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.
[08:48 am]
NimoStar -- plus most of the human APM is just spam clicking APM inflation
[08:47 am]
NimoStar -- the thing with the "*12" thing is completely misleading. The AI isn't using two control groups, it can use each of those actions to command a single unit individually and issue different commands to each single unit.
[08:06 am]
NudeRaider -- NudeRaider
NudeRaider shouted: Oh_Man Artosis hasn't caught on how devastating the perfect focus fire is. With the mutas he was like "the Mutas always seem to have less hp than against a human". But he didn't notice that the flock he had selected always just had one muta that was hurt. Same with the wraiths here. He's talking about how valks+wraith is gonna destroy Pluto's valks, then 5s later he's dumbfounded the human player's air is just gone and he never figured out why. And for some reason didn't even think to go back and look at the battle.
*Pluto's wraiths
[08:05 am]
NudeRaider -- Oh_Man Artosis hasn't caught on how devastating the perfect focus fire is. With the mutas he was like "the Mutas always seem to have less hp than against a human". But he didn't notice that the flock he had selected always just had one muta that was hurt. Same with the wraiths here. He's talking about how valks+wraith is gonna destroy Pluto's valks, then 5s later he's dumbfounded the human player's air is just gone and he never figured out why. And for some reason didn't even think to go back and look at the battle.
[02:18 am]
Oh_Man -- Close enuf
[04:14 pm]
Vrael -- perhaps there is a small professional player trapped in a box in the server rack where pluto is running? hmm?
[04:14 pm]
Vrael -- 240*12*2 is 5760, where is the other 240 APM?
[03:44 pm]
Oh_Man -- 1 action is selecting the unit and another action is moving it
[02:58 pm]
Vrael -- 240*12 is 2880, where is the other 3000 APM?
[02:55 pm]
Oh_Man -- another arty stream
Please log in to shout.


Members Online: unlockshelf5