So I'm trying to create an event that when moved onto another event it will trigger that events inner switch.
In a more understandable way, I'm having the main character throw a boulder and if it lands on a monster then the monsters self switch ('D' for dead) activates.
This is the script I have so far:
$gameSelfSwitches.setValue(
[$gameMap._mapId,
$gameMap.eventIdXy(
'D'],
true);
The code works when I call it before I move the boulder event, but doesn't work after I move the boulder. This is a little problematic because I don't want the monster to be squished BEFORE the boulder hit it.
I think the problem is that when I call $gameMap.eventIdXy() it returns the TOP event, which would be the boulder. It might return an array of the events that occupy that space, though I think it's the former because I tried treating it like an array and it changed nothing. =(
Does anyone know of any potential workarounds or a simpler solution?
Here is the reference for the function calls (from the docs):
var key = [mapId, eventId, A-D]
$gameSelfSwitches.setValue(key, true);
In a more understandable way, I'm having the main character throw a boulder and if it lands on a monster then the monsters self switch ('D' for dead) activates.
This is the script I have so far:
$gameSelfSwitches.setValue(
[$gameMap._mapId,
$gameMap.eventIdXy(
$gameVariables.value(98),
$gameVariables.value(99)
),
$gameVariables.value(99)
),
true);
The code works when I call it before I move the boulder event, but doesn't work after I move the boulder. This is a little problematic because I don't want the monster to be squished BEFORE the boulder hit it.
I think the problem is that when I call $gameMap.eventIdXy() it returns the TOP event, which would be the boulder. It might return an array of the events that occupy that space, though I think it's the former because I tried treating it like an array and it changed nothing. =(
Does anyone know of any potential workarounds or a simpler solution?
Here is the reference for the function calls (from the docs):
var key = [mapId, eventId, A-D]
$gameSelfSwitches.setValue(key, true);