- 2
- Posts
- 11
- Years
- Seen Feb 4, 2021
Differences between goto and call?
Differences between goto and call?
Differences between goto and call?
#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?
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.
#org @move3
#raw 0x56
#raw 0x00
[COLOR="Red"]#raw 0xFE[/COLOR]
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 [COLOR=Red]#raw 0xFE[/COLOR]
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.
#dynamic 0x800000
#org @start
checkflag 0x8D6
[COLOR="Red"]if 0x1 goto @done[/COLOR]
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
[COLOR="red"]#org @done
release
end[/COLOR]
#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
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?
fixes are in red.
Code:#dynamic 0x800000 #org @start checkflag 0x8D6 [COLOR=Red]if 0x1 goto @done[/COLOR] 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 [COLOR=red]#org @done release end[/COLOR] #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)
Da... heck...?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)
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?
@DaniilS, words? are you talking about buffers?
Spoiler:setvar 0x800D 0x77
bufferpokemon 0x1 0x800D
is the equivalent ofSpoiler:bufferpokemon 0x1 0x77
if arg <= 0x3FFF:
goto use_number_as_is
else:
goto use_variable_decrypter
#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
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.