• 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!
  • Akari, Selene, Mint, Solana - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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.

Events don't trigger while on ice

  • 132
    Posts
    10
    Years
    I have a chase event that's meant to trigger upon Event Touch, whose autonomous movement is set to repeatedly move downwards with THROUGH on. The player has to meander through obstacles sliding on ice while being chased, but this makes the player impervious to triggering any chase events. What can I do? Thanks all :-)

    And a related question: once the player gets a certain distance away from NPCs, the game seems to globally lock distant NPCs' movements. How could I deactivate this?
     
    If you're up for playing around with code, I can point you in the right direction:

    The Game_Player class has the methods check_event_trigger_here and check_event_trigger_there which are called to see if any events have been triggered on the player's current square and the one in front of him, respectfully. You can call these like so:

    Code:
    $game_player.check_event_trigger_here([1,2]) #Check "contact with player" and "contact with event" events on the current tile
    The function Kernel.pbSlideOnIce in PField_Field is what gets called whenever the player slides on the ice. There's a double loop inside it which moves the player forward while on the ice. You could conceivably put the above code in the outer loop, after the event.moving? loop, and break if that function returns true.

    I don't know what side effects, if any, may come of doing something like that, so make sure you test it thoroughly.

    ---

    As to your other question, I'm under the impression that's a function of RMXP and can't be changed, but I could be wrong about that. It does that to make sure off-screen events aren't taking up processing power when they don't have to.

    EDIT: I am wrong about that: the Spriteset_Map script section, line ~290 in the update function makes a call to in_range? to see if the player can see that sprite before updating it. You could comment that call out, but I warn you that that undoubtedly will cause problems with performance, especially when near connected maps. You could also add another check OR'd onto the end of that if statement to test specifically for certain sprites, so they always update.

    If you're not down with coding, move your events onto non-icy ground. :j
     
    Last edited by a moderator:
    Thanks for the help! Oof, normally I'd be pretty gung-ho about scripting but nothing's been working for me today. I will post pictures of the scripts for clarification.
    [PokeCommunity.com] Events don't trigger while on ice

    Note that I've been putting the "break if" anywhere imaginable, inside the loop, outside the loop, wherever. Nothing seems to make a difference though, as the events still don't trigger while on ice.
    [PokeCommunity.com] Events don't trigger while on ice

    For this one, I made an "or" statement like you said, and even tried making a new "if" statement entirely, but still no luck.

    Any idea what I could be missing in either case? Thanks again for your help.
     
    For the latter case, I pointed you to the wrong one by mistake. That loop updates the sprites but not the events. Put that same modification over in the Game_Map section, on line ~452, where there's a similar loop that updates the events (rather than the sprites). My apologies for that.

    As for the ice sliding thing, I'm not sure. I suspect it might be because ice is not passable terrain for any event other than the player. You can try swapping out the "here" method for the "there" method and see if that makes a difference (it reverses the check for terrain passability).

    When I get the chance I'll try coding something up on a clean project.
     
    You can try swapping out the "here" method for the "there" method
    I did try that, I assure you. But it's cool, you don't need to worry about it actually. The event update thing was probably more important, and I got that working at least, thanks to you.
     
    Back
    Top