Talk:Logic script: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "== extended array == Are you sure the arrays can be extended? I turned smart edit off and added more arrays, so that i end up with 36 (i still need more).<br> Now everytime...")
 
 
(4 intermediate revisions by 3 users not shown)
Line 20: Line 20:
Even after i edited the "base.fdg" and manually expanded the available slots to 100 ([https://i.imgur.com/jIO2yaa.png screenshot]) it still would not work.<br>
Even after i edited the "base.fdg" and manually expanded the available slots to 100 ([https://i.imgur.com/jIO2yaa.png screenshot]) it still would not work.<br>
So i'm pretty sure you can '''not''' expand the arrays past 15 --[[User:MrFunreal|MrFunreal]] ([[User talk:MrFunreal|talk]]) 14:58, 5 September 2017 (UTC)
So i'm pretty sure you can '''not''' expand the arrays past 15 --[[User:MrFunreal|MrFunreal]] ([[User talk:MrFunreal|talk]]) 14:58, 5 September 2017 (UTC)
Indeed, logic_script cannot get more values. That error is from the Squirrel script, not finding value 16. You need to edit the game code to allow more. --[[User:TeamSpen210|TeamSpen210]] ([[User talk:TeamSpen210|talk]]) 11:22, 6 September 2017 (UTC)
In that case i feel we should add this information the the main page. Stating that the list could be extended, but it would not work. --[[User:MrFunreal|MrFunreal]] ([[User talk:MrFunreal|talk]]) 14:29, 6 September 2017 (UTC)
== How can I invoke script function with string params? ==
Never try to pass string parameters to a script function with ''RunScriptCode''.
So what is the solution? Is there anybody know it?
Does the VMF file have quotation mark escape characters?

Latest revision as of 04:26, 27 February 2022

extended array

Are you sure the arrays can be extended? I turned smart edit off and added more arrays, so that i end up with 36 (i still need more).
Now everytime the logic_script has to do anything, i get the following error:

AN ERROR HAS OCCURED [the index '16' does not exist]

CALLSTACK
*FUNCTION [StopAllMusic()] f:/programme/steam/steamapps/common/left 4 dead 2/tumtara/scripts/vscripts/TUMTaRA_Music.nut line [386]
*FUNCTION [Play_Snd_alarm3()] f:/programme/steam/steamapps/common/left 4 dead 2/tumtara/scripts/vscripts/TUMTaRA_Music.nut line [319]
*FUNCTION [main()] InputRunScript line [1]

LOCALS
[this] TABLE
[this] TABLE
[vargv] ARRAY
[this] TABLE

According to the callstack the game knew what it was meant to do, but it just wouldn't do it because appereantly only the indexes 0-15 exist.
Even after i edited the "base.fdg" and manually expanded the available slots to 100 (screenshot) it still would not work.
So i'm pretty sure you can not expand the arrays past 15 --MrFunreal (talk) 14:58, 5 September 2017 (UTC)

Indeed, logic_script cannot get more values. That error is from the Squirrel script, not finding value 16. You need to edit the game code to allow more. --TeamSpen210 (talk) 11:22, 6 September 2017 (UTC)

In that case i feel we should add this information the the main page. Stating that the list could be extended, but it would not work. --MrFunreal (talk) 14:29, 6 September 2017 (UTC)

How can I invoke script function with string params?

Never try to pass string parameters to a script function with RunScriptCode.

So what is the solution? Is there anybody know it?

Does the VMF file have quotation mark escape characters?