• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Pokeemerald] Scripting Tutorial

451
Posts
6
Years
    • Seen yesterday
    Hello,

    Thank you very much for these, they are very useful and easy to understand !

    I was moving things around in Littleroot Town inside porymap, and I saw that some npcs seemed to have a tile attributed to them before a specific flag is cleared.

    Like for exemple, for the player character. He seems to start at a specific location after jumping out of the truck, either as male or female, and I can't find where I could change his designated tile once he is out of the truck.

    I found this segment of the script that seems to be what I'm looking for, but I changed it and it didn't do anything :

    LittlerootTown_EventScript_StepOffTruckMale::
    lockall
    setvar VAR_0x8004, 4 (<--- I changed this value)
    setvar VAR_0x8005, 11 (<--- I changed this value)
    call LittlerootTown_EventScript_GoInsideWithMom
    setflag FLAG_HIDE_LITTLEROOT_TOWN_BRENDANS_HOUSE_TRUCK
    warpsilent MAP_LITTLEROOT_TOWN_BRENDANS_HOUSE_1F, 255, 8, 8
    waitstate
    releaseall
    end

    LittlerootTown_EventScript_StepOffTruckFemale::
    lockall
    setvar VAR_0x8004, 22 (<--- I changed this value)
    setvar VAR_0x8005, 10 (<--- I changed this value)
    call LittlerootTown_EventScript_GoInsideWithMom
    setflag FLAG_HIDE_LITTLEROOT_TOWN_MAYS_HOUSE_TRUCK
    warpsilent MAP_LITTLEROOT_TOWN_MAYS_HOUSE_1F, 255, 2, 8
    waitstate
    releaseall
    end


    I don't know if a tutorial on how to modify the original script would be of interest to anyone besides me, but I couldn't find that info anywhere.


    The script you edited has nothing to do with where the player starts. If you actually look at LittlerootTown_EventScript_GoInsideWithMom, you'll see that it is using VAR_0x8004 and VAR_0x8005 as the coordinates of a door to open/close.
    The warp tiles in InsideOfTruck warp the player to warp 127 of map "None", the destination of this warp can be set by using the command setdynamicwarp. Look at the scripts in InsideOfTruck to see it in use.
     
    4
    Posts
    3
    Years
    • Seen Aug 19, 2021
    Oh right, I didn't think of checking the map of the inside of the truck ! Thank you very much !
     
    Back
    Top