Heal a monster?

Talk about anything Legend of Grimrock 1 related here.
Post Reply
trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Heal a monster?

Post by trancelistic » Sat Aug 13, 2016 6:35 pm

Hey guys, I saw recently 1 of the first release video's of A.H. They fight a spider and a poison bolt /cloud was casted. I saw green "damage" numbers on the spider.
So, I guess that poison used to heal a spider?

Now my question; If it possible to heal, for example an uggardian, with a fire spell or to heal a spider again with poison ?
If so, could u make me a little script example, let say with a cloned uggardian? It takes a fireball, greater fireball or a burst and it gains health? (possible with shown numbers(?))

Thanks in advanced.

User avatar
THOM
Posts: 1043
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Heal a monster?

Post by THOM » Sat Aug 13, 2016 6:51 pm

This is managed in the monsterdefinition.

In the monster-component you can add something like

Code: Select all

resistances = { cold = "absorb" },
"absorb" means, that the specific damage-type doesn't do damagae to the monster but adds it's value to the health-stat of the monster.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download

User avatar
Isaac
Posts: 2868
Joined: Fri Mar 02, 2012 10:02 pm

Re: Heal a monster?

Post by Isaac » Sat Aug 13, 2016 6:52 pm

*Also: Uggardians already have this, and will heal from fire attacks; and it shows the numbers.

minmay
Posts: 2577
Joined: Mon Sep 23, 2013 2:24 am

Re: Heal a monster?

Post by minmay » Sat Aug 13, 2016 7:12 pm

You posted this in the Grimrock 1 subforum. It's not possible in Grimrock 1 to show green damage numbers for this; absorption doesn't exist.

However you can easily do it in Grimrock 1 without the damage number by using the Monster.onDamage hook and Monster:setHealth().
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.

trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Re: Heal a monster?

Post by trancelistic » Sat Aug 13, 2016 7:42 pm

Wow, thanks for the fast feedback all. Yes this is about grimrock 1 and not 2:)
But I though perhaps its still in the game to absord damage like in LoG2. Because I did saw green numbers in the LoG1 video of A.H from 2012. Perhaps the engine still has it somwhere?

Anyhows, Could you show me a fully working script with hook etc? I've never used a hook before.. Still kinda new with that. I could learn from you then.

User avatar
Isaac
Posts: 2868
Joined: Fri Mar 02, 2012 10:02 pm

Re: Heal a monster?

Post by Isaac » Sat Aug 13, 2016 10:00 pm

I just never notice between the two forums. :oops:

Code: Select all

defineObject{
	name = "uggardian",
	class = "Monster",
	model = "assets/models/monsters/uggardian.fbx",
	meshName = "uggardian_mesh",
	animations = {
		idle = "assets/animations/monsters/uggardian/uggardian_idle.fbx",
		moveForward = "assets/animations/monsters/uggardian/uggardian_walk.fbx",
		strafeLeft = "assets/animations/monsters/uggardian/uggardian_strafe_left.fbx",
		strafeRight = "assets/animations/monsters/uggardian/uggardian_strafe_right.fbx",
		turnLeft = "assets/animations/monsters/uggardian/uggardian_turn_left.fbx",
		turnRight = "assets/animations/monsters/uggardian/uggardian_turn_right.fbx",
		attack = "assets/animations/monsters/uggardian/uggardian_attack.fbx",
		getHitFrontLeft = "assets/animations/monsters/uggardian/uggardian_get_hit_front_left.fbx",
		getHitFrontRight = "assets/animations/monsters/uggardian/uggardian_get_hit_front_right.fbx",
		getHitBack = "assets/animations/monsters/uggardian/uggardian_get_hit_back.fbx",
		getHitLeft = "assets/animations/monsters/uggardian/uggardian_get_hit_left.fbx",
		getHitRight = "assets/animations/monsters/uggardian/uggardian_get_hit_right.fbx",
		fall = "assets/animations/monsters/uggardian/uggardian_get_hit.fbx",
	},
	moveSound = "uggardian_walk",
	attackSound = "uggardian_attack",
	hitSound = "uggardian_hit",
	dieSound = "uggardian_die",
	hitEffect = "hit_flame",
	capsuleHeight = 0.6,
	capsuleRadius = 0.3,
	collisionRadius = 0.8,
	health = 235,
	sight = 5,
	attackPower = 30,
	coolDown = { 1.5, 4 },
	protection = 5,
	immunities = {},
	evasion = 10,
	rangedAttack = "fireball",
	movementCoolDown = 1,
	flying = true,
	noRecoilInterval = { 0.35, 0.5 },
	exp = 500,
	lightName = "light1",
	lightColor = vec(1, 0.5, 0.25),
	lightBrightness = 15,
	lightRange = 3.5,
	attackPowerIncrement = 5,
	healthIncrement = 100,
	protectionIncrement = 3,
	brain = "Uggardian",
	onDamage = function(self, damage, damageType)
				if damageType == "fire" then 
					if (self:getHealth()+damage) < 235 then --Uggardian default health 
						self:setHealth(self:getHealth()+damage)
						spawn("fx", self.level, self.x, self.y, self.facing):setParticleSystem("monster_heal"):setLight(0,1,0,20,1,.3,false)
						playSoundAt("generic_spell",self.level, self.x, self.y)
						hudPrint("It gains strength from the heat!") 
					else	
						hudPrint("It seems to like the extra heat!")
					end
					return false
				end	
			end,
}

defineParticleSystem{
	name = "monster_heal",
	emitters = {
		-- stars
		{
			emissionRate = 500,
			emissionTime = 0.2,
			maxParticles = 1000,
			boxMin = {-0.6, 0.3,-0.6},
			boxMax = { 0.6, 2.5, 0.6},
			sprayAngle = {0,360},
			velocity = {0.2,0.2},
			objectSpace = true,
			texture = "assets/textures/particles/teleporter.tga",
			lifetime = {1,1},
			color0 = {3.0,3.0,3.0},
			opacity = 1,
			fadeIn = 0.1,
			fadeOut = 0.1,
			size = {0.05, 0.13},
			gravity = {0,0,0},
			airResistance = 0.1,
			rotationSpeed = 2,
			blendMode = "Additive",
		}
	}
}

trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Re: Heal a monster?

Post by trancelistic » Sun Aug 14, 2016 1:04 am

Can I marry you isaac? Or send a pizza?:)

Thanks, this will teach me a thing or 2 <3

Greetz.

Post Reply