The PokéCommunity Forums Fan Games ROM Hacking Help
Script repeat msgbox in case answer msgbox 0x5-> no

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

Reply
 
Thread Tools
  #1    
Old 2 Days Ago (8:39 AM).
Dinisk's Avatar
Dinisk Dinisk is offline
DinisK
     
    Join Date: Jan 2017
    Gender: Male
    Posts: 80
    I want to make a scene. The professor asks with msgbox 0x5 yes or no. If yes-> the scene goes on, if no-> another message comes out (hmm .. repeat your answer) and after that the message msgbox 0x5 repeats. It sounds pretty simple yes? I'm wondering where I made a mistake. When I click yes, it continues to work, but if I try different combinations from no and yes, the script repeats.

    #dynamic 0x800000

    #org @main
    msgbox @ rowantell2 0x5
    compare 0x800D 0x1
    if 0x1 call @Yes // I tried to put everything here if 0x0 call @no
    msgbox @ No2 0x2
    msgbox @ rowantell2 0x5
    end

    #org @start
    .... // continius script if choose Yes
    ...... setvar 0x4011 0x1

    #org @ rowantell2
    = Yes or no?

    #org @No
    msgbox @ No2 0x2
    msgbox @ rowantell2 0x5
    end

    #org @ No2
    = Good, i repeat

    #org @Yes
    msgbox @ Yes2 0x2
    call @start
    end

    #org @ Yes2
    = Good answer .....
    Reply With Quote
      #2    
    Old 2 Days Ago (3:09 PM).
    DrFuji's Avatar
    DrFuji DrFuji is offline
    Heiki Hecchara‌‌
     
    Join Date: Sep 2009
    Location: Aussie
    Age: 25
    Gender: Male
    Nature: Jolly
    Posts: 1,466
    Quote:
    Originally Posted by Dinisk View Post
    I want to make a scene. The professor asks with msgbox 0x5 yes or no. If yes-> the scene goes on, if no-> another message comes out (hmm .. repeat your answer) and after that the message msgbox 0x5 repeats. It sounds pretty simple yes? I'm wondering where I made a mistake. When I click yes, it continues to work, but if I try different combinations from no and yes, the script repeats.
    I'm a bit confused about what you want because in one sentence you say that you want the script to repeat, but in the last sentence you say that you don't want it to repeat.

    I think you want the script to enter a loop, so this script is probably what you're looking for:

    Code:
    #dynamic 0x800000
    
    #org @Main
    lock // 0x5 msgboxes don't automatically lock the OW
    faceplayer // Or face the player so these need to be added manually
    msgbox @YesOrNo 0x5
    compare 0x800D 0x1
    if 0x1 goto @start
    msgbox @No 0x2
    goto @Main // Will loop @Main until yes is chosen
    
    #org @start
    msgbox @Yes 0x2
    ... // Script continues on
    
    #org @YesOrNo
    = Yes or no?
    
    #org @Yes
    = Good answer...
    
    #org @No
    = I repeat...
    It will go in an infinite loop as long as the player chooses no, but will branch off to @start and continue the script if the player chooses yes. If I completely misunderstood your question and you're looking for something else, just let me know.
    __________________
    Reply With Quote
      #3    
    Old 1 Day Ago (12:22 AM).
    Dinisk's Avatar
    Dinisk Dinisk is offline
    DinisK
       
      Join Date: Jan 2017
      Gender: Male
      Posts: 80

      Thanks your script worked.
      yeah,my lvl language eng very deep on bottom.May be simpler add post image and in text. Msgbox 0x5 hard understandable by structure and add repeat msg in case
      (i hope you understand my minds)
      Reply With Quote
      Reply

      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
      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 10:28 PM.