The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking
Reload this Page Script how to enable the script on the spawn hero and looping animation movement

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 November 3rd, 2018 (11:49 AM). Edited November 4th, 2018 by Dinisk.
Dinisk's Avatar
Dinisk Dinisk is offline
DinisK
 
Join Date: Jan 2017
Gender: Male
Posts: 89
(sorry for english) and Hello, I can not figure out how to make the script work at the very beginning of the game (after all, you need to step on it) there is an option to put four scripts on four sides, but my location will start with the animation of the machine, and the player’s movement cannot be allowed. In the emerald there is such a function and it looks like callasm is accessing it, but I cannot copy the hxd code and paste it into my own. I heard about the third and fifth level scripts when closing the map and opening it. Maybe they work on the appearance of the player? I tried to create a hero with a sprite number (not myself) 0xff that he clicked on the script and made the script work, but somewhere there was an error ... that’s where my brain exploded. There is something else. I created a fountain and I want to loop its animation, it looks like it can be done return and call without end. I did it once, and I lost this construction. In any case, the fountain turns on, runs an animation cycle (one) and stops in the last frame. it was removed accordingly, so that I could move when the fountain is working / not working. And can it be done so that its animation would always be, if I turn it on, even I went beyond the location (10 cells) and come back. this has a connection with my first thought about activating the script when spawning to the card (you can fill the entire card with a script with the fountain turned on, but this is a bad option for me).
fountain script itself:

#dynamic 0x800000

#org @start
checkflag 0x1e(0x200)
if 0x0 goto @chs
if 0x1 goto @No
end

#org @chs
msgbox @chs2 0x5
compare 0x800D 0x1
if 0x1 goto @Yes
if 0x0 goto @No
end

#org @No
msgbox @No2 0x6
applymovement 0x14 @moveoff

end

#org @Yes
msgbox @Yes2 0x6
setflag 0x1e(0x200)
applymovement 0x14 @moveon
clearflag 0x1e(0x200)
end

#org @chs2
= Turn on the fountain?

#org @No2
= Turn off the fountain

#org @Yes2
= You pressed the switch

#org @moveoff
#raw 0xff //sprite set frame 9(in NSE) on map walk on the spot(down) 4d, in this way I get the opportunity to use an extra frame
#raw 0xfe //end stop animation

#org @moveon //cycle of sprites of five frames, some raw contain two frames or one ,on result five ,do not pay attention to which sprite corresponds to the frame, it does not matter
#raw 0x2b
#raw 0x18
#raw 0x29
#raw 0x18
#raw 0x4
#raw 0xfe
//during switching on//off, turning off the fountain, it is desirable that its state can be changed
Reply With Quote
  #2   Link to this post, but load the entire thread.  
Old November 4th, 2018 (2:07 AM).
DrFuji's Avatar
DrFuji DrFuji is offline
Heiki Hecchara‌‌
 
Join Date: Sep 2009
Location: Aussie
Age: 30
Gender: Male
Nature: Jolly
Posts: 1,693
Quote:
Originally Posted by Dinisk View Post
(sorry for english) and Hello, I can not figure out how to make the script work at the very beginning of the game (after all, you need to step on it) there is an option to put four scripts on four sides, but my location will start with the animation of the machine, and the player’s movement cannot be allowed. In the emerald there is such a function and it looks like callasm is accessing it, but I cannot copy the hxd code and paste it into my own. I heard about the third and fifth level scripts when closing the map and opening it. Maybe they work on the appearance of the player? I tried to create a hero with a sprite number (not myself) 0xff that he clicked on the script and made the script work, but somewhere there was an error ... that’s where my brain exploded.
FR actually does have a level script that plays when you begin in your room. It makes the player face up rather than down upon spawning for the first time. Its a type 02 level script that will only activate once and is dependent on a variable's value in order to run. You should be able to easily adapt it for your script. Since you seem to be interested in level scripts, I'd suggest that you read this tutorial to learn more about them.

Quote:
Originally Posted by Dinisk View Post
There is something else. I created a fountain and I want to loop its animation, it looks like it can be done return and call without end. I did it once, and I lost this construction. In any case, the fountain turns on, runs an animation cycle (one) and stops in the last frame. it was removed accordingly, so that I could move when the fountain is working / not working. And can it be done so that its animation would always be, if I turn it on, even I went beyond the location (10 cells) and come back. this has a connection with my first thought about activating the script when spawning to the card (you can fill the entire card with a script with the fountain turned on, but this is a bad option for me).
I had a bit of trouble understanding what you're talking about here, but I'll try to help where possible.

While your way of making a constant animation with an OW sprite is pretty good, I think that this situation would be better suited for a tile animation. With a tile animation you can have far more frames and they will repeat constantly until you change the tiles via scripting. If you've never made new tile animations you can get a small overview and a download for Lu-Ho's Tileset Animation Editor from this thread. You would need to edit the tileset that you're using so that you have two different types of fountain: One that has animated tiles and another that doesn't.

If you do change over to using tiles instead of an OW you will need to make two scripts, a regular signpost script and a level script. Here's what they would look like:

Code:
#dynamic 0x800000

#org @start
checkflag 0x200 // You need to use a regular flag if you want the fountain to remember being on/off when you leave the map. You can also use a variable instead
if 0x1 goto @TurnOff
msgbox @On? 0x5
closeonkeypress
compare 0x800D 0x1
if 0x1 goto @TilesOn
end

#org @TurnOff
msgbox @Off? 0x5
closeonkeypress
compare 0x800D 0x1
if 0x1 goto @TilesOff
end

#org @TilesOn
msgbox @Button 0x6
setmaptile 0x3 0x3 0x20 0x1
... // Set as many tiles as you need to recreate the fountain with animated tiles
special 0x8E // Updates the map
setflag 0x200
end

#org @TilesOff
msgbox @Button 0x6
setmaptile 0x3 0x3 0x30 0x1
... // Set as many tiles as you need to recreate the fountain with animated tiles
special 0x8E // Updates the map
clearflag 0x200
end

#org @On?
= Turn on the fountain?

#org @Off?
= Turn off the fountain?

#org @Button
= You pressed the switch.
This level script will work with level script types 01 and 05:

Code:
#dynamic 0x800000

#org @start
checkflag 0x200
if 0x0 goto @skip
setmaptile 0x3 0x3 0x20 0x1
... // Set as many tiles as you need to recreate the fountain with animated tiles
end

#org @skip
end
Hopefully that all helps.
__________________
Reply With Quote
  #3   Link to this post, but load the entire thread.  
Old November 4th, 2018 (3:58 AM).
Dinisk's Avatar
Dinisk Dinisk is offline
DinisK
 
Join Date: Jan 2017
Gender: Male
Posts: 89
Quote:
Originally Posted by DrFuji View Post
FR actually does have a level script that plays when you begin in your room. It makes the player face up rather than down upon spawning for the first time. Its a type 02 level script that will only activate once and is dependent on a variable's value in order to run. You should be able to easily adapt it for your script. Since you seem to be interested in level scripts, I'd suggest that you read this tutorial to learn more about them.



I had a bit of trouble understanding what you're talking about here, but I'll try to help where possible.

While your way of making a constant animation with an OW sprite is pretty good, I think that this situation would be better suited for a tile animation. With a tile animation you can have far more frames and they will repeat constantly until you change the tiles via scripting. If you've never made new tile animations you can get a small overview and a download for Lu-Ho's Tileset Animation Editor from this thread. You would need to edit the tileset that you're using so that you have two different types of fountain: One that has animated tiles and another that doesn't.

If you do change over to using tiles instead of an OW you will need to make two scripts, a regular signpost script and a level script. Here's what they would look like:

Code:
#dynamic 0x800000

#org @start
checkflag 0x200 // You need to use a regular flag if you want the fountain to remember being on/off when you leave the map. You can also use a variable instead
if 0x1 goto @TurnOff
msgbox @On? 0x5
closeonkeypress
compare 0x800D 0x1
if 0x1 goto @TilesOn
end

#org @TurnOff
msgbox @Off? 0x5
closeonkeypress
compare 0x800D 0x1
if 0x1 goto @TilesOff
end

#org @TilesOn
msgbox @Button 0x6
setmaptile 0x3 0x3 0x20 0x1
... // Set as many tiles as you need to recreate the fountain with animated tiles
special 0x8E // Updates the map
setflag 0x200
end

#org @TilesOff
msgbox @Button 0x6
setmaptile 0x3 0x3 0x30 0x1
... // Set as many tiles as you need to recreate the fountain with animated tiles
special 0x8E // Updates the map
clearflag 0x200
end

#org @On?
= Turn on the fountain?

#org @Off?
= Turn off the fountain?

#org @Button
= You pressed the switch.
This level script will work with level script types 01 and 05:

Code:
#dynamic 0x800000

#org @start
checkflag 0x200
if 0x0 goto @skip
setmaptile 0x3 0x3 0x20 0x1
... // Set as many tiles as you need to recreate the fountain with animated tiles
end

#org @skip
end
Hopefully that all helps.
in fact, you can create entire overworld cities in the bottom edge in the screenshot, you can see the OAK laboratory. OW is good because it is dynamic, unlike the background, which is semi-dynamic (changes the palette, when you exit the locations). dynamic palettes. Thus, ow is responsible for buildings (not counting npc). and for landscape, it allows you to spend resources more efficiently. Thanks for the answer, I will try to understand and use it
Reply With Quote
  #4   Link to this post, but load the entire thread.  
Old November 4th, 2018 (4:05 AM). Edited November 4th, 2018 by Dinisk.
Dinisk's Avatar
Dinisk Dinisk is offline
DinisK
 
Join Date: Jan 2017
Gender: Male
Posts: 89
I wonder if it can be looped, with frames. If scripts have such a function with frames in general(applymovement)
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:14 AM.