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 Appearing sprite levelscript issue (https://www.pokecommunity.com/showthread.php?t=472011)

Captain W'Kos April 27th, 2022 12:44 AM

Appearing sprite levelscript issue
 
Hi!
Can someone can tell me, what I made wrong with this level script? I want to make that sprite is appearing while player got a Pokemon and every time, when player is entering the map afterwards.

#org 0x88007C4
compare 0x4055 0x4
if >= jump 0x88007D0
end

#org 0x88007D0
reappear 0x5
end

The script trigger is "On entering the map/not menu is closing."

The sprite is just not appearing on the map.

Captain W'Kos April 30th, 2022 11:27 AM

I'm trying to solve this for three days, it would be nice when someone will amswer...

kalarie April 30th, 2022 2:15 PM

@Captain W'Kos

These aren't even XSE commands? Not sure what you're trying to do exactly, but you should probably set a variable or a flag which should be checked in a level script. I recommend taking Anthroyd's Gen III ROM Hacking Video Tutorials on Youtube to get an understanding of some of the basics of scripting. That will probably help you further;)

Captain W'Kos May 1st, 2022 5:05 AM

I am using PKSV Script Editor bcause it's clear to me. I'm trying to make a new starting town in Kanto and I have scripted person that stops the player when he is trying to leave the town. After he got a starter Pokemon the person stands near the town entrance. And I'm trying to make the levelscript is checking if player got starter Pokemon (variable 4055 is in 4 or larger) then the person sprite appears. If not, he not appears.

About tutorials, I am watching this guy, but I think, his XSE commands are outdated or something, bcause they're different than in-game or compiler scripts, for example #dynamic than #dyn.
I know, #dyn is only for automatic assign code to memory cells, and it isn't saving in code, but this is only example.

Edit: I have modified the script for working in opposite way, I mean, if variable 4055 is smaller than 4 it makes sprite disappear. It still not working like the game is skipping the compare command or the variable isn't smaller than 4 (but it is, bcause variable in that situation is set to 0)

Anyway, the script is now:
#dyn 0x800000
#org @start
compare 0x4055 0x4
if < jump @no
end

#org @no
disappear 0x5
end

The levelscript trigger is still on entering map/not on menu close.

Captain W'Kos May 1st, 2022 9:34 AM

Quote:

Originally Posted by kalarie (Post 10498125)
you should probably set a variable or a flag which should be checked in a level script.

The variable is already set by the game default script (var 4055). The only thing that my script need to do is to read it and execute depending on variable value is (larger or equal) or smaller than 4.

kalarie May 1st, 2022 10:17 AM

@Captain W'Kos

Quote:

About tutorials, I am watching this guy, but I think, his XSE commands are outdated or something, bcause they're different than in-game or compiler scripts, for example #dynamic than #dyn.
I know, #dyn is only for automatic assign code to memory cells, and it isn't saving in code, but this is only example.
Yes, XSE is probably outdated, but PKSV is even more outdated. Really, you should switch to XSE. It's the standard that is used in the community for binary hacking. That it's different than ''in-game'' or ''compiler'' scripts is just nonsense. It probably just has different names for certain commands than PKSV does.

Quote:

#dyn 0x800000
#org @start
compare 0x4055 0x4
if < jump @no
end

#org @no
disappear 0x5
end
This is not how you hide a sprite (semi-)permanently. I'm not familiar with the ''disappear''-command in PKSV, but it's probably the ''hidesprite''-command (entry 0x53) in XSE. That command is only used in an instant script activation to temporarily hide a certain sprite. To hide a sprite (semi-)permanently, you need to assign a flag to an event sprite and set the flag in a script. If you have no idea what I'm talking about, check out Anthroyd's tutorials I mentioned earlier.

Captain W'Kos May 1st, 2022 10:53 AM

Quote:

Originally Posted by kalarie (Post 10498125)
Really, you should switch to XSE.

OK, but there's a little problem here: I am doing everything on the phone and the XSE is crashing when I am launching it by ExaGear. But I'll try to make it work, maybe it needs additional program or something...

And I have a question: Did you know how to decompile addresses that are used by commands? For example special 0x9D and I want to decompile 0x9D address, check how it's made and make a copy with different values. Everything is in my another post "Forcing starter Pokemon gender. And some other issues".

Captain W'Kos May 2nd, 2022 3:11 AM

OK, I am on the PC...
I have compiled the levelscript with that hidesprite command.
It's still not working.

#org 0x80084C
compare 0x4055 0x4
if 0x0 jump 0x88005CC
end


#org 0x8005CC
hidesprite 0x5
end

And are there somewhere a list of equation codes? Belive me, < tells me a little bit more than 0x0...

I have tried it with spriteinvisible, but the effect is still the same...

Tried to split the script into compare and set flag and script with trigger 02 that just executes the hidesprite. I didn't even believe that this thing would work. And it didn't.

script1, trigger 03:

#org 0x80084C
compare 0x4055 0x4
if 0x0 goto 0x88005CC
end

#org 0x8005CC
setflag 0x11
end

Script2, trigger 02:

#org 0x80085B
spriteinvisible 0x5 0x43 0x0
release
end

kalarie May 2nd, 2022 3:20 AM

@Captain W'Kos

Read my last post again. I explicitly told you that this would not work. You need to assign a flag to the overworld sprite and set that flag to make the sprite disappear. Take a look at Anthroyd's tutorials, specifically the one about flags and variables. Although it's probably a good idea to take them all.

Captain W'Kos May 2nd, 2022 4:08 AM

Something like this?
This is what I deduced from the tutorial...
Or maybe I am too dumb...

'---------------
#org 0x80084C
hidesprite 0x5
setflag 0x11
compare 0x4055 0x4
if 0x0 jump 0x8005CC
end

'---------------
#org 0x8005CC
clearflag 0x0011
end


Yeah, I'm dumb... It's not working.

Captain W'Kos May 2nd, 2022 4:33 AM

Quote:

Originally Posted by kalarie (Post 10498401)
This is not how you hide a sprite (semi-)permanently. I'm not familiar with the ''disappear''-command in PKSV, but it's probably the ''hidesprite''-command (entry 0x53) in XSE. That command is only used in an instant script activation to temporarily hide a certain sprite. To hide a sprite (semi-)permanently, you need to assign a flag to an event sprite and set the flag in a script. If you have no idea what I'm talking about, check out Anthroyd's tutorials I mentioned earlier.

How to assign the flag to sprite?

Nevermind, I have found a similar post...
https://www.pokecommunity.com/showthread.php?p=9915945


All times are GMT -8. The time now is 9:19 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.