Simple Disableenable object script

Post » Mon May 07, 2012 4:09 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
Oceavision
 
Posts: 3414
Joined: Thu May 03, 2007 10:52 am

Post » Mon May 07, 2012 2:44 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
matt oneil
 
Posts: 3383
Joined: Tue Oct 09, 2007 12:54 am

Post » Sun May 06, 2012 10:39 pm

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
Jeremy Kenney
 
Posts: 3293
Joined: Sun Aug 05, 2007 5:36 pm


Return to III - Morrowind