swk3000 Posted August 13, 2015 Share Posted August 13, 2015 I'm working on a minor mod, and most (actually, all) of what I need to do to get what I want done is scripting. I think I'm doing everything okay, and that this is going to work how I want, but I want to double-check before I fire it up, as I'm afraid that something I've missed might completely screw up my game. And, since I'm planning on uploading this to the Nexus, the game of everyone who downloads it. The idea of the script is pretty simple: when Doc Mitchell hands you a weapon based on your TAG skills, I want him to also hand you one of the Merc outfits. The one you get is appropriate to your preferred weapon, as determined by the skill bonuses added to the outfits by the jsawyer mod. So a character who TAGs Guns will get the Merc Grunt Outfit, while a character who TAGs Explosives will get the Merc Troublemaker Outfit. In addition to handing you the armor, it's also auto-equipped, just like what happens when he hands you the Vault 21 Jumpsuit in the normal game. I found the script used to do this (credit to Ladez for pointing me to it; I wouldn't have found it otherwise), and have made some changes to it. It now looks like this: SetObjectiveCompleted VCG01 50 1 AddNote VMQ01CourierNote ; Basic starting equipment for all players player.additem Stimpak 4 player.additem caps001 18 if (IsPlayerTagSkill Lockpick) player.additem Lockpick 12 else player.additem Lockpick 6 endif if IsPlayerTagSkill Guns player.additem CondNV9mmPistolLoot 1 player.additem Ammo9mm75 60 player.additem OutfitMerc05 1 player.equipitem OutfitMerc05 elseif IsPlayerTagSkill EnergyWeapons player.additem CondLaserPistolLoot 1 player.additem AmmoSmallEnergyCell75 25 player.additem OutfitMerc03 1 player.equipitem OutfitMerc03 elseif IsPlayerTagSkill Explosives player.additem LootNVDynamite75 8 player.additem OutfitMerc02 1 player.equipitem OutfitMerc02 elseif IsPlayerTagSkill MeleeWeapons player.additem CondNVStraightRazorRaider 1 player.additem OutfitMerc06 1 player.equipitem OutfitMerc06 elseif IsPlayerTagSkill Unarmed player.additem CondNVBoxingGloveLoot 1 player.additem OutfitMerc04 1 player.equipitem OutfitMerc04 else player.additem CondNV9mmPistolLoot 1 player.additem Ammo9mm 75 30 player.additem OutfitMerc01 1 player.equipitem OutfitMerc01 endifLike I said, it looks pretty solid. Every skill gets the appropriate armor, and it's auto-equipped. If they don't TAG any weapon skills, then they get the Merc Charmer Outfit instead. No matter what, it's auto-equipped. Also, I've added a semi-colon in front of the script lines that add the Vault 21 Jumpsuit to your inventory and auto-equip it, so by my understanding, those lines won't be run. So the player character will only get one of the Merc outfits, as determined by their stats, but will not receive a Vault 21 Jumpsuit. It's my understanding that these aren't unique, so I don't feel bad about depriving them of it. Also, I'm not sure what will happen if a player TAGs multiple weapon skills. I'm hoping that the script runs in order, so if they TAG Guns and Melee, it will add the Merc Grunt Outfit to their inventory, equip it, then add the Merc Cruiser Outfit to their inventory, and when that one is equipped, it will unequip the Merc Grunt outfit. I do plan on testing that once I have confirmed that the script is fine, but I suppose it bears mentioning in case it might be a problem. Anyway, does everything look good, or is there some minor rule of scripting that I've missed that is going to cause my motherboard to re-create the Great War? Link to comment Share on other sites More sharing options...
Ladez Posted August 14, 2015 Share Posted August 14, 2015 If/else statements work by running the first condition that evaluates to true and skipping all the rest. So if the player tags both guns and melee weapons, then he will only receive the gear for guns, since that is the first true condition. If you want it to add multiple sets of gear in succession, then you need to split the single if statement into several if statements that are all evaluated separately. Your script looks good btw, no glaring errors that I can see. Link to comment Share on other sites More sharing options...
swk3000 Posted August 14, 2015 Author Share Posted August 14, 2015 Cool. Thanks for the input. I'm okay with the player only getting one armor when tagging two weapon skills, so I'll go ahead and leave it be. Thanks again for the input. Link to comment Share on other sites More sharing options...
Recommended Posts