Author |
Message |
carnaxcce
Joined: Sun Jul 04, 2010 8:09 pm Posts: 12
|
Re: Setting mass in lua.
@MLC, yes. You need Administrator privileges to run B23. So I just copied all the files over. I've been using stuff that uses lua with no problems...
EDIT: After I put the lua at the particle, it worked. Could copying all the files from B23 to B22 made it so I can use lua?
|
Mon Jul 05, 2010 12:03 am |
|
|
CrazyMLC
Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
|
Re: Setting mass in lua.
Maybe all that was changed to include lua was content in dll files and stuff like that. It's possible.
|
Mon Jul 05, 2010 12:23 am |
|
|
carnaxcce
Joined: Sun Jul 04, 2010 8:09 pm Posts: 12
|
Re: Setting mass in lua.
That's probably what it was. In the frameworks, it has a bunch of files that, well, i dunno what they do. Still, they probably changed from B22 to B23. After all, I did change ALL of the data files it accessed.
EDIT: Yeah, if you change the resource files with another program, it becomes that program. Thus, I'm running B23 under the name of B22. Interesting...
|
Mon Jul 05, 2010 1:33 am |
|
|
Dylanhutch
Joined: Sun Apr 25, 2010 12:04 am Posts: 303 Location: Australia
|
Re: Setting mass in lua.
Also, how would I make an actor gain health? <edit> At say 1 hp/sec</edit>
I have searched so much but can't find the code, and the wiki is broken. I really think we should have a forum wiki.
|
Mon Jul 05, 2010 1:41 pm |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Setting mass in lua.
function Update(self) if self.hptimer == nil then self.hptimer = Timer(); elseif self.hptimer:IsPastSimMS(1000) == true then self.hptimer:Reset(); self.Health = self.Health + 1; end end
|
Mon Jul 05, 2010 1:57 pm |
|
|
Dylanhutch
Joined: Sun Apr 25, 2010 12:04 am Posts: 303 Location: Australia
|
Re: Setting mass in lua.
Um... Any way to stop it healing when health is more than 100?
Oh and, I tried 'if self.health < 100 then'
|
Tue Jul 06, 2010 5:19 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Setting mass in lua.
You probably didn't try hard enough. Change
elseif self.hptimer:IsPastSimMS(1000) == true then
to
elseif self.hptimer:IsPastSimMS(1000) == true and self.Health < 100 then
|
Tue Jul 06, 2010 5:22 am |
|
|
Dylanhutch
Joined: Sun Apr 25, 2010 12:04 am Posts: 303 Location: Australia
|
Re: Setting mass in lua.
Thanks. It worked I tried that 2 minutes ago, but i used: Code: function Update(self) if self.hptimer == nil then self.hptimer = Timer(); elseif self.hptimer:IsPastSimMS(1000) == true and self.health < 100 then self.hptimer:Reset(); self.Health = self.Health + 1; end end
|
Tue Jul 06, 2010 5:27 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Setting mass in lua.
In your non-working script, Code: self.health < 100 then self.hptimer:Reset(); self.Health = self.Health + 1; needed to be Code: if self.health < 100 then self.hptimer:Reset(); self.Health = self.Health + 1; end You forgot the "if" and the "end".
|
Tue Jul 06, 2010 5:41 am |
|
|
TheLastBanana
DRL Developer
Joined: Wed Dec 13, 2006 5:27 am Posts: 3138 Location: A little south and a lot west of Moscow
|
Re: Setting mass in lua.
Health should also have been capitalized.
|
Tue Jul 06, 2010 5:43 am |
|
|
Awesomeness
Joined: Sat Jun 19, 2010 5:02 pm Posts: 331 Location: Mekkan
|
Re: Setting mass in lua.
I'm not and administrator on my Mac, and I run B23 just fine...
|
Thu Jul 15, 2010 7:44 pm |
|
|
carnaxcce
Joined: Sun Jul 04, 2010 8:09 pm Posts: 12
|
Re: Setting mass in lua.
I got what I was doing to work, with a few changes: 1. I use the Autocannon now, since the missle was propelled, and changing it's mass had next to no effect. 2. The code now reads: Quote: function Create(self) local endmass = self.Mass^16 end
function Update(self) self.Mass = self.Mass^2; if self.Mass > endmass then self:GibThis(); end end What happens is the rounds fire, then after a few seconds fall slowly, and the smoke trail makes 'em look like streamers. A few more gibs to add some oomph, and it's done.
|
Sat Jul 17, 2010 5:38 pm |
|
|
|