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.
[02:53 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: I'll check it out this weekend!
Thanks
[02:47 am]
Symmetry -- I'll check it out this weekend!
[02:40 am]
Mr.BurnLiquid -- Symmetry
Symmetry shouted: Another map maker? Damn we really ARE back
I invite you to try out the map I modified. I don't have the creativity to create maps from scratch, but I do have the know-how to modify existing ones; my project is to tweak community campaigns (specifically those with errors—to make them playable.
[02:27 am]
Symmetry -- Another map maker? Damn we really ARE back
[01:51 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Now that I wanted to change my avatar, the error image is showing up, haha.
[01:34 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
I invite you to try out a mission I'm modifying from *StarCraft Reversed*; I'm trying to make it more playable and challenging.
[01:33 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: Mr.BurnLiquid actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
Thanks; I'm new to the site and a Spanish speaker. I must have missed the part where it was prohibited—I'll change it now.
[01:31 am]
Ultraviolet -- Mr.BurnLiquid
Mr.BurnLiquid shouted: Ultraviolet Is it forbidden to have a large avatar?
actually yeah though I wasn't really saying it to narc on you. It just caught me off guard because I don't usually see it (because it's against the rules) "The avatar may not be bigger than 150x150 pixels". Kinda silly that it relies on users to be well behaved rather than just limiting the dimensions on uploads :lol:
[12:20 am]
Mr.BurnLiquid -- Ultraviolet
Ultraviolet shouted: https://staredit.net/profile/133367/ dude's avatar is massive
Is it forbidden to have a large avatar?
[12:04 am]
Ultraviolet -- https://staredit.net/profile/133367/ dude's avatar is massive
Please log in to shout.


Members Online: UndeadStar, Ultraviolet