• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script✓] how to enable the script on the spawn hero and looping animation movement

Dinisk

DinisK
  • 89
    Posts
    8
    Years
    • Seen Apr 27, 2019
    (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:
    [PokeCommunity.com] how to enable the script on the spawn hero and looping animation movement

    #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
     
    Last edited:
    (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.

    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.
     
    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
     
    I wonder if it can be looped, with frames. If scripts have such a function with frames in general(applymovement)
     
    Last edited:
    Back
    Top