View unanswered posts | View active topics It is currently Thu Nov 28, 2024 8:30 am



Reply to topic  [ 7 posts ] 
 On Lua (Some tips) 
Author Message
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post 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.


Last edited by Grif on Fri Jul 10, 2009 6:50 am, edited 1 time in total.



Sat May 17, 2008 12:14 am
Profile
User avatar

Joined: Sat Jun 30, 2007 4:39 am
Posts: 521
Reply with quote
Post 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.


Sat May 17, 2008 1:34 am
Profile WWW
User avatar

Joined: Mon Jun 04, 2007 5:55 am
Posts: 1627
Location: Ohio
Reply with quote
Post 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?


Sat May 16, 2009 3:02 am
Profile YIM WWW
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: On Lua (Some tips)
If I remember correctly the hello world program is something like:
Print("Hello World")
Or something like that.


Sat May 16, 2009 3:43 am
Profile WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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.


Sat May 16, 2009 5:25 am
Profile
User avatar

Joined: Mon Jun 04, 2007 5:55 am
Posts: 1627
Location: Ohio
Reply with quote
Post 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.


Sat May 16, 2009 5:20 pm
Profile YIM WWW
User avatar

Joined: Sun Mar 18, 2007 5:35 am
Posts: 3778
Location: Largo, Florida
Reply with quote
Post Re: On Lua (Some tips)
Someone really needs to update the OP


Mon May 18, 2009 1:09 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

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.028s | 13 Queries | GZIP : Off ]