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

[Script✓] XSE scripting issue! Please Help.

ContestTrainer

YamiiVance
9
Posts
12
Years
  • Hello! And thank you in advanced for checking out this thread.
    I'm currently working on a hack, Blood Stained Leaf
    - (since the only other person working on it isn't going to release there beta or continue it ) -
    and I've recently started using XSE instead of PKSV.
    I've been having alot of issues with a few scripts- one in particular
    Basically I am trying to do a gender script where when you step on it depending on your gender depends on what you get?

    The original Script: ( please scroll down to my next reply for the updated script )
    #dynamic 0x800000
    #org @start
    lock
    faceplayer
    checkgender
    compare 0x800D 0x1
    = if 0x1 goto @girl
    compare 0x800D 0x0
    = if 0x0 goto @boy
    release
    end

    #org @boy
    givepokemon 0x4 0x5 0x50 0x0 0x0 0x0
    setflag 0x828
    setflag 0x82F
    setflag 0x829

    end

    #org @girl
    givepokemon 0xD7 0x5 0x50 0x0 0x0 0x0
    setflag 0x828

    end

    XSE scripting issue! Please Help.
     
    Last edited:

    DrFuji

    [I]Heiki Hecchara‌‌[/I]
    1,691
    Posts
    14
    Years
  • Hello! And thank you in advanced for checking out this thread.
    I'm currently working on a hack, Blood Stained Leaf
    - (since the only other person working on it isn't going to release there beta or continue it ) -
    and I've recently started using XSE instead of PKSV.
    I've been having alot of issues with a few scripts- one in particular
    Basically I am trying to do a gender script where when you step on it depending on your gender depends on what you get?

    The Script:
    Spoiler:


    View attachment 82003

    While you've got most of the script right there are a few spots that are incorrect or could be eliminated/ shortened. Here's a better version of your script with changes in red:

    Code:
    #dynamic 0x800000
    
    #org @start
    [COLOR="red"]lock
    faceplayer[/COLOR] // The lock and faceplayer commands can be removed entirely as you're interacting with a green S-tile rather than an NPC
    checkgender
    compare 0x800D 0x1
    [COLOR="red"]=[/COLOR] if 0x1 goto @girl // XSE doesn't use equal signs as commands
    // I've deleted your check for whether the player is a boy as you've already checked if they are a girl (process of elimination and all that).
    givepokemon 0x4 0x5 0x50 0x0 0x0 0x0
    setflag 0x828
    setflag 0x82F 
    setflag 0x829 
    end
    
    #org @girl
    givepokemon 0xD7 0x5 0x50 0x0 0x0 0x0
    setflag 0x828
    end

    Don't forget to either insert a checkflag command or set a variable to ensure that the player only activates this script once, otherwise they will be able to get a million Pokemon.
     

    ContestTrainer

    YamiiVance
    9
    Posts
    12
    Years
  • Ah thank you so much! But what's the check flag to keep a million Pokemon from spawning? This is an issue I've always struggled with. ( thank you again! )
    Edit: Oh dear. I put the script into the game and it didn't work? It gave me a start offset I put it in. And I checked the script it only had a dynamic org offset and nop in the script. I shrugged it off and tested it and nothing happened...? why does this keep happening??? Example.
    ( I'm trying to add a count pokemon script so when you get the starter you won't get two hundred more- that would work right? )
    the new script:

    #dynamic 0x740857
    #org 0x740857
    checkflag 0x828
    checkgender
    setflag 0x828
    compare LASTRESULT 0x1
    if 0x1 goto 0x8740E2A
    givepokemon 0x4 0x5 0x50 0x0 0x0 0x0
    setflag 0x828
    setflag 0x82F
    setflag 0x829
    countpokemon
    compare 0x800D 0x1
    if 0x1 goto @end
    end

    #org 0x740E2A
    givepokemon 0xD7 0x5 0x50 0x0 0x0 0x0
    setflag 0x828
    countpokemon
    compare 0x800D 0x1
    if 0x1 goto @end
    end


    #org @end
    return
    end
     
    Last edited:

    Froosty

    The_Learner
    535
    Posts
    9
    Years
  • Ah thank you so much! But what's the check flag to keep a million Pokemon from spawning? This is an issue I've always struggled with. ( thank you again! )
    Edit: Oh dear. I put the script into the game and it didn't work? It gave me a start offset I put it in. And I checked the script it only had a dynamic org offset and nop in the script. I shrugged it off and tested it and nothing happened...? why does this keep happening??? Example.
    ( I'm trying to add a count pokemon script so when you get the starter you won't get two hundred more- that would work right? )
    the new script:

    #dynamic 0x740857
    #org 0x740857
    checkflag 0x828
    checkgender
    setflag 0x828
    compare LASTRESULT 0x1
    if 0x1 goto 0x8740E2A
    givepokemon 0x4 0x5 0x50 0x0 0x0 0x0
    setflag 0x828
    setflag 0x82F
    setflag 0x829
    countpokemon
    compare 0x800D 0x1
    if 0x1 goto @end
    end

    #org 0x740E2A
    givepokemon 0xD7 0x5 0x50 0x0 0x0 0x0
    setflag 0x828
    countpokemon
    compare 0x800D 0x1
    if 0x1 goto @end
    end


    #org @end
    return
    end

    With the dynamic tag there,
    the script gets inserted to the free space location starting from that point,
    i.e. it might or might not get inserted in the same location you specified.

    When compiling you get the offset where it got inserted.
    use that and you might get it done.. i.e. running the script
     
    Back
    Top