Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Help: Unit Spawning Problem
Help: Unit Spawning Problem
Oct 17 2008, 4:54 am
By: Lucky.307  

Oct 17 2008, 4:54 am Lucky.307 Post #1



I have a few triggers that say
Conditions
"Player 1 bring 1 _______ to ______"
Action
"Create 1 _______ for Player 5 at _________"

However when this happens it creates 2 of that unit. It happens on all the triggers that create 1 unit at any location. Is it because of hyper triggers? If so, how do I fix that?



None.

Oct 17 2008, 5:28 am Ahli Post #2

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

maybe 2 players run this trigger -> 2 units will be created




Oct 17 2008, 5:38 am Falkoner Post #3



You definitely checked the trigger for more than one player, if you only want it created once, only check one player, for every player you check, another copy of the trigger is given to them, so if the conditions remain true, it will run for as many players as you check.



None.

Oct 17 2008, 5:39 am Lucky.307 Post #4



In one case it is suppose to create 2 units. Even though each unit goes to a different player. However in multiple other cases, it has to create one marine at on location for player 7 but it creates two instead. I've looked over the trigger many times but it still spawns 2 even though it clearly states 1 unit is supposed to spawn.



None.

Oct 17 2008, 5:41 am Lucky.307 Post #5



So since I have players 5 and 6 checked it executes the trigger twice and creates one player 7 marine for player 5's trigger and one player 7 marine for player 6's trigger?

Whenever I did this before it didn't seem to do this.



None.

Oct 17 2008, 6:41 am Falkoner Post #6



The reason it didn't do it before was most likely because the conditions were no longer true once one of the triggers ran, in this case, obviously that is not true. It's not to difficult to make it true though.



None.

Oct 17 2008, 6:45 am NudeRaider Post #7

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Yes, that's the problem.
Depending on what you are trying to do there's a couple ways to prevent it.
The most elegant way, if applicable, is to use Current Player:

Force 1
Conditions:
Current Player brings at least 1 <unit> to X
Actions:
Create 1 <unit> for Player Y at Z

This way the trigger will only run for the person owning the unit.

Another good way is to make the condition untrue:
Force 1
Conditions:
Player 1 brings at least 1 <unit A> to X
Actions:
Create 1 <unit B> for Player Y at Z
Move <unit A> at X to X2

OR:
Force 1
Conditions:
Switch 1 is cleared
Player 1 brings at least 1 <unit A> to X
Actions:
Create 1 <unit B> for Player Y at Z
Set Switch 1

Often it also helps to give the trigger to a single owner, like a comp. Especially useful if it's the receiver of the new unit:
Player Y
Conditions:
Force 1 brings at least 1 <unit A> to X
Actions:
Create 1 <unit B> for Current Player at Z

Of course there's dozens of other ways to prevent this, but the above triggers cover the most common ones. I just wanted to show you some practical solutions and with a bit of thinking I'm sure you can modify one of these to fit into your map.
Good luck!

Post has been edited 3 time(s), last time on Oct 17 2008, 7:09 am by NudeRaider.




Oct 17 2008, 6:53 am Falkoner Post #8



You have to be careful with making the conditions false using a bring command, some actions will not update the bring command, so the condition will still remain true, even if physically it is not, here's a list of actions that do instantly update the bring command:

Code
Kill Unit
Kill Unit at Location
Remove Unit
Remove Unit At Location
Move Location
Move Unit




None.

Oct 17 2008, 6:58 am NudeRaider Post #9

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Yes, that means if you move the unit out of the location you're fine, but if you just give the unit to another player sc doesn't detect it instantly and the trigger might run again for the next player.

Also be careful with kill unit. Units don't die instantly (while remove is). During the death animation they still can be detected.




Oct 17 2008, 8:49 am Ahli Post #10

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Quote from NudeRaider
...but if you just give the unit to another player sc doesn't detect it instantly and the trigger might run again for the next player.
That problem really confused me in my D1 item swapping triggers because I thought it was updated instantly with give. I fixed it centering anywhere on anywhere.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:32 pm]
Zoan -- I got $2000 bonus. I would like 2000 minerals, please
[04:15 am]
DarkenedFantasies -- you eat lots of beans
[03:46 am]
IskatuMesk -- how do i get gas
[11:43 pm]
Moose -- you don't
[2026-4-15. : 10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
[2026-4-13. : 9:15 pm]
NudeRaider -- Vrael ranting still is though
Please log in to shout.


Members Online: anoeth47