Staredit Network

Staredit Network -> UMS Assistance -> Countdown Timer
Report, edit, etc...Posted by Excaluber on 2006-03-25 at 16:13:53
The goal of these triggers is that: At the start of the map, the timer starts at 60 seconds. Whenever the timer reaches "1" it will produce units. Whenever the timer reaches 0, it will start at 160 seconds. Here is the set of triggers:

Trigger
Description:
Start timer at start of map (once)
Players:
¤ All
Conditions:
¤ Always
Actions:
¤ Modify Countdown Timer: Set to 60 seconds


Trigger
Description:
Timer Reset
Players:
¤ All
Conditions:
¤ Countdown timer is exactly 1 game seconds.
Actions:
¤ Modifty Countdown Timer: Set to 160 seconds.
¤ Preserve Trigger


Trigger
Description:
Make the units
Players:
¤ Player X (one player, repeated trigger differently for each)
Conditions:
¤ Player X commands exactly 1 [required building]
¤ Player X commands exactly 1 Civilian at [location]
¤ Player X commands at most 200 Any Unit
¤ Countdown timer is exactly 1 game seconds.
Actions:
¤ Create X units
¤ Preserve trigger.

Now, the problem is that nothing is happening when it reaches 1, but it does reset to 160 when it hits 0.
Report, edit, etc...Posted by Azu on 2006-03-25 at 16:16:30
Make it so like

Players all

Condition countdown is exactly 0 game seconds

Action give players units or w/e
Action set timer to 90 seconds
Action Preserver trigger
Report, edit, etc...Posted by MapUnprotector on 2006-03-25 at 16:28:57
QUOTE(Excaluber @ Mar 25 2006, 05:13 PM)
The goal of these triggers is that: At the start of the map, the timer starts at 60 seconds. Whenever the timer reaches "1" it will produce units. Whenever the timer reaches 0, it will start at 160 seconds. Here is the set of triggers:







Trigger
Description:
Start timer at start of map (once)
Players:
¤ All
Conditions:
¤ Always
Actions:
¤ Modify Countdown Timer: Set to 60 seconds








Trigger
Description:
Timer Reset
Players:
¤ All
Conditions:
¤ Countdown timer is exactly 1 game seconds.
Actions:
¤ Modifty Countdown Timer: Set to 160 seconds.
¤ Preserve Trigger








Trigger
Description:
Make the units
Players:
¤ Player X (one player, repeated trigger differently for each)
Conditions:
¤ Player X commands exactly 1 [required building]
¤ Player X commands exactly 1 Civilian at [location]
¤ Player X commands at most 200 Any Unit
¤ Countdown timer is exactly 1 game seconds.
Actions:
¤ Create X units
¤ Preserve trigger.

Now, the problem is that nothing is happening when it reaches 1, but it does reset to 160 when it hits 0.
[right][snapback]452952[/snapback][/right]


The triggers you have there have it resetting at 1 and not 0 so the trigger after that will never run.
Report, edit, etc...Posted by Noober on 2006-03-25 at 16:33:21
The problem is the trigger order. Since the resetting the timer executes before the unit trigger, the timer is set to 160 before it gets to the unit trigger, so it never fires. You need to move the unit trigger up, so it fires before the timer trigger does.
Report, edit, etc...Posted by Excaluber on 2006-03-25 at 17:03:22
Noober, the reset one is under All Players, and the "create units at timer=1" is under each player seperately, how would I set the reset to below the others? The reset is currently at the bottom of the "All Players" list already.

I also fixed it so that the "Reset" trigger's conditions are
¤ Countdown timer is exactly 0 game seconds.
not
¤ Countdown timer is exactly 1 game seconds.
And it is still not working sad.gif
Report, edit, etc...Posted by LiquidSilver on 2006-03-25 at 21:53:28
I HAVE THE ANSWER FOR YOU!

I have used a similar system in the past. I once made a salary system, so that every 2 minutes, the player would get payed a salary. Depending on their Kills status, their salary would increase.

However, you will find one major problem. When you use the "Wait" action, it stops all the other triggers from working while your "Wait" action is in use, and considering its going to be nonstop, the other triggers won't get a chance.

Here's how to solve the problem...

1. Set 1 player to Neutral. It is important this player does not have any other triggers to work with.

2. Set a Timer for this player. Here's the trigger:

CONDITIONS:
Switch(Timer) is Set

ACTIONS:
Wait(100000);
SetSwitch(Timer) to Set
Preserve Trigger


3. Now, you need triggers for the Human Players. Lets assume you have 1 Human Player. The first trigger, you have to activate the Switch:

CONDITIONS:
Always();

ACTIONS:
SetSwitch(Timer) to Set


4. Now you have to create the actions for the Human Player every time the Switch is Set. You also need to clear the Switch after your actions (Very important, otherwise the trigger will keep running, as you need to preserve the trigger)
Here's the Trigger:

CONDITIONS:
Switch(Timer) is Set

ACIONS:
Create Units for Current Player at destination
SetSwitch(Timer) to Clear
Preserve Trigger


I hope thats of help to you.

ADDITION:
PS. I stated that the "Wait" trigger stops all other triggers from working. 50% true. It only stops the other triggers working for the Current Player (all other triggers for the player you have the continueous "Wait" trigger involved)
Report, edit, etc...Posted by Excaluber on 2006-03-26 at 07:42:34
Thanks Liquid Silver, but I'd probably have to rework alot of the map for balance and land if I cut out a player sad.gif

I fixed the problem of it not happening, but now it happens about 10 times every time the timer ticks down to "90 game seconds." How could I stop this but still keep the triggers preserved?
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-03-26 at 09:21:48
Well, from what I saw in your triggers there, you used the "exactly" thing. I suggest using "at most". It's more reliable.
Report, edit, etc...Posted by LiquidSilver on 2006-03-26 at 22:47:37
EXACTLY! That was the problem I was getting. You see, because you are preserving the trigger, the actions will just keep on running! That's why, in your actions list, you MUST add a CLEAR SWITCH Trigger! Then, every 30 seconds (or however long you intend) the OTHER trigger will SET the Switch again.

Understand?

ADDITION:
Oh, and in answer to your other question...

I'm sorry if it means you have to rearrange your map, but there is no other way of doing it, unless there is a player in your map with no other triggers. The timer trigger will just keep running for its selected player, and not allow any other triggers to run for that selected player.
Report, edit, etc...Posted by GG.Pe4nut on 2006-03-27 at 14:05:40
QUOTE(Noober @ Mar 25 2006, 10:32 PM)
The problem is the trigger order. Since the resetting the timer executes before the unit trigger, the timer is set to 160 before it gets to the unit trigger, so it never fires. You need to move the unit trigger up, so it fires before the timer trigger does.
[right][snapback]452965[/snapback][/right]

NONONONONO THATS WRONG!!!!! ranting.gif did u see that it was 1 "game sec" closedeyes.gif

//gg.pe4nut
Report, edit, etc...Posted by XMercury on 2006-03-28 at 07:59:33
WOW Liquid I'm impressed. I tried it out myself from Liquid's instructions, and it works perfectly.
Report, edit, etc...Posted by Excaluber on 2006-03-28 at 14:40:30
Yes, thank you Liquid, problem solved.
Report, edit, etc...Posted by PhoenixRajoNight on 2006-03-28 at 18:07:33
1. Waits = Bad, Period.
2. And that switch is not needed at all.

Your all missing the easiest way to fix this. --- & Noober were right first off the triggers are in the wrong order, You have them displayed in the wrong order, and you put it as "ALL PLAYERS" or you just set it for all players by selecting players, 1-8. There is no reason if the correct order is presented that your triggers shouldnt work. Also if your triggers are in the right order, nobody brought up the fact all his conditions might not be being met, If it is set to "All Players", notice in his conditions he says PLAYER X not Current Player.

Sorry, if I sound like a wang by correcting this issue but your telling him a solution that involves re-triggering, instead of fixing the problem, triggering that is more complicated then needed, and using waits, which are bad to use 97% of the time especially in a preserved trigger.

ADDITION:
Another Note: He said its popping off 10 times per second if he made the same mistake in his triggers for Create Units, because he doesnt state which player he set it to then maybe he has it set to Player X yet again, and the resaon he doesnt see the units created and then sees them created 10 times or most likely 8 times, is because he has the force set to random Starting location, which means sometimes he gets the player thats getting the unit, sometimes he gets the other 7 that dont get any.
Next Page (1)