Jump to content

Scripting Help For Spawning


ToxicWhiteout

Recommended Posts

Sorry I'm making a second topic so soon, but I really need some help with this. I'm making a quest where a paranoid scientist wants you to get him parts for a project he's working on. Then when you get all the materials, a protectron spawns and starts following him around as a guard. I'm not great at scripting so I'm not entirely sure how to do this, but I know it has to do with the REF of the protectron. Can anyone help me?

Link to comment
Share on other sites

First, copy one of the existing protectrons under Creatures in the GECK and give it a Follow or Guard AI package and make the scientist the target. Drag the new protectron into the render window and place it where you want it to spawn. You need two things to use it in a script: 1) edit the protectron in the cell and select the Persistent Reference checkbox, 2) give it a unique name (typical convention is to add REF to the end of the object name, so if the Creature name is myProtectron, the name in the cell where you placed it would be myProtectronREF).

 

To make it "spawn", also select the "Initially Disabled" checkbox. Then in the script that "spawns" it (perhaps in the result script for a quest stage after the player delivers all the parts), use code like this:

myProtectronREF.enable
Link to comment
Share on other sites

 

First, copy one of the existing protectrons under Creatures in the GECK and give it a Follow or Guard AI package and make the scientist the target. Drag the new protectron into the render window near where it will ultimately be. You need two things to use it in a script: 1) edit the protectron in the cell and select the Persistent Reference checkbox, 2) give it a unique name (typical convention is to add REF to the end of the object name, so if the Creature name is myProtectron, the name in the cell where you placed it would be myProtectronREF).

 

To make it "spawn", also select the "Initially Disabled" checkbox. Then in the script that "spawns" it (perhaps in the result script for a quest stage after the player delivers all the parts), use code like this:

myProtectronREF.enable

Thanks so much! You've been very helpful and I really appreciate it :smile:

 

EDIT: It won't work. No matter where I put the script, it gives me error messages. I think it's a problem with the REF. What exactly is the REF? My object is named 00alexprotectron so the final script is:

 

setobjectivecompleted 00robot 20 1
rewardxp 800
AddReputation RepNVFollowers 1 3
player.AddItem caps001 50
00alexprotectronREF.enable
player.removeitem 00electronicemitter
but every time I try to make it work, it just acts as though it saved and then when I check it again, it didn't.
Edited by TheScout201
Link to comment
Share on other sites

  • Recently Browsing   0 members

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