|
please make it possible to change entity.string1 / 2
#451841
05/23/15 13:03
05/23/15 13:03
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Hi JCL and co, It would be really nice if entity.string1 and entity.string2 could be changed realtime. I am making a realtime map editor and it would be nice to save 2 actions/strings; 1 for in the editor itself (also for the entity action when opening a saved map in the editor) and 1 for the game (script). But the manual points out the it is read-only. entity.string1 ... entity.string2 Two general-purpose 32 character strings. Can be set by WED's entity properties panel and can be read in the script by the str_cpy or str_cat functions, but must not be altered. Type: char* pointer, read-only Is it possible to bypass the read-only thingy? Thanks in advance.
|
|
|
Re: please make it possible to change entity.string1 / 2
[Re: Ch40zzC0d3r]
#451850
05/23/15 18:52
05/23/15 18:52
|
Joined: Mar 2011
Posts: 3,150 Budapest
sivan
Expert
|
Expert
Joined: Mar 2011
Posts: 3,150
Budapest
|
if you need to store data on creating a wmb, I use it in MapBuilder, just save the info in the editor into a skill over 20 (the 1st 20 skills are saved into wmb), then get the string when you write the 2 strings into the new wmb. check my source, it is easy (I use it for storing decal shadow file name needed for free/extra license users).
Last edited by sivan; 05/23/15 18:53.
|
|
|
Re: please make it possible to change entity.string1 / 2
[Re: sivan]
#451864
05/24/15 10:01
05/24/15 10:01
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
OP
Serious User
|
OP
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Thanks for all the quick responses; You can use a entity skill as a string too , true but that would be sacrificing 1 one of the 20 skills the user otherwise can use for e.g. stats like hit points to save in a .wmb map file. Forget the read only stuff... Nothing in memory is really read-only (just when the process constantly writes to the address which is not the case here). So you either just call str_cpy and if it fails you can use VirtualProtect to change the page protections because it might be protected (ReadOnly). , oh nice, ty for the tip. if you need to store data on creating a wmb, I use it in MapBuilder, just save the info in the editor into a skill over 20 (the 1st 20 skills are saved into wmb), then get the string when you write the 2 strings into the new wmb. check my source, it is easy (I use it for storing decal shadow file name needed for free/extra license users). , with source you mean your Map Builder source? I try to download it but both the mirrors don't work. But why actually not directly save the string into entity.string?
|
|
|
Re: please make it possible to change entity.string1 / 2
[Re: txesmi]
#451872
05/24/15 18:14
05/24/15 18:14
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Of course, all of this is going to break the second the strings are used internally. Or hashed and that hash is used internally.
Has none of you guys mothers told you that you don't just walk into your neighbours house and take their bread? You keep your grabby fingers off of memory that isn't yours.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: please make it possible to change entity.string1 / 2
[Re: FBL]
#451877
05/24/15 21:50
05/24/15 21:50
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Rumour has it there is a ghost still living there, not being able to find a final resting place. Also, don't eat moldy bread found in your neighbours rotten house. Chances are that the stuff growing on it is not in fact penicillin.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
|