Initially disabled?

Post » Fri May 27, 2011 7:25 pm

How do I make NPC's, Objects, etc... Start disabled? Like in Oblivion and FO3 you can check the "Initially disabled" Box. So I can then use the "NPC->Enable" Function later on.

Cheers.

Shadowform.
User avatar
Niisha
 
Posts: 3393
Joined: Fri Sep 15, 2006 2:54 am

Post » Fri May 27, 2011 2:24 pm

How do I make NPC's, Objects, etc... Start disabled? Like in Oblivion and FO3 you can check the "Initially disabled" Box. So I can then use the "NPC->Enable" Function later on.

Cheers.

Shadowform.


Could be simple... Or it could be complicated. Depends on what conditions you require.

For statics you would need to either run a global or place a marker with script attached in the cell to be referenced. If using an object that can hold a script this procedure becomes less complicated. For the sake of going slow at first lets look at a very simple method using the journal indexing:

Begin My_DisableINTShort Doneif (done == 1)    returnendifIf (menuMode == 1)    returnendifif (GetDisabled == 0)    if (GetJournalIndex, My_Journal < 10)        disable    endifendifif (GetDisabled == 1)    if (GetJournalIndex, My_Journal >= 10)        enable        set done to 1    endifendifend

User avatar
Gaelle Courant
 
Posts: 3465
Joined: Fri Apr 06, 2007 11:06 pm

Post » Fri May 27, 2011 10:40 pm

I'm very new to scripting, (i've only made 3 that work) but I came on here to ask the same question, but I fixed mine.
It's very very basic, and there's probably something that could be done to it, but it goes as so...

begin myscriptif ( GetJournalIndex <25 )     disableelseif (GetJournalIndex >= 25 )     enableendifend myscript


That worked for me, so if yours is that simple, you could try it till someone gives you better advice :laugh:
User avatar
casey macmillan
 
Posts: 3474
Joined: Fri Feb 09, 2007 7:37 pm

Post » Fri May 27, 2011 1:01 pm

Another option is to simply have the NPC disabled at the start of the game and not worry about the journal entry.

There is a script called "statrup" that exists as a run once script that says to put run once items in it, like disable NPCs. However, experinced modders seem to object to this use of the script, so to keep everyone happy, there is a simple script you can make that will handle it:
Begin DisableNPCscriptshort DoOnceif ( MenuMode == 1 )	ReturnendIfIf ( DoOnce >= 1 )	ReturnendIfIf ( DoOnce == 0 )	"YourNPCName"->disable	set DoOnce to 1	stopscript DisableNPCScriptendIfEnd DisableNPCScript

Save this script in your script editor (you will need to comment out the stopscript, save, then uncomment the stopscript and save again) and add the script to your startup scripts in the CS under gameplay > edit start scripts.

If you do it this way, you can choose from a variety of ways to enable the NPC later on, either with another script based on journal or an onActivate kind of thing, or dialgue.

The main difference between this script and the one offered by iwasavampireonce is that you can add many more objects and NPCs to this script if you find you need to, and it will only run once, whereas the journal based script will run that script constantly until the conditions are met.

Also, get Morrowind Scripting for Dummies version 9. It's really helpful, believe me, you won;t regeret it if you are going to do any scripting at all.
User avatar
Karine laverre
 
Posts: 3439
Joined: Tue Mar 20, 2007 7:50 am

Post » Fri May 27, 2011 2:32 pm

There is a script called "startup" that exists as a run once script that says to put run once items in it, like disable NPCs. However, experinced modders seem to object to this use of the script ...

If two mods modify that script, only the modifications of the last loaded mod will take effect, over-writing the other mods modifications to the same script. Don't touch it. Some experienced mod makers put a lot of effort into making sure their mods play nice with other peoples. Learn to do the same.
User avatar
Averielle Garcia
 
Posts: 3491
Joined: Fri Aug 24, 2007 3:41 pm

Post » Fri May 27, 2011 12:14 pm

If two mods modify that script, only the modifications of the last loaded mod will take effect, over-writing the other mods modifications to the same script. Don't touch it. Some experienced mod makers put a lot of effort into making sure their mods play nice with other peoples. Learn to do the same.

Well, there you go. Nobody ever bothered to tell me why it should be left alone, just to leave it alone. It's not a case of me not wanting to make mods play nice, and I respected their wishes even without knowing the reasoning behind it.
User avatar
Guy Pearce
 
Posts: 3499
Joined: Sun May 20, 2007 3:08 pm


Return to III - Morrowind