View unanswered posts | View active topics It is currently Fri Apr 19, 2024 7:55 am



Reply to topic  [ 50 posts ]  Go to page Previous  1, 2, 3, 4  Next
 trying to learn Lua.... cant understand 
Author Message

Joined: Sat Oct 01, 2011 9:06 pm
Posts: 125
Location: london
Reply with quote
Post Re: trying to learn Lua.... cant understand
ahhhh got it and why do you need to tabb?


Thu Dec 15, 2011 9:40 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: trying to learn Lua.... cant understand
In the lua script, or in the ini code?


Thu Dec 15, 2011 9:46 pm
Profile

Joined: Sat Oct 01, 2011 9:06 pm
Posts: 125
Location: london
Reply with quote
Post Re: trying to learn Lua.... cant understand
both and whats the ini code I know what it is im just not fully informed...gahh im ignorant.


Thu Dec 15, 2011 9:51 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: trying to learn Lua.... cant understand
The ini code, you know, AddActor = AHuman, where you code the actors, guns, the basic stuff.

Well, tabbing in the ini code is completely necessary, but in the lua script, it's not. However, tabbing in the lua script is good because it helps you to keep order, easier reading and less syntax errors.

I wouldn't like to cover the ini part, since that shouldn't be hard at all, and there are like ten billions of tutorials out there, but if you want me to, I'll explain the basics of it.


Thu Dec 15, 2011 10:01 pm
Profile

Joined: Sat Oct 01, 2011 9:06 pm
Posts: 125
Location: london
Reply with quote
Post Re: trying to learn Lua.... cant understand
your far far far more experienced then me and your ALSO wasting your freetime on me...sooo I think its fair to say your call


Thu Dec 15, 2011 10:13 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: trying to learn Lua.... cant understand
No really, if you want I can explain you both, it's not a problem. I'd prefer to teach you completely that have you half taught.


Thu Dec 15, 2011 10:17 pm
Profile

Joined: Sat Oct 01, 2011 9:06 pm
Posts: 125
Location: london
Reply with quote
Post Re: trying to learn Lua.... cant understand
whatever you think


Thu Dec 15, 2011 10:21 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: trying to learn Lua.... cant understand
Ok so, tabbing.
You can use the tab button, or use 4 spaces, but spaces tend to be messy, so use tabs.

In the ini file:

Code:
AddEffect = MOPixel
   PresetName = Grenade Fragment Gray
   Mass = 0.15 // kg
   LifeTime = 250
   Sharpness = 20
   HitsMOs = 1
   GetsHitByMOs = 0
   Color = Color
      R = 143
      G = 143
      B = 143
   Atom = Atom
      Material = Material
         CopyOf = Bullet Metal
      TrailColor = Color
         R = 155
         G = 155
         B = 155
      TrailLength = 25

Note how in here we used up to 3 tabs.


When you define an object, it'll look like that. Now, tabbing should be placed when a new property for something will be added, for example:

Code:
Object
    Property1
    Property2
    Property3
        PropertyForProperty3
    Property4


So, if we take a look to the previous defined particle, we will look at it's tabbing:

Code:
AddEffect = MOPixel //No tabs, it's the object being defined
   PresetName = Grenade Fragment Gray //One tab, it's a property of the defined object
   Mass = 0.15  //Same as before, one tab
   LifeTime = 250 //Same as before, one tab
   Sharpness = 20 //Same as before, one tab
   HitsMOs = 1 //Same as before, one tab
   GetsHitByMOs = 0 //Same as before, one tab
   Color = Color //Same as before, one tab, but to define the color must have more properties on it
      R = 143 //Two tabs here because it's a property of the previous property, the color
      G = 143 //Two tabs here because it's a property of the previous property, the color
      B = 143 //Two tabs here because it's a property of the previous property, the color
   Atom = Atom //One tab now, the atom is a property of the MOPixel, not of the color
      Material = Material //Two tabs, material is a property of the atom
         CopyOf = Bullet Metal //Three tabs here, because we are defining the material of Material = Material
      TrailColor = Color //Two tabs, TrailColor is a property of the atom
         R = 155 //Three tabs, defining the color of the trail
         G = 155
         B = 155
      TrailLength = 25 //Only two tabs here, we are defining the length of the trail, which is a property of the atom


Here I'll attach an old text file I made for a dude which explains most variables for making weapons.

Attachment:
Nuevo documento de texto.txt [13.37 KiB]
Downloaded 251 times

**Note, there is a small error in the file!! Color can only go from 0 to 255, not 256!!**


Take a look at this, with this post you have more than enough information to mod your first, simple weapon. When you feel confident enough with this simple ini coding, we can continue with lua scripting.


Thu Dec 15, 2011 10:53 pm
Profile

Joined: Sat Oct 01, 2011 9:06 pm
Posts: 125
Location: london
Reply with quote
Post Re: trying to learn Lua.... cant understand
how can I mod I only know how to tab and to change notepad to .Lua


Thu Dec 15, 2011 10:57 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: trying to learn Lua.... cant understand
Wait, so you don't actually know anything? At all?
Geez...

Well, with the previous I went through most basic stuff, I just got to explain how to do your mod folder and set an index.ini.


Thu Dec 15, 2011 11:00 pm
Profile

Joined: Sat Oct 01, 2011 9:06 pm
Posts: 125
Location: london
Reply with quote
Post Re: trying to learn Lua.... cant understand
lmao :')

and okay we can start with that


Thu Dec 15, 2011 11:02 pm
Profile

Joined: Sat Oct 01, 2011 9:06 pm
Posts: 125
Location: london
Reply with quote
Post Re: trying to learn Lua.... cant understand
do what?.


Thu Dec 15, 2011 11:04 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: trying to learn Lua.... cant understand
Ok so, to begin with, the most basic but necessary thing, is your mod folder.

Create a folder, and name it how you want. For example, "MyMod", "MyFirstWeapon", etc.

But creating a folder in the cortex command directory won't do anything, right? That's right, because it must have at the end of the folder's name ".rte". So, change the name of your folder to "MyMod.rte", and cortex command will read it.

Open up your "MyMod.rte" folder. It's empty. Depressing, isn't it? Well now, let's begin filling it up!

Create a text file and name it "Index", and change it's extension from .txt to .ini. Open it up now.
Now, the FIRST AND MOST IMPORTANT THING TO DO WITH THAT INDEX FILE IS WRITING DataModule ON THE FIRST LINE! Not writing it is the most common mistake.

As we are defining the DataModule, everything that comes next is a property of it, so, we are going to use tabs in here.
One of the first properties we add on the DataModule is the ModuleName, in other words, the name of your faction, weapon pack, etc.
Then, you add the property IncludeFile to the DataModule. This are the files that will be loaded when cortex command reads your Index.ini.

A regular index looks like this:

Code:
DataModule
   ModuleName = Coalition Faction
   IconFile = ContentFile
      Path = Coalition.rte/ModuleIcon.bmp
   IncludeFile = Coalition.rte/Effects/Effects.ini
   IncludeFile = Coalition.rte/Devices/Devices.ini
   IncludeFile = Coalition.rte/Actors/Actors.ini


Now, let's suppose you create a mod that is for a pistol. Your folder will be named "MyDesertEagle.rte".
Inside it, you'll have two things: your index.ini, and another folder which is named "Devices". Inside devices you have everything related to the desert eagle, let's say, sprites, the Desert Eagle's ini file, sounds, etc.
(Note that you can arrange your mod folder as you like, you can add as much folders as you want, as long as you put the filepaths correctly)

Your Index should look like:
Code:
DataModule
   ModuleName = My Desert Eagle
   IconFile = ContentFile  //Use this to add a module icon, the icon that will appear in the buy menu for your faction
      Path = MyDesertEagle.rte/ModuleIcon.bmp  //Here you add the path to the icon
   IncludeFile = MyDesertEagle.rte/Devices/DesertEagle.ini


Note that it's not necessary to add a module icon, you can delete those lines if you want.


Now, in DesertEagle.ini you'll have your weapon defined. You can use the file I attached on the previous post to help yourself creating your weapon.

EDIT:

Oh, Non, if you won't have patience to teach a new guy just don't spam the thread. Please.
=D


Thu Dec 15, 2011 11:21 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: trying to learn Lua.... cant understand
If you don't know how to, I doubt you will do it.

I'm just teaching the basics bud, everyone had to start somewhere. I still remember spamming the ♥♥♥♥ out of a thread dragonxp made to create my first actor, so let this newbie spam the ♥♥♥♥ out of this one just as I did.


Thu Dec 15, 2011 11:28 pm
Profile

Joined: Sat Oct 01, 2011 9:06 pm
Posts: 125
Location: london
Reply with quote
Post Re: trying to learn Lua.... cant understand
Thanks man bless you :) and btw your nike joke I forgot nike was american so I didnt connect the 2


Thu Dec 15, 2011 11:41 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 50 posts ]  Go to page Previous  1, 2, 3, 4  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.079s | 16 Queries | GZIP : Off ]