RaffTheSweetling Posted March 16, 2014 Share Posted March 16, 2014 (edited) Hi guys, I am hopeless at scripting, and I need to know how to write a script to trigger initially disabled enemies in FO3. I tried with a simple script but "mynpcref.enable" did not work and I kept getting errors telling me that that command was not right. Please someone help. Thanks heaps Griffin Edited March 16, 2014 by RaffTheSweetling Link to comment Share on other sites More sharing options...
Jason210 Posted March 16, 2014 Share Posted March 16, 2014 (edited) Could it be that Persistent Reference is not checked for the new reference? This makes the reference accessible by scripts. The workflow for all this is:Make a copy of the disabled AI form by opening it and renaming its ID. GECK will ask you if you want to create a new form. Say yes. Drag the new AI form into the render window to create a reference of it. Double-click on the AI, to bring up the reference dialogue box. Give the reference a Reference Editor ID in the first box. This is should be unique name and which you can easily identify later. At the bottom of the dialogue, make sure initially disabled and persistent reference are checked.You should now be able to access the new reference AI object, using its Editor ID, from a script. To enable the object, you need a line like: [editor ID name].enable That has to go in the script that triggers it. The trigger could be an activator such as a box, with a script attached. The script might look like this scn SpawnGriffinsAI SCRIPT short doOnce begin onTriggerEnter player if doOnce == 0 [editor ID name].enable endif endThe doOnce variable makes sure the code is only executed once, and not every time you walkthrough it. SpawnGriffinsAI is the unique name of your script. /Jason Edited March 16, 2014 by Jason210 Link to comment Share on other sites More sharing options...
RaffTheSweetling Posted March 16, 2014 Author Share Posted March 16, 2014 Awesome, gonna try this right now. Thanks, Jason.If I intend to spawn several enemies from the one trigger, how can I write each enemy's REF into the script line 5 please, mate? :) Griffin Link to comment Share on other sites More sharing options...
RaffTheSweetling Posted March 16, 2014 Author Share Posted March 16, 2014 I'm thinking just go with the "enable parent" option. Will try that right now too. Link to comment Share on other sites More sharing options...
RaffTheSweetling Posted March 16, 2014 Author Share Posted March 16, 2014 That worked beautifully. Thanks so much! I have big plans for this script in my current project "Heritage Home Part 2". You saved the day, Jason. :) Link to comment Share on other sites More sharing options...
Jason210 Posted March 16, 2014 Share Posted March 16, 2014 (edited) Glad to help - good luck with the project! All I do is make lists like this: scn SpawnGriffinsAI SCRIPT short doOnce begin OnTriggerEnter player if doOnce == 0 [editor ID name#1].enable [editor ID name#2].enable [editor ID name#3].enable [editor ID name#4].enable [editor ID name#5].enable endif end Not very elegant but it works. I guess enable parent will work too but I've never tried it. Edited March 16, 2014 by Jason210 Link to comment Share on other sites More sharing options...
vforvic Posted March 16, 2014 Share Posted March 16, 2014 Just a word of warning that using the Enable Parent can be a little glitchy at times. At least in my experience you can sometimes get strange side effects. Nothing I can ever really put my finger on as far as a cause, but just strange bugs where things do not work as expected. I still use it at times, but not so much with NPC's. Just something to keep in mind if you ever run across one of those bugs the GECK seems to have where you cannot workout why it is not working when it should. Link to comment Share on other sites More sharing options...
RaffTheSweetling Posted March 17, 2014 Author Share Posted March 17, 2014 That's good to know, Vforvic. Thanks for that. And thanks also Jason for the second script. I would like to prevent glitches, so I will use your method. :) Cheers, guys! Link to comment Share on other sites More sharing options...
Recommended Posts