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
2 registered members (AndrewAMD, dpn), 1,328 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Possible to return an " action " name to a " STRING* " ? #269819
06/04/09 18:58
06/04/09 18:58
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
E
Enduriel Offline OP
Member
Enduriel  Offline OP
Member
E

Joined: Aug 2008
Posts: 133
Sweden, Stockholm
Hello devteam!

I have a small problem, I'm working on my own in-game editor for an RPG where I can control the events and conversations through it.

But to save out my own "level" files I need to somehow return an "action" name assigned to an entity to a " STRING* ".
Example: If player has action act_player(), then I want to return it to STRING* str_temp so it contains "act_player".

Is there a way to do this? If not, could it be implemented as I really need this?

Thanks in advance!

Last edited by Enduriel; 06/04/09 18:59.
Re: Possible to return an " action " name to a " STRING* " ? [Re: Enduriel] #269837
06/04/09 20:09
06/04/09 20:09
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I dont know how managable that would be, because its possible, and quite common, for an entity to have multiple
actions attached to it at the same time. How could that be handled?

You say its in YOUR editor right?
So are YOU(or your code at least) assigning the actions to the entities?
If so, when you assign the action, cant you save the action name into a spare skill of that entity at the same time?
Say, at the start of the action itself?
eg
Code:
action player_act()
{
   wait(1);
   my.skill25 = str_create("player_act");
   ...



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Possible to return an " action " name to a " STRING* " ? [Re: EvilSOB] #269851
06/04/09 20:55
06/04/09 20:55
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
E
Enduriel Offline OP
Member
Enduriel  Offline OP
Member
E

Joined: Aug 2008
Posts: 133
Sweden, Stockholm
Right now, when I right click ---> add model in my own editor, it just creates the chosen model with ent_create, and assigning NULL as an action.

So basicly, what I need is assigning an action after it has been created. What I came up with is whenever I assign a NEW action to the entity in the editor, I just store its flags, skills, pos etc and then ent_remove(selected), and then recreate it with the chosen action with ent_create to see the change in real-time.

But I had trouble returning the action name to a string for saving purposes. Your method will work and is same as what Slin suggested, though it also needs typecasting ^^, I could use skill[99] for it ^^

But is there a way maybe through some engine commands to return it? Otherwise I guess I'll have to spend a skill :P

Thanks for the help btw laugh appreciated! I'll still wait a dev to answer this post though!

Re: Possible to return an " action " name to a " STRING* " ? [Re: Enduriel] #269930
06/05/09 09:20
06/05/09 09:20
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The action name can't be returned because the action is nowhere stored in the entity. An entity action is just a normal function with the only exception that the "me" pointer is set to that entity.

What I could do is implementing a function that returns a name for a function address, f.i.

char* name = engine_getfunctionname(player_act);

Would that help?

Re: Possible to return an " action " name to a " STRING* " ? [Re: jcl] #269952
06/05/09 10:04
06/05/09 10:04
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
For me, that does actually sound useful... Yes please.

Also please a matching function that returns the address of a function given by name. F.I
long act_addr = engine_getfunctionAddr(player_act);
(assuming one doesnt already exist, I havent looked)



"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Possible to return an " action " name to a " STRING* " ? [Re: EvilSOB] #270322
06/07/09 18:03
06/07/09 18:03
Joined: Aug 2008
Posts: 133
Sweden, Stockholm
E
Enduriel Offline OP
Member
Enduriel  Offline OP
Member
E

Joined: Aug 2008
Posts: 133
Sweden, Stockholm
i've noticed that using shift+F11 displays the action name in the watched string, wouldn't this suggest that the action string already exists?

many thanks
Enduriel

Example:



Last edited by Enduriel; 06/07/09 18:17.
Re: Possible to return an " action " name to a " STRING* " ? [Re: Enduriel] #270333
06/07/09 18:34
06/07/09 18:34
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
maybe, maybe not. afaik shift+f11 panel and ctrl+f11 views are not lite-c code. it's implemented in the engine itself.

but ofc, that nay give some hints to JCL

Last edited by Quadraxas; 06/07/09 18:34.

3333333333
Re: Possible to return an " action " name to a " STRING* " ? [Re: Quad] #270399
06/08/09 07:00
06/08/09 07:00
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The engine displays the action name by checking all currently running actions and finding in which one "me" is the entity pointer. This is not necessarily the original entity action. You can make any function to an action by setting the "me" pointer.

But I'll implement the engine_getfunctionname function. The reverse function is already there.


Moderated by  old_bill, Tobias 

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