• 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.

[Trigger] Map's triggers bug

Status
Not open for further replies.
Level 4
Joined
Mar 24, 2008
Messages
87
Hi everyone !

I am making a orpg, and at the moment scripting different heroes.

I have a bug now, i'll try to explain it :
When i test or just launch the map on war 3, it seems like some of my triggers don't work anymore.
Moreover, after leaving, the game crash and i must press ctl + alt + supr to leave it correctly.

I tryed to find the soucre of the problem : disabling 2 triggers like this seems to solve the problem.
  • Frappe tempete dummy
    • Evénements
      • Unit enter - Entire map
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Egal Ã* Frappe-tempête dummy 1
          • (Unit-type of (Triggering unit)) Egal Ã* Frappe-tempête dummy 2
          • (Unit-type of (Triggering unit)) Egal Ã* Frappe-tempête dummy 3
    • Actions
      • Wait 0.50 seconds
      • Unit - Remove (Triggering unit) from the game
(made many of those to remove dummys units)

So i was wondering what did i do wrong ?
Thaught about Region leaks, so i tryed to make Entire map as a variable region and changed the events, but i still had the bug.

Btw : Sorry for my english !

Edit : Tryed to remove all events, creat a trigger to add "Unit enter entire map (Variable) as event to these triggers.
I can have a maximum of 15 "Add to
  • the event "Enter in entire map (variable)" at the same time, more makes the bug come again.
  • Edit 2 : It seems like the triggers bugging are only the ones based on "Unit enter [Region]" event.
  • Any idea ? :/
 
Ur English isn't bad lol. As for the trigger I would stay away from the waits if u could. Although normally when a map stops like this it's due to a variable that isn't initialized. Like if u try to use an item variable b4 u store an item in that variable. Also check to make sure the variable arrays u have in the variable editor r set to 1 do not set them to high numbers. Except for dialog, dialog button and one or 2 others

Can u post the other trigger tho or ur map
 
Level 4
Joined
Mar 24, 2008
Messages
87
I don't think it's an infinit loop, as it seems to be a problem with triggers "Unit enter entire map" only.

  • Totem de soins dummys
    • Evénements
    • Conditions
      • (Unit-type of (Triggering unit)) Egal Ã* Totem de soins
    • Actions
      • Wait 5.00 seconds
      • Unité - Remove (Triggering unit) from the game
They are all like this one, and i created another :
  • Set map
    • Evénements
      • Map initialization
    • Conditions
    • Actions
      • Set EntireMap = (Entire map)
      • Déclencheur - Add to Coup assourdissant dummy <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Sang chaud dummy <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Enrager del dummy <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Etre de lave <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Carapace d eau dummy <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Orbe de glace dummy del <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Peau glaciale dummy <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Projectiles arcaniques dummy <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Volee de fleches dummy <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Furie partagee remove dummy <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Tir explosif dummy <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Grenade dummy <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Esprits sauvages dummy <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Rage hero dummy <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Seisme dummy <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Totem de mana dummys <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Totem de soins dummys <gen> the event (Unité - A unit enters EntireMap)
      • Déclencheur - Add to Frappe tempete dummy <gen> the event (Unité - A unit enters EntireMap)
Disabling 3 of any action here solves the problem

Can't be a variable problem as it bugged before i made the "Entire map" variable, and i have no trigger with "Unit enter rect" - event

As the problem might be here, i didn't think uploading the map could help. If you really think so, i will.

Edit : Is there any problem with the "wait" action ? - i had to use it to let time for dummys to attack / use a spell / ... (and in case their target dies before they end it, i prefered using "Enter entire map" than "Being casting a spell" / " attack" / and so on. It seems to be safer imo.
 
You haven't answered my question. Does any of the triggers that use the Unit enters Rect event create units? And of course you have triggers with that event. You add the event to a whole load of triggers in your "setMap" trigger.


Btw, I remember WC3 only allowing up to 16 events of the same kind.
Try to use one global trigger with the event and then execute the other triggers, checking conditions.

Also, for removing dummy units, you can add a lifetimer to the unit created instead of removing them manually (at least as long as they are unselectable or not player units, otherwise you will see the ugly timed life bar). Saves you the hassle of creating all those triggers.
call UnitApplyTimedLife(unit u, integer buffid, real duration)
 
Level 4
Joined
Mar 24, 2008
Messages
87
I did answer : told you i didn't use any Event : unit enter rect :p

Edit : maybe i missunderstood you, were you talking about some kind of trigger like this one ?
  • Choix elem
    • Evénements
      • Unité - A unit enters Choix elem <gen>
    • Conditions
    • Actions
      • Unité - Remove (Triggering unit) from the game
      • Set PointStart = (Center of Start <gen>)
      • Unité - Create 1 Elémentaire for (Owner of (Triggering unit)) at PointStart facing Orientation bâtiment par défaut degrees
      • Set Heroes[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
      • Caméra - Pan camera for (Owner of (Triggering unit)) to PointStart over 0.00 seconds
      • Quête - Display to (Player group((Owner of (Triggering unit)))) the Quête mise Ã* jour message: Vous avez choisi d'...
      • Sélection - Select Heroes[(Player number of (Owner of (Triggering unit)))] for (Owner of (Triggering unit))
      • Custom script: call RemoveLocation (udg_PointStart[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])

Anyway : the problem might be what you said :
Btw, I remember WC3 only allowing up to 16 events of the same kind.

I didn't know that, thank you !

I didn't think about expiration timers for dummys, will be helpful !

A lot of work to do now ^^.

So, just to know : when you creat a map, you use only 1 trigger for each event and then run other ones checking conditions ?
And is for example "Unit enter Region1" concidered as the same event than "Unit enter Region2" ?

Thanks for answers !
 
I did answer : told you i didn't use any Event : unit enter rect :p
You do. You assign 18 of them in your "setMap" trigger. How can you tell me you don't use it? o_O

So, just to know : when you creat a map, you use only 1 trigger for each event and then run other ones checking conditions ?
Exactly.

And is for example "Unit enter Region1" concidered as the same event than "Unit enter Region2" ?
Unlikely, considering there are so many TD maps using it out there.

@deathismyfriend:
16 events per region not 16 events in general. I'm pretty sure I've read something about an event limit.
But it shouldn't be hard to confirm this.
 
Level 4
Joined
Mar 24, 2008
Messages
87
Yes, i missunderstood, i thaught you were talking about the
  • Unit - A unit enters (Region((Point(X, Y)), (Point(X2, Y2))))
event, sorry.

@deathismyfriend:
16 events per region not 16 events in general. I'm pretty sure I've read something about an event limit.
But it shouldn't be hard to confirm this.

I'd really like to see a post about those limits !

I am making global events trigger now, so knowing more about it will help me. For example : will i have to make a trigger for every events ?
Is it the same for "Every X time" events ? (only 16 events per X time or only 16 events using Every X time ?)
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
@deathismyfriend: "Zwiebelchen" is a word in German ("Onions"), so it's kinda weird when you shorten it to "belchen" :p.
It's like shortening my name to "lypse".

@Zwiebelchen: tested it with 35 different functions, each with the same event (a unit enters entire map). All of them worked just fine.
Couldn't see any hint of an event limit.

@Exum: oftentimes, the map is easier to work with as it is then possible to test and debug certain scenario's myself, speeding up the process.
 
Level 4
Joined
Mar 24, 2008
Messages
87
Really strange that you made 35 events "a unit enters entire map" working without bugs :eek:

I will send you my map, as it were when i saw the bug, just leave me a few minuts :)
 
@Zwiebelchen: tested it with 35 different functions, each with the same event (a unit enters entire map). All of them worked just fine.
Couldn't see any hint of an event limit.
Alright, proven wrong.

@Exum: does it matter which of the event registrations you disable?

This or just post the map so we can look into it.

Btw, do you possibly remove your "EntireMap" rect somewhere in the code?
 
Level 4
Joined
Mar 24, 2008
Messages
87
@Exum: does it matter which of the event registrations you disable?

Nop, any 3 of them !

Btw, do you possibly remove your "EntireMap" rect somewhere in the code?

Neither, but anyway, i already had the bug before making this variable :/

Ok, uploaded the map (i added events which make it bugs, and unabled the trigger global event) !
 

Attachments

  • HnS.w3x
    427.5 KB · Views: 100
the problem may be ur variables they r all set to 10 or 30. they should always be 1. its either that or one of ur triggers is broken. to find out which one first set all variables to 1 if thats not the problem disable triggers in batches to narrow it down. then when u find the batch tht caused the problem narrow it down by turning them on 1 by 1 unitl the problem reoccurs
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
deathismyfriend is correct: you will always be able to use the full 8192 arrays (from 0 to 8191).
The thing is that increasing the array size in the variable editor will just initialize them.
Initializing variables takes time (increases loading time) and may crash the init trigger (too many functions have to run --> trigger gets overloaded).
Long story short: always keep the array size to 1.
The only exceptions are "Timer" and "Dialog" (you cannot create timers/dialogs in GUI, so they have to be initialized or created via JASS, otherwise they won't work).


Another thing is: you've got some serious problems with those triggers and variables.
I am convinced that you can remove at least 100 variables without breaking any trigger (you've got 246 variables right now, nearly all of them with an array).
Every time you need a variable, you just create a new one (with array, even). That's not very good.
I could go on and on about this, but that won't help you with your problem.
The bottom line is: don't use arrays unless you actually need them, and re-use variables as often as you can (20 variables without array is all you need for pretty much all spells in the entire map).


After testing and re-testing many times, I couldn't seem to find a reasonable explanation.
While those triggers are completely useless, they also seem to break the game.
If you wish to keep working with what you have now, your expiration timers will indeed do the trick.
Personally, I would delete everything and start all over again :p.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
dont dialog button arrays and timer window arrays also need to be set to the number u need ?
No, because the initial value for both dialog buttons and timer windows is "none", so increasing the array size for them won't do anything at all (they won't get initialized because there is no value to set them to).
They can also be created in GUI, so that's no problem :).
 
Level 4
Joined
Mar 24, 2008
Messages
87
So to resume, i have to :
Make a max of 1 arraw for my variables, the other will be created themselves with triggers.
Use as less variable as possible.
Use global events triggers.

Actually, i made arraw because i were afraid of some kind of bugs.
I thaught for example that if i use a variable point without arraw, and if 2 players use a spell using this variable at the same time, it would bug.
That's why i used a 10 arraw for each point integer (for spells), and why i didn't use the same point variable for 2 spells.

So i have to make only, like 2 variables points (with no arraw) for every trigger using temp points (being removed later in the trigger), right ?

Ps : I'm using only GUI atm, learning Jass is longer than i thaught :p
 
Level 4
Joined
Mar 24, 2008
Messages
87
Immediately yes, but if a point variable is used twice exactly at the same time, will it be concidered as a different point or will it count both of those 2 points and then destroy them ? Even if it is the same variable ?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Warcraft cannot handle "exactly at the same time", because it only uses 1 core to process data (so all triggers run one after another, not at the same time).
And remember that a trigger runs in a fraction of a second, gotta have some pretty sick timing to pull that off.

I use 3 location variables total in all maps/spells I create and I've never heard of anyone complaining about that.
 
Level 4
Joined
Mar 24, 2008
Messages
87
Warcraft cannot handle "exactly at the same time", because it only uses 1 core to process data (so all triggers run one after another, not at the same time).
And remember that a trigger runs in a fraction of a second, gotta have some pretty sick timing to pull that off.

I use 3 location variables total in all maps/spells I create and I've never heard of anyone complaining about that.


Ok, thank you for all infos !

Now let's .... spend 1 year reworking my spells :p
 
Status
Not open for further replies.
Top