Need help with damageTile

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Shadowfied
Posts: 47
Joined: Wed Apr 11, 2012 10:42 pm

Need help with damageTile

Post by Shadowfied »

So I'm learning a bit of scripting and using the "Number guess game" from the modding tutorial, which I can't seem to find again..Anyway, I got it to work fine and messed with it a bit so that I understand how it works, and I looked up the script references to find a way to damage the party if the wrong number is guessed. I found the damageTile function and decided to try it. It damages my party, but there is no indication of being damaged, other than the red splats on the health-bars, and it doesn't matter which damageType I choose, it's always the same.

Code: Select all

counter = 0
function awesomeGame()
	counter = counter + 1
	local randomNumber = math.random(5)
	if randomNumber == 3 then
		print ("CORRECT!", counter, "TRIES!")
	else
		print ("FAIL DUDE!")
		damageTile(1, 16, 14, 0, 0, "fire", 5)
	end
end
The script works and there are no errors, there's just no indication of what damages you, no sound, no particles etc.

Also, I'm a bit confused with the flags, like "bit 0" and what they would be used for, but I guess that's irrelevant for this issue.

Thanks in advance.
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Need help with damageTile

Post by antti »

The lack of visual or audio indications is intentional: this enables the modders to make the damaging event feel whatever they like by letting them dress it up themselves. You can play sounds using the playSound function: you can add playSound("fireball_hit") into the script for example. Particles can also be played back with an FX entity and some scripting.

The bit field questions have come up before. I think I should write a small clarification of it into the guide somewhere.
Steven Seagal of gaming industry
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Need help with damageTile

Post by petri »

A simpler way to punish the party would be to use the spawn() function to spawn, let's say, a "fireburst" in the tile :twisted:
User avatar
Shadowfied
Posts: 47
Joined: Wed Apr 11, 2012 10:42 pm

Re: Need help with damageTile

Post by Shadowfied »

Thanks for the reply.

Sounds good, but what is the damageType option for then?
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Need help with damageTile

Post by petri »

damageType is used for determining damage resistances. E.g. damageType "fire" would use target's fire resistance to reduce the damage of the attack.
User avatar
Shadowfied
Posts: 47
Joined: Wed Apr 11, 2012 10:42 pm

Re: Need help with damageTile

Post by Shadowfied »

Ah, makes sense.

Thank you very much!

And if you didn't already petri, please read my last post here.
Post Reply