Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,534 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
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
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
How can I apply an action to an entity after ent_create?
I mean it like here:
Code:
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 wink
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 Offline
Senior Expert
Quad  Offline
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: Quad] #261274
04/16/09 16:13
04/16/09 16:13
Joined: Apr 2009
Posts: 138
Germany
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
my problem is that every bullet can have another speed. i don't know how to make this, i don't want to make a new action for every speed wink

Last edited by Toryno; 04/16/09 16:14.

Thanks for reading, thinking, answering wink
Re: apply an action to an entity after it has been created [Re: Toryno] #261277
04/16/09 16:23
04/16/09 16:23
Joined: Apr 2009
Posts: 138
Germany
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
Ah i found an other way ;D


Thanks for reading, thinking, answering wink
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
D
DiegoFloor Offline
Junior Member
DiegoFloor  Offline
Junior Member
D

Joined: Jan 2009
Posts: 86
Brasil - RS
Quote:
Ah i found an other way ;D


Wich is..? smile

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 Offline
Senior Expert
Pappenheimer  Offline
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.

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1