Kinda nooby question?

Bogomil16

New Member
Reaction score
1
I'm making squad units so when you select a unit from the squad you select the whole squad.I did that using unit point values.For instance-the Marine has a point value of 1 and the marine commander has a point value of 1 so when you chose one of them the other one is also selected.Here's the trigger

Squad Select
Events
Player - Player 1 (Red) Selects a unit
Player - Player 2 (Blue) Selects a unit
Player - Player 3 (Teal) Selects a unit
Player - Player 4 (Purple) Selects a unit
Player - Player 5 (Yellow) Selects a unit
Player - Player 6 (Orange) Selects a unit
Player - Player 7 (Green) Selects a unit
Player - Player 8 (Pink) Selects a unit
Player - Player 9 (Gray) Selects a unit
Player - Player 10 (Light Blue) Selects a unit
Player - Player 11 (Dark Green) Selects a unit
Player - Player 12 (Brown) Selects a unit
Conditions
(Owner of (Triggering unit)) Equal to (Triggering player)
Actions
Selection - Clear selection for (Triggering player)
Selection - Add (Triggering unit) to selection for (Triggering player)
Selection - Select (Units in (Playable map area) matching (((Owner of (Matching unit)) Equal to (Triggering player)) and ((Real((Point-value of (Matching unit)))) Equal to (Real((Point-value of (Triggering unit))))))) for (Triggering player)

When I select it the trigger works,but 1 second later the game freezes.Is it s memory leak or something? :confused:
 

Romek

Super Moderator
Reaction score
964
Infinite loop.
The trigger fires when a unit is selected.
The trigger selects a unit for a player.
The trigger fires again.
Etc.

Just disable the trigger before you select, and enable it after.
Also, a squad system has been made on these forums. Look around in the systems section (Tutorials and resources)
 

Azlier

Old World Ghost
Reaction score
461
This is most likely an infinite loop. In the actions, you select the unit for the player, which triggers the event, which does the action, which triggers the event... I think you can see where I'm going with this.

Edit: Was Romek's post there before? I could've sworn there was only the original... unless, no, God, no! I was beaten by three seconds again!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top