You can change tiles and their regionIds with a tile changer like Shaz's one. You can't change terrain tags because they are tied to that tile type and harcoded in the database.
I do think modifying CT_Bolt's plugim would be the best and most efficient solution, but if we can't get that working (maybe it doesn't work with spawned events, I would have to test that) or if it's too much work there are those other solutions.
How to make traps like fear&hunger?
● ARCHIVED · READ-ONLY
-
-
Thank you so much for the help, I will give up on this for now, maybe if there is plugin or other solution in the future I could try to add it later.
-
Could you try this in a parallel common event
JavaScript:And put Wait: 5 frames at the end$gameMap.events().forEach(event => {if (event.meta.enemy) $gameMap.eventsXy(event.x, event.y).forEach(shared => {if (shared.meta.trap) $gameSelfSwitches.setValue([$gameMap._mapId, shared._eventId, 'A'],true);})});
Put <enemy> tags in your enemy event noteboxes and <trap> tags in your traps. -
Thank you for this!Could you try this in a parallel common event
JavaScript:And put Wait: 5 frames at the end$gameMap.events().forEach(event => {if (event.meta.enemy) $gameMap.eventsXy(event.x, event.y).forEach(shared => {if (shared.meta.trap) $gameSelfSwitches.setValue([$gameMap._mapId, shared._eventId, 'A'],true);})});
Put <enemy> tags in your enemy event noteboxes and <trap> tags in your traps.
This script call didn't work for me to be fair but it helped me with the use of ChatGPT to find the solution for it after some tries.
This is the script that worked for me but it change the self switch of only 1 of the 2 events:
// Script for handling events with the <trap> tag
$gameMap.events().forEach(event => {
if (event.event().meta.trap) {
$gameMap.eventsXy(event.x, event.y).forEach(shared => {
if (shared.event() && shared.event().meta.enemy) {
$gameSelfSwitches.setValue([$gameMap._mapId, shared._eventId, 'A'], true);
}
});
}
});
So to change the enemy self switch in the common event I added another script with the same formula but with different stracture:
// Script for handling events with the <enemy> tag
$gameMap.events().forEach(event => {
if (event.event().meta.enemy) {
$gameMap.eventsXy(event.x, event.y).forEach(shared => {
if (shared.event() && shared.event().meta.trap) {
$gameSelfSwitches.setValue([$gameMap._mapId, shared._eventId, 'A'], true);
}
});
}
});
If there is a way to do it in 1 script that will be better but this way worked for me.
This can open for me and many other game maker a sea of ways to create events, game mechanics and puzzels.
I didn't try it yet with spawn event plugin, I will try that and give updates if it work or didn't.
Edit: Spawned event didn't work but I remember when I showed your script to chatGPT and tell it it didn't work they suggested some possible reasons of the problem, one of them is this.
"Event Initialization Order: Make sure that the common event with the script call runs after the events are initialized on the map. If the common event runs before events are placed on the map, it won't find any events to check."
So because spawned events are for sure spawned on the map after the paralell common event with the script it didn't work, this could be also the same reason why the plugin didn't work?