Simple Disable/enable object script

Post » Sat May 28, 2011 4:49 am

I'm sure its easy, but I am a total scripting dunce and need such a script for a tavern mod I'm making. UNless there is some kind of basic Morrowind script generator (ala that neverwinter nights tool) available for download? Any help would be appreciated.
User avatar
Chris Jones
 
Posts: 3435
Joined: Wed May 09, 2007 3:11 am

Post » Sat May 28, 2011 8:52 am

declare a short variable. this will be your "state". it will have the value of 0 or 1, starting at 0 by default. decide what you want as a "trigger". then use a conditional (an "if" line) that when triggered changes state to 1. the next part of the script will be an if/elseif block checking state. if state is 0 disable, if state is one enable.

scripting isnt too hard, it's basically stringing console commands together.

while i know of nothing that will autogenerate scripts for you, i do know of a good document to get you started scripting for yourself - Morrowind Scripting for Dummies (vol 9). tis invaluable, i have it open at all times when i'm scripting something.
User avatar
Jay Baby
 
Posts: 3369
Joined: Sat Sep 15, 2007 12:43 pm

Post » Sat May 28, 2011 7:25 am

assuming myNPCid is your unique NPC id and myObj the id of your related object, attaching a local script like this to myObj should work
begin myObjScriptif ( GetDisabled )   ; obect is disabled    if ( myNPCid->GetDisabled == 0 )   ;  NPC is enabled        enable   ; so enable object    endif    returnendif; object is enabled here if ( myNPCid->GetDisabled )   ; NPC is disabled        disable  ;  disable object endifend

User avatar
KRistina Karlsson
 
Posts: 3383
Joined: Tue Jun 20, 2006 9:22 pm


Return to III - Morrowind