Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Nymphodora), 485 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Copy the Action-name #408112
09/25/12 15:42
09/25/12 15:42
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline OP
Senior Member
sebbi91  Offline OP
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
Hi Community,

I want to to duplicate (copy) an Entity.

I want something like that:
Quote:

....
act_name_ent=you.action_name;
ent_create("tmp.mdl",create_pos,act_name_ent);
....


I know, that this is not possible, I tried something like reading the name from an infofile and fill a String with it.
Like that:

Quote:

....
STRING* act_name_ent= "";
....
//open the file and replace "" with "your_action" (ACTION your_action())

ent_create("tmp.mdl",create_pos,act_name_ent);
....


But all I've got is Error E1513.

There is no other way!
I need to get the Action-Name from the scanned Entity.

Is there anyone who can solve this?
Thanks in advance!

Best regards
Sebbi


3D-Gamestudio A8 - Commercial
Re: Copy the Action-name [Re: sebbi91] #408113
09/25/12 16:13
09/25/12 16:13
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
you can either store some function pointer in a skill or you can use engine_getscript to get the action/function by name

the first one works like this:

ent = ent_create([...], myaction);
ent.actionptr = myaction;
[...]
you = ent_create(ent.type, ent.x, ent.actionptr);

the second one:

ent = ent_create([...], myaction);
ent.string1 = "myaction";
[...]
you = ent_create(ent.type, ent.x, engine_getscript(_chr(ent.string1))); // EDIT: Too dumb to write correct cody, sorry!

Last edited by MasterQ32; 09/25/12 17:42. Reason: Just forgot the most important part... :)

Visit my site: www.masterq32.de
Re: Copy the Action-name [Re: MasterQ32] #408116
09/25/12 17:25
09/25/12 17:25
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
you evencan use engine_getscript, and let the action parameter of ent_create NULL.
Now just give the action name to the entity with:
pointer.event = the engine_getscript_function.


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<

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