Heavy Guard Purchase
Events
Unit - Any Unit uses Engineering Bay - Heavy Guard Upgrade at Generic6 - Complete stage (Ignore shared abilities)
Local Variables
Conditions
Actions
Variable - Set Heavy_Guard_Upgrade[(Triggering player)] = true
**Then a Trigger:**
Heavy Guard Spawn
Events
Timer - Every 12.0 seconds of Game Time
Local Variables
Conditions
Actions
Player Group - Pick each player in Active_Players and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
Player_Imprisoned[(Picked player)] == false
Guard_Post_Alive[(Picked player)] == true
Heavy_Guard_Upgrade[(Picked player)] == true
Then
Unit - Create 1 Heavy Guard for player (Picked player) at Guard_Spawn[(Picked player)] using default facing (No Options)
Else
**It's not working. Any ideas?**
Basically when the player buys the upgrade it's suppose to turn spawning on for a Heavy Guard unit. I think the problem is the Heavy Guard Purchase part, where it's setting the trigger when all it needs to do it change the value of the boolean for that player to true but I can't find the command in the editor to do that.
Everything seems to work, I even get the message on the screen that says "You just completed Heavy Guard research" which is the line of code right before the line of code that isn't working, which is this line:
Variable - Set Heavy_Guard_Upgrade[(Owner of (Triggering progress unit))] = On
I assume that's where I'm messing up but no matter what I try, I just can't get the Heavy Guards to spawn for that player.
I don't know where I'm going wrong. Is it the variable itself, I'm trying to use a on/off boolean. Could it be something in the data editor for the unit itself (somehow I don't think so). Here is a screenshot with the error I'm getting:
What i think, you are trying to reffer to "triggering progress unit", which is the unit created... but there's none, its an upgrade. Try using triggering unit instead.
Try printing text of # of player owner of triggering progress unit and triggering unit and see if both come up, dunno.
Heavy Guard Purchase
Events
Unit - Any Unit uses Engineering Bay - Heavy Guard Upgrade at Generic6 - Complete stage (Ignore shared abilities)
Local Variables
Conditions
Actions
Variable - Set Heavy_Guard_Upgrade[(Triggering player)] = true
Maybe, this doesn't accept "Triggering player", as it is a unit, that triggeers. You could try using "Owner of Unit (Triggering Unit)"
**So I have something that looks like this:**
Heavy_Guard_Upgrade = false <Boolean[9]>
**Then an Event:**
Heavy Guard Purchase
Events
Unit - Any Unit uses Engineering Bay - Heavy Guard Upgrade at Generic6 - Complete stage (Ignore shared abilities)
Local Variables
Conditions
Actions
Variable - Set Heavy_Guard_Upgrade[(Triggering player)] = true
**Then a Trigger:**
Heavy Guard Spawn
Events
Timer - Every 12.0 seconds of Game Time
Local Variables
Conditions
Actions
Player Group - Pick each player in Active_Players and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
Player_Imprisoned[(Picked player)] == false
Guard_Post_Alive[(Picked player)] == true
Heavy_Guard_Upgrade[(Picked player)] == true
Then
Unit - Create 1 Heavy Guard for player (Picked player) at Guard_Spawn[(Picked player)] using default facing (No Options)
Else
**It's not working. Any ideas?**
Basically when the player buys the upgrade it's suppose to turn spawning on for a Heavy Guard unit. I think the problem is the Heavy Guard Purchase part, where it's setting the trigger when all it needs to do it change the value of the boolean for that player to true but I can't find the command in the editor to do that.
Help please?
I don't know if that event works or not, but you can try using the research event:
I have no idea what's going on but it's making some of my marines spawn with shields and some without...
I think I've got this all messed up.
Okay, so here are some screenshots of what I've got going on here:
http://img826.imageshack.us/f/scedit0001.png/
http://img697.imageshack.us/f/scedit0002.png/
Everything seems to work, I even get the message on the screen that says "You just completed Heavy Guard research" which is the line of code right before the line of code that isn't working, which is this line:
Variable - Set Heavy_Guard_Upgrade[(Owner of (Triggering progress unit))] = On
I assume that's where I'm messing up but no matter what I try, I just can't get the Heavy Guards to spawn for that player.
I don't know where I'm going wrong. Is it the variable itself, I'm trying to use a on/off boolean. Could it be something in the data editor for the unit itself (somehow I don't think so). Here is a screenshot with the error I'm getting:
http://img834.imageshack.us/f/scedit0003.png/
I'm lost.
What i think, you are trying to reffer to "triggering progress unit", which is the unit created... but there's none, its an upgrade. Try using triggering unit instead.
Try printing text of # of player owner of triggering progress unit and triggering unit and see if both come up, dunno.
Triggering Unit is grayed out. It's not an option for that specific spot in the code.
And Triggering Progress Upgrade isn't an option either :(
Try running map test with debugging on and see if all variables are being set up correctly.
http://forums.sc2mapster.com/resources/tutorials/11659-trigger-debugging-how-to-open-and-use-the-trigger-debugger/
@uiasdnmb: Go
Maybe, this doesn't accept "Triggering player", as it is a unit, that triggeers. You could try using "Owner of Unit (Triggering Unit)"
Ready for this...
I left out a line of code, I'll let you guess where it went. The line was:
Trigger - Turn Heavy Guard Spawn On
Yeah, I know right...