The PokéCommunity Forums Fan Games ROM Hacking
Script Help Thread (DO NOT REQUEST SCRIPTS)

ROM Hacking Need a helping hand? You can get help on any ROM Hacking-related problems or questions you have here.


Closed Thread
 
Thread Tools
  #8651    
Old August 12th, 2013 (1:02 AM).
Mauri Mauri is offline
     
    Join Date: Aug 2013
    Gender: Male
    Posts: 18
    Hey guys, does exist a method for make appear a sprite in a determinate coords (X|Y)?

    Relevant Advertising!

      #8652    
    Old August 12th, 2013 (5:44 AM).
    Wobbu's Avatar
    Wobbu Wobbu is offline
    Drag a needle on the good today
       
      Join Date: Mar 2012
      Location: Stardew Valley
      Gender: Male
      Nature: Relaxed
      Posts: 2,793
      How I go about this is that I'll give a person event an ID and set their flag. Later on, when I need them, I'll clear their flag and have them fulfill their duties :)
      __________________

      My Favorite Song
        #8653    
      Old August 12th, 2013 (5:52 AM).
      Bubblepopper Bubblepopper is offline
         
        Join Date: Aug 2013
        Gender: Male
        Posts: 5
        Hey again guys,

        I posted a script yesterday and you guys helped me a lot, anyways started trying to move on to more advanced scripts and i've ran into another problem.

        Iv made a script for a random NPC to give a pokemon to you, im following a tutorial and even though iv followed his script something went wrong, I think its something to do with the flags, but no matter how much a tinker with them the character continues to talk like hes already given you the pokemon.

        Im using XSE 1.1.1 so thats not the problem.

        Anyways heres the code, any help at all would be really appreciated!

        #dynamic 0x800042

        #org @start
        lock
        faceplayer
        checkflag 0x1200
        if 0x1 goto @done
        msgbox @question 0x5
        compare LASTRESULT 0x1
        if 0x1 goto @givepokemon
        msgbox @nothanks 0x6
        release
        end

        #org @done
        msgbox @checkup 0x6
        release
        end

        #org @givepokemon
        msgbox @thanks 0x6
        givepokemon 0x19 0xA 0xD 0x0 0x0 0x0
        fanfare 0x13E
        msgbox @recieved 0x6
        waitfanfare
        setflag 0x1200
        msgbox @thanks2 0x6
        release
        end

        #org @question
        = Hey there!\pYou seem like a nice person.\nWould you like this Pikachu?

        #org @nothanks
        = Oh, that's too bad.\pCome back if you change your mind.

        #org @thanks
        = Oh, thats great!\pHere you go!

        #org @thanks2
        = Thanks again.\pTake goo care of Pikachu!

        #org @recieved
        = \v\h01 recieved PIKACHU!

        #org @checkup
        = Hey again.\pHow's my Pikachu doing with you?
          #8654    
        Old August 12th, 2013 (6:04 AM).
        Wobbu's Avatar
        Wobbu Wobbu is offline
        Drag a needle on the good today
           
          Join Date: Mar 2012
          Location: Stardew Valley
          Gender: Male
          Nature: Relaxed
          Posts: 2,793
          Quote:
          Originally Posted by Bubblepopper View Post
          checkflag 0x1200
          Wow, that's a large number. I'd suggest using a flag in the 0x200s.
          __________________

          My Favorite Song
            #8655    
          Old August 12th, 2013 (6:07 AM).
          Bubblepopper Bubblepopper is offline
             
            Join Date: Aug 2013
            Gender: Male
            Posts: 5
            Quote:
            Originally Posted by jsziede View Post
            Wow, that's a large number. I'd suggest using a flag in the 0x200s.
            Would that help though?

            The tutorial script worked without a hitch and its flag was set to 1200, but mine just keeps skipping to "@done" which then loads "@checkup", so the NPC continually talks like the Pokemon was given to the player already...
              #8656    
            Old August 12th, 2013 (6:20 AM).
            Wobbu's Avatar
            Wobbu Wobbu is offline
            Drag a needle on the good today
               
              Join Date: Mar 2012
              Location: Stardew Valley
              Gender: Male
              Nature: Relaxed
              Posts: 2,793
              If you've already set flag 0x1200 earlier, then it will remain set unless you clear it via the clearflag command. And for the sake of vars, keep the flag numbers to a minimum.
              __________________

              My Favorite Song
                #8657    
              Old August 12th, 2013 (6:29 AM).
              Bubblepopper Bubblepopper is offline
                 
                Join Date: Aug 2013
                Gender: Male
                Posts: 5
                That was it thank you!

                I must have already had the flag set, didnt even think of that.

                Cheers for the help!
                  #8658    
                Old August 12th, 2013 (6:44 AM).
                Mauri Mauri is offline
                   
                  Join Date: Aug 2013
                  Gender: Male
                  Posts: 18
                  Quote:
                  Originally Posted by jsziede View Post
                  How I go about this is that I'll give a person event an ID and set their flag. Later on, when I need them, I'll clear their flag and have them fulfill their duties :)
                  Mmmm.. i think haven't got it. =(
                    #8659    
                  Old August 12th, 2013 (1:40 PM).
                  cclemur's Avatar
                  cclemur cclemur is offline
                     
                    Join Date: Sep 2011
                    Gender: Male
                    Posts: 4
                    Quote:
                    Originally Posted by destinedjagold View Post
                    [B][FONT="Book Antiqua"]studying your script, i found out that the grunt is hidden and then you 'showed him up' via movement scripts. that works, only if you add #raw 0x61 to every single applymovement of your grunt, preferably, the very first movement on your movement address.
                    Thanks for the insight on the hidden scripts, but the problem is that I the grunts won't leave their "hiding place" but still move the way they are supposed to minus the appearing which you have just informed me how to do. I will post a video, but seeing as I can't post links yet, just check out my youtube channel for the video if you are willing to help. the channel name is cclemur
                      #8660    
                    Old August 12th, 2013 (2:36 PM).
                    karatekid552's Avatar
                    karatekid552 karatekid552 is offline
                    What happens if I push it?....
                       
                      Join Date: Nov 2012
                      Location: Do you really want to know? Really?
                      Gender: Male
                      Nature: Bold
                      Posts: 1,766
                      Quote:
                      Originally Posted by Bubblepopper View Post
                      That was it thank you!

                      I must have already had the flag set, didnt even think of that.

                      Cheers for the help!
                      Read this: http://www.pokecommunity.com/showthread.php?t=302347
                      __________________

                      Paired with Simba
                        #8661    
                      Old August 13th, 2013 (2:57 AM).
                      Mauri Mauri is offline
                         
                        Join Date: Aug 2013
                        Gender: Male
                        Posts: 18
                        Hello again,

                        Which is the flag, or the var, where i can check if a battle has been won or not? I need it because i would realize a battle that i'm sure i'll loose, and after that i would move my sprite to another bank map and position.
                          #8662    
                        Old August 13th, 2013 (3:37 AM).
                        Wobbu's Avatar
                        Wobbu Wobbu is offline
                        Drag a needle on the good today
                           
                          Join Date: Mar 2012
                          Location: Stardew Valley
                          Gender: Male
                          Nature: Relaxed
                          Posts: 2,793
                          Quote:
                          Originally Posted by Mauri View Post
                          Hello again,

                          Which is the flag, or the var, where i can check if a battle has been won or not? I need it because i would realize a battle that i'm sure i'll loose, and after that i would move my sprite to another bank map and position.
                          Just use checktrainerflag 0xYYY.
                          YYY would be the trainer's number (the one you'll see in A-Trainer).
                          __________________

                          My Favorite Song
                            #8663    
                          Old August 13th, 2013 (3:43 AM). Edited August 13th, 2013 by Mauri.
                          Mauri Mauri is offline
                             
                            Join Date: Aug 2013
                            Gender: Male
                            Posts: 18
                            So, like this?

                            Code:
                            trainerbattle <etc>..
                            checktrainerflag 0x<ID>
                            if 0x1 goto @win
                            // if you loose
                            Right? Or have i to compare the last result?
                              #8664    
                            Old August 13th, 2013 (5:08 AM). Edited August 13th, 2013 by karatekid552.
                            karatekid552's Avatar
                            karatekid552 karatekid552 is offline
                            What happens if I push it?....
                               
                              Join Date: Nov 2012
                              Location: Do you really want to know? Really?
                              Gender: Male
                              Nature: Bold
                              Posts: 1,766
                              Quote:
                              Originally Posted by Mauri View Post
                              So, like this?

                              Code:
                              trainerbattle <etc>..
                              checktrainerflag 0x<ID>
                              if 0x1 goto @win
                              // if you loose
                              Right? Or have i to compare the last result?
                              Nope, a common misconception is that trainerflags are set when you beat them. Trainerflags are really cleared when you beat them.

                              And yes, you need to compare LASTRESULT 0x0 in between the chckflag and the if.
                              __________________

                              Paired with Simba
                                #8665    
                              Old August 13th, 2013 (5:24 AM).
                              Mauri Mauri is offline
                                 
                                Join Date: Aug 2013
                                Gender: Male
                                Posts: 18
                                So it should be like this:

                                Code:
                                checktrainerflag 0x<value>
                                compare LASTRESULT 0x0
                                if 0x1 goto @Win
                                  #8666    
                                Old August 13th, 2013 (5:37 AM).
                                Wobbu's Avatar
                                Wobbu Wobbu is offline
                                Drag a needle on the good today
                                   
                                  Join Date: Mar 2012
                                  Location: Stardew Valley
                                  Gender: Male
                                  Nature: Relaxed
                                  Posts: 2,793
                                  Quote:
                                  Originally Posted by Mauri View Post
                                  So, like this?

                                  Code:
                                  trainerbattle <etc>..
                                  checktrainerflag 0x<ID>
                                  if 0x1 goto @win
                                  // if you loose
                                  Right? Or have i to compare the last result?
                                  Yeah, if the trainer has been defeated, then the flag will be set. You don't need to check a variable, just do if 0x1 goto.
                                  If you want to do a script with the actual trainerbattle in it, then this is what you want:
                                  Code:
                                  trainerbattle 0x3 0xYYY 0x0 @intro @defeat
                                  Iirc, trainerbattle 0x3 allows execution after the battle, even if you lose.
                                  __________________

                                  My Favorite Song
                                    #8667    
                                  Old August 13th, 2013 (6:01 AM). Edited August 13th, 2013 by karatekid552.
                                  karatekid552's Avatar
                                  karatekid552 karatekid552 is offline
                                  What happens if I push it?....
                                     
                                    Join Date: Nov 2012
                                    Location: Do you really want to know? Really?
                                    Gender: Male
                                    Nature: Bold
                                    Posts: 1,766
                                    Quote:
                                    Originally Posted by jsziede View Post
                                    Yeah, if the trainer has been defeated, then the flag will be set. You don't need to check a variable, just do if 0x1 goto.
                                    If you want to do a script with the actual trainerbattle in it, then this is what you want:
                                    Code:
                                    trainerbattle 0x3 0xYYY 0x0 @intro @defeat
                                    Iirc, trainerbattle 0x3 allows execution after the battle, even if you lose.
                                    NO!

                                    Sorry bro, but this is completely wrong. Trainerflags are cleared when you win, and trainerbattle 0x3 doesn't require a pounter to continue the script, however the wcript will NOT continue if you lose. The only trainerbattle that will continue is 0x9. However that is the tutorial battle which has all sprts of messaged which pop up, though woth a alittle work, they can be removed.

                                    Quote:
                                    Originally Posted by Mauri View Post
                                    So it should be like this:

                                    Code:
                                    checktrainerflag 0x<value>
                                    compare LASTRESULT 0x0
                                    if 0x1 goto @Win
                                    Yes, that is correct, for checking if you won of course.
                                    __________________

                                    Paired with Simba
                                      #8668    
                                    Old August 13th, 2013 (6:11 AM).
                                    destinedjagold's Avatar
                                    destinedjagold destinedjagold is offline
                                    Oh Hai Thar~
                                     
                                    Join Date: May 2007
                                    Location: Philippines
                                    Age: 27
                                    Gender: Male
                                    Nature: Careful
                                    Posts: 8,575
                                    Quote:
                                    Originally Posted by cclemur View Post
                                    Thanks for the insight on the hidden scripts, but the problem is that I the grunts won't leave their "hiding place" but still move the way they are supposed to minus the appearing which you have just informed me how to do. I will post a video, but seeing as I can't post links yet, just check out my youtube channel for the video if you are willing to help. the channel name is cclemur
                                    Your NPCs are too far away from the player for them to move.
                                    Spoiler:

                                    There is a limit of distance for NPCs to be able to be controlled by your scripts.
                                    They should be within an 8(or 9 maybe) tile distance horizontally, and 7 tiles vertically.
                                    __________________


                                    FC: 0061-1111-6462
                                    TSV: 1364(X), 0790(OR)

                                      #8669    
                                    Old August 13th, 2013 (8:15 AM). Edited August 13th, 2013 by Bubblepopper.
                                    Bubblepopper Bubblepopper is offline
                                       
                                      Join Date: Aug 2013
                                      Gender: Male
                                      Posts: 5
                                      Hey again guys,

                                      So i'v been getting pretty good at scripting (at least in my own opinion anyways), I'm hacking FR and i'm changing the way Professor Oak comes to you at the start and I have two Psyduck blocking the exit of Pallet to Route 1, these blocks are unpassable until after you have been to the lab, but the question im really asking is, is there a ways i can make a tile passable in script?

                                      The Psyducks disappear, thats no problem but the tile itself is still locked to movement because of the movement permissions...so yea ill just leave this here, if anyone can help great!

                                      Or if there is a forum which can teach my how to do this that would be great!

                                      Anyways, cheers in advance you guys are always great help :)

                                      Don't need the help anymore guys, I found the "setmaptile" command tinkered with it till I got it to work :D
                                        #8670    
                                      Old August 13th, 2013 (9:38 AM).
                                      Wobbu's Avatar
                                      Wobbu Wobbu is offline
                                      Drag a needle on the good today
                                         
                                        Join Date: Mar 2012
                                        Location: Stardew Valley
                                        Gender: Male
                                        Nature: Relaxed
                                        Posts: 2,793
                                        Quote:
                                        Originally Posted by karatekid552 View Post
                                        NO!

                                        Sorry bro, but this is completely wrong. Trainerflags are cleared when you win.
                                        Oops, I was going by memory, and my memory isn't the greatest lol. I rarely use trainer flags or trainerbattle 0x3, so I don't know a lot about them, but now I know more :)
                                        __________________

                                        My Favorite Song
                                          #8671    
                                        Old August 15th, 2013 (11:19 AM).
                                        DaleH771's Avatar
                                        DaleH771 DaleH771 is offline
                                        I know who you are.
                                           
                                          Join Date: Oct 2011
                                          Gender: Male
                                          Posts: 126
                                          I had a hack in production, but deserted it because after coming back it my scripting skills weren't exactly great... Anyone made a simple and easy tool for scripting yet?

                                          I might re-open my hack if I can get scripting again easily
                                          __________________

                                          Demo coming soon!
                                            #8672    
                                          Old August 15th, 2013 (11:35 AM).
                                          Wobbu's Avatar
                                          Wobbu Wobbu is offline
                                          Drag a needle on the good today
                                             
                                            Join Date: Mar 2012
                                            Location: Stardew Valley
                                            Gender: Male
                                            Nature: Relaxed
                                            Posts: 2,793
                                            Gamer2020's unofficial XSE is the best scipt editor imo. If you don't know the XSE language or you need a refresher, here are some tutorials.
                                            __________________

                                            My Favorite Song
                                              #8673    
                                            Old August 15th, 2013 (8:05 PM).
                                            SpadeEdge16's Avatar
                                            SpadeEdge16 SpadeEdge16 is offline
                                               
                                              Join Date: May 2012
                                              Gender: Male
                                              Posts: 154
                                              hey guys, i wanted to know is it possible to give money in a script in the same way you would an item? Ive done a lot of scripting already, ive just never wanted to do this until now, so i havent payed any attention to whether or not i could.
                                              __________________
                                                #8674    
                                              Old August 15th, 2013 (9:06 PM).
                                              karatekid552's Avatar
                                              karatekid552 karatekid552 is offline
                                              What happens if I push it?....
                                                 
                                                Join Date: Nov 2012
                                                Location: Do you really want to know? Really?
                                                Gender: Male
                                                Nature: Bold
                                                Posts: 1,766
                                                Quote:
                                                Originally Posted by SpadeEdge16 View Post
                                                hey guys, i wanted to know is it possible to give money in a script in the same way you would an item? Ive done a lot of scripting already, ive just never wanted to do this until now, so i havent payed any attention to whether or not i could.
                                                There is literally a command called "givemoney".:P One sec, I'll go get the syntax...

                                                Here: http://www.pokecommunity.com/showpost.php?p=4228426&postcount=13
                                                __________________

                                                Paired with Simba
                                                  #8675    
                                                Old August 15th, 2013 (9:22 PM).
                                                SpadeEdge16's Avatar
                                                SpadeEdge16 SpadeEdge16 is offline
                                                   
                                                  Join Date: May 2012
                                                  Gender: Male
                                                  Posts: 154
                                                  Quote:
                                                  Originally Posted by karatekid552 View Post
                                                  There is literally a command called "givemoney".:P One sec, I'll go get the syntax...

                                                  Here: http://www.pokecommunity.com/showpost.php?p=4228426&postcount=13
                                                  Pfft, haha, thanks. And im assuming paymoney and givemoney are the same thing right? I just read it, but i want to make sure theres not some secret way of using them, haha.
                                                  Closed Thread

                                                  Quick Reply

                                                  Join the conversation!

                                                  Create an account to post a reply in this thread, participate in other discussions, and more!

                                                  Create a PokéCommunity Account

                                                  Sponsored Links
                                                  Thread Tools

                                                  Posting Rules
                                                  You may not post new threads
                                                  You may not post replies
                                                  You may not post attachments
                                                  You may not edit your posts

                                                  BB code is On
                                                  Smilies are On
                                                  [IMG] code is On
                                                  HTML code is Off

                                                  Forum Jump


                                                  All times are GMT -8. The time now is 4:05 PM.