HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [resolved] stack limit 99?  (Read 2359 times)

Thazager

  • General Accounts
  • *
  • Posts: 1160
  • Never stop learning
    • View Profile
[resolved] stack limit 99?
« on: Jun 21, 16, 07:24:27 PM »

Any way to change the size without changing the HE_ scripts ?

Code: [Select]
ERROR:HeroScript::HeroMachine::ScriptError:Exceeded $callStackLimit (99)
ERROR:System:SCRIPT ERROR: Exceeded $callStackLimit (99)
Time:06/21/2016 19:18:57
Call trace:
  Script _GUIIconClassMethods line 552 me[id=1000008840 class=EO_ItemIcon]

starting method/function _GOTSPECFOREDIT
starting me[id=0 invalid]
« Last Edit: Jun 22, 16, 09:45:01 PM by Thazager »
Logged
Lead scripter for EO, Repop helper.
HSL Video tutorials:
https://community.heroengine.com/forums/index.php/topic,1719.msg36858.html#msg3685

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: stack limit 99?
« Reply #1 on: Jun 21, 16, 11:05:30 PM »

I don't know that you would want to. I'm guessing that is due to some extreme recursion, possibly an infinite loop. Best to find the root cause first.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Thazager

  • General Accounts
  • *
  • Posts: 1160
  • Never stop learning
    • View Profile
Re: stack limit 99?
« Reply #2 on: Jun 21, 16, 11:32:07 PM »

I'm not sure how many functions are on the stack when it gets to the spec section, where it sets up the gui, but there are about 10-15 functions deep at one point in the specs. If there was a way to print that value, it might be interesting to see at certain times in code.
Logged
Lead scripter for EO, Repop helper.
HSL Video tutorials:
https://community.heroengine.com/forums/index.php/topic,1719.msg36858.html#msg3685

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: stack limit 99?
« Reply #3 on: Jun 21, 16, 11:43:58 PM »

There is the external function GetCallStack(), but I am not sure how you might time it to execute when reaching this limit.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

GlorianLanTarini

  • General Accounts
  • *
  • Posts: 148
    • View Profile
Re: stack limit 99?
« Reply #4 on: Jun 22, 16, 10:54:15 AM »

Quote
I'm not sure how many functions are on the stack when it gets to the spec section, where it sets up the gui, but there are about 10-15 functions deep at one point in the specs.

Thazager, I'm sure you have infinite loop. I has same situation. When you have calls stack 10-15 functions deep, it's really ease to miss the place where function call another, which upper at row. Especially if you call lower function with upper function as param: LowerFunction(UpperFuction).
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1160
  • Never stop learning
    • View Profile
Re: stack limit 99?
« Reply #5 on: Jun 22, 16, 07:29:46 PM »

Thanks, I think I found it.

Upon setting the value in the "on screen" textbox, it also called a method which checks when that value is changed by a user. I did not think it would call this method --> _onDropDownBoxValueChange(), as it was being set.  Function A calls Function B, which calls Function C, which calls Function A.

So, now its a matter of showing the value in the textdisplaybox without changing the value in the textdisplaybox.


Code: [Select]
// function A
method PopulateSpecEditorFields(spec as NodeRef)

  ...

  me.GetMyTypeBox()._setDropDownBoxValue(spec.GetMyType())  // calls the method to show it in box

  ...
.

// Function B
method _onDropDownBoxValueChange(args references Class GUIValueFieldChangeEvent)
  when args.value
    is "Armour"
      me.setupArmor()     // recalls the function that shows those updated values
    .
  .
.

// Function C
method setupArmor()

  ...

  me.PopulateSpecEditorFields(spec)    // show dropdownbox values
.
Logged
Lead scripter for EO, Repop helper.
HSL Video tutorials:
https://community.heroengine.com/forums/index.php/topic,1719.msg36858.html#msg3685