Page 1 of 2

any way to directly detect if player is hit by blob?

Posted: Thu Jan 03, 2013 8:50 pm
by Komag
I can't make onDamage or onProjectileHit give me any results, presumably because blob isn't a projectile and does no damage. Is there any other way to directly detect if the party is hit by a blob?

If not then all I can think of is to set up accurate timers to know that the blob failed to hit the receptor on time, but I'm going to set up a lot of them so I'd rather have a direct approach is possible

Re: any way to directly detect if player is hit by blob?

Posted: Thu Jan 03, 2013 9:29 pm
by Diarmuid
That's exactly what I'm doing with my spells framework... setting up a ton of timers :). And one of the goals of the project was to handle such cases because it was impossible in native Grimrock.

What you ask is super easy in exsp:

Code: Select all

exsp.addSpellHooks("blob",{
	onPartyHit = function(sId)
		[do whatever you want, sId being the id of the blob entity]
	end
	}
)
But there's a lot going on behind the scenes to make it happen... ;)

PS: By the way, I've found a few bugs in 1.3.3, working on a more stable release that will also integrate some of Grimwold's work, new version should be up soon, don't download it right now, might not be 100% stable.

Re: any way to directly detect if player is hit by blob?

Posted: Thu Jan 03, 2013 9:46 pm
by Komag
From: hyteria
To: Komag
dunno if this can help but if your problem is that blob isn't a projectile, and didn't make damage, why you don't custom a spell like blob but who did damage? :p

---------

it's a good idea!

(I'm not ready to do exsp yet, trying to keep things simple for this project, but thanks, good to know it's available!)

Re: any way to directly detect if player is hit by blob?

Posted: Thu Jan 03, 2013 10:01 pm
by hyteria
you knonw that i m unskilled on code but if can help with some logic mind hehehe

Re: any way to directly detect if player is hit by blob?

Posted: Thu Jan 03, 2013 11:29 pm
by Komag
I've never messed with custom spells before - I can't find any original spells! I of course have the asset pack, but the spell.lua is full of defineObject, no defineSpell anywhere. Where are they?

Re: any way to directly detect if player is hit by blob?

Posted: Thu Jan 03, 2013 11:34 pm
by hyteria
i think it s a function in a game script

Re: any way to directly detect if player is hit by blob?

Posted: Thu Jan 03, 2013 11:49 pm
by Neikun
Oh I know this... Where did I see them when I was doing my gardians?

EDIT: They're in objects.lua
Just ctrl+f and find the one you're looking for n.n

Re: any way to directly detect if player is hit by blob?

Posted: Thu Jan 03, 2013 11:58 pm
by Komag
there are no spells in my asset pack objects.lua

Re: any way to directly detect if player is hit by blob?

Posted: Fri Jan 04, 2013 12:29 am
by hyteria
check grimworld tread , he worked on some custom spell , maybee this help , i think you had to add it into game in a script

Re: any way to directly detect if player is hit by blob?

Posted: Fri Jan 04, 2013 12:32 am
by Neikun
Weird... There are in mine. Do you have the latest version?

Anyway, in case you still can't find them:
SpoilerShow

Code: Select all

defineObject{
	name = "fireburst",
	class = "BurstSpell",
	screenEffect = "fireball_screen",
	particleSystem = "fireburst",
	lightColor = vec(0.75, 0.4, 0.25),
	lightBrightness = 40,
	lightRange = 4,
	sound = "fireburst",
	attackPower = 20,
	damageType = "fire",
	--cameraShake = true,
	tags = { "spell" },
}

defineObject{
	name = "shockburst",
	class = "BurstSpell",
	particleSystem = "shockburst",
	lightColor = vec(0.25, 0.5, 1),
	lightBrightness = 40,
	lightRange = 4,
	sound = "shockburst",
	attackPower = 27,
	damageType = "shock",
	--cameraShake = true,
	tags = { "spell" },
}

defineObject{
	name = "frostburst",
	class = "BurstSpell",
	particleSystem = "frostburst",
	lightColor = vec(0.25, 0.5, 1),
	lightBrightness = 40,
	lightRange = 4,
	sound = "frostburst",
	attackPower = 20,
	damageType = "cold",
	--cameraShake = true,
	tags = { "spell" },
}

defineObject{
	name = "fireball",
	class = "ProjectileSpell",
	particleSystem = "fireball",
	hitParticleEffect = "fireball_hit",
	lightColor = vec(1, 0.5, 0.25),
	lightBrightness = 15,
	lightRange = 7,
	lightHitBrightness = 40,
	lightHitRange = 10,
	castShadow = true,
	launchSound = "fireball_launch",
	projectileSound = "fireball",
	hitSound = "fireball_hit",
	screenEffect = "fireball_screen",
	projectileSpeed = 7.5,
	attackPower = 30,
	damageType = "fire",
	--cameraShake = true,
	tags = { "spell" },
}

defineObject{
	name = "fireball_greater",
	class = "ProjectileSpell",
	particleSystem = "fireball_greater",
	hitParticleEffect = "fireball_hit_greater",
	lightColor = vec(1, 0.5, 0.25),
	lightBrightness = 15,
	lightRange = 7,
	lightHitBrightness = 40,
	lightHitRange = 10,
	castShadow = true,
	launchSound = "fireball_launch",
	projectileSound = "fireball",
	hitSound = "fireball_hit",
	screenEffect = "fireball_screen",
	projectileSpeed = 7.5,
	attackPower = 60,
	damageType = "fire",
	--cameraShake = true,
	tags = { "spell" },
}

defineObject{
	name = "poison_bolt",
	class = "ProjectileSpell",
	particleSystem = "poison_bolt",
	hitParticleEffect = "poison_bolt_hit",
	lightColor = vec(0.25, 0.6, 0.2),
	lightBrightness = 4,
	lightRange = 4,
	lightHitBrightness = 4,
	lightHitRange = 5,
	launchSound = "poison_bolt_launch",
	projectileSound = "poison_bolt",
	hitSound = "poison_bolt_hit",
	screenEffect = "poison_bolt_screen",
	projectileSpeed = 7.5,
	attackPower = 20,
	damageType = "poison",
	--cameraShake = true,
	tags = { "spell" },
}

defineObject{
	name = "poison_bolt_greater",
	class = "ProjectileSpell",
	particleSystem = "poison_bolt",
	hitParticleEffect = "poison_bolt_hit",
	lightColor = vec(0.25, 0.6, 0.2),
	lightBrightness = 4,
	lightRange = 4,
	lightHitBrightness = 4,
	lightHitRange = 5,
	launchSound = "poison_bolt_launch",
	projectileSound = "poison_bolt",
	hitSound = "poison_bolt_hit",
	screenEffect = "poison_bolt_screen",
	projectileSpeed = 7.5,
	attackPower = 35,
	damageType = "poison",
	--cameraShake = true,
	tags = { "spell" },
}

defineObject{
	name = "frostbolt",
	class = "ProjectileSpell",
	particleSystem = "frostbolt",
	hitParticleEffect = "frostbolt_hit",
	lightColor = vec(0.25, 0.5, 1),
	lightBrightness = 15,
	lightRange = 7,
	lightHitBrightness = 40,
	lightHitRange = 10,
	launchSound = "frostbolt_launch",
	projectileSound = "frostbolt",
	hitSound = "frostbolt_hit",
	projectileSpeed = 7.5,
	attackPower = 10,
	damageType = "cold",
	freezeChance = 50,
	freezeDuration = 4,
	--cameraShake = true,
	tags = { "spell" },
}

defineObject{
	name = "improved_frostbolt",
	class = "ProjectileSpell",
	particleSystem = "frostbolt",
	hitParticleEffect = "frostbolt_hit",
	lightColor = vec(0.25, 0.5, 1),
	lightBrightness = 15,
	lightRange = 7,
	lightHitBrightness = 40,
	lightHitRange = 10,
	launchSound = "frostbolt_launch",
	projectileSound = "frostbolt",
	hitSound = "frostbolt_hit",
	projectileSpeed = 7.5,
	attackPower = 15,
	damageType = "cold",
	freezeChance = 50,
	freezeDuration = 7,
	--cameraShake = true,
	tags = { "spell" },
}

defineObject{
	name = "ice_shards",
	class = "IceShards",
	attackPower = 20,
	chainCounter = 4,
	--cameraShake = true,
	tags = { "spell" },
}

defineObject{
	name = "lightning_bolt",
	class = "ProjectileSpell",
	particleSystem = "lightning_bolt",
	hitParticleEffect = "lightning_bolt_hit",
	lightColor = vec(0.25, 0.5, 1),
	lightBrightness = 15,
	lightRange = 7,
	lightHitBrightness = 40,
	lightHitRange = 10,
	castShadow = true,
	launchSound = "lightning_bolt_launch",
	projectileSound = "lightning_bolt",
	hitSound = "lightning_bolt_hit_small",
	projectileSpeed = 10,
	attackPower = 35,
	damageType = "shock",
	--cameraShake = true,
	tags = { "spell" },
}

defineObject{
	name = "lightning_bolt_greater",
	class = "ProjectileSpell",
	particleSystem = "lightning_bolt_greater",
	hitParticleEffect = "lightning_bolt_hit_greater",
	lightColor = vec(0.25, 0.5, 1),
	lightBrightness = 15,
	lightRange = 7,
	lightHitBrightness = 40,
	lightHitRange = 10,
	castShadow = true,
	launchSound = "lightning_bolt_launch",
	projectileSound = "lightning_bolt",
	hitSound = "lightning_bolt_hit",
	projectileSpeed = 10,
	attackPower = 47,
	damageType = "shock",
	--cameraShake = true,
	tags = { "spell" },
}

defineObject{
	name = "powerbolt",
	class = "ProjectileSpell",
	particleSystem = "lightning_bolt",
	hitParticleEffect = "lightning_bolt_hit",
	lightColor = vec(0.25, 0.5, 1),
	lightBrightness = 15,
	lightRange = 7,
	lightHitBrightness = 40,
	lightHitRange = 10,
	castShadow = true,
	launchSound = "lightning_bolt_launch",
	projectileSound = "lightning_bolt",
	hitSound = "lightning_bolt_hit",
	projectileSpeed = 10,
	attackPower = 35,
	damageType = "shock",
	--cameraShake = true,
	tags = { "spell" },
}

defineObject{
	name = "poison_cloud",
	class = "PoisonCloud",
	attackPower = 5,
	tags = { "spell" },
}

defineObject{
	name = "blob",
	class = "Blob",
	tags = { "spell" },
}