Data Realms Fan Forums
http://forums.datarealms.com/

On Lua (Some tips)
http://forums.datarealms.com/viewtopic.php?f=73&t=11230
Page 1 of 1

Author:  Grif [ Sat May 17, 2008 12:14 am ]
Post subject:  On Lua (Some tips)

1. It's Lua. It's not an acronym, it's a noun. Don't abbreviate it, and don't capitalize every letter.

2. Build 23 is out. Whoop de doo, Lua on everything. This does not mean .ini modding is obsolete, nor will it ever.

3. Lua will add many possibilities to modding. That said, we don't need anyone to tell us new ideas. Not for a while. Don't post any new idea topics of things to do in Lua. Modders who know how to use it will get the process started. STILL APPLIES

4. Something being technically possible in Lua does not equate to something being technically feasible in Lua.
4a. Just because something can be made does not mean someone will make it for you.
4b. Your own incompetence is not grounds to make an idea thread or whine to someone about "x mod" not being made.

5. Lua scripting will NOT overtake the traditional CC .ini files. It is a seperate language, it will NOT BE REQUIRED for mods. It will not overwrite mod files, and will only serve as an addition to the game; not an overhauling. The correct term for what's done in Lua is scripting. The .ini file modification is correctly referred to as modding. STILL APPLIES

6. Lua is not a challenging language. Some grasp of basic mathematics and logic is all that's required. It's nothing excessive, and anyone who's been through a low-level fundamental math course, and is decently intelligent should be perfectly good at scripting in Lua.
6a. That said, the capacity to script in Lua does not mean you will be GOOD at scripting in Lua.
6b. Practice will make you better. The same rules apply to posting Lua scripts as normal mods. Don't post something halfassed that you did in five minutes, and don't post your first script.
6c. Don't worry. If you honestly want to, no matter how little you know at the start, you'll get good at it.

7. Syntax counts.
7a. Trigonometry rocks.

Author:  Electroclan [ Sat May 17, 2008 1:34 am ]
Post subject:  Re: On Lua (Some tips)

An addition:

Please don't be a pompous ♥♥♥hole. It is very likely that, the people who seek help here, will not know the basics of programming logic. So have some patience as you deal with newer Lua scripters.

Acting all elite and holier-than-thou will get you nowhere.

And warned.

Author:  Miles_T3hR4t [ Sat May 16, 2009 3:02 am ]
Post subject:  Re: On Lua (Some tips)

I notice your tips on lua didn't actually include any tips on lua.

Could you maybe explain a little to those who have no idea how to code at all other than editing inis, or is there another thread for that I haven't seen?

And I don't mean what the variables are, I mean, how do you structure lua, how are statements written, maybe a nice hello world lua scriped triggered by an actor or something?

Author:  411570N3 [ Sat May 16, 2009 3:43 am ]
Post subject:  Re: On Lua (Some tips)

If I remember correctly the hello world program is something like:
Print("Hello World")
Or something like that.

Author:  mail2345 [ Sat May 16, 2009 5:25 am ]
Post subject:  Re: On Lua (Some tips)

Done:
Code:

function Create(self)
-- Put stuff you want when the game begins
end
function Update(self)
       for actor in MovableMan.Actors do -- Iterate though actors
      if (actor.Pos.X >= self.Pos.X - 18) and (actor.Pos.X <= self.Pos.X + 18) and (actor.Pos.Y >= self.Pos.Y - 18) and (actor.Pos.Y <= self.Pos.Y + 18)  then -- Eliminate all not in the tile
print("Hello World") -- Duh
   end -- End if
    end -- End for
end

function Destroy(self)
end


On a 36*36 tile, print Hello World to the console when an actor enters.

Yes, you can nest like in regular lua.

Author:  Miles_T3hR4t [ Sat May 16, 2009 5:20 pm ]
Post subject:  Re: On Lua (Some tips)

mail2345 wrote:
Done:
Code:

function Create(self)
-- Put stuff you want when the game begins
end
function Update(self)
       for actor in MovableMan.Actors do -- Iterate though actors
      if (actor.Pos.X >= self.Pos.X - 18) and (actor.Pos.X <= self.Pos.X + 18) and (actor.Pos.Y >= self.Pos.Y - 18) and (actor.Pos.Y <= self.Pos.Y + 18)  then -- Eliminate all not in the tile
print("Hello World") -- Duh
   end -- End if
    end -- End for
end

function Destroy(self)
end


On a 36*36 tile, print Hello World to the console when an actor enters.

Yes, you can nest like in regular lua.


okay, Nested if/then/else/elseif statements, complex math, and, as long as we can create particles with trails, starting cords, trail collor, hitsmos =0, we can draw. I'm learning.

Author:  venn177 [ Mon May 18, 2009 1:09 am ]
Post subject:  Re: On Lua (Some tips)

Someone really needs to update the OP

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/