Couple of questions here
Displaying 1-2 of 2 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
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


Displaying 1-2 of 2 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.