HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Live Counter

07-17-2005, 11:57 PM#1
Killa_Demon1833
Ok, I need a little help with a lives/death sequence of triggers. I do have a working one, but it interfere's with the joining thing and it's REALLY long. You have 5 lives, if you run out, you lose, and are givin the defeat condition. I do have a leaderboard set up, now I need help with some simpler compact life/death triggers, can anyone help?
07-18-2005, 07:20 AM#2
Anitarf
Have an integer array store lives for every player. Whenever a unit dies, decrease that player's integer by 1, if it reaches 0 defeat the player. Simple.
07-18-2005, 12:33 PM#3
Killa_Demon1833
though what would I use to decrease it? what about initial value??
07-18-2005, 12:36 PM#4
oNdizZ
initial value is yours to decide. and with the decending of the integer.
set lives[playernumber?] = lives[playernumber?] - 1
07-18-2005, 03:34 PM#5
Killa_Demon1833
Code:
Event
A Unit Owned By Player 1 (Red) dies.

Conditions
(None)

Actions
Set Lives[1] to to Lives[1] -1

Code:
Variable: Interger
Array: 12
Intial Value: 5

Would this be right if i had a 12 player map and each player has 5 lives?
07-18-2005, 03:51 PM#6
Killa_Demon1833
Sorry for double post, but if what I posted before is right, what would defeat condtions be? I have it set to

Code:
Event
Unit Owned By Player 1 (Red) Dies

Conditions
(None)

Actions
If (Lives[1] Equal to 0) then do (Gmae-Defeat Player 1 (Red) with the message: You Failed, you......) else do (Do Nothing)

is that right?
07-18-2005, 04:07 PM#7
shadow1500
that wud require u to make 12 triggers, just use generic unit death
Code:
Death
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Set Lives[(Player number of (Owner of (Triggering unit)))] = (Lives[(Player number of (Owner of (Triggering unit)))] - 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Lives[(Player number of (Owner of (Triggering unit)))] Equal to 0
            Then - Actions
                Game - Defeat (Owner of (Triggering unit)) with the message: Bye
            Else - Actions
07-18-2005, 04:24 PM#8
Killa_Demon1833
ok, then with know all this I got this right, now I will go test my map.
07-18-2005, 04:41 PM#9
Killa_Demon1833
SUCCESS!!! IT WORKS!! After a month and about a week or 2 of hard work... now to work on the next version.
07-19-2005, 10:03 PM#10
AFZ
Quote:
Originally Posted by Killa_Demon1833
SUCCESS!!! IT WORKS!! After a month and about a week or 2 of hard work... now to work on the next version.

Dum-da-da-dum. Your map leaks.
07-20-2005, 01:21 AM#11
Killa_Demon1833
no it dosen't
07-21-2005, 02:01 PM#12
oNdizZ
think me meant that if you use shadow1500's "bye" msg then it leaks, since its a force leak there.
07-21-2005, 02:03 PM#13
Killa_Demon1833
Yes i know. But that's why lots of code i get from here i edit, before implanting. And I can't fix a gui leak.
07-21-2005, 02:05 PM#14
oNdizZ
why cant you fix a gui leak? :> how do you mean? that you dont know how to do? or do you think its impossible? :)
07-21-2005, 02:09 PM#15
Killa_Demon1833
I never took the time to learn, my maps never leaked.