|
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn),
581
guests, and 0
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
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
Enduriel
OP
Member
|
OP
Member
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
Expert
|
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 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
Enduriel
OP
Member
|
OP
Member
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  appreciated! I'll still wait a dev to answer this post though!
|
|
|
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
Expert
|
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
Enduriel
OP
Member
|
OP
Member
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,209 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,209
İ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
|
|
|
|