Throwing things...

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
GMer
Posts: 329
Joined: Thu Oct 25, 2007 4:49 pm
Location: On the rock in the 3rd solar orbit.

Throwing things...

Post by GMer » Wed Mar 17, 2010 2:48 am

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()
	}
Over 3 years (has it been that long?) and just now I noticed the day and month of my birthday were switched. Whoops!

Some 2d games I made, haven't made anything in a year though O.o
http://www.yoyogames.com/users/GMer56

Post Reply