Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Loading from text file (MMF2)


Blue Frenzy

Recommended Posts

I have some wrong events here. I have a file on txt format, and i want to read its values. There is an unknow numbre of objects. Each object has some data.

The way I organize it on txt is like this:

-each data is separated by " * "

-each object is separated by " ¡ "

-File end is marked by " $ "

so, i have something like this:

0*15000*96*128*-1*0*¡0*18750*96*128*-1*1*¡0*20600*96*128*-1*
1*¡0*21750*64*128*-1*0*¡0*22250*152*128*-1*0*¡0*22500*152*128*-1
*0*¡0*25550*88*24*-1*0*¡0*25800*88*56*-1*0*¡0*26250*88*56*-1*0*¡0*
26900*88*56*-1*0*¡0*28100*168*232*-1*1*¡0*28300*168*232*-1*0*¡0*28850*
136*200*-1*0*¡0*29400*96*128*-1*1*¡0*29750*96*128*-1*0*¡0*30000*
128*128*-1*0*¡0*30250*128*128*-1*0*¡0*30750*64*128*-1*0*¡

NOTE: on screenshots appears the " ! " symbol instead " ¡ " but now it is fixed, still doesnt work.

I store each value in some list objects. so, in list 1, it stores the first value. In list 2 it stores the 2nd value, etc... so, each line is a different object and each list is a different value.

NOTE 2: Note that not always the 5th value appears so, if there is no 5th value i put a value 0 on the list.

NOTE 3: there are 2 counters, one stores the value, and the other stores the current data position, so, if counter is = 2, it means i have to add the value to the 3rd field. each " * " means a different field so I add one to the counter and reset the first counter to store a new value.

well, it doesn't work. It just appears an unique "0"

Here is the code.

wrongeventsgg1.jpg

any help on finding what could be wrong?

Link to comment
Share on other sites

I believe MMF gets upset if the loop length grows above 100.

I agree with gsoft on using arrays, though maybe if you divide the big "load" loop into smaller loops MMF might actually do the process correctly. *shrugs*

Btw, instead of saying to directly check the character number equal to the loop index of "load", did you try setting a counter to the loop index of "load" and then using the value of the counter to compare what character to look at? I believe that strangely fixed a problem for me once.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...