Page 1 of 1

Throwing things...

Posted: Wed Mar 17, 2010 2:48 am
by GMer
I am currently stumped...
I am trying to make a pawn fly away from the player when the right button is pressed (left button plays an animation), and after a certain amount of time have it fly back to the player after 10 seconds.
I have something like this so far. How far off am I?

Code: Select all

{
	K_FIRE		[72] ;Slashing button
	K_THROW		[73] ;Throwing button
	SLASH		[slash] ;attacking animation
	THROWINGANIM	[spinning} ;throwing animation (spinning)
	SWORDSPEED	[256] ;Sword throwing speed
	ROTSPEED	[90]
	INCREASETIMER	[1]
	TIMERAMOUNT	[1]

	Spawn[()
	{
		Console(true);
		NewOrder(KEYFUNCTIONS);
	}

	KEYFUNCTIONS[()
	{
		if (IsKeyDown(K_FIRE))
		{
			Animate(SLASH)
			RestartOrder();;
		}
		if (IsKeyDown(K_THROW))
		{
			if (SPEED = 0)
			{
				self.yaw=self.player_yaw
				self.pitch=self.player_pitch
				SPEED=Integer(SWORDSPEED)
				NewOrder(Throwing);;
			}
		;;
		}
	}]

	THROWING[()
	{
		if(INCREASETIMER < self.time)
      		{
        		INCREASETIMER = self.time + StringCopy(TIMERAMOUT);;
      		}

		if(INCREASETIMER = 10)
		{
	  		RotateToPlayer(THROWINGANIM,ROTSPEED,true,SWOOSH);;
		}

		if (self.player_range>96)
		{
			;
			}
			else
			{
			NewOrder(KEYFUNCTIONS);
			}
		}
	RestartOrder()
	}