Total servers: 1
  •  LXA Server
(Ew) (Clan threads) by Atumbra Today at 03:10:08 am
Cheer up! Smile! (The World Outside) by Tiger Today at 01:48:36 am
Looking for a dedicated server administrator (News) by Asrack Today at 01:36:44 am
LXA Times - Erwan Edition (All about the game) by SorZ Today at 12:12:39 am
Vagabond - [vB] (Clan threads) by ONeill February 08, 2010, 11:22:11 pm
[ Fast mortars ]
Modern Warfare1.0 – 20lt
IP: 85.248.229.111
Game Mode: Death Match
Lives: unlimited
Max Kills: 15
Version: OpenLieroX 0.59 beta3
Players:
Pages: [1]   Go Down

Author Topic: Mod: Basics  (Read 1640 times)

Asrack

Mod: Basics
« on: September 27, 2006, 02:36:04 am »
Mods: The Basics

Synopsis
In this tutorial we will discover the basics of creating mods. We will use easy weapons, and help create your own in the end. The over all tutorial should be easy to read. If you have any questions or comments, please post them. You can also email me at Asrackk@hotmail.com, please don't add me to your msn. Use a nice little tag to describe what help you are looking for. [Mod] Question. So I don't just delete your post. Thank you.


Lay Out
Every mod has the same layout. You use Main.txt as your starting point. Main.txt is what the compiler looks at first. This file will tell the compiler, what weapon files to read, and what to add to your mod. This will also show the mods name, and the overall settings of the mod, like how high you will jump, what speed you aim at, and more when we get into it. If you ever need help go to this link, and read it, I will call this the quick functions guide, becaues it does just that. Click Here

Or look in code block.
Code: [Select]
Files:

Main.txt     = The main script text file, must be in a mod.
w_*.txt      = Usually a weapon script text file.
p_*.txt      = Usually a projectile script text file.


Script:

Order of variable settings does not matter as long as they are under the correct group.
When leaving out a variable setting it usually defaults to 0 (else noted).
It does not usually matter if you use capitals or not in the scriping.

[]           = Different sections of the script code.
#            = Comment, all text after on same line will not be compiled.
°            = Angle, 360 is one full rotation.
bool         = boolean variable, can have value true or false.
classic      = the value in classic mod.
def          = default value, if you dont use this the value get the default value.
float        = floating point variable (decimals).
int          = interger variable (no decimals).
less         = must be less than that value to work.
max          = maximum working value of the variable.
min          = minimum working value of the variable.
more         = must be more than that value to work.
ms           = milli seconds (1000ms = 1s).
px           = pixels (with double resolution, which makes 320 is one screen in width).
RGB          = Red 0-255, Green 0-255, Blue 0-255 (eg 128,255,64).
s            = seconds.

When using sound effect if first look for the file in you <modname>/sfx folder,
if it does not find it there it looks in data/sound.
When using sound effect if first look for the file in you <modname>/gfx folder,
if it does not find it there it looks in data/gfx.

***          = New - added in last update.
**           = Recent - added in update before last time.
*            = Updated - text changes somewhat, priorty change, or additional info.

Main File

[General]    = General mod settings.
ModName      = Name of the mod that will show up in the mod list.
               If you use more than one word you must incapselate it with "" when you compile.

[Weapons]    = Weapon list settings.
NumWeapons   = Number of weapons the mod contains (int, min 1).
Weapon#      = File name of a weapon. Replace # with an interger for each weapons.
               Use same amount of lines as the NumWeapons is.
               Weapon1 shows up first in the list when you choose weapons,
               Weapon2 comes in second place and so on.
               If a weapon a filename is wrong or miss a Weapon# the weapon will be blank,
               but the game will still run with defualt values on the weapon.

[NinjaRope]  = The Ninja Rope setting.
RopeLength   = The max lenght on the rope when you throw in px (int, classic 300).
               Note, you can max throw the rope about 900 in right up in the air.
RestLength   = The min lenght the rope will have when you hang by it in px (int, classic 27).
Strength     = How hard it will drag you until you have reached min length (float, classic 4.5).

[Worm]       = Settings on all worms.
AngleSpeed   = How fast it can change direction of the aim (classic 150, less is slower).
GroundSpeed  = How fast it moves on land (classic 8, less is slower).
AirSpeed     = How fast it moves in air (classic 4, less is slower).
               Note: A bug makes air speed is also used on ground.
               Negative walues will give some strange results on both speeds.
Gravity      = How much the gravity affect it, (classic 100, 0 is no gravity,
               and negative number will make it moves upwards instead).
JumpForce    = How fast it will jump (classic -65, possetive will make it bounce first).
AirFriction  = How much the air slows it down (float, min 0, max 1, classic 0).
GroundFriction = How much ground slows it down (float, min 0, max 1, classic 0.4).

Weapon Files

[General]    = Must be in a weapon/projectile scrip file. Main settings.
Name         = Name that will show up in weapon list.
Type         = Use "Type = WPN_BEAM" of you want to use beam weapon.
*Class       = Can be: WCL_AUTOMATIC, WCL_CLOSERANGE, WCL_GRENADE, WCL_MISSILE, WCL_POWERGUN.
               Just used for future reference.
Recoil       = How much you will fly backwards when you shoot.
               Negative will make you fly forward instead.
Recharge    = Time it takes to reload weapon the more the faster
               (float, min 0, def 0, 10s/number).
               Example: 1 = 10s, 0.5 = 20s, 2 = 5s, 10 = 1s.
Drain       = How much each shot will drain in percent.
               When more than 100 have been used you must reload to shoot again.
               Note the "more", if it have drained 100 you can still shoot one more time,
               it needs to be just over it for just one shot, eg 100.001.
ROF          = Rate of Fire, delay between shots in same clip, in ms (int, min 1, def 1).
Sound        = A sound file that will be played when the weapon is fired.
LaserSight   = Shows a dottet line directly at where the player aims.


[Beam]       = Creates a beam with some setings.
               Ignores Recoil, Sound and LaserSight in General.
Damage       = Size of the damage on dirt (int).
PlayerDamage = Damage player will take when hit (int).
Colour       = Color of the whole beam (RGB).
Length       = Length of the beam in px (int, use 999999 to have no end of the beam).

Weapon and Projectile Files

[Projectile] = Creates a projectile with some settings.

Amount       = How many projectiles that will be created each time
               (int, min 1, max 2047, def 0).
Speed        = How fast the projectiles moves (def 0).
               More than 1000 can usually pierce through materials.
               Moves backwards with a negative number.
SpeedVar     = Randomly extra or less in speed (def 0).
               Example 10 can give 0-10 extra speed or 0-10 less speed.
*Spread       = How much randlomly each projectile can spread at both direction from the middle
               in ° (float, min 0, max 180). In v0.55b 0 spread works correctly.
Projectile   = The name of the projectile file that will be loaded.
Angle        = In wich direction the projectile start to move in °,
               0 is to the right, 90 is down, -90 is up, 180 is left.
               Variable ignored in the weapons first projectiles and in trail.
Useangle     = Bool (def false), when true use last projectiles angle (+ Angle variable)
               instead of using absolute angle.
               Variable ignored in the weapons first projectiles and in trail.

Projectile Files

[General]    = Main settings on the projectile.
Type         = Can have values: PRJ_IMAGE or PRJ_PIXEL.
               PRJ_IMAGE followed by Image in new line to use an image,
               PRJ_PIXEL followed by Colour1 and optional Colour2 if you want pixel graphics.
Image        = Name of the image file that will be used on the projectile.
Colour1      = The RGB value of the pixels (def black).
Colour2      = Use this if you want some variation on the pixel colors (def not used).
Trail       = Everything but TRL_PROJECTILE and TRL_NONE use hard coded images. Can have values:
               TRL_CHEMSMOKE = Green smoke effects.
               TRL_DOOMSDAY = tiny fire trail.
               TRL_EXPLOSIVE = big explosion trail.
               TRL_NONE = have no trail.
               TRL_PROJECTILE = have a trail that is defined in [ProjectileTrail] section.
               TRL_SMOKE = use the smoke.png trail (hardcoded).
Gravity      = How much gravity effects the projectile (0 = nothing, 100 = full, 200 =
               double effect, negative value will make it moves upwards instead of downwards).
Dampening    = Multiplies with projectile speed each frame (float, 1.0 = no effect,
               less than 1.0 slows it down, more than 1.0 accelerate the projectile, def 1.0).
Timer        = In how many seconds the [Time] trigger will be used, in s (float).
*TimerVar    = Radom time length variance.
Rotating     = Bool (def false). If the projectile will rotate when it moves.
               If true also use RotIncrement and RotSpeed.
*RotIncrement = How many rotated images there is in the file in °.
               For 4 direction 90, for 8 45, for 16 23.
RotSpeed     = How fast the rotation will be, the higher value the faster (int).
               Also rotates slower the slower the projectile moves.
UseAngle     = Bool (def false), when true the graphics will be dependent on the projectiles angle,
               If true also use AngleImages.
UseSpecAngle = Don't know the difference between this and UseAngle except it show some directions
               wrong.
AngleImages  = Tells how many direction images there is in the file.
               These amount of directions seams to work best: 10, 18, 34, 66.
Animating    = Bool, when true use also AnimRate and AnimType
AnimRate     = How long each frame in the animation will be shown, the less the slower.
AnimType     = Can have values ANI_ONCE, ANI_LOOP, ANI_PINGPONG.
               ANI_ONCE = Animate from left to right then the projectile dissaperes.
               ANI_LOOP = Animate from left to right again and again until projectile dissaperes.
               ANI_PINGPONG = Animate from left to right and back again then dissaperes.


[Hit]        = Setting on what will happen when a projectile hits a wall (both dirt and rock).
Type        = Can have values: Bounce, Carve, Dirt, Explosion, GreenDirt, Nothing (def Nothing).
               Bounce = will make the projectile bounce on the material (use BounceCoeff too).
               Carve = damage walls without showing some animation.
               Dirt = will make 3 dirt circles around it.
               Explode = use the "Explosion.png" in different sizes depending on damage.
               GreenDirt = makes a tiny green dirt.
               Nothing = will make the projectile moves through dirt and rock (max speed around 50).
Damage      = How much that will be removed on dirt (int, def 0).
               In LieroX v0.50b it also damage the player in same damage
               (instead of just 1 as it was before).
               Maximum damage is 15 (image bug if higher)
               Use Damage = -1 if you don't want to show a small explosion image.
BounceCoeff  = How much the projectile will loose in speed when it bounce (float,
               1.0 = no speed loss, 0.0 all speed loss, over 1.0 it gets faster after each bounce).
BounceExplode = If the projectile explodes every time it bounce (int, the higher, the bigger removal).
               If it is slow or have low angle it can carve through much dirt
               (a bug that it gets faster when it bounces).
Projectiles  = Bool (def false). If true and "Type = Explosion" the [Projectile] will trigger.
Shake        = How much the whole level will shake (def 0).
Sound        = Sound file that will be used.


[PlayerHit]  = What will happen when a projectile hits a player (both computer and human).
               Only the Type variale works differently compared to [Hit].
Type         = Can have values: Explosion, Injure, Nothing (def Nothing).
               Explode with show exploding animation but max do 5 damage.
               Injure will hurt the player directly with no max damage.
               Nothing will just pass though the player (but the same time also ignore wall hits).
               Both Explode and Injure can trigger a [Projectile].


[Time]       = What will happen when a projectile have a certain age.
               Using same variables like [Hit] and [PlayerHit] with an exception of
               Sound that unfortunatly does not work.

[ProjectileTrail] = When "Trail = TRL_PROJECTILE" is stated in [General].
UseProjVelocity = Bool, true if the trail will use the speed of the projectile it shoots from.
Delay        = Delay between each projectile in the trail, in ms

Inside your mod folder, you should have a folder named gfx and sfx. If you choose to use default graphics, and pixels, you do not need to create these folders. But if you choose to use your own graphics and sounds, you must include all sounds and graphics inside there appropriate folders.

Lets take a look at the main.txt a second.

Quote
[General]
ModName = WarZone


[Weapons]
NumWeapons = 2
Weapon1 = Sniper Rifle.txt
Weapon2 = Minigun.txt

[NinjaRope]
RopeLength = 300
RestLength = 27
Strength = 4.5

[Worm]
AngleSpeed = 120
GroundSpeed = 3
AirSpeed = 2
Gravity = 125
JumpForce = -75
AirFriction = 0
GroundFriction = 0.2

Lets go over the block above line by line.

[General]: Anything after this is the general mod settings. Its used as a type of header for certian parts of scripts in every script.
ModName: This is the name of your mod. You can put anything you wish in here, but LieroX dosent see certian characters.

[Weapons]: Another type of header, that deals with the weapons in the mod.
NumWeapons: Short for number of weapons.
Weapon#: Where # equals a number. (1, 2, 3, +) This lines all weapons and points them to there weapon file.

[NinjaRope: This is another type of header that deals with the Ninja Rope.
RopeLength: The length of your ninja rope in game.
RestLength: The minimum lenth the rope will have when you hang on it.
Strength: How fast it will move your worm to the restlength varaible.

[Worm]: Is another type of header that deals with the worm.
AngleSpeed: How fast your worm can change the direction of your aim.
GroundSpeed: How fast your worm move on the ground.
AirSpeed: How fast your worm move in the air.
Gravity: This number decideds weither your want your worm to move in a certian way, or at all. 100 is normal gravity, 0 is no gravity, and a negative number will make your worm move upward.
JumpForce: How fast your worm will jump. -65 is the normal jumpforce for the classic mod.
AirFriction: How much the air slows your worm down.
GroundFriction: How much the ground slows your worm down.

Weapon File
You might wonder, what a weapon file does, well, its the weapon your worm carries in short. It will be the first part of all weapons that you create. Lets look at an easy weapon. Again, this is from my WarZone mod.

Quote
[General]
Name = Sniper Rifle
Class = WCL_MISSILE
Recoil = 55
Recharge = 1
Drain = 20.2
ROF = 1500
LaserSight = true
Sound = rifle.wav

[Projectile]
Amount = 1
Speed = 800
Spread = 0
Projectile = Sniper Rifle/Rifle Projectile.txt

[General]: General information/settings about the weapon.
Class: Check striders Weapon Scripting Information linked above for information. Used as a refrence for weapons.
Recoil: Recoil is how much the weapon will push your worm after its fired. 0 equals no recoil.
Recharge: This is the speed in which a weapon will reload at. Lower, the slower.
Drain: This will judge how much ammo a weapon has in precentage. (101 max)
ROF: This is the time between each shot. It stands for Rate of Fire.
LaserSight: This allows you to have a red laser shoot out, like on your basic rifle from Liero v1.0.
Sound: Found in the sfx folder in your mod. There are default sounds you can choose from in the default sfx folder.

[Projectile]: This is information about the projectile your weapon will shoot.
Amount: This is how many of the projectiles you want to shoot.
Speed: How fast the projectile will go.
Spread: Randomly adds a distance between each projectile that is shot from the gun defined by this number. 0 equals none.
Projectile: This calls the projectile. It will be whatever you name it.

Projectile File
The projectile is the image/pixel that is shot from the weapon, it includes all the script to deal damage, to change into another projectile, to have a trail, to fly around with no gravity. This is completely up to you. But Lets look at an easy projectile file for example.

Quote
[General]
Type = PRJ_IMAGE
Image = Bullet.png
Trail = TRL_NONE
UseAngle = True
AngleImages = 32

[Hit]
Type = Explode
Damage = 5

[PlayerHit]
Type = Injure
Damage = 65

[General]: General information/settings about the projectile.
Type: This is what you use to shoot an image, or a pixel. You can choose between PRJ_IMAGE or PRJ_PIXEL. For PRJ_PIXEL however, your script will change to look something more like this.
Quote
Type = PRJ_PIXEL
Colour1 = 0, 0, 0
Colour2 = 0, 0, 0
Although, you don't need to add Colour2, you can to give the weapon more colour. Also, it is RGB colors, so just change the 0's, to anything inbetween 0, and 255.
Image: This is the name of the image that you want your weapon to shoot. Found in the gfx folder you create or the default gfx folder in your data folder.
Trail: You will have to check Striders weapon scripting tutorial for all instances, but it defines a trail that follows the weapon, or does other things that are user defined.
UseAngle: This is if you are using an image with different angles. It will allow you too choose how many angles the picture has, so it looks proper.
AngleImages: This is used to define how many angles are in the image.

[Hit]: Information about what happends when the weapon hits a solid object.
Type: More information in Striders Weapon Scripting Tutorial. Explode is the type choosen, of course there are more you can look at, but this makes the projectile explode on contact.
Damage: How much dirt will be removed on hit. Use -1 to show no explosion animation.

[PlayerHit]: Information on what happends on player hit.
Type: Again, can find more information in Striders Weapon Scripting Tutorial, but injure allows the projectile to move through a player, but still hurt them.
Damage: The damage it deals to the player. Use -1 or more to heal.


You now have basic information on how a mod works. You could create a bunch of weapons like this, but that would be boring. So, whenever my Mod: Intermediate Tutorial is done, you can look at that. Until then, you might wanna look at Striders Weapon Scripting Tutorial to check learn more.
« Last Edit: October 10, 2007, 09:08:53 pm by Asrack »
Logged
You're just a breath away!

Splinky

Re: Mod Creating: The Basics
« Reply #1 on: September 27, 2006, 02:41:53 am »
Woooow, thats long and informative. Nice Work, I think I might try making a mod sometime. If i do it wont be for a looong time kuz school is getting 0_0. I see you put alot of effort into this, its great you can help the community like this. +1 ;D
Logged

Click Here, xD

Asrack

Re: Mod Creating: The Basics
« Reply #2 on: September 27, 2006, 02:45:42 am »
Thanks, its not the best there ever was, but its a start. I will get into trails, and shit later.
Logged
You're just a breath away!

Purplehaze

Re: Mod Creating: The Basics
« Reply #3 on: September 27, 2006, 02:50:25 am »
*Purplehaze is reminded why he lets other people make mods*
Logged
Like a boss.

Indignation

Re: Mod Creating: The Basics
« Reply #4 on: September 27, 2006, 02:56:03 am »
*Purplehaze is reminded why he lets other people make mods*

*Roxas does not know why people talk in 3rd person*


But seriouly, nice long post. =o Even though the length of the post seems to contridict when you say "Mods are easy to create" <_<
Logged
i r homosecksual

AnubisBlessing

Re: Mod Creating: The Basics
« Reply #5 on: September 29, 2006, 04:53:10 pm »
Modding is easy, especially with LMS. Anyone can make something in it. It's all about taking time.

Now to the author:

You did a great job on putting this all together. I'm sure someone has use for it since the thread in GU has probably been forgotten. And you make a good job in going a bit more in depth than Strider, anyways. Everything worked upon should have some critics, I have given my good critics, but there are some bad too.
I noticed some things in the guide which are not fully correct though.. No hard feelings I hope, but:

Quote from: Asrack
Recoil: This is how far you will be pushed back when you press the fire button. 0 being the lowest, no recoil.
This is not quite true, in two meanings. The recoil is the force the weapon affects your worm with, and not a distance (you can compare the effect on a flying worm and one standing on the ground). And being a force it can also be negative in relation to the worm, which can have a nice effect in for instance the "replacement technique" weapon in Loop's Naruto mod.

Quote from: Asrack
Drain: How much of your ammo is taken every time you press fire.
Yes - In percent. 100 does however not mean the whole clip. To do one shot per clip you need to have a drain of 101.

Quote from: Asrack
ROF: How long inbetween each time you press fire. When you use the handgun, you shoot, but you don't shoot again in a split second. If you hold down the button, their is a pause between each shot. That is what the Rate of Fire is.
The explanation feels a bit long, it's basically the time between each shot fired by the weapon. A machine gun has a high rate of fire, while a grenade has lower and "Game over" in 8-bit spam is extreme. Could also mention this is good to prevent people abusing the weapons in 0%lt, as it works independantly from the loading time.

Asrack, please don't get me wrong: I think you did a great job on this, and these are all some smaller bad things in a greater good thing. Keep up the good work!
« Last Edit: September 29, 2006, 04:55:16 pm by AnubisCurse »
Logged

Durza

Re: Mod Creating: The Basics
« Reply #6 on: September 29, 2006, 05:06:38 pm »
I tried to make a mod too with LMS. that came like 3 weapons, no gravity.
Weapon #1: Bazooka, which doesnt fire.
Weapon #2: Rifle, which doesnt hurt you.
Weapon #3: Grenade, which does nothing. just screaming something. :P
Logged
Cee ya later

Asrack

Re: Mod Creating: The Basics
« Reply #7 on: September 29, 2006, 05:42:03 pm »
Modding is easy, especially with LMS. Anyone can make something in it. It's all about taking time.

Now to the author:

You did a great job on putting this all together. I'm sure someone has use for it since the thread in GU has probably been forgotten. And you make a good job in going a bit more in depth than Strider, anyways. Everything worked upon should have some critics, I have given my good critics, but there are some bad too.
I noticed some things in the guide which are not fully correct though.. No hard feelings I hope, but:

Quote from: Asrack
Recoil: This is how far you will be pushed back when you press the fire button. 0 being the lowest, no recoil.
This is not quite true, in two meanings. The recoil is the force the weapon affects your worm with, and not a distance (you can compare the effect on a flying worm and one standing on the ground). And being a force it can also be negative in relation to the worm, which can have a nice effect in for instance the "replacement technique" weapon in Loop's Naruto mod.

Quote from: Asrack
Drain: How much of your ammo is taken every time you press fire.
Yes - In percent. 100 does however not mean the whole clip. To do one shot per clip you need to have a drain of 101.

Quote from: Asrack
ROF: How long inbetween each time you press fire. When you use the handgun, you shoot, but you don't shoot again in a split second. If you hold down the button, their is a pause between each shot. That is what the Rate of Fire is.
The explanation feels a bit long, it's basically the time between each shot fired by the weapon. A machine gun has a high rate of fire, while a grenade has lower and "Game over" in 8-bit spam is extreme. Could also mention this is good to prevent people abusing the weapons in 0%lt, as it works independantly from the loading time.

Asrack, please don't get me wrong: I think you did a great job on this, and these are all some smaller bad things in a greater good thing. Keep up the good work!


Thanks Anubis, I was trying to get good definitions for them. It was quite hard to think of them. Thanks manl.
Logged
You're just a breath away!

AnubisBlessing

Re: Mod Creating: The Basics
« Reply #8 on: September 30, 2006, 12:57:35 am »
Glad I could help.

I just realized i didn't explain high rate of fire means lower number ;>
The rate of fire is the duration in milliseconds between each shot.

Confusing? Yeah ;>
Logged

[leke]LemonNinja

Re: Mod Creating: The Basics
« Reply #9 on: October 11, 2006, 11:39:13 am »
Modding is easy, especially with LMS. Anyone can make something in it. It's all about taking time.

Heh, everyone can make something, youre right....

If you didnt get what i mean, check out this

Cool mod  :-X

 :-X
Logged

When we die we come to a better place... I'll respawn right behind you!

SiL3nT

Re: Mod Creating: The Basics
« Reply #10 on: January 25, 2007, 03:54:51 am »
woah! lots of info dammit!!  :P :Pjavascript:void(0);
Tongue
Logged

chetzel

Re: Mod: Basics
« Reply #11 on: July 15, 2007, 01:23:01 am »
Can someone please place a link to a mod compiler or simalar here because mine doesnt work.
Logged

Leon

Re: Mod: Basics
« Reply #12 on: July 15, 2007, 01:32:33 am »
Here's a link to LieroX Mod Scripter (LMS for short) ->
http://forums.thegaminguniverse.com/showthread.php?t=18914
Logged

Indignation

Re: Mod: Basics
« Reply #13 on: July 15, 2007, 01:45:32 am »
Can someone please place a link to a mod compiler or simalar here because mine doesnt work.


Your compiler should always work, and LMS won't help you since it uses your existing compiler. Your compiler probably doesn't work because you have a scripting error.
Logged
i r homosecksual

Fuego

Logged

Smexy Ligar

Logged
I want to punch Avogadro in the face 6.022X10^23 times

Hawk

  • Chaos is only thing i leave behind
  • LXA Part Time Adapt
  • *****
  • Schwartz: +28/-51
  • Offline Offline
  • Posts: 680
  • 3708 credits
  • View Inventory
  • Send Money To Hawk
  • i'm not going anywhere
Re: Mod: Basics
« Reply #16 on: March 20, 2009, 12:10:55 pm »
smexy... i checked that page... i can't get those files...
Logged
LXAn kovin jätkä on puhunut

(19:11:38) Hugglebunny: satan
(19:11:55) satch: oh silly thats hawk. hawk isn't here right now
Pages: [1]   Go Up