execute two custom scripts packaged with the PSK?
by Nathan Gordon · in TGB Platformer Kit · 02/28/2009 (1:33 pm) · 2 replies
Instructions within the demo tutorial :
Before we get too far into this project, you may want to execute two custom scripts packaged with the PSK. Open your "game.cs" file inside of your gameScripts folder and type these two lines:
exec ("./PlayerMethods.cs");
exec ("./DrillMethods.cs");
Where do I type these two lines within the game.cs? beginning, end, etc.
Maybe someone can point me where to go to get some basic know how on how copy and paste script into the right places at the very least?
My main priority is to plug my art and anims into psk and work with it thru the interface, premade behavior and script. This is until I can start learning some of the basics of scripting and or find someone who wants to work with me that has the know how :)
Also, I finally got my behaviors and play scene to work with my created PSK demo. For some reason on creating a new template psk or tgb adds in a duplicate game folder within the game folder which causes major problems. Is there a fix for this so I dont have to manually go into the newly created directory and fix the structure everytime I make a new project?
Any help or advice is appreciated
Before we get too far into this project, you may want to execute two custom scripts packaged with the PSK. Open your "game.cs" file inside of your gameScripts folder and type these two lines:
exec ("./PlayerMethods.cs");
exec ("./DrillMethods.cs");
Where do I type these two lines within the game.cs? beginning, end, etc.
Maybe someone can point me where to go to get some basic know how on how copy and paste script into the right places at the very least?
My main priority is to plug my art and anims into psk and work with it thru the interface, premade behavior and script. This is until I can start learning some of the basics of scripting and or find someone who wants to work with me that has the know how :)
Also, I finally got my behaviors and play scene to work with my created PSK demo. For some reason on creating a new template psk or tgb adds in a duplicate game folder within the game folder which causes major problems. Is there a fix for this so I dont have to manually go into the newly created directory and fix the structure everytime I make a new project?
Any help or advice is appreciated
#2
C:\Program Files\GarageGames\TorqueGameBuilder-1.7.4\games\test\game
within the test folder are common, game, resources, main.cs,and *.t2dproj
within the 2nd game folder is: behaviors, data, gamescripts,gui, managed, and main.cs
this second game folder has the other directories that should be in the first game folder. So, I always have to copy whats missing from the second game folder into the 1st game folder and then delete the 2nd game folder.
I am also using a pc not mac.
Thanks again for the info.
02/28/2009 (4:46 pm)
Thanks for the help. I looked in the Gamemethods.cs file and the 2 behaviors are there. In the tutorial it says to add them to the game.cs file. I have only went through the fish tutorial which was informative but I should probably go through the rest like you mentioned. I had hopes that psk would be a little more plug and play but once I go thru some of the basics im sure it will come together. Heres what i'm getting as far as directory structure when creating a project.C:\Program Files\GarageGames\TorqueGameBuilder-1.7.4\games\test\game
within the test folder are common, game, resources, main.cs,and *.t2dproj
within the 2nd game folder is: behaviors, data, gamescripts,gui, managed, and main.cs
this second game folder has the other directories that should be in the first game folder. So, I always have to copy whats missing from the second game folder into the 1st game folder and then delete the 2nd game folder.
I am also using a pc not mac.
Thanks again for the info.
Associate Phillip O'Shea
Violent Tulip
In any case, those two scripts should be executed from "game/gameScripts/GameMethods.cs" in the function "initialisePlatformerKit". You may find that they have already been executed and you don't need to do anything (they should be at the bottom of the function).
I've not seen this happen before, are you on a Mac by chance? If so, you should just be able to delete the one "game" folder that doesn't contain any of the PSK scripts.