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



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.





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.
[03:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[2024-5-16. : 5:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
[2024-5-16. : 5:24 pm]
lil-Inferno -- poopoo
[2024-5-16. : 5:14 pm]
UndeadStar -- I wonder if that's what happened to me. A returned product (screen) was "officially lost" for a while before being found and refunded. Maybe it would have remained "lost" if I didn't communicate?
Please log in to shout.


Members Online: 5harperc441eh1, 8oliviae241ye2, Roy