Setting up script paths/pragma path

Posted By: theraygun

Setting up script paths/pragma path - 04/22/16 18:34

Hello. I am confused with WHERE to put my work in 3DGS. Here is my current directory structure, program is in C:\Program Files\GStudio8. So, for a generic example, I made a folder called "shooter" in \work folder of game folder i.e.C:\Program Files\GStudio8\work\shooter.

This is the script:

#include <acknex.h>
#include <default.c>
#include "t_player.h" // player's movement / camera code
#include "t_weapons.h" // player's weapons: pistol, machine gun with autofire and sniper gun, ammo packs, health pack, armor pack
#include "t_enemies.h" // player's enemies
#include "t_elevators.h" // elevators and platforms
#include "t_doors.h" // doors and keys

#define PRAGMA_PATH "%EXE_DIR%\\templates\\code";
#define PRAGMA_PATH "%EXE_DIR%\\templates\\images";
#define PRAGMA_PATH "%EXE_DIR%\\templates\\levels";
#define PRAGMA_PATH "%EXE_DIR%\\templates\\models";
#define PRAGMA_PATH "%EXE_DIR%\\templates\\sounds";

Shouldn't I be able to access this stuff via this, or do I need to add other levels to my actual work directory?

? #2....how do I use pragma paths when my work in a sub directory of say C:\my documents\GSwork\filename? I can only load my projects if ALL scripts in same directory, while I have tried to make seperate folders for maps/sounds/models/scripts. I cant figure out how to write proper paths...ty in advance.
Posted By: txesmi

Re: Setting up script paths/pragma path - 04/23/16 10:23

Hello,
#1 you need to define the paths before including their contents.

#2 you can define a path for a subfolder contained on the folder the main script is contained on by its name.
Code:
#define PRAGMA_PATH "models"
#define PRAGMA_PATH "scripts"



You can go up the folders by "..". I have my module folders on the same folder of project folders and I define my paths by:
Code:
#define PRAGMA_PATH "..\\modules\\math.h"



Note that WED levels need to be on same or higher folder than the main script. Otherway you will not be able to asign it on map properties.

Salud!
Posted By: Reconnoiter

Re: Setting up script paths/pragma path - 04/23/16 10:34

Hi and welcome to the forums,

I personally never used templates cause they are old as f*ck. tongue
What you can try though is instead of writing #include "..." write #include <...>

Use #include "..." if the script file is in your project/game folder.

Also concerninng paths, I use add_folder, e.g. like this:

Code:
function addfolders_startup()
{
	add_folder("models");
	add_folder("data\\sounds");
}



-edit, ninja'd
© 2024 lite-C Forums