[I suggested that Dagoth Murdock put this as a public thread so that other people could benefit from my suggestions/guide/thing if they are considering a similar thing; rather than just keep it limited to a pm.]
This is fairly advanced stuff youre trying to do now. This situation cannot be controlled by one script, it will require MANY scripts. Its almost too complex to try and explain in one reply.. but i'll see what i can do. Im not sure you'll be able to just jump into this and get it to work, and to be honest im too busy to constantly help out, your probably better off bringing this to the attention of the community who can give more consistent advice. There are one or two things of this process that are a little hazy in my mind too, so i might not get it right, since its been a little while since ive done it
1. This will need to be controlled by journals. Lets assume youve used the Quest/Journal id: DM_Fire. This is the id that appears in the quests list. Then you'll set up the stages of that quest and I suggest seperating them out like this (at a minimum):
Spoiler [Mission tells you to set fire to barrel] 10
[You set fire to barrel, need to run away] 20
[Fire will have worked, go back now] 30
[The building is destroyed] 40
These are the stages i will use in the scripts, so if you change this or add things in before them, change everything accordingly.
2. The first part will require a unique barrel in the Activators list; not a static item. You can do this by seeing what mesh the barrel uses in the Static list, then creating a new Activator in the Activator list and, by using the CS disk with the data files, sort through until you find the Barrel mesh. This means you will have a barrel that you can attach a script to, which is what we want. When it is made call it something like DM_Barrel. [im just using DM as an example, you should always use your own prefix for new items in your mods; for example i use "alx_". But you need something different to other people, preferably. DM_ is good.
3. Now you need to find an actual fire which i suspect are in the Activators list, but if they arent, and are instead in the Static list, simply make a new Activator just like the barrel and recreate the fire as an activator. I highly suspect there will already be a fire item in the Activator list somewhere. Rename it DM_BarrelFire or something.
4. Now, you need to make the Undamaged Building. Unfortunately this is where things get very complex. Instead of using the Static building components like you would use in any other building, you need to make new Activator equivilents. So if you were going to use one of the Hlaalu Building exteriors, you must check out what mesh/model it uses, and then recreate a new Activator using that mesh in the Activator list. This is tedious so make sure your building isnt too complex on the exterior. We do this because we have very little control over Static items and Activators are the only way to do this. This process will take some time so be slow and methodical, dont make any mistakes. When all the components are in the Activator list you want construct your building wherever you want the way you want it. Also take this time to make a new Interior Cell and do that part. The Interior can be whatever you want and be built normally, because we can control interiors much easier.
5. Now, unfortunately we have to do it all again for what you want the
damaged exterior to look like. If you are using the Imperial models (making an Inperial building) then this whole mod would be much easier bacuse there are already 'destroyed' components so its easier to make the building look destroyed. Think of Fort Frostmoth after the werewolf attack -> infact this is exactly what we are trying to recreate. When the Destroyed Building components are all in the Activator list, make the destroyed building next to the Undamaged Building and when it is done select it and SLIDE the building over the other. This will look silly, with two buildings in the one spot, overlapping and such, but if everything works well, only one building should be visible at one stage. When the old building is destroyed, it will dissappear and the new destroyed on will appear, making it look like it was damaged, etc.
6. Now, inside the interior cell, place the Barrel somewhere and ontop if it, as if it were on fire, place the Fire. What will happen, is that when you light the barrel, the fire will be enabled and will appear, looking as though you just set it on fire. One other thing regarding the Doors in and out. Feel free to set up a normal door exiting from the Interior cell, but DONT set up a door going inside the building. Instead, recreate the Door you want as an Activator and we'll get back to that stage later on. Place this Activator door object on the outside as you would normally, but dont set it to travel inside (not that you would be able to anyway), we'll get back to this.
6. Ok thats the ground work done, now we need to knock up some scripts. I admit that i suspect you are not ready for this (no offence) so i can foresee that you will just plow through this without any understanding, just blind faith. I guess thats a shame but do try and look at what your doing and writing and learn from it. Look at the scripts and try and see what it being programmed [tip of the day ^_^ lol]. So, anyway:
a. The script for the Barrel:
Spoiler Begin DM_Barrel_SCRIPT
if ( OnActivate == 1 )
if ( GetJournalIndex DM_Fire == 10 )
if ( Player->GetItemCount "torch" >= 1 )
Journal DM_Fire 20
PlaySound "Torch Out"
MessageBox "You set fire to the oil! You should run away back to (somewhere) before someone finds you!" "Ok"
Return
elseif ( Player->GetItemCount "torch" < 1 )
MessageBox "You need a torch to set fire to this barrel"
Return
endif
elseif ( GetJournalIndex DM_Fire < 10 )
MessageBox "This barrel is full of flammable oil"
Return
endif
endif
End
b. The script for the fire:
Spoiler Begin DM_Fire_Script
if ( GetDisabled == 0 )
if ( GetJournalIndex DM_Fire < 20 )
Disable
endif
elseif ( GetDisabled == 1 )
if ( GetJournalIndex DM_Fire >= 20 )
if ( GetSoundPlaying "fire" == 0 )
PlayLoopSound3DVP "fire", 1.0, 1.0
endif
Enable
endif
endif
if ( GetJournalIndex DM_Fire < 10 )
return
endif
End
c. Below is the script that you must attach to every Activator component of the Undamaged Building (except the Activator Door):
Spoiler Begin DM_Undamaged_Script
if ( GetJournalIndex DM_Fire >= 30 )
Disable
endif
End
d. Below is the script to attach to every Activator component of the Damaged Building.
Spoiler Begin DM_Damaged_SCRIPT
if ( GetDisabled == 0 )
if ( GetJournalIndex DM_Fire < 30 )
Disable
endif
endif
if ( GetDisabled == 1 )
if ( GetJournalIndex DM_Fire >= 30 )
Enable
endif
endif
End
7. Ok so thats the majority of easy script work done. From here things can be done in MANY different ways. Lets first deal with the entry door. The door will not be a traditional door, because it must dissappear when the building is destroyed, yet still work as a door before. So i simply include a teleport script inside the one used for the Undamaged Building. Now this is where things get tricky for you because you must determine the coordinates of the space just inside the door of the Interior Cell where you want to appear (asif you went thru the door like normal). I do this by placing something like a North Marker where i want to teleport, then double clicking and writing down the X, Y, and Z coordintes. When you do this, simply put these numbers in their spot in the script below. Lets also assume your interior cell id is "Interior Cell". Whatever you name it will need to replace this in the script below.
Spoiler Begin DM_Door_SCRIPT
if ( OnActivate == 1 )
PlaySound "mysticism area"
Player->PositionCell, 743 (xcoord), 4085 (ycoord), 249 (zcoord), 90 (this is rotation, use whatever the North Marker does), "Interior Cell"
endif
if ( GetJournalIndex DM_Fire >= 30 )
Disable
endif
End
8. Now we need to make it so that the building only burns down when the player isnt looking. I suggest that you make it so the players has to run back to the quest giver, report the fire and then is sent back (to do whatever). That means you will have dialogue with the Journal condition for DM_Fire at 20 (after you set the fire) for the quest giver to make him say something like "oh good its on fire, now please go back". And then in the conditions box put "Journal DM_Fire 30". This should trigger all the scripts and make the buildings change over, also denying you access to the interior from now on (cos its burned down i guess).
And after that i dont know what else you need in the quest.
Wow that took a while to write down. And who knows, i might be wrong about some stuff, or maybe i do it the hard way, who knows! ^_^ This system works for me. Hopefully you can work your way through this and make it work for your needs.