Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 552 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: please make it possible to change entity.string1 / 2 [Re: Superku] #451886
05/25/15 09:42
05/25/15 09:42
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
string1/2 can be modified - nothing evil will happen (I hope). You only must be aware that they are char* pointers, so they do not store a string content, but only its pointer.

Re: please make it possible to change entity.string1 / 2 [Re: Superku] #451888
05/25/15 10:03
05/25/15 10:03
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Thanks guys for all the replies;

Originally Posted By: WretchedSid
Of course, all of this is going to break the second the strings are used internally. Or hashed and that hash is used internally.
, but the wmb compiler saves the entity.strings, the manual points this out itself, maybe I misinterpreting your comment.


Originally Posted By: Superku
I see two separate questions/ things in this thread/ OP. The first thing is to be able to modify string1/2, but as stated by others you can just create a string and save it in one of the 100 skills.
, only 20 skills are saved for wmb, I already use 2 of them (1 for alpha value cause wmb does not save this >> , and 1 for ID), so I want to leave others alone.
Leave the skills alone grin <bad joke>.

Originally Posted By: Superku
second thing is that you want to attach 2 actions to your entities because of editor/ ingame differences. Alternatively, I think it would be a better way to save additional data in a *.txt file from which you then load map editor related actions for each entity if necessary (and suppress the execution of the actual entity action).
, well this is something I am still pondering about what is the best solution. My idea was to set the editor action through ent_create since the game action does not yet exist at that time, cause its not the game script. So I thought I would let the user being able to type/c&p the wanted entity action string so it can be saved into the entity.string1 . Than the user can add the editor action in his script and from there:
- call the right game script action/function (saved into entity.string1) or based of maybe the enttiy's ID. Or ent_filename for the slow approach.
- return;

But I see some flaws with this. One is adding extra mess to the user's script (though I doubt if this can be solved). But mainly this puts up a limit of max entities based on the max function/action limit. So I am thinking about removing the whole editor action dependence all together and replace it with 1 function that check ents through ent_next and mouse_ent for click/touch events. Than just add a dummy entity action pure for this user to acces the entity in game script and give it a new (/ the right) action.

ps: is there an elegant line that runs a function for an entity based on a string?

-edit, just saw your response JCL, thanks for replying.
Quote:
string1/2 can be modified - nothing evil will happen (I hope). You only must be aware that they are char* pointers, so they do not store a string content, but only its pointer.
, so its useless for saving to wmb?

Last edited by Reconnoiter; 05/25/15 10:04.
Page 2 of 2 1 2

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