View unanswered posts | View active topics It is currently Thu Apr 25, 2024 3:42 pm



Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
 Timer 
Author Message
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Timer
Lord Tim wrote:
I haven't tried, but leaving out the Destory(self) could infact break it. These aren't real lua scripts. They're parsed by Data's C++ code, and the functions are added to the C++ objects. If it doesn't find one of the functions that it is expecting, that could break it.


Then how come my dozens of shitty scripts run fine without it?


Mon May 25, 2009 8:38 am
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Timer
it was probably just mind's syntax or capitalisation.


Mon May 25, 2009 11:21 am
Profile WWW
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1359
Location: USA
Reply with quote
Post Re: Timer
Hm. But i had something without the destroy function, and it didnt work. I guess ill have to try it again.

Ill post the code later after i make it again because the code was on my other computer, but im in another state now :p


Mon May 25, 2009 5:39 pm
Profile
User avatar

Joined: Fri Apr 27, 2007 4:55 pm
Posts: 1178
Location: America!
Reply with quote
Post Re: Timer
Grif wrote:
Lord Tim wrote:
I haven't tried, but leaving out the Destory(self) could infact break it. These aren't real lua scripts. They're parsed by Data's C++ code, and the functions are added to the C++ objects. If it doesn't find one of the functions that it is expecting, that could break it.


Then how come my dozens of crap scripts run fine without it?


Well technically, that's bad syntax, not the other way around.


Mon May 25, 2009 6:02 pm
Profile
User avatar

Joined: Fri Jan 26, 2007 3:22 am
Posts: 1451
Reply with quote
Post Re: Timer
Lord Tim wrote:
Grif wrote:
Lord Tim wrote:
I haven't tried, but leaving out the Destory(self) could infact break it. These aren't real lua scripts. They're parsed by Data's C++ code, and the functions are added to the C++ objects. If it doesn't find one of the functions that it is expecting, that could break it.


Then how come my dozens of crap scripts run fine without it?


Well technically, that's bad syntax, not the other way around.


Well technically, I think your book of technicalities must be retarded, as including an empty function when it can work without it is most definitely bad syntax.


Tue May 26, 2009 1:25 am
Profile
User avatar

Joined: Thu Mar 06, 2008 10:54 pm
Posts: 1359
Location: USA
Reply with quote
Post Re: Timer
So what could be wrong with this?

Code:
function Create(self)
   self.timer = Timer()
end

function Update(self)
   for actor in MovableMan.Actors do
      if actor.team ~= self.team then
         actor.PinStrength = 9999
      if self.timer:IsPastSimMS(3000) then
         actor.PinStrength = 0
      end
      end
   end
end

and this didnt work either

function Create(self)
   self.timer = Timer()
end

function Update(self)
   for actor in MovableMan.Actors do
      if actor.team ~= self.team then
         actor.PinStrength = 9999
         if self.timer:IsPastSimMS(3000) then
            actor.PinStrength = 0
         end
      end
   end
end




Btw: they dont even get pinned.


Tue May 26, 2009 2:59 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 21 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users


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 © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.065s | 15 Queries | GZIP : Off ]