• 🏆 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!

[Trigger] Doesn't work.. why?!

Status
Not open for further replies.
Level 12
Joined
Apr 26, 2008
Messages
830
Does someone see a mistake in this triggers?!

Basically it works but just for the first instance, it just creates the paladin, but it worked before but now it doesn't create the other heroes why is it?!

  • T1
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • -------- - --------
      • Set SPAWNUnitType[1] = Paladin
      • Set SPAWNMaxUnits[1] = 4
      • Set SPAWNLocation[1] = (Center of Region 000 <gen>)
      • Set LevelMAX[1] = 9
      • Set LevelMIN[1] = 4
      • -------- - --------
      • Set SPAWNUnitType[2] = Blutmagier
      • Set SPAWNMaxUnits[2] = 2
      • Set SPAWNLocation[2] = (Center of Region 000 <gen>)
      • Set LevelMAX[2] = 8
      • Set LevelMIN[2] = 2
      • -------- - --------
      • Set SPAWNUnitType[3] = Bergkönig
      • Set SPAWNMaxUnits[3] = 3
      • Set SPAWNLocation[3] = (Center of Region 001 <gen>)
      • Set LevelMAX[3] = 6
      • Set LevelMIN[3] = 3
      • -------- - --------
  • T2
    • Ereignisse
      • Zeit - Every 5.00 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer A) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[(Integer A)])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[(Integer A)]
            • 'THEN'-Aktionen
              • Einheit - Create 1 SPAWNUnitType[(Integer A)] for Neutral feindlich at SPAWNLocation[(Integer A)] facing Vorgabe für Gebäude-Ausrichtung degrees
              • Set LevelEND[(Integer A)] = (Random integer number between LevelMIN[(Integer A)] and LevelMAX[(Integer A)])
              • For each (Integer A) from 1 to LevelEND[(Integer A)], do (Actions)
                • Schleifen - Aktionen
                  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
            • 'ELSE'-Aktionen
          • Custom script: call DestroyGroup(udg_SPAWNRegion)
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Could you perhaps reset the refference to the unit type inside the variables?
Have you tested this in a new map?
Try importing the units in a new map, copy and paste the triggers and reset the unit variables.

See if that works. It might be that the unit refference got corrupt or that the unit data of your map became corrupt.
Since you stated it did work before...
 
Level 12
Joined
Apr 26, 2008
Messages
830
Could you perhaps reset the refference to the unit type inside the variables?
Have you tested this in a new map?
Try importing the units in a new map, copy and paste the triggers and reset the unit variables.

See if that works. It might be that the unit refference got corrupt or that the unit data of your map became corrupt.
Since you stated it did work before...

Tried but still doesn't work!..

Maybe it works for you?

http://www.hiveworkshop.com/forums/pastebin.php?id=8e78os
 
Level 4
Joined
May 23, 2010
Messages
83
I made minor changes on your trigger. You used the
  • For each (Integer A) from 1 to LevelEND[(Integer A)], do (Actions)
twice. you should have used (Integer B) instead. And dont use a loop just to level a hero (you run 5+ times an action that can be done in just 1 attempt). Enjoy your map!

  • T2
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set SPAWNRegion = (Units owned by Neutral Hostile matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to SPAWNUnitType[(Integer A)])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in SPAWNRegion) Less than SPAWNMaxUnits[(Integer A)]
            • Then - Actions
              • Unit - Create (SPAWNMaxUnits[(Integer A)] - (Number of units in SPAWNRegion)) SPAWNUnitType[(Integer A)] for Neutral Hostile at SPAWNLocation[(Integer A)] facing Default building facing degrees
              • Set LevelEND[(Integer A)] = (Random integer number between LevelMIN[(Integer A)] and LevelMAX[(Integer A)])
              • Hero - Set (Last created unit) Hero-level to (LevelEND[(Integer A)]), Hide level-up graphics
            • Else - Actions
          • Custom script: call DestroyGroup(udg_SPAWNRegion)
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
I made minor changes on your trigger. You used the
  • For each (Integer A) from 1 to LevelEND[(Integer A)], do (Actions)
twice. you should have used (Integer B) instead. And dont use a loop just to level a hero (you run 5+ times an action that can be done in just 1 attempt). Enjoy your map!

@Nightbrowler
The reason why arielavi did this can be found inside this tutorial:
(It might be better to not use Integer A or B at all, but that all depends on how many loops you have and on which moment they are triggered)

http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/essentials-tutorial-141191/

Chapter 4. g.
 
Level 12
Joined
Apr 26, 2008
Messages
830
@Nightbrowler
The reason why arielavi did this can be found inside this tutorial:
(It might be better to not use Integer A or B at all, but that all depends on how many loops you have and on which moment they are triggered)

http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/essentials-tutorial-141191/

Chapter 4. g.

I made the loop on purpose, because i need the levels to be one by one not instantaniusoly it got to do with the systems of my map, anyways does somebody know why this doesnt work?!
 
Level 4
Joined
May 23, 2010
Messages
83
I downloaded the map to change your stuff, it works fine here. And we're talking about the loop variables, not about the way you're making your trigger. You should use an specific global variable integer array to make your loops, it makes your life easier.

Do this: create a new variable (type: integer array) and instead of Integer A, chose your new variable from the table (eg. 'loopvar[1]') as for Integer B ('loopvar[2]') and that goes on and on...
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
And we're talking about the loop variables, not about the way you're making your trigger. You should use an specific global variable integer array to make your loops
It doesn't nessecarily need to be an array, but...
it makes your life easier.

Do this: create a new variable (type: integer array) and instead of Integer A, chose your new variable from the table (eg. 'loopvar[1]') as for Integer B ('loopvar[2]') and that goes on and on...
You basically do this for each trigger that uses a for loop (in GUI ofcourse).

Why would you do this? Because let's say you have 2 triggers:
The first trigger runs every 0.1 seconds.
The second trigger runs every 1 second.
Both triggers have a loop which uses Integer A.
Now when the second trigger runs, the values of Integer A can change in the first trigger while it's being used in the second one.
Causing Integer A to have a completely different value in the second trigger instead of the values you specified in the loop of the second trigger.

To fix this you use a different variable inside the for loops for each trigger so that the values can not be altered while it is being used.

It's got to do with the triggers and loops of my map!

:goblin_good_job:
 
Level 12
Joined
Apr 26, 2008
Messages
830
It doesn't nessecarily need to be an array, but...



You basically do this for each trigger that uses a for loop (in GUI ofcourse).

Why would you do this? Because let's say you have 2 triggers:
The first trigger runs every 0.1 seconds.
The second trigger runs every 1 second.
Both triggers have a loop which uses Integer A.
Now when the second trigger runs, the values of Integer A can change in the first trigger while it's being used in the second one.
Causing Integer A to have a completely different value in the second trigger instead of the values you specified in the loop of the second trigger.

To fix this you use a different variable inside the for loops for each trigger so that the values can not be altered while it is being used.



:goblin_good_job:

Oh i get it thanks !.. so you dled and it worked like that?!

EDIT: Hm doesn't work

  • T1
    • Ereignisse
      • Zeit - Elapsed game time is 1.00 seconds
    • Bedingungen
    • Aktionen
      • -------- - --------
      • Set SPAWNUnitType[spawnINT[1]] = Hüter des Hains
      • Set SPAWNMaxUnits[spawnINT[1]] = 4
      • Set SPAWNLocation[spawnINT[1]] = (Center of Gebiet 000 <gen>)
      • Set LevelMAX[spawnINT[1]] = 9
      • Set LevelMIN[spawnINT[1]] = 4
      • -------- - --------
      • Set SPAWNUnitType[spawnINT[2]] = Lich
      • Set SPAWNMaxUnits[spawnINT[2]] = 2
      • Set SPAWNLocation[spawnINT[2]] = (Center of Gebiet 000 <gen>)
      • Set LevelMAX[spawnINT[2]] = 8
      • Set LevelMIN[spawnINT[2]] = 2
      • -------- - --------
      • Set SPAWNUnitType[spawnINT[3]] = Blutmagier
      • Set SPAWNMaxUnits[spawnINT[3]] = 3
      • Set SPAWNLocation[spawnINT[3]] = (Center of Gebiet 001 <gen>)
      • Set LevelMAX[spawnINT[3]] = 6
      • Set LevelMIN[spawnINT[3]] = 3
      • -------- - --------
  • T2
    • Ereignisse
      • Zeit - Every 5.00 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer spawnINT[(Integer A)]) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[(Integer A)])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[(Integer A)]
            • 'THEN'-Aktionen
              • Einheit - Create 1 SPAWNUnitType[spawnINT[(Integer A)]] for Neutral feindlich at SPAWNLocation[spawnINT[(Integer A)]] facing Vorgabe für Gebäude-Ausrichtung degrees
              • Set LevelEND[spawnINT[(Integer A)]] = (Random integer number between LevelMIN[spawnINT[(Integer A)]] and LevelMAX[spawnINT[(Integer A)]])
              • For each (Integer spawnINT[(Integer B)]) from 1 to LevelEND[spawnINT[(Integer A)]], do (Actions)
                • Schleifen - Aktionen
                  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
            • 'ELSE'-Aktionen
          • Custom script: call DestroyGroup(udg_SPAWNRegion)
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Can you post it please?

It doesn't work because this is wrong:
  • T2
    • Ereignisse
      • Zeit - Every 5.00 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer spawnINT[(Integer A)]) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[(Integer A)])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[(Integer A)]
            • 'THEN'-Aktionen
              • Einheit - Create 1 SPAWNUnitType[spawnINT[(Integer A)]] for Neutral feindlich at SPAWNLocation[spawnINT[(Integer A)]] facing Vorgabe für Gebäude-Ausrichtung degrees
              • Set LevelEND[spawnINT[(Integer A)]] = (Random integer number between LevelMIN[spawnINT[(Integer A)]] and LevelMAX[spawnINT[(Integer A)]])
              • For each (Integer spawnINT[(Integer B)]) from 1 to LevelEND[spawnINT[(Integer A)]], do (Actions)
                • Schleifen - Aktionen
                  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
            • 'ELSE'-Aktionen
            • Custom script: call DestroyGroup(udg_SPAWNRegion)
Change it to this:

  • T2
    • Ereignisse
      • Zeit - Every 5.00 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer spawnINT[1]) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[1])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[1]
            • 'THEN'-Aktionen
              • Einheit - Create 1 SPAWNUnitType[spawnINT[1]] for Neutral feindlich at SPAWNLocation[spawnINT[1]] facing Vorgabe für Gebäude-Ausrichtung degrees
              • Set LevelEND[spawnINT[1]] = (Random integer number between LevelMIN[spawnINT[1]] and LevelMAX[spawnINT[1]])
              • For each (Integer spawnINT[1]) from 1 to LevelEND[spawnINT[1]], do (Actions)
                • Schleifen - Aktionen
                  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
            • 'ELSE'-Aktionen
            • Custom script: call DestroyGroup(udg_SPAWNRegion)
Then when your using a loop in a different trigger, simply use spawnINT[2].
 
Level 12
Joined
Apr 26, 2008
Messages
830
It doesn't work because this is wrong:
  • For each (Integer spawnINT[(Integer A)]) from 1 to 3, do (Actions)
  • Schleifen - Aktionen
  • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[(Integer A)])))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • 'IF'-Bedingungen
  • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[(Integer A)]
  • 'THEN'-Aktionen
  • Einheit - Create 1 SPAWNUnitType[spawnINT[(Integer A)]] for Neutral feindlich at SPAWNLocation[spawnINT[(Integer A)]] facing Vorgabe für Gebäude-Ausrichtung degrees
  • Set LevelEND[spawnINT[(Integer A)]] = (Random integer number between LevelMIN[spawnINT[(Integer A)]] and LevelMAX[spawnINT[(Integer A)]])
  • For each (Integer spawnINT[(Integer B)]) from 1 to LevelEND[spawnINT[(Integer A)]], do (Actions)
  • Schleifen - Aktionen
  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
  • 'ELSE'-Aktionen
  • Custom script: call DestroyGroup(udg_SPAWNRegion)
Change it to this:

  • For each (Integer spawnINT[1]) from 1 to 3, do (Actions)
  • Schleifen - Aktionen
  • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[1])))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • 'IF'-Bedingungen
  • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[1]
  • 'THEN'-Aktionen
  • Einheit - Create 1 SPAWNUnitType[spawnINT[1]] for Neutral feindlich at SPAWNLocation[spawnINT[1]] facing Vorgabe für Gebäude-Ausrichtung degrees
  • Set LevelEND[spawnINT[1]] = (Random integer number between LevelMIN[spawnINT[1]] and LevelMAX[spawnINT[1]])
  • For each (Integer spawnINT[1]) from 1 to LevelEND[spawnINT[1]], do (Actions)
  • Schleifen - Aktionen
  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
  • 'ELSE'-Aktionen
  • Custom script: call DestroyGroup(udg_SPAWNRegion)
Then when your using a loop in a different trigger, simply use spawnINT[2].

I need to recopy that trigger so many times?!, for example i got SpawnINT[38] i have to copy that trigger 38 times Oo?
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
I need to recopy that trigger so many times?!, for example i got SpawnINT[38] i have to copy that trigger 38 times Oo?

If they are all individual triggers, sadly yes.
But if they are using the same event, then why not merge them together?

Be reminded that avoiding Integer A and Integer B is only to make sure that the values of Integer A and Integer B do not change inside a different trigger that runs simultaniously...
 
Level 12
Joined
Apr 26, 2008
Messages
830
If the event is the same then no since you can then safely use Integer A to loop through the SpawnINT in order to do it all at once.
If they are all individual triggers, sadly yes.

Sry somehow i don't get it.. can you reexplain in some other way, please.. the thing is i got a a trigger liek this.

  • T1
    • Ereignisse
      • Zeit - Elapsed game time is 1.00 seconds
    • Bedingungen
    • Aktionen
      • -------- - --------
      • Set SPAWNUnitType[1] = Paladin
      • Set SPAWNMaxUnits[1] = 4
      • Set SPAWNLocation[1] = (Center of Region 000 <gen>)
      • Set LevelMAX[1] = 9
      • Set LevelMIN[1] = 4
      • -------- - --------
      • Set SPAWNUnitType[2] = Blutmagier
      • Set SPAWNMaxUnits[2] = 2
      • Set SPAWNLocation[2] = (Center of Region 000 <gen>)
      • Set LevelMAX[2] = 8
      • Set LevelMIN[2] = 2
      • -------- - --------
      • Set SPAWNUnitType[3] = Bergkönig
      • Set SPAWNMaxUnits[3] = 3
      • Set SPAWNLocation[3] = (Center of Region 001 <gen>)
      • Set LevelMAX[3] = 6
      • Set LevelMIN[3] = 3
      • -------- - --------
but until [70-90].. do i need to make another T2 trigger for each array?
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Sry somehow i don't get it.. can you reexplain in some other way, please.. the thing is i got a a trigger liek this.

  • T1
    • Ereignisse
      • Zeit - Elapsed game time is 1.00 seconds
    • Bedingungen
    • Aktionen
      • -------- - --------
      • Set SPAWNUnitType[1] = Paladin
      • Set SPAWNMaxUnits[1] = 4
      • Set SPAWNLocation[1] = (Center of Region 000 <gen>)
      • Set LevelMAX[1] = 9
      • Set LevelMIN[1] = 4
      • -------- - --------
      • Set SPAWNUnitType[2] = Blutmagier
      • Set SPAWNMaxUnits[2] = 2
      • Set SPAWNLocation[2] = (Center of Region 000 <gen>)
      • Set LevelMAX[2] = 8
      • Set LevelMIN[2] = 2
      • -------- - --------
      • Set SPAWNUnitType[3] = Bergkönig
      • Set SPAWNMaxUnits[3] = 3
      • Set SPAWNLocation[3] = (Center of Region 001 <gen>)
      • Set LevelMAX[3] = 6
      • Set LevelMIN[3] = 3
      • -------- - --------
but until [70-90].. do i need to make another T2 trigger for each array?

If your using this at the moment:

  • For each (Integer spawnINT[1]) from 1 to 3, do (Actions)
Then cant you do this when the array increases?

  • For each (Integer spawnINT[1]) from 1 to 70-90?, do (Actions)
In fact you can even make it more interactable.
For example: set the number of the maximum array to a variable, then use that variable like this:

  • For each (Integer spawnINT[1]) from 1 to MaxArrayVariable, do (Actions)
This way you can even add new values to the array in different triggers and increase MaxArrayVariable by 1 for each new value added to the array...


EDIT:
Hashjie said:
If the event is the same then no since you can then safely use Integer A to loop through the SpawnINT in order to do it all at once.

Nevermind about that part... It didn't really make sense.

EDIT 2: Oops I made a small mistake I overlooked a index. It should be this instead. Else spawnINT[1] get's altered inside the second loop as you've tryed to fix with Integer B.

  • T2
    • Ereignisse
      • Zeit - Every 5.00 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer spawnINT[1]) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[1])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[1]
            • 'THEN'-Aktionen
              • Einheit - Create 1 SPAWNUnitType[spawnINT[1]] for Neutral feindlich at SPAWNLocation[spawnINT[1]] facing Vorgabe für Gebäude-Ausrichtung degrees
              • Set LevelEND[spawnINT[1]] = (Random integer number between LevelMIN[spawnINT[1]] and LevelMAX[spawnINT[1]])
              • For each (Integer spawnINT[2]) from 1 to LevelEND[spawnINT[1]], do (Actions)
                • Schleifen - Aktionen
                  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
            • 'ELSE'-Aktionen
            • Custom script: call DestroyGroup(udg_SPAWNRegion)
 
Last edited:
Level 12
Joined
Apr 26, 2008
Messages
830
If your using this at the moment:

  • For each (Integer spawnINT[1]) from 1 to 3, do (Actions)
Then cant you do this when the array increases?

  • For each (Integer spawnINT[1]) from 1 to 70-90?, do (Actions)
In fact you can even make it more interactable.
For example: set the number of the maximum array to a variable, then use that variable like this:

  • For each (Integer spawnINT[1]) from 1 to MaxArrayVariable, do (Actions)
This way you can even add new values to the array in different triggers and increase MaxArrayVariable by 1 for each new value added to the array...


EDIT:

Nevermind about that part... It didn't really make sense.

EDIT 2: Oops I made a small mistake I overlooked a index. It should be this instead. Else spawnINT[1] get's altered inside the second loop as you've tryed to fix with Integer B.

  • T2
    • Ereignisse
      • Zeit - Every 5.00 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer spawnINT[1]) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[1])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[1]
            • 'THEN'-Aktionen
              • Einheit - Create 1 SPAWNUnitType[spawnINT[1]] for Neutral feindlich at SPAWNLocation[spawnINT[1]] facing Vorgabe für Gebäude-Ausrichtung degrees
              • Set LevelEND[spawnINT[1]] = (Random integer number between LevelMIN[spawnINT[1]] and LevelMAX[spawnINT[1]])
              • For each (Integer spawnINT[2]) from 1 to LevelEND[spawnINT[1]], do (Actions)
                • Schleifen - Aktionen
                  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
            • 'ELSE'-Aktionen
            • Custom script: call DestroyGroup(udg_SPAWNRegion)

This still doesn't work , can you please ad this in the map and post it when it works please?!
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
This still doesn't work , can you please ad this in the map and post it when it works please?!

I will as soon as I've installed warcraft 3 on my new SSD ^.^
Hopefully the downloader doesn't take ages -,-...

EDIT: damn I overlooked another mistake, this is not my best day.

  • T2
    • Ereignisse
      • Zeit - Every 5.00 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer spawnINT[1]) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[spawnINT[1]])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[spawnINT[1]]
            • 'THEN'-Aktionen
              • Einheit - Create 1 SPAWNUnitType[spawnINT[1]] for Neutral feindlich at SPAWNLocation[spawnINT[1]] facing Vorgabe für Gebäude-Ausrichtung degrees
              • Set LevelEND[spawnINT[1]] = (Random integer number between LevelMIN[spawnINT[1]] and LevelMAX[spawnINT[1]])
              • For each (Integer spawnINT[2]) from 1 to LevelEND[spawnINT[1]], do (Actions)
                • Schleifen - Aktionen
                  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
            • 'ELSE'-Aktionen
            • Custom script: call DestroyGroup(udg_SPAWNRegion)
 
Level 12
Joined
Apr 26, 2008
Messages
830
I will as soon as I've installed warcraft 3 on my new SSD ^.^
Hopefully the downloader doesn't take ages -,-...

EDIT: damn I overlooked another mistake, this is not my best day.

  • T2
    • Ereignisse
      • Zeit - Every 5.00 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer spawnINT[1]) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[spawnINT[1]])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[spawnINT[1]]
            • 'THEN'-Aktionen
              • Einheit - Create 1 SPAWNUnitType[spawnINT[1]] for Neutral feindlich at SPAWNLocation[spawnINT[1]] facing Vorgabe für Gebäude-Ausrichtung degrees
              • Set LevelEND[spawnINT[1]] = (Random integer number between LevelMIN[spawnINT[1]] and LevelMAX[spawnINT[1]])
              • For each (Integer spawnINT[2]) from 1 to LevelEND[spawnINT[1]], do (Actions)
                • Schleifen - Aktionen
                  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
            • 'ELSE'-Aktionen
            • Custom script: call DestroyGroup(udg_SPAWNRegion)

saw that mistake already:/.. but still doesnt work
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Hmm strange, the test map you've send seems to work without me changing anything. It spawns all the units in the correct order with the correct amounts etc. Have you tested your test map yourself?

It must have something to do with Integer A and Integer B being altered by different triggers. I won't be abled to check that since I don't know the other triggers that are in your map.

As far as I'm concerned the test map works both with Integer A and Integer B (this is because there are no other triggers interferring with Integer A and Integer B) as with spawnINT[1] and spawnINT[2]...
It's even more odd that even though your using spawnINT[1] and spawnINT[2] in your own map (which don't get altered by different triggers since your only using them inside T2) it doesn't work :S

Have you tryed changing the unit types to see if those units do spawn?
If they do, then could you perhaps do the following for me?

Copy your T1 trigger and select it, go to edit -> Convert to custom text, click yes
Now you should see something among the lines of:

JASS:
function Trig_T1_Copy_Actions takes nothing returns nothing
    // -
    set udg_SPAWNUnitType[1] = 'Ekee'
    set udg_SPAWNMaxUnits[1] = 4
    set udg_SPAWNLocation[1] = GetRectCenter(gg_rct_Gebiet_000)
    set udg_LevelMAX[1] = 9
    set udg_LevelMIN[1] = 4
    // -
    set udg_SPAWNUnitType[2] = 'Ulic'
    set udg_SPAWNMaxUnits[2] = 2
    set udg_SPAWNLocation[2] = GetRectCenter(gg_rct_Gebiet_000)
    set udg_LevelMAX[2] = 8
    set udg_LevelMIN[2] = 2
    // -
    set udg_SPAWNUnitType[3] = 'Hblm'
    set udg_SPAWNMaxUnits[3] = 3
    set udg_SPAWNLocation[3] = GetRectCenter(gg_rct_Gebiet_001)
    set udg_LevelMAX[3] = 6
    set udg_LevelMIN[3] = 3
    // -
endfunction

//===========================================================================
function InitTrig_T1_Copy takes nothing returns nothing
    set gg_trg_T1_Copy = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_T1_Copy, 1.00 )
    call TriggerAddAction( gg_trg_T1_Copy, function Trig_T1_Copy_Actions )
endfunction

Here you can see the raw codes of your unit type in the set udg_SPAWNUnitType lines of the code.
In order to check if the raw codes match the raw codes of your custom unit you open up the object editor.
When the object editor is open you press Controll + D

If I'm correct you should now see the raw codes of your units in front of the name of the unit.
Check if they are the same as the ones in set udg_SPAWNUnitType[1] etc...
If they are not, fill in the correct raw codes, disable T1 (not the coppyed Jass version) and check if it works.


EDIT: here is an example of how it should look like (I used the test map for this):
exampledo.jpg


As you can see:
'Ekee' = Keeper of the Grove
'Ulic' = Lich
'Hblm' = Blood Mage

Of course T1 still needs to be disabled here if you want to test if it works...


Try to do this same thing for your custom units and see if it works.
If this doesn't fix it then the problem occurs because of other triggers interferring...
The only way to examine your problem would then be to see the other triggers inside your map and I'm not sure if your willing to put your unprotected map on the internet ;)

Of course most of the people here at the hive won't do anything to your map, but you can never be sure.
If you want, you can send it to me privately through PM so I can try to fix it for you.
You'll get my promise that I won't do anything else with your map but solving your problem and returning it to you.
After that I'll remove the map from my HD and the PM you've send me so you can feel safe :)

But that's your own decision ofcourse. First check if this works, if it doesn't then you decide what to do.
 
Last edited:
Level 12
Joined
Apr 26, 2008
Messages
830
Hmm strange, the test map you've send seems to work without me changing anything. It spawns all the units in the correct order with the correct amounts etc. Have you tested your test map yourself?

It must have something to do with Integer A and Integer B being altered by different triggers. I won't be abled to check that since I don't know the other triggers that are in your map.

As far as I'm concerned the test map works both with Integer A and Integer B (this is because there are no other triggers interferring with Integer A and Integer B) as with spawnINT[1] and spawnINT[2]...
It's even more odd that even though your using spawnINT[1] and spawnINT[2] in your own map (which don't get altered by different triggers since your only using them inside T2) it doesn't work :S

Have you tryed changing the unit types to see if those units do spawn?
If they do, then could you perhaps do the following for me?

Copy your T1 trigger and select it, go to edit -> Convert to custom text, click yes
Now you should see something among the lines of:

JASS:
function Trig_T1_Copy_Actions takes nothing returns nothing
    // -
    set udg_SPAWNUnitType[1] = 'Ekee'
    set udg_SPAWNMaxUnits[1] = 4
    set udg_SPAWNLocation[1] = GetRectCenter(gg_rct_Gebiet_000)
    set udg_LevelMAX[1] = 9
    set udg_LevelMIN[1] = 4
    // -
    set udg_SPAWNUnitType[2] = 'Ulic'
    set udg_SPAWNMaxUnits[2] = 2
    set udg_SPAWNLocation[2] = GetRectCenter(gg_rct_Gebiet_000)
    set udg_LevelMAX[2] = 8
    set udg_LevelMIN[2] = 2
    // -
    set udg_SPAWNUnitType[3] = 'Hblm'
    set udg_SPAWNMaxUnits[3] = 3
    set udg_SPAWNLocation[3] = GetRectCenter(gg_rct_Gebiet_001)
    set udg_LevelMAX[3] = 6
    set udg_LevelMIN[3] = 3
    // -
endfunction

//===========================================================================
function InitTrig_T1_Copy takes nothing returns nothing
    set gg_trg_T1_Copy = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_T1_Copy, 1.00 )
    call TriggerAddAction( gg_trg_T1_Copy, function Trig_T1_Copy_Actions )
endfunction

Here you can see the raw codes of your unit type in the set udg_SPAWNUnitType lines of the code.
In order to check if the raw codes match the raw codes of your custom unit you open up the object editor.
When the object editor is open you press Controll + D

If I'm correct you should now see the raw codes of your units in front of the name of the unit.
Check if they are the same as the ones in set udg_SPAWNUnitType[1] etc...
If they are not, fill in the correct raw codes, disable T1 (not the coppyed Jass version) and check if it works.


EDIT: here is an example of how it should look like (I used the test map for this):
exampledo.jpg


As you can see:
'Ekee' = Keeper of the Grove
'Ulic' = Lich
'Hblm' = Blood Mage

Of course T1 still needs to be disabled here if you want to test if it works...


Try to do this same thing for your custom units and see if it works.
If this doesn't fix it then the problem occurs because of other triggers interferring...
The only way to examine your problem would then be to see the other triggers inside your map and I'm not sure if your willing to put your unprotected map on the internet ;)

Of course most of the people here at the hive won't do anything to your map, but you can never be sure.
If you want, you can send it to me privately through PM so I can try to fix it for you.
You'll get my promise that I won't do anything else with your map but solving your problem and returning it to you.
After that I'll remove the map from my HD and the PM you've send me so you can feel safe :)

But that's your own decision ofcourse. First check if this works, if it doesn't then you decide what to do.

The triggers i send you i didnt add them into my project map yet, because i tested them on a new map without any triggers and it didn't work.. so i will just try what you told me just now, and besides when i do the spawnINT[1] it doesn't even summon 1 unit, before it summoned the first unit only.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
It just spawns 1 unit, the one with [1], in that case it's kotg. but it doesn't spawn the others, while it should spawn all 3 at once.

Wait, now I'm confused it should spawn all 3 at once?
So it shouldn't work like this?:

first 5 seconds passed -> 1 unit created from SpawnUNITType[1]
second 5 seconds passed -> 1 unit created from SpawnUNITType[1]
third 5 seconds passed -> 1 unit created from SpawnUNITType[1]
fourth 5 seconds passed -> 1 unit created from SpawnUNITType[1]
fifth 5 seconds passed -> 1 unit created from SpawnUNITType[2]
sixth 5 seconds passed -> 1 unit created from SpawnUNITType[2]
seventh 5 seconds passed -> 1 unit created from SpawnUNITType[3]
eighth 5 seconds passed -> 1 unit created from SpawnUNITType[3]
nineth 5 seconds passed -> 1 unit created from SpawnUNITType[3]

I'm taking the test map as a refference here...


EDIT: have you already checked if all the raw codes match?
 
Level 12
Joined
Apr 26, 2008
Messages
830
Wait, now I'm confused it should spawn all 3 at once?
So it shouldn't work like this?:

first 5 seconds passed -> 1 unit created from SpawnUNITType[1]
second 5 seconds passed -> 1 unit created from SpawnUNITType[1]
third 5 seconds passed -> 1 unit created from SpawnUNITType[1]
fourth 5 seconds passed -> 1 unit created from SpawnUNITType[1]
fifth 5 seconds passed -> 1 unit created from SpawnUNITType[2]
sixth 5 seconds passed -> 1 unit created from SpawnUNITType[2]
seventh 5 seconds passed -> 1 unit created from SpawnUNITType[3]
eighth 5 seconds passed -> 1 unit created from SpawnUNITType[3]
nineth 5 seconds passed -> 1 unit created from SpawnUNITType[3]

I'm taking the test map as a refference here...


EDIT: have you already checked if all the raw codes match?

No they should spawn all at once. 5 seconds create unit from SpawnUNITType[1] , SpawnUNITType[2] and SpawnUNITType[3]
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
No they should spawn all at once. 5 seconds create unit from SpawnUNITType[1] , SpawnUNITType[2] and SpawnUNITType[3]

Just so that we can be on the same frequency:

Each 5 seconds it should create 1 unit from all unit types untill the maximum amount for that specific unit type has been reached?
Whenever a maximum amount of units for a unit type gets reached this type of unit should not spawn but the other units should untill they have also reached their maximum. Am I correct?

So for example:

first 5 seconds passed -> 1 unit from SpawnUNITType[1], SpawnUNITType[2] and SpawnUNITType[3]
second 5 seconds passed -> 1 unit from SpawnUNITType[1], SpawnUNITType[2] and SpawnUNITType[3]
third 5 seconds passed -> 1 unit from SpawnUNITType[1] and SpawnUNITType[3]
fourtgh 5 seconds passed -> 1 unit from SpawnUNITType[1]

EDIT: Eeeerm... Okay, check this test map: http://www.hiveworkshop.com/forums/pastebin.php?id=mjlv1a
It does exactly that.

If this still doesn't work in your map, could you perhaps send me the original through PM so I can make it work for your map?
 
Level 12
Joined
Apr 26, 2008
Messages
830
Just so that we can be on the same frequency:

Each 5 seconds it should create 1 unit from all unit types untill the maximum amount for that specific unit type has been reached?
Whenever a maximum amount of units for a unit type gets reached this type of unit should not spawn but the other units should untill they have also reached their maximum. Am I correct?

So for example:

first 5 seconds passed -> 1 unit from SpawnUNITType[1], SpawnUNITType[2] and SpawnUNITType[3]
second 5 seconds passed -> 1 unit from SpawnUNITType[1], SpawnUNITType[2] and SpawnUNITType[3]
third 5 seconds passed -> 1 unit from SpawnUNITType[1] and SpawnUNITType[3]
fourtgh 5 seconds passed -> 1 unit from SpawnUNITType[1]

If this is true then I'll try to recreate the trigger for you, but first: let me smoke a cigarette ^.^

Yes exactly, recreate them until the limit of the unit given is reached. Could you do this now or does this need time because i have timo to work on the project now^^
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Check my last EDIT

All I did in your test map was change this:
  • For each (Integer A) from 1 to LevelEND[(Integer A)], do (Actions)
    • Loop - Actions
      • Hero - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Hide level-up graphics
to this:
  • For each (Integer B) from 1 to LevelEND[(Integer A)], do (Actions)
    • Loop - Actions
      • Hero - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Hide level-up graphics
 
Level 12
Joined
Apr 26, 2008
Messages
830
Check my last EDIT

All I did in your test map was change this:
  • For each (Integer A) from 1 to LevelEND[(Integer A)], do (Actions)
    • Loop - Actions
      • Hero - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Hide level-up graphics
to this:
  • For each (Integer B) from 1 to LevelEND[(Integer A)], do (Actions)
    • Loop - Actions
      • Hero - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Hide level-up graphics

LOL, it works now, but didn't you say i should replace the integer A with an integer array or something?! because when im gonna add it to my map it coukd interfere with some other triggers
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
LOL, it works now, but didn't you say i should replace the integer A with an integer array or something?! because when im gonna add it to my map it coukd interfere with some other triggers

Yes exactly. You can use Integer A and Integer B if you are sure that Integer A and Integer B will not be changed by any other triggers while this trigger is being executed.

But just to be sure it's better to use different variables so they won't get changed while this trigger is being executed.

You could use an array to make it simple but this is not nessecary.

You can use any integer variable as long as your not using it in any other triggers.

EDIT: That's why I was so surprised when you told me that this trigger didn't work:

  • T2
    • Ereignisse
      • Zeit - Every 5.00 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer spawnINT[1]) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[spawnINT[1]])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[spawnINT[1]]
            • 'THEN'-Aktionen
              • Einheit - Create 1 SPAWNUnitType[spawnINT[1]] for Neutral feindlich at SPAWNLocation[spawnINT[1]] facing Vorgabe für Gebäude-Ausrichtung degrees
              • Set LevelEND[spawnINT[1]] = (Random integer number between LevelMIN[spawnINT[1]] and LevelMAX[spawnINT[1]])
              • For each (Integer spawnINT[2]) from 1 to LevelEND[spawnINT[1]], do (Actions)
                • Schleifen - Aktionen
                  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
            • 'ELSE'-Aktionen
            • Custom script: call DestroyGroup(udg_SPAWNRegion)
It basically does the same but then with variables that can't be changed outside the trigger :S
That's why I asked you to check the raw codes to make sure that the unit types where correct.
Because I couldn't really think of anything else that would cause it not to work.
 
Level 12
Joined
Apr 26, 2008
Messages
830
Yes exactly. You can use Integer A and Integer B if you are sure that Integer A and Integer B will not be changed by any other triggers while this trigger is being executed.

But just to be sure it's better to use different variables so they won't get changed while this trigger is being executed.

You could use an array to make it simple but this is not nessecary.

You can use any integer variable as long as your not using it in any other triggers.

EDIT: That's why I was so surprised when you told me that this trigger didn't work:

  • T2
    • Ereignisse
      • Zeit - Every 5.00 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer spawnINT[1]) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[spawnINT[1]])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[spawnINT[1]]
            • 'THEN'-Aktionen
              • Einheit - Create 1 SPAWNUnitType[spawnINT[1]] for Neutral feindlich at SPAWNLocation[spawnINT[1]] facing Vorgabe für Gebäude-Ausrichtung degrees
              • Set LevelEND[spawnINT[1]] = (Random integer number between LevelMIN[spawnINT[1]] and LevelMAX[spawnINT[1]])
              • For each (Integer spawnINT[2]) from 1 to LevelEND[spawnINT[1]], do (Actions)
                • Schleifen - Aktionen
                  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
            • 'ELSE'-Aktionen
            • Custom script: call DestroyGroup(udg_SPAWNRegion)
It basically does the same but then with variables that can't be changed outside the trigger :S
That's why I asked you to check the raw codes to make sure that the unit types where correct.
Because I couldn't really think of anything else that would cause it not to work.

Alright, if i wanted to use an inter variable how would it look like then can you show me?!
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Alright, if i wanted to use an inter variable how would it look like then can you show me?!

Simple:


  • T2
    • Ereignisse
      • Zeit - Every 5.00 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer IntegerC) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[IntegerC])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[IntegerC]
            • 'THEN'-Aktionen
              • Einheit - Create 1 SPAWNUnitType[IntegerC] for Neutral feindlich at SPAWNLocation[IntegerC] facing Vorgabe für Gebäude-Ausrichtung degrees
              • Set LevelEND[IntegerC] = (Random integer number between LevelMIN[IntegerC] and LevelMAX[IntegerC])
              • For each (Integer IntegerD) from 1 to LevelEND[IntegerC], do (Actions)
                • Schleifen - Aktionen
                  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
            • 'ELSE'-Aktionen
            • Custom script: call DestroyGroup(udg_SPAWNRegion)
All you have to do is make sure that IntegerC and IntegerD won't be used in any other trigger.
It's only to prevent that the values from IntegerC and IntegerD won't be changed while this trigger is being executed.

If for example another trigger has an action that does something like: set IntegerC = 5 then that would create pretty weird outcomes in this trigger, can you imagine :)?
Basically when creating a for loop it does this: set IntegerC = 1 -> execute all the actions inside the loop -> when done executing all the actions inside the loop set IntegerC = 2 -> execute all the actions inside the loop etc...

The values that the loop sets the variables to is defined in: from ... to ...

You can also use an integer array so that you won't have to create a new integer for each for loop. This way you can simply use for example:
Integer[1], Integer[2], Integer[3] instead of IntegerC, IntegerD, IntegerE etc.
 
Level 12
Joined
Apr 26, 2008
Messages
830
Yes exactly. You can use Integer A and Integer B if you are sure that Integer A and Integer B will not be changed by any other triggers while this trigger is being executed.

But just to be sure it's better to use different variables so they won't get changed while this trigger is being executed.

You could use an array to make it simple but this is not nessecary.

You can use any integer variable as long as your not using it in any other triggers.

EDIT: That's why I was so surprised when you told me that this trigger didn't work:

  • T2
    • Ereignisse
      • Zeit - Every 5.00 seconds of game time
    • Bedingungen
    • Aktionen
      • For each (Integer spawnINT[1]) from 1 to 3, do (Actions)
        • Schleifen - Aktionen
          • Set SPAWNRegion = (Units owned by Neutral feindlich matching ((((Matching unit) is alive) Gleich True) and ((Unit-type of (Matching unit)) Gleich SPAWNUnitType[spawnINT[1]])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Number of units in SPAWNRegion) Kleiner als SPAWNMaxUnits[spawnINT[1]]
            • 'THEN'-Aktionen
              • Einheit - Create 1 SPAWNUnitType[spawnINT[1]] for Neutral feindlich at SPAWNLocation[spawnINT[1]] facing Vorgabe für Gebäude-Ausrichtung degrees
              • Set LevelEND[spawnINT[1]] = (Random integer number between LevelMIN[spawnINT[1]] and LevelMAX[spawnINT[1]])
              • For each (Integer spawnINT[2]) from 1 to LevelEND[spawnINT[1]], do (Actions)
                • Schleifen - Aktionen
                  • Held - Set (Last created unit) Hero-level to ((Hero level of (Last created unit)) + 1), Verbergen level-up graphics
            • 'ELSE'-Aktionen
            • Custom script: call DestroyGroup(udg_SPAWNRegion)
It basically does the same but then with variables that can't be changed outside the trigger :S
That's why I asked you to check the raw codes to make sure that the unit types where correct.
Because I couldn't really think of anything else that would cause it not to work.

How does the other T1 trigger look like?!

EDIT: see it doesn't work http://www.hiveworkshop.com/forums/pastebin.php?id=mawbxg
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Check my last EDIT once again ^.^ you should be abled to figure it out from there on...

Yes but dont you have to set spawnunittype[spawnINT[1]] ?! and so on

No the variables in your T1 trigger are fixed, they should not be abled to change since you're declaring the values of the variable there.
Your using spawnINT[1] only to loop through the index of the array. Nothing more, nothing less.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Yeah but the problem is it laggs so much when creating so much units.

I can improve the performance of the trigger for you by optimizing it in Jass or vJass I suppose... Is it really that noticeable? I have a computer with 16gb DDR3 RAM memmory so I won't notice anything at all :S

Also 3 units every 5 seconds is not much at all and shouldn't lag ^.^
The lag you're experiencing is either from other applications running at the same time, taking away the RAM memory that you need for warcraft.
Or from unnessecary function calls, iterating through unit groups and so on.
It all depends on how many RAM memory you have, how many applications you are running and ofcourse how you created your triggers.

Which in this case shouldn't be a real noticeable difference. But if you want to completely optimize it, just ask me.

If your screen is staggering which makes it look as if it's lagging it might also be that your video card driver is outdated, not installed, not supported (I doubt that) etc..
 
Last edited:
Level 12
Joined
Apr 26, 2008
Messages
830
I can improve the performance of the trigger for you by optimizing it in Jass or vJass I suppose... Is it really that noticeable? I have a computer with 16gb DDR3 RAM memmory so I won't notice anything at all :S

Also 3 units every 5 seconds is not much at all and shouldn't lag ^.^
The lag you're experiencing is either from other applications running at the same time, taking away the RAM memory that you need for warcraft.
Or from unnessecary function calls, iterating through unit groups and so on.
It all depends on how many RAM memory you have, how many applications you are running and ofcourse how you created your triggers.

Which in this case shouldn't be a real noticeable difference. But if you want to completely optimize it, just ask me.

If your screen is staggering which makes it look as if it's lagging it might also be that your video card driver is outdated, not installed, not supported (I doubt that) etc..

I'm not talking about the 3 units i'm talking about 60 units spawning at the same time =D.
 
Status
Not open for further replies.
Top