The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script Appearing sprite levelscript issue

Notices
For all updates, view the main page.

Binary ROM Hacking Need a helping hand or just want to talk about binary ROM hacks? Get comments and answers to any ROM Hacking-related problems, questions or thoughts you have here.

Ad Content
Reply
 
Thread Tools
  #1   Link to this post, but load the entire thread.  
Old April 27th, 2022 (12:44 AM). Edited April 27th, 2022 by Captain W'Kos.
Captain W'Kos's Avatar
Captain W'Kos Captain W'Kos is offline
 
Join Date: Apr 2022
Posts: 17
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.
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old April 30th, 2022 (11:27 AM).
Captain W'Kos's Avatar
Captain W'Kos Captain W'Kos is offline
 
Join Date: Apr 2022
Posts: 17
I'm trying to solve this for three days, it would be nice when someone will amswer...
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old April 30th, 2022 (2:15 PM).
kalarie kalarie is offline
 
Join Date: Jun 2008
Posts: 760
@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;)
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old May 1st, 2022 (5:05 AM). Edited May 1st, 2022 by Captain W'Kos.
Captain W'Kos's Avatar
Captain W'Kos Captain W'Kos is offline
 
Join Date: Apr 2022
Posts: 17
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.
Reply With Quote
  #5   Link to this post, but load the entire thread.  
Old May 1st, 2022 (9:34 AM). Edited May 1st, 2022 by Captain W'Kos.
Captain W'Kos's Avatar
Captain W'Kos Captain W'Kos is offline
 
Join Date: Apr 2022
Posts: 17
Quote:
Originally Posted by kalarie View Post
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.
Reply With Quote
  #6   Link to this post, but load the entire thread.  
Old May 1st, 2022 (10:17 AM).
kalarie kalarie is offline
 
Join Date: Jun 2008
Posts: 760
@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.
Reply With Quote
  #7   Link to this post, but load the entire thread.  
Old May 1st, 2022 (10:53 AM). Edited May 1st, 2022 by Captain W'Kos.
Captain W'Kos's Avatar
Captain W'Kos Captain W'Kos is offline
 
Join Date: Apr 2022
Posts: 17
Quote:
Originally Posted by kalarie View Post
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".
Reply With Quote
  #8   Link to this post, but load the entire thread.  
Old May 2nd, 2022 (3:11 AM). Edited May 2nd, 2022 by Captain W'Kos.
Captain W'Kos's Avatar
Captain W'Kos Captain W'Kos is offline
 
Join Date: Apr 2022
Posts: 17
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
Reply With Quote
  #9   Link to this post, but load the entire thread.  
Old May 2nd, 2022 (3:20 AM).
kalarie kalarie is offline
 
Join Date: Jun 2008
Posts: 760
@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.
Reply With Quote
  #10   Link to this post, but load the entire thread.  
Old May 2nd, 2022 (4:08 AM). Edited May 2nd, 2022 by Captain W'Kos.
Captain W'Kos's Avatar
Captain W'Kos Captain W'Kos is offline
 
Join Date: Apr 2022
Posts: 17
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.
Reply With Quote
  #11   Link to this post, but load the entire thread.  
Old May 2nd, 2022 (4:33 AM).
Captain W'Kos's Avatar
Captain W'Kos Captain W'Kos is offline
 
Join Date: Apr 2022
Posts: 17
Quote:
Originally Posted by kalarie View Post
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
Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
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

Forum Jump


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