I don't believe you can set individual unit alliances, no.
You could:
Keep everyone as neutral. Players would have to attack manually.
or
Make triggers that give attack commands wherever you need them (would likely be quite complex).
or
Set up a new player, lets call him, "Discovered!". Give any discovered units to this shared control dummy player.
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.
They don't keep their value after the trigger finishes. Every variable resets for each run through (or it would work very poorly with different players using different bunkers). I'm using local variables, not global. But the bunker does keep the units, and that's what I check.
I don't see anything odd. I'm missing a few variables, but I assume they are in your map. What exactly does not work? Try showing the timer if that's the problem.
I think you misunderstood my trigger. It does add the tint, sort of. I pick each unit in the bunker that loaded a unit and then calculate the color. It does not matter in which order you load the units... or unload for that matter.
I'll set up a test map so you can see what I mean and copy that if you want. And no, it would not make the map lag (why would you run the trigger every second?). Triggers are low overhead. Animating a single marine is probably worse (very rough estimate).
Now the only problem left as far as I see it is finding colors that work well (if you want more than 4). I used red, green, blue and gray. It's hard to find other usable colors. Yellow... blue + yellow = green, bad.. etc.
I'd take a slightly different approach. Any time you load or unload a unit, check all cargo units and set the color appropriately. I'm in a bit of a rush, but using this as a base you should be able to get the desired effect. When the bunker is empty, it's pitch black (of course). Maybe check the current color of the player and set it to that or something if it's empty. Also, the numbers make it a bit dark at the moment. Maybe just set red / blue to a fixed number if X are in the bunker. I just found it a bit cool that the bunker got "redder" with more marines inside.
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 can give you an example in code later if you want. Gotta run now.
In my opinion, you should use the "for each integer" loop instead of a "while" loop. Then you won't have to manually increase or reset the variables. Like this:
(copied from another post of mine, but it's sort of the same thing)
Your problem is the order in which you do the if checks.
You start off with the timer at 30, and add 8. So now it's 38.
Your next if checks if it's 38, and it is.. so adding 8 more. Now it's 46.
the next if fires if it's 46. Bad luck, it is 46.
...and so on.
There are a few options to fix this, but the easiest as far as I can see would be to reverse the order of the checks. Start with your highest and check lower and lower. Now, if your timer is increased, the check for that higher timer has already been done, so it won't fire immediately.
...or use a local boolean variable that makes sure that the timer is only increased once each time the trigger runs.
I get the feeling that the entire procedure can be done with only one if check but using a few more variables that keeps track of which timer step you are currently on, but since you already have the trigger set up, might as well keep it I guess. Don't really matter as long as you get it to work as intended.
Edit:
Yeah, the trigger could be cleaned up quite a bit by removing redundant steps. But I think it's more important that you do it your way, so that you understand your own triggers.
I'm unsure exactly how switches work in the galaxy editor, but using that instead of if then might also solve the problem (assuming it only allows one case to be chosen, even if the variables change halfway through).
It would help if we had a bigger picture to look at. Copy your entire trigger as text and paste it here in code tags. It's better to see exactly what you did. Right now I'm sitting here guessing what your trigger looks like from your description.
I've been using: http://forums.sc2mapster.com/?scope=tree&search=Berrala&sort=-last-post
...which basically shows me all the topics I've posted in with the most active ones on top. The forums are a bit buggy for me, took me some trial and error testing to even get to that link since sorting refused to work when I clicked the different columns. Also, unread topics seem to reset and or simply refuse to work.
Why are you getting the unit type from a string conversion? Just choose SCV from "value" (not function).
Also, a mineral field isn't an item. Your order should be targeting a unit.
wOlfLisK's way is probably the simplest way, but you have no real control where the individual units go to gather, etc. Usually that's irrelevant though.
Ah, nice. I've been wanting to make a function, but never really had a reason to do so. I considered it briefly here, but didn't get into it since I haven't done any functions yet. Great example here on a situation where a function is very useful.
Guess I was tired when I posted my last post. Totally missed that you had got it working well.
He crouches when he actually shoots the sniper shot at the critters, but is there any way to make him crouch for the whole duration he is in the bush looking down on the critters, as well as shooting them? :)
I haven't been playing around much with actors and animations yet. Anyway, in the data editor for the ghost actor events, I found "Spell B" (aiming his gun). The aiming looks good enough, but after a snipe he stands up as part of the animation before aiming again, looks a bit weird. You could play around a bit with it and see how it works.
You actually said it yourself. You fade out (to black) and end the cinematic. Just fade back in or the game will stay black, as you told it to. :-)
A few thoughts on the map so far. I know, it's early but I'm a stickler for details.
- After you kill the revealers after the cinematic, you should also set the area to be unexplored (assuming you don't want it to be seen for some reason).
- Why is he sniping critters at point blank range? Doesn't feel very hunter'ish. Maybe add some distance, make him sit in a bush. Also, maybe add a reaction to the other critter when the first dies. Make him (try to) run away.
I like the terrain so far, detailed = good. Keep up the good work!
0
I don't believe you can set individual unit alliances, no.
You could:
Keep everyone as neutral. Players would have to attack manually.
or
Make triggers that give attack commands wherever you need them (would likely be quite complex).
or
Set up a new player, lets call him, "Discovered!". Give any discovered units to this shared control dummy player.
0
They don't keep their value after the trigger finishes. Every variable resets for each run through (or it would work very poorly with different players using different bunkers). I'm using local variables, not global. But the bunker does keep the units, and that's what I check.
0
I don't see anything odd. I'm missing a few variables, but I assume they are in your map. What exactly does not work? Try showing the timer if that's the problem.
0
I think you misunderstood my trigger. It does add the tint, sort of. I pick each unit in the bunker that loaded a unit and then calculate the color. It does not matter in which order you load the units... or unload for that matter.
I'll set up a test map so you can see what I mean and copy that if you want. And no, it would not make the map lag (why would you run the trigger every second?). Triggers are low overhead. Animating a single marine is probably worse (very rough estimate).
Now the only problem left as far as I see it is finding colors that work well (if you want more than 4). I used red, green, blue and gray. It's hard to find other usable colors. Yellow... blue + yellow = green, bad.. etc.
0
I'd take a slightly different approach. Any time you load or unload a unit, check all cargo units and set the color appropriately. I'm in a bit of a rush, but using this as a base you should be able to get the desired effect. When the bunker is empty, it's pitch black (of course). Maybe check the current color of the player and set it to that or something if it's empty. Also, the numbers make it a bit dark at the moment. Maybe just set red / blue to a fixed number if X are in the bunker. I just found it a bit cool that the bunker got "redder" with more marines inside.
Edit:
Changed from "if then" to a "switch".
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 can give you an example in code later if you want. Gotta run now.
0
Yup, what Riley said.
In my opinion, you should use the "for each integer" loop instead of a "while" loop. Then you won't have to manually increase or reset the variables. Like this:
(copied from another post of mine, but it's sort of the same thing)
0
Yeah, that's the way it should work, but as I haven't used it here yet, I didn't want to say anything for certain.
0
Your problem is the order in which you do the if checks.
You start off with the timer at 30, and add 8. So now it's 38.
Your next if checks if it's 38, and it is.. so adding 8 more. Now it's 46.
the next if fires if it's 46. Bad luck, it is 46.
...and so on.
There are a few options to fix this, but the easiest as far as I can see would be to reverse the order of the checks. Start with your highest and check lower and lower. Now, if your timer is increased, the check for that higher timer has already been done, so it won't fire immediately.
...or use a local boolean variable that makes sure that the timer is only increased once each time the trigger runs.
I get the feeling that the entire procedure can be done with only one if check but using a few more variables that keeps track of which timer step you are currently on, but since you already have the trigger set up, might as well keep it I guess. Don't really matter as long as you get it to work as intended.
Edit:
Yeah, the trigger could be cleaned up quite a bit by removing redundant steps. But I think it's more important that you do it your way, so that you understand your own triggers.
I'm unsure exactly how switches work in the galaxy editor, but using that instead of if then might also solve the problem (assuming it only allows one case to be chosen, even if the variables change halfway through).
0
It would help if we had a bigger picture to look at. Copy your entire trigger as text and paste it here in code tags. It's better to see exactly what you did. Right now I'm sitting here guessing what your trigger looks like from your description.
0
Exactly, that's what I meant by trial and error. I guessed the link and added the "-" to invert the sorting (compared to how post count worked).
0
I've been using: http://forums.sc2mapster.com/?scope=tree&search=Berrala&sort=-last-post
...which basically shows me all the topics I've posted in with the most active ones on top. The forums are a bit buggy for me, took me some trial and error testing to even get to that link since sorting refused to work when I clicked the different columns. Also, unread topics seem to reset and or simply refuse to work.
0
Why are you getting the unit type from a string conversion? Just choose SCV from "value" (not function).
Also, a mineral field isn't an item. Your order should be targeting a unit.
wOlfLisK's way is probably the simplest way, but you have no real control where the individual units go to gather, etc. Usually that's irrelevant though.
0
Ah, nice. I've been wanting to make a function, but never really had a reason to do so. I considered it briefly here, but didn't get into it since I haven't done any functions yet. Great example here on a situation where a function is very useful.
Guess I was tired when I posted my last post. Totally missed that you had got it working well.
0
I haven't been playing around much with actors and animations yet. Anyway, in the data editor for the ghost actor events, I found "Spell B" (aiming his gun). The aiming looks good enough, but after a snipe he stands up as part of the animation before aiming again, looks a bit weird. You could play around a bit with it and see how it works.
0
You actually said it yourself. You fade out (to black) and end the cinematic. Just fade back in or the game will stay black, as you told it to. :-)
A few thoughts on the map so far. I know, it's early but I'm a stickler for details.
- After you kill the revealers after the cinematic, you should also set the area to be unexplored (assuming you don't want it to be seen for some reason).
- Why is he sniping critters at point blank range? Doesn't feel very hunter'ish. Maybe add some distance, make him sit in a bush. Also, maybe add a reaction to the other critter when the first dies. Make him (try to) run away.
I like the terrain so far, detailed = good. Keep up the good work!