Scripting - Adding Scripts

Post » Sat May 28, 2011 7:59 am

Simple question.......How do you add a script to a creature/NPC/etc., that already HAS a script applied to it? There are certain creatures/NPCs that I'm trying to add a universal script to, and most of them already have a script attached to them.
User avatar
Ashley Clifft
 
Posts: 3468
Joined: Thu Jul 26, 2007 5:56 am

Post » Sat May 28, 2011 8:35 am

Simple question.......How do you add a script to a creature/NPC/etc., that already HAS a script applied to it? There are certain creatures/NPCs that I'm trying to add a universal script to, and most of them already have a script attached to them.

You would have to incorporate your script into the existing script.
For some simple commands, you can also use attach a script elsewhere in the cell (like an invisible Activator) that can affect the NPC/Creature. Ensuring that the script doesn't conflict with the original script.
User avatar
lucile davignon
 
Posts: 3375
Joined: Thu Mar 22, 2007 10:40 pm

Post » Fri May 27, 2011 10:28 pm

You would have to incorporate your script into the existing script.
For some simple commands, you can also use attach a script elsewhere in the cell (like an invisible Activator) that can affect the NPC/Creature. Ensuring that the script doesn't conflict with the original script.

Ok........Take, for example, this. How would I incorporate a script to permanently disable this creature's respawn ability into the script that it, for some odd reason, needs in order to be "properly afflicted" with disease? The "spells" for diseases already appear in creature spell lists, so.........Is this script even really necessary for anything at all?

Begin diseaseAscendedDontSaveObject;ascended sleeper has all the blight diseases for some reason...if ( CellChanged == 0 )    returnendifAddSpell "ash woe blight"AddSpell "black-heart blight"AddSpell "chanthrax blight"AddSpell "ash-chancre"End

User avatar
Vicki Blondie
 
Posts: 3408
Joined: Fri Jun 16, 2006 5:33 am

Post » Fri May 27, 2011 9:58 pm

While I don't know for certain, I believe that script makes sure that the creature has the diseases no matter what cell they are in.

Generally though, since scripts take time and effort to write, and more time and effort to test, you can presume there is a reason for a script to be attached to a particular thing. If you do away with a seemingly useless script, It can be quest breaking and you'll never know it until you try to do whatever quest it was.
User avatar
Suzie Dalziel
 
Posts: 3443
Joined: Thu Jun 15, 2006 8:19 pm

Post » Sat May 28, 2011 2:22 am

Ok........Take, for example, this. How would I incorporate a script to permanently disable this creature's respawn ability into the script that it, for some odd reason, needs in order to be "properly afflicted" with disease?
If this is what you need to do, then you don't need a script to do it (in fact, I think you *can't* do it through a script). What you need is to open creature's description and uncheck the "Respawn" checkbox.
User avatar
Alkira rose Nankivell
 
Posts: 3417
Joined: Tue Feb 27, 2007 10:56 pm

Post » Fri May 27, 2011 10:40 pm

How would I incorporate a script to permanently disable this creature's respawn ability

[EDIT]too late
That's more a leveled list behavior, I'd try checking corpses persist, if you can't get rid of the corpse it should not respawn so soon
[EDIT2]well, as ascended sleeper seems to have no respawn checked, maybe this can still be something to try
User avatar
Elizabeth Davis
 
Posts: 3406
Joined: Sat Aug 18, 2007 10:30 am

Post » Fri May 27, 2011 10:51 pm

It sounds like you want to change the ascendant sleepers to not respawn in a particular cell. The creatures themselves do not actually respawn. Instead a leveled creature list, the ninja monkey in the CS generates a new sleeper after the last sleeper despawns. There are two approaches to resolve this.

1) replace the Leveled Creature List with an activator that will place one ascendant sleeper and then stop functioning.

2) create a duplicate cell and script the doors going into this cell to go to your emptied cell after the first visit.

I strongly recommend the 1st solution as the later has a whole host of flaws.
User avatar
Cathrine Jack
 
Posts: 3329
Joined: Sat Dec 02, 2006 1:29 am


Return to III - Morrowind