Ohhh, I was thinking that each time the trigger ran the variables would be reset back to zero. I didn't realize they kept their value.
I understand now. You've been extremely helpful, thanks.
BTW, I'm not actually going to run the trigger every second, that was just a rough estimate of how often I think it would be used. It's an 8-player tower defense map, so everybody would be putting units in bunkers at the same time after a wave.
I've decided to only have 4 units for the bunkers instead of 5, so that means 20 color combinations. I also realized that if you put a marauder in a bunker, you're not going to be able to have a marine/hydralisk combo, so I'll only need 6 switch actions each time a unit is loaded.
Would running a trigger with 6 switch actions every second make the map very laggy?
The problem is I want to add tint rather than set it. Somebody puts a marauder in a bunker, that turns it red. After that, if they put a Marine in the same bunker, I want it to add blue tint to turn it purple. With your method it would just make the bunker red when a marauder enters, then turn it blue when a marine enters. I need to be able to get the current tint so I can add to that - so if a marauder is in a bunker, that sets the tint to 50% 0% 0%, and then if a marine enters, instead of setting it to 0% 0% 50%, it would get the current tint (50% 0% 0%) and add 50% to the red, making it purple.
Edit 2:
Another way to do it would be to simply check "if marine" "if marine marauder" "if marauder" "if empty" (using a few more variables in the switch), and then set the colors to exactly what you want in another switch... depending, of course, on how many different unit combinations are possible in your map.
I could do this, but as I said, there are 30 possible color combinations - wouldn't that make the map laggy? It's going to be a maze defense map where you build bunkers (which have a 1x1 footprint) and then build units inside of them, so the trigger would be running a lot.
I'm trying to make it so bunkers are tinted a certain color if a certain type of unit is loaded into them. For example: if marines are blue and marauders are red, then a bunker with one marine and one marauder would be purple, or a bunker with two marines would be blue, etc.
The problem is I need to add tint to a bunker when a marine is loaded into it, rather than set the tint of it. Here's what I have so far:
Events
Unit - Any Unit Loads Cargo
Conditions
(Unit Type of (Triggering Cargo Unit)) == Marine
Actions Send Actor Message To Unit
Message: Set Tint Color
- Color: Convert Reals To Color With Alpha
- - Red: Arithmetic (Real)
- - - Value 1: Absolute Value (Real)
- - - - ?????
- - - Operator: +
- - - Value 2: 1.0
- - Green: 100.0%
etc.
This is where I'm having problems. I want to get the current percentage of red tint on the bunker and add to that. I've tried everything I could think of and nothing has worked.
Bunkers can only load two units in my map, so I suppose I could just make 30 triggers for all of the color combinations, but wouldn't that make my map laggy?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Damn, I'm really stupid today. But I get it now. For reals this time. Thanks.
Ohhh, I was thinking that each time the trigger ran the variables would be reset back to zero. I didn't realize they kept their value.
I understand now. You've been extremely helpful, thanks.
BTW, I'm not actually going to run the trigger every second, that was just a rough estimate of how often I think it would be used. It's an 8-player tower defense map, so everybody would be putting units in bunkers at the same time after a wave.
I've decided to only have 4 units for the bunkers instead of 5, so that means 20 color combinations. I also realized that if you put a marauder in a bunker, you're not going to be able to have a marine/hydralisk combo, so I'll only need 6 switch actions each time a unit is loaded.
Would running a trigger with 6 switch actions every second make the map very laggy?
The problem is I want to add tint rather than set it. Somebody puts a marauder in a bunker, that turns it red. After that, if they put a Marine in the same bunker, I want it to add blue tint to turn it purple. With your method it would just make the bunker red when a marauder enters, then turn it blue when a marine enters. I need to be able to get the current tint so I can add to that - so if a marauder is in a bunker, that sets the tint to 50% 0% 0%, and then if a marine enters, instead of setting it to 0% 0% 50%, it would get the current tint (50% 0% 0%) and add 50% to the red, making it purple.
I could do this, but as I said, there are 30 possible color combinations - wouldn't that make the map laggy? It's going to be a maze defense map where you build bunkers (which have a 1x1 footprint) and then build units inside of them, so the trigger would be running a lot.
I'm trying to make it so bunkers are tinted a certain color if a certain type of unit is loaded into them. For example: if marines are blue and marauders are red, then a bunker with one marine and one marauder would be purple, or a bunker with two marines would be blue, etc.
The problem is I need to add tint to a bunker when a marine is loaded into it, rather than set the tint of it. Here's what I have so far:
Events
Unit - Any Unit Loads Cargo
Conditions
(Unit Type of (Triggering Cargo Unit)) == Marine
Actions
Send Actor Message To Unit
Message: Set Tint Color
- Color: Convert Reals To Color With Alpha
- - Red: Arithmetic (Real)
- - - Value 1: Absolute Value (Real)
- - - - ?????
- - - Operator: +
- - - Value 2: 1.0
- - Green: 100.0%
etc.
This is where I'm having problems. I want to get the current percentage of red tint on the bunker and add to that. I've tried everything I could think of and nothing has worked.
Bunkers can only load two units in my map, so I suppose I could just make 30 triggers for all of the color combinations, but wouldn't that make my map laggy?