• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Not Working Blood Trigger

Status
Not open for further replies.
Level 14
Joined
Jul 12, 2011
Messages
1,371
Hey people!
I got 2 triggers which action is to spawn random blood effects when a unit dies.
It aint working however.
The blood is dummy units located at an isolated place in the map and when the map starts they get added to a unit group.

  • Blood Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in Region 000 <gen>) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to BloodUnits
  • Dies Gore
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit - Create 1 (Unit-type of (Random unit from BloodUnits)) for Neutral Passive at (Random point in (Region centered at (Position of (Triggering unit)) with size (150.00, 150.00))) facing (Random angle) degrees
      • Unit - Add a 20.00 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 (Unit-type of (Random unit from BloodUnits)) for Neutral Passive at (Random point in (Region centered at (Position of (Triggering unit)) with size (150.00, 150.00))) facing (Random angle) degrees
      • Unit - Add a 20.00 second Generic expiration timer to (Last created unit)
      • Unit - Create 1 (Unit-type of (Random unit from BloodUnits)) for Neutral Passive at (Random point in (Region centered at (Position of (Triggering unit)) with size (150.00, 150.00))) facing (Random angle) degrees
      • Unit - Add a 20.00 second Generic expiration timer to (Last created unit)
 
Are units in Region 000 <gen> selectable? If they have invul + alloc you cant pick them.

But anyway you should do like this:


  • Ereignisse
    • Map initialization
  • Aktionen
    • Set BloodType[1] = YourType 1
    • Set BloodType[2] = YourType 2
    • Set BloodType[3] = YourType 3
    • Set BloodType[4] = YourType 4

  • Ereignisse
    • Unit - A unit dies
  • Aktionen
    • Set Point = (Position of (Triggering unit))
    • For each (Integer Integer A) from 1 to 3, do (Actions)
      • Loop - Aktionen
        • Unit - Create 1 BloodType[(Random integer number between 1 and 4)] for Neutral passiv at Point facing 0.00 degrees
        • Unit - Add a 20.00 second Generic expiration timer to (Last created unit)
    • Custom script: call RemoveLocation (udg_Point)


Point is a variably of type "point". Use it to remove memory leaks.

Edit: BloodType is a variable of type "UnitType"
 
Level 14
Joined
Jul 12, 2011
Messages
1,371
How do you put the [1] thing?
You just write it in the variable?
Is the variable a unit variable?



Edit:
Can't find out how you make those [1] things.
WE variables don't allow [] things.

Never Mind.
Found it.
Thanks a lot friend!
+2rep:goblin_yeah:
 
Level 9
Joined
Dec 12, 2007
Messages
489
Damn!
For a strange reason this trigger keeps repeating hiself and theire si lot of blood and lag!
Help please!

When your "blood" units expired (passing that 20 second), it counted as death, triggering the Unit Dies event again.

Possible solution is to check if the dying unit is not equal to "blood" before action to prevent the blood fire the event.
 
Just change your trigger to this:

  • Dies Gore
    • Events
      • Einheit - A unit Stirbt
    • Cinditions
      • (Owner of (Triggering unit)) Ungleich Neutral passive
    • Actionens
      • Set DeathPoint = (Position of (Triggering unit))
      • For each (Integer IntegerA) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • Einheit - Create 1 BloodType[(Random integer number between 1 and 6)] for Neutral passiv at (Random point in (Region centered at DeathPoint with size (150.00, 150.00))) facing (Random angle) degrees
          • Einheit - Add a 7.00 second Standard expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_DeathPoint)


*The event: Einheit - A unit Stirbt = Unit - A unit dies
sorry, it's german :D
 
Status
Not open for further replies.
Top