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

Some little advanced scripts [Updated 02.14]

219
Posts
16
Years
  • Some little advanced scripts



    Though there are some great script tutorial,some advanced script skills are still unknown to some people.Now I'd like to share some of mine with you.
    These scripts require that you have already mastered basic script knowledge.

    1.Some addon about 0m3GA ARS3NAL's DAY-CARE Script[FR/LG]
    Since 0m3GA ARS3NAL has explain the taken part well,I'm just going to say the retaken part which give back your Pokemon to party
    And besides,I don't know ASM,so I can't research the pay script and can only make this free retaken script.

    Script first:
    Spoiler:
    In fact,this is a basic part.Remove anything will destroey the retaken function.
    Sorry,I haven' gotten through what these special2s exacly do.But for now,we don't have to know this.Our point is how to make this work well in our hacks.
    So,let's make it "fat".
    Spoiler:
    This a good command to check how many Pokemons in your party and store the quantity to LASTRESULT.
    So we use it like this:
    Spoiler:
    Now we have made our check function,and let's plant it into our basic retaken part:
    Spoiler:
    Now we can ensure wheather your party is full,but what if you didn' save any Pokemons?The result is nothing will happen,but it's not perfect for a hack.
    Code:
    special2 LASTRESULT 0xB6
    This special2 will get what day-care state you are and save the number to LASTRESULT.
    This is a list of numbers and states:
    Spoiler:
    Hehe,do you know how to use "special2 LASTRESULT 0xB6" now?
    An example:
    Spoiler:

    Phew...little big ,isn't it?
    Our script is going to complete,but why don't we add some interesting thing?
    Before we use the "load" function,we can add this:
    Code:
    sound 0x58
    checksound
    cry LASTRESULT 0x0
    These will make the "give back" with a sound~
    So,let's see our finil fat script:
    Spoiler:
    I heve droped some commands which I think it's useless from the original day-care script,so if there's anything wrong please let me know,thanks.



    2.Button Script[FR/LG]
    attachment.php

    Have you ever noticed these interesting buttons?If you walk on them,they will make some change in the map.Fun,huh?
    Actully,these interesting button working only relying this command:setmaptile.
    Setmaptile is a simple command that has explained by some tutorials,but how to use it now?

    Most tutorial didn't explain it well,but if research it yourself,you'll find out the truth.
    When we want to create a button script,we should set a green "S" script icon in the AM.In this green "S",we must set the "Unknown" value to 0003 and set the Var value to 0063.As for the var,it depends on you,just a free one is ok.
    Spoiler:

    Having known this,we can make a simple script to test our thought:
    Spoiler:
    "lockall" and "releaseall" are the developed version of "lock" and "release".They ensure that nobody can move when script works.
    There is a "new" way of command "compare".You must have seen "compare LASTRESULT 0x1",and this is the same way.All what I do is replace the LASTRESULT with another variable.
    In this script,when 0x5000 is 0x63,the "setmaptile" cammand will work.
    If you want a free variable,just check the new guide.chm which included in the XSE zip.
    Now it's clear ,isn't it?
    To make it perfect,let's add a effect:
    Spoiler:

    Well,you may noticed that when you leave this map,what script has done will be cancelled.How can we keep this change?
    Now we need some "level script".
    If you have read Cooley's tutorial,it's easy for you.
    Let's see this script:
    Spoiler:
    I don't think there are anything need to explain.
    So just complie it and get our offset~
    Now open your AM ,go to the map and turn to the "head" page.
    Add a script and select "setmaptile" and put the offset that we just got.
    Save the change in AM.
    Hehe,now our work is done~

    3.About eggs in DAY-CARE Script[FR/LG]
    When the Spcial2 LASTRESULT 0xB6 returns 0x1,it means you hava an egg.But what should we do next?
    Code:
    clearflag 0x266
    special 0xB7
    This is the basic script of reciving an egg.
    The clearflag will tell the system,the egg has been given and the spcial 0xB7 will give the egg to the player.
    But we should check if your party is full.
    Code:
    special2 LASTRESULT 0x83
    compare LASTRESULT 0x6
    if 0x5 goto @full
    Just like what I said before,special2 LASTRESULT 0x83 will do it well.
    And of course,you can add more subs in this script,such as "Do you like eggs?" before this give egg function.
    Now,let's see how to insert our give egg function in to our retaken script.
    Spoiler:




    4.Make Scripts Work
    For not being understood,what I talk in fact is this kind of scripts:
    Spoiler:


    Maybe you have the experience that though you had already write a good script in a green "S" icon,the script wouldn't work.
    Yes, that's what I faced days ago...
    In fact all what we should do is:
    (1) Set a free var in AM,such as 5000
    (2) Set a number in Var value,such as 0000(I can't test all values,so I prefer to put 0000)
    (3) Set the Unknown value to 0003(Seems must be)

    Just like what I did in the picture above
    (3) Add these kind of scripts in your script:
    Spoiler:


    5.DAY-CARE script in R/S [load part]
    Maybe because FR/LG is based on R/S,the DAY-CARE script is almost the same.
    But there is one thing different :
    Code:
    sound 0x5F
    attention,sound 0x58 should be changed to sound 0x5F!

    Our full script for R/S:
    Spoiler:
    As you can see,when the var's value is other than what you set in AM,script won't work;If the var's value is what you set in AM, script will work.
    That's it ,easy~
    All these things for R/S is coming...
    Anyway, sorry for my really bad English and this semi-finished product, I'll make it better as soon as possible.

    Thanks for reading.
     
    Last edited by a moderator:
    219
    Posts
    16
    Years
  • Update a little~
    Yes,I'd say my English is really poor,so if there's anything you couldn't recognise ,just tell me .
    And if there's anything wrong,please let me know,because I don't mean to mislead people.

    By the way,these are for FR/LG, and the scripts for R/S are coming soon~
     
    219
    Posts
    16
    Years
  • XD maybe what I said in tutorial is already common sense...
    And I'd love to correct my grammatical errors ,if you can point it out...

    Updated~~Add a section to talk about DAY-CARE script in R/S~
    And the eggs thingy is coming soon~~
     
    Back
    Top