Script to temporarily disable all event interactions

● ARCHIVED · READ-ONLY
Started by mdqp 9 posts View original ↗
  1. Is there a way to disable/enable event interactions at will? And maybe exclude specific events from being disabled?

    Let's say (for example) I wanted to have a "freeze time" spell available for players at all time. Not only would I need to stop movement, I'd need the NPCs to stop talking if interacted with, while at the same time allowing certain events to work (if, for example, I wanted the players to be able to pickpocket an item from a frozen NPC). Doing this with switches is too much work and error prone (I'd need an event page for ALL events in all maps, since the spell should be able to work anywhere, and I would probably want to block exits as well).

    I actually need such a script for a variety of scenarios, so I am not looking specifically for a way to implement my example (even though I could use it), I need the script itself. I am willing to pay, if such a script requires extensive work (I'd like to use the script in commercial game).

    Edit:

    Nevermind, I think I managed to create it myself (I figured it would be harder XD).

    If anyone is interested, this is how I did it:

    class Game_Event < Game_Character

    alias mdqp_block_start start
    def start
    return if empty?
    unless $game_switches[160] == true
    @starting = true
    lock if trigger_in?([0,1,2])
    else
    if @event.name.include?("&&")
    @starting = true
    lock if trigger_in?([0,1,2])
    end

    end
    end
    end

    I use the switch 160 to stop events from starting (but of course, any other condition would work) and I identify the events I want to still be interactive if they include "&&" in the name. I can imagine most people wouldn't want to mess with this, since disabling all events can be potentially disastrous, bit I figure it could be interesting. I don't know if this stops movement (probably not), but it's going to solve a lot of my problems (and usually NPCs are stationary in my game anyway).
  2. Yanfly's Disable Event movement script is pretty close to what you want. You set a switch in the script, and once that switch is on, nothing can move but the player. You'll have to event the interactions for when the switch is ON, but that will be true for any script you request as no scripter can handle that part for you. So you'll still need a page unique to when that switch is ON to handle exits and NPC stealing, as again, no scripter can handle that for you (as how would a script know it is an exit? Or an NPC?)
  3. bgillisp said:
    Yanfly's Disable Event movement script is pretty close to what you want. You set a switch in the script, and once that switch is on, nothing can move but the player. You'll have to event the interactions for when the switch is ON, but that will be true for any script you request as no scripter can handle that part for you. So you'll still need a page unique to when that switch is ON to handle exits and NPC stealing, as again, no scripter can handle that for you (as how would a script know it is an exit? Or an NPC?)

    Thanks, I'll probably use that script together with what I created, and I should be able to get the exact effect I want. Thanks a lot for letting me know! :)
  4. NP. I'll leave this open for now in case you end up needing a different script, if that is the case please state what else you need that the script is not doing. Otherwise, let us know and we can close this thread.
  5. You went to the trouble of aliasing the method, but then you completely rewrote it and didn't call the aliased method anyway.

    Code:
    class Game_Event < Game_Character
      alias mdqp_block_start start
      def start
        return if $game_switches[160] && !@event.name.include?('&&')
        mdqp_block_start
      end
    end

    So you're saying if that switch is on and the event doesn't include && in the name, you're not going to start it. Otherwise, proceed as you normally would.
  6. I would also be very interested in a script that accomplishes this effect.
  7. um - I just posted one right above you.
  8. bgillisp said:
    NP. I'll leave this open for now in case you end up needing a different script, if that is the case please state what else you need that the script is not doing. Otherwise, let us know and we can close this thread.

    I think I should not need any more help on this matter, so we can close the thread, as far as I am concerned. :)

    Shaz said:
    You went to the trouble of aliasing the method, but then you completely rewrote it and didn't call the aliased method anyway.

    Code:
    class Game_Event < Game_Character
      alias mdqp_block_start start
      def start
        return if $game_switches[160] && !@event.name.include?('&&')
        mdqp_block_start
      end
    end

    So you're saying if that switch is on and the event doesn't include && in the name, you're not going to start it. Otherwise, proceed as you normally would.

    Ah-ah, yes, I was doing some quick testing, and I must have forgotten. I am not a programmer by trade, so everything I do is hacked together poorly, most of the times.
  9. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.