Vscript Problem

Lowpoly Guy

L1: Registered
Jul 24, 2023
4
0
I'm trying to use the vscript and it's giving me this error:

AN ERROR HAS OCCURRED [the index 'helloworld' does not exist]

CALLSTACK
*FUNCTION [main()] InputRunScript line [1]

LOCALS
[vargv] ARRAY
[this] TABLE
Entity theScript encountered an error in RunScript()

Even though I got the logic_script as it is in the image.

Can someone help?
 

Attachments

  • image_2023-07-24_181043987.png
    image_2023-07-24_181043987.png
    11 KB · Views: 89
Solution
Your .nut filepath is wrong in your logic_script. You can omit everything up to and including the vscripts dir. In your case, simply change the filepath to 'test.nut'.

In addition, you are using the custom dir incorrectly, though you are to be commended for using it as it is a useful way to organise your stuff. You need to create a directory inside custom named whatever you like, and then put your scripts, materials, sound etc. dirs in there, as if it were a tf dir. e.g. tf/custom/mystuff/scripts/vscripts

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,259
999
You need a script file with a function named helloworld() in it, attached to the logic_script, for it to be recognised and called.

Attached are some reference sheets and a list of links that I made.
 

Attachments

  • vscript_reference.zip
    3.5 KB · Views: 66

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,259
999
Without evidence to prove that I am sceptical. Please show us the script and a screenshot of your logic_script properties.
 

Lowpoly Guy

L1: Registered
Jul 24, 2023
4
0
Here are the: logic_script, the file where is located the script and the script it self
 

Attachments

  • image_2023-07-27_205557916.png
    image_2023-07-27_205557916.png
    32.7 KB · Views: 85
  • image_2023-07-27_205700935.png
    image_2023-07-27_205700935.png
    10 KB · Views: 79
  • image_2023-07-27_205755506.png
    image_2023-07-27_205755506.png
    7.3 KB · Views: 82

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,259
999
Your .nut filepath is wrong in your logic_script. You can omit everything up to and including the vscripts dir. In your case, simply change the filepath to 'test.nut'.

In addition, you are using the custom dir incorrectly, though you are to be commended for using it as it is a useful way to organise your stuff. You need to create a directory inside custom named whatever you like, and then put your scripts, materials, sound etc. dirs in there, as if it were a tf dir. e.g. tf/custom/mystuff/scripts/vscripts
 
Solution