riki2321 Posted September 28, 2015 script 1 open // Add this script to the first map only { Minutes = 1; Seconds = 60; // 5 minutes total } script 2 (void) // Add this to all maps { Seconds -= 1; if(Seconds < 10) { printbold(d:Minutes,s:":0",d:Seconds,s:" remaining"); } else { printbold(d:Minutes,s:":",d:Seconds,s:" remaining"); } if(Seconds == 0) { Minutes -= 1; Seconds = 60; } if((Minutes == 0) && (Seconds == 0)) delay(35); // equal to 1 second DamageThing(10000,0); // Deal 10000 damage to the player } 0 Share this post Link to post
Blue Shadow Posted September 29, 2015 Variables need to be declared before they can be used, like so: int Minutes; int Seconds; Since those variables are shared between your scripts, they need to be declared outside of any script block. 0 Share this post Link to post
Kappes Buur Posted September 29, 2015 http://www.zdoom.org/zdkb/scriptvariables.html 0 Share this post Link to post
scifista42 Posted September 29, 2015 As a side note: When pasting your code to a DW forum post, put it between (code) and (/code) tags (with square brackets [] around the tags, not normal brackets). Example:Text within code tags: - has fixed width of characters, and - unlike default forum behaviour, multiple spaces in succession are not automatically removed somescript { { { { ... } } } } Compare: Text within code tags: - has fixed width of characters, and - unlike default forum behaviour, multiple spaces in succession are not automatically removed somescript { { { { ... } } } } 0 Share this post Link to post
riki2321 Posted September 29, 2015 Blue Shadow said:Variables need to be declared before they can be used, like so: int Minutes; int Seconds; Since those variables are shared between your scripts, they need to be declared outside of any script block. Thanks! i got other problemint Minutes; int Seconds; #include "zcommon.acs" script 1 open // Add this script to the first map only { Minutes = 1; Seconds = 59; // 5 minutes total } script 2 enter // Add this to all maps { Seconds -= 1; if(Seconds < 10) { printbold(d:Minutes,s:":0",d:Seconds,s:" remaining"); } else { printbold(d:Minutes,s:":",d:Seconds,s:" remaining"); } if(Seconds == 0) { Minutes -= 1; Seconds = 60; } if((Minutes == 0) && (Seconds == 0)) delay(35); // equal to 1 second DamageThing(10000,0); // Deal 10000 damage to the player } 0 Share this post Link to post
riki2321 Posted September 29, 2015 Script FIX! For thoose that want it. UDMF ONLYint Minutes; int Seconds; #include "zcommon.acs" script 1 open // Add this script to the first map only { Minutes = 1; Seconds = 60; // 5 minutes total } script 2 enter // Add this to all maps { Seconds -= 1; if(Seconds < 10) { printbold(d:Minutes,s:":0",d:Seconds,s:" remaining"); } else { printbold(d:Minutes,s:":",d:Seconds,s:" remaining"); } if(Seconds == 0) { Minutes -= 1; Seconds = 60; } if((Minutes == 0) && (Seconds == 0)) { delay(35); // equal to 1 second DamageThing(10000,0); // Deal 10000 damage to the player } delay(35); restart; } 0 Share this post Link to post
Aliotroph? Posted September 29, 2015 Why does it wait 1 second after reaching zero? Timers only do that in bad movies. 0 Share this post Link to post
Gentlepoke Posted September 29, 2015 Out of curiosity, what are you planning to do with that script? 0 Share this post Link to post
Chezza Posted September 29, 2015 I'm not good with Scripting but I'm mostly competent enough to understand what I'm seeing. I'm assuming this is a Timer that counts down in Bold and as it reaches the last 10 seconds it must change formats to appear more critical. When the timer is out the player dies (so should die). However I don't entirely understand this: Minutes = 1; Seconds = 60; // 5 minutes total Why in notes are you stating 5 minutes total? From what I'm reading your simply saying how many seconds are in a minute or just stating 1 minute in the counter. Can you modify the timer to have as many minutes as you like? 0 Share this post Link to post
riki2321 Posted September 30, 2015 Chezza said:I'm not good with Scripting but I'm mostly competent enough to understand what I'm seeing. I'm assuming this is a Timer that counts down in Bold and as it reaches the last 10 seconds it must change formats to appear more critical. When the timer is out the player dies (so should die). However I don't entirely understand this: Minutes = 1; Seconds = 60; // 5 minutes total Why in notes are you stating 5 minutes total? From what I'm reading your simply saying how many seconds are in a minute or just stating 1 minute in the counter. Can you modify the timer to have as many minutes as you like? Haha the stating is an error, Freely choose an time Gentlepoke said:Out of curiosity, what are you planning to do with that script? A bomb countdown 0 Share this post Link to post