-
Ok we lowered the global variables considerably and seems ok.
I have another mission now that crashes 5 mins into the game after a load. Yet the ammount of variables isnt that high.
Im wondering do eventhandlers constitute/create a global variable?
I have over 80 units with event handlers spawning into the mission repeatedly (ie they respawn when dead)
50 of those have 2 eventhandlers.. so that makes 130-140 eventhandlers..
Can to many eventhandlers cause problems?
-
If you don't assign a name to the eventandler then it wont be a global variable.
Taken from the wiki here.
Example 1 will create a global variable called 'EHkilled': <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">EHkilled = player addEventHandler ["killed", {_this exec "playerKilled.sqs"}][/QUOTE]
Example 2 does not create a global variable: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventHandler ["killed", {hint format["%1 killed by %2",_this select 0, _this select 1]}][/QUOTE]
Any name that you create which can be accessed by any script and trigger in the mission is a global variable, although marker names given in the 'name' field in the mission editor don't seem to count as they are stored in a seperate place in the save file.
-
hmmm... all my eventhandlers do not have variable names.. they just use "this"
I sense an ardous search lol.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules