hey there, I have a map i am working on, which is where you have "civilians" to choose an army selection and then kill enemy units, and ULTIMATELY, kill the enemy NEXUS. Its like Team Micro ARENA or NEXUS MICRO wars. When all your army dies, your civilian respawns to choose an army again. TEAM 1 is terran and TEAM 2 is protoss.
I have been working on this for days but just cant seem to get civilians to respawn. It works great for me but whenever another player is involved, his / her civilians do not respawn.
Attached is my map, so you can see the triggers
The triggers that you should be looking at is
"CIVILIAN RESPAWN TERRAN 1"
"CIVILIAN RESPAWN PROTOSS1"
"TEAMS"
"NEXUS SET UP"
Many of your units have 2 unit actors which is now allowed. It even tells you this error when you start the editor. This has nothing to do with the problem mentioned. It is caused by you having made exact copies of unit actors so that 2 unit actors attempt to be made for the same unit. To fix I would recommend deleting the actor copies and modifying the original. You might have meant for them to be created for a copy of the marine unit in which case you need to change the event subject to your copy and not the original.
Your events make no sense. : "Unit - (Unit attached to Region playable map) dies" : The region "playable map" is not attached to any unit? As such it is equivalently saying "any" unit dies. I think you are misunderstanding what that function does. Or maybe I am missing something about it? I mean your the second person today I have seen use it like this which seems illogical and should act the same as "any unit" in this case.
The logic in "NEXUS SET UP" appears illogical. You might want to update alliances outside the loop and not inside. This way all alliance settings are done in a single call at the end after the teams are built.
As for the repawning... You sure everyone is hitting 0 supply? Are all the triggers firing?
hey thanks for checking it out.
as far as the unit attached to region playable map goes<sub>, it is not that same as any unit. "any unit " does not work for me in this case. the region "PLAYABLE MAP" is the region of the map that is the battlefield outside of the civilian area. i dont want it to trigger when a civilian dies, only when units on the battlefield dies. it works this way.</sub>
also, everyone is hitting 0 supply... i have checked with the players and checked the replays.
it seems i got everything right except for the respawn. i dont have a problem with team set up and lobby anymore. its respawning for me and no1 else, it might have to do with something in the "NEXUS SET UP" trigger
One thing I dont understand from what you said is
"The logic in "NEXUS SET UP" appears illogical. You might want to update alliances outside the loop and not inside. This way all alliance settings are done in a single call at the end after the teams are built."
hey thanks for checking it out. as far as the unit attached to region playable map goes, it is not that same as any unit. "any unit " does not work for me in this case. the region "PLAYABLE MAP" is the region of the map that is the battlefield outside of the civilian area. i dont want it to trigger when a civilian dies, only when units on the battlefield dies. it works this way.
No it does not work that way. You are misunderstanding what is happening from the Galaxy virtual machine point of view.
At map initialization it gets the unit you attached the region to (null since the region is not attached to any unit) and then makes a unit reference to null. This is the same as saying any unit.
It is clearly stated in the native list what will happen.
// Unit events// - Use a null unit for "any unit" events// - When a unitref within an event refers to a variable with a null value, by default this is also// treated as "any unit". However, if UnitEventSetNullVariableInvalid is set to true, then null// variable refs within events are treated as "no unit" instead, meaning that the event will never// fire.
Since you are making a null unit ref it is equivalent to any unit. Galaxy is not declarative so it will not dynamically re-evaluate functions automatically just because it sounds right (although that would be cool but probably too performance intensive). Once you make a unit ref using the "UnitRefFromUnit" function (which is how GUI does it), it is impossible to change the unit. The only time references will change is if they are made from "UnitRefFromVariable" (GUI does this if you give it a global unit variable as an argument) in which case it will reference what ever unit is in the variable.
What you want to do is add a condition to the triggers check if the dying unit's point was within the PLAYABLE MAP region (equal to true, its a boolean test). That performs the logic you want as any unit dying outside the region will fail the condition so the actions will not run.
also, everyone is hitting 0 supply... i have checked with the players and checked the replays. it seems i got everything right except for the respawn. i dont have a problem with team set up and lobby anymore. its respawning for me and no1 else, it might have to do with something in the "NEXUS SET UP" trigger
You need to find out if the triggers are actually running. I recall Galaxy having some kind of limit to the number of event sockets for some event types. It could be that you attach so many "any unit dies" events that it runs out of sockets so not all triggers have an event. I would strongly recommend trying to merge the triggers together into 1 with more selection logic as that would be more efficient and avoid this problem (if it is the cause).
You update the alliances for both teams every time someone is added to team 2. This means if the last player was added to team 1 he will not get allied properly by that trigger. What you want to do instead is place everyone into teams inside the loop and then outside the loop you ally them. This way you can ally them all by running 2 lines of script at the end instead of currently where it could possibly bug and will re-ally everyone every time someone is added to team 2 (which is a waste of processor time as no everyone may be in the teams yet).
To get the lines outside the loop drag them to the gap below the root node of the loop (the actual loop statement) but before it indents for the looping code. They will then appear on the same line as the loop root but after the actual loop block.
I was going to try to help, but then I realized that I would have to have other ppl help me help you and it would be very time consuming, so I decided to drop the job; however, Ill chime in since the other guy is helping you. I also notice some of the things that he mentioned.
I also remember that you have an event "unit dies", but in the actions you have "spawn X for (triggering player). correct me if i'm wrong, but that should read "spawn X for (Owner of triggering unit)"
I also remember that you have an event "unit dies", but in the actions you have "spawn X for (triggering player). correct me if i'm wrong, but that should read "spawn X for (Owner of triggering unit)"
If you read the help text on the event it says that (triggering player) in this case is the same as owner of dying unit. To avoid excessive native calls it should probably be cached in a local variable.
However in the case of any ability cast event it is different since it returns the ordering player (who could not be the owner in the case of shared control) but that is only for such events.
hey there, I have a map i am working on, which is where you have "civilians" to choose an army selection and then kill enemy units, and ULTIMATELY, kill the enemy NEXUS. Its like Team Micro ARENA or NEXUS MICRO wars. When all your army dies, your civilian respawns to choose an army again. TEAM 1 is terran and TEAM 2 is protoss.
I have been working on this for days but just cant seem to get civilians to respawn. It works great for me but whenever another player is involved, his / her civilians do not respawn.
Attached is my map, so you can see the triggers
The triggers that you should be looking at is "CIVILIAN RESPAWN TERRAN 1" "CIVILIAN RESPAWN PROTOSS1" "TEAMS" "NEXUS SET UP"
anyone out there that can identify the problem?
I have noticed a number of issues with your map.
As for the repawning... You sure everyone is hitting 0 supply? Are all the triggers firing?
@ImperialGood: Go
hey thanks for checking it out. as far as the unit attached to region playable map goes<sub>, it is not that same as any unit. "any unit " does not work for me in this case. the region "PLAYABLE MAP" is the region of the map that is the battlefield outside of the civilian area. i dont want it to trigger when a civilian dies, only when units on the battlefield dies. it works this way.</sub>
also, everyone is hitting 0 supply... i have checked with the players and checked the replays. it seems i got everything right except for the respawn. i dont have a problem with team set up and lobby anymore. its respawning for me and no1 else, it might have to do with something in the "NEXUS SET UP" trigger
One thing I dont understand from what you said is
"The logic in "NEXUS SET UP" appears illogical. You might want to update alliances outside the loop and not inside. This way all alliance settings are done in a single call at the end after the teams are built."
what do you mean by this?
No it does not work that way. You are misunderstanding what is happening from the Galaxy virtual machine point of view.
At map initialization it gets the unit you attached the region to (null since the region is not attached to any unit) and then makes a unit reference to null. This is the same as saying any unit.
It is clearly stated in the native list what will happen.
Since you are making a null unit ref it is equivalent to any unit. Galaxy is not declarative so it will not dynamically re-evaluate functions automatically just because it sounds right (although that would be cool but probably too performance intensive). Once you make a unit ref using the "UnitRefFromUnit" function (which is how GUI does it), it is impossible to change the unit. The only time references will change is if they are made from "UnitRefFromVariable" (GUI does this if you give it a global unit variable as an argument) in which case it will reference what ever unit is in the variable.
What you want to do is add a condition to the triggers check if the dying unit's point was within the PLAYABLE MAP region (equal to true, its a boolean test). That performs the logic you want as any unit dying outside the region will fail the condition so the actions will not run.
You need to find out if the triggers are actually running. I recall Galaxy having some kind of limit to the number of event sockets for some event types. It could be that you attach so many "any unit dies" events that it runs out of sockets so not all triggers have an event. I would strongly recommend trying to merge the triggers together into 1 with more selection logic as that would be more efficient and avoid this problem (if it is the cause).
You update the alliances for both teams every time someone is added to team 2. This means if the last player was added to team 1 he will not get allied properly by that trigger. What you want to do instead is place everyone into teams inside the loop and then outside the loop you ally them. This way you can ally them all by running 2 lines of script at the end instead of currently where it could possibly bug and will re-ally everyone every time someone is added to team 2 (which is a waste of processor time as no everyone may be in the teams yet).
To get the lines outside the loop drag them to the gap below the root node of the loop (the actual loop statement) but before it indents for the looping code. They will then appear on the same line as the loop root but after the actual loop block.
I was going to try to help, but then I realized that I would have to have other ppl help me help you and it would be very time consuming, so I decided to drop the job; however, Ill chime in since the other guy is helping you. I also notice some of the things that he mentioned.
I also remember that you have an event "unit dies", but in the actions you have "spawn X for (triggering player). correct me if i'm wrong, but that should read "spawn X for (Owner of triggering unit)"
If you read the help text on the event it says that (triggering player) in this case is the same as owner of dying unit. To avoid excessive native calls it should probably be cached in a local variable.
However in the case of any ability cast event it is different since it returns the ordering player (who could not be the owner in the case of shared control) but that is only for such events.