cyber-menace Posted August 18, 2003 Is there anyway using Doom2 or Zdoom features to make an on screen countdown? If so how? I know of one way but it would require me to type print (s:""); 300 times... is there an easier way? Oh yes I want this countdown to last 5 minutes before activating a script. 0 Share this post Link to post
Ichor Posted August 18, 2003 Here's a simple way (I hope): script 1 (void) { int var0; var0 = 300; do { print(d:var0, s:" SECONDS REMAINING"); delay(35); var0--; } until(var0 == 0); if(var0 == 0) { Whatever; } } 0 Share this post Link to post
Cyb Posted August 18, 2003 revising Ichors: script 1 (void) { int var0 = 300; while(!var) { print(d:var0, s:" SECONDS REMAINING"); delay(35); var0--; } //do stuff here } if you want it to print out mins as well (ie instead of 300 seconds, 5:00) that requires a couple extra lines of code and some padding but nothing too complex. you could also use hudmessage(); instead of print which allows a lot more freedom, in this case you can position the time anywhere on screen (print just centers it) or have it fade out upon completion. 0 Share this post Link to post
cyber-menace Posted August 18, 2003 It works except for one problem. It won't activate the function that comes after the countdown. Here's what I have so far...#include "zcommon.acs" int countd; script 1 OPEN { print (s:"Objective 1\n\nFind the next elevator."); Delay (5*35); print (s:"Warning! Multiple bomb threats detected!"); Delay (3*35); print (s:"All personel evacuate immediatly!"); Delay (5*35); countd = 5; do { print(d:countd, s:" Seconds Until Explosion"); delay(35); countd--; } until(countd == 0); if(countd == 0) { Thing_Damage (1, 400); terminate; } } What do I need to do? 0 Share this post Link to post
cyber-menace Posted August 18, 2003 When I use your script Cyb the countdown doesn't even get displayed. Can you show me the lines of scripting necessary to display it in minutes in the upper right hand corner. If so thanks. 0 Share this post Link to post
Nanami Posted August 18, 2003 Cyb's while loop says while (!var) and should read while (!var0) unless I'm reading it wrong. 0 Share this post Link to post
Ichor Posted August 18, 2003 Hmm... I was afraid that would happen. Let's try this:#include "zcommon.acs" int countd; script 1 OPEN { print (s:"Objective 1\n\nFind the next elevator."); Delay (5*35); print (s:"Warning! Multiple bomb threats detected!"); Delay (3*35); print (s:"All personel evacuate immediatly!"); Delay (5*35); countd = 5; do { print(d:countd, s:" Seconds Until Explosion"); delay(35); countd--; if(countd == 0) { Thing_Damage(1, 400); terminate; } } until(countd == 0); } 0 Share this post Link to post
cyber-menace Posted August 18, 2003 I still don't have any function. Oh and I tried doing my function on a line. I have my player with a tag of 1, but when Thing_Destroy (1); activates the player is still alive. How can I destroy a player with Thing_Destory? 0 Share this post Link to post
cyber-menace Posted August 18, 2003 Uh oh I just found a problem. The function does activate, but for some reason the player doesn't die! I added Sector_SetColor (0, 255, 0, 0); to test this and it does work. For some reason Thing_Destroy (1); doesn't work even though the player is tagged as 1. Any suggestions? 0 Share this post Link to post
The Ultimate DooMer Posted August 18, 2003 You can't tag player starts. And with this special you can't use tag 0, as that kills all untagged monsters instead. You could use DamageThing (400) assuming the script is not OPEN (as the player doesn't activate those) or telefrag a manikin with something on a scrolling floor (and unblock the teleport linedef when time is up). Although I think there's a special that lets you tag a player, but I can't remember what it was. (it's like Player_ChangeTID or something) 0 Share this post Link to post
Ichor Posted August 18, 2003 However, you can set a fast crusher that does a lot of damage right on top of a dummy player. Once that countdown reaches zero...splat! 0 Share this post Link to post
cyber-menace Posted August 18, 2003 One more problem... how do I make dummy players? And I need dummy players for each of the 8 players is the problem because of the game being multiplayer as well. 0 Share this post Link to post
Ichor Posted August 18, 2003 All you need is another player one start spot. For normal Doom, this is all you need, but for ZDoom and Hexen, it has to have the same tag number. I'm guessing that more than one player two, player three, etc. will work the same way, but I haven't tested that. 3000th post! 0 Share this post Link to post
Kid Airbag Posted August 18, 2003 yayayayay for Ichor! BTW when did HTML become enabled in posts? 0 Share this post Link to post
The Ultimate DooMer Posted August 18, 2003 cyber-menace said:One more problem... how do I make dummy players? And I need dummy players for each of the 8 players is the problem because of the game being multiplayer as well. More player 1 starts as suggested, but the one you create last will be the actual start (the highest thing number). You don't need to make them all the same tag number (not sure what he means there), but if you're using hubs, then you need a manikin for each of the start points (ie. one for player start 0, one for player start 1 etc.). You only need to do this for entrance points that get used when you first enter the map. And you'll need to repeat this for all the multiplayer starts, too. 0 Share this post Link to post
Kid Airbag Posted August 18, 2003 Ichor said:It isn't actually. Oh so it's a special mods-only thing. I see how it is. 0 Share this post Link to post
cyber-menace Posted August 18, 2003 Ok my bomb is now working. Thank you very much. 0 Share this post Link to post
Nanami Posted August 19, 2003 The Ultimate DooMer said:You can't tag player starts.You can give the player a tid, Randy posted an example. All you need is an open script that uses ChangeTid() or whatever the function is. 0 Share this post Link to post
Grazza Posted August 19, 2003 Archvile46 said:BTW when did HTML become enabled in posts? I think this answers your question.Archvile46 said:Oh so it's a special mods-only thing. I see how it is. Supermods, admins and Ling, to be precise. It is also enabled in the moderators' forum. I had used it to post "peace be with you" in Inuktitut (when Julian went on holiday), so you can see it is a really valuable feature. 0 Share this post Link to post
Cyb Posted August 19, 2003 Nanami said:You can give the player a tid, Randy posted an example. All you need is an open script that uses ChangeTid() or whatever the function is. script 1 enter thing_changetid(0, tag); assigns tag to the player 0 Share this post Link to post