Page 1 of 1

Why no function?

Posted: 06 Sep 2011, 12:08
by PicassoCT

Code: Select all

[string "scripts/tiglilscript.lua"]:729: in function <[string "scripts/tiglilscript.lua"]:720>
[f=0000479] [string "scripts/tiglilscript.lua"]:729: attempt to call global 'legs_down' (a nil value)
This.. what does this error message mean? Im fresh out of ideas.

Code: Select all

local function legs_down()
	
				
		Turn(tigLil,y_axis,math.rad(0),3)
		Turn(tigLil,z_axis,math.rad(0),3)	
		Turn(tlHead,x_axis,math.rad(0),2)
		Turn(tlHead,y_axis,math.rad(0),2)
		Turn(tlHead,z_axis,math.rad(0),2)
		Turn(tlhairup,x_axis,math.rad(-74),2)
		Turn(tlhairup,y_axis,math.rad(0),2)
		Turn(tlhairup,z_axis,math.rad(0),2)
		Turn(tlhairdown,x_axis,math.rad(-19),3)
		Turn(tllegUp,x_axis,math.rad(0),2)
		Turn(tllegUp,y_axis,math.rad(0),2)
		Turn(tllegUp,z_axis,math.rad(0),2)
		Turn(tllegLow,x_axis,math.rad(0),2)
		Turn(tllegLow,y_axis,math.rad(0),2)
		Turn(tllegLow,z_axis,math.rad(0),2)
		Turn(tllegUpR,x_axis,math.rad(0),2)
		Turn(tllegUpR,y_axis,math.rad(0),2)
		Turn(tllegUpR,z_axis,math.rad(0),2)
		Turn(tllegLowR,x_axis,math.rad(0),2)
		Turn(tllegLowR,y_axis,math.rad(0),2)
		Turn(tllegLowR,z_axis,math.rad(0),2)
		Sleep(85)
		WaitForTurn(tlhairup,x_axis)   
		WaitForTurn(tlhairup,y_axis)   
		WaitForTurn(tlhairup,z_axis)   
		WaitForTurn(tlhairdown,x_axis)
		WaitForTurn(tllegUp,x_axis)   
		WaitForTurn(tllegUp,y_axis)   
		WaitForTurn(tllegUp,z_axis)   
		WaitForTurn(tllegLow,x_axis) 
		WaitForTurn(tllegLow,y_axis) 
		WaitForTurn(tllegLow,z_axis) 
		WaitForTurn(tllegUpR,x_axis)
		WaitForTurn(tllegUpR,y_axis)
		WaitForTurn(tllegUpR,z_axis)
		WaitForTurn(tllegLowR,x_axis)   
		WaitForTurn(tllegLowR,y_axis)   
		WaitForTurn(tllegLowR,z_axis)   

end
Cant see any evil in this...

This calls it... not evilz in it either..

Code: Select all

local function idle()
	Signal(SIG_HAIRWIND)
	Signal(SIG_WALK)
	Signal(SIG_WHIR)
	Signal(SIG_SWING)
	Signal(SIG_IDLE)
	
	SetSignalMask(SIG_IDLE)
	while(true) do
				legs_down()
				Sleep(285)
				Sleeper=Sleeper+1
				Sleeper=Sleeper%5
				tempsleep=math.random(512,4096)
					if Sleeper==0 then
					Sleep(tempsleep)
					idle_stance2()
					end
						if Sleeper==1 then
						Sleep(tempsleep)
						idle_stance()
						end
							if Sleeper==2 then
							Sleep(tempsleep)
							idle_stance3()
							end
								if Sleeper==3 then
								Sleep(tempsleep)
								idle_stance4()
								end
									if Sleeper==4 then
									Sleep(tempsleep)
									idle_stance5()
									end
				
				end
end

Re: Why no function?

Posted: 06 Sep 2011, 12:41
by PicassoCT
Also the move animations speeds up over time. Getting faster and faster. means... Signal doesent work?

Re: Why no function?

Posted: 06 Sep 2011, 13:00
by PicassoCT
Also every time my unit moves for longer distances - game slows down to stop motion show.

Re: Why no function?

Posted: 06 Sep 2011, 13:23
by hoijui
sounds like you start a lot of new threads without killing the old ones.

Re: Why no function?

Posted: 06 Sep 2011, 13:36
by PicassoCT
but if i put a Singal at the start of the thread it should kill the old one off?

Re: Why no function?

Posted: 06 Sep 2011, 13:45
by PicassoCT
If a Signal is give mutliple times, does that mean it chancels the Singal before out?

Like Signal ==true
Signal == false
Signal ==true

?

Re: Why no function?

Posted: 06 Sep 2011, 13:53
by FLOZi
If you mean in your example, all Signal is doing there is killing other threads who have the corresponding SignalMask