Jump to content

NPC Spawning Script


SpetsnazDude

Recommended Posts

Hello! :D

 

Recently I've been getting into scripting in the G.E.C.K.; not proper scripting but just some edits there and there.

 

And I've been wondering how to do a certain thing that I found in a Fallout: New Vegas mod:

 

Basically I want an item (probably an editable / activated item) that will show a menu; with this menu you have options in which when selected (options for NPC spawns) will spawn certain NPCs from afar.

 

The mod I found this in is the 'LegionCommander" mod in F:NV. I've looked at some of the script and seen how it's based off but I would like some help making the script; as far as I know it uses NVSE (FOSE) from commands such as 'IsKeyPressed' which is probably something I'll need to add.

 

So here's a recap on the script I need help on / trying to make:

 

An item is spawned in your player's inv, this item when pressed (or consumed..) opens up a menu, this menu has certain options shown on it and when one of those options is pressed - let's say 'Enclave Squad' - it will spawn a group some distance away from you. (Or maybe having a total of NPCs you can spawn in which adds up as a total - similar to the Enclave Commander 0.9 version: in which it shows a total of NPCs you can spawn at that time.)

 

Hopefully someone will help me as I'm going off to bed now.

 

-Spets :dance: :thumbsup:

 

Link to comment
Share on other sites

What you've asked for isn't merely a script but an entire process.

 

An item is spawned in your player's inv

Use Player.addItem to spawn inventory objects.

 

this item when pressed (or consumed..) opens up a menu

You'll need to create the menu in the Geck using a message object and then show it by placing an effect on the comestible that utilizes a script archetype. You don't NEED FOSE for this. You would need FOSE if you wanted to spawn via hotkey and not use a menu at all.

 

it will spawn a group some distance away from you.

Spawning is easily accomplished using the PlaceAtMe command.

 

(Or maybe having a total of NPCs you can spawn in which adds up as a total - similar to the Enclave Commander 0.9 version: in which it shows a total of NPCs you can spawn at that time.)

 

You may want to create a quest with a quest script to track the number of spawned actors. I have done something similar and in doing so, created custom versions of the actors that ran scripts. Each time a new actor was spawned, a value in my quest script was incremented. Each time one of those actors was killed an OnDeath block ran which decremented that same quest script variable. Spawning new actors was limited via the quest script when the total number of existing actors was above a defined threshold.

Edited by pkleiss
Link to comment
Share on other sites

  • Recently Browsing   0 members

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