PirateLord
|
Adept
|
|
|
Reged: 10/07/03
|
Posts: 212
|
Loc: Terra, Sol System
|
|
|
OK, this has got me.
I want to make a spell that gives an aura of darkness around an NPC, just like the dark lights. Not being able to figure out how to make a new spell effect, I done a quick test by changing the Light Effect. Neither setting the colour to Black, or to White and inverse (just like the Dark Lights) works. Both just end up as bright white in game.
I'm aware that dark light only works best on interiors, where there are more light sources.
Anyone got any ideas how I can achieve this, or something similar (like a mist or something)
-------------------- Piratelordx MODs
Post Extras:
|
Klinn
|
Diviner
|
|
|
Reged: 11/19/02
|
Posts: 2319
|
|
|
|
Why not have a script on the NPC that just positions a unique dark light object at her/his location? Update the position about every 1/2 second so the dark light will follow the NPC around. This may run into problems if the NPC changes from one cell to another. You would probably have to delete the old dark light and create a new instance in the new cell.
...Klinn
Post Extras:
|
|
|
What you need is the Blind spell effect.
Post Extras:
|
|
|
Quote:
Ignore this, didnt read the question properly
Post Extras:
|
PirateLord
|
Adept
|
|
|
Reged: 10/07/03
|
Posts: 212
|
Loc: Terra, Sol System
|
|
|
Quote:
Why not have a script on the NPC that just positions a unique dark light object at her/his location? Update the position about every 1/2 second so the dark light will follow the NPC around. This may run into problems if the NPC changes from one cell to another. You would probably have to delete the old dark light and create a new instance in the new cell.
Cell changes shouldn't be a problem. Problem is, I'm not an expert at scripting (while I can make sense of the code). What commands do I need?
Thanks
-------------------- Piratelordx MODs
Post Extras:
|
Klinn
|
Diviner
|
|
|
Reged: 11/19/02
|
Posts: 2319
|
|
|
|
Here's a script that seems to do what you want. First I made a new NPC called 'Dark Guy' and dropped him into a tomb. Next I created my own unique 'dark' object (initially with a radius of 1000 but 500 worked out better) and dropped it in the cell with my new NPC. Be sure to check 'References Persist' for the 'dark' object. Then I attached this script to the new NPC: Code:
;======================================== ; KLNTest_SCR_DarkNPC ;======================================== ; This script is attached to 'KLNTest_NPC_DarkNPC'. ; It moves the dark light 'KLNTest_dark_1000' so it stays ; with the NPC as he moves about. The NPC himself still ; is fairly light, but the surrounding interior is darkened. ;======================================== Begin KLNTest_SCR_DarkNPC ;----local variables---- Float Timer ;times 1/2 second between position updates Float NPCX ;saves NPC's current X coordinate Float NPCY ;saves NPC's current Y coordinate Float NPCZ ;saves NPC's current Z coord + 100 ;note: adding 100 compensates for different object centers ;----do not process script if menus open---- If ( MenuMode == 1 ) Return EndIf ;----advance timer, see if time to reposition dark light to match NPC---- Set Timer To ( Timer + GetSecondsPassed ) If ( Timer > 0.5 ) Set NPCX To ( GetPos X ) ;save current NPC coordinates Set NPCY To ( GetPos Y ) Set NPCZ To ( GetPos Z + 100 ) KLNTest_dark_1000 -> SetPos X, NPCX ;apply to dark light object KLNTest_dark_1000 -> SetPos Y, NPCY KLNTest_dark_1000 -> SetPos Z, NPCZ Set Timer To 0 ;reset timer for next check EndIf End The only reason for the Timer business is just so the bulk of the script does not execute with every single frame. That potentially could introduce some lag, depending on the speed of one's computer. An update every half-second should be good enough even if the NPC is running. As mentioned in the code, the NPC doesn't seem to darken as much as the walls etc around him. But when he went wandering around the tomb, the 'shadow of doom' followed him.
Hope this helps,
...Klinn
Post Extras:
|
PirateLord
|
Adept
|
|
|
Reged: 10/07/03
|
Posts: 212
|
Loc: Terra, Sol System
|
|
|
Wow! That's a great help!
The idea is that the light is absorbed by the NPC, and since it's a Dark guy anyway, this should look good. There would be need for a disable (or move) command on the dark light to get rid of it when the NPC dies. That I should be able to work out, since there is a lot more I want to happen when it dies.
-------------------- Piratelordx MODs
Post Extras:
|
Klinn
|
Diviner
|
|
|
Reged: 11/19/02
|
Posts: 2319
|
|
|
|
Glad to help. Here's a revised script that disables the 'dark' light when the NPC dies. As you mentioned, many more things can be done when the NPC dies, but this framework may be useful. Code:
;======================================== ; KLNTest_SCR_DarkNPC ;======================================== ; This script is attached to 'KLNTest_NPC_DarkNPC'. ; It moves the dark light 'KLNTest_dark_1000' so it stays ; with the NPC as he moves about. The NPC himself still ; is fairly light, but the surrounding interior is darkened. ; When the NPC dies, the darkening effect is disabled. ;======================================== Begin KLNTest_SCR_DarkNPC ;----local variables---- Float Timer ;times 1/2 second between position updates Float NPCX ;saves NPC's current X coordinate Float NPCY ;saves NPC's current Y coordinate Float NPCZ ;saves NPC's current Z coord + 100 ;note: adding 100 compenstates for different object centers ;----do not process script if menus open---- If ( MenuMode == 1 ) Return EndIf ;----if NPC dies, disable dark light---- If ( OnDeath == 1 ) KLNTest_dark_1000 -> disable EndIf ;----do not process rest of script if NPC is dead---- If ( GetHealth <= 0 ) Return EndIf ;----advance timer, see if time to reposition dark light to match NPC---- Set Timer To ( Timer + GetSecondsPassed ) If ( Timer > 0.5 ) Set NPCX To ( GetPos X ) ;save current NPC coordinates Set NPCY To ( GetPos Y ) Set NPCZ To ( GetPos Z + 100 ) KLNTest_dark_1000 -> SetPos X, NPCX ;apply to dark light object KLNTest_dark_1000 -> SetPos Y, NPCY KLNTest_dark_1000 -> SetPos Z, NPCZ Set Timer To 0 ;reset timer for next check EndIf End
Some people have reported problems with disabling lights, I'm not sure if that might also apply to 'dark' lights. Anyway, it worked fine for me, I'm using MW+Trib+BM+last BM patch. There was a brief pause between killing the NPC and the darkness disappearing. That may be because of how long it takes for the NPC to go through the death animation until the game considers him truly dead, or maybe it's just that the MW game engine doesn't update the list of light sources to be rendered immediately.
Hope this helps,
...Klinn
Post Extras:
|
|
|
One quick question, same as in your other thread: Do you want this to work for all NPCs with that certain spell effect, or just this one? All NPCs would require much scripting and (hesitant to say this) may be very near impossible. But for that one, that script should work. Also, since you seem to be looking for scripting commands, check out GhanBuriGhan's Morrowind Scripting for Dummies on EuroMW. It's the answer to pretty much all scripting needs. Happy modding!
Afterthought: New spell effects, other than summon spells with Bloodmoon, are impossible to do without some very heavy scripting. I'm finding this out myself, as I am making a new Scripted Spells mod, which, contrary for the name (looking for a new one that sounds cool), has nothing to do with Cortex's mod. (Tries to hide blatant advertising and fails...miserably) Check out my thread in the Mods section.
-------------------- Never laugh at a live dragon.
--Bilbo Baggins, There and Back Again: a Hobbit's Tale (a.k.a. The Hobbit)
Nerds rule the world. No one else knows it yet.
Post Extras:
|
Mode_Locrian
|
Diviner
|
|
|
Reged: 10/07/02
|
Posts: 2084
|
Loc: Bjornholm, Rykith Lowlands Region
|
|
|
You could just make a light source for the NPC to hold/have placed at him that is 255 255 255 in its RGB settings with the "negative" box checked.
-------------------- My Website
Bards of Vvardenfell Thread (New Info 8/15/04)
Post Extras:
|