Andrea Rovenski Posted March 1, 2011 Is it possible to add an infinite timer that keeps counting until you die? 0 Share this post Link to post
Andrea Rovenski Posted March 1, 2011 Oh, yeah. GZDoom. Doom in Hexen mode. 0 Share this post Link to post
AlysiumX Posted March 1, 2011 #include "zcommon.acs" int Counter[7]=0; Script 1 ENTER { Thing_ChangeTID(0, 1000 + PlayerNumber()); while(getactorproperty(1000 + PlayerNumber(), APROP_Health) > 0) { Counter[PlayerNumber()]++; delay(35); hudmessage (d:Counter[PlayerNumber()]; HUDMSG_PLAIN, 0, CR_RED, 0.0, 0.0, 1.0); } } Should work. 0 Share this post Link to post
Andrea Rovenski Posted March 1, 2011 I got this error: Missing opening '{' in array initilizer. 0 Share this post Link to post
Gez Posted March 1, 2011 int Counter[7]= {0, 0, 0, 0, 0, 0, 0}; But why 7? ZDoom supports up to 8 players; and Skulltag up to 32.(Or was it 64?) 0 Share this post Link to post
AlysiumX Posted March 2, 2011 oops. int Counter[7] = { 0 }; Should work. ya in counter[7] there are actually 8 values because 0 counts as a slot. counter[0] - counter[7] 0 Share this post Link to post
Worst Posted March 2, 2011 Nope, when you initialize an array, the value you use means exactly how many 'slots' or elements or indexes (or whatever you want to call it) it will have, and instead when you access the slots its 0-based, so you need to use a value that is one smaller than the nth-slot you want to access. So with int Counter[7]; you would only be able to access slots [0] to [6]. You should use a value like int Counter[64]; at least to play it safe for ports with bigger player limits. Also no need to initialize the array to zeros, ZDoom at least treats uninitialized variables as 0 I think. 0 Share this post Link to post
AlysiumX Posted March 2, 2011 lol nvm, my brain shut off for a sec, sorry. 0 Share this post Link to post