Game Development Community

Integrating Scripts into the Engine

by Howard University · in Technical Issues · 03/18/2006 (12:13 pm) · 5 replies

I am designing new scripts and modifying the checkpoint scripts that are located in the starter.racing/server/scripts folder. Upon changing and saving it, I can not get it to work in the actual game that I am designing. How do you get the new scripts that I have designed along with the the modified scripts to work in the fame engine.

#1
03/18/2006 (1:15 pm)
-------------
If you are modifing an existing script file (.cs):
Ensure your updated script compiles. The console.log will report back a failure to compile. If it fails to compile the engine will use the old compiled version. So chances are you failed to compile if you made a script change to an existing script that should have done something different, but didn't.

------------
If you are adding a completely new script file to a folder (.cs) ensure that there is an exec statement for your new script. You will find examples in the existing script files on how to do that.

If that doesn't solve your problem, please be more specific. Also I recommend picking up 3D Game Programming All In One
#2
04/10/2006 (4:40 am)
Hi todd!

u r thread topic heading and u r problem description are entirely diffrent.
pls be more clear in choosing ur thread title.okay let me try to fix it.
u r check point problem u need to describe u r check point (area trigger )in u r world editor[press f11 and then press f4] there u need to define u r area object[trigger object] under some group , then save u r mission file . place ontrigger function in u r checkpoint.cs file ............
so i have given u hints. i hope it will fix u r probl.
happy gaming
#3
04/10/2006 (10:12 am)
Actually I thought the subject precisely described the problem. Dan pretty much answered this but I'll restate it in case your still stuck. Next time, please post back so we know you have solved the problem! :-)

Any new script-files you add (*.cs) have to be called from another script file which is being executed. This is usually server/scripts/game.cs. Near the top of the file you'll see a list of "exec( ../scriptFileFoo.cs);" commands.

Torque only compiles scripts for which it can't find a current "*.cs.dso"(script binary) file for at run-time. Since the 'out-of-date' check is hit-or miss, (as is the "delete *.dso" function in some script-IDEs) your safest-bet is to delete the *.dso file by hand in your file-explorer everytime. Trust me, the extra 2-secs. will save you hours!

Then when you start Torque, make sure to check the console carefully, to see that it did in fact compiled your file at run-time. If it's not listed, it may not have found an "exec()" statement. If it says "Loading compiled myScriptname", you need to delete the *.cs.dso and restart torque. If there's compile errors, fix them, etc..

If it compiled ok, there's some message that implies that, and it won't be followed by errors.

Good Luck,
Steven
#4
04/10/2006 (11:50 am)
Thank you very much Dan, Roshan, and Steven. I got the script to integrate correctly and your posts helped me out tremendously.
#5
04/10/2006 (12:21 pm)
Your welcome :-)