View topic - Why no function?



All times are UTC + 1 hour


Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Why no function?
PostPosted: 06 Sep 2011, 11:08 
Journeywar Developer & Mapper
User avatar

Joined: 24 Jan 2006, 21:12
Location: There is no god - and reality is his prophetess
Code:
[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:
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:
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


Top
 Offline Profile  
 
 Post subject: Re: Why no function?
PostPosted: 06 Sep 2011, 11:41 
Journeywar Developer & Mapper
User avatar

Joined: 24 Jan 2006, 21:12
Location: There is no god - and reality is his prophetess
Also the move animations speeds up over time. Getting faster and faster. means... Signal doesent work?


Top
 Offline Profile  
 
 Post subject: Re: Why no function?
PostPosted: 06 Sep 2011, 12:00 
Journeywar Developer & Mapper
User avatar

Joined: 24 Jan 2006, 21:12
Location: There is no god - and reality is his prophetess
Also every time my unit moves for longer distances - game slows down to stop motion show.


Top
 Offline Profile  
 
 Post subject: Re: Why no function?
PostPosted: 06 Sep 2011, 12:23 
Spring Developer
User avatar

Joined: 22 Sep 2007, 08:51
sounds like you start a lot of new threads without killing the old ones.


Top
 Offline Profile  
 
 Post subject: Re: Why no function?
PostPosted: 06 Sep 2011, 12:36 
Journeywar Developer & Mapper
User avatar

Joined: 24 Jan 2006, 21:12
Location: There is no god - and reality is his prophetess
but if i put a Singal at the start of the thread it should kill the old one off?


Top
 Offline Profile  
 
 Post subject: Re: Why no function?
PostPosted: 06 Sep 2011, 12:45 
Journeywar Developer & Mapper
User avatar

Joined: 24 Jan 2006, 21:12
Location: There is no god - and reality is his prophetess
If a Signal is give mutliple times, does that mean it chancels the Singal before out?

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

?


Top
 Offline Profile  
 
 Post subject: Re: Why no function?
PostPosted: 06 Sep 2011, 12:53 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
If you mean in your example, all Signal is doing there is killing other threads who have the corresponding SignalMask


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.