Staredit Network > Forums > SC2 Assistance > Topic: Creating an X+Y variable, having trouble...
Creating an X+Y variable, having trouble...
Mar 5 2011, 12:34 am
By: reapur  

Mar 5 2011, 12:34 am reapur Post #1



Hi Guys,
Ultimately here's what I want to do:
If player x has > 5 tanks then do something. Problem is tanks come in siege and tank mode. I want to the TOTAL tank and siege count.

Here's what I've got to work:
(Get the number of units of type Merc - Siege Breaker (Siege Mode) (Merc Siege Tank) owned by player 7 that have been seen by the specified player 7) > 13
This check works. After it's > 13, I do a disable on this type tank.
But the problem is if you pop it into tank mode, the count goes out of whack.

So I'm thinking that I need to do this check
(Get the number of units of type Merc - Siege Breaker (Siege Mode) (Merc Siege Tank) owned by player 7 that have been seen by the specified player 7)
and ADD the resulting number to this:
(Get the number of units of type Merc - Siege Breaker (Tank Mode) (Merc Siege Tank) owned by player 7 that have been seen by the specified player 7)
and compare the output to > 13.

The problem is I can't figure out how to assign a variable:
x= (Get the number of units of type Merc - Siege Breaker (Siege Mode) (Merc Siege Tank) owned by player 7 that have been seen by the specified player 7))
y= (Get the number of units of type Merc - Siege Breaker (Siege Mode) (Merc Siege Tank) owned by player 7 that have been seen by the specified player 7)
then I can do
If x+y > 13 then ...

any idea on how to make a variable x= to make this happen?
or any other ideas?

cheers



None.

Mar 5 2011, 12:58 am Ahli Post #2

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

You go to your trigger, click on "variables" and press ctrl+W. Then a new variable is created that you can give a new name.

You can modify variables with the actions within the "Variables" trigger action category.

You can calculate with numbers with "Math" -> "Arithmetic ( Integer)".




Mar 5 2011, 6:44 am reapur Post #3



Thanks Ahli,
I have a general idea of what you recommended. I've played with variables and also manipulated them with thru actions.
But I don't understand how you mean I should go about doing this.
Do you see a way in your mind that I can assign something like this, get its value and put it in a variable?
(Get the number of units of type Merc - Siege Breaker (Siege Mode) (Merc Siege Tank) owned by player 7 that have been seen by the specified player 7))

I can't find in variables how to use a function to get a value to assign to a variable.

:)



None.

Mar 5 2011, 8:59 pm Roy Post #4

An artist's depiction of an Extended Unit Death

You want something like this?

Untitled Trigger 001
    Events
        Timer - Every 0.05 seconds of Game Time
    Local Variables
        x = (Siege Tank (Tank Mode) count for player 7, counting Queued Or Better) <Integer>
        y = (Siege Tank (Siege Mode) count for player 7, counting Queued Or Better) <Integer>
        total = (x + y) <Integer>
    Conditions
        total > 13
    Actions
        ------- Actions


You can set the initial value of variables and click the function tab to assign it like above.




Mar 6 2011, 4:37 pm Riney Post #5

Thigh high affectionado

Wouldnt it be completed or better? :hurr:



.riney on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

Sure I didn't pop off on SCBW like I wanted to, but I won VRChat. Map maker for life.

Mar 6 2011, 6:56 pm Roy Post #6

An artist's depiction of an Extended Unit Death

Quote from Riney
Wouldnt it be completed or better? :hurr:
It's up to the implementer. If he wants as one of the effects the inability to build tanks, for instance, then queued or better would be the way to go. However, if his map doesn't revolve around constructing tanks in any way, then there would be no difference between using the 'queued' or 'completed' keywords.




Mar 6 2011, 9:16 pm Riney Post #7

Thigh high affectionado

The way he put it, the tanks have to exist.



.riney on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

Sure I didn't pop off on SCBW like I wanted to, but I won VRChat. Map maker for life.

Mar 11 2011, 12:29 am reapur Post #8



thanks guys.
a tremendous amount of help :)



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:05 pm]
NudeRaider -- DarkenedFantasies
DarkenedFantasies shouted: you eat lots of beans
:lol:
[11:30 am]
NudeRaider -- I would like 3000 minerals, please
[2026-4-16. : 7:32 pm]
Zoan -- I got $2000 bonus. I would like 2000 minerals, please
[2026-4-16. : 4:15 am]
DarkenedFantasies -- you eat lots of beans
[2026-4-16. : 3:46 am]
IskatuMesk -- how do i get gas
[2026-4-15. : 11:43 pm]
Moose -- you don't
[2026-4-15. : 10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
Please log in to shout.


Members Online: Zoan, Excalibur, Nekron