Author Id: 28274 Author Name: Dark Sneasel Post Content: En mi hack, yo necesitaba una escena en la que el jugador tiene que montarse en varios barcos. Pero, no quieria hacer lo mismo que hicieron en RSE, donde alguien conduce el barco para usted, me decidí a hacer un par de scripts en que el jugador controla los barcos! Voy a compartir aquí, y lo explico para que otros lo usen. Ahora, usualmente yo no pido crédito, pero si usted decide usar esto, por favor dame crédito, me tome un tiempo para hacer esto. De todas formas, aquí hay algunas cosas a tener en cuenta antes de empezar: [LIST] [*] Si el jugador tiene el surf y / o fly en su partida, esto causará problemas, así que les recomendamos quitarlo, o hacer eventos como estos que ocurran antes que tiene acceso a esas cosas. [*] Se necesita una buena cantidad de conocimientos de scripting para hacer esto. Voy a ir sobre algunas cosas, pero yo prefiero que ustedes no hagan copy y paste. [/LIST] Bien, ahora vamos a empezar. Esto es lo que quiero decir con barcos controlables: [URL=http://www.youtube.com/watch?v=qhVxglIGxAI]YouTube Video[/URL] (No se puede ver en el video, por que es un video, pero el jugador controla después de que se sube) Bueno, vamos a empezar. Aquí está mi mapa y los eventos de el: [SPOILER][IMG]http://i.snag.gy/ZMP19.jpg[/IMG][/SPOILER] No te preocupes por los events de persona y deformaciones en la parte superior izquierda del mapa, y el desastre por todas partes, me falta hacer unas cosas en el mapa. Yo también voy a admitir que algunos scripts en el piso fueron agregados más tarde debido a los errores de mi parte, después de todo, esta era mi primera vez haciendo los scripts en barco. Solamente voy a indicarles como hacer dos; si quieres más, vas a tener que hacerlo tú mismo. [IMG]http://i.snag.gy/fJWK7.jpg[/IMG] Esas cosas son necesarias para que el primer barco. Bueno, vamos a ver el script para el evento con la esquema negra. Aquí está el script: '--------------- #org 0xE5FAE1 lock faceplayer checkflag 0x8BB if 0x1 goto 0x8E5FBCC msgbox 0x8E5FB6A MSG_YESNO '"Sometimes people need to get to\nt..." compare LASTRESULT 0x1 if 0x1 goto 0x8E64A82 msgbox 0x8E5FB53 MSG_NORMAL '"Arr[.] That's a shame!" release end '--------------- #org 0xE5FBCC msgbox 0x8E5FBD7 MSG_NORMAL '"Arr[.] I love me boat!" release end '--------------- #org 0xE64A82 clearflag 0x8C0 setvar 0x4060 0x1 hidesprite 0x6 hidesprite 0x3 hidesprite 0x5 setflag 0x1233 setflag 0x1234 setflag 0x1235 setflag 0x1236 applymovement 0x1 0x8E5FB50 waitmovement 0x0 applymovement 0x1 0x8E5FB50 hidesprite 0x1 applymovement MOVE_PLAYER 0x8E5FB50 waitmovement 0x0 applymovement MOVE_PLAYER 0x8E5FB50 waitmovement 0x0 applymovement MOVE_PLAYER 0x8E5FB50 waitmovement 0x0 hidesprite 0xFF hidesprite 0x4 showsprite 0x4 release end '--------- ' Strings '--------- #org 0xE5FB6A = Sometimes people need to get to\nthe other parts of the islands.\lWanna use me boat to get there? #org 0xE5FB53 = Arr[.] That's a shame! #org 0xE5FBD7 = Arr[.] I love me boat! '----------- ' Movements '----------- #org 0xE5FB50 #raw 0x8 'Step Down (Normal) #raw 0xFE 'End of Movements 0x1 = El anciano 0xFF = Jugador 0x4 = Barco Probalmente notaste que hay una gran cantidad de hidesprites y setflags. No te preocupes por algunos de ellos, que es porque hice más barcos que haré en este tutorial. Ahora voy a explicar el script en detalle. '--------------- #org 0xE5FAE1 lock faceplayer checkflag 0x86A //la flag de el quinto gym. Si el/ella ya la tiene, no hay punto de el script. if 0x1 goto 0x8E5FBCC msgbox 0x8E5FB6A MSG_YESNO '"Sometimes people need to get to\nt..." compare LASTRESULT 0x1 if 0x1 goto 0x8E64A82 //Donde te subes al barco. msgbox 0x8E5FB53 MSG_NORMAL '"Arr[.] That's a shame!" release end Ahora vamos a ver esta parte: '--------------- #org 0xE64A82 clearflag 0x8C0 //Flag para los zapatos. Se activa de nuevo cuando se baje. setvar 0x4060 0x1 //Habrá scripts en el agua que se activan si el var es esta en 1. hidesprite 0x6 //Otro barco hidesprite 0x3 //Otro barco hidesprite 0x5 //Otro barco setflag 0x1233 //flag para otro barco setflag 0x1234 //flag para otro barco setflag 0x1235 //flag para otro barco setflag 0x1236 //flag para otro barco applymovement 0x1 0x8E5FB50 waitmovement 0x0 applymovement 0x1 0x8E5FB50 hidesprite 0x1 applymovement MOVE_PLAYER 0x8E5FB50 waitmovement 0x0 applymovement MOVE_PLAYER 0x8E5FB50 waitmovement 0x0 applymovement MOVE_PLAYER 0x8E5FB50 waitmovement 0x0 hidesprite 0xFF hidesprite 0x4 showsprite 0x4 release end (La flag de el barco y de el viejo es 1232) Ahora. vamos a ver la baldosa de script en el agua. Ten en cuenta que el script sólo ocurra si var 0x4060 = 0x1. '--------------- #org 0xE63302 lock msgbox 0x8E63323 MSG_YESNO '"Do you wanna get off the boat?" compare LASTRESULT 0x1 if 0x1 goto 0x8E63344 release end '--------------- #org 0xE63344 msgbox 0x8E63378 MSG_KEEPOPEN '"See ya, matey!" setflag 0x8C0 //Zapatos setvar 0x4060 0x0 showsprite 0xFF fadescreen 0x1 clearflag 0x1232 //La flag de person event de el viejo y el barco showsprite 0x1 //Viejo showsprite 0x4 //Barco closeonkeypress warpmuted 0x0 0x2 0x7 0xF 0x11 //Esto TIENE que estar ahí. Lo explicaré ahorita. fadescreen 0x0 release end '--------- ' Strings '--------- #org 0xE63323 = Do you wanna get off the boat? #org 0xE63378 = See ya, matey! Ahora vamos a ver el warp de allí. (warp # 7 en mi mapa) Pon una baldosa de warp en el lugar donde desea que el jugador vaya despues que se baje de el barco. Asegúrese de ponerlo en una tile que no tiene el byte comportamiento de warp. Ahora, en el script anterior vieron esto: warpmuted 0x0 0x2 0x7 0xF 0x11 Warp muted es asi: warpmuted 0x(bank) 0x(bank) 0x(warp #) 0x(X) 0x(Y) Yo no creo que tengo que explicar mucho allí. Ahora, si tu pones los scripts en una ROM, y los pruebas, ellos trabajarian perfectamente. Pero eso es sólo para un barco, ahora tenemos que hacer otro barco! [IMG]http://i.snag.gy/EQftB.jpg[/IMG] Ahora, vamos a centrarnos en los dos más fáciles, los que están en el agua. Hice que tengan el mismo script offset. (Solo pasan cuando 0x4060 = 1) '--------------- #org 0xE63DAD lock msgbox 0x8E63323 MSG_YESNO '"Do you wanna get off the boat?" compare LASTRESULT 0x1 if 0x1 goto 0x8E63DD4 release end '--------------- #org 0xE63DD4 msgbox 0x8E63378 MSG_KEEPOPEN '"See ya, matey!" setflag 0x8C0 setvar 0x4060 0x0 showsprite 0xFF fadescreen 0x1 clearflag 0x1232 showsprite 0x4 showsprite 0x1 setflag 0x1233 hidesprite 0x6 closeonkeypress warpmuted 0x0 0x2 0x8 0x1D 0x19 fadescreen 0x0 release end '--------- ' Strings '--------- #org 0xE63323 = Do you wanna get off the boat? #org 0xE63378 = See ya, matey! Yo no creo que tengo que explicar eso. (Hay una warpmuted en esa zona, mi mal por no mostrarlo, oops) Ahora vamos a ver las otras script tiles. (Pasan cuando var 0x4060 = 0.) '--------------- #org 0xE5FEEB lock msgbox 0x8E5FD01 MSG_YESNO '"[green_em]Hmm[.] I need to find a ..." compare LASTRESULT 0x1 if 0x1 goto 0x8E5FFB6 release end '--------------- #org 0xE5FFB6 pokenavcall 0x8E5FD50 '"Arr[.] Ye need a ride? I'll be\nth..." waitmsg goto 0x8E63477 '--------------- #org 0xE63477 clearflag 0x8C0 //Zapatos setvar 0x4060 0x1 special 0x116 //0x113 para FR/RF applymovement MOVE_CAMERA 0x8E5FD7F waitmovement 0x0 applymovement 0x1 0x8E5FB50 waitmovement 0x0 applymovement 0x1 0x8E5FB50 hidesprite 0x1 //Anciano applymovement MOVE_CAMERA 0x8E5FCF3 applymovement 0x4 0x8E5FCF3 waitmovement 0x0 special 0x117 //0x114 para FR/RF msgbox 0x8E5FCD0 MSG_NORMAL '"Get on, ye kid!" applymovement MOVE_PLAYER 0x8E5FCCD waitmovement 0x0 applymovement MOVE_PLAYER 0x8E5FCCD fadescreen 0x1 hidesprite 0xFF setflag 0x1232 //flag para el anciano y barco #1 hidesprite 0x4 //barco #1 clearflag 0x1233 //flag para barco #2 hidesprite 0x6 //barco #2 showsprite 0x6 fadescreen 0x0 release end '--------- ' Strings '--------- #org 0xE5FD01 = [green_em]Hmm[.] I need to find a way\nthere. Should I call the old man\lwith the boat? #org 0xE5FD50 = Arr[.] Ye need a ride? I'll be\nthere in a sec! #org 0xE5FCD0 = Get on, ye kid! '----------- ' Movements '----------- #org 0xE5FD7F #raw 0x9 'Step Up (Normal) #raw 0x9 'Step Up (Normal) #raw 0x9 'Step Up (Normal) #raw 0x9 'Step Up (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xFE 'End of Movements #org 0xE5FB50 #raw 0x8 'Step Down (Normal) #raw 0xFE 'End of Movements #org 0xE5FCF3 #raw 0x8 'Step Down (Normal) #raw 0x8 'Step Down (Normal) #raw 0x8 'Step Down (Normal) #raw 0x8 'Step Down (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xFE 'End of Movements #org 0xE5FCCD #raw 0xA 'Step Left (Normal) #raw 0xFE 'End of Movements Así que creo que eso es todo. Estaré encantado de responder a cualquier pregunta :) [SPOILER=En Ingles]In my hack, I needed a scene in which the player gets on multiple boats. However, I didn't want to go with the same old thing as in RSE, where someone drives the boat for you, I decided to make a few scripts where you control the boat! I'm gonna share it here, and explain it for others to use. Now, I usually don't ask for credit, but if you decide to use this, please credit me, it took me a while to make this. Anyways, here's a few things to note before you get started: [LIST] [*]If the player has surf and/or fly in his/her party, this will cause problems, so I suggest disabling them, or making events like these happen before (s)he has access to those things. [*]You need a fair amount of scripting knowledge to do this. I will be going over some things, but I'd preffer you don't copy and paste. [/LIST] Okay, now let's get started. Here's what I mean by controllable boats: [URL=http://www.youtube.com/watch?v=qhVxglIGxAI]YouTube Video[/URL] (You can't really tell since that's a video, but the player controls it after he gets on) Okay, let's get started. First of all, here is my map and the events in it. [SPOILER][IMG]http://i.snag.gy/ZMP19.jpg[/IMG][/SPOILER] Don't mind the person events and warps at the top left side of the map, and the mess everywhere, I just haven't done a lot of work in this map yet. I'm also going to admit that some script tiles were just added later due to mistakes on my part, after all, this was my first time making the boat scripts. I will only be going over how to make two; if you want more, you're gonna have to do it yourself. [IMG]http://i.snag.gy/fJWK7.jpg[/IMG] Those things are necessary for the first boat. Okay, first, let's look at the script for the person event with the black outline. Here is his script: '--------------- #org 0xE5FAE1 lock faceplayer checkflag 0x8BB if 0x1 goto 0x8E5FBCC msgbox 0x8E5FB6A MSG_YESNO '"Sometimes people need to get to\nt..." compare LASTRESULT 0x1 if 0x1 goto 0x8E64A82 msgbox 0x8E5FB53 MSG_NORMAL '"Arr[.] That's a shame!" release end '--------------- #org 0xE5FBCC msgbox 0x8E5FBD7 MSG_NORMAL '"Arr[.] I love me boat!" release end '--------------- #org 0xE64A82 clearflag 0x8C0 setvar 0x4060 0x1 hidesprite 0x6 hidesprite 0x3 hidesprite 0x5 setflag 0x1233 setflag 0x1234 setflag 0x1235 setflag 0x1236 applymovement 0x1 0x8E5FB50 waitmovement 0x0 applymovement 0x1 0x8E5FB50 hidesprite 0x1 applymovement MOVE_PLAYER 0x8E5FB50 waitmovement 0x0 applymovement MOVE_PLAYER 0x8E5FB50 waitmovement 0x0 applymovement MOVE_PLAYER 0x8E5FB50 waitmovement 0x0 hidesprite 0xFF hidesprite 0x4 showsprite 0x4 release end '--------- ' Strings '--------- #org 0xE5FB6A = Sometimes people need to get to\nthe other parts of the islands.\lWanna use me boat to get there? #org 0xE5FB53 = Arr[.] That's a shame! #org 0xE5FBD7 = Arr[.] I love me boat! '----------- ' Movements '----------- #org 0xE5FB50 #raw 0x8 'Step Down (Normal) #raw 0xFE 'End of Movements 0x1 = the old guy 0xFF = player 0x4 = boat Okay, so you will see that there are a lot of hidesprites and setflags. Don't mind some of those, that was because I did more boats than I will in this tutorial. Now I'm going to explain the script in detail. '--------------- #org 0xE5FAE1 lock faceplayer checkflag 0x86A //fifth gym flag, I'm pretty sure. This is a check if player already has it, and if he/she does then there is no need for the script/ if 0x1 goto 0x8E5FBCC msgbox 0x8E5FB6A MSG_YESNO '"Sometimes people need to get to\nt..." compare LASTRESULT 0x1 if 0x1 goto 0x8E64A82 //the actual getting on the boat and stuff msgbox 0x8E5FB53 MSG_NORMAL '"Arr[.] That's a shame!" release end Now let's take a look at this part: '--------------- #org 0xE64A82 clearflag 0x8C0 //running shoes flag. It's enabled again when you get off. setvar 0x4060 0x1 //There will be script tiles in the water that are activated if that var is set to 1. hidesprite 0x6 //other boat hidesprite 0x3 //other boat hidesprite 0x5 //other boat setflag 0x1233 //flag for other boat setflag 0x1234 //flag for other boat setflag 0x1235 //flag for other boat setflag 0x1236 //flag for other boat applymovement 0x1 0x8E5FB50 waitmovement 0x0 applymovement 0x1 0x8E5FB50 hidesprite 0x1 applymovement MOVE_PLAYER 0x8E5FB50 waitmovement 0x0 applymovement MOVE_PLAYER 0x8E5FB50 waitmovement 0x0 applymovement MOVE_PLAYER 0x8E5FB50 waitmovement 0x0 hidesprite 0xFF hidesprite 0x4 showsprite 0x4 release end (The boat and the old guy's flag is 1232) Now. let's take a look at the script tile in the water. Keep in mind that the script only happens if var 0x4060 = 0x1. '--------------- #org 0xE63302 lock msgbox 0x8E63323 MSG_YESNO '"Do you wanna get off the boat?" compare LASTRESULT 0x1 if 0x1 goto 0x8E63344 release end '--------------- #org 0xE63344 msgbox 0x8E63378 MSG_KEEPOPEN '"See ya, matey!" setflag 0x8C0 //running shoes setvar 0x4060 0x0 //sets the var back showsprite 0xFF fadescreen 0x1 clearflag 0x1232 //old man's and boat's flag showsprite 0x1 //old man showsprite 0x4 //boat closeonkeypress warpmuted 0x0 0x2 0x7 0xF 0x11 //This HAS to be there. I'll explain it soon. fadescreen 0x0 release end '--------- ' Strings '--------- #org 0xE63323 = Do you wanna get off the boat? #org 0xE63378 = See ya, matey! Now let's take a look at the warp in there. (warp #7 in my map) Put a warp tile the place where you want the player to get off after choosing. Make sure to put it on a tile that does NOT have the warp behavior byte. Now in the previous script, you saw this: warpmuted 0x0 0x2 0x7 0xF 0x11 Warp muted goes like this: warpmuted 0x(bank) 0x(bank) 0x(warp #) 0x(X) 0x(Y) I don't think I have to explain much there. Now, if you were to put those scripts in a rom, and test them out, they would work perfectly. But that is just for one boat, now we have to do another boat! [IMG]http://i.snag.gy/EQftB.jpg[/IMG] First of all, let's focus on the two easiest ones, the ones in the water. I made them have the same script offset. (They only happen when var 0x4060 = 1) '--------------- #org 0xE63DAD lock msgbox 0x8E63323 MSG_YESNO '"Do you wanna get off the boat?" compare LASTRESULT 0x1 if 0x1 goto 0x8E63DD4 release end '--------------- #org 0xE63DD4 msgbox 0x8E63378 MSG_KEEPOPEN '"See ya, matey!" setflag 0x8C0 setvar 0x4060 0x0 showsprite 0xFF fadescreen 0x1 clearflag 0x1232 showsprite 0x4 showsprite 0x1 setflag 0x1233 hidesprite 0x6 closeonkeypress warpmuted 0x0 0x2 0x8 0x1D 0x19 fadescreen 0x0 release end '--------- ' Strings '--------- #org 0xE63323 = Do you wanna get off the boat? #org 0xE63378 = See ya, matey! I don't think I need to explain that. (there is a warpmuted in that area, my bad for not showing it, oops) Now let's take a look at the other script tile. (happens when var 0x4060 = 0.) '--------------- #org 0xE5FEEB lock msgbox 0x8E5FD01 MSG_YESNO '"[green_em]Hmm[.] I need to find a ..." compare LASTRESULT 0x1 if 0x1 goto 0x8E5FFB6 release end '--------------- #org 0xE5FFB6 pokenavcall 0x8E5FD50 '"Arr[.] Ye need a ride? I'll be\nth..." waitmsg goto 0x8E63477 '--------------- #org 0xE63477 clearflag 0x8C0 //running shoes setvar 0x4060 0x1 special 0x116 //0x113 for FR applymovement MOVE_CAMERA 0x8E5FD7F waitmovement 0x0 applymovement 0x1 0x8E5FB50 waitmovement 0x0 applymovement 0x1 0x8E5FB50 hidesprite 0x1 //old guy applymovement MOVE_CAMERA 0x8E5FCF3 applymovement 0x4 0x8E5FCF3 waitmovement 0x0 special 0x117 //0x114 in FR msgbox 0x8E5FCD0 MSG_NORMAL '"Get on, ye kid!" applymovement MOVE_PLAYER 0x8E5FCCD waitmovement 0x0 applymovement MOVE_PLAYER 0x8E5FCCD fadescreen 0x1 hidesprite 0xFF setflag 0x1232 //flag for old guy and boat #1 hidesprite 0x4 //boat #1 clearflag 0x1233 //flag for boat #2 hidesprite 0x6 //boat #2 showsprite 0x6 fadescreen 0x0 release end '--------- ' Strings '--------- #org 0xE5FD01 = [green_em]Hmm[.] I need to find a way\nthere. Should I call the old man\lwith the boat? #org 0xE5FD50 = Arr[.] Ye need a ride? I'll be\nthere in a sec! #org 0xE5FCD0 = Get on, ye kid! '----------- ' Movements '----------- #org 0xE5FD7F #raw 0x9 'Step Up (Normal) #raw 0x9 'Step Up (Normal) #raw 0x9 'Step Up (Normal) #raw 0x9 'Step Up (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xA 'Step Left (Normal) #raw 0xFE 'End of Movements #org 0xE5FB50 #raw 0x8 'Step Down (Normal) #raw 0xFE 'End of Movements #org 0xE5FCF3 #raw 0x8 'Step Down (Normal) #raw 0x8 'Step Down (Normal) #raw 0x8 'Step Down (Normal) #raw 0x8 'Step Down (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xB 'Step Right (Normal) #raw 0xFE 'End of Movements #org 0xE5FCCD #raw 0xA 'Step Left (Normal) #raw 0xFE 'End of Movements So I think that's about it. I'll be happy to answer any questions :) And lastly, I wanna thank Josefig for giving me the idea of doing warpmuted for getting off the boat :)[/SPOILER]