• 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.

Level Script lifehack: Creating the map header without relying on Advance Map!

Bela

Banned
  • 262
    Posts
    15
    Years
    Hello binary hackers,

    Are you tired of this happening with your Level Scripts in Advance Map?

    Spoiler:


    Say goodbye to the old way of inserting level scripts, and say hello to...

    The newly patented* and ultra-easy XSE Level Script Header writing method! For just 15 easy payments of $8.75, you too can:

    1) Create a level script
    2) Create a header for the level script
    3) Create even more level scripts, even those of the same type, all in one map!

    All you need is:

    1) Advance Map (to insert the offset, and NOTHING else)
    2) XSE
    3) Check, money order, or credit card--call now, operators are standing by!

    It's that simple!

    [And now, the actual tutorial]

    Whenever you create a Level Script in Advance Map that requires a variable/var value argument, such as a type 2 level script, Advance Map has a tendency to be like:

    Spoiler:


    There's really no excuse for that, Amap is just bad at what it does. Instead, you can bypass dealing with Amap's buggy level script header by writing the header as its own script you compile. It should be noted, this method really only applies when you're creating level scripts that involve vars, as this is where Amap gives you trouble. If your map only has the 0x3 type of map script, you *shouldn't* have trouble but you can still use this method.

    Here's a skeleton of what the header would look like if you were to write it yourself:

    #dynamic 0x800000

    #org @maps
    #raw 0x3
    <- This is the type of level script. In this case, we're talking about the "0x3 On entering map/not on menu close" script type
    #raw pointer 0x81650F2 <- For type 0x3 level scripts, the offset for the level script goes here.
    #raw 0x5 <- This is another type of level script. In this case, we're talking about the "0x5 On entering map/on menu close" script type
    #raw pointer 0x8165116 <- For type 0x5 level scripts, the offset for the level script goes here.
    #raw 0x2 <- Another level script type. In this case, we're talking about the "0x2 Validates values, loads handler to 0x03000EBO" script type
    #raw pointer @map2 <- This goes to the next part of the header, for all type 0x2 level scripts associated with this map
    #raw 0x0 <- This terminates this portion of the header

    #org @map2 <- This is a section of the header for all type 0x2 level scripts (any events you normally would trigger on entering a map with a var)
    #raw word 0x405A <- Variable for the level script
    #raw word 0x18 <- Var value the level script triggers on
    #raw pointer 0x889FB9C <- This is the offset for an already compiled level script, what you would otherwise be putting into Amap's "Script offset 2" box
    #raw word 0x405A
    #raw word 0x1A
    #raw pointer 0x88A3328
    #raw word 0x0

    ' 02:
    ' Event1 (MS) when 405A = 18
    ' Event2 (MS) when 405A = 1A


    In its most basic form, the header for a map with a single 0x3 (On entering map/not on menu close) level script would look like this:

    Spoiler:



    However, they can be much more complex. Here's an actual header I created for my hack:

    Spoiler:


    Anyway, once you've written and compiled your header, next you need to use the following component of Advance Map: The Header tab, in the Professional viewer mode. If you've never seen this, this is a section of the Header tab that only comes up with pressing Ctrl + H when on this tab. Take the offset XSE gave you for the header you compiled, and put that address here:

    Level Script lifehack: Creating the map header without relying on Advance Map!

    (For future reference, if this image somehow dies, this is the "Map script offset" box in the Map Options section in the Header tab. That's where you put your offset!)

    Save the map, and you're done! That's it, really! With this, go ahead and test; your level scripts should now work! Once you've mastered this, you won't have to play with Advance Map's level script header ever again!


    Call within the next 10 minutes, and we'll double your order! With this method you'll be feeling great. Say goodbye to those aches and pains! Some of our customers have even reported sudden weight loss!**

    * Patent pending under the Pokemon Romhacking International Guidelines § 1337p
    ** This statement has not been evaluated by the FDA. This product is not intended to diagnose, treat, cure, or prevent any disease, except maybe using the Level Editor in Advance Map.
     
    Back
    Top