Special Hud thing

Topics regarding Scripting with Reality Factory
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Re: Special Hud thing

Post by Jay » Wed Oct 07, 2009 11:27 pm

It says it found an error in line 12 of the 'Spawn' order, but that's bogus, becaue in neither script posted here the 'Spawn' order has 12 lines. Did you modify the script further on?

I just tested the script, made a few adjustments, and it ran just fine...
The final script:

Code: Select all

{
	INCREASETIMER	[0]
	TIMERAMOUT   [1.0] 
	Spawn[ ()
	{
		Console(true);
		LowLevel("Keycheck");
	} ]

	Keycheck[ ()
	{
		if(INCREASETIMER < self.time)
		{
			if (IsKeyDown(46))
			{
				ModifyAttribute("speed", 5,"Player");
			}
			else
			{
				ModifyAttribute("speed", -5,"Player");
			}
			INCREASETIMER = self.time + StringCopy(TIMERAMOUT);
		}
		debug(GetAttribute("speed", "Player"));
	} ]
}
Everyone can see the difficult, but only the wise can see the simple.
-----

User avatar
GMer
Posts: 329
Joined: Thu Oct 25, 2007 4:49 pm
Location: On the rock in the 3rd solar orbit.

Re: Special Hud thing

Post by GMer » Thu Oct 08, 2009 3:59 am

Ah ha! I know what I did wrong!
I forgot to define a variable :P
Thanks Jay!
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