help a newbie out !! none of the scripts get executed
by andrewKRT · in Technical Issues · 01/25/2012 (5:24 pm) · 8 replies
hi guys,
new guy here.
Im brawling through the tutorial, and soon hit a barrier that I cannot cross, so I need you, brilliant folks to help me out !!
none of the tutorial scripts compile, for some reason. I do everything that I should, write the exec command in the game.cs file, copy the desired script into Gamescripts folder. Ive tried the test, included in the FileIO tutorial, where you check from console to return a file, which, of course, it doesnt.
are there any specifics I need to check before ? Currently Im at a complete halt because the rest of the tutorial starts to play with the fun stuff (scripts), which doesnt work :(
kind regards
andrew
new guy here.
Im brawling through the tutorial, and soon hit a barrier that I cannot cross, so I need you, brilliant folks to help me out !!
none of the tutorial scripts compile, for some reason. I do everything that I should, write the exec command in the game.cs file, copy the desired script into Gamescripts folder. Ive tried the test, included in the FileIO tutorial, where you check from console to return a file, which, of course, it doesnt.
are there any specifics I need to check before ? Currently Im at a complete halt because the rest of the tutorial starts to play with the fun stuff (scripts), which doesnt work :(
kind regards
andrew
About the author
#2
thank you for the quick reply.
please excuse the lack of information.
I am using T2D, and its tutorial, more specifically the FileIO tutorial, part of the Scripting submenu.
I have to include ---exec("./FileIO.cs");--- in game.cs and save the file itself to FileIO.cs to Gamescripts.
then run "writeFile();" in console which should save the file, thus confirming that scripting works normally. I get a cannot find function writefile error
hope that makes more sense
regards
Andrew
01/25/2012 (7:26 pm)
greetings Greg.thank you for the quick reply.
please excuse the lack of information.
I am using T2D, and its tutorial, more specifically the FileIO tutorial, part of the Scripting submenu.
I have to include ---exec("./FileIO.cs");--- in game.cs and save the file itself to FileIO.cs to Gamescripts.
then run "writeFile();" in console which should save the file, thus confirming that scripting works normally. I get a cannot find function writefile error
hope that makes more sense
regards
Andrew
#3
01/25/2012 (8:44 pm)
Try checking the console.log file in your project directory for errors. It could be a typo somewhere is causing an error in compilation so that it doesn't see the function.
#4
I went through everything, I just cant get my head around what Im doing wrong.
the syntax in the scripts, does it have to include anything else, besides the stuff I copy and paste from the tutorial ? some beggining methods or what ?
may I post a copy of my console log for you guys to check it ?
regards
01/27/2012 (2:06 pm)
greetings Harry, thanks for the reply !I went through everything, I just cant get my head around what Im doing wrong.
the syntax in the scripts, does it have to include anything else, besides the stuff I copy and paste from the tutorial ? some beggining methods or what ?
may I post a copy of my console log for you guys to check it ?
regards
#5
>> Advanced script error report. Line 1206.
>>> Some error context, with ## on sides of error halt:
Other than that there's just a lot of stuff in there that's from the engine loading up. You should see a line like:
Loading compiled script C:/Users/<lots more path>/FileIO.cs
Where it hits the exec call in the code.
01/27/2012 (6:15 pm)
Sure.. I took a quick look at the tutorial your talking about and it seems pretty straight forward. The main thing you probably want to check is if there's anything like:>> Advanced script error report. Line 1206.
>>> Some error context, with ## on sides of error halt:
Other than that there's just a lot of stuff in there that's from the engine loading up. You should see a line like:
Loading compiled script C:/Users/<lots more path>/FileIO.cs
Where it hits the exec call in the code.
#6
it has just occured to me, that I forgot to mention that I am using the demo.
can that be it ??
EDIT : after carefully analysing the console again, I found out only 2 files load from <game path>/game/gameScripts : datablocks.cs and guiprofiles.cs but no game.cs
whats even weirder that if I check the folder, there is a game.dso file, which in theory means that it was exec'd right ??
theres the bugger, but why isnt it loading ?
02/02/2012 (5:43 pm)
hi Harry, sorry for taking my time.it has just occured to me, that I forgot to mention that I am using the demo.
can that be it ??
EDIT : after carefully analysing the console again, I found out only 2 files load from <game path>/game/gameScripts : datablocks.cs and guiprofiles.cs but no game.cs
whats even weirder that if I check the folder, there is a game.dso file, which in theory means that it was exec'd right ??
theres the bugger, but why isnt it loading ?
#7
just in case others will stroll upon the same issue, here is the solution, it was, like always, trivial.
Everything happened because of the tilda button. Which was setup wrong in on my laptop. And everytime I would open console, it would automatically modify the first letter you press afterwards (kinda like if you wanna write accents on letters).
I went to my project, gamescripts folder, ran guiProfiles.cs and added this line at the bottom :
GlobalActionMap.bind(keyboard, "alt c", toggleConsole);
now console works flawlessly, even after I run the game. You can change the "alt c" part to anything you wish
cheers all, thanks for keeping up with my thread bumps :))
02/04/2012 (8:11 am)
update : issue fixed.just in case others will stroll upon the same issue, here is the solution, it was, like always, trivial.
Everything happened because of the tilda button. Which was setup wrong in on my laptop. And everytime I would open console, it would automatically modify the first letter you press afterwards (kinda like if you wanna write accents on letters).
I went to my project, gamescripts folder, ran guiProfiles.cs and added this line at the bottom :
GlobalActionMap.bind(keyboard, "alt c", toggleConsole);
now console works flawlessly, even after I run the game. You can change the "alt c" part to anything you wish
cheers all, thanks for keeping up with my thread bumps :))
#8
02/04/2012 (10:51 pm)
Ah, that makes sense. The code in the tutorial is pretty straightforward and should work... just not if your laptop is putting weird characters into the console when you try to put in the commands :)
Torque 3D Owner Greg M
DERP Studio
scripts are executed in different places depending on if they are server or client side. if they are server side scripts then they get executed in /scripts/server/scriptExec.cs and client side in /scripts/client/init.cs and if it is a datablock then it is executed in /art/datablocks/datablockExec.cs
This is if you are using T3D.