Scripting

Post » Tue Sep 15, 2009 4:58 am

Hi, I am just starting a mod part of which will revolve around a gun with a script effect.

To test the gun in question, I have writen a temporary script to pop it straight into my players inventory. Or at least I think I have, but nothing seems to be working.

Gun Details

Editor ID: DPMesmapulse
Form ID: 01000ADE

Script Being Used:

ScriptName DPMesmaPulseAddshort DPMesmaRunOnceBegin gamemodeif DPMesmaRunOnce != 1    player.additem DPMesmapulse 1    Set DPMesmaRunOnce to 1endifend


Its a fairly standard gun at the moment, it is in fact just a renamed plasma pistol for now.

I have also tried to use the console to bring it in, but it then says that it can't find that object ID so I suspect the problem is in my method rather than a bug, but I can't for the life of me see what I have done wriong.

(For the record, yes I have checked that the .esp is active)
User avatar
Star Dunkels Macmillan
 
Posts: 3421
Joined: Thu Aug 31, 2006 4:00 pm

Post » Tue Sep 15, 2009 2:51 am

Have you included that script as a Quest Script with the quest marked to start on game start?
User avatar
Catherine N
 
Posts: 3407
Joined: Sat Jan 27, 2007 9:58 pm

Post » Tue Sep 15, 2009 12:12 am

Scripts on items only run when the item is in use, IE Equipped on ingested, etc.

To get an item to be added to the inventory when you start the game, you need a quest script because they run globally.
User avatar
Sarah Edmunds
 
Posts: 3461
Joined: Sat Jul 08, 2006 8:03 pm

Post » Mon Sep 14, 2009 8:27 pm

Thanks guys, thats a very good point. Will fix that now. (Haven't written a mod since Oblivion!) Doesn't explain why the console couldn't find the item using the form ID though. Ahhh well, cross that bridge when we come to it.
User avatar
Flutterby
 
Posts: 3379
Joined: Mon Sep 25, 2006 11:28 am

Post » Mon Sep 14, 2009 11:27 pm

(As a side note, with the quest in place, the script is putting the weapon in place as intended. Now to make the weapon work as intended...)
User avatar
Mark
 
Posts: 3341
Joined: Wed May 23, 2007 11:59 am


Return to Fallout: New Vegas