• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Why does my trigger make Wc3 Crash?

Status
Not open for further replies.
Level 7
Joined
Sep 7, 2006
Messages
97
So, i basicly tried to make a trigger where a pack of units function together as a regiment. And when i click on Testmap it loads the map but when i select a unit Warcraft crashes. To get you all to understand the problem im just putting a map with just that trigger so you can see for yourself.

Anyways, can i fix this is anyway? Help would be greatly appreciated!
 

Attachments

  • Regiments.w3x
    16.6 KB · Views: 38
Level 21
Joined
Aug 21, 2005
Messages
3,699
Your trigger is buggy. You see, this is what happens:

If a unit is selected and that unit is in regiment 1, select all units of regiment 1.
The problem is: whenever 1 unit is selected, it is selecting all units of regiment 1, which means "another" unit of regiment 1 is selected, which causes the trigger to run again, to infinity.

A possible fix:
  • Unit
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • ((Triggering unit) is in Regiment1) Equal to (==) True
    • Actions
      • Trigger - turn off (this trigger)
      • Unit Group - Pick every unit in Regiment1 and do (Selection - Select Regiment1 for Player 1 (Red))
      • Trigger - turn on (this trigger)
Another problem is that for each unit in Regiment1, you're selecting the whole group of units in Regiment1. Replace it by:
  • Unit Group - Pick every unit in Regiment1 and do (Selection - Select (picked unit) for Player 1 (Red))
And let's advertise for my own systems: you might want to check out this system:
Grouping System v1.08 - The Hive Workshop - A Warcraft III Modding Site
 
Level 7
Joined
Sep 7, 2006
Messages
97
Your trigger is buggy. You see, this is what happens:

If a unit is selected and that unit is in regiment 1, select all units of regiment 1.
The problem is: whenever 1 unit is selected, it is selecting all units of regiment 1, which means "another" unit of regiment 1 is selected, which causes the trigger to run again, to infinity.

A possible fix:
  • Unit
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • ((Triggering unit) is in Regiment1) Equal to (==) True
    • Actions
      • Trigger - turn off (this trigger)
      • Unit Group - Pick every unit in Regiment1 and do (Selection - Select Regiment1 for Player 1 (Red))
      • Trigger - turn on (this trigger)

Thanks, i tried it but it still crashed.

Another problem is that for each unit in Regiment1, you're selecting the whole group of units in Regiment1. Replace it by:
  • Unit Group - Pick every unit in Regiment1 and do (Selection - Select (picked unit) for Player 1 (Red))

Unit Group - Pick every unit in Regiment1 and do (Selection - Select Regiment1 for Player 1 (Red)

You cant do Selection - Select (picked unit) for Player 1

Anyway i discovered i could just do Selection - Select (Regiment1) for Player 1
but warcraft 3 still buggs and crashes ;(.

Ty for trying anyway :D!

Any more ideas?

And let's advertise for my own systems: you might want to check out this system:
Grouping System v1.08 - The Hive Workshop - A Warcraft III Modding Site

Cool system! But im not to good with jass to understand everything ^^, and i dont wanted units from the regiments to be able to run away from it.

Edit:
 

Attachments

  • Regiments.w3m
    16.5 KB · Views: 32
Status
Not open for further replies.
Top