Game Development Community

Exec'ing a script outside your game directory?

by Ian Poma · in Torque Game Builder · 06/20/2006 (7:56 am) · 3 replies

Can you exec a script outside your base game directory? In my case I have a script in the common library I would like to exec in my game.

-TorqueGameBuilder
---MyGame
------main.cs
---common
------gamescripts
------------base
-----------------myFile.cs


How do i exec "common/gamescripts/base/myFile.cs" from "Mygame/main.cs"?

I've tried doing exec("../common/gamescripts/base/myFile.cs"), but that doesn't work.

#1
06/20/2006 (8:34 am)
Try

exec("/common/gamescripts/base/myFile.cs");

The beginning slash (/) should mean from your TGB root dir, a tilde (~) means from the current mod dir, and dot (.) means from the current dir.
#2
06/20/2006 (8:38 am)
You may not need a beginning slash at all, actually. Also try exec( "common/gamescripts/base/myFile.cs" );
#3
06/20/2006 (10:01 am)
Thanks!

exec( "common/gamescripts/base/myFile.cs" ); worked.

exec("/common/gamescripts/base/myFile.cs"); didn't work.