View Single Post
  #37    
Old January 29th, 2009 (2:35 PM).
Lyzo's Avatar
Lyzo Lyzo is offline
On vacation
     
    Join Date: Mar 2007
    Location: The Netherlands
    Age: 22
    Gender: Male
    Nature: Bold
    Posts: 252
    Quote:
    Originally Posted by Mourgrim View Post
    Hello, I've been having some troubles with a script I wanted to start out with. What I want the script to do is:

    Yes or no ask if I would like a pokemon
    give the pokemon
    set flags so it doesn't repeat.

    I've tried various different circumstances for this, but everytime something goes wrong. One time, it was in a whole bunch of symbols. Another, it was all placed wrong (even though I used XSE's Text Adjuster) and wouldn't even give the pokemon.

    If anyone could offer some help or advice, it'd be greatly appreciated for my first script. :) Thank you.

    This is the one that seemed to come closest to working, but still failed.

    #dynamic 0x80000

    #org @start
    checkflag 0x1000
    if 0x1 call @given
    msgbox @yesno 0x5
    compare LASTRESULT 0x1
    if 0x1 goto @yes
    msgbox @no 0x2
    setflag 0x1000
    end

    #org @given
    msgbox @given2
    end

    #org @yes
    countpokemon
    compare LASTRESULT 0x6
    if 0x1 call @full
    givepokemon 0x4 0x4 0x0 0x0 0x0 0x0
    msgbox @thanks 0x2
    end

    #org @full
    msgbox @full2 0x2
    end

    #org @yesno
    = Yes or no?

    #org @given2
    = I gave you it already.

    #org @full2
    = Your party's full.

    #org @no
    = Okay.

    #org @thanks
    = Thanks.
    Okay, nothing much wrong with this script.
    You missed a msgbox sort once:
    Code:
    #org @given
    msgbox @given2
    end
    But that's about all the mistakes I could find. I personally don't use call, but I only use goto.

    This is how I'd script it:

    Spoiler:
    #dynamic 0x80000

    #org @start
    lock
    faceplayer
    checkflag 0x200
    if 0x1 goto @given
    msgbox @yesno 0x5
    compare LASTRESULT 0x1
    if 0x1 goto @yes
    msgbox @no 0x6
    release
    end

    #org @given
    msgbox @given2 0x6
    release
    end

    #org @given2
    = I gave you it already.

    #org @yesno
    = Yes or no?

    #org @yes
    countpokemon
    compare LASTRESULT 0x6
    if 0x1 goto @full
    givepokemon 0x4 0x4 0x0 0x0 0x0 0x0
    setflag 0x200
    msgbox @thanks 0x6
    release
    end

    #org @full
    msgbox @full2 0x6
    release
    end

    #org @full2
    = Your party's full.

    #org @thanks
    = Thanks.

    #org @no
    = Okay.



    Anyway hope this helped ;)
    __________________


    Thank you The Blueprint !!!
    Reply With Quote