NPC's using added weapons

Post » Wed Aug 26, 2009 6:42 am

How do I manage to do this? for example

I added the assault rifle in and I want Generic NPC's to use it, such as fiends, convicts, powder gangers etc.

How would I go about doing it?

Thanks
User avatar
rebecca moody
 
Posts: 3430
Joined: Mon Mar 05, 2007 3:01 pm

Post » Tue Aug 25, 2009 8:46 pm

You've got to add it to the leveled lists for their weapons, just open the NPC's to see which list they use and drop it in there. But you shouldn't drop the weapon directly in, copy of of the (Weapon)COND lists and change it to your weapon so the don't all have perfectly maintained weapons.
User avatar
Heather Dawson
 
Posts: 3348
Joined: Sun Oct 15, 2006 4:14 pm

Post » Wed Aug 26, 2009 3:28 am

There's also a slight problem with just dropping it into the lists- it'll conflict with any other mod doing that. You need to write a script that adds it to the lists instead- the only way to have a script run not on an item/effect is by setting up a quest.

1. Set up your condition list, as Uglulyx said, and name it something like MyGunConditionList.
2. You now need to set up a list with that condition list, and some ammo- look at something like the WithAmmoLaserPistolNPC list to get an idea, then make a version using your condition list- named something like MyGunWithAmmo.
3. Make a quest, named something like "MyGunQuest", and check "Start game enabled".
4. Make a new script, that looks something like.
scriptName myGunQuestScriptshort Finishedbegin gameModeif( Finished )   returnelse   AddItemToLeveledList WhateverLeveledList01 MyGunWithAmmo 0 1   AddItemToLeveledList WhateverLeveledList02 MyGunWithAmmo 0 1 (repeated as many times as lists you want it on)   set Finished to 1   stopquest MyGunQuestendifend

The WhateverLeveledList should be replaced with the list you want your gun to be added to- you'll mostly be wanting to add it to lists like LL2Tier1GunsLegionRecruit, HVPaladinWeapons, FiendInt1WeaponGunNV- pretty much any list that has other WithAmmoXYZ entries.
4. Make sure that script's a quest script (top-right dropdown set it) then pick it as the script for your quest.
User avatar
Thomas LEON
 
Posts: 3420
Joined: Mon Nov 26, 2007 8:01 am

Post » Wed Aug 26, 2009 1:17 am

Thanks Uglulyx and Talkie Toaster

and Talkie Toaster Is this method similair for adding it to Vendors?

Edit: When I create a (for lack of me knowing what it's called) Greenbox thing it says would you like to add new form and I click yes it won't add it, how come?
User avatar
zoe
 
Posts: 3298
Joined: Sun Nov 12, 2006 1:09 pm

Post » Wed Aug 26, 2009 6:22 am

Yep, just add it to the greenbox/leveled lists for Vendors.

I don't quite get your second question. What are you doing?
User avatar
Hussnein Amin
 
Posts: 3557
Joined: Sun Aug 05, 2007 2:15 am

Post » Wed Aug 26, 2009 9:51 am


I don't quite get your second question. What are you doing?


I was trying to add a new leveled list/Greenbox by changing the I.D of one already there and when it asks if I want to create it I click yes, but it won't appear, it's as if I did nothing.
User avatar
Andrew Tarango
 
Posts: 3454
Joined: Wed Oct 17, 2007 10:07 am

Post » Wed Aug 26, 2009 11:13 am

Odd. Try refreshing the list by going to a different category and back to leveled items.
User avatar
JaNnatul Naimah
 
Posts: 3455
Joined: Fri Jun 23, 2006 8:33 am

Post » Wed Aug 26, 2009 1:36 am

Okay I was able to get the Leveled List to add and set up everything like you said could I please get you to look over my script to see if it's right, this is for adding it to vendors thought I should fix that up before doing NPC's

scriptName AssaultRifleGunQuestScript

short Finished

begin gameMode

if( Finished )
return

else
AddItemToLeveledList VendorContainerChet01 AssaultRifleCond 0 1
AddItemToLeveledList VendorContainerCliffBriscoe02 AssaultRifleCond 0 1
set Finished to 1
stopquest AssaultRifleGunQuest

endif

end


does everything seem alright?

edit What does it mean when it says

Do you want to save the current script?

Current =


I click yes but nothing happens it won't let me exit the script box unless I select no
User avatar
Lawrence Armijo
 
Posts: 3446
Joined: Thu Sep 27, 2007 7:12 pm

Post » Tue Aug 25, 2009 9:11 pm

I click yes but nothing happens it won't let me exit the script box unless I select no

thats cause your script doesnt work


how it would work:
scriptName AssaultRifleGunQuestScriptshort finishedbegin gameModeif finished == 0AddItemToLeveledList VendorContainerChet01 AssaultRifleCond 0 1 1  ;; 0 = level; 1 = count; 1 = condition at 100%AddItemToLeveledList VendorContainerCliffBriscoe02 AssaultRifleCond 0 1 1stopquest AssaultRifleGunQuestset finished to 1endifif finished == 1stopquest AssaultRifleGunQuest ;;set JaysusRules to 1endifend


however it still will not work because VendorContainerChet01 and VendorContainerCliffBriscoe02 are not leveled lists but containers, use
VendorContainerCliffBriscoe02REF.additem AssaultRifleCond 1 ;;REF because oyu need the containers reference ID not the object list ID
instead

but mind that this will be pointless as merchant containers often get respawned and your item wont be in them anymore... hence use leveled lists instead, to find an appropriate one for your merchant open his vendor chest and see which ones he uses
User avatar
Rach B
 
Posts: 3419
Joined: Thu Mar 08, 2007 11:30 am

Post » Wed Aug 26, 2009 5:44 am

Thankyou Jaysus I was able to get the script to save also did one for leveled Fiends.

I was wondering how do you tell if it is working?
User avatar
Carlos Vazquez
 
Posts: 3407
Joined: Sat Aug 25, 2007 10:19 am

Post » Wed Aug 26, 2009 10:06 am

if you see them running around with the stuff :P

but on a more serious note:

add the following line to your script right before the "endif":

player.additem f 1


if you get 1 bottle cap upon starting the game it worked... but of course that only works once since the quest and its script will only run once and then never again until you "rename/unload save then load" the mod so it gets started again...

that bottlecap trick works for most script tests btw, its good to have it if youre unsure about more complicated "if" statement like timers and such
User avatar
Juan Suarez
 
Posts: 3395
Joined: Sun Nov 25, 2007 4:09 am


Return to Fallout: New Vegas