Deal damage to party
-
Emera Nova
- Posts: 146
- Joined: Wed Jun 11, 2014 1:31 am
Deal damage to party
So I'm thinking of making a puzzle that as you do it the party takes damage, problem I could see happening with it would be it breaking if a champion is already dead.
So I'm guessing the script would need to first check to see if each champion is still alive, and if not skip that champion for the damage. And then it would need to deal the damage to other champions.
Idea's on the script itself?
So I'm guessing the script would need to first check to see if each champion is still alive, and if not skip that champion for the damage. And then it would need to deal the damage to other champions.
Idea's on the script itself?
Re: Deal damage to party
damaging dead champions is not a problem unless perhaps you try to do it in a really weird way like with 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.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
-
Emera Nova
- Posts: 146
- Joined: Wed Jun 11, 2014 1:31 am
Re: Deal damage to party
So I have this which I thought would be the answer to the deal damage to party but its not working so something is wrong.
Code: Select all
function Damage()
party.party:getChampion:damage(5, fire)
endRe: Deal damage to party
You have to specify which champion is meant. Also you have to bring fire into quotationmarks:
This will deal damage only to champion number one.
Code: Select all
function Damage()
party.party:getChampion(1):damage(5, "fire")
end-
Emera Nova
- Posts: 146
- Joined: Wed Jun 11, 2014 1:31 am
Re: Deal damage to party
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: Deal damage to party
Hi Thom. I cant remember the code for damage whole party not just one member any help please thxs 
Re: Deal damage to party
Well, you can either loop through the party, or use damageTile on the party's location.Eleven Warrior wrote:Hi Thom. I cant remember the code for damage whole party not just one member any help please thxs
Code: Select all
function partyDamage()
for x = 1,4 do
local t = party.party:getChampion(x)
t:damage(5, "fire")
playSound("damage_"..t:getRace().."_"..t:getSex())
end
endCode: Select all
function partyDamage()
damageTile(party.level, party.x, party.y, party.facing, party.elevation, 512, "fire", 5)
for x = 1,4 do
local t = party.party:getChampion(x)
playSound("damage_"..t:getRace().."_"..t:getSex())
end
end
- Eleven Warrior
- Posts: 752
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: Deal damage to party
Thxs Issac awesome man 
Re: Deal damage to party
This would work also
Sometimes solutions are very obvious...
Code: Select all
function Damage()
party.party:getChampion(1):damage(5, "fire")
party.party:getChampion(2):damage(5, "fire")
party.party:getChampion(3):damage(5, "fire")
party.party:getChampion(4):damage(5, "fire")
endRe: Deal damage to party
This is good too. I wonder why damageTile and :damage() do not cause champion sounds for the injury?THOM wrote:This would work also
Sometimes solutions are very obvious...Code: Select all
function Damage() party.party:getChampion(1):damage(5, "fire") party.party:getChampion(2):damage(5, "fire") party.party:getChampion(3):damage(5, "fire") party.party:getChampion(4):damage(5, "fire") end