ErayMan
|
1. Is there a way to set in a variable the position of an entity in tile?
2. When you switch map, is the global variable stay as they were, or they're erase? And the local?
3. How can I make something happens randomly ( well not when ya step in a zone placed in maped, but, for example, put a random number between 1 - 10 into a variable ) ?
thanks
-ErayMan
Posted on 2000-12-22 00:08:51
|
andy
|
1. Yes.
myvariableX=entity.tx[index];
myvariableY=entity.ty[index];
You can set entity.tx and entity.ty in a similar fashion, as long as you do it like so:
entity.tx[index]=myvariableX;
entity.ty[index]=myvariableY;
entity.x[index]=entity.tx[index]*16;
entity.y[index]=entity.ty[index]*16;
The 'why' is a little complicated, so I'll spare ye. Suffice to say that it works. ^_^
2. Global variables change in these situations: (a) You set them yourself. ;) (b) ReadVars (c) Shutting VERGE down. That's it. local variables are destroyed when a function is finished, so they're gone. ;)
3. You can.
myvariable=random(number); // myvariable is now some number between 0 and number-1
if (myvariablesomenumber)
{
Dorandomthing();
}
'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald
Posted on 2000-12-22 01:13:11
|