Making Snails shoot. Poison.

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Chimera005ao
Posts: 187
Joined: Sun Jun 29, 2014 8:34 am

Making Snails shoot. Poison.

Post by Chimera005ao »

Using other, older threads around here I was able to get my snails to shoot a projectile.
However, the projectile does not seem to trigger an onDealDamage check.
I'm hesitant to use the onProjectileHit hook for the party, as it seems I would have to tie the poison affliction level to the damage of the projectile, which may not really be an issue, but I'd like to have it based on the enemy throwing the projectile instead.

The code in quesiton should just involve these I believe.

Code: Select all

	rangedAttack = "poison_bolt",
	
	defineAnimationEvent{
   animation = "mod_assets/animations/poison_snail/poison_snail_attack.fbx",
   event = "ranged_attack",
   frame = 10,
	},
	
	onDealDamage = function(self, champion, damage)
			--champion:setConditionCumulative("poison", 7)
			print ("hit")
	end,
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: Making Snails shoot. Poison.

Post by Grimfan »

onDealDamage is normally for melee attacks afaik but you could simply create a new spell like a poison_snail_bolt and have the snail shoot that instead. You could then set the damage to whatever you want. I personally haven't looked into ranged attacks for non-ranged monsters though, so perhaps someone else has had a similar problem and found a more innovative fix?
User avatar
Chimera005ao
Posts: 187
Joined: Sun Jun 29, 2014 8:34 am

Re: Making Snails shoot. Poison.

Post by Chimera005ao »

For the poison_bolt spell it says onCast = "poisonBolt"
The spells have no information for the effects they cause, only information for the spell itself, casting requirements and such.
I suppose that confuses me, especially since I made a spell that has the function defining its effects right there.

*actually, I see that poisonBolt is defined under objects. I shall poke around there.
Last edited by Chimera005ao on Mon Jun 30, 2014 2:20 am, edited 1 time in total.
Grimfan
Posts: 369
Joined: Wed Jan 02, 2013 7:48 am

Re: Making Snails shoot. Poison.

Post by Grimfan »

Spells are defined as objects in the asset pack. You can find poison_bolt (and all the other spells) there and create your own poison_bolt with a modified attack power and a different name.

* Beaten to the punch. Ha!

EDIT: I think the only problem you might have is that the game won't recognize your new spell and your ranged snails won't shoot it (even though they will go through the animation). To avoid that you'll need to have the snail spawn the bolt itself with the onRangedAttack function (since you seem well-versed in scripting already this should not be an issue).

Again, I defer to my compatriots on his one. They may have a more elegant and robust solution to your snail problem.
User avatar
Chimera005ao
Posts: 187
Joined: Sun Jun 29, 2014 8:34 am

Re: Making Snails shoot. Poison.

Post by Chimera005ao »

I got a new projectile, and some more understanding for how these scripts interconnect (made a blue poison_bolt that does 2 damage ; P)

I think I'm going to have to go back toward the original idea. Except instead of being tied to damage, at least it is tied to a new projectile.
Too bad I'll have to add a trigger to every monster if I ever decide to let the player use such spells.

Thanks.
Post Reply