The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script XSE scripting issue! Please Help.

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old May 23rd, 2017 (5:30 PM). Edited May 24th, 2017 by ContestTrainer.
ContestTrainer's Avatar
ContestTrainer ContestTrainer is offline
YamiiVance
 
Join Date: Oct 2011
Location: The Void
Gender: Other
Nature: Bashful
Posts: 7
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

A MAP image of script.PNG
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old May 24th, 2017 (1:19 AM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
Quote:
Originally Posted by ContestTrainer View Post
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:
#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


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
lock
faceplayer // 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
= 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.
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old May 24th, 2017 (8:30 AM). Edited May 24th, 2017 by ContestTrainer.
ContestTrainer's Avatar
ContestTrainer ContestTrainer is offline
YamiiVance
 
Join Date: Oct 2011
Location: The Void
Gender: Other
Nature: Bashful
Posts: 7
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
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old May 24th, 2017 (7:51 PM).
Froosty's Avatar
Froosty Froosty is offline
The_Learner
 
Join Date: Sep 2014
Location: Somewhere in this world.
Age: 25
Gender: Male
Nature: Brave
Posts: 535
Quote:
Originally Posted by ContestTrainer View Post
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
__________________
My works:
TOOL: TL's Quick Enhancer
TUTORIAL: Fire red habitat editing
TUTORIAL: Fire red Transparent text-box


| |
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
Ad Content
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 9:14 AM.