Registrarse

script que se repite en una parte.

Estado
Cerrado para nuevas respuestas.

Jordithc7

Usuario de platino
Bueno tengo un pequeño problema con este dichoso script...
el problema surge que cuando lo copilo guardo pongo la partida llega a la parte de darme el pokemon me da 3 pokemon y me dice 3 veces si quiero poner el mote...
total luego abro el script y sale 3 ves givepokemon.. es un bug de mi rom?

Aqui el script normal (no mires los textos que no estan bien escritos xD):
#dynamic 0x800000

#org @sjo1
checkflag 0x202
if 0x1 goto @des
lock
faceplayer
msgbox @tex 0x6
applymovement 0x2 @mov
waitmovement 0x2
applymovement 0x3 @mov1
waitmovement 0x3
msgbox @tex1 0x6
applymovement 0x3 @mov2
waitmovement 0x3
hidesprite 0x3
setflag 0x203
msgbox @tex2 0x6
msgbox 0x88011BF MSG_YESNO '"¿Quieres a Meleon tipo planta?"
compare LASTRESULT 0x1
if 0x1 goto 0x8801221
msgbox 0x88011E0 MSG_YESNO '"¿Quieres a Blazgo tipo fuego?"
compare LASTRESULT 0x1
if 0x1 goto 0x880123D
msgbox 0x8801200 MSG_YESNO '"¿Quieres a Flinflix tipo Agua?"
compare LASTRESULT 0x1
if 0x1 goto 0x8801259
msgbox 0x88011BF MSG_YESNO '"¿Quieres a Meleon tipo planta?"
compare LASTRESULT 0x1
if 0x1 goto 0x8801221
msgbox 0x88011E0 MSG_YESNO '"¿Quieres a Blazgo tipo fuego?"
compare LASTRESULT 0x1
if 0x1 goto 0x880123D
msgbox 0x8801200 MSG_YESNO '"¿Quieres a Flinflix tipo Agua?"
compare LASTRESULT 0x1
if 0x1 goto 0x8801259
msgbox 0x88011BF MSG_YESNO '"¿Quieres a Meleon tipo planta?"
compare LASTRESULT 0x1
if 0x1 goto 0x8801221
msgbox 0x88011E0 MSG_YESNO '"¿Quieres a Blazgo tipo fuego?"
compare LASTRESULT 0x1
if 0x1 goto 0x880123D
msgbox 0x8801200 MSG_YESNO '"¿Quieres a Flinflix tipo Agua?"
compare LASTRESULT 0x1
if 0xC2 goto 0xD5E0E3



'---------------
#org 0x801221
givepokemon 0x1 0x1 0x0 0x0 0x0 0x0
msgbox @mote 0x5
compare LASTRESULT 0x1
if 0x1 goto @simote
special 0x16F
setflag 0x202
setflag 0x828
setvar 0x4049 0x1
end

#org 0x80123D
givepokemon 0x1 0x1 0x0 0x0 0x0 0x0
msgbox @mote 0x5
compare LASTRESULT 0x1
if 0x1 goto @simote
special 0x16F
setflag 0x202
setflag 0x828
setvar 0x4049 0x1
end

'---------------
#org 0x801259
givepokemon 0x1 0x1 0x0 0x0 0x0 0x0
msgbox @mote 0x5
compare LASTRESULT 0x1
if 0x1 goto @simote
special 0x16F
setflag 0x202
setflag 0x828
setvar 0x4049 0x1
end

#org @simote
Special 0x9E
special 0x16F
setflag 0x202
setflag 0x828
setvar 0x4049 0x1
end

'---------
' Strings
'---------
#org @tex
= Hola hijo que haces aqui?\n?como? ya llego el dia? !ups¡\lse me habia pasado con tanto\ltrabajo.Bueno desafortunadamente\lraparti todos los POKéMON y\lPOKéDEX que tenia...

#org @tex1
= Mensajero: Hola, la profesora\nCarmen?\lProf.Carmen: Si soy yo.\lMensajero: le traigo un paquete de\lsu marido, firme aqui.\lTenga buen dia.\l

#org @tex2
= Prof.Carmen: Mmm veamos que envio,\n¡oh! son tres nuevas especies de\lPOKéMON! bueno como no me quedan\lPOKéMON y tu te tienes que ir, te\ldare uno de estos asi me ayudas\lcon mi investigación, lo malo es\lque no me quedan pokedex, !ah¡\lahora que recuerdo en casa tengo\luna te la puedes llevar.

#org 0x8011BF
= ¿Quieres a Meleon tipo planta?

#org 0x8011E0
= ¿Quieres a Blazgo tipo fuego?

#org 0x801200
= ¿Quieres a Flinflix tipo Agua?


'-----------
' Movements
'-----------
#org @mov
#raw 0x63 'Question Mark (?)
#raw 0x0
#raw 0xFE 'End of Movements

#org @mov1
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x1 'Face Up
#raw 0xFE 'End of Movements

#org @mov2
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)


#raw 0xFE 'End of Movements

#org @des
lock
faceplayer
msgbox @te 0x6
release
end

#org @te
= Ten mucho cuidado hijo y disfruta\nde tu aventura.

#org @mote
= ¿Quieres ponerle un mote?




Aqui el script que se pone:

'---------------
#org 0x800BC6
checkflag 0x202
if 0x1 goto 0x8801031
lock
faceplayer
msgbox 0x8800D5F MSG_NORMAL '"Hola hijo que haces aqui?\n?como? ..."
applymovement 0x2 0x8801015
waitmovement 0x2
applymovement 0x3 0x8801019
waitmovement 0x3
msgbox 0x8800E08 MSG_NORMAL '"Mensajero: Hola, la profesora\nCar..."
applymovement 0x3 0x8801026
waitmovement 0x3
hidesprite 0x3
setflag 0x203
msgbox 0x8800E93 MSG_NORMAL '"Prof.Carmen: Mmm veamos que envio,..."
msgbox 0x88011BF MSG_YESNO '"¿Quieres a Meleon tipo planta?"
compare LASTRESULT 0x1
if 0x1 goto 0x8801221
msgbox 0x88011E0 MSG_YESNO '"¿Quieres a Blazgo tipo fuego?"
compare LASTRESULT 0x1
if 0x1 goto 0x880123D
msgbox 0x8801200 MSG_YESNO '"¿Quieres a Flinflix tipo Agua?"
compare LASTRESULT 0x1
if 0x1 goto 0x8801259
msgbox 0x88011BF MSG_YESNO '"¿Quieres a Meleon tipo planta?"
compare LASTRESULT 0x1
if 0x1 goto 0x8801221
msgbox 0x88011E0 MSG_YESNO '"¿Quieres a Blazgo tipo fuego?"
compare LASTRESULT 0x1
if 0x1 goto 0x880123D
msgbox 0x8801200 MSG_YESNO '"¿Quieres a Flinflix tipo Agua?"
compare LASTRESULT 0x1
if 0x1 goto 0x8801259
msgbox 0x88011BF MSG_YESNO '"¿Quieres a Meleon tipo planta?"
compare LASTRESULT 0x1
if 0x1 goto 0x8801221
msgbox 0x88011E0 MSG_YESNO '"¿Quieres a Blazgo tipo fuego?"
compare LASTRESULT 0x1
if 0x1 goto 0x880123D
msgbox 0x8801200 MSG_YESNO '"¿Quieres a Flinflix tipo Agua?"
compare LASTRESULT 0x1
if 0xC2 goto 0x8D5E0E3
'---------------
#org 0x801031
lock
faceplayer
msgbox 0x880103E MSG_NORMAL '"Ten mucho cuidado hijo y disfruta\..."
release
end

'---------------
#org 0x801221
givepokemon 0x1 0x1 0x0 0x0 0x0 0x0
msgbox 0x8801072 MSG_YESNO '"¿Quieres ponerle un mote?"
compare LASTRESULT 0x1
givepokemon 0x1 0x1 0x0 0x0 0x0 0x0
msgbox 0x8801072 MSG_YESNO '"¿Quieres ponerle un mote?"
compare LASTRESULT 0x1
givepokemon 0x1 0x1 0x0 0x0 0x0 0x0
msgbox 0x8801072 MSG_YESNO '"¿Quieres ponerle un mote?"
compare LASTRESULT 0x1
if 0x1 goto 0x8800D4C
special 0x16F
setflag 0x202
setflag 0x828
setvar 0x4049 0x1
end

'---------------
#org 0x80123D
givepokemon 0x1 0x1 0x0 0x0 0x0 0x0
msgbox 0x8801072 MSG_YESNO '"¿Quieres ponerle un mote?"
compare LASTRESULT 0x1
givepokemon 0x1 0x1 0x0 0x0 0x0 0x0
msgbox 0x8801072 MSG_YESNO '"¿Quieres ponerle un mote?"
compare LASTRESULT 0x1
if 0x1 goto 0x8800D4C
special 0x16F
setflag 0x202
setflag 0x828
setvar 0x4049 0x1
end

'---------------
#org 0x801259
givepokemon 0x1 0x1 0x0 0x0 0x0 0x0
msgbox 0x8801072 MSG_YESNO '"¿Quieres ponerle un mote?"
compare LASTRESULT 0x1
if 0x1 goto 0x8800D4C
special 0x16F
setflag 0x202
setflag 0x828
setvar 0x4049 0x1
end

'---------------
#org 0xD5E0E3
choosecontestpkmn
setfarbyte 0x33 0x242444
showcontestresults
paymoney 0x1224AC12 0x12
givecoins 0x2144
warp5 0x13 0xC0 0x50 0x333 0x32C5
nop
checkpcitem 0x1233 0x41
nop
comparevars 0x3334 0x4204
playsong 0x423 0xCF
nop1
waitcry
nop1
hidecoins 0x14 0x42
givemoney 0x35600EB 0xEF
setbyte2 0x3 0x7F
cmd24 0xFB030310

'---------------
#org 0x800D4C
special 0x9E
special 0x16F
setflag 0x202
setflag 0x828
setvar 0x4049 0x1
end


'---------
' Strings
'---------
#org 0x800D5F
= Hola hijo que haces aqui?\n?como? ya llego el dia? !ups¡\lse me habia pasado con tanto\ltrabajo.Bueno desafortunadamente\lraparti todos los POKéMON y\lPOKéDEX que tenia...

#org 0x800E08
= Mensajero: Hola, la profesora\nCarmen?\lProf.Carmen: Si soy yo.\lMensajero: le traigo un paquete de\lsu marido, firme aqui.\lTenga buen dia.\l

#org 0x800E93
= Prof.Carmen: Mmm veamos que envio,\n¡oh! son tres nuevas especies de\lPOKéMON! bueno como no me quedan\lPOKéMON y tu te tienes que ir, te\ldare uno de estos asi me ayudas\lcon mi investigación, lo malo es\lque no me quedan pokedex, !ah¡\lahora que recuerdo en casa tengo\luna te la puedes llevar.

#org 0x8011BF
= ¿Quieres a Meleon tipo planta?

#org 0x8011E0
= ¿Quieres a Blazgo tipo fuego?

#org 0x801200
= ¿Quieres a Flinflix tipo Agua?

#org 0x80103E
= Ten mucho cuidado hijo y disfruta\nde tu aventura.

#org 0x801072
= ¿Quieres ponerle un mote?


'-----------
' Movements
'-----------
#org 0x801015
#raw 0x63 'Question Mark (?)
#raw 0x0 'Face Down
#raw 0xFE 'End of Movements

#org 0x801019
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x1 'Face Up
#raw 0xFE 'End of Movements

#org 0x801026
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0xFE 'End of Movements

algun error en el primer script?

Solucionado pueden cerrar el post
 
Última edición:

Inferno

Miembro insignia
Miembro insignia
La verdad nunca me ha pasado que un script se cambie por otro como en tu caso, de todos modos te he hecho el script y un poco más optimizado. No debería de dar fallo.

Código:
#dynamic 0x800000

#org @start
lock
faceplayer
checkflag 0x202
if 0x1 goto @usada
msgbox @texto 0x6
applymovement 0x2 @mov
waitmovement 0x2
applymovement 0x3 @mov1
waitmovement 0x3
msgbox @texto2 0x6
applymovement 0x3 @mov2
waitmovement 0x3
hidesprite 0x3
setflag 0x203
msgbox @texto3 0x6
goto @elegir

#org @elegir
msgbox @tipoplanta 0x5
compare LASTRESULT 0x1
if 0x1 goto @1
msgbox @tipofuego 0x5
compare LASTRESULT 0x1
if 0x1 goto @2
msgbox @tipoagua 0x5
compare LASTRESULT 0x1
if 0x1 goto @3
goto @elegir

#org @1
givepokemon 0x1 0x1 0x0 0x0 0x0 0x0
msgbox @mote 0x5
compare LASTRESULT 0x1
if 0x1 goto @simote
special 0x16F
setflag 0x202
setflag 0x828
setvar 0x4049 0x1
release
end

#org @2
givepokemon 0x1 0x1 0x0 0x0 0x0 0x0
msgbox @mote 0x5
compare LASTRESULT 0x1
if 0x1 goto @simote
special 0x16F
setflag 0x202
setflag 0x828
setvar 0x4049 0x1
release
end

#org @3
givepokemon 0x1 0x1 0x0 0x0 0x0 0x0
msgbox @mote 0x5
compare LASTRESULT 0x1
if 0x1 goto @simote
special 0x16F
setflag 0x202
setflag 0x828
setvar 0x4049 0x1
release
end

#org @simote
Special 0x9E
waitstate
special 0x16F
setflag 0x202
setflag 0x828
setvar 0x4049 0x1
release
end

#org @usada
msgbox @usada2 0x6
release
end

#org @texto
= Hola hijo que haces aqui?\n?como? ya llego el dia? !ups¡\lse me habia pasado con tanto\ltrabajo.Bueno desafortunadamente\lraparti todos los POKéMON y\lPOKéDEX que tenia...

#org @texto2
= Mensajero: Hola, la profesora\nCarmen?\lProf.Carmen: Si soy yo.\lMensajero: le traigo un paquete de\lsu marido, firme aqui.\lTenga buen dia.\l

#org @texto3
= Prof.Carmen: Mmm veamos que envio,\n¡oh! son tres nuevas especies de\lPOKéMON! bueno como no me quedan\lPOKéMON y tu te tienes que ir, te\ldare uno de estos asi me ayudas\lcon mi investigación, lo malo es\lque no me quedan pokedex, !ah¡\lahora que recuerdo en casa tengo\luna te la puedes llevar.

#org @tipoplanta
= ¿Quieres a Meleon tipo planta?

#org @tipofuego
= ¿Quieres a Blazgo tipo fuego?

#org @tipoagua
= ¿Quieres a Flinflix tipo Agua?

#org @mote
= ¿Quieres ponerle un mote?

#org @usada2
= Ten mucho cuidado hijo y disfruta\nde tu aventura.

#org @mov
#raw 0x63 'Question Mark (?)
#raw 0x0 
#raw 0xFE 'End of Movements

#org @mov1
#raw 0x10
#raw 0x10
#raw 0x10
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x1 'Face Up
#raw 0xFE 'End of Movements

#org @mov2
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0xFE 'End of Movements
Si quieres hacerlo aún más optimizado y ahorrarte la flag 0x202 usa al principio un checkflag 0x828, que mirara si tienes el menú Pokémon activado, como no será así se ejecutará el script y, una vez este finalice el menú ya debería estar activado, por lo que si volvemos a hablar con el NPC nos llevará al puntero del final.
Si vas a hacerlo así acuérdate de borrar todo lo relacionado con la flag 0x202.

Aún más optimizado podrías conseguirlo haciendo unos retoques al puntero del mote, en vez de ir a el con un goto puedes hacer un call y luego un return para volver al lugar de donde fue llamado, con esto te ahorrarías de poner todo lo que vendría luego del waitstate.

Yo no he querido ponerlo yo ya para no complicarlo más, así que tú ponlo como veas mejor.

No tiene sentido que pongas el checkflag antes del lock y el faceplayer si luego en el puntero vas a hacer otra vez lock y faceplayer, para eso ponlo detrás de los del inicio y borra los otros dos.
El hecho de que hagas 9 msgbox del tipo 0x5 no lo cobierte en un bucle, por lo que si el jugador elige la opción NO en todas las ocasiones tendríamos un problema, en mi script te dejo hecho un bucle haciendo que no pueda salir de él hasta que elija la opción SI, luego al final de esa parte del script haces un if 0xC2 goto ... teniendo en cuenta que lastresult en ese caso nunca va a dar C2 y el puntero que ahí pones no aparece luego en el script, sería un error.

Nombres de punteros y todo eso puedes ponerle en que quieras, yo acostumbro a ponerlos así.
 
Última edición:
Estado
Cerrado para nuevas respuestas.
Arriba