Why no function?

Why no function?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Why no function?

Post 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
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Why no function?

Post by PicassoCT »

Also the move animations speeds up over time. Getting faster and faster. means... Signal doesent work?
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Why no function?

Post by PicassoCT »

Also every time my unit moves for longer distances - game slows down to stop motion show.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Why no function?

Post by hoijui »

sounds like you start a lot of new threads without killing the old ones.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Why no function?

Post by PicassoCT »

but if i put a Singal at the start of the thread it should kill the old one off?
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Why no function?

Post 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

?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Why no function?

Post by FLOZi »

If you mean in your example, all Signal is doing there is killing other threads who have the corresponding SignalMask
Post Reply

Return to “Game Development”