Jump to content

Recommended Posts

Posted

Hiya :)

 

here`s what came to my mind:

I want to have a button on one point in the room, that spawns an NPC in another point of the room. That NPC has to stand there and do nothing, just being an human target vor VATS and "first person".

Creating the NPC per se won`t be a problem, methinks, but i want it to spawn/de-spawn (either the NPC or his remains) on the press of a button.

 

So how could a script look like that spawns/de-spawns an object (e.g. glass flask for target practice) and/or an NPC or creature?

 

thanks in advance :)

Posted
I too am curious as to how this could be done, but for a different purpose. I'm wanting to make a training room, and set it so that activating a terminal would spawn a bunch of enemies, and opening the door and going through to leave despawns them. I'd imagine this would involve scripting, as I see nowhere else the ability to make things like conditional switches or etc. Any ideas?
Posted

The easiest way is to make the NPC a persistent reference and two other items too,like 2 bottle cap, and put the cap where you want the NPC to spawn,and the other where you want him to be while not "used".

Then on the activator ...use a OnActivate Begin, an use a "short once" to control if the NPC is there or not.

When you want the NPC to appear,use resurrect on him,then enable him and finally use [moveto "Persistent Ref Cap" x y z] (you may need to adjust these 3) to put him in place.

To de-spawn, disable him then move him to the other "Persistent Ref Cap"...

something like that:

 

Scriptname "Name..."
short toggle

begin OnActivate
if toggle == 0
"NPCRef".resurrect
"NPCRef".Enable
"NPCRef".Moveto "Cap Ref"
set toggle to 1
else
"NPCRef".Disable
"NPCRef".Moveto "The other Cap Ref"
set toggle to 0
endif
end

Posted
I have absolutely no scripting experience...would I save this as a script in the GECK, then make, say, the terminal (when an option is selected) run this script after substituting the refids? I have no clue :\
Posted

Basically this...

if you want to spawn lots of creatures,for every creature,copy the script part

 

"NPCRef".resurrect

"NPCRef".Enable

"NPCRef".Moveto "Cap Ref"

 

and

 

"NPCRef".Disable

"NPCRef".Moveto "The other Cap Ref"

then you need to create more persistent refs so they don't spawn all in one place and Crash... One position for every creature.

Read some tuturials and you will understand better.

Posted

Thanks Aragron, this was exactly the answer i was hoping for :)

 

Another question: would this in principle work with lightsources, too?

 

 

Edit: Name corrected :)

seems Lord of the Rings is somewhat hardwired to my brain :laugh:

Posted

hmm ... i`ll may have to play Zeta sometime *g*

 

anyhow, i got it to work (after i nav-meshed the rooms *g*), now only the switch doesn`t visually change.

It does what it should, spawn, de-spawn but it doesn`t go on and off ....

 

as for the light, thanks for the link, maybe i couple the light to the target ... definitely helpful :)

Posted
Forgot to tell... the command Moveto can be used with the coordinates x y z, like Ref.Moveto player 10 0 10... For the switch,if you are using a World Objects Activator ,there should be an animation already,if you are using an static object or other,to make it move you need to place 2 in the same space,then enable one and disable the other.
  • Recently Browsing   0 members

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