Quote:
Originally Posted by stompem
Hi thanks for helping but I didn't give up, eventually I found a way and published the map.
Here's the map if you're interested.
Human vs AI - Special Forces
http://novahq.net/maps.php?ID=10470
Here's the code for detecting player deaths - so simple in the end.
Code:
;Count Player Deaths
if never() then
set(v1,0) // Triggers once then resets
set(v2,0) // Count 1 adds
set(v3,0) // Count 2 Subtracts
endif
if not ssnalive(player) then
set(v1,1)
endif
if eq(v1,1) then
set(v1,0)
endif
; Use chain to trigger once each time the variable flips - link will keep counting
if chain(1) then
add(v2,1)
sub(v3,1)
endif
As you probably know you can pick the random using relational operators.
Random=3 or random(3) is more or less setting the variable to 3
Random==3 or eq means the random value is equivalent to 3
Though I think "=" and "==" are inter-operable because they are both true.
gt > (greater-than)
lt < (less-than)
neq != (not equal to)
eq == (equivalent to)
etc. etc.
NOTE: The following eq example uses parentheses.
Code:
if never() and random(10) then
if eq(v1,0) and eq(rnd, 3) then
set(v14,1)
end
endif
//
if eq(v14,1) then
ammo2tgt AMMO_60MM_MORTAR(1)
dec(v14)
endif
|
played your map and thoroughly enjoyed it. I commented in the map posting.
I beat all 10 levels first try with no deaths though.

Do I get a special prize?