Hello, i'm working on a hack'n'slash map, and i got these triggers to spawn mobs in a zone :
How its activated
The spawner
To make them patrol
I also have 2 more triggers for making the monsters patrol in the zone, and a timer for clearing out the zone if empty of heroes...
I seem to get fatal errors randomly after a long period of playing the map, and i cannot consciously make it crash when i want to, so i think this may be related to leaks? I honestly don't know.
Also, sorry for the weird code, my interface is in french and copies badly...
Thanks in advance for any answer.
edit: how do u guys show the triggers in gui on the forum??
edit2: ty! here are 2 reports of crashes i get
How its activated
-
Plains Activation
-
Evénements
-
Unité - A unit enters Region 006 <gen>
-
Unité - A unit enters Region 007 <gen>
-
Unité - A unit enters Region 008 <gen>
-
Unité - A unit enters Region 009 <gen>
-
Unité - A unit enters Region 010 <gen>
-
Unité - A unit enters Region 011 <gen>
-
Unité - A unit enters Region 012 <gen>
-
Unité - A unit enters Region 013 <gen>
-
Unité - A unit enters Region 014 <gen>
-
Unité - A unit enters Region 015 <gen>
-
Unité - A unit enters Region 016 <gen>
-
Unité - A unit enters Region 017 <gen>
-
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
((Entering unit) is Un héros) Egal à TRUE
-
(Unit-type of (Triggering unit)) Egal à Surunan Scout (Plains)
-
(Unit-type of (Triggering unit)) Egal à Surunan Patrol (Plains)
-
(Unit-type of (Triggering unit)) Egal à Surunan Militia (Plains)
-
-
-
-
Actions
-
Compte à rebours - Start MonstersTimer[1] as a Un coup timer that will expire in 120.00 seconds
-
Set AUnitGroup = (Units in (Entire map) matching (((Custom value of (Matching unit)) Egal à 1) and ((Owner of (Matching unit)) Egal à Neutre Hostile)))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si - Conditions
-
(Number of units in AUnitGroup) Inférieur à MaxMonster[1]
-
-
Alors - Actions
-
Déclencheur - Run Plains Spawn <gen> (checking conditions)
-
-
Sinon - Actions
-
-
Déclencheur - Turn on Plains Spawn <gen>
-
Déclencheur - Turn on Plains Patrol <gen>
-
-
The spawner
-
Plains Spawn
-
Evénements
-
Temps - Every 15.00 seconds of game time
-
-
Conditions
-
(Number of units in (Units in (Playable map area) matching ((Custom value of (Matching unit)) Egal à 1))) Inférieur à MaxMonster[1]
-
-
Actions
-
For each (Integer Var_Integer[6]) from 1 to 3, do (Actions)
-
Boucle - Actions
-
Set tempInteger = (Random integer number between 1 and 11)
-
If (tempInteger Egal à 1) then do (Set tempUnitType = Flying Goblin (Plains)) else do (Do nothing)
-
If (tempInteger Egal à 2) then do (Set tempUnitType = Goblin (Plains)) else do (Do nothing)
-
If (tempInteger Egal à 3) then do (Set tempUnitType = Goblin (Plains)) else do (Do nothing)
-
If (tempInteger Egal à 4) then do (Set tempUnitType = Rat (Plains)) else do (Do nothing)
-
If (tempInteger Egal à 5) then do (Set tempUnitType = Thief (Plains)) else do (Do nothing)
-
If (tempInteger Egal à 6) then do (Set tempUnitType = Thief (Plains)) else do (Do nothing)
-
If (tempInteger Egal à 7) then do (Set tempUnitType = Spider (Plains)) else do (Do nothing)
-
If (tempInteger Egal à 8) then do (Set tempUnitType = Bear (Plains)) else do (Do nothing)
-
If (tempInteger Egal à 9) then do (Set tempUnitType = Wolf (Plains)) else do (Do nothing)
-
If (tempInteger Egal à 10) then do (Set tempUnitType = Wolf (Plains)) else do (Do nothing)
-
If (tempInteger Egal à 11) then do (Set tempUnitType = Eagle (Plains)) else do (Do nothing)
-
Set APoint = (Random point in Plains_Region[(Random integer number between 1 and 13)])
-
Unité - Create 1 tempUnitType for Neutre Hostile at APoint facing (Random real number between 0.00 and 360.00) degrees
-
Unité - Set the custom value of (Last created unit) to 1
-
Custom script: call RemoveLocation(udg_APoint)
-
Set APoint = (Random point in Plains_Region[(Random integer number between 1 and 13)])
-
Unité - Order (Last created unit) to Patrouille vers APoint
-
Custom script: call RemoveLocation(udg_APoint)
-
Set tempInteger2 = (Random integer number between 1 and 100)
-
If (tempInteger2 Inférieur ou égal à 5) then do (Set tempUnitType = Dryad (Plains)) else do (Do nothing)
-
Set APoint = (Random point in Plains_Region[(Random integer number between 1 and 13)])
-
Unité - Create 1 tempUnitType for Neutre Hostile at APoint facing (Random real number between 0.00 and 360.00) degrees
-
Unité - Set the custom value of (Last created unit) to 1
-
Custom script: call RemoveLocation(udg_APoint)
-
Set APoint = (Random point in Plains_Region[(Random integer number between 1 and 13)])
-
Unité - Order (Last created unit) to Patrouille vers APoint
-
Custom script: call RemoveLocation(udg_APoint)
-
-------- Giants --------
-
Set tempInteger3 = (Random integer number between 1 and 110)
-
If (tempInteger3 Egal à 1) then do (Set tempUnitType = Giant Goblin (Plains)) else do (Do nothing)
-
If (tempInteger3 Egal à 2) then do (Set tempUnitType = Giant Eagle (Plains)) else do (Do nothing)
-
If (tempInteger3 Egal à 3) then do (Set tempUnitType = Giant Spider (Plains)) else do (Do nothing)
-
If (tempInteger3 Egal à 4) then do (Set tempUnitType = Giant Wolf (A)) else do (Do nothing)
-
Set APoint = (Random point in Plains_Region[(Random integer number between 1 and 13)])
-
Unité - Create 1 tempUnitType for Neutre Hostile at APoint facing (Random real number between 0.00 and 360.00) degrees
-
Unité - Set the custom value of (Last created unit) to 1
-
Custom script: call RemoveLocation(udg_APoint)
-
Set APoint = (Random point in Plains_Region[(Random integer number between 1 and 13)])
-
Unité - Order (Last created unit) to Patrouille vers APoint
-
Custom script: call RemoveLocation(udg_APoint)
-
-
-
-
To make them patrol
-
Plains Patrol
-
Evénements
-
Temps - Every 30.00 seconds of game time
-
-
Conditions
-
Actions
-
Set AUnitGroup = (Units in (Entire map) matching (((Custom value of (Matching unit)) Egal à 1) and ((Owner of (Matching unit)) Egal à Neutre Hostile)))
-
Groupe unité - Pick every unit in AUnitGroup and do (Actions)
-
Boucle - Actions
-
Set APoint = (Random point in Plains_Region[(Random integer number between 1 and 12)])
-
Unité - Order (Picked unit) to Patrouille vers APoint
-
Custom script: call RemoveLocation(udg_APoint)
-
-
-
Custom script: call DestroyGroup(udg_AUnitGroup)
-
-
I also have 2 more triggers for making the monsters patrol in the zone, and a timer for clearing out the zone if empty of heroes...
I seem to get fatal errors randomly after a long period of playing the map, and i cannot consciously make it crash when i want to, so i think this may be related to leaks? I honestly don't know.
Also, sorry for the weird code, my interface is in french and copies badly...
Thanks in advance for any answer.
edit: how do u guys show the triggers in gui on the forum??
edit2: ty! here are 2 reports of crashes i get
Last edited: