creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
General Forum
old
setv question   
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  3/9/2009

When you set a variable using setv, is it possible to set it to be, say, 13 (bug) OR 3 (seed)? Or do you have to use a DOIF to first do the coding for the 13, but then say if you don't see (ESEE?) any 13s, then setv to 3?

My TCR Norns
 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  3/9/2009

I don't think it would be possible to do it without adding *something* to tell the game when to use 3 instead of 13, or vice-versa; I believe you actually need something along the lines of the ESEE statement you mentioned above, or (from my experience) the value that was mentioned first will be used every time.

Or alternately you could set it to assign one of the two numbers to the variable randomly, using something like this:

setv va00 rand 1 2
doif va00 eq 1
setv ov00 13
else
setv ov00 3
endi



 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  3/10/2009

Of course, when I say OR, I mean AND... oops. :( I want this critter to eat both bugs and seeds.

My TCR Norns
 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  3/10/2009

Oh, I get it.

If you're using a DOIF statement to determine whether an object is edible for your critter, you could use something like this:

DOIF rtyp room targ eq 5 OR rtyp room targ eq 7

This is grabbed right out of my Tulu moonflower's timer script; it determines whether a moonflower seed can sprout or not. The seed can use either of two room types, although it's possible to add any number of conditions by just tacking an "OR" and a new condition onto the end. You do have to type out the entire command all over again for each new condition; as above, I put "DOIF rtyp room targ eq 5 OR rtyp room targ eq 7". Putting "DOIF rtyp room targ eq 5 OR 7" doesn't work.



 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  3/13/2009

Is it possible to set a va## randomly to 13 or 3 by "setv va48 rand 13 or 3"? Is that a valid statement?

My TCR Norns
 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  3/14/2009

Not that I'm aware of... or at least if it does I haven't gotten it to work. But you can get the same result this way:

setv va00 rand 1 2
doif va00 eq 1
setv va## 13
else
setv va## 3
endi



 


downloads
cobs
adoptions
creaturelink
metarooms
breeds
 
gallery
art
wallpaper
screenshots
graphics
promos
sprites
dev
hack shack
script reservations
dev resources
active projects
dev forum
 
community
links
advice
chat
polls
resources
creatchi
 
forum
bookmarks
general
news
help
development
strangeo
survivor
mycaves
log in
register
lost pw
0 online
creatures caves is your #1 resource for the creatures artificial life game series: creatures, creatures 2, creatures 3, docking station, and the upcoming creatures family.

contact    help    privacy policy    terms & conditions    rules    donate    wiki