Jump to content

Code Problems


Deji

Recommended Posts

UPDATED: Okay, I changed the script a little and put it back into a new stripped .scm file. It worked great, better than ever! But when I put it onto an original main.scm it doesn't work. It crashes at the Start New Game loading screen...

I think there may not be enough memory left or something... I'm not sure, because I've seen larger scripts... Or maybe the new driveby feature is clashing with another script... Either way, there's nothing I can think of doing to fix the problem... All the required objects are defined, the thread is created with 'create_thread' and it works perfectly like this in the stripped .scm

So how do I fix this? How do I enable more memory (Sanny doesn't seem to help much with it unlike Barton Waterducks mission builder) I really need to know otherwise I can't release 0.7 of my really cool mod (And trust me, this new feature makes it 20x cooler!)

If you require the file for reference, tell me and I'll upload it (It's too long to put on the forums)

Edited by Deji
Link to comment
Share on other sites

Since I am unaware of what you added exactly... it could be a simple "if then" statement crashing the game. I have this working method I use to debug my scripts:

1. Change one section at a time and make a backup before you make changes.

2. If your changes cause the game to crash or has unexpected results, comment out one line at a time until the program works again.

3. Don't use the whole MAIN.SCM use a stripped down version as it will be easier to add your code to the main once debugged.

4. Never assume your problem is the area that you changed last.

It is a slow process but it must be done or you will drive yourself crazy with buggy code.

JAB B)

Feeling much better now.

Link to comment
Share on other sites

Since I am unaware of what you added exactly... it could be a simple "if then" statement crashing the game. I have this working method I use to debug my scripts:

1. Change one section at a time and make a backup before you make changes.

2. If your changes cause the game to crash or has unexpected results, comment out one line at a time until the program works again.

3. Don't use the whole MAIN.SCM use a stripped down version as it will be easier to add your code to the main once debugged.

4. Never assume your problem is the area that you changed last.

Turns out a previously working thread was causing the problem. I used it to get rid of the blockage in the vent at Area 51 but now I just removed the 'remove from mission cleanup' for the blockage object and it works fine!

After I've finished terminating some virus which is opening my internet to web pages and playing random noises, I'll make the video and put my mod up!

Cheers JAB! :coolthumbup:

Link to comment
Share on other sites

  • 1 month later...

I need help with my Crazy Trainer. Only some commands work and unfortunately, not the ones I really want to work. I try the gravity and health commands but nothing happens at all. And when I use the command to spawn a vehicle, it usually just gives me a Dozer. Can anyone help? Thanks.

Cheers,

Tom.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...