Wall of Force spell
Posted: Sat May 22, 2021 2:32 am
I'll start the post by posing two questions related to what I'm trying to do, afterwards there's a full explanation of the spell I'm working on.
1) Is there a way to check whether the tile in front of the party is a floor or dungeon wall?
2) Is it possible to make a floor object (like a pillar) block items the same way a wall does - ie. not allowing thrown or placed items or thrown spells to enter its tile, but stop right before like you would see when throwing an item at a wall?
Now the full background to these questions:
I have created the Wall of Force spell. It's simple enough. It creates an impassable tile of green haze, then disappears after a set amount of time. However, due to the nature of the RTC engine, I have been running into problems I had to find workarounds for, let me walk you through the different versions of the spell:
1) Invisible pillar
Casting the spell does the following:
- creates a Green Haze on tile in front of the party
- creates a temporary Green Haze on tile in front of the party
- SWAP replaces the temporary Green Haze with an invisible pillar (because I have found no way to place a specific object type on tile in front of party, only on the party's own tile, the CREATE_HAZE_INFRONT is the only instance I have see of object creation on tile in front of party)
- after timer ends, SWAPs both Green Haze and the invisible pillar for null, deleting them
It works perfectly, does exactly what I need it to, a variation of it can also be used to make pre-placed Walls of Force that have to be removed by a new Dispel spell, etc.
HOWEVER! Given that the blocking element of the spell is a pillar, a player is able to place items at the foot of the invisible pillar, or throw items at it and have them land there - it doesn't act like a wall. This is not much of a problem until you realize that you can essentially place items into the green haze and remove them from it as well, making it looks sort of weird.
2) Invisible wall on tile in front
Casting the spell does the following:
- creates a Green Haze on tile in front of the party
- creates a temporary Green Haze on tile in front of the party
- SWAP replaces the temporary Green Haze with the FLOOR_MECHANICS object Invisible Wall
- OBJECT_ACTIVATEs the placed Invisible Wall (this is done because otherwise the wall will not be blocking anything until party moves into the tile and back out again)
- after timer ends, OBJECT_DEACTIVATEs the Invisible wall (this is done because if the wall is just deleted, the tile will remain impassable)
- SWAPs both Green Haze and Invisible Wall for null, deleting them
Now this is even better, it works exactly as I want it to without the annoying placing-items-inside-the-haze glitch. ... With one minor downside: it lets the player literally delete dungeon walls. You can see how that makes the spell rather undesirable, although hilarious. I like to think that I could use this specific version to create the Disintegrate spell and add it as a super secret joke spell at the end of the dungeon to let the player go nuts.
3) Invisible wall on party's tile
Works the same as 2), but instead of tile in front of the party, it creates the wall on the party's tile.
This prevents it from being used to delete dungeon walls and break the game, but the new undesired side effect is that when you cast it and stay inside the green haze, you are immune to all thrown objects and spells, as they will land or explode 1 tile away from you. Melee attacks can still hurt you. Useful as a shield spell, but not what I'm desiring.
4) Invisible wall on party's tile without activating it
Casting the spell is exactly as 2), EXCEPT it is not OBJECT_ACTIVATEd.
Now this is more like it. The green haze is created on party's tile, but provides no protection from anything UNTIL the party moves away from it, at which point it then performs as advertised. Of all the spell versions, this one is the most perfect, save only for the fact that I'd really like to be able to have the party cast it on the tile in front of them, but I suppose this will have to do, unless someone offers an answer to the two question posed at the very top of this post.
1) Is there a way to check whether the tile in front of the party is a floor or dungeon wall?
2) Is it possible to make a floor object (like a pillar) block items the same way a wall does - ie. not allowing thrown or placed items or thrown spells to enter its tile, but stop right before like you would see when throwing an item at a wall?
Now the full background to these questions:
I have created the Wall of Force spell. It's simple enough. It creates an impassable tile of green haze, then disappears after a set amount of time. However, due to the nature of the RTC engine, I have been running into problems I had to find workarounds for, let me walk you through the different versions of the spell:
1) Invisible pillar
Casting the spell does the following:
- creates a Green Haze on tile in front of the party
- creates a temporary Green Haze on tile in front of the party
- SWAP replaces the temporary Green Haze with an invisible pillar (because I have found no way to place a specific object type on tile in front of party, only on the party's own tile, the CREATE_HAZE_INFRONT is the only instance I have see of object creation on tile in front of party)
- after timer ends, SWAPs both Green Haze and the invisible pillar for null, deleting them
It works perfectly, does exactly what I need it to, a variation of it can also be used to make pre-placed Walls of Force that have to be removed by a new Dispel spell, etc.
HOWEVER! Given that the blocking element of the spell is a pillar, a player is able to place items at the foot of the invisible pillar, or throw items at it and have them land there - it doesn't act like a wall. This is not much of a problem until you realize that you can essentially place items into the green haze and remove them from it as well, making it looks sort of weird.
2) Invisible wall on tile in front
Casting the spell does the following:
- creates a Green Haze on tile in front of the party
- creates a temporary Green Haze on tile in front of the party
- SWAP replaces the temporary Green Haze with the FLOOR_MECHANICS object Invisible Wall
- OBJECT_ACTIVATEs the placed Invisible Wall (this is done because otherwise the wall will not be blocking anything until party moves into the tile and back out again)
- after timer ends, OBJECT_DEACTIVATEs the Invisible wall (this is done because if the wall is just deleted, the tile will remain impassable)
- SWAPs both Green Haze and Invisible Wall for null, deleting them
Now this is even better, it works exactly as I want it to without the annoying placing-items-inside-the-haze glitch. ... With one minor downside: it lets the player literally delete dungeon walls. You can see how that makes the spell rather undesirable, although hilarious. I like to think that I could use this specific version to create the Disintegrate spell and add it as a super secret joke spell at the end of the dungeon to let the player go nuts.
3) Invisible wall on party's tile
Works the same as 2), but instead of tile in front of the party, it creates the wall on the party's tile.
This prevents it from being used to delete dungeon walls and break the game, but the new undesired side effect is that when you cast it and stay inside the green haze, you are immune to all thrown objects and spells, as they will land or explode 1 tile away from you. Melee attacks can still hurt you. Useful as a shield spell, but not what I'm desiring.
4) Invisible wall on party's tile without activating it
Casting the spell is exactly as 2), EXCEPT it is not OBJECT_ACTIVATEd.
Now this is more like it. The green haze is created on party's tile, but provides no protection from anything UNTIL the party moves away from it, at which point it then performs as advertised. Of all the spell versions, this one is the most perfect, save only for the fact that I'd really like to be able to have the party cast it on the tile in front of them, but I suppose this will have to do, unless someone offers an answer to the two question posed at the very top of this post.