Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Possible CTD on a gamelogic

  1. #11
    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?

  2. #12
    Chief Warrant Officer
    Join Date
    Jan 17 2004
    Location
    Auckland, New Zealand
    Posts
    3,788
    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 &#39;EHkilled&#39;: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">EHkilled = player addEventHandler &#91;&#34;killed&#34;, {_this exec &#34;playerKilled.sqs&#34;}&#93;[/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 &#91;&#34;killed&#34;, {hint format&#91;&#34;%1 killed by %2&#34;,_this select 0, _this select 1&#93;}&#93;[/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 &#39;name&#39; field in the mission editor don&#39;t seem to count as they are stored in a seperate place in the save file.

  3. #13
    hmmm... all my eventhandlers do not have variable names.. they just use "this"

    I sense an ardous search lol.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •