Visualizza messaggio singolo
  #65 (permalink)  
Vecchio 22nd July 2008, 15:31
Goobers Goobers non  è collegato
Member
 
Data registrazione: Oct 2007
Messaggi: 72
Potenza rep: 2
Goobers è su una strada distinta
okay... i'm pretty confused about the pointers and stuff in the wiki... so i'm gonna make this simple... probably cause it's 5 am and i haven't slept yet.

this is my code:
_C1 Items
_L 0x80640240 0x01F40058
_L 0x00000031 0x00000000
_L 0x80640244 0x01F40058
_L 0x00000001 0x00000000
_L 0x8064024C 0x01F4002C
_L 0x10000001 0x00000001
_L 0x80640250 0x01F40058
_L 0x00000004 0x00000000

but, i want it to go to 640240 and first check if there is ALREADY some value there... if there is, don't change anything but increment the address until it DOESN'T find any value (other than 00)... then proceed with the code. as if that was the starting point. however, it WILL decrement the other counter (1F4 in this case) by however many times it had to skip.

again, lets keep it simple... say it had to skip once... so the code ends up like:

_C1 Items
_L 0x80640298 0x01F30058
_L 0x00000031 0x00000000
_L 0x8064029C 0x01F30058
_L 0x00000001 0x00000000
_L 0x806402A4 0x01F3002C
_L 0x10000001 0x00000001
_L 0x806402A8 0x01F30058
_L 0x00000004 0x00000000

i realize that it basically looks like it just skipped the first iteration, but you'll notice that in he 5th and 6th lines:

_L 0x806402A4 0x01F3002C
_L 0x10000001 0x00000001

didn't become

_L 0x806402A4 0x01F3002C
_L 0x10000002 0x00000001

as it would've if it was an actual iteration. of course, it also gets messy if you DO want it to change (in otherwords a "skip" in iteration as if the first one went through).

to give an idea of what i want to do... lets say i have 5 slots... and i want to add 5 swords (each level from 1 to 5)

if i didn't have any items it would come out like:
sword 1
sword 2
sword 3
sword 4
sword 5

but if i had say two shields (level 1 and 2), then it'll be:
shield 1
shield 2
sword 1
sword 2
sword 3

there's a whole other complication about if i had a sword 1 and i added the "five" swords, making sword [1, 1, 2, 3, 4]... but that's another issue i'll leave for later.
Rispondi citando