4 registered members (ozgur, Ayumi, VHX, monarch),
1,161
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
apply an action to an entity after it has been created
#261267
04/16/09 15:57
04/16/09 15:57
|
Joined: Apr 2009
Posts: 138 Germany
Toryno
OP
Member
|
OP
Member
Joined: Apr 2009
Posts: 138
Germany
|
How can I apply an action to an entity after ent_create? I mean it like here:
ent_create("bullet.mdl",my.x, NULL);
wait(1);
set(my, PASSABLE);
my.pan = temp_pan;
my.tilt = temp_tilt;
my.action = fly; // this doesn't work, but how must it be written!?
Thanks for reading, thinking, answering
|
|
|
Re: apply an action to an entity after it has been created
[Re: Toryno]
#261269
04/16/09 16:03
04/16/09 16:03
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
|
ent_create("bullet.mdl",my.x, NULL);
instead of NULL, you write your actions name.
3333333333
|
|
|
Re: apply an action to an entity after it has been created
[Re: Toryno]
#261745
04/19/09 21:01
04/19/09 21:01
|
Joined: Jan 2009
Posts: 86 Brasil - RS
DiegoFloor
Junior Member
|
Junior Member
Joined: Jan 2009
Posts: 86
Brasil - RS
|
Ah i found an other way ;D Wich is..? I would really like to be able to pass some parameters with the action, like a function, when creating entities.
|
|
|
Re: apply an action to an entity after it has been created
[Re: DiegoFloor]
#261749
04/19/09 21:42
04/19/09 21:42
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
Probably such a way:
Define _bullet_speed, skill99;
action bullet() { ent_move(...my._bullet_speed....) }
function shooting() { you = ent_create(..., bullet)//This is the important part where you get the pointer to the created entity you._bullet_speed = 20; ....
Last edited by Pappenheimer; 04/19/09 21:45.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|