Advertiser Content

Tutorial diegoisawesome's MEGA-HUGE XSE Scripting Tutorial Page 49

Started by Diegoisawesome December 26th, 2008 6:55 PM
  • 593836 views
  • 1216 replies

DrFuji

Heiki Hecchara‌‌

Age 26
Male
Aussie
Seen 1 Hour Ago
Posted 3 Hours Ago
1,602 posts
9.9 Years
Having some problems moving the camera with a script tile. I'm setting unknown to 3 and my script doesn't crash. It simply doesn't move the camera. Even using a waitmovement 0x7F after my applymovement call.
Are you able to post your script so other members can analyse it and find out what's wrong?

Make sure that you're including the commands 'special 0x113' and 'special 0x114' before and after moving the camera.

pikachux2

Never Evolve

Male
USA
Seen May 5th, 2019
Posted May 3rd, 2019
116 posts
9.4 Years
Are you able to post your script so other members can analyse it and find out what's wrong?

Make sure that you're including the commands 'special 0x113' and 'special 0x114' before and after moving the camera.
Special 0x113 and 0x114 were the problem, I hadn't heard about them. Thanks :)

Now am I able to move the camera with the movesprite or movesprite2 cmds? I have a script where this would be much easier than adjusting the camera based on players initial location with an applymovement cmd.

BluRose

blu rass

Age 18
Male
rip x
Seen 2 Weeks Ago
Posted July 10th, 2019
763 posts
5.3 Years
Now am I able to move the camera with the movesprite or movesprite2 cmds? I have a script where this would be much easier than adjusting the camera based on players initial location with an applymovement cmd.
try with the npc id 0xFE (or 0xFF? i can't remember)
am i cool yet

pikachux2

Never Evolve

Male
USA
Seen May 5th, 2019
Posted May 3rd, 2019
116 posts
9.4 Years
The camera is 0x7F, but as far as I can tell I'm not able to move it with any movesprite cmd. Also having a problem were the sprite whose ID initiates my script keeps turning to face against the player each time I applymovement 0xFF. This is bizarre to me because I'm not even using a faceplayer cmd, or msgbox 0x6 (which I think deals with some kind of faceplayer call, if I'm correct). Even more bizarre because the player moves earlier in the script and doesn't trigger the NPC to move.

Spoiler:
#dynamic 0x819170

#org @main
lockall
compare 0x407D 0x4
if 0x4 goto @afterWon
compare 0x407D 0x2
if 0x1 goto @rematch
if 0x0 goto @original
goto @end

#org @original
msgbox @challenge 0x5
compare 0x800D 0x1
if 0x1 goto @wantsChallenge
setvar 0x407D 0x1
msgbox @okay 0x4
closeonkeypress
goto @end

#org @rematch
msgbox @rematchMsg 0x5
compare 0x800D 0x1
if 0x1 goto @wantsChallenge
msgbox @okay 0x4
closeonkeypress
goto @end

#org @wantsChallenge
msgbox @challengeStart 0x4
closeonkeypress
pause 0x10
fadescreen 0x1
setflag 0x113
movesprite 0xFF 0x23 0xB
movesprite2 0x7F 0x23 0xB
pause 0x10
setflag 0x114
pause 0x20
fadescreen 0x0
compare 0x407D 0x1
if 0x3 call @intros
applymovement 0xFF @lookRight
applymovement 0x3 @rightKidMoveIn
waitmovement 0x3
setvar 0x407D 0x2
trainerbattle 0x1 0x43 0x0 @before @after @battle2
goto @end

#org @battle2
msgbox @1stWin 0x4
closeonkeypress
applymovement 0x3 @rightKidBackOut
applymovement 0x8 @bottomKidMoveIn
applymovement 0xFF @lookDown
waitmovement 0x8
trainerbattle 0x1 0x44 0x0 @before2 @after2 @battle3
goto @end

#org @battle3
msgbox @2ndWin 0x4
closeonkeypress
applymovement 0x8 @bottomKidBackOut
applymovement 0x1 @leftKidMoveIn
applymovement 0xFF @lookLeft
waitmovement 0x1
trainerbattle 0x1 0x42 0x0 @before3 @after3 @battle4
goto @end

#org @battle4
msgbox @3rdWin 0x4
closeonkeypress
applymovement 0x1 @leftKidBackOut
applymovement 0x4 @topKidMoveIn
applymovement 0xFF @lookUp
waitmovement 0x1
trainerbattle 0x1 0x41 0x0 @before4 @after4 @won
goto @end

#org @won
setvar 0x407D 0x3
msgbox @finalWin 0x4
closeonkeypress
applymovement 0x4 @topKidBackOut
waitmovement 0x4
pause 0x30
applymovement 0xFF @lookAround
waitmovement 0xFF
pause 0x30
applymovement 0x1 @suprised
applymovement 0x3 @suprised
applymovement 0x8 @suprised
applymovement 0x4 @suprised
waitmovement 0x0
applymovement 0x3 @rightKidMoveIn
applymovement 0xFF @lookRight
waitmovement 0x3
msgbox @youWin 0x4
closeonkeypress
msgbox @prize 0x4
countpokemon
compare 0x800D 0x6
if 0x1 goto @partyFull
setvar 0x8006 0x0
loadpointer 0x0 @magby
special 0x25
setvar 0x8006 0x1
loadpointer 0x0 @elekid
special 0x25
multichoice 0x12 0x8 0x20 0x0
compare 0x800D 0x0
if 0x1 @pickedMag
compare 0x800D 0x1
if 0x1 @pickedEle
msgbox @wantNone 0x4
closeonkeypress
goto @end

#org @pickedMag
pause 0x30
givepokemon 0xF0 0xC 0x0 0x0 0x0 0x0
fanfare 0x101
msgbox @gotPokeMag 0x4
waitfanfare
closeonkeypress
msgbox @giveNickname 0x5
compare 0x800D 0x1
if 0x1 call @name
msgbox @takeCareMag 0x4
closeonkeypress
setvar 0x407D 0x5
goto @end

#org @pickedEle
pause 0x30
givepokemon 0xEF 0xC 0x0 0x0 0x0 0x0
fanfare 0x101
msgbox @gotPokeEle 0x4
waitfanfare
closeonkeypress
msgbox @giveNickname 0x5
compare 0x800D 0x1
if 0x1 call @name
msgbox @takeCareEle 0x4
closeonkeypress
setvar 0x407D 0x4
goto @end

#org @name
countpokemon
subvar 0x800D 0x1
copyvar 0x8004 0x800D
fadescreen 0x1
special 0x9E
waitstate
return

#org @intros
applymovement 0xFF @lookRight
msgbox @welcome1 0x4
closeonkeypress
applymovement 0xFF @lookDown
msgbox @welcome2 0x4
closeonkeypress
applymovement 0xFF @lookLeft
msgbox @welcome3 0x4
closeonkeypress
applymovement 0xFF @lookUp
msgbox @welcome4 0x4
closeonkeypress
return

#org @partyFull
msgbox @partyFullMsg 0x4
closeonkeypress
goto @end

#org @afterWon
msgbox @afterMsg 0x4
closeonkeypress
goto @end

#org @end
releaseall
end


there is the body if anyone wants to check it out...

DrFuji

Heiki Hecchara‌‌

Age 26
Male
Aussie
Seen 1 Hour Ago
Posted 3 Hours Ago
1,602 posts
9.9 Years
Now am I able to move the camera with the movesprite or movesprite2 cmds? I have a script where this would be much easier than adjusting the camera based on players initial location with an applymovement cmd.
There's really only one instant move camera command and its extremely buggy. It will move every OW (including the player) rather than just the camera, resets all OWs original positions after a trainerbattle and if you don't move the camera back to its original position after using it, will mess with the movement permissions of the map. It should only really be used in the context of the video in the thread (looking at something far away) and isn't suited for your purpose at all.

The camera is 0x7F, but as far as I can tell I'm not able to move it with any movesprite cmd. Also having a problem were the sprite whose ID initiates my script keeps turning to face against the player each time I applymovement 0xFF. This is bizarre to me because I'm not even using a faceplayer cmd, or msgbox 0x6 (which I think deals with some kind of faceplayer call, if I'm correct). Even more bizarre because the player moves earlier in the script and doesn't trigger the NPC to move.

there is the body if anyone wants to check it out...
I'm not 100% sure why the OW is acting like that based of your script, but make sure that it isn't sharing its 'Person Event Number' with any other OW. If that isn't the case, you could try writing an extra applymovement command each time the player changes their facing direction that changes the troublesome OW's facing direction to the correct one.

Also, you're using setflag 0x113/ 0x114 instead of the special command in your script. Finally, its msgbox 0x2 that has lock/ faceplayer automatically built-in. Here's what it says in the first post of this thread:

Spoiler:
Msgbox Numbers
Here are the many different types, taken directly from The ROM Hacking Newsletter, also located in the ROM Hacking section.
This week's tip comes from HackMew. This time, it's all about msgboxes. Below is a description, script example and in-game shot of the different msgbox types.

0x2
Spoiler:
Description:
This is the msgbox used for normal people. Using this type means that you don't need to use the lock, faceplayer or release commands.

Script:
#dynamic 0x800000


#org @start
msgbox @hello 0x2
end

#org @hello
= Hello, my name is dshayabusa.


0x3
Spoiler:
Description:
Used for signs etc. No lock or faceplayer effect. Only shows the sign textbox when used on an actual sign.

Script:
#dynamic 0x800000



#org @start
msgbox @sign 0x3
end

#org @sign
= You are here

0x4
Spoiler:
Description:
A normal msgbox except for the fact that it does not close. Command closeonkeypress must be used to close it. No lock or faceplayer effect.

Script:
#org @start
msgbox @hello 0x4
end

#org @hello
= Hello, my name is dshayabusa.

0x5
Spoiler:
Description:
Used for Yes/No questions. No lock or faceplayer effect.

Script:
#dynamic 0x800000


#org @start
msgbox @question 0x5
end

#org @question
= Is this statement false?

0x6
Spoiler:
Description:
Normal textbox. Has no lock or faceplayer effect.

Script:

#dynamic 0x800000

#org @start
msgbox @hello 0x6
end

#org @hello
= Hello, my name is dshayabusa.

pikachux2

Never Evolve

Male
USA
Seen May 5th, 2019
Posted May 3rd, 2019
116 posts
9.4 Years
There's really only one instant move camera command and its extremely buggy. It will move every OW (including the player) rather than just the camera, resets all OWs original positions after a trainerbattle and if you don't move the camera back to its original position after using it, will mess with the movement permissions of the map. It should only really be used in the context of the video in the thread (looking at something far away) and isn't suited for your purpose at all.



I'm not 100% sure why the OW is acting like that based of your script, but make sure that it isn't sharing its 'Person Event Number' with any other OW. If that isn't the case, you could try writing an extra applymovement command each time the player changes their facing direction that changes the troublesome OW's facing direction to the correct one.

Also, you're using setflag 0x113/ 0x114 instead of the special command in your script. Finally, its msgbox 0x2 that has lock/ faceplayer automatically built-in. Here's what it says in the first post of this thread:

Spoiler:
Msgbox Numbers
Here are the many different types, taken directly from The ROM Hacking Newsletter, also located in the ROM Hacking section.
This week's tip comes from HackMew. This time, it's all about msgboxes. Below is a description, script example and in-game shot of the different msgbox types.

0x2
Spoiler:
Description:
This is the msgbox used for normal people. Using this type means that you don't need to use the lock, faceplayer or release commands.

Script:
#dynamic 0x800000


#org @start
msgbox @hello 0x2
end

#org @hello
= Hello, my name is dshayabusa.


0x3
Spoiler:
Description:
Used for signs etc. No lock or faceplayer effect. Only shows the sign textbox when used on an actual sign.

Script:
#dynamic 0x800000



#org @start
msgbox @sign 0x3
end

#org @sign
= You are here

0x4
Spoiler:
Description:
A normal msgbox except for the fact that it does not close. Command closeonkeypress must be used to close it. No lock or faceplayer effect.

Script:
#org @start
msgbox @hello 0x4
end

#org @hello
= Hello, my name is dshayabusa.

0x5
Spoiler:
Description:
Used for Yes/No questions. No lock or faceplayer effect.

Script:
#dynamic 0x800000


#org @start
msgbox @question 0x5
end

#org @question
= Is this statement false?

0x6
Spoiler:
Description:
Normal textbox. Has no lock or faceplayer effect.

Script:

#dynamic 0x800000

#org @start
msgbox @hello 0x6
end

#org @hello
= Hello, my name is dshayabusa.
Thanks for all the help! I've deduced that its the trainerbattle 0x1 cmd that's causing the movement... I assume that it has a faceplayer call... I figured this out by trying to turn the sprite, just to have her turn back when the @before msgbox appears for the trainerbattle.

/JASHIN/

Age 25
Male
Canada
Seen 3 Weeks Ago
Posted June 18th, 2019
50 posts
278 Days
Is there a way to compare a variable based on whether it is higher or lower than a certain number?

For example..

if 0x4011 > 20 event happens
POKEMON PULSAR VERSION PHASE 02 THREAD: https://www.pokecommunity.com/showthread.php?t=421565
(Phase 02 Trailer Coming Soon)


POKEMON PULSAR VERSION PHASE 01 TRAILER:https://www.youtube.com/watch?v=5vpuR7c2XGY
(Formerly known as Pokemon Jashin Version)


-Praise Be To Jashin

DrFuji

Heiki Hecchara‌‌

Age 26
Male
Aussie
Seen 1 Hour Ago
Posted 3 Hours Ago
1,602 posts
9.9 Years
Is there a way to compare a variable based on whether it is higher or lower than a certain number?

For example..

if 0x4011 > 20 event happens
You can use the 'compare' command to do that easily. Here's what your example would look like with it:

compare 0x4011 0x14
if 0x2 goto @EventHappens
The first line is pretty simple, you just write the variable you want to use and then the value that you want to compare it to. The second line is tricky if you don't know what XSE's 'if values' mean. Here's a table that diegoisawesome has on the first page:

Lower Than (0x0)
Equals (0x1)
Greater Than (0x2)
Lower than or Equal to (0x3)
Greater than or Equal to (0x4)
Not exactly equal to (0x5)
Since I'm using 'if 0x2', the script will only move onto @EventHappens if 0x4011 is greater than 20 (0x14). Hopefully that all makes sense.

/JASHIN/

Age 25
Male
Canada
Seen 3 Weeks Ago
Posted June 18th, 2019
50 posts
278 Days
Beautiful!

Thank you very much!
POKEMON PULSAR VERSION PHASE 02 THREAD: https://www.pokecommunity.com/showthread.php?t=421565
(Phase 02 Trailer Coming Soon)


POKEMON PULSAR VERSION PHASE 01 TRAILER:https://www.youtube.com/watch?v=5vpuR7c2XGY
(Formerly known as Pokemon Jashin Version)


-Praise Be To Jashin

/JASHIN/

Age 25
Male
Canada
Seen 3 Weeks Ago
Posted June 18th, 2019
50 posts
278 Days
Hi, I'm trying to execute a code that allows me to evolve a certain pokemon in my party (I'm actually form changing it, but I have inserted a routine to skip the evolution sequence. The issue I'm having is forcing the game to specifically ONLY evolve the particular pokemon.

So far I have this code: (note that my issue isn't with the routine, but rather with making the game understand that I picked A certain pokemon and any other pokemon will not be allowed to evolve)
Spoiler:

#org @start
lock
msgbox @talk1 0x6 "If bulbasaur is in your party its going to evolve"
setvar 0x8004 0x1
special2 0x800D 0x17C
compare 0x800D 0x1
if 0x1 goto @have
end

#org @have
From here is where I'm having issues. I need the game to give me bulbasaur's slot number in the party so I can execute this code:
Setvar 0x8001 0x(whichever slot Bubasaur is in)
callasm 0x900000 (This will evolve the pokemon in that slot.)
end


So, yeah.. Basically I need the game to check if I have the pokemon, find which slot that pokemon is in and execute that ASM to evolve it... Does anyone have any information? It would be greatly appreciated. BTW I got the ASM from here if that helps..

https://www.pokecommunity.com/showpost.php?p=8513813&postcount=39
POKEMON PULSAR VERSION PHASE 02 THREAD: https://www.pokecommunity.com/showthread.php?t=421565
(Phase 02 Trailer Coming Soon)


POKEMON PULSAR VERSION PHASE 01 TRAILER:https://www.youtube.com/watch?v=5vpuR7c2XGY
(Formerly known as Pokemon Jashin Version)


-Praise Be To Jashin
Seen June 16th, 2019
Posted June 15th, 2019
15 posts
75 Days
I have a question. If I use special 0x9f to select a pokemon. How would I execute a script to basically say if the chosen pokemon is (let's say pikachu) perform this script. If it's not pikachu perform this script. Basically I'm wondering if special 0x9f stores the index pokemon of the pokemon u chose and if I can use a compare to set up 2 scenarios. I'm wondering which var it would load the index number to

Avara

Author of Tales

Female
Izantine
Seen 3 Hours Ago
Posted July 1st, 2019
1,051 posts
7.7 Years
Is there a way to prevent you from stepping on a tile unless you have at least one Pokémon? It's supposed to be like when Professor Oak stops you from going on route 1 in Fire Red/Leaf Green.
You could use a level script triggered in the overworld for that (the green "S" tiles). Diego's covered how these work in this tutorial already, alternatively there's this post. You could use that in combination with a flag check for if the Pokemon menu has been activated (flag 0x828 for FR, 0x860 for EM) or the countpokemon command. Hope that helps!
Advertiser Content