Sign in to follow this  
Followers 0
atrX

Find the Error

45 posts in this topic

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". :dave:

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. :dumb: Triton, Lossy, Purity and me facepalmed (and had a giggle) after finding out what was wrong with it.

0

Share this post


Link to post
Share on other sites

Why this thread slaya

 

why

 

 

/sorry for this comment, I can imagine how much some of you love to code

Edited by QueNNch
0

Share this post


Link to post
Share on other sites

Why this thread slaya

 

why

 

 

/sorry for this comment, I can imagine how much some of you love to code

Lossy's idea. :dumb:

0

Share this post


Link to post
Share on other sites

In the initial IF statement you've set 

level.ee_step6_souls < level.ee_step6_soul_c

as a condition, yet later on you've done

level.ee_step6_souls >= level.ee_step6_soul_c

It can't be both so nothing happens after the second statement?

 

 

 

maybe? :okay:

0

Share this post


Link to post
Share on other sites

Negative, if level.ee_step6_soul_c is less than level.ee_step6_souls, it will carry on, but you're close :dave:

0

Share this post


Link to post
Share on other sites


	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 )
	

Your parentheses are wrong in here? I'm going out on a limb and saying because of this line above has a <. And in typical math(I'm guessing computers compute math the same way, your < is only using the level.ee_step6_souls in the inequality statement. If you're trying to get the WHOLE line to be less than level.ee_step6_soul_c, then you'd have to have another set of parentheses, like this.

 

    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 )

 

That way, the whole beginning is included in the inequality statement instead of just level.ee_step6_souls < level.ee_step6_soul_c

 

inb4 I'm 100% completely wrong and have no idea what I"m talking about :dumb:

0

Share this post


Link to post
Share on other sites

Even I know what it is and I don't script :dumb:

Cause I told you. :dumb:

0

Share this post


Link to post
Share on other sites

Cause I told you. :dumb:

Meant to upvote :okay:

0

Share this post


Link to post
Share on other sites

I'll post the answer in a couple hours if no one has found it by then so we can have someone else post. :dave:

0

Share this post


Link to post
Share on other sites

lol it's this

 

 

if( isDefined( level.ee_step6_active ) && level.ee_step6_active

 

0

Share this post


Link to post
Share on other sites

lol it's this

 

Should be like this if I'm not wrong? xD

if( isDefined( level.ee_step6_active ) && level.ee_step6_soul_c
0

Share this post


Link to post
Share on other sites

lol it's this

You sure? Cause there's nothing wrong with that. :dave:

Should be like this if I'm not wrong? xD

if( isDefined( level.ee_step6_active ) && level.ee_step6_soul_c
That doesn't even make sense, if you look further in the script it should become clear that level.ee_step6_souls and level.ee_step6_soul_c are integers, but you're using level.ee_step6_soul_c as if it was a boolean.

Edit: As Lossy said, Sentrex is really close, might wanna take a look at what he said.

0

Share this post


Link to post
Share on other sites

motherfucker just tell us lol. it's probably something obvious that I didn't notice, because everything looks fine with that.

0

Share this post


Link to post
Share on other sites

leedle its so obvious, we all had a giggle in ts3 when he showed us the mistake :troll: all u nublet scripters will be kicking urselfs for not seeing it

0

Share this post


Link to post
Share on other sites

umm.. 

self isTouching( level.ee_step6_radius )

when the player is dead :dave: ?

tag enableLinkTo();

is not needed :dave: ?

level.ee_step6_souls++;

is after a loooong wait :kingdave: ?

 

I DONT KNOW!!!! :ANGRYARNOLD: TELL ME!

0

Share this post


Link to post
Share on other sites

ehh, i'm not sure, but is tag_origin a model? xD

 

tag setModel( "tag_origin" );

 

Also i don't understand this? 

 

if( isDefined( level.ee_step6_active ) && level.ee_step6_active

 

Bare in mind i aint scripted in a long time so i am nub nub x)

 

 

0

Share this post


Link to post
Share on other sites

ehh, i'm not sure, but is tag_origin a model? xD

 

tag setModel( "tag_origin" );

 

Also i don't understand this? 

 

if( isDefined( level.ee_step6_active ) && level.ee_step6_active

 

Bare in mind i aint scripted in a long time so i am nub nub x)

tag_origin is a model, dunno why its used though... maybe for playFXOnTag()

 

the if thingy checks that the variable is defined and its 'true' :sir:

0

Share this post


Link to post
Share on other sites

tag_origin is a model, dunno why its used though... maybe for playFXOnTag()

 

the if thingy checks that the variable is defined and its 'true' :sir:

My bad, i thought if something is defined is has the value of true :3 told u i was nub

0

Share this post


Link to post
Share on other sites

Bare in mind i aint scripted in a long time so i am nub nub x)

ALSO, YOU MISSPELLED THE WORD 'BEAR' !!!! :angryarnold: AAARGGGHHH!!!

0

Share this post


Link to post
Share on other sites

OK it makes sense, this is a zombies map, if you die the game is over!!! therefore, if you wait until death the game has ended and the rest of the thread will be useless EASY! (unless it's multiplayer  :okay: )

0

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0