Adding gas/mana
Jan 15 2008, 2:14 am
By: TurtleBoy  

Jan 15 2008, 2:14 am TurtleBoy Post #1



Hey, I want it so gas is added every second until it reaches a limit of 100 gas.

The current trig is:

COND:
-Accumulate at most 99 gas

ACTION:
-Modifiy resources, add 1 gas
-Preserve trigger

The problem is that it adds the gas way too fast, if i add a wait trig to the action (which should've worked, i.e. wait 1000 millisecs) then the gas adds extremely slow (slower than 1 sec).

How do I make it so it adds it for every second?



None.

Jan 15 2008, 2:22 am Ultraviolet Post #2

We do a little trolling

Make a seperate count.

Cond:
-Always

Action:
-Add 1 death for geyser for p1
-preserve

Cond:
-P1 has at least 12 deaths for geyser

Action:
-subtract 12 deaths for geyser for p1
-preserve

cond:
-P1 has exactly 0 deaths for geyser
-accumulate at most 99 gas

action:
-add 1 gas
-preserve

Sorry it's super sloppy, I'm feeling really lazy.




My Projects:

Impossible Ultraviolet | Impossible UV 2 | Impossible UV 3
Mercenaries 2020 | Mercenaries III
Squad Defense

Legacy Projects (No guarantee of functionality in modern SC):

Pixel Adventure 2 | Space Snipers | Control the Ball

______________________________________________

Join me in Torn City

Jan 15 2008, 2:22 am who Post #3



You are probably experiencing wait blocks, because you have other waits running at once for the players with this trigger. That's why it runs much slower than expected.
do you have hypertriggers (3 or 4 always preserved triggers that consist of 63 wait 0 milliseconds)?
assuming that you do, this is what you should do instead (to avoid wait blocks)

C:
always
a:
preserve trigger
add one death of goliath turret for current player

c:
current player has suffered at least 12 deaths of goliath turret
accumulate at most 99 gas
a:
set deaths of goliath turret to 0 for current player
add 1 gas
preserve trigger

c:
current player has suffered at least 12 deaths of goliath turret
accumulate at least 100 gas
a:
set deaths of goliath turret to 0 for current player
preserve trigger


this is probably not the most efficient way, but it works. The first one constantly adds deaths (with hypertriggers at about the rate of twelve per second)
the second trigger, when the deaths has gone up to twelve and the player has accumulated at most 99 gas, sets it the death counter back to 0 and gives the player 1 gas.
the third trigger is the same as the above, but when he has accumulated 100 gas, it sets the deaths back to 0 and gives no more gas.

also move your hypers to the bottom of the list or give them to a player with no waits.

EDIT: The triggers in the post above also work, but you should replace "P1" with the force which contains the players, so you don't have to duplicate that trigger for every player.

EDIT 2: The triggers below work better. :omfg:

Post has been edited 1 time(s), last time on Jan 15 2008, 2:28 am by someone09.



None.

Jan 15 2008, 2:26 am Fwop_ Post #4



You could do it in two triggers:

C: Current Player has suffered exactly 0 deaths of unused unit
A: Modify deaths of unused unit: Set to 12 deaths
A: Modify resources: Add 1 gas
A: Preserve Trigger

C: Accumulates at most 99 gas
A: Modify deaths of unused unit: Subtract 1 deaths
A: Preserve Trigger



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:41 am]
Oh_Man -- i used to play TF2 competitive in that clan, and also was PR manager (ie: i wrote all the website posts)
[02:41 am]
Oh_Man -- another fun fact iaguz actually joined the clan i was part of - Frenetic Array
[02:40 am]
Symmetry -- Human memory is a fragile, fallible thing
[02:39 am]
Oh_Man -- i realised all his shit was halluc and i wiped out his measly army of fake hallucs and he called GG - yeah thts wat actually happened damn false memory strikes again
[02:38 am]
Oh_Man -- i was zerg, the toss guy did a bunch of hallucinates, and i was like, welp, i guess i'm dead, but i have that mindset of never giving up, so attacked him anyway, then tht was wen
[02:38 am]
Oh_Man -- coz i was actually a zerg main, so wat ACTUALLY happened was a complete reverse of this
[02:37 am]
Oh_Man -- i found an old comment of mine i actually think the idra thing over-ride my own memory
[02:22 am]
Symmetry -- was it idra
[01:52 am]
NudeRaider -- Oh_Man
Oh_Man shouted: and i went on to win the tournament, and a pair of steelseries headphones. i even reember how i won the final match - hallucinated a fck-tonne of units and my opponent thought i had way more than he did and GGed
classic
[2026-8-05. : 2:56 pm]
Oh_Man -- long story short - patience is a virtue!
Please log in to shout.


Members Online: ManCubuS, lil-Inferno