View unanswered posts | View active topics It is currently Thu Dec 26, 2024 6:14 pm



Reply to topic  [ 66 posts ]  Go to page 1, 2, 3, 4, 5  Next
 Lua 
Author Message
User avatar

Joined: Fri Jul 13, 2007 12:11 pm
Posts: 15
Location: Xera
Reply with quote
Post Lua
I think CC would be a lot better off if it used Lua as its scripting language, it's a lot more flexible and easier to understand(And read :wink: ) and would allow for people to create much more complex stuff than currently possible.

What do you think?


Heh, my first post is a suggestion.. :grin:


Fri Jul 13, 2007 9:37 pm
Profile
User avatar

Joined: Wed May 02, 2007 10:27 pm
Posts: 514
Location: Eating ice cream at Graeter's
Reply with quote
Post Re: Lua
I think its fine as is, but there is always room for improvement, however; I think we have gotten used to how it is now.


Fri Jul 13, 2007 9:39 pm
Profile

Joined: Mon Dec 04, 2006 3:34 am
Posts: 2378
Reply with quote
Post Re: Lua
Putting in lua would require a bunch of work for payoff that Data probably doesn't need.


Fri Jul 13, 2007 9:41 pm
Profile
Forum Moderator
User avatar

Joined: Fri Feb 02, 2007 3:53 pm
Posts: 1896
Location: in my little gay bunker
Reply with quote
Post Re: Lua
Lua isnt "easy to understand" if you cant understand simple variables, you have no chance to do ANYTHING in Lua


Fri Jul 13, 2007 11:59 pm
Profile
User avatar

Joined: Sat Apr 28, 2007 3:22 pm
Posts: 493
Reply with quote
Post Re: Lua
Once I saw Lua code, I was baffled. Much later I found Cortex Command code, and I could at least understand the variables well enough on my own.


Sat Jul 14, 2007 12:19 am
Profile
User avatar

Joined: Tue Oct 31, 2006 6:10 pm
Posts: 358
Location: at ze kopta!
Reply with quote
Post Re: Lua
I'm fine by how the script works currently. No need to change it. (well for my opinion)


Sat Jul 14, 2007 3:00 am
Profile
Banned
User avatar

Joined: Tue Feb 27, 2007 4:05 pm
Posts: 2527
Reply with quote
Post Re: Lua
The code base requires more comments, or at least someone should post an indepth description of each variable possible.


Sat Jul 14, 2007 4:25 am
Profile YIM
User avatar

Joined: Fri Jul 13, 2007 12:11 pm
Posts: 15
Location: Xera
Reply with quote
Post Re: Lua
IMO the current system is messy as hell - It's basically just a bunch of variables, sure, it's easy as moving an eye lid but it's inefficient and messy.


Sat Jul 14, 2007 7:24 pm
Profile

Joined: Sun Jun 24, 2007 6:13 am
Posts: 505
Reply with quote
Post Re: Lua
It takes finnesse to make it efficient. You just haven't done enough for it to be easy and clean.


Sat Jul 14, 2007 7:26 pm
Profile
User avatar

Joined: Fri Jul 13, 2007 12:11 pm
Posts: 15
Location: Xera
Reply with quote
Post Re: Lua
Pyrorex wrote:
It takes finnesse to make it efficient. You just haven't done enough for it to be easy and clean.

Seriously, how can you say something like
Code:
AddAmmo = Round
   InstanceName = Round Supreme Blast
   ParticleCount = 4
   Particle = MOPixel
      InstanceName = Particle Supreme Digger
      Mass = 0.2
      RestThreshold = 500
      LifeTime = 20
      Sharpness = 28
      HitsMOs = 1
      GetsHitByMOs = 0
      Color = Color
         R = 35
         G = 171
         B = 255
      Atom = Atom
         Material = Material
            CopyOf = Bullet Metal
         TrailColor = Color
            R = 35
            G = 171
            B = 255
         TrailLength = 10
   Shell = None
   FireVelocity = 95
   ShellVelocity = 10
   Separation = 10

AddAmmo = Round
   InstanceName = Round Very Supreme Blast
   ParticleCount = 4
   Particle = MOPixel
      InstanceName = Particle Very Supreme Digger
      Mass = 0.35
      RestThreshold = 500
      LifeTime = 20
      Sharpness = 28
      HitsMOs = 1
      GetsHitByMOs = 0
      Color = Color
         R = 255
         G = 255
         B = 255
      Atom = Atom
         Material = Material
            CopyOf = Bullet Metal
         TrailColor = Color
            R = 255
            G = 255
            B = 255
         TrailLength = 10
   Shell = None
   FireVelocity = 95
   ShellVelocity = 10
   Separation = 10

isn't messy?

Compared to this
Code:
if(SERVER) then

   AddCSLuaFile("autorun/healthfix.lua")

   function UpdateHealth()
   
      local Ents = ents.GetAll()
   
      for k,v in pairs(Ents) do
      
         if(v:GetHealth() != v:Health()) then
            
            v:SetNWFloat("hp", v:Health())
            
         end
         
         if(v:GetNWMaxHealth() != v:GetMaxHealth()) then
         
            v:SetNWFloat("maxhp", v:GetMaxHealth())
         
         end
      
      end
   
   end

   hook.Add("Think", "HealthThink", UpdateHealth)
   
end

local meta = FindMetaTable("Entity")

function meta:GetHealth()

   local hp = self:GetNWFloat("hp")

   return hp

end

function meta:GetNWMaxHealth()

   local mhp = self:GetNWFloat("maxhp")
   
   return mhp

end

if(CLIENT) then

   local function hphud()
   
      if(!LocalPlayer():Alive()) then return end
   
      local TR = LocalPlayer():GetEyeTrace()

      if(TR.HitWorld || !TR.Entity || !TR.Entity:IsValid()) then return end

      local sw,sh = ScrW(), ScrH()
      
      --draw.RoundedBox( 0, sw/2-53.5, sh/2-20, 107, 40, Color(173,255,47,200))
      
      local String1 = ""
      
      if(TR.Entity:IsPlayer()) then
         String1 = TR.Entity:GetName()
      else
         String1 = TR.Entity:GetClass()
      end
      
      local Percent = TR.Entity:GetHealth() / TR.Entity:GetNWMaxHealth()
      
      --print(Percent)
      
      Percent = Percent*100
      
      local Colour = Color((Percent*100)*4,0,math.fmod(255,(Percent*100)*3))
      
      draw.RoundedBox(0, (sw/2)-Percent, sh/2+20, Percent*2, 10, Colour)
      
      local Text = {}
      Text.text = "Name: "..String1
      Text.font = "GModWorldTip"
      Text.xalign = TEXT_ALIGN_CENTER
      Text.yalign = TEXT_ALIGN_CENTER
      Text.pos = {sw/2, sh/2-60}
      Text.color = Color(0,0,0,255)
      draw.Text(Text)
      
      Text.text = TR.Entity:GetHealth()
      Text.pos[2] = sh/2-40
      draw.Text(Text)
         
   end
   
   hook.Add("HUDPaint", "hphud", hphud)

end

Yeah, that's for a completely different game but the same principle could be applied to CC.


Sat Jul 14, 2007 7:30 pm
Profile

Joined: Mon Dec 04, 2006 3:34 am
Posts: 2378
Reply with quote
Post Re: Lua
It would take a lot of work to put in lua, and Data doesn't need anything near as powerful as lua for CC. Not to mention we are comparing apples to oranges here. CC's .inis are just variables, not code, not script, used properly you can emulate script... but that's not exactly it's real purpose. We can't see the scripts or code of CC right now. Lua is a rather different thing than our beloved .ini files.


Sat Jul 14, 2007 7:34 pm
Profile
Banned
User avatar

Joined: Tue Feb 27, 2007 4:05 pm
Posts: 2527
Reply with quote
Post Re: Lua
Also, I like working with a higher-level "language." That is--to be very similar to English. If I wanted to code in assembly, I would.


Sat Jul 14, 2007 9:17 pm
Profile YIM
User avatar

Joined: Sun Dec 03, 2006 4:00 am
Posts: 578
Location: America
Reply with quote
Post Re: Lua
Alenth wrote:
It would take a lot of work to put in lua, and Data doesn't need anything near as powerful as lua for CC. Not to mention we are comparing apples to oranges here. CC's .inis are just variables, not code, not script, used properly you can emulate script... but that's not exactly it's real purpose. We can't see the scripts or code of CC right now. Lua is a rather different thing than our beloved .ini files.


Yep, yep, yep.


Sun Jul 15, 2007 12:56 am
Profile WWW
User avatar

Joined: Tue Dec 26, 2006 9:35 am
Posts: 481
Reply with quote
Post Re: Lua
I can't even understand the Lua code. I probably could learn it if I wanted to, but I don't think Cortex Command needs it. The .inis are fine, in my opinion.


Sun Jul 15, 2007 1:27 am
Profile
User avatar

Joined: Sun Mar 18, 2007 5:35 am
Posts: 3778
Location: Largo, Florida
Reply with quote
Post Re: Lua
Lua is easy to learn, but it's not necessary for ANY 2d game that people want to learn to mod. Anything lua can do we can emulate with variables.


Sun Jul 15, 2007 2:56 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 66 posts ]  Go to page 1, 2, 3, 4, 5  Next

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