detecting spell

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
THOM
Posts: 1281
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

detecting spell

Post by THOM »

Is there a way to detect, if a certain spellblast - let's say a fireblast - explodes on a certain tile?

What I need is something similar to a receptor. But in my case the triggering spell shouldn't be a fireball but just a fireblast.

I have fiddled around with the wall-receptor but I was sure that it couldn't be that easy. I assume, the blast cannot trigger the receptor because they are not on the same tile...

Has anyone an idea?
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: detecting spell

Post by minmay »

WallTriggerComponent only triggers when a projectile hits its ProjectileCollider. Since fireburst is not a projectile, you will not have good luck trying to use it.

Try HealthComponent instead.
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.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: detecting spell

Post by akroma222 »

Is this Fireburst going to be spawned through a mediating script when casting?? (assuming you are casting it) As in, like:
SpoilerShow

Code: Select all

onCast = function(champion, x, y, direction, elevation, skillLevel)															      
		return aoeScripts.script.areaEffectSpell(champion, x, y, direction, elevation, skillLevel, "fireburst", false, "oneSquare", powerB, nil, 0, "burning")
	end,		
If so then the mediating script could check for the type of tiles included in an AoE ...

Otherwise, if this is for a puzzle, a timer set to 0.001 interval checking the area of interest could detect the fireburst??
Hmm... perhaps some more info on how and why this would be happening? (without giving too much away!)
Definitely, how this fireburst would be spawned (casting or not?) would help
User avatar
THOM
Posts: 1281
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: detecting spell

Post by THOM »

The detecting will be part of a puzzle (or a lock).

The spell is casted by the party.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: detecting spell

Post by minmay »

akroma222 wrote:Is this Fireburst going to be spawned through a mediating script when casting?? (assuming you are casting it) As in, like:
SpoilerShow

Code: Select all

onCast = function(champion, x, y, direction, elevation, skillLevel)															      
		return aoeScripts.script.areaEffectSpell(champion, x, y, direction, elevation, skillLevel, "fireburst", false, "oneSquare", powerB, nil, 0, "burning")
	end,		
If so then the mediating script could check for the type of tiles included in an AoE ...
[...]
Hmm... perhaps some more info on how and why this would be happening? (without giving too much away!)
Definitely, how this fireburst would be spawned (casting or not?) would help
You are overcomplicating this. The timer approach you mentioned is fine.
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.
Post Reply