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.
[2024-5-31. : 2:36 pm]
Wing Zero -- Bop em
[2024-5-31. : 2:36 pm]
Wing Zero -- Mods
[2024-5-29. : 9:40 pm]
Ultraviolet -- :wob:
[2024-5-28. : 8:43 am]
TheHappy115 -- Yea, thats the issue. Thanks. It would also explain why my deleted map couldn't get updated. Updated version reduced collision on units (only thing added) since was dodging game (players collide with each other)
[2024-5-28. : 5:26 am]
Ultraviolet -- If so, I'd just focus on getting them on scmscx.com and then you can link to that in the showcase thread for your maps
[2024-5-28. : 5:25 am]
Ultraviolet -- I can't upload my EUD maps, I think the DLDB has some issue with handling them. Are you trying to upload EUD maps?
[2024-5-28. : 2:06 am]
TheHappy115 -- Its been awhile but ever since I requested one of the Maps I posted to be deleted since I couldn't delete it myself (or update it), I haven't been able to upload any more maps. Any reason for that?
[2024-5-26. : 7:14 pm]
Kyradax -- Hi
[2024-5-26. : 5:05 pm]
O)FaRTy1billion[MM] -- :wob:
[2024-5-25. : 9:22 am]
Zycorax -- :wob:
Please log in to shout.


Members Online: Nekron, Oh_Man