Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Peforming a string?

Author
Message
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 26th Jun 2009 18:45
Hi! I'm currently working on loading maps for my map editor and the way i export the map is to go through each object and export the object number, file, position, and rotation in this format:

so that it can be copied and pasted directly into VC++. But I'm a bit stumped on how to load this. I know in Game Maker there is a perform string function, and what i'm looking for is something like that, but i can't find it. For now i'll settle with saving a text file as shown above and another one with only values. Thanks!

AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 26th Jun 2009 18:58
Are you asking if it's possible to execute the functions in a string? If so then yes, but it would take a lot of parsing and wouldn't really be worth it. You're better off just exporting the position, angle, and file name, then reading that info in and setting it up in your game.

i like orange
prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 26th Jun 2009 19:18 Edited at: 26th Jun 2009 19:18
No you can't execute actions into C++ code (no eval() in c++) due to it being a compiled language. If you split the function into its parts and check them from a known list of commands, yes then it is possible.


Your signature has been erased by a mod
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 26th Jun 2009 19:19
Ok so it's possible but hard and annoying (i hate strings...). I'll just do it the simple way. Thanks!

Login to post a reply

Server time is: 2024-11-25 08:31:05
Your offset time is: 2024-11-25 08:31:05