"Deleted code is debugged code." - Jeff Sickel "Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." - Richard Hamming
Basically, someone posts a script with an error in it, person who manages to fix the error gets to post a new broken script. (Don't post obvious errors or it defeats the purpose of the whole game, which is to test your scripting skills.)
Before you ask, no, it won't throw an actual error ingame. It just won't "work".
Code Snippet
Plaintext
step6_death_watch() { time = 5;
self waittill( "death" );
if( isDefined( level.ee_step6_active ) && level.ee_step6_active && self isTouching( level.ee_step6_radius ) && level.ee_step6_souls < level.ee_step6_soul_c ) { org = spawn( "script_origin", self.origin ); tag = spawn( "script_model", self.origin ); tag setModel( "tag_origin" ); tag enableLinkTo(); tag linkTo( org ); tag thread step6_fx( time );
org moveTo( level.ee_step6_fx_goto.origin, time ); org waittill( "movedone" );
This one was something I actually did wrong when scripting for Rise V2 and took me 2 days to find what was wrong with it myself. Triton, Lossy, Purity (some nub friends of mine) and me facepalmed (and had a giggle) after finding out what was wrong with it.
Nubs who were in chat when I was talking to Ray about this, please don't spoil it for others, ty. :3
Last Edit: December 07, 2014, 12:28:38 pm by JR-Imagine
wow its checking if a vairiable is greater than or equal to before the ++ inside of a if statment that only is true if the variable isless thenso the second it becaomes equal to itwill never get to the other if check so it wont work it should look like this:
Code Snippet
Plaintext
step6_death_watch() { time = 5;
self waittill( "death" );
if( isDefined( level.ee_step6_active ) && level.ee_step6_active && self isTouching( level.ee_step6_radius ) && level.ee_step6_souls < level.ee_step6_soul_c ) { org = spawn( "script_origin", self.origin ); tag = spawn( "script_model", self.origin ); tag setModel( "tag_origin" ); tag enableLinkTo(); tag linkTo( org ); tag thread step6_fx( time );
org moveTo( level.ee_step6_fx_goto.origin, time ); org waittill( "movedone" );
wow its checking if a vairiable is greater than or equal to before the ++ inside of a if statment that only is true if the variable isless thenso the second it becaomes equal to itwill never get to the other if check so it wont work it should look like this:
Code Snippet
Plaintext
step6_death_watch() { time = 5;
self waittill( "death" );
if( isDefined( level.ee_step6_active ) && level.ee_step6_active && self isTouching( level.ee_step6_radius ) && level.ee_step6_souls < level.ee_step6_soul_c ) { org = spawn( "script_origin", self.origin ); tag = spawn( "script_model", self.origin ); tag setModel( "tag_origin" ); tag enableLinkTo(); tag linkTo( org ); tag thread step6_fx( time );
org moveTo( level.ee_step6_fx_goto.origin, time ); org waittill( "movedone" );
Putting this here this is a mind fuck. No code should of would ever look like this but still. it does contain "3" errors. The logical process should end up printing "fuck it i give up. Logic is simple when logic is not simple". This does not happen due to a logic fail. Fix my logic and i will give you a cookie
1) "yes != "no"" will evaluate to false since yes is defined as no 2) " && yes == no" will evaluate to false 2b) idk wtf "continue" does in C#, if that was java than that would be a syntax error since theres no enclosing loop 3) if( logicalYes ) { logicalYes is false in this scenario 4) if( logicalYes ) { if( !logicalYes ) { that cant happen... 5) if( !nub && (logicalYes == oldLogical)) { that will evaluate to true and the else block which contains the print statement wont be run