Any way to affect the self-switch of a neighbouring event?

Hey everyone,

I came up with a nice ''furniture'' system for my IGMC entry and it's going to be one of the key mechanics in the game.

That said, it's just affecting the one tile the player aims at, is there some way to have the event ''check'' for the event above it and set the self-switch of that event to X as long as it's not set to anything already?

Thanks!
Sure, use a global event (or variable, or combination of switch and variable if you have multiple furniture) and add an extra auto-run page that turns on said self-switch and turns off the main switch. 🙂
You can also do it by a script call:

$game_self_switches[[68, 73, 'A']] = true

That will set the self switch on map 68, event 73, switch A to true. Replace it with what numbers you need.
Sure, use a global event (or variable, or combination of switch and variable if you have multiple furniture) and add an extra auto-run page that turns on said self-switch and turns off the main switch. 🙂
Hmm, I've considered this, but the problem is that my current system doesn't restrict the player from placing anything anywhere, so it's going to be really difficult to predict all the switches... Hmm. That said maybe I should just go with smaller rooms and then the number of switches won't be so massive.

As in, let's say I have a grandfather clock item in my inventory. I use the ''use item on event'' script to use the item on Tile A. I'd like the tile above it, Tile B to detect the change to tile A and change to the top of the clock, no matter what the tile A and B are.

@bgillisp (Sorry I don't know how to quote in a previously written post)

 

Hmm, that's quite simple and promising, can I make 68 and 73 relative somehow? As in thisevent.x, thisevent.y+1? (I dont know the script calls. ^^')

Ah nevermind, I misread that. Hmm.

Any way to replace event 73 with ''event at X = a, Y = b?

EDIT: Sorry for the double post, I didn't notice that bgillisp posted when I was writing.
As in, let's say I have a grandfather clock item in my inventory. I use the ''use item on event'' script to use the item on Tile A. I'd like the tile above it, Tile B to detect the change to tile A and change to the top of the clock, no matter what the tile A and B are.
Ah, that does complicate things a bit.

Now, there is an eventing solution for this. It would involve using a variable to display the graphic, and using recorded X/Y coordinates and a parallel process event to move the event to the designated location at map load.

However, it's not a quickly created event, and since you're doing this for IGMC, it might not be worth the extra effort.

So, maybe you could consider switching the design around a bit:

- Give the player designated places where they can use the items, but let them choose what they put there.

This would still give the player some customization control, but make it infinitely easier for you to plan and work with. 🙂
This should do the trick:

Add this script on the editor:

Code:
class Game_Map  def activate_self_switch_at(x, y, switch_id, state = true)    events = events_xy(x, y)    return if events.nil?    events.each do |event|      $game_self_switch[[@map_id, event.id, switch_id]] = state    end  endend
And call this when you want to activate a self-switch:
Code:
$game_map.activate_self_switch_at(x, y, 'A')
Changing x and y for the values you want.
Thanks! Both answers will work I suppose, I guess all I really need to do now is figure out which one is worth it in the long run, I suppose I'll get the basics working and then see if I have enough time left to fully implement the system.

Also...

$game_map.activate_self_switch_at(x, y, 'A')Changing x and y for the values you want.
How do I make the x and y relative here to the event that triggers the call? As in activate the switch at x, y+1 for something like the top of the grandfather clock when the bottom part of it is at x, y?
When you say "change tile" you mean "change event". Why not just have an event sprite that is 2 tiles high, instead of two events that have to work together.

Original thread: https://forums.rpgmakerweb.com/threads/any-way-to-affect-the-self-switch-of-a-neighbouring-event.42066/