UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

[Forum Game] Find the Error

HOT
broken avatar :(
Created 9 years ago
by JR-Imagine
0 Members and 1 Guest are viewing this topic.
6,504 views
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 3 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
Signature
"Deleted code is debugged code." - Jeff Sickel
"Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." - Richard Hamming
×
JR-Imagine's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
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". :derp:
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" );

if( level.ee_step6_souls >= level.ee_step6_soul_c )
{
level.ee_step6_active = false;
flag_set( "ee_step6" );
}

wait 8;

tag delete();
org delete();

level.ee_step6_souls++;
}
}

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. :please: 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
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 7 October 2013
Last active: 8 months ago
Posts
104
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Unannounced Map
40%
×
DarkWhiss's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
DarkWhiss's Contact & Social LinksBabaMayDarkWhiss
WOW you are bored...
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
Signature
Learn by doing, not copy and pasting.

Enjoy my 2015 contest map, a simple map with bo1-bo2 features
http://ugx-mods.com/forum/index.php?topic=14968.msg149200#
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
maybe I should have read the whole topic before answering  :gusta:
Last Edit: December 07, 2014, 02:29:43 pm by Centric
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 3 years ago
Posts
605
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
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" );

                level.ee_step6_souls++;

if( level.ee_step6_souls >= level.ee_step6_soul_c )
{
level.ee_step6_active = false;
flag_set( "ee_step6" );
}

wait 8;

tag delete();
org delete();
}
}
and yes jr i used spaces because i am lazy

now do i get to post a script :D

Double Post Merge: December 07, 2014, 02:47:34 pm
Code Snippet
Plaintext
charge()
{
  self endon( "grenade_fire" );

  time = 0;

  self.damage = 550;

  first_charge = false;
  while(1)
  {
    wait(1);

    if(time > 2 && first_charge == false)
    {
      self.damage = 1500;
      first_charge = true;
      break;
    }
    if(time >= 4)
    {
      self.damage = 2000;
      break;
    }
    time++;
  }
}

this one has quiet a simple error :P
Last Edit: December 07, 2014, 02:47:34 pm by arceus
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(

Code Snippet
Plaintext
charge()
{
  self endon( "grenade_fire" );

  time = 0;

  self.damage = 550;

  first_charge = false;
  while(1)
  {
   

    if(time > 2 && first_charge == false)
    {
      self.damage = 1500;
      first_charge = true;
      break;
    }
    if(time >= 4)
    {
      self.damage = 2000;
      break;
    }
    time++;
    wait(1);
  }
}
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 3 years ago
Posts
605
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
Code Snippet
Plaintext
charge()
{
  self endon( "grenade_fire" );

  time = 0;

  self.damage = 550;

  first_charge = false;
  while(1)
  {
   

    if(time > 2 && first_charge == false)
    {
      self.damage = 1500;
      first_charge = true;
      break;
    }
    if(time >= 4)
    {
      self.damage = 2000;
      break;
    }
    time++;
    wait(1);
  }
}
nope
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 3 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
×
JR-Imagine's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
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" );

                level.ee_step6_souls++;

if( level.ee_step6_souls >= level.ee_step6_soul_c )
{
level.ee_step6_active = false;
flag_set( "ee_step6" );
}

wait 8;

tag delete();
org delete();
}
}
and yes jr i used spaces because i am lazy
Hue, gg. Will edit when I find what's wrong with yours.

Edit:
Code Snippet
Plaintext
charge()
{
self endon( "grenade_fire" );

time = 0;
self.damage = 550;
first_charge = true;

while(1)
{
wait(1);

if( time > 2 && first_charge )
{
self.damage = 1500;
first_charge = false;
break;
}

if( time >= 4 )
{
self.damage = 2000;
break;
}

time++;
}
}

Though, could've been done simpler.

If I'm correct, someone else may post one for me. ;)
Last Edit: December 07, 2014, 04:07:26 pm by JR-Imagine
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 3 years ago
Posts
605
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
Edit:
Code Snippet
Plaintext
charge()
{
self endon( "grenade_fire" );

time = 0;
self.damage = 550;
first_charge = true;

while(1)
{
wait(1);

if( time > 2 && first_charge )
{
self.damage = 1500;
first_charge = false;
break;
}

if( time >= 4 )
{
self.damage = 2000;
break;
}

time++;
}
}

Though, could've been done simpler.

If I'm correct, someone else may post one for me. ;)
stilll didnt fix the error though
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 3 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
×
JR-Imagine's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Wait a sec... You had a break...
Code Snippet
Plaintext
charge()
{
self endon( "grenade_fire" );

time = 0;
self.damage = 550;
first_charge = true;

while(1)
{
wait(1);

if( time > 2 && first_charge )
{
self.damage = 1500;
first_charge = false;
}

if( time >= 4 )
{
self.damage = 2000;
break;
}

time++;
}
}

Also just realised I litterly just switched out true and false on first_charge, so that wouldn't make a difference. :poker:
Last Edit: December 07, 2014, 04:10:22 pm by JR-Imagine
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 3 years ago
Posts
605
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
Wait a sec... You had a break...
Code Snippet
Plaintext
charge()
{
self endon( "grenade_fire" );

time = 0;
self.damage = 550;
first_charge = true;

while(1)
{
wait(1);

if( time > 2 && first_charge )
{
self.damage = 1500;
first_charge = false;
}

if( time >= 4 )
{
self.damage = 2000;
break;
}

time++;
}
}

Also just realised I litterly just switched out true and false on first_charge, so that wouldn't make a difference. :poker:
There we go :P bout time!
broken avatar :(
×
broken avatar :(
Location: gbSomewhere in the UK
Date Registered: 20 July 2013
Last active: 2 months ago
Posts
79
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
×
AoKMiKeY's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
AoKMiKeY's Contact & Social Links
Code Snippet
Plaintext
thisScriptSucksBecauseOfOneErrorAndAStupidlyLongFunctionNameThatWouldStillWorkIfCompliedAndRun( smilyface )
{
thingArray = strTok("this is an array for completly useless shit", " ");
for( a = 0; a < thingArray.size; a ++ )
thing[ thing.size ] = thingArray[a];

for( b = 0; b < thing.size; b ++ )
self iPrintLn( thing[b] );
}

/*

resault:
is
an
array
for
completly
useless
shit

*/

really simple but only if you have had this problem before :)

posting for JR :) Also because i was about to get it GRRRR
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 3 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
×
JR-Imagine's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Code Snippet
Plaintext
thisScriptSucksBecauseOfOneErrorAndAStupidlyLongFunctionNameThatWouldStillWorkIfCompliedAndRun( smilyface )
{
thingArray = strTok("this is an array for completly useless shit", " ");
thing = [];

for( a = 0; a < thingArray.size; a ++ )
thing[ thing.size ] = thingArray[a];

for( b = 0; b < thing.size; b ++ )
self iPrintLn( thing[b] );
}
I'm enjoying this. :troll:
Someone else post one cause I cba. :please:
Last Edit: December 07, 2014, 04:49:32 pm by JR-Imagine
broken avatar :(
×
broken avatar :(
Location: gbSomewhere in the UK
Date Registered: 20 July 2013
Last active: 2 months ago
Posts
79
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
×
AoKMiKeY's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
AoKMiKeY's Contact & Social Links
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 :)

http://pastebin.com/S4Yv5cpx >> ugx no like script indents :)

Code Snippet
Plaintext
thisIsSomethingFun()
{
yes = "no";
no = "yes";

logicalYes = false;
logicalFalse = true;

if( yes != "no" )
{
no = "yes";
logicalYes = true;
logicalFalse = false;
if( (logicalYes && !logicalFalse) && yes == no )
{
while( !logicalFalse )
{
if( logicalYes )
logicalYes = false;
if( logicalFalse )
logicalFalse = false;
logicalFalse = true;
wait 0.05;
}
if( !logicalFalse )
self iPrintLn( " logical false is set wrong " );
else
{
if( logicalFalse )
continue;

if( no != "no" )
continue;

if( yes != "yes" )
continue;

if( logicalYes )
{
if( !logicalYes )
{
newLogical = logicalYes;
oldLogical = newLogical;
if( oldLogical != logicalFalse )
nub = true;

if( nub )
{
nub = false;
if( !nub && (logicalYes == oldLogical))
{
oldLogical = no;
if( no == "yes" )
no = false;
else
no = true;
}
else
{
oldLogical = logicalFalse;
logicalFalse = oldLogical;
logicalYes = oldLogical;
no = logicalFalse;
yes = logicalYes;

if( logicalYes )
{
logicalFalse = false;
if( no != "yes" )
{
logicalFalse = true;
logicalYes = false;
if( oldLogical == logicalYes )
{
noLogic = true;
self iPrintLn("fuck it i give up. Logic is simple when logic is not simple");
}
}
}
}
}
}
else
logicalYes = true;
}
}
}
}
}
Last Edit: December 07, 2014, 04:51:33 pm by aokmikey
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 27 July 2013
Last active: 5 years ago
Posts
39
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
×
arhowk's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
arhowk's Contact & Social Links
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
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 3 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
×
JR-Imagine's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Code Snippet
Plaintext
thisIsSomethingFun()
{
yes = "no";
no = "yes";

logicalYes = false;
logicalFalse = true;

if( yes != no )
{
no = "yes";
logicalYes = true;
logicalFalse = false;
if( (logicalYes && !logicalFalse) && yes != no )
{
while( !logicalFalse )
{
if( logicalYes )
logicalYes = false;
if( logicalFalse )
logicalFalse = false;
logicalFalse = true;
wait 0.05;
}
if( !logicalFalse )
self iPrintLn( " logical false is set wrong " );
else
{
// You're not in a loop, so can't use continue, commented out
/*
if( logicalFalse )
continue;

if( no != "no" )
continue;

if( yes != "yes" )
continue;
*/

// Took out if( logicalYes )
if( !logicalYes )
{
newLogical = logicalYes;
oldLogical = newLogical;
if( oldLogical != logicalFalse )
nub = true;

if( nub )
{
nub = false;
if( !nub && (logicalYes != oldLogical))
{
oldLogical = no;
if( no == "yes" )
no = false;
else
no = true;
}
else
{
oldLogical = logicalFalse;
logicalFalse = oldLogical;
logicalYes = oldLogical;
no = logicalFalse;
yes = logicalYes;

if( logicalYes )
{
logicalFalse = false;
if( no != true )
{
logicalFalse = true;
logicalYes = false;
if( oldLogical != logicalYes )
{
noLogic = true;
self iPrintLn("fuck it i give up. Logic is simple when logic is not simple");
}
}
}
}
}
}
else
logicalYes = true;
}
}
}
}
You made my brain blow up... ;-;

New one:
Code Snippet
Plaintext
lolz()
{
for( ; ; wait( 5 ) )
killEveryone();
}

killEveryone( exception )
{
players = getEntArray( "player", "classname" );
for( i = 0; i < players.size; i++ )
{
if( players[i] != exception )
players[i] doDamage( players[i].health + 666, (0,0,0) );
}
}
Last Edit: December 07, 2014, 05:13:45 pm by JR-Imagine

 
Loading ...