hi guys, i'm trying to make a level editor by storing all the info in a simple txt file, but not using a ini. I'm trying to figure out how string parser 2 works but it's kinda hard.
for example, let's say I have this text in a file.
object115-id=barril,xpos=100,ypos=100
i want mmf to identify this "object115" as a group, then load the ID, XPosition and YPosition.
I'm quite sure that string parser can do that, i just have no idea how.
and I want MMf to identify everything that is separated by "-" as elements when I need to and then when I select one of those elements, separate them again with "|".
well, I found a way, don't know if its the better way but will do for now, until someone tell me if there's a easier way to do what I'm doing.
I have this:
object1|barrel|100|35-object3|candle|40|40-object8|candle|40|90
so I put this event:
by pressing "space" do the follow:
set stringparser delimiter to "-",
set "element loader string" to element 2,
set source string to "element loader string",
set stringparser delimiter to "|",
set "result string" to element 2.
this in one line of event, the result string would return me "Candle"
Doing this I wandered if there's a easy way to find elements. like: search element N with delimiters "x", instead to have to set the delimeter and then search for the element.
use a fastloop and the string parser together to run a search, and compare the current value in string parser to the search value. use str$() and val() accordingly.