Basic Modding with Playable Examples
This is a discussion on Basic Modding with Playable Examples within the S.T.A.L.K.E.R. SoC Modding, Mapping and Editing forums, part of the S.T.A.L.K.E.R. Shadow of Chernobyl category; Well, this should give people a basic start on a weapon by example. If you want, ignore the text outside ...
| S.T.A.L.K.E.R. SoC Modding, Mapping and Editing Want more info about a Mod? Making a Mod? Looking for Modders, Mappers, Skinners, etc.? This is your Spot! |
![]() |
| | LinkBack | Thread Tools | Rating: | Display Modes |
|
#1
| |||
| |||
| 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: Quote:
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.. Quote:
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 Quote:
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 Last edited by S.T.A.L.K.E.R.; March 29th, 2007 at 08:56 AM.. Reason: Made it a bit easier to read |
| Remove advertisements | |
| |
| |
|
#2
| |||
| |||
| 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. Last edited by moonracer1313; March 29th, 2007 at 06:23 AM.. |
|
#3
| ||||
| ||||
| Nice tutorial. I went ahead and made it a bit easier to follow though, you kinda had things a jumbled together
__________________ ![]() You have all failed me..... ![]() |
|
#4
| |||
| |||
| 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 :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 Quote:
Quote:
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: Quote:
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! Last edited by niphty; March 29th, 2007 at 12:56 PM.. Reason: minor corrections :P |
|
#5
| ||||
| ||||
| 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. |
|
#6
| |||
| |||
| 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! |
|
#7
| |||
| |||
| 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!Quote:
Quote:
Quote:
|
|
#8
| |||
| |||
| 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: Quote:
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. Quote:
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:![]() 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 |
|
#9
| |||
| |||
| 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. ![]() Quote:
Quote:
Quote:
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. |
|
#10
| |||
| |||
| 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: Quote:
![]() 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: Quote:
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. Quote:
![]() 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. |
![]() |
| Bookmarks |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | Rate This Thread |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| basic modding | kathmondar91 | DoW Modding and Editing | 18 | January 21st, 2007 06:39 AM |
| Basic Modding | [Sonic]uk | ST:A2 Modding, Mapping and Editing | 6 | May 31st, 2006 04:50 AM |
| basic modding utilities/tutorials... | Grover | ST:SC3 Modding, Mapping and Editing | 3 | September 23rd, 2004 07:54 PM |
| Possible Examples | McCleod | SW:JK3 Modding, Mapping and Editing | 0 | October 15th, 2003 03:12 PM |
All times are GMT -7.












:
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!





Linear Mode

