Merging the PSK with other projects
by RollerJesus · in TGB Platformer Kit · 07/09/2008 (10:38 am) · 10 replies
Hey all...
I'm making a game where the main level is created using the Adventure Kit and the other levels are created using either the PSK or straight TGB.
I can load the straight TGB levels no problem, swap keybindings, all that with no issues using loadLevel(%levefile).
However, to fire up a PSK level there is quite a bit of magic invloved that needed attention. For instance, I needed to call all the PSK scripts that weren't called in the Adventure Kit game.cs so i renamed the PSK game.cs to platformerGame.cs and executed that by adding a dynamic field to the Adv Kit level trigger that indicates if the level to be loaded is a PSK level.
All the PSK scripts successfully get initialized and the level loads. I can hear the PSK level starting and responding to input and have no console errors but I can't get the Adv Kit level to unload.
Anyone have any ideas here? Is there any code I can post to help clarify?
Thanks in advance,
Patrick
I'm making a game where the main level is created using the Adventure Kit and the other levels are created using either the PSK or straight TGB.
I can load the straight TGB levels no problem, swap keybindings, all that with no issues using loadLevel(%levefile).
However, to fire up a PSK level there is quite a bit of magic invloved that needed attention. For instance, I needed to call all the PSK scripts that weren't called in the Adventure Kit game.cs so i renamed the PSK game.cs to platformerGame.cs and executed that by adding a dynamic field to the Adv Kit level trigger that indicates if the level to be loaded is a PSK level.
All the PSK scripts successfully get initialized and the level loads. I can hear the PSK level starting and responding to input and have no console errors but I can't get the Adv Kit level to unload.
Anyone have any ideas here? Is there any code I can post to help clarify?
Thanks in advance,
Patrick
#2
That's what I'm doing and I figured that you couldn't provide any insight into the unload issue but I wanted to make sure that you didn't throw anything in there that I didn't see regarding changing levels within the PSK.
I'm should be able to get some more work done tonight and I'll post back if I make progress.
Thanks again,
Patrick
07/10/2008 (11:24 am)
Thanks Phil, That's what I'm doing and I figured that you couldn't provide any insight into the unload issue but I wanted to make sure that you didn't throw anything in there that I didn't see regarding changing levels within the PSK.
I'm should be able to get some more work done tonight and I'll post back if I make progress.
Thanks again,
Patrick
#3
Now, everything seems to load fine. I can spawn the Dragon player, the animation system is kosher (all behaviors for that matter), the sound is good, all the gamemethods load proper but the player just runs in place when I try to move to the right. Moving left is good, I can jump to the right, but there seems to be little bobble upon landing after a jump.
It seems very likely to me that it's a collision issue somewhere, but the collisions/platform behaviors for the platforms are normal, and the player is setup just as described in the kit (symmetrical about the y-axis and a single point for the feet, behaviors, etc).
I'm fresh out of ideas of what else to test, the only anomoly I show in the console.log is a warning that is along the lines of:
"Simset::getObject - index out of bounds"
Ideas, comments, concerns, or just tell me to shut up already... anything is welcome here.
'Patrick
07/11/2008 (6:14 am)
I isolated the problem with unloading the Adv Kit and it turned out the PSK level would load fine if I don't load the PSK gui (mainScreen.gui).Now, everything seems to load fine. I can spawn the Dragon player, the animation system is kosher (all behaviors for that matter), the sound is good, all the gamemethods load proper but the player just runs in place when I try to move to the right. Moving left is good, I can jump to the right, but there seems to be little bobble upon landing after a jump.
It seems very likely to me that it's a collision issue somewhere, but the collisions/platform behaviors for the platforms are normal, and the player is setup just as described in the kit (symmetrical about the y-axis and a single point for the feet, behaviors, etc).
I'm fresh out of ideas of what else to test, the only anomoly I show in the console.log is a warning that is along the lines of:
"Simset::getObject - index out of bounds"
Ideas, comments, concerns, or just tell me to shut up already... anything is welcome here.
'Patrick
#4
Are you able to tell me what you are doing when that SimSet error is displayed? I can look into that problem.
07/11/2008 (2:31 pm)
What do you mean by bobble? Are you sure it isn't just the land animation being played?Are you able to tell me what you are doing when that SimSet error is displayed? I can look into that problem.
#5

Also, it's not a simset error, here's the console.log:
Upon further review, it looks like it happens upon any level change, so it's not a PSK issue.
But if you have any insight into why I can't get the actor to move to the right, that would be much appreciated.
patrick
07/11/2008 (3:16 pm)
I guess the bobble is the land animation, sorry, it looked funny because of the collision issue. I've attached a screenshot of the idle animation with collision in place, but see how the little fella floats a bit. Can't figure that one out.
Also, it's not a simset error, here's the console.log:
Loading compiled script C:/Users/Patrick/Documents/MyGames/Bobby and Sprout/game/gameScripts/GameMethods.cs. Loading compiled script C:/Users/Patrick/Documents/MyGames/Bobby and Sprout/game/gameScripts/PlayerMethods.cs. Loading compiled script C:/Users/Patrick/Documents/MyGames/Bobby and Sprout/game/gameScripts/ObjectManager.cs. Loading compiled script C:/Users/Patrick/Documents/MyGames/Bobby and Sprout/game/gameScripts/SoundManager.cs. Loading compiled script C:/Users/Patrick/Documents/MyGames/Bobby and Sprout/game/data/levels/mountain.t2d. Set::getObject index out of range.
Upon further review, it looks like it happens upon any level change, so it's not a PSK issue.
But if you have any insight into why I can't get the actor to move to the right, that would be much appreciated.
patrick
#6
The "floating" is probably due to the "GroundYBuffer" field.
07/11/2008 (4:10 pm)
Have you changed any of the "ActorBehavior" fields from their defaults? Try reseting them back to default and see if that helps.The "floating" is probably due to the "GroundYBuffer" field.
#7
I tried decreasing the GroundYBuffer to a really small value (0.010) but he still floats and still can't run to the right.
07/11/2008 (6:17 pm)
I haven't changed any of the default ActorBehavior fields... plain old vanilla.I tried decreasing the GroundYBuffer to a really small value (0.010) but he still floats and still can't run to the right.
#8
Thanks for hanging in there Phil. I'll post back when I get it figured out, or get massively stuck.
Patrick
07/11/2008 (6:25 pm)
I've noticed that several of the ActorBehavior fields have no effect. For instance the, GlideTimeOut has no effect. I think this has to do with incomplete unloading of the Adventure Kit and some of the gameMethods being called incorrectly.Thanks for hanging in there Phil. I'll post back when I get it figured out, or get massively stuck.
Patrick
#9
The first thing you need to do is make sure that pressing the keys actually does something! Open up the Controller Behavior file and throw an echo at the bottom of the keyDown function. Just make sure that we are getting there. If not, it could have something to do with the moveMap itself. You can try creating a new moveMap and using that for your controller instead o
07/11/2008 (6:58 pm)
GlideTimeOut should alter the length of time you are allowed to glide. Are you sure that it isn't working?The first thing you need to do is make sure that pressing the keys actually does something! Open up the Controller Behavior file and throw an echo at the bottom of the keyDown function. Just make sure that we are getting there. If not, it could have something to do with the moveMap itself. You can try creating a new moveMap and using that for your controller instead o
#10
The keys are doing something. In fact, I already created a new moveMap. The following code is
email to follow...
07/11/2008 (7:55 pm)
I altered the glideTimeOut to 0.5 and it is working, I just wasn't gliding longer than the default 2.0 seconds.The keys are doing something. In fact, I already created a new moveMap. The following code is
function loadPlatformerLevel()
{
if ( isObject( moveMap ) )
moveMap.delete();
new ActionMap(platformerMoveMap); //PWA - changed from (moveMap)
platformerMoveMap.push(); //PWA - changed from (moveMap)
exec ("./GameMethods.cs"); //Get the PSK methods ready to be called
exec("./PlayerMethods.cs"); //Get the PSK player ready
initialisePlatformerKit(); //Load up the PSK Stuff
}email to follow...
Associate Phillip O'Shea
Violent Tulip
// Loads various functions required through the kit exec ("./GameMethods.cs"); initialisePlatformerKit();As long as you load those, you should be okay.
I haven't actually used the Adventure Kit so I cannot really comment on how to unload that I am sorry.