Decrease Time with ability?

T3rm1nat0r

New Member
Reaction score
23
Hi everyone, how do i make an ability that decreases a timer by 30 seconds? What i am saying on my map you play for 30 minutes and you build a certain building which has the ability to decrease time by 30 seconds. So when i activate it my timwerwindow minuses by 30 seconds, does any body know how to do this? And how do i make it cost 1000 + 250 per each certain living units?

I am willing o give +rep to those who know how to do it :D
 

rodead

Active Member
Reaction score
42
just make a variable that stores the time and do it minus the other time make sure it is always null and when you got the abilty it is 30 so when it isn't cast it is - 0 so it stays the same.

and for the second store them into a unit group do that x 250 and +1000 and here you go.
 

T3rm1nat0r

New Member
Reaction score
23
Thanx, +rep, but do you mind to show the trigger, to me to make it easier for me? I give more +rep to you again, thanx rodead!
 

rodead

Active Member
Reaction score
42
here is the trigger hope it works i am not sure but then anybody else needs to help:

variables needed:

-Time real variable
-Timer Timer Variable
- Integer array variable
- Unitgroup variable


Code:
set time
    Events
        Map initialization
    Conditions
    Actions
        Countdown Timer - Start Timer as a One-shot timer that will expire in (3600.00 - Time) seconds

Code:
Test
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Animate Dead
    Actions
        Set Time = 30.00
        Trigger - Turn off (This trigger)

Code:
Time
    Events
        Time - Timer expires
    Conditions
    Actions
        Game - Defeat Player 1 (Red) with the message: Defeat!

this is the other one:

Code:
Untitled Trigger 001
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
        Set group = (Units in (Playable map area))
        Set Integer[1] = (Number of units in group)
        Set Integer[2] = (Integer[1] x (250 + 1000))
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
I'd say make an integer variable which stores the seconds. Then when you build this building just do:
Code:
Actions:
 Set TIMEVARIABLE = TIMEVARIABLE - 30
If you use a variable instead of a time you'll have to add this trigger to your map also:
Code:
Event:
  Every 1 second 
Actions:
 Set TIMEVARIABLE = TIMEVARIABLE - 1

@rodead: Are you sure that this timer will work correctly? I'd say that the timer - once started - will not be affected by the variable Time anymore, don't really know, though :p
 

rodead

Active Member
Reaction score
42
I'd say make an integer variable which stores the seconds. Then when you build this building just do:
Code:
Actions:
 Set TIMEVARIABLE = TIMEVARIABLE - 30
If you use a variable instead of a time you'll have to add this trigger to your map also:
Code:
Event:
  Every 1 second 
Actions:
 Set TIMEVARIABLE = TIMEVARIABLE - 1

you better not use a integer variable real is better in this case since timers works with them.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top