Game Development Community

Programming not being updated in game

by nick fortier · in Technical Issues · 05/15/2011 (10:59 pm) · 4 replies

I know I already posted about needing help with programming, but I think there is something else that is causing my problems.
I've been messing around creating new games and using the programing from the original game I created in them and those games won't work at all with that programming.I know I've set everything up correctly, but the programming just won't take in them. This could explain why alot of the new code I've put in from the Tutorial isn't working.
But the biggest thing that tells me that the games programming is not being updated is something I noticed while messing around with the movement speed.

speed functions
function MainPlayerUp()
{
$MainPlayer.setLinearVelocityY(-$MainPlayer.uSpeed);
}

function MainPlayerDown()
{
$MainPlayer.setLinearVelocityY($MainPlayer.bSpeed);
}

function MainPlayerLeft()
{
$MainPlayer.setFlipX(true);
$MainPlayer.setLinearVelocityX(-$MainPlayer.hSpeed);
}

function MainPlayerRight()
{
$MainPlayer.setFlipX(false);
$MainPlayer.setLinearVelocityX($MainPlayer.hSpeed);
}
Now I have my Velocities for my up and down movement set to different values to help give me more control. I do have these values set correctly in dynamic fields in TGB,and with those settings my fish moves around just fine. But if I try and change the code for those velocities to $MainPlayer.vSpeed and set the dynamic fields to vSpeed, the fish will no longer move up and down. It seems like TGB doesn't always update the new code for the game.

I don't know if this is something im doing something wrong or if its a bug in the program. Any one else notice this problem?

#1
05/15/2011 (11:32 pm)
This is likely due to the DSOs. TorqueScripts (.cs) files are compiled into a binary format (DSO). If a DSO exists, the game will load that instead of the script. When you run the game, the DSO generation happens automatically. However, DSO files are not updated after they are generated. You have to delete them to see your latest script changes.
#2
05/17/2011 (3:33 am)
Ya I've read about that and have tried it. Thing is when I do the game stops working all together, it never generates a new DSO file.
But that is what I was thinking the problem might be, I just don't know how to fix it.
#3
05/17/2011 (9:50 am)
If your game has quit working and/or a DSO file is not being generated then you very likely have an error in that particular script file. Check for errors in the console (in-game) or by reading the console.log file.
#4
05/17/2011 (6:28 pm)
I have had a problem kind of like that. My first script said
(barney style for example)
movement=3
check the console log and its stating 3

changed the script to
movement=4

saved it, deleted all dso's, still says 3 in the console log...

never did figure it out