getting ent indexes
Displaying 1-3 of 3 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
jrhee

Is there any way to get the index of an entity when you activate it on a map? So, for example, if I were to have my player "speak" to an NPC, how can I get the NPC's index so I can stop it from wandering about while it's textbox-ing?

Posted on 2006-07-28 15:58:12

Overkill

There is an event.entity, which (I think) refers to the entity which was "spoken to".

So you could go like this your system code:

int entity_speed[256];
void EntityPause(int ent)
{
if (entity.speed[ent])
{
entity_speed[ent] = entity.speed[ent];
entity.speed[ent] = 0;
}
}

void EntityUnpause(int ent)
{
if (entity_speed[ent])
{
entity.speed[ent] = entity_speed[ent];
entity_speed[ent] = 0;
}
}


Using functionality in your map event:

void TalkToSomeDude()
{
EntityPause(event.entity);
Textbox("blah blah blah");
EntityUnpause(event.entity);
}

Posted on 2006-07-28 18:24:48 (last edited on 2006-07-28 18:25:03)

jrhee

Perfect, thanks!

Posted on 2006-07-30 22:13:59


Displaying 1-3 of 3 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.