Basic Modding with Playable Examples -1 reply

Please wait...

niphty

GF makes me horny

50 XP

28th March 2007

0 Uploads

102 Posts

0 Threads

#1 12 years ago

Well, this should give people a basic start on a weapon by example. If you want, ignore the text outside of the quotes for the most part, and add the pre-made stuff in to the correct files and you'll be on your way with an awesome gun :P But if you want to learn to mod your own, just sit back and read.

First, you want to open the unique_items.ltx, and find the start of the weapons section. I prefer to keep things in order, adding my newer creations at the bottom, rather than having them all over the place and hard to find.

First, you need to give your weapon a description for the system. Weapons begin with the WPN prefix, then a name, then you should add on "_m#" to note it's a modified weapon and what version number it is.

You should see a few existing modded guns like the upgraded SVD and Viper with silencer. You can use these base parts to help you construct a gun, or you can look at the actual gun's base file in the weapons directory.

Next, is a colon ( : ) then an inheritor. Basically, you should link to the base (or modded) version of the gun you're making a mod for. That way, you ONLY have to add lines for the things you WANT TO CHANGE, the rest is inherited from the base gun version =D

Here's a short rundown of what you need/want to have in order to have a good looking modded gun:

$spawn - used for the system, generally keep it the same as the base gun, or a unique modded version for simplicity.

description - text string which the engine uses to look up the description of your gun when you examine it. Important if you want people to know your gun is special :P You can get creative with the descriptions, which are explained more below.

inv_name & inv_name_short - Short names similar to the description, again.. must have so people can tell your gun apart from the regular one.

cost - You can be realistic, unless you're testing the gun, in which case you should make it cheap so you can buy it at the very start.

fire_modes - single (1), double (2), triple (3), and auto (-1). Doesn't work on all guns just by settings.

ammo_limit - Theoretically the limit of ammo you can carry, though I've never seen it work, may be only for AI. ammo_current is the same.

ammo_mag_size - how big is the magazine? Again, think realistically, or insanely =D

ammo_class - what ammo it shoots. You may want to make a SPR with an AK over-bored to take .45 rounds ;)

sprint_allowed - some guns are just too big to run with. But you can change that here ;)

misfire_probability - chance the weapon will jam.

condition_shot_dec - how much condition is lost per round fired.

hit_power - the amount of force behind the hits. I still haven't figured out what the four divisions are =D higher = better, with sniper rifles typically 1.0+

hit_impulse - raw impact force of the bullet. Setting this high results in some crazy physics. The gun below is capable of shooting a barrel through a wall at times..

fire_distance - max range of the shell. May also be used for AI purposes.

bullet_speed - how fast your bullet zings. higher speeds = less leading of target. I think realistically 10k = instant hit for all ranges you can see.

rpm - rounds per minute. raise this to make a high rate of fire gun.

scope_zoom_factor - How much your scope moves in and out. I'm not -totally- sure how this number works, it seems like lower is better just by thumbing through the config files, just haven't tested it yet.

A couple others not on the gun below:

holder_range_modifier - Some guns shoot further, this allows you to see further. Be wary: turning this up too high results in your client trying to render every living body within sight range.

holder_fov_modifier - same as above, but allows you to restrict the rendering view. The higher you range, the lower you should make your FOV to keep things balanced.

fire_dispersion_base - base distance the rounds will disperse across for accuracy. Lower should be better.

inv_grid_x & inv_grid_y - these two confused me at first, but they relate to the actual image of the item displayed in the inventory. Be SURE to set this to either the base item's settings (by not including them, like I have below) or to the same as another modded item of the same kind (or the gun you're using to represent your modded weapon). The difference at times between two sets of these is that one is the "base" and displays nothing special, just the gun. The other is a "+" version, with the green arrow in the lower left corner. I'm sure you could add your own, but I've not gotten there yet.

That's the majority of things to get you started. I'll cover more later after I've played with them =D Here's my first modded gun for you to look at/play with:

[wpn_niphty_m1]:wpn_gauss $spawn = "weapons\wpn-gauss" description = enc_weapons1_wpn-niphty_m1 inv_name = wpn-niphty_m1 inv_name_short = wpn-niphty_m1 cost = 25 fire_modes = 1 ammo_limit = 1000 ammo_current = 500 ammo_mag_size = 1000 ammo_class = ammo_gauss sprint_allowed = true misfire_probability = 0.0 condition_shot_dec = 0.0 hit_power = 10.10, 10.10, 10.10, 16.60 hit_impulse = 6000 fire_distance = 10000 bullet_speed = 150000 rpm = 500 scope_zoom_factor = 7.5

Add that in to your unique_weapons.ltx, just above the arena guns.

Next you'll need some descriptions of what's what with your new item. The encyclopedia files keep track of all the string data, so that the items can just use short names and all the text can be kept elsewhere.. like the /text/eng folder!

This is pretty straight forward, all you have to do is copy the formatting and ensure the ID names are typed right. If you find your game isn't starting up, check to see if you forgot to end a formatting in these =D And my example, for the gun above..

An awesomely modified version of the standard Gauss rifle. Niphty's team has reworked the otherwise cumbersome and slow weapon into one of sheer terror. Still single shot, the weapon's capacitors have been heavily upgraded with artificat components to recharge almost instantly, creating an insane fire rate from an otherwise deadly gun. To compliment this, the clip has been extended greatly. Artifact barrel upgrades have been implimented as well, making this gun even more deadly accurate and high speed, while retaining the low kick of the original. A true weapon to be feared on the battlefield.Niphty Gauss

And add that into the "string_table_enc_weapons.xml" in the text/eng folder. I split them up in mine, just like the rest of the gun descriptions/names are, but it's not necessary.

Now you need to put it up on the trader; the inital guy is "trade_trader.ltx" and look for the "[supplies_start]" section. Scroll from there and find the section with the modified items, which all end in _m1, _m2, etc. Then just add in this line

wpn_niphty_m1 = 1, 3

The first number means quantity carried, and the second number I'm unsure of at this point. You can add it to the two other sections, which relate his stock based on different points in the story, as well as adding it to the other traders if you wish. All in all, lots of small modifications to tons of text files. Almost makes you wish you had an IDE =D

Next up.. basic armor modding! And later.. how to make one of those smaller machine guns fit into the pistol slot. It's big enough to hold one, so why doesn't it go there! =D




moonracer1313

Slightly cooler than a n00b

50 XP

29th March 2007

0 Uploads

35 Posts

0 Threads

#2 12 years ago

A nice tutorial there. I was wondering what a few of those things did. Looking forward to more.

The idea of small smgs in the pistol slot is brilliant! Would make the pistol slot more useful later in the game. I may even have to try squeezing a sawn off shotgun into that slot as a personal backup weapon :)

Edit: Just a request, perhaps a tutorial on ammo types and damage? I just took a brief look through the files last night so don't remember if you can add ammo types some where or if the weapon damage is decided more by the ammo or the weapon or both.




RadioactiveLobster Forum Admin

Jeff is a mean boss

566,445 XP

28th July 2002

0 Uploads

53,178 Posts

1,337 Threads

#3 12 years ago

Nice tutorial. I went ahead and made it a bit easier to follow though, you kinda had things a jumbled together


If there is no image, Mikey broke something...



niphty

GF makes me horny

50 XP

28th March 2007

0 Uploads

102 Posts

0 Threads

#4 12 years ago

Ahh, thanks. Does look much better that way =D Too busy typing and too little time formatting, hehe. Hopefully this one will be a bit easier on the eyes.

Part 2: Armor modding

Just like with weapons modding, armor modding should be done via the unique_items.ltx file. I chose to mod the exoskeleton, and basically re-write the majority of its properties, lol. Armor has some pretty odd functions in this game; ones I'm not sure if the patch has fixed or not. I'm writing all of this from a version 1.0 standpoint. Patches may change the behaviors of some -odd- functions within the armor. I certainly hope they make them a bit more "normal".

Start out by giving your armor a unique name in brackets, just like we did on the weapons above. I chose outfit_niphty_m1, then state its inheritor - I used the exo_outfit for mine.

Just like with the weapons, the basic item properties apply: $spawn, inv_name, inv_name_short, description, inv_grid_x, inv_grid_y, and cost. Refer to above if you need explanations for them.

Armor adds on quite a few new fields, which I'll list out below.

nightvision_sect - Which classification of night vision this armor uses. The game only has two versions at this point: effector_nightvision_bad and effector_nightvision_good. Bad is the ugly green kind, while good is the soft blue kind.

additional_inventory_weight & additional_inventory_weight2 - Pretty straightforward options. Note, though, the game will only display you as being able to carry 70kgs, regardless of what you set this to. But with higher numbers you won't get overloaded just by carrying 150kgs, even though it still shows up as a red number. I'll show you how to fix the sprint loss later, regardless of weight.

RESTORE SPEEDS! These come in different flavors: health, satiety, bleeding, power and radiation. In version 1.0, these items act -strange- or not at all. Essentially, these are items which are supposed to help you heal, etc, when you are wounded. The problem is that these numbers get applied in a very odd way. For instance, if you set health_restore_speed = 0.2 you'll get a HUGE boost in health restore speed. But as far as I can tell, it only gets applied when you take damage. Sounds funny, right? But yes, walk into an anomaly - boom, you're healed! Jump from a bridge - hallelujah! But get shot.. and it seems useless. Rarely does it seem to help, usually it doesn't do anything. Which means Ghost's suit and the other one with healing bonus is useless. Explains why it never seemed to help. I assumed they helped at standard health tick rates, but that doesn't seem to be true. But since you want to know how they work, I'll give you the info on them, and besides.. they'll come in handy later for artifact modding. Ohhh, teaser. The calculation is slightly different for each, which seems odd. Here's a little chart of the main four, satiety didn't seem important enough to test :D :

Health: Value - 0.0001 Effect - 100% Radiation: Value - 0.0001 Effect - 1% Power (Endurance): Value - 0.001 Effect - 18 Bleeding: Value - 0.001 Effect - 33%

Now, you have to be careful here, because Bleeding is actually backwards.. or rather, forwards, but backwards to how you'd think it should be displayed. GREEN (positive) numbers for bleeding actually make you bleed more. Red, which you'd normally think meant bad.. makes you bleed less. Though the Bleeding and Radiation values on armor does not seem to work in any way =D

Again, these values -only- get applied when taking certain types of damage. And yes, with the suit below you should go run into anomalies or jump off high places to get healed. hehe.

Next up is my personal favorite item: power_loss - this single line controls how much power you lose while wearing the suit. Set to 0.0 and you can run all day. Or modify the number accordingly to make your suit act heavier/lighter than the normal.

health_loss, radiation_loss, satiety_loss, & bleeding_loss - while all four of these THEORETICALLY are in the engine, I've yet to tinker with them much. health_loss = 0.0 doesn't make you invincible :P

sprint_allowed - true or false. Can you run while lugging this suit around?

Protection levels. These 9 items tell the game what level of protection to the elements your suit offers. They are as follows:

burn_protection - resistance to being set on fire strike_protection - resistance to being struck shock_protection - electro-resistance wound_protection - "rupture" or your protection from bleeding radiation_protection - Resistance to being rad =D telepatic_protection - Protection from the one guy who uses telepathy in the game :P chemical_burn_protection - Resistance to those nasty acid baths explosion_protection - Resistance to missiles, grenades and the like fire_wound_protection - Wounds from fire? I thought fire cauterized? :) This is actually "bullet cap" or wounds taken from gunfire, just named funny :)

For all of these, 1.0 = 100% protection. So you can change the % up and down as you want =D The one below is.. er.. a lot of %, I think effectively above 100% may be wasted, as even at 10,000% you still get wounds and such. Armor isn't perfect.

immunities_sect - Which section of immunities for the armor to use. Use a pre-defined set, or define your own. When you define your own, use the same style naming they do (which helps to keep things easy to read and understand) and place the definitions underneath this command. An important thing to note about immunities is that they ONLY relate to the ARMOR. They don't make you invulnerable, they have the same function as "condition_shot_dec" for guns. But since armors get hit with multiple types of damage, they have resistances to those damages. A suit might be good against radiation, and thus not get hurt by it, but a bullet will rip the suit to shreds! 0.0 represents no damage to the armor's condition by that type, while a 1.0 means the armor takes 100% damage from that type, which means 1 shot will destroy the entire armor, regardless. -1.0 means the armor completely repairs itself every time it's damaged by a certain type. This means you can make a radioactive suit that repairs itself when you're standing in a radioactive field. Or maybe your suit converts bullets into kevlar. lol :)

Now, after all that, here's my first modified armor suit, designed to pretty much make it impossible for you to die, to show all the extreme values =D

[outfit_niphty_m1]:exo_outfit

$spawn = "outfit\uniq\outfit_exo_m1" inv_name = niphty_outfit_name_m1 inv_name_short = niphty_outfit_name_m1 description = niphty_outfit_description_m1 inv_grid_x = 14 inv_grid_y = 24 nightvision_sect = effector_nightvision_good cost = 20

additional_inventory_weight = 2000

health_restore_speed = 0.5 satiety_restore_speed = 0.5 power_restore_speed = 0.5

power_loss = 0.0

sprint_allowed = true

immunities_sect = sect_niphty_outfit_immunities

burn_protection = 100.0 strike_protection = 100.0 shock_protection = 100.0 wound_protection = 100.0 radiation_protection = 100.0 telepatic_protection = 100.0 chemical_burn_protection = 100.0 explosion_protection = 100.0 fire_wound_protection = 100.0

[sect_niphty_outfit_immunities] burn_immunity = -1.0 strike_immunity = -1.0 shock_immunity = -1.0 wound_immunity = -1.0 radiation_immunity = -1.0 telepatic_immunity = -1.0 chemical_burn_immunity = -1.0 explosion_immunity = -1.0 fire_wound_immunity = -1.0

again, place this at the bottom of the armor section in the unique_items.ltx, to keep things nice and lined up =D Once that's done, you'll need to add in the description and name in the encyclopedia file just like the weapons:

This exoskeletal suit has been fully reworked by Niphty Industries with deep-zone artifacts. The exterior resembles the popular Exoskeleton suit simply to ensure the wearer does not stick out too much. However, when people see you sprinting lazily alongside them, they'll know this suit is not the normal. Rather, enhanced artifacts lighten up to a ton of weight, carried inside an active wormhole-like anomaly. To top off the features, this suit is impervious to all known forms of weaponry and actually revitalizes the user as they work. Fear nothing.Exo-Niphty

Place this text inside the string_table_outfit.xml file inside the /text/eng folder, at the bottom, before the /string_table command =D

With the text in place, it's time to add it to the trader again. Open the trade_trader.ltx in the misc folder, and at the bottom of the modified outfit section (you can search for outfit_exo_m1 and put this line below it) insert:

outfit_niphty_m1 = 1, 3

Be sure to put it in all the sale places, just to make sure =D

As a side note, if you mistype something on the trader, the game WILL load, and will crash when loading a saved game. Both games I tested this on were standing right beside him, and it crashed pretty much right after it hit the "loading XXXX.sav" status. So if you find yourself crashing on load, make sure you haven't mistyped something here =D Eventually we should make a known set of mod-related crashes, so people can have a quick reference guide to what they might be missing. For instance, the game loads fine and lets you buy a sniper rifle to put into the pistol slot, but when you go to inventory, it crashes. I haven't tested it fully, but I'm pretty sure it's because the item's icon is larger than the box that's supposed to hold it =D hehe.

Next up! How to make your Viper/MP5 fit into that durned pistol slot, then how to make an artifact do what you want it to do!




Deimos

Pierce the Heavens

50 XP

27th January 2003

0 Uploads

9,197 Posts

0 Threads

#5 12 years ago

Very nice! This indeed does look interesting. I'll have to try some of it out when I've finished the game. :)

Oh, and seeing as how this thread is already jam-packed with tons of information, I'll go ahead and sticky it. :thumbsup:




moonracer1313

Slightly cooler than a n00b

50 XP

29th March 2007

0 Uploads

35 Posts

0 Threads

#6 12 years ago

I just tested making a modified sawn-off shotgun and viper that fit in the pistol slot. using the above info and incluting:

"slot = 1 ; // primary"

for each in the unique_items file. Works great!




niphty

GF makes me horny

50 XP

28th March 2007

0 Uploads

102 Posts

0 Threads

#7 12 years ago

Part 3: So you want an SMG in that area where only pistols go? No problem!

Since changing the slot-use of a gun is a minor detail, one that moonracer1313 managed to sneak in while I was typing this beast :P I'm also using this space to give more detail on weapon modding. All of the options from the first post still apply, so I'll be skipping all of that and getting right into the harder parts.

inv_grid_height & inv_grid_width - these two options control the height and width of the item in inventory. I haven't fully tested these out just yet, but they should match the graphic of the weapon, overlap is bad!

slot - which slot this item occupies on your person. 1 is handgun, 2 is rifle. This is the option you edit to make a smaller item bigger or a big item smaller. Note: Other slots - 1 = knife, 4 = nades, 6 = armor. Artifacts go on the "belt" slot which apparently used to be slot 10! =D

animation_slot - according to the comments, this should be the action of the character's animation when firing. Slot 1 uses certain actions, while slot 2 others. I don't believe it matters from a first-person perspective.

hand_dependence - I believe this option can only be a 1. Presumably, a 0 would allow a character to dual wield guns, though the game doesn't seem to support it.

single_handed - 1 for yes, 0 for no. Either it's used in one hand, and the other's free, or it's not. Like above, I assume it's to dual wield in the engine.

control_inertion_factor - This value relates, in floating point, to how much the weapon slows (or accelerates) your control system. A heavier gun, with a higher inertia, will take longer to swing around. 1.0 is default. 0.5 makes your controls work twice as fast, while 2.0 makes them half as fast. This means as you roll the mouse left to right, a 1.0 would be normal, while 2.0 would take you twice the mouse work to get the same distance on screen, and a 0.5 would take half the mouse work. Be VERY careful as numbers too far from 1.0 quickly make the game difficult or just downright frustrating. Try a 0.01 once if you want to a real challenge =D

Next up is the cam section, which relates to accuracy. I haven't fully tested all of these, but this should give you a basic idea of how they work.

cam_relax_speed - To be honest, I'm not entirely sure what this does. It may be related to how quickly the camera returns to the player's control after you're done firing, or for bursts. To be honest, I set values all over the place and never noticed a major change in weapon handling.

These next three relate to the gun's recoil effects: cam_dispersion - Base value for the motion of the camera cam_dispersion_inc - Incremental value for camera dispersion. cam_dispersion_frac - a fractional value to help randomize the camera dispersion.

Essentially, these three contribute to how the recoil effects the player via camera movement. According to one of the notes in the game files, it works something like base times fraction, plus or minus base times one minus the fraction. The incremental gets added to base every in-game tick (unsure on the exact timing.. quarter of a second? a second?) and the function keeps running away. This boils down to one thing: A gun becomes less controllable the longer you keep it firing.

Now, the three more to wrap it up: cam_max_angle - This is the maximum angle the camera will go during a single dispersion. cam_max_angle_horz - This is how far the camera will rise before it will rise no more. Similar to above, except this only controls horizontal motion, and is a hard limit. If you lay on the trigger, the gun will rise only to this level then stop specifically rising in the horizontal. cam_step_angle_horz - This value is (angularly) how much the gun will rise per in-game tick while firing. A high value here (6+) is used more for a sniper rifle whilst a lower value (0.5) is used for a smaller SMG. This value is essentially a straightforward recoil kick upwards and always moves down to up.

Note: If you set certain cam values to zero, the game will freeze. The numbers I have below (which is about 1/100th of the originals) make a perfectly recoil-less weapon. There's no need for 0's.

Next are the add-on status conditions and affect what the gun is capable of. scope_status - Is there a scope? silencer_status - A silencer? grenade_launcher_status - A boom-boom launcher? =D

All three take a value of 0, 1 or 2. 0 means there is not one, and one cannot be attached. 1 means there is one permanently attached. 2 means that one can be attached.

Now, if you choose to silence your weapon by placing a 1 in the option, then the gun's parameters have no change, though you'll want to make use of the light_disabled & snd_shoot options to make sure the muzzle flash is suppressed and the appropriate sound is used. Look at my example and base weapon models for ideas on what you should put in the sound effect.

However, if you choose to use a 2, then you open up a whole new line of options for silenced operation. silencer_hit_power, silencer_hit_impulse, silencer_fire_distance, & silencer_bullet_speed - All four of these are the same as their non-silenced counterparts, except that they allow the modder to make the bullet's properties different when silenced. Typically, these values will be lower than the regular versions.

Similar to the inv_grid_x and y options, the scope_x, scope_y, silencer_x, silencer_y, and grenade_launcher_x & grenade_launcher_y control the type of add-on attached to the gun, while the _name option is used to define the name of the add-on.

Below is my modification of the MP5 "Viper". The accuracy is not 100%, closer to about 97%. This was done because, let's face it, we can't always put the crosshair on the target -exactly-, so a bit of leniency in accuracy actually helps out. The game only reports the accuracy at like 50% of maximum, but I'd rate it closer to 75%. It's no sniper rifle. But at ranges ~20 yards to it's pretty nasty still. =D I chose not to increase the MP5's already high rate of fire. But with clips of 100, you can spray all over and enjoy it. Range is up, and the kill level is super high, even with FMJ's =D It has built-in silencer, though to be honest I saw 0 difference in game with the sound level from a silenced gun and that of a regular one, which is pretty disappointing. :( Also there's no graphical difference in a silencer and not. But at least it sounds like you're a ninja with the silencer sounds!

[wpn_mp5-niphty_m1]:wpn_mp5 $spawn = "weapons\uniq\wpn_mp5_m1" description = enc_weapons1_wpn-mp5-niphty_m1 inv_name = wpn-mp5-niphty_m1 inv_name_short = wpn-mp5-niphty_m1 ammo_class = ammo_9x19_fmj, ammo_9x19_pbp inv_grid_x = 5 inv_grid_y = 33 cost = 10 ammo_mag_size = 100 slot = 1 animation_slot = 1 condition_shot_dec = 0.0 fire_dispersion_base = 0.005 control_inertion_factor = 1.0f cam_relax_speed = 0.65 cam_dispersion = 0.002 cam_dispersion_inc = 0.0005 cam_dispertion_frac = 0.004 cam_max_angle = 0.06 cam_max_angle_horz = 0.09 cam_step_angle_horz = 0.005 misfire_probability = 0.0 hit_power = 1.31, 1.35, 1.38, 1.41 fire_distance = 2000 bullet_speed = 4000 silencer_status = 1 light_disabled = true snd_shoot = weapons\w_ak74_shot1

Again, put that at the bottom of the weapons listing in your unique_items.ltx file. Also be sure to add in the encyclopedia entries:

Niphty Industries artifact-born MP5 Viper. Recoil is non-existant while a moderate bullet spread ensures the inaccuracy of the user is accounted for. Great for killing stuff up close and at medium ranges.Niphty Viper V1

Add those into the string_table_enc_weapons.xml in the /text/eng folder. And, as always, to add the weapon on the trader:

wpn_mp5-niphty_m1 = 1, 1

And that wraps up the majority of the weapons information. Next up: How to make an artifact that won't let you die! And later, Too lazy to actually make your own artifact? Tired of looser bandages not fixing all your wounds? Well we have the solution: ULTRA-BANDAGE! Because let's face it, the game's still a challenge if you actually have to reach up and press a button in the middle of combat to keep from dying. As a bonus, we'll also teach you how to bake the best bread in town! In case you'd rather have to actually go into your inventory to keep alive. Ohhh, there's a challenge for ya!




niphty

GF makes me horny

50 XP

28th March 2007

0 Uploads

102 Posts

0 Threads

#8 12 years ago

I'm going to derail my own mod post for a moment to discuss the practicality of modding itself. Most people say 'hey, how can I mod when I don't know nothing?' and I answer: Double negatives are bad. But, for those who don't care about grammar, I give you a short tutorial on the actual processing of modding.

Step 1: Learn the system you're going to mod. This is by far the single most important, time consuming, and downright frustrating part of the entire process. But once you know the system, you can build new stuff in mere moments!

When learning how the systems in the game actually worked, I used three versions of something to test. Version 1 is "normal" while Version 2 is "1/10th" the values of the normal item. Version 3 is "10x" the values of the normal item. Using the modified weapon posted above, plus two replicas of it shown below, I tested the various cam options:

[wpn_mp5-niphty_m2]:wpn_mp5-niphty_m1 inv_name = wpn-mp5-niphty_m2 inv_name_short = wpn-mp5-niphty_m2 ;fire_dispersion_base = 0.005 ;control_inertion_factor = 1.0f ;cam_relax_speed = 0.65 ;cam_dispersion = 0.002 ;cam_dispersion_inc = 0.005 ;cam_dispertion_frac = 0.004 ;cam_max_angle = 0.06 ;cam_max_angle_horz = 0.09 ;cam_step_angle_horz = 0.005

[wpn_mp5-niphty_m3]:wpn_mp5-niphty_m1 inv_name = wpn-mp5-niphty_m3 inv_name_short = wpn-mp5-niphty_m3 ;fire_dispersion_base = 0.005 ;control_inertion_factor = 1.0f ;cam_relax_speed = 0.065 ;cam_dispersion = 0.2 ;cam_dispersion_inc = 0.5 ;cam_dispertion_frac = 0.004 ;cam_max_angle = 0.06 ;cam_max_angle_horz = 0.09 ;cam_step_angle_horz = 0.005

The first thing you should note here is the semicolon ( ; ). Typically, this denotes a line which is commented out. This means the engine ignores anything after a semicolon. You should see these all over the text files, explaining things, letting you know where sections begin, etc. That's their typical purpose: to comment code. By commenting code, you ensure future tweaks or edits are a lot easier to perform, since you have a quick reference to what a line or value means to the engine.

That's basic programming there: how to maintain clean code with accurate comments. You'll note none of my items have comments, simply because they're modified versions in a special file for modded items. Originals have tons of comments, and you can use those to help guide you to the purpose of an item when learning how to mod said item :)

Now, you'll also note that version 2 and 3 have different values for several of the options. This relates to above, where you essentially change the value by a factor of 10 to help determine that item's role in the engine. By keeping the changes limited through commenting out lines (which the engine then falls back on the inherited item's properties for a value.. a key asset of Object Oriented Programming), you're able to see the effect of only a few items at once. If you changed all of the items above radically, then tested, you couldn't be sure exactly which option controls what.

You'll notice on both of the items above, I've failed to include a $spawn or description field. These will both default to the one for the m1 version. However, I changed the names of the guns to make sure which one I was tinkering with, then added that code into the weapons encyclopedia file.

Niphty Viper V2Niphty Viper V3

Of course, all three versions of the weapon had to be added to the trader, which you should well understand how to do by now :) Then, buy them, user my super suit above so you can carry them around, and then find a wall to test grouping, dispersion rates, and so forth on. You should end up with something that looks like this:

weaponstrial.jpg

Notice the considerable difference in the patterns from left to right as accuracy decreases. This tells you which weapon is closest to your goal, and you can make adjustments from there. All three of these test versions still had the vertical cam step turned on, so I could test the difference in the dispersion patterns while the gun slowly arced upwards on its own. The result, you can see, is a straight line in the version 1, with nearly no dispersion, and a wandering line in version 2, with a much more random pattern in version 3. Also notice that version 3 allowed less shots to be placed inside the box, simply because it had dispersed itself up up and away too quickly =D

The purpose of close-up tests as well as longer range is simply to see a small and medium scale effect side by side. Clearly the extremely tight grouping of version 1 vs the loose grouping of version 3 tells a pretty big tale from only 4 yards.

Anyway, I'm rambling, and that's the basics of learning how the engine works. Once you've learned, it's really just on to conceptualizing the purpose of your modded item, then getting down to making it, which my other posts should assist with =D




niphty

GF makes me horny

50 XP

28th March 2007

0 Uploads

102 Posts

0 Threads

#9 12 years ago

Part 4: Dabbling with artifacts!

These are fairly straight-forward items which don't need much explanation, as most of their detail was covered in the armor section. Remember the part about armor restore_speed? Well, the same goes with artifacts, except they actually work!

I'm not going to give a lengthy discission on anything here, just that I'm choosing to import the item's look directly from the Soul artifact, so I haven't bothered to retype them. You only need to add the properties you wish to change from the inheritor, no need to remake them all. Check the comments by the numbers for some dazzling data! =D Oh, and I can't confirm Satiety and Power restoration works. I still got hungry, and my suit takes care of power loss. But I left it in just in case :) Immunities on these operate off a 1.0 base multiplier. Numbers below 1 mean they reduce your exposure to that type of immunity, while numbers over mean they increase your exposure. Essentially: 1.5 = 50% more exposure, 1.0 = normal, and 0.5 = 50% less exposure. I didn't bother trying extreme numbers here, since my suit's pretty extreme already. Oh, and the first line is just because there was no artifact section of the unique_items.ltx, so I made a little header. :beer:

;artifact testing facility! yay \o/ [af_niphty]:af_soul description = enc_zone_artifact_af-niphty inv_name = af-niphty inv_name_short = af-niphty

cost = 50

health_restore_speed = 0.6 ; 600,000% radiation_restore_speed = -0.02 ; -200 radiation/tick satiety_restore_speed = 0.2 power_restore_speed = 0.2 bleeding_restore_speed = 0.2 ; 6667% Bleed restoration hit_absorbation_sect = af_niphty_absorbation

[af_niphty_absorbation] burn_immunity = 1.0 strike_immunity = 1.0 shock_immunity = 1.0 wound_immunity = 1.0 radiation_immunity = 0.5 telepatic_immunity = 1.0 chemical_burn_immunity = 1.0 explosion_immunity = 1.0 fire_wound_immunity = 1.0

Add that at the very bottom of the unique_items.ltx file and you're golden. Once again, let's put in some text for it..

Niphty's SoulThe first man-made artifact. Like its natural brothers, this artifact is crafted via a controlled and stabilized Whirligig anomaly. One has to wonder how Niphty Industries managed to force an anomaly to do their bidding, but one dares not ask. This item is made through a secret process, concentrating the naturally occuring Soul artifact into an item of unbelievable proportions. While it retains the look of the Soul, the user will immediately feel the effects of this artifact like someone had just pumped liquid, irradiated speed directly into their brain. The artifact itself seems to be powered by the radiation in the area, absorbing it out of the air at an alarming rate. Just pray it doesn't break.

Add this text to your string_table_enc_zone.xml file, at the bottom. Next up, let's get it on the market..

af_niphty = 5, 1

Add that under the [supplies_start] in your trade_trader.ltx file. You're not likely to need more than 1 throughout the entire game, but there's 5 to fill your belt =D You CAN still die if you take an exponential amount of damage in an extremely short time. But you pretty much have to try to make that happen. With 1 or 2 you can still die to rocket/sniper fire on Master during the last section of the game, after you leave the power plant if you do the emo ending. Typically, two snipers firing back to back is enough damage that it doesn't matter. Add to that a rocket launcher guy, and you're pretty much toast. I can think of one place where I died, but these are tweaked up a bit, and with 5.. yeah. Shouldn't be a problem unless they hit at the same instant, hehe.

Next up is a pretty short one, the Ultra Bandage. This bandage makes the game a TINY bit more balanced against you, since you have to actually WORK to use it. It'll also include the best bread in town recipe! Look for it.. next post! dun dun duuuuuun.




niphty

GF makes me horny

50 XP

28th March 2007

0 Uploads

102 Posts

0 Threads

#10 12 years ago

Part 5: Ultra-Bandages! or Bandage, Bandage, wherefore art thou mine bandage?

First off, a small rant.. If you haven't noticed, all of my items I've posted have been for those wanting to cheat the game. Not that I mind that, afterall, I'm posting them so that I won't get questions on how to make uber items. They're already there :) And people who want balance are willing to take the time and do it right themselves, and only ask questions when they're stuck ;) Regardless, there's something to be said for having to duck and cover long enough to bandage yourself in order to keep playing. That's why I decided to include this little tidbit.

As a side note.. I didn't bother to make a "custom bandage" like all the previous posts. In the section you WILL be modifying a normal game file, for which you should make a backup. The file is items.ltx in the /misc directory, like everything else useful :) Copy it to a safe spot, do something to keep it safe, so you can restore it if you need to.

What you'll want to do is search out [bandage] in that file. Below there you'll see the comment ;eatable item. Ok, so it was translated funny =D After that comes the seemingly obvious items you should edit.. you'll want them to look like this:

; eatable item eat_health = 1.0 eat_satiety = 1.0 eat_power = 1.0 eat_radiation = -1.0 wounds_heal_perc = 1.0 eat_portions_num = 1

Now, it should be pretty apparent what this means: health, satiety, and power all relate to the (percent) level to restore. 1.0 = 100%. Likewise, radiation works in the same way, but you'd like it to be negative :)

wounds_heal_perc - perc = percent. You want 100% of your wounds healed, right? :)

eat_portions_num - how many are consumed per keypress/inventory double-click. If you look at the comment in the original file, it looks like once upon a time a single press would have consumed 100 :) I guess it used to be measured in a much different scale, hehe.

As a side note, I found this extremely amusing:

;hud item hud = wpn_vodka_hud

But I've been known to have a dry sense of humor. Vodka-bandages, saving the world one lush at a time!

Now, if you want the best bread in town.. scroll back to the top of the items.ltx file and check out the first entry.. bread! Again, we want the eatable item stats.

eat_health = 1.0 eat_satiety = 1.0 eat_power = 1.0 eat_radiation = -1.0 wounds_heal_perc = 1.0 eat_portions_num = -1

Same as above, except note the eat_portions_num has gone negative! This doesn't mean you gain bread as you consume it (which would be cool. yes, I tried.) For some reason, the engine treats medical items differently than edible items. If you DO set the bread to a 1, to try to get a bread each time you eat one, the game ends up never putting bread into your inventory. That's right, just by existing the bread doesn't exist. Pretty wild, I know, but that's what it did to me. Honestly, it took me 5 minutes to notice the mountain of bread I'd picked up had poofed from my inventory :)

Now, you can browse through this file some more, and see the devices including the detectors and the rare vodka weapon at the very bottom. Maybe I'll try to make a mod for that! Forget nades, throw vodka! lol.

Next up: Taking requests. I'm working on a bit of a secret (maybe impossible) mod, and if it works I'll post it eventually. Otherwise, from here on out it's more about what kinds of questions you guys have, and what other simple modified items people might be interested in. I can't think of any more "uber-items" that I haven't given you a base example of just yet. Unless you want to know how to throw a nade like superman. I didn't include that one because, to be honest, it was useless. Sure, it looked great cocking a nade back and launching it miles up into the air, but it never came back. Good for a chuckle, but overall wasn't too useful.