Wall of Force spell

Questions about how to create your own dungeons and replacement graphics and sounds.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
dungeonneophyte
Neophyte
Posts: 2
Joined: Fri May 21, 2021 11:21 pm

Wall of Force spell

Post by dungeonneophyte »

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.
User avatar
Saumun
High Lord
Posts: 2238
Joined: Fri Feb 20, 2009 3:03 am
Location: The Ether

Re: Wall of Force spell

Post by Saumun »

1) I don't think so.
2) I don't think so, but there may be alternative possibilities.

From what i've read, am I right in thinking it's a shield spell that would drop any flying object in front of the party?

I had a 'create wall' spell in The Trail, but it was cloned from a floor object and would not stop a projectile entering the tile.
Have you considered cloning a floor trigger with a unique ID and a 'CREATE_NEW_ON_FLOOR' action, and have it target a 'STOP_FLYING' action?
As long as it has a unique ID you could destroy it after a set time. I did a similar thing with a 'Freeze' spell in The Trail.
You may need to create a tile somewhere on each level (but outside the map) that has this same trigger. It's a weird quirk of RTC that Adamski highlighted me to. A single tile with a copy/pasted trigger would do.
“Grynix Ernum Quey Ki Skebow Rednim U Os Dey Wefna Enocarn Aquantana” - Anon
dungeonneophyte
Neophyte
Posts: 2
Joined: Fri May 21, 2021 11:21 pm

Re: Wall of Force spell

Post by dungeonneophyte »

Thanks, that could potentially work, however it wouldn't stop the player from being able to manually place an object into the green haze that's supposed to be impassable. Unless I suppose I'd also put in a trigger that would move the object towards the party if placed on it, but at that point we're getting into "way too complicated to be worth it" territoty.

I eventually went with version 4 of the spell as the closest to what I wanted and reaonably lightweight in execution.
Post Reply