Staredit Network

Staredit Network -> UMS Assistance -> Gas 2 Cash
Report, edit, etc...Posted by Slayer_dt_ on 2005-11-24 at 01:36:46
I need some help here.. I'm currently making a Starcraft version of Line Tower D (For those of you who played Warcraft, you should know this happy.gif ) But I need to know how to convert gas into cash... some help please biggrin.gif
Report, edit, etc...Posted by RedNara on 2005-11-24 at 02:06:21
well you can say current player has atleast 1 gas as condition

and subtract 1 gas and add 1 min...

or you mean cash in credits like so you can buy hero if so. after you have certain amount of gas subtract that much gas and create 1 i donno that unit and preserve trigger.

sorry what i said is very unclear
Report, edit, etc...Posted by Slayer_dt_ on 2005-11-24 at 02:33:43
I mean I'm trying to get the similar kind used in Spawn Defense and Income Defense... You accumilate let's say 100 gas, and after countdown timer is gone, the same amount of gas (100 gas) becomes 100 minerals, and then your gas returns to its original number (100 gas)
Report, edit, etc...Posted by RedNara on 2005-11-24 at 03:08:02
oh seems more complicated and i havent play any of thoes games.. just wait i guess someone else will post sorry dude. :\ if i atleast played it once i might get it more...
Report, edit, etc...Posted by Slayer_dt_ on 2005-11-24 at 03:17:38
Oh ok... pity SC doesn't have much in-game features as WC... I've tried to search everywhere but came up empty handed.. someone please help helpsmilie.gif
Report, edit, etc...Posted by Lithium on 2005-11-24 at 05:11:11
I dont like the HTML Trigger Thingy.

Trigger:
[Condition]
Accumilate 100 Gas
Countdown Timer Reaches 0.

[Action]
Subtract 100 Gas for Current Player
Add 100 Mineral for Current Player
Preserve Trigger.

--

[Condition]
Countdown Timer Reaches 0.

[Action]
Set Countdown Timer "Time".
Preserve Trigger.


--
Oh your talking about Income Defense...

I cant figure it out... its really complicated.
It appears you probably need to ask someone like Libre or Vic.

I think i should have an answer though.... to think about for half an hour.
Report, edit, etc...Posted by Diggidoyo on 2005-11-24 at 05:26:11
Yeah there's a 3 step process to doing those maps:

1. When the player spawns a unit, it gives the player a certain amount of gas.

2a When the timer is up, it does what boyscout says and takes away gas (-500's, trigger, -100's trigger, all the way down to -1 gas +1 mineral trigger) giving it to minerals until the player has 0 gas.

2b. At the same time it is doing step 2a, in the same trigger you have to give the amount of gas the player has to his death count (for NPU) or custom score (w/e u want)

3. Then when the player has 0 gas (<= condition), it trades his death count (or custom score) for gas all the way back up until his death count (or custom score) = 0

Hope that helps. I can explain in more detail if you don't understand.

I'll try the trigger thing in my next post. I haven't tried using it yet.

ADDITION:
HAve a trigger that sets switch 1 when the timer is 0:00. Then the following triggers happen when that switch is set:



Trigger
Description:
Gas Income
Players:
¤ P1
Conditions:
¤ Accumulate at least 1 gas
¤ Acummulate at most 4 gas
Actions:
¤ Set Resources, P1, subtract, 1, gas
¤ Set Resources, P1, add, 1 ore
¤ Set Score, P1, add, 1, custom
¤ Preserve Trigger



Trigger
Description:
Gas Income
Players:
¤ P1
Conditions:
¤ Accumulate at least 5 gas
¤ Acummulate at most 9 gas
Actions:
¤ Set Resources, P1, subtract, 5, gas
¤ Set Resources, P1, add, 5 ore
¤ Set Score, P1, add, 5, custom
¤ Preserve Trigger



Trigger
Description:
Gas Income
Players:
¤ P1
Conditions:
¤ Accumulate at least 10 gas
¤ Acummulate at most 19 gas
Actions:
¤ Set Resources, P1, subtract, 10, gas
¤ Set Resources, P1, add, 10 ore
¤ Set Score, P1, add, 10, custom
¤ Preserve Trigger



Trigger
Description:
Gas Income
Players:
¤ P1
Conditions:
¤ Accumulate at least 20 gas
¤ Acummulate at most 49 gas
Actions:
¤ Set Resources, P1, subtract, 20, gas
¤ Set Resources, P1, add, 20 ore
¤ Set Score, P1, add, 20, custom
¤ Preserve Trigger



Blah Blah Blah etc etc etc... using this process going up as high as you want. Using this process will take care of steps 1 and 2a/2b by converting gas into ore and custom score starting with high increments and going all the way down to 1 till he reaches 0. Then for step 3 have switch 2 be set when P1 has 0 gas and the following triggers occure when switch 2 fires:


Trigger
Description:
Score Back to Gas
Players:
¤ P1
Conditions:
¤ Score, P1, at least, 1, custom
¤ Score, P1, at least, 4, custom
Actions:
¤ Set Score, P1, subtract, 1, custom
¤ Set Resources, P1, add, 1 ore
¤ Preserve Trigger


Etc etc same as steps 1 and 2, until the player custom score is 0, then you switch the triggers and the process repeats!


Report, edit, etc...Posted by Staredit.Net Essence on 2005-11-24 at 05:27:31
QUOTE(Lithium @ Nov 24 2005, 04:11 AM)
I dont like the HTML Trigger Thingy.

Trigger:
[Condition]
Accumilate 100 Gas
Countdown Timer Reaches 0.

[Action]
Subtract 100 Gas for Current Player
Add 100 Mineral for Current Player
Preserve Trigger.

--

[Condition]
Countdown Timer Reaches 0.

[Action]
Set Countdown Timer "Time".
Preserve Trigger.

[right][snapback]363378[/snapback][/right]



Just So The Topic Starter Doesn't Get Confused, Say You Have An Uneven Number OF Minerals, And You Want All Your Gas To Be Converted, It'll Have To Look Like This:


Trigger
Description:
Part 1
Players:
¤ Players Trigger Affecting
Conditions:
¤ Current Player Accumulates At Least 1 Minerals
¤ Countdown Timer Is 0
Actions:
¤ Subtract 1 Mineral From Current Player
¤ Add 1 Gas For Current Player
¤ Preserve Trigger







::Mp)Shorty
Report, edit, etc...Posted by Diggidoyo on 2005-11-24 at 05:35:35
QUOTE
Then for step 3 have switch 2 be set when P1 has 0 gas


Haha that sounds funny when you say it out loud just becuase it contains 3,2,1,0. drunk.gif
Report, edit, etc...Posted by Lithium on 2005-11-24 at 08:33:49
that'd need so much triggers if i imagine in those shorty numbers. That system wont work because incomeD's income system goes on forever and ever. I never seen it end anyways. the furthest i got was 42 million in income d.
Report, edit, etc...Posted by Diggidoyo on 2005-11-24 at 09:44:36
The one I posted would work, and techincally you can stop at 100 and it would take care of 42 million and beyond... just really slow... the way it works is:

You have 42,000,000 gas

Trigger condition for "accumulate at least 100 gas" kicks in.

---Starts taking away 100's until it gets down to 99 or less...

that's when you need an "accumulate 50-99 gas" to take away 50 gas

---brings you down to 0-49

etc...

just starts taking away by smaller and smaller increments until you have 0...

But becuase it would take so long to take away 42,000,000 gas by the hundreds, you can add another trigger to take it away by 500's or thousands, etc, depending on how long you expect your game to last.
Report, edit, etc...Posted by PCFredZ on 2005-11-24 at 10:47:42
QUOTE(Diggidoyo @ Nov 24 2005, 09:44 AM)
The one I posted would work, and techincally you can stop at 100 and it would take care of 42 million and beyond... just really slow... the way it works is:

You have 42,000,000 gas

Trigger condition for "accumulate at least 100 gas" kicks in.

---Starts taking away 100's until it gets down to 99 or less...

that's when you need an  "accumulate 50-99 gas" to take away 50 gas

---brings you down to 0-49

etc...

just starts taking away by smaller and smaller increments until you have 0...

But becuase it would take so long to take away 42,000,000 gas by the hundreds, you can add another trigger to take it away by 500's or thousands, etc, depending on how long you expect your game to last.
[right][snapback]363436[/snapback][/right]

Might as well do a binary system so you only need a single trigger cycle to convert all the gas to minerals.
Report, edit, etc...Posted by Diggidoyo on 2005-11-24 at 12:17:23
Binary wtf??

remember there are 10 kinds of people in the world
  • those who understand binary
  • and those who don't

and I don't. Will w/e you're saying work for all players? With the triggers I posted you can easily duplicate for all eight players.
Report, edit, etc...Posted by PCFredZ on 2005-11-24 at 12:38:23
By doing powers of 2, each trigger through a cycle will either run once or not run because of the way that binary works (either on or off).

E.g.: 10000 = 8192 (2^13) + 1024 (2^10) + 512 (2^9) + 256 (2^8) + 16 (2^4). So the trigger runs once each for these numbers, and you're already done, so you don't need to wait for the units of 100, 50, etc.
Report, edit, etc...Posted by Diggidoyo on 2005-11-24 at 18:35:38
can you show me a trigger which can implement "binary"?
Report, edit, etc...Posted by Cnl.Fatso on 2005-11-24 at 19:14:31
Okay:

Trigger
Players:
¤ Players
Conditions:
¤ Timer X is at at most 0 seconds.
¤ Current player has at least 1024 Gas.
Actions:
¤ Modify resources for current player: Subtract 1024 gas.
¤ Modify resources for current player: add 1024 Minerals.
¤ Preserve trigger.


Trigger
Players:
¤ Players
Conditions:
¤ Timer X is at at most 0 seconds.
¤ Current player has at least 512 Gas.
¤ Current player has at most 1023 Gas.
Actions:
¤ Modify resources for current player: Subtract 512 Gas.
¤ Modify resources for current player: Add 512 Minerals.
¤ Preserve trigger.


Trigger
Players:
¤ Players
Conditions:
¤ Timer X is at at most 0 seconds.
¤ Current player has at least 256 Gas.
¤ Current player has at most 511 Gas.
Actions:
¤ Modify resources for current player: Subtract 256 Gas.
¤ Modify resources for current player: Add 256 Minerals.
¤ Preserve trigger.


Trigger
Players:
¤ Players
Conditions:
¤ Timer X is at at most 0 seconds.
¤ Current player has at least 128 Gas.
¤ Current player has at most 255 Gas.
Actions:
¤ Modify resources for current player: Subtract 128 Gas.
¤ Modify resources for current player: Add 128 Minerals.
¤ Preserve trigger.


Trigger
Players:
¤ Players
Conditions:
¤ Timer X is at at most 0 seconds.
¤ Current player has at least 64 Gas.
¤ Current player has at most 127 Gas.
Actions:
¤ Modify resources for current player: Subtract 64 Gas.
¤ Modify resources for current player: Add 64 Minerals.
¤ Preserve trigger.


Trigger
Players:
¤ Players
Conditions:
¤ Timer X is at at most 0 seconds.
¤ Current player has at least 32 Gas.
¤ Current player has at most 63 Gas.
Actions:
¤ Modify resources for current player: Subtract 32 Gas.
¤ Modify resources for current player: Add 32 Minerals.
¤ Preserve trigger.


Trigger
Players:
¤ Players
Conditions:
¤ Timer X is at at most 0 seconds.
¤ Current player has at least 16 Gas.
¤ Current player has at most 31 Gas.
Actions:
¤ Modify resources for current player: Subtract 16 Gas.
¤ Modify resources for current player: Add 16 Minerals.
¤ Preserve trigger.


Trigger
Players:
¤ Players
Conditions:
¤ Timer X is at at most 0 seconds.
¤ Current player has at least 8 Gas.
¤ Current player has at most 15 Gas.
Actions:
¤ Modify resources for current player: Subtract 8 Gas.
¤ Modify resources for current player: Add 8 Minerals.
¤ Preserve trigger.


Trigger
Players:
¤ Players
Conditions:
¤ Timer X is at at most 0 seconds.
¤ Current player has at least 4 Gas.
¤ Current player has at most 7 Gas.
Actions:
¤ Modify resources for current player: Subtract 4 Gas.
¤ Modify resources for current player: Add 4 Minerals.
¤ Preserve trigger.


Trigger
Players:
¤ Players
Conditions:
¤ Timer X is at at most 0 seconds.
¤ Current player has at least 2 Gas.
¤ Current player has at most 3 Gas.
Actions:
¤ Modify resources for current player: Subtract 2 Gas.
¤ Modify resources for current player: Add 2 Minerals.
¤ Preserve trigger.


Trigger
Players:
¤ Players
Conditions:
¤ Timer X is at at most 0 seconds.
¤ Current player has exactly 1 Gas.
Actions:
¤ Modify resources for current player: Subtract 1 Gas.
¤ Modify resources for current player: Add 1 Minerals.
¤ Preserve trigger.


There you have it-- the first 10 binary triggers.
Report, edit, etc...Posted by I-X-King-X-I on 2005-11-24 at 19:19:53
Trigger
Players:
¤ Current Player
Conditions:
¤ Countdown timer reaches 0
¤ Current player has accumlated at least 1 gas
Actions:
¤ Subtract 1 gas
¤ Add 1 mineral
¤ Preserve trigger
¤ Set deaths 1 (some unit not being used)

now do same for 10, 100, 1000, 10000, 1000000 etc.

now to get ur gas back up do
Trigger
Players:
¤ Current player
Conditions:
¤ Current player has at least 1 death (same unit as used in first trigger)
Actions:
¤ Subtract 1 death (that unit)
¤ Add 1 gas
¤ Preserve trigger

^ do more than jsut that one.. do one for like 5, 10, 100, 500, etc.

there ya go
Report, edit, etc...Posted by Diggidoyo on 2005-11-24 at 19:26:03
QUOTE
I mean I'm trying to get the similar kind used in Spawn Defense and Income Defense... You accumilate let's say 100 gas, and after countdown timer is gone, the same amount of gas (100 gas) becomes 100 minerals, and then your gas returns to its original number (100 gas)


You guys are completly ignoring his post ^. He doesn't just want to change gas to minerals (which is easy to do with any one of the ways posted above) but he also wants to SAVE the amount of gas that player has... and give it back to the player after its been converted. Thats the only reason why I posted my triggers becuase saving the gas to the death count/custom score is the only way I could think of do that. All of your posts just convert, they don't save, as he asked.
Report, edit, etc...Posted by I-X-King-X-I on 2005-11-24 at 19:35:42
QUOTE(Diggidoyo @ Nov 24 2005, 06:26 PM)
You guys are completly ignoring his post ^. He doesn't just want to change gas to minerals (which is easy to do with any one of the ways posted above) but he also wants to SAVE the amount of gas that player has... and give it back to the player after its been converted. Thats the only reason why I posted my triggers becuase saving the gas to the death count/custom score is the only way I could think of do that. All of your posts just convert, they don't save, as he asked.
[right][snapback]363926[/snapback][/right]

modified my post to do it tongue.gif
Report, edit, etc...Posted by in_a_biskit on 2005-11-24 at 23:10:18
Digidoyo has the right idea [snapback]363379[/snapback]:
Count off the gas into minerals and another counter simultaneously. Then count back the other counter into gas to restore the original amount.

PCFredZ's suggestion of using a binary counter is good.

The tricky bit is to make sure you can keep track of whether your gas is supposed to be going up or down, and not having the countdown timer reset before the cycle is finished. Digidoyo gets around this using two switches - the problem I see with this is that since switches are global (they are the same to all players), having multiple players may confuse the system. It may be better to use a death counter to keep track of the triggers instead.

Here's essentially the basic method again, but hopefully in a clearer way.
(Every trigger is preserved; all player fields are "current player".)
  1. conditions: Countdown timer is 0, deathcount1 is 0[sup]1[/sup]
    actions: Set deathcount1 to 1, wait 0[sup]2[/sup], set countdown timer to {time}[sup]3[/sup]
  2. [sup]4[/sup] conditions: Gas accumulated at least 1, deathcount1 is 1
    actions: Subtract 1 gas, add 1 mineral, add 1 for deathcount2
  3. conditions: Gas accumulated at most 0, deathcount1 is 1
    actions: Set deathcount1 to 2
  4. [sup]4[/sup] conditions: Deathcount2 is at least 1, deathcount1 is 2
    actions: Subtract 1 for deathcount2, add 1 gas
  5. conditions: Deathcount2 is at most 0, deathcount1 is 2
    actions: Set deathcount1 to 0
Notes:
1: Deathcount1 has the same role as Digidoyo's switches; it keeps track of which stage the triggers are at.

2: This "wait 0" is to make sure that all the players have a chance to set deathcount1 to 1 (and so start this set of triggers) before the countdown timer is reset. Personally, however, I think this is a pretty messy way to do this - can anyone suggest a better way?

3: This system resets the countdown timer right at the beginning, so that the time between income-earning is constant (the triggers giving income work whilst the countdown timer is beginning to count down). The problem is that for large incomes and short countdown times, the trigger set might not finish in time for the next income round. The alternative is to wait until everyone has finished calculating their income and resetting their gas before resetting the countdown timer, but then you have to work out how to work out when everyone has finished calculating their income. You might try using a trigger which checks for everyone's deathcount1 to be 2 and deathcount1 to be 0, but then the trigger would fail without all players being present.

4: Steps 2 and 4 are the ones where you would insert a 'binary counter' system if you wish.
Report, edit, etc...Posted by Slayer_dt_ on 2005-11-25 at 07:38:03
QUOTE(in_a_biskit @ Nov 25 2005, 12:10 PM)
Digidoyo has the right idea [snapback]363379[/snapback]:
Count off the gas into minerals and another counter simultaneously.  Then count back the other counter into gas to restore the original amount.

PCFredZ's suggestion of using a binary counter is good.

The tricky bit is to make sure you can keep track of whether your gas is supposed to be going up or down, and not having the countdown timer reset before the cycle is finished. Digidoyo gets around this using two switches - the problem I see with this is that since switches are global (they are the same to all players), having multiple players may confuse the system.  It may be better to use a death counter to keep track of the triggers instead.

Here's essentially the basic method again, but hopefully in a clearer way.
(Every trigger is preserved; all player fields are "current player".)

  1. conditions: Countdown timer is 0, deathcount1 is 0[sup]1[/sup]
    actions: Set deathcount1 to 1, wait 0[sup]2[/sup], set countdown timer to {time}[sup]3[/sup]

  2. [sup]4[/sup] conditions: Gas accumulated at least 1, deathcount1 is 1
    actions: Subtract 1 gas, add 1 mineral, add 1 for deathcount2

  3. conditions: Gas accumulated at most 0, deathcount1 is 1
    actions: Set deathcount1 to 2

  4. [sup]4[/sup] conditions: Deathcount2 is at least 1, deathcount1 is 2
    actions: Subtract 1 for deathcount2, add 1 gas

  5. conditions: Deathcount2 is at most 0, deathcount1 is 2
    actions: Set deathcount1 to 0
Notes:
1: Deathcount1 has the same role as Digidoyo's switches; it keeps track of which stage the triggers are at.

2: This "wait 0" is to make sure that all the players have a chance to set deathcount1 to 1 (and so start this set of triggers) before the countdown timer is reset.  Personally, however, I think this is a pretty messy way to do this - can anyone suggest a better way?

3: This system resets the countdown timer right at the beginning, so that the time between income-earning is constant (the triggers giving income work whilst the countdown timer is beginning to count down).  The problem is that for large incomes and short countdown times, the trigger set might not finish in time for the next income round.  The alternative is to wait until everyone has finished calculating their income and resetting their gas before resetting the countdown timer, but then you have to work out how to work out when everyone has finished calculating their income.  You might try using a trigger which checks for everyone's deathcount1 to be 2 and deathcount1 to be 0, but then the trigger would fail without all players being present.

4: Steps 2 and 4 are the ones where you would insert a 'binary counter' system if you wish.
[right][snapback]364129[/snapback][/right]

I've tried the other triggers but those didn't work.. and I'm sort of lost with this one... Can you explain a bit simpler?
Report, edit, etc...Posted by in_a_biskit on 2005-11-25 at 08:01:22
All the methods do pretty much the same thing (except the digidoyo didn't include his switch conditions in his trigger descriptions). In a nutshell:
QUOTE(biskit)
Count off the gas into minerals and another counter simultaneously.  Then count back the other counter into gas to restore the original amount.

In my trigger set above:
step 1: when the countdown timer reaches 0, start counting off gas into minerals and deathcount2.
step 2: (trigger that counts gas into minerals and deathcount2)
step 3: when all the gas has been counted off, start restoring deathcount2 back into gas.
step 4: (trigger that counts deathcount2 into gas)
step 5: when all of deathcount2 has been counted off, the trigger cycle is ready to start again next time the countdown timer reaches zero.

Is that still confusing?
Report, edit, etc...Posted by Slayer_dt_ on 2005-11-25 at 08:22:40
How's the death count counter supposed to work?
Report, edit, etc...Posted by Diggidoyo on 2005-11-25 at 08:47:09
It just keeps track of how many units of that type you've lost. For instance if you make 12 zerglings, and you send them to the enemy base, your death count of zerglings would be 12 (assuming they all die of course laugh.gif)

With triggers however, you can make any players death count be w/e you want for any unit. Its just a neat trick to use for UMS maps. Just make sure the unit you choose is not actually used in the map or else it will mess things up. Choose something like death count of floortraps or independent command centers etc.
Report, edit, etc...Posted by Slayer_dt_ on 2005-11-25 at 08:57:22
Oh! I get it now, but I think i'll need a pretty large amount of triggers once the income reaches like 100k
Next Page (1)