Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
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 (degenerate_762, AndrewAMD), 877 guests, and 5 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
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,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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