Jump to content

T.I.L. Torquescript Can Throw Exceptions In Debug Mode


Steve_Yorkshire

Recommended Posts

If only I'd known this 10 years ago I wouldn't have spent all my dev life avoiding debug mode ... :oops:


http://i.imgur.com/SZ4Aez3.jpg


It's not muh leet haxxor skillz that were to blame - it was having incompatible variables in Torquescript datablocks ...

This is of course something that never occurred to me, so I've spent the last month hunting through my spaghetti code - which these days is the good stuff that is actually commented and makes some semblence of sense - only to have been on the wildest of goosechases.


So let's check the top pic problem with the out of range value of 627/256. Kept calling a stack with explosion.cpp - kept doing it even without my custom changes. Why? Because one of my explosion datablocks had lightStartBrightness set to 50 when I meant 5.0. The maximum limit is actually 20.


Now let's check the bottom problem which has the out of range value of -ALL_THE_BITS_IN_THE_OBSERVABLE_UNIVERSE/64. Now this is player.cpp - which has THREE (count 'em) custom modes of movement. The sort of code which falls out of your pockets and spills everywhere when you trip in the hall.


f4d1124776b6f0ef5de80decd2de0001.jpg


Failing on head rotations - but I don't actually use head rotations in a twin stick shooter control method. And that was why. PlayerData Torquescript had min/maxLookAngles set to ZERO (because they weren't really in use) so it freaked out when trying to subtract them.


And that was it, all the reasons I could never get debug exe to work for all these years, because I was always looking in my custom code for the issues and not expecting it to throw a wobbly over being past a dodgy script value from a scriptedd datablock. :evil:


And now all is right with the world which comprises of my spagbol C++ and my status as 1337 is confirmed (unless someone else actually looks at my code and then starts laughing, but hey). :P


C4AeHCyWAAItQ1a.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...