The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Script setting event position (https://www.pokecommunity.com/showthread.php?t=392872)

ASDBUDDY May 18th, 2017 8:34 AM

setting event position
 
Hi,so I had placed a gaurd at the end of a map who lets you pass after completing a task but after doing that when enter the map back the person event returns to its og postition and as the flag is set it doesn't move again how do i change the person event's pos so that it stays out of the way even after i enter the map again.

Teh Blazer May 23rd, 2017 11:26 AM

Quote:

Originally Posted by ASDBUDDY (Post 9650707)
Hi,so I had placed a gaurd at the end of a map who lets you pass after completing a task but after doing that when enter the map back the person event returns to its og postition and as the flag is set it doesn't move again how do i change the person event's pos so that it stays out of the way even after i enter the map again.

Are you saying that the NPC is at location 1, you make a script that makes them move to location 2 in the map, but once you exit the map and return they're still at location 1?

For that you have to create a level script (which hopefully you know how to do, diegoeisawesome's XSE level script guide tells you how to make level scripts step-by-step).

The script will essentially look like this:
Spoiler:

#dynamic 0xwhatever

#org @start
checkflag 0x[whatever you set in the script]
if 0x1 goto @moveNPC
end

#org @moveNPC
movesprite 0x[NPC ID] 0x[X-Position of location2] 0x[Y-Position of location2]
end

This'll make it so once you set the flag in your original script, the level script will be active and manually move the NPC to location2 every time you enter the map as you enter the map. And rather than the Level Script Type being 0x2 like it is in diegoisawesome's tutorial, since you're only moving NPC's around and not making people talk or anything, you use 0x5.

ASDBUDDY May 23rd, 2017 10:48 PM

Quote:

Originally Posted by Teh Blazer (Post 9655601)
Are you saying that the NPC is at location 1, you make a script that makes them move to location 2 in the map, but once you exit the map and return they're still at location 1?

For that you have to create a level script (which hopefully you know how to do, diegoeisawesome's XSE level script guide tells you how to make level scripts step-by-step).

The script will essentially look like this:
Spoiler:

#dynamic 0xwhatever

#org @start
checkflag 0x[whatever you set in the script]
if 0x1 goto @moveNPC
end

#org @moveNPC
movesprite 0x[NPC ID] 0x[X-Position of location2] 0x[Y-Position of location2]
end

This'll make it so once you set the flag in your original script, the level script will be active and manually move the NPC to location2 every time you enter the map as you enter the map. And rather than the Level Script Type being 0x2 like it is in diegoisawesome's tutorial, since you're only moving NPC's around and not making people talk or anything, you use 0x5.

Oh, ok got it! tho i didn't understand the lvl script type in Diego's XSE tutorial(sorry noob here) but i do understand lvl scripts(kinda cuz i made one right now actually) but thank you so much, I'll try making one thanks :)


All times are GMT -8. The time now is 9:14 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 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 - 2016 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.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.