I have placed a receptor (and also tried a wall trigger) in my dungeon to open a door when triggered by a spell.
If I type 'poison_bolt' into the entityType box and blast a poison bolt at it, it works just fine.
If I type 'fireball' into the entityType box and blast a fireball at it, it does not work. I have tried fireball, fireball_small, etc. but I cannot get it to work shooting a fireball at it.
What prey tell is going on?
Any help would be appreciated.
receptor/wall trigger
- Zo Kath Ra
- Posts: 944
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: receptor/wall trigger
This entityType works for me:
fireball_large
fireball_large
Re: receptor/wall trigger
There is no object defined as "fireball" in the standard assets.
You probably want to connect the WallTrigger to a script entity function and check if the triggering projectile's GameObject is named "fireball_small", "fireball_medium", or "fireball_large" (all three of which can be created by the Fireball spell, depending on the champion's skill level/CastSpellComponent power).
You probably want to connect the WallTrigger to a script entity function and check if the triggering projectile's GameObject is named "fireball_small", "fireball_medium", or "fireball_large" (all three of which can be created by the Fireball spell, depending on the champion's skill level/CastSpellComponent power).
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: receptor/wall trigger
How do you connect the wall_trigger/receptor to a script which checks to see what type fireball was cast when you need to know what type fireball was cast in the first place in order to trigger the receptor and run the script?
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: receptor/wall trigger
You don't have to connect the receptor to anything to check which projectile it receives, you just input the name of the entity to hit it for it to trigger.RayB wrote:How do you connect the wall_trigger/receptor to a script which checks to see what type fireball was cast when you need to know what type fireball was cast in the first place in order to trigger the receptor and run the script?

Each fireball is a separate entity, so you would input the type of fireball you wish the receptor to respond to.
Re: receptor/wall trigger
Place a script_entity (or your preferred object with both a ScriptComponent named "script" and a ScriptControllerComponent named "controller"). In its source, define a function named "checkReceptor" or whatever you prefer, which does the check I mentioned. Example:RayB wrote:How do you connect the wall_trigger/receptor to a script which checks to see what type fireball was cast when you need to know what type fireball was cast in the first place in order to trigger the receptor and run the script?
Code: Select all
function checkReceptor(walltrigger, projectile)
if projectile.go.name == "fireball_small" or projectile.go.name == "fireball_medium" or projectile.go.name == "fireball_large" then
receptor_door_1.controller:toggle()
end
endGrimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.