Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

What is the best way to force a NPC to re-equip items?

For example:

 

- johnREF.RemoveAllItems somecontainerREF

 

... More code here ...

 

- somecontainerREF.RemoveAllItems johnREF

 

The first one remove all John's items to a container

The second remove all items to John again. The problem is, he equips only weapons, not clothes.

 

If i reload the game, he will equip the clothes.

if i open and close his inventory, he will equip the clothes

 

I need to re-equip John as soon as he gets his items again

Link to comment

The best way is for you to save the state before hand. You can do this with NX vars, a quest script, a scripted token, whatever. Then you can use EquipItem on everything that needs to be equipped. This will prevent him from trying to equip 5 different guns or armors, or from equipping things in his inventory that were not equipped when you removed them.

 

GetEquippedObject will let you get the IDs of everything he has equipped, before removing it all. Save the values somewhere. Then after you've given them back, EquipItem on any of them that are not null/0, and reset your saved values to 0 (so they do not interfere next time).

Link to comment

Alternate approach, although neither verified by me or necessarily better:  http://geck.bethsoft.com/index.php?title=Force_an_actor_to_equip_new_stuff  I just ran across that earlier today while looking up the answer to a different question.

 

Essentially, add an item, force an equip, force an unequip makes the actor reevaluate their items.

 

Trivia:  If you want the player's inventory to refresh, you have to add and then remove an item because only removing something "changes" the inventory.

 

 

Link to comment

Did some experimental exploration into using ceiling turrets on the weekend.

I found ceiling turrets don't stay on the ceiling, they fall due to gravity till their blue red box under the turret lands on something, you need to put invisible collision planes under them to keep them up.

Also if adding custom weapons to the turrets you need to add those weapons into the EmbeddedWeapons formlist for them to work.

Link to comment
  • 2 weeks later...

Anyone ever looked into how the "VEFR02NCRBad2MostWanted" or related quests really work?

 

I'm in the process of updating a mod from somebody that doesn't want release hassles. (As usual, updating any mod immediately produces 3 million problems!) Currently slaver NPC's are just dumped into leveled lists which is a major compatibility annoyance. I'm thinking of setting up some kind of system similar to the VEFRblah quest however I keep getting references to something about a "new system in P04". (Patch 4 maybe?) Check out the script "VEFR02NCRBad2QuestSCRIPT" to see what I mean. I'm assuming there's some kind of activators spread around somewhere that controls the NCR or Legion hit squads but I'm having no luck figuring it out at the moment.

 

Basically, the idea is to have slaver NPC's attack the player from a distance when NOT in a populated region. (They use special dart guns instead of the usual weapons. One too many hits and you're out. Rather neat setup actually.) I was hoping to hook into the existing vanilla setups but it's proving a tad elusive.

 

Another option could be to dynamically update the lists in game via NVSE. (Assuming that is possible with NVSE that is!)

 

Any thoughts? :angel:

Link to comment

From what I can tell vanilla just spawns death squads in a dummy cell as levelled npc's (but persistent refs), then occasionally sends one out to find the player on a package - to kill you, or just warn you. The others sort of follow that one on a package too, and combat is started from the greeting topic or whatever branches from there. Could be slightly different for Legion, or the other way around.

Edit: between the dummy cell & the travel to player, they enter a trigger (filter down "vef" in the activator list of the object window) that'll moveto them to one of several locations. And if after a while the dialog package hasn't brought the leader to the player, they're disabled & respawn somewhere else to start their journey, hopefully closer. I gotta say, there are probably easier methods of doing all this, without the ai always running too.

Link to comment

It does seem like a convoluted way to achieve something simple. Something I'm frequently running into with this mod. I think instead I can make a bunch of slaver encounters in a dummy cell, then move them all over the place. Another method might be just to spawn a slaver once in awhile near the player via a quest and give them an AI package to hunt down the player. Perhaps distant enough the player has a chance to zonk him first. Seems a lot simpler than whatever Jorge did with the NCR and Legion anyway! :angel:

 

Of course I'm running into even more fun. I wanted to make a black out scene in one of the slave cell locations. Black the screen, tie the player up (playidle) then brighten, then start dialog. I've got it all working now except the dialog! StartConversation refuses to run. Unless I zonk the black out part that is! *laughs*

 

Obviously I'm going to have to tone down my updates to this or it's never getting finished! :lol:

Link to comment

Can't you stick a MoveTo travel package in between StartConversation?  With StartConversation triggered on package end?  Then they should get up first.  Ignore me if I clearly don't know what I'm talking about, but that's how I solved it.

Link to comment

StartConversation. i.e. on a triggen zone like this:

 

begin ontriggerenter player

if doonce == 0

npcref.startconversation player

set doonce to 1

 

In the Goodbye topic, I must ResetAI or NPC will talk again and again. I must use ResetAI for so many things. Like for packages too, because evp inside a end result script on a dialogue or on a package end script has the result that npc doesn't evaluate. I always wondered why, since in any guide I read around everyone uses evp (like for followers). Anyway, it's not that bad for me using ResetAI, it's only unaesthetic since it breaks the current animation of the NPCs and they seem "jumpy".

Link to comment

I am such a noobie at this. I am trying to make sure my base programs are what is needed for this... modding thing everybody is talking about... :D

I am working my way through the various requirements and PU is one of them. However I want to be sure I am on the right page.. well at least have the right version

 

Get GECK PowerUp and install it:
Otherwise you are flying Blind for the silliest of errors, it will tell you what type of error and which line it is on 99% of the time, it's not perfect but it's a heap better than just wondering why it won't save.
http://newvegas.nexu...le.php?id=41642
Use the Forked version, not the original, it's out of date.

I didn't see a "Forked Version" on the link. Has it been updated or am I just missing something.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use