Entity Question

Posted By: 48th_Ronin

Entity Question - 01/06/09 03:30

if I define a entity example:

entity* megan_fox;

and make a action:

action sel_player {

megan_fox = my;

my.skill5 = 100;

}

1) does that make everything within the quotations marks megan_fox when i use my,

2) say I create a action weapon() in another wdl. for instance

action weapon {

while (1)
{
if (my.skill5 > 0 ) {wait(1);}

c_trace(megan_fox.x, enemy.x, ignore_me | ignore_passable);

if (you == enemy)
{
status_txt.string = "SEES ENEMY!";
enemy.invisible = off;
}
else
{
if (you != enemy ){
status_txt.string = "ALL CLEAR!";
enemy.invisible = on;
}
}
status_txt.visible = on; // show the text
sleep (1); // for 1 second

}
}

I put the action weapon() within the megan_fox action, will the action know megan_fox = my or do I need to include it again in the weapon() action or change my.skill51 to megan_fox.skill51



Posted By: MrGuest

Re: Entity Question - 01/07/09 02:00

hey,

1) if something is given an action, that action will then respond to me commands, (e.g my.pan += 100;)

2) if you're not applying the action in WED then declare it as a function, and pass the me variable
so use
Code:
function weapon(ent){
me = ent;
... //blah blah
}

action sel_player{
//blah again
weapon(me);

Posted By: heinekenbottle

Re: Entity Question - 01/07/09 05:36

The "my" pointer is a local pointer. "My" points to the entity which is attached to the action (either in WED or through ent_create). Both entities can use "my" without interfering with each other.

So if you have two entities, one with the action "sel_player" and the other with the action "weapon()," you can simply use "my."
© 2023 lite-C Forums