Mirage Source
Loading Up.. - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Loading Up.. (/showthread.php?tid=2403)



Loading Up.. - Tony - 26-11-2008

Problem: Doesn't load up (or save) individually as a different number

Code:
DefaultMove(1 To 3) As Byte
    
    LearnMove(1 To 10) As Byte
    LearnLevel(1 To 10) As Byte

Code:
For i = 1 To 3
        Pokemon(n).DefaultMove(i) = Val(Parse(9))
    Next i
    
    For i = 1 To 10
        Pokemon(n).LearnMove(i) = Val(Parse(10))
        Pokemon(n).LearnLevel(i) = Val(Parse(11))
    Next i



Re: Loading Up.. - William - 26-11-2008

Where did you put:

Code:
DefaultMove(1 To 3) As Byte
  
    LearnMove(1 To 10) As Byte
    LearnLevel(1 To 10) As Byte



Re: Loading Up.. - Tony - 27-11-2008

in my PokémonRec

Is it because I can't send my packets this way?

Quote:With Pokemon(PokemonNum)
For I = 1 To 3
For n = 1 To 10
Packet = "SAVEPOKEMON" & SEP_CHAR & PokemonNum & SEP_CHAR & Trim(.Name) & SEP_CHAR & .Sprite & SEP_CHAR & .spritesheet & SEP_CHAR & .Type1 & SEP_CHAR & .Type2 & SEP_CHAR & .Evolve & SEP_CHAR & .EvolveLevel & SEP_CHAR & .DefaultMove(I) & SEP_CHAR & .LearnMove(n) & SEP_CHAR & .LearnLevel(n) & SEP_CHAR & END_CHAR
Next n
Next I
End With



Re: Loading Up.. - Mattyw - 27-11-2008

TonyNooblet Wrote:in my PokémonRec

Is it because I can't send my packets this way?

Quote:With Pokemon(PokemonNum)
For I = 1 To 3
For n = 1 To 10
Packet = "SAVEPOKEMON" & SEP_CHAR & PokemonNum & SEP_CHAR & Trim(.Name) & SEP_CHAR & .Sprite & SEP_CHAR & .spritesheet & SEP_CHAR & .Type1 & SEP_CHAR & .Type2 & SEP_CHAR & .Evolve & SEP_CHAR & .EvolveLevel & SEP_CHAR & .DefaultMove(I) & SEP_CHAR & .LearnMove(n) & SEP_CHAR & .LearnLevel(n) & SEP_CHAR & END_CHAR
Next n
Next I
End With

Code:
& SEP_CHAR & END_CHAR

What?


Re: Loading Up.. - Tony - 27-11-2008

What about it?..


Re: Loading Up.. - Coke - 27-11-2008

What the hell are you doing to that poor packet?!


Re: Loading Up.. - Tony - 27-11-2008

Fox Wrote:What the hell are you doing to that poor packet?!

Waah1?!!? So so so I would have to type it out 1 to 10?


Re: Loading Up.. - Coke - 27-11-2008

I can see what you are doing,

If you MUST do it that way at least put the loop outside of the packet event procedure, have the loop where the packet event proc~ is called and just feed the variable into it.


Re: Loading Up.. - Kraft - 27-11-2008

Code:
Dim i As Long
Dim n As Long

   Packet = "SAVEPOKEMON" & SEP_CHAR & PokemonNum & SEP_CHAR & Trim(Pokemon(PokemonNum).Name) & SEP_CHAR & Pokemon(PokemonNum).Sprite & SEP_CHAR & Pokemon(PokemonNum).spritesheet & SEP_CHAR & Pokemon(PokemonNum).Type1 & SEP_CHAR & Pokemon(PokemonNum).Type2 & SEP_CHAR & Pokemon(PokemonNum).Evolve & SEP_CHAR & Pokemon(PokemonNum).EvolveLevel & SEP_CHAR

    For I = 1 To 3
       Packet = Packet & Pokemon(PokemonNum).DefaultMove(I) & SEP_CHAR
    Next I
    For n = 1 To 10
       Packet = Packet & Pokemon(PokemonNum).LearnMove(n) & SEP_CHAR & Pokemon(PokemonNum).LearnLevel(n)
    Next n

    Packet = Packet & END_CHAR
    SendData(Packet)
Fixed... I guess.


Re: Loading Up.. - William - 27-11-2008

Just put a "sendata packet" below this:

Code:
Packet = "SAVEPOKEMON" & SEP_CHAR & PokemonNum & SEP_CHAR & Trim(.Name) & SEP_CHAR & .Sprite & SEP_CHAR & .spritesheet & SEP_CHAR & .Type1 & SEP_CHAR & .Type2 & SEP_CHAR & .Evolve & SEP_CHAR & .EvolveLevel & SEP_CHAR & .DefaultMove(I) & SEP_CHAR & .LearnMove(n) & SEP_CHAR & .LearnLevel(n) & SEP_CHAR & END_CHAR



Re: Loading Up.. - Kraft - 27-11-2008

William Wrote:Just put a "sendata packet" below this
Guess this is not what he needs. He wants to save an edited Pokémon.
Lots of DefaultMove(), LearnMove() and LearnLevel() in only ONE Pokémon (and packet).
The code I posted does it.

Sorry for bad English.


Re: Loading Up.. - GIAKEN - 27-11-2008

Fox Wrote:What the hell are you doing to that poor packet?!

Haha I lol'd.


Re: Loading Up.. - Matt - 27-11-2008

Kraft hit it on the head.


Re: Loading Up.. - Kraft - 27-11-2008

Perfekt Wrote:Kraft hit it on the head.
Sorry, but what does it means? Tongue


Re: Loading Up.. - Tony - 27-11-2008

Fox Wrote:I can see what you are doing,

If you MUST do it that way at least put the loop outside of the packet event procedure, have the loop where the packet event proc~ is called and just feed the variable into it.

But wouldn't that be sending amounts of packets?


Re: Loading Up.. - Coke - 27-11-2008

Looked like that was what you were doing until Kraft cleaned it up.


Re: Loading Up.. - Tony - 27-11-2008

Fox Wrote:Looked like that was what you were doing until Kraft cleaned it up.

Didn't understand The "For" command as much as I do right now ">.>

Is this the proper way to receive it

Quote:For i = 1 To 3
Pokemon(n).DefaultMove(i) = Val(Parse(i + 8))
Next i

For i = 1 To 10
Pokemon(n).LearnMove(i) = Val(Parse(i + 9))
Pokemon(n).LearnLevel(i) = Val(Parse(i + 10))
Next i

edit;
Code:
For i = 1 To 3
        Pokemon(n).DefaultMove(i) = Val(Parse(i + 8))
    Next i
    
    For i = 1 To 10
        Pokemon(n).LearnMove(i) = Val(Parse((i * 2) + 11))
        Pokemon(n).LearnLevel(i) = Val(Parse((i * 2) + 11))
    Next i



Re: Loading Up.. - Matt - 28-11-2008

Kraft Wrote:
Perfekt Wrote:Kraft hit it on the head.
Sorry, but what does it means? Tongue

Means you hit the nail on the head perfectly. You showed him exactly what was wrong with his code. Big Grin


Re: Loading Up.. - Kraft - 28-11-2008

Perfekt Wrote:
Kraft Wrote:Sorry, but what does it means? Tongue
Means you hit the nail on the head perfectly. You showed him exactly what was wrong with his code. Big Grin
Oh, I see!
Glad it's good stuff. Thank you! Tongue


Re: Loading Up.. - Tony - 28-11-2008

Me too