The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > ROM Hacking Hub
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

ROM Hacking Hub General discussions about ROM Hacking and Emulation. Not sure where to start? This is the place for you.
Posting links to ROMs is illegal and is not tolerated anywhere on the forum.
New threads in this forum are to be approved by a moderator before they are displayed.


Closed Thread
Click here to go to the first staff post in this thread.  
Thread Tools
  #8926    
Old October 24th, 2013, 06:28 AM
ep!c
Banned
 
Join Date: Mar 2013
Gender: Male
Send a message via Skype™ to ep!c
My Crystal ball says me, that the person who you hide with setflag 0x85C, reappears.
0x8C5 is a temporary flag/special flag (0x8XX), use another.
0x200-0x2FF is 100 % free and not buggy
  #8927    
Old October 25th, 2013, 07:04 AM
Dark Sneasel's Avatar
Dark Sneasel
Community Supporter
 
Join Date: Jun 2013
Location: Miami, FL
Age: 14
Gender: Male
Nature: Hasty
Quote:
Originally Posted by Ganeshwar View Post
hey i have made this script whts the problem with it?

'---------------
#org 0x8012B6
lock
faceplayer
checkflag 0x828
if 0x1 goto 0x88013CF
msgbox 0x88013E7 MSG_YESNO '"DAD: So [player] are you going to ..."
compare LASTRESULT 0x1
if 0x1 goto 0x88012E1
compare LASTRESULT 0x0
if 0x1 goto 0x880133A
end

'---------------
#org 0x8013CF
msgbox 0x88015A7 MSG_NORMAL '"DAD: [player],best of luck my son...."
applymovement 0x1 0x8801613
waitmovement 0x0
setflag 0x8C6
release
end

'---------------
#org 0x8012E1
applymovement 0x2 0x8801609
waitmovement 0x0
hidesprite 0x3
setflag 0x8C5
applymovement 0x2 0x880160E
waitmovement 0x0
givepokemon 0x11 0xA 0xD2 0x0 0x0 0x0
fanfare 0x13E
msgbox 0x88014C3 MSG_KEEPOPEN '"[player] received a Pidgeotto\nfro..."
waitfanfare
setflag 0x828
msgbox 0x88014E8 MSG_YESNO '"Would you like to give your\nPokém..."
compare LASTRESULT 0x1
if 0x1 goto 0x88013A5
compare LASTRESULT 0x0
if 0x1 goto 0x88013BD
end

'---------------
#org 0x80133A
msgbox 0x8801419 MSG_NORMAL '"DAD: Oh,I see you must be kidding\..."
applymovement 0x1 0x8801606
waitmovement 0x0
applymovement 0x2 0x8801609
waitmovement 0x0
hidesprite 0x3
setflag 0x8C5
applymovement 0x2 0x880160E
waitmovement 0x0
givepokemon 0x11 0xA 0xD2 0x0 0x0 0x0
fanfare 0x13E
msgbox 0x88014C3 MSG_KEEPOPEN '"[player] received a Pidgeotto\nfro..."
waitfanfare
setflag 0x828
msgbox 0x88014E8 MSG_YESNO '"Would you like to give your\nPokém..."
compare LASTRESULT 0x1
if 0x1 goto 0x88013A5
compare LASTRESULT 0x0
if 0x1 goto 0x88013BD
end

'---------------
#org 0x8013A5
setvar 0x8004 0x0
call 0x88013B5
goto 0x88013C4

'---------------
#org 0x8013BD
closeonkeypress
goto 0x88013C4

'---------------
#org 0x8013B5
fadescreen 0x1
special 0x9E
waitstate
return

'---------------
#org 0x8013C4
msgbox 0x880151D MSG_NORMAL '"DAD: Please take care of this\ndoc..."
release
end


'---------
' Strings
'---------
#org 0x8013E7
= DAD: So [player] are you going to start\nyour journey?

#org 0x8015A7
= DAD: [player],best of luck my son.I have\nto go to Saffron city due to some\limportant work.Bye now!

#org 0x8014C3
= [player] received a Pidgeotto\nfrom DAD.\l

#org 0x8014E8
= Would you like to give your\nPokémon a nickname?

#org 0x801419
= DAD: Oh,I see you must be kidding\nam I right? This is the best day\lin any trainer's life.SO,I have\lsomething for you.Cubone can you\lbring the pokeball?\lpresent there?\l

#org 0x80151D
= DAD: Please take care of this\ndocile Pidgeotto I have caught and\ltrained it till the time it was a\lPidgey just for this auspicious\lday.


'-----------
' Movements
'-----------
#org 0x801613
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x60 'Hide
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org 0x801609
#raw 0x11 'Step Up (Normal)
#raw 0x11 'Step Up (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0xFE 'End of Movements

#org 0x80160E
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0xFE 'End of Movements

#org 0x801606
#raw 0x62 'Exclamation Mark (!)
#raw 0xFE 'End of Movements
Do you have it how it was before you opened it in A-Map?
It would make it much easier to fix it that way.
__________________
  #8928    
Old October 25th, 2013, 07:08 AM
TheUltimateG.J's Avatar
TheUltimateG.J
 
Join Date: Oct 2011
Location: Bihar,Darbhanga
Age: 15
Gender: Male
Nature: Jolly
I will pm u it so is it ok with u?
__________________


A lover of Pokemon and their Hacks this is no other than?

Only he can be----->G.J
  #8929    
Old October 26th, 2013, 12:59 PM
NonPlayerCharacter's Avatar
NonPlayerCharacter
 
Join Date: Oct 2013
Gender: Male
Differences between goto and call?
__________________
Sorry if you can't understand me.
My mother tongue it's spanish
  #8930    
Old October 26th, 2013, 01:20 PM
Edward Newgate's Avatar
Edward Newgate
Everyone is a child of the sea
Community Supporter
 
Join Date: Jun 2011
Location: The Netherlands
Age: 18
Gender: Male
Nature: Relaxed
Quote:
Originally Posted by NonPlayerCharacter View Post
Differences between goto and call?
Goto is used to call another part in the same script
(Like with the checkflag command:
If 0x1 goto @right
Or
If 0x0 goto @left)

Call is used to call (a part of) a different script saved in the rom
(Comes down to: call 0x800000, to call the script stored at offset 800000
__________________
Pokemon X FRIEND CODE: 1779-0853-5563
Friend safari type:
Pokemon:
- Munna
- Duosion
- Espurr
Send me a message if you add me, then I will add you too
  #8931    
Old October 26th, 2013, 01:42 PM
ep!c
Banned
 
Join Date: Mar 2013
Gender: Male
Send a message via Skype™ to ep!c
Wrong.
The difference between Goto and Call is, that you can return a call.
Example.

if 0x1 goto @offset

#org @offset
end

Example2.

if 0x1 call @offset
end

#org @offset
return

It will return to end or whatever you write after "if 0x1 call @offset"
  #8932    
Old October 26th, 2013, 06:02 PM
Airikita's Avatar
Airikita
 
Join Date: Oct 2013
Gender: Female
Does anyone know what "rst 28" (GBC) does? It's rather important as it's a source of a glitch occurring with my hack.

EDIT: Nevermind, found it... wow, the code was a mess! I think I found where I accidentally injected code to the wrong address in the Script Editor... messed up the ASM badly.
__________________

The Vocaloids battling with Pokemon? What could go wrong?
http://www.youtube.com/watch?v=xI8YOOHlEXQ
Po pi po! (Pokemon Gold music import)
Check out my channel for more!

Last edited by Airikita; October 26th, 2013 at 06:59 PM.
  #8933    
Old October 26th, 2013, 07:23 PM
destinedjagold's Avatar
destinedjagold
Oh Hai Thar~ 'ω'
Community Supporter
 
Join Date: May 2007
Location: Philippines
Gender: Male
Nature: Careful
Quote:
Originally Posted by NonPlayerCharacter View Post
Differences between goto and call?
An example script...
Code:
#org @start
lock
faceplayer
call @free
checkflag 0x800
if 0x1 goto @done
message @1 0x6
givepokemon 0x4 0x5 0x0
message @2 0x6
setflag 0x800
release
end

#org @1
= Here's a Charmander for you!

#org @done
message @2 0x6
release
end

#org @2
= Take good care of Charmander!

#org @free
message @3 0x6
return

#org @3
= Charmanders, are great, no?
goto will go to a new address and will not return to where it came from. The script will not work properly if the 'goto' address has a 'return' code in it.
call will go to a new address and will return back to where it left off with the 'return' code.
__________________
  #8934    
Old October 26th, 2013, 08:13 PM
Eren Jaeger's Avatar
Eren Jaeger
Pianoist
 
Join Date: Apr 2013
Location: EARTH
Gender: Male
Nature: Serious
How does hidesprite work on setvar script?
I've made a setvar script but it doesn't need flags right?
But without a flag hidesprite won't work, I tried to put the setvar's flag which is 5000.
But my sprite is nowhere to be seen and after the script, the whole game hangs.

this is my script.
Spoiler:
#dynamic 0x800000

#org @start
setvar 0x5000 0x1
applymovement 0xFF @move
waitmovement 0x0
applymovement 0x1 @move1
waitmovement 0x0
msgbox @1 0x6
givepokemon 0x85 0x0A 0x8B 0x0 0x0 0x0
fanfare 0x174
msgbox @here 0x6
waitfanfare
closeonkeypress
msgbox @2 0x6
applymovement 0x1 @move2
applymovement 0xFF @move3
waitmovement 0x0
hidesprite 0x1
release
end

#org @move
#raw 0x08
#raw 0x08
#raw 0x08
#raw 0x0A
#raw 0x0A
#raw 0xFE

#org @move1
#raw 0x03
#raw 0x56
#raw 0xFE

#org @move2
#raw 0x08
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x08
#raw 0xFE

#org @move3
#raw 0x56
#raw 0x00

#org @1
= [blue_em]Father[darkgrey_em]: Oh [green_em][PLAYER][darkgrey_em]!\nI see you're ready now.\pBut let me tell you this\nbefore I give it to you.\pPOK\h1AMON are not guns, [green_em][PLAYER][darkgrey_em].\nThey are to be loved.\pEnough said, here you go.\nTake good care of it.

#org @here
= [green_em][PLAYER][darkgrey_em] receive a EEVEE!

#org @2
= [blue_em]Father[darkgrey_em]: I'd hate to say this..\n[green_em][PLAYER][darkgrey_em] I need to go now.\pThe Kingdom rangers found me.\nI made a deal with them.\pYou see, [green_em][PLAYER][darkgrey_em].\nI'm a trainer terrorist.\pI don't treat POK\h1AMON just\nlike tools for war.\p[green_em][PLAYER][darkgrey_em], believe me.\nThey are meant to love.\pUse them for battle if\nyou only needed, okay?\pDon't worry, I'll be..\nback, before you know it.\pWell then, [green_em][PLAYER][darkgrey_em].\nThis is farewell.\pI'm sorry, I know..\nIt's all so sudden.\pDon't you forget what I\nhave said to you, [green_em][PLAYER][darkgrey_em].\lKeep it in mind.
__________________
Music is art
  #8935    
Old October 26th, 2013, 09:47 PM
destinedjagold's Avatar
destinedjagold
Oh Hai Thar~ 'ω'
Community Supporter
 
Join Date: May 2007
Location: Philippines
Gender: Male
Nature: Careful
Quote:
Originally Posted by kaedearagaki View Post
How does hidesprite work on setvar script?
I've made a setvar script but it doesn't need flags right?
But without a flag hidesprite won't work, I tried to put the setvar's flag which is 5000.
simple...add a flag. =/
I'm still a newbie at vars though, so I can't really see any other ways to hide an NPC aside from flags or level scripts.


Quote:
Originally Posted by kaedearagaki View Post
But my sprite is nowhere to be seen and after the script, the whole game hangs.
That's because you forgot this...
Code:
#org @move3
#raw 0x56
#raw 0x00
#raw 0xFE
__________________
  #8936    
Old October 26th, 2013, 11:21 PM
Eren Jaeger's Avatar
Eren Jaeger
Pianoist
 
Join Date: Apr 2013
Location: EARTH
Gender: Male
Nature: Serious
Quote:
Originally Posted by destinedjagold View Post
simple...add a flag. =/
I'm still a newbie at vars though, so I can't really see any other ways to hide an NPC aside from flags or level scripts.




That's because you forgot this...
Code:
#org @move3
#raw 0x56
#raw 0x00
#raw 0xFE
Thanks, my gf just said why my script went wrong.
You always got the answer to my problems. lol

I don't get it!
I did everything correctly.

I inserted this script on the green "S"
Spoiler:
#dynamic 0x800000

#org @start
checkflag 0x8D6
applymovement 0xFF @move
waitmovement 0x0
playsong 0x1F4 0x0
special 0x116
applymovement 0x7F @camera
waitmovement 0x0
msgbox @1 0x6
applymovement 0x1 @move1
waitmovement 0x0
hidesprite 0x1
applymovement 0x7F @camera1
waitmovement 0x0
special 0x117
fadesong 0x169
setflag 0x8D6
release
end

#org @1
= [red_em]?????[darkgrey_em]: Soma had been captured.\nThis is bad, I better hurry now.

#org @move
#raw 0x56
#raw 0xFE

#org @camera
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0xFE

#org @move1
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0xFE

#org @camera1
#raw 0xA
#raw 0xA
#raw 0xA
#raw 0xFE


and change the var number to 4050 and unknown to 300
and the script has a check & setflag! but the script
keeps repeating when I step on it? What the hell.
__________________
Music is art

Last edited by Eren Jaeger; October 27th, 2013 at 05:10 AM. Reason: Your double post has been automatically merged.
  #8937    
Old October 28th, 2013, 03:08 AM
destinedjagold's Avatar
destinedjagold
Oh Hai Thar~ 'ω'
Community Supporter
 
Join Date: May 2007
Location: Philippines
Gender: Male
Nature: Careful
Quote:
Originally Posted by kaedearagaki View Post
I don't get it!
I did everything correctly.

I inserted this script on the green "S"
Spoiler:
#dynamic 0x800000

#org @start
checkflag 0x8D6
applymovement 0xFF @move
waitmovement 0x0
playsong 0x1F4 0x0
special 0x116
applymovement 0x7F @camera
waitmovement 0x0
msgbox @1 0x6
applymovement 0x1 @move1
waitmovement 0x0
hidesprite 0x1
applymovement 0x7F @camera1
waitmovement 0x0
special 0x117
fadesong 0x169
setflag 0x8D6
release
end

#org @1
= [red_em]?????[darkgrey_em]: Soma had been captured.\nThis is bad, I better hurry now.

#org @move
#raw 0x56
#raw 0xFE

#org @camera
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0xFE

#org @move1
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0x0B
#raw 0xFE

#org @camera1
#raw 0xA
#raw 0xA
#raw 0xA
#raw 0xFE


and change the var number to 4050 and unknown to 300
and the script has a check & setflag! but the script
keeps repeating when I step on it? What the hell.
fixes are in red.

Code:
#dynamic 0x800000

#org @start
checkflag 0x8D6
if 0x1 goto @done
applymovement 0xFF @move
waitmovement 0x0
playsong 0x1F4 0x0
special 0x116
applymovement 0x7F @camera
waitmovement 0x0
msgbox @1 0x6
applymovement 0x1 @move1
waitmovement 0x0
hidesprite 0x1
applymovement 0x7F @camera1
waitmovement 0x0
special 0x117
fadesong 0x169
setflag 0x8D6
release
end

#org @done
release
end

#org @1
= [red_em]?????[darkgrey_em]: Soma had been captured.\nThis is bad, I better hurry now.

#org @move
#raw 0x56
#raw 0xFE

#org @camera
#raw 0x0B 
#raw 0x0B
#raw 0x0B
#raw 0xFE 

#org @move1
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0xFE 

#org @camera1
#raw 0xA
#raw 0xA 
#raw 0xA 
#raw 0xFE
__________________
  #8938    
Old October 28th, 2013, 05:31 PM
Teh Blazer's Avatar
Teh Blazer
Divider of Zero
 
Join Date: Feb 2009
Location: 'MERICA
Age: 19
Gender: Male
Nature: Relaxed
I made a givepokemon script and it works fine when I want to nickname the given pokemon when it's on my team, but when it's boxed the nickname thing nicknames the last pokemon I have instead of the given pokemon.

What commands do I need to use so the nickname feature works on the pokemon even if it's sent to the box?
__________________
Coming soon...
  #8939    
Old October 28th, 2013, 06:14 PM
karatekid552's Avatar
karatekid552
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552
Quote:
Originally Posted by Teh Blazer View Post
I made a givepokemon script and it works fine when I want to nickname the given pokemon when it's on my team, but when it's boxed the nickname thing nicknames the last pokemon I have instead of the given pokemon.

What commands do I need to use so the nickname feature works on the pokemon even if it's sent to the box?
You don't. That is why the game always checked to make sure that you had room for a pokemon before giving you one. Include those checks in the script and you will be fine.
__________________

Paired with Simba
  #8940    
Old October 29th, 2013, 09:34 AM
ep!c
Banned
 
Join Date: Mar 2013
Gender: Male
Send a message via Skype™ to ep!c
Quote:
Originally Posted by destinedjagold View Post
fixes are in red.

Code:
#dynamic 0x800000

#org @start
checkflag 0x8D6
if 0x1 goto @done
applymovement 0xFF @move
waitmovement 0x0
playsong 0x1F4 0x0
special 0x116
applymovement 0x7F @camera
waitmovement 0x0
msgbox @1 0x6
applymovement 0x1 @move1
waitmovement 0x0
hidesprite 0x1
applymovement 0x7F @camera1
waitmovement 0x0
special 0x117
fadesong 0x169
setflag 0x8D6
release
end

#org @done
release
end

#org @1
= [red_em]?????[darkgrey_em]: Soma had been captured.\nThis is bad, I better hurry now.

#org @move
#raw 0x56
#raw 0xFE

#org @camera
#raw 0x0B 
#raw 0x0B
#raw 0x0B
#raw 0xFE 

#org @move1
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0x0B 
#raw 0xFE 

#org @camera1
#raw 0xA
#raw 0xA 
#raw 0xA 
#raw 0xFE
Gosh, destinja, this is a terrible scripting style!!
Throw this checkflag thingie away.. it's awful plz.
Set your variable in advancemap to a free one (i use 5000+), value = 0.
Set in the script this variable you used in advancemap, but value = 1 (setvar 0xXYZQ 0x1)
  #8941    
Old October 29th, 2013, 05:36 PM
karatekid552's Avatar
karatekid552
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552
Quote:
Originally Posted by ep!c View Post
Gosh, destinja, this is a terrible scripting style!!
Throw this checkflag thingie away.. it's awful plz.
Set your variable in advancemap to a free one (i use 5000+), value = 0.
Set in the script this variable you used in advancemap, but value = 1 (setvar 0xXYZQ 0x1)
YOUR RESPONSE IS TERRIBLE. Not DJG's scripting.

Those vars. 5000+? Really? Those are in PC box space. Do you really want bad eggs? Look bro, DJG knows what to do. This method is safe. Yours is not.

I think you need to read this: http://www.pokemonhackersonline.com/...ad.php?t=14110

Even though you've been hacking longer than me, and maybe DJG, a lot has been learned about what is safe and what isn't while you weren't hacking.
__________________

Paired with Simba
  #8942    
Old October 30th, 2013, 04:22 AM
Satoshi Ookami's Avatar
Satoshi Ookami
Memento Mori
Community Supporter
 
Join Date: Jul 2008
Location: Abyss of Time, Great Seal
Age: 22
Gender: Male
Nature: Calm
Quote:
Originally Posted by ep!c View Post
Gosh, destinja, this is a terrible scripting style!!
Throw this checkflag thingie away.. it's awful plz.
Set your variable in advancemap to a free one (i use 5000+), value = 0.
Set in the script this variable you used in advancemap, but value = 1 (setvar 0xXYZQ 0x1)
Da... heck...?
1) No one will take you seriously if you write like that plz... just 'cause it's cool plz!
2) You should suggest this to the poster, not DJG.
3) Poster wanted help with script where he explicitly used the "checkflag" command so DJG fixed his script.
__________________
ROM hacking FAQ - Read before asking how to play a hack. | Previous Sign 2 | Previous Sign

Anime List | PSN Trophy List
  #8943    
Old October 30th, 2013, 10:15 AM
daniilS's Avatar
daniilS
busy trying to do stuff not done yet
 
Join Date: Aug 2013
Age: 15
Gender: Male
I know some scripting commands support a word OR a variable as an argument. In the case of a variable, how should I write that?
__________________

Thanks to JPAN, Jambo51, Shiny Quagsire and knizz for teaching me almost everything I know about hacking, through tutorials or in person.
  #8944    
Old October 30th, 2013, 01:43 PM
Kurapika's Avatar
Kurapika
Grudgebearer
 
Join Date: Feb 2013
Location: Lavendar Town - Morocco
Gender: Male
Nature: Naughty
@DaniilS, words? are you talking about buffers?
Spoiler:
setvar 0x800D 0x77
bufferpokemon 0x1 0x800D

is the equivalent of
Spoiler:
bufferpokemon 0x1 0x77
__________________
  #8945    
Old October 30th, 2013, 04:35 PM
karatekid552's Avatar
karatekid552
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552
Quote:
Originally Posted by daniilS View Post
I know some scripting commands support a word OR a variable as an argument. In the case of a variable, how should I write that?
Quote:
Originally Posted by Kurapika View Post
@DaniilS, words? are you talking about buffers?
Spoiler:
setvar 0x800D 0x77
bufferpokemon 0x1 0x800D

is the equivalent of
Spoiler:
bufferpokemon 0x1 0x77
He is talking about scripts like this:

trainerbattle 0x3 0x4000 etc


Where a var is substituted for a static number. GF used these a lot to make dynamic scripts that saved space. (Though, I noticed that GF OVERuses them in some cases, lol)

Either way, most commands (but not all) accept a var. You see, it does this:

Code:
if arg <= 0x3FFF:
    goto use_number_as_is
else:
    goto use_variable_decrypter
Got it? So, it is the exact same syntax, just using a var instead of a number. The most common example is the givepokemon script:

givepokemon 0x4001 0x5 0x0


At the beginning of the game, when the player is asked which pokemon they want, that choice is set to a temp var (either 0x4001 or 0x4003, can't remember) and then the givepokemon command is called using that var. Basically works like this:

Code:
#org @choose_bulbasaur
setvar 0x4001 0x1
goto @give

#org @choose_charamander
setvar 0x4001 0x4
goto @give

#org @choose_squirtle
setvar 0x4001 0x7
goto @give

#org @give
givepokemon 0x4001 0x5 0x0
__________________

Paired with Simba
  #8946    
Old November 1st, 2013, 02:05 PM
Rezordaxx's Avatar
Rezordaxx
Asks many questions!
 
Join Date: Aug 2013
Location: The Netherlands
Age: 15
Gender: Male
Nature: Relaxed
So the second move script doesnt work but the first does,
the person event number is correct!
could it be because the sprite isnt in the screen?
Or is it to long or something?
I am using a offset of 500 bytes in FireRed JPAN hacked engine

script:
Spoiler:
'---------------
#org 0x807F48
lock
checkflag 0x3
if 0x0 goto 0x8807F84
applymovement 0x1 0x8807FBA
showpokepic 0x1 0x0 0x4
msgbox 0x8807F87 MSG_NORMAL '"Come on Gohan,\nLets go to Roshi's..."
hidepokepic
applymovement 0x2 0x8807FBE
showpokepic 0x2 0x0 0x4
msgbox 0x8807FAC MSG_NORMAL '"Euhhm Okay."
hidepokepic
setvar 0x4001 0x3
release
end

'---------------
#org 0x807F84
release
end


'---------
' Strings
'---------
#org 0x807F87
= Come on Gohan,\nLets go to Roshi's!

#org 0x807FAC
= Euhhm Okay.


'-----------
' Movements
'-----------
#org 0x807FBA
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0xFE 'End of Movements

#org 0x807FBE
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x1D 'Step Down (Fast)
#raw 0x1D 'Step Down (Fast)
#raw 0x1D 'Step Down (Fast)
#raw 0x1D 'Step Down (Fast)
#raw 0x1D 'Step Down (Fast)
#raw 0xFE 'End of Movements
__________________

thanks to Saturnus for helping me with the sig

My hack

  #8947    
Old November 1st, 2013, 09:03 PM
destinedjagold's Avatar
destinedjagold
Oh Hai Thar~ 'ω'
Community Supporter
 
Join Date: May 2007
Location: Philippines
Gender: Male
Nature: Careful
Quote:
Originally Posted by Rezordaxx View Post
So the second move script doesnt work but the first does,
the person event number is correct!
could it be because the sprite isnt in the screen?
Or is it to long or something?
I am using a offset of 500 bytes in FireRed JPAN hacked engine

script:
Spoiler:
'---------------
#org 0x807F48
lock
checkflag 0x3
if 0x0 goto 0x8807F84
applymovement 0x1 0x8807FBA
showpokepic 0x1 0x0 0x4
msgbox 0x8807F87 MSG_NORMAL '"Come on Gohan,\nLets go to Roshi's..."
hidepokepic
applymovement 0x2 0x8807FBE
showpokepic 0x2 0x0 0x4
msgbox 0x8807FAC MSG_NORMAL '"Euhhm Okay."
hidepokepic
setvar 0x4001 0x3
release
end

'---------------
#org 0x807F84
release
end


'---------
' Strings
'---------
#org 0x807F87
= Come on Gohan,\nLets go to Roshi's!

#org 0x807FAC
= Euhhm Okay.


'-----------
' Movements
'-----------
#org 0x807FBA
#raw 0x13 'Step Right (Normal)
#raw 0x13 'Step Right (Normal)
#raw 0xFE 'End of Movements

#org 0x807FBE
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x20 'Step Right (Fast)
#raw 0x1D 'Step Down (Fast)
#raw 0x1D 'Step Down (Fast)
#raw 0x1D 'Step Down (Fast)
#raw 0x1D 'Step Down (Fast)
#raw 0x1D 'Step Down (Fast)
#raw 0xFE 'End of Movements
NPC #2 is too far.
Spoiler:

Horizontally, from the player, NPC's should be 8 or 9 tiles away for your script to reach them.
Also, don't forget to add 'waitmovement 0x0' after each of your 'applymovement' commands.
__________________
  #8948    
Old November 2nd, 2013, 02:50 AM
Rezordaxx's Avatar
Rezordaxx
Asks many questions!
 
Join Date: Aug 2013
Location: The Netherlands
Age: 15
Gender: Male
Nature: Relaxed
Quote:
Originally Posted by destinedjagold View Post
NPC #2 is too far.
Spoiler:

Horizontally, from the player, NPC's should be 8 or 9 tiles away for your script to reach them.
Also, don't forget to add 'waitmovement 0x0' after each of your 'applymovement' commands.
Okay thankyou i will try it!
__________________

thanks to Saturnus for helping me with the sig

My hack

  #8949    
Old November 2nd, 2013, 06:25 AM
Aruaruu
 
Join Date: Sep 2011
Gender: Male
So I am trying to make a script that starts an alternate trainer battle in emerald if a flag has been set.
Basically, I am making an E4 rematch where they have upgraded teams and such.

Here is my current script. Also the alternate trainer battle starts phoebe's battle. Just a placeholder to test.

Spoiler:
#freespace 0xFF
#dynamic 0xE43710

#org @start
lock
faceplayer
checkflag 0x4FB
if 0x1 goto @beaten
checkflag 0x864
if 0x0 goto @battle1
checkflag 0x864
if 0x1 goto @battle2

#org @beaten
= Well, listen to what this loser has\nto say.\pYou've got what it takes to go far.\nNow, go on to the next room and enjoy\lyour next battle!

#org @battle1
playsong 0x1C2 0x0
msgbox @intro 0x4
trainerbattle 0x3 0x105 0x0 @after
goto @defeat

#org @battle2
playsong 0x1C2 0x0
msgbox @intro 0x4
trainerbattle 0x3 0x106 0x0 @after
goto @defeat

#org @after
= Well, how do you like that? I lost!\nEh, it was fun, so it doesn't matter.

#org @intro
= Welcome, challenger!\nI'm SIDNEY of the ELITE FOUR.\pI like that look you're giving me.\nI guess you'll give me a good match.\lThat's good! Looking real good!\pAll right! You and me, let's enjoy\na battle that can only be staged\lhere in the POKéMON LEAGUE!
return

#org @defeat
setflag 0x4FB
call @setmaptile
msgbox @beaten 0x4
release
end

#org @setmaptile
applymovement MOVE_PLAYER @move
waitmovement 0x0
sound 0x8
setmaptile 0x6 0x1 0x344 0x0
setmaptile 0x6 0x2 0x345 0x0
setmaptile 0x0 0x2 0x2DE 0x1
setmaptile 0x1 0x2 0x2DD 0x1
setmaptile 0x2 0x2 0x2DE 0x1
setmaptile 0x3 0x2 0x2DD 0x1
setmaptile 0x4 0x2 0x2DE 0x1
setmaptile 0x8 0x2 0x2DD 0x1
setmaptile 0x9 0x2 0x2DE 0x1
setmaptile 0xA 0x2 0x2DD 0x1
setmaptile 0xB 0x2 0x2DE 0x1
setmaptile 0xC 0x2 0x2DD 0x1
special 0x91
return

#org @move
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements


and here is what it looks like after compiling it.

Spoiler:
'---------------
#org 0xE445B8
lock
faceplayer
checkflag 0x4FB
if 0x1 goto 0x8E445D6
checkflag 0x864
if 0x0 goto 0x8E44660
checkflag 0x864
if 0x1 goto 0x8E4467C
'---------------
#org 0xE445D6
warpteleport2 0xD9 0xE0 0xE0 0xB8 0xDDE0

'---------------
#org 0xE44660
playsong 0x1C2 0x0
msgbox 0x8E446E4 MSG_KEEPOPEN '"Welcome, challenger!\nI'm SIDNEY o..."
trainerbattle 0x3 0x105 0x0 0x8E44698
goto 0x8E447E2

'---------------
#org 0xE4467C
playsong 0x1C2 0x0
msgbox 0x8E446E4 MSG_KEEPOPEN '"Welcome, challenger!\nI'm SIDNEY o..."
trainerbattle 0x3 0x106 0x0 0x8E44698
goto 0x8E447E2

'---------------
#org 0xE447E2
setflag 0x4FB
call 0x8E447F5
msgbox 0x8E445D6 MSG_KEEPOPEN '"Well, listen to what this loser ha..."
release
end

'---------------
#org 0xE447F5
applymovement MOVE_PLAYER 0x8E44873
waitmovement 0x0
sound 0x8
setmaptile 0x6 0x1 0x344 0x0
setmaptile 0x6 0x2 0x345 0x0
setmaptile 0x0 0x2 0x2DE 0x1
setmaptile 0x1 0x2 0x2DD 0x1
setmaptile 0x2 0x2 0x2DE 0x1
setmaptile 0x3 0x2 0x2DD 0x1
setmaptile 0x4 0x2 0x2DE 0x1
setmaptile 0x8 0x2 0x2DD 0x1
setmaptile 0x9 0x2 0x2DE 0x1
setmaptile 0xA 0x2 0x2DD 0x1
setmaptile 0xB 0x2 0x2DE 0x1
setmaptile 0xC 0x2 0x2DD 0x1
special 0x91
return


'---------
' Strings
'---------
#org 0xE446E4
= Welcome, challenger!\nI'm SIDNEY of the ELITE FOUR.\pI like that look you're giving me.\nI guess you'll give me a good match.\lThat's good! Looking real good!\pAll right! You and me, let's enjoy\na battle that can only be staged\lhere in the POKéMON LEAGUE!

#org 0xE44698
= Well, how do you like that? I lost!\nEh, it was fun, so it doesn't matter.

#org 0xE445D6
= Well, listen to what this loser has\nto say.\pYou've got what it takes to go far.\nNow, go on to the next room and enjoy\lyour next battle!


'-----------
' Movements
'-----------
#org 0xE44873
#raw 0x14 'Delay5
#raw 0x14 'Delay5
#raw 0xFE 'End of Movements


Why does the part in bold appear?
The script works fine when tested unless you talk to the npc a second time, at which it tries to warp
the player it seems.
  #8950    
Old November 2nd, 2013, 06:35 AM
~Pokedude~
 
Join Date: Nov 2013
Gender: Male
You must have a complete new offset for the script.
Because 2 scripts overwrote each other, this abnormal thing has outputted.
Closed Thread
Quick Reply

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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 08:56 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.