Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
riki2321

Will this work? (Solution on down post)

Recommended Posts



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
}

Share this post


Link to post

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.

Share this post


Link to post

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
{
{
{
{
...
}
}
}
}

Share this post


Link to post
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 problem

int 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
}

Share this post


Link to post

Script FIX! For thoose that want it. UDMF ONLY

int 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;
}

Share this post


Link to post

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?

Share this post


Link to post
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

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×