Jump to content

Heavenly Aura on death + other Scripts


4dacause

Recommended Posts

I have been working on a mod which I made to test the Mind of people. Its a bit like a maze and you have to fight through stuff, lots of traps and so on. One of the things I wanted to add was a Heavenly Aura which appeared when people died (A bit like the light beams in the Construction Set), the only problem was... Im not that good of a Scripter...

I've also been looking for a script that can be added to items such as a dagger and when you pick it up, it respawns straight away, and so it must be picked up in a specific order. I would be just as much satisfied if someone made a maze mod, I put a trapdoor in Rosethorn Hall's Basement and would like it to be there if anyone decides to make a maze.

 

Overall, I guess this isn't really a 'Mod Request'. but im new and this is actually my first post and i have no clue where else to post this... If anyone has a nice deal of experience in Scripting help me please. Thanks!

 

4dacause :rolleyes:

Link to comment
Share on other sites

For the aura, it should be easy. Just put a static lightbeam in the same cell as the NPC that is going to die. Make it a persistent reference, initially disabled and give it a unique name so that a script can send instructions to it. (I'll use lightbeamRef for this example).

 

For the NPC, assign him/her an unique name (deadNPCRef in this example) and an object script which should be something like:

 

scriptname whateveryouwant

BEGIN ONDEATH

lightbeamRef.MoveTo deadNPCRef  x  y  z  ; where x, y and z are the position relative to the body
lightbeamRef.enable

END

 

For the daggers, best to make them activators instead of real daggers. If the player gets it right, add a dagger to their inventory. If they get it wrong, the script does something else. This one will require more than a quick explanation, but once you get the lightbeam script working, you'll understand scripting a little bit better. ;)

Link to comment
Share on other sites

For the aura, it should be easy. Just put a static lightbeam in the same cell as the NPC that is going to die. Make it a persistent reference, initially disabled and give it a unique name so that a script can send instructions to it. (I'll use lightbeamRef for this example).

 

For the NPC, assign him/her an unique name (deadNPCRef in this example) and an object script which should be something like:

 

scriptname whateveryouwant

BEGIN ONDEATH

lightbeamRef.MoveTo deadNPCRef  x  y  z  ; where x, y and z are the position relative to the body
lightbeamRef.enable

END

 

For the daggers, best to make them activators instead of real daggers. If the player gets it right, add a dagger to their inventory. If they get it wrong, the script does something else. This one will require more than a quick explanation, but once you get the lightbeam script working, you'll understand scripting a little bit better. ;)

 

 

Lansor...right to the point. lol

Link to comment
Share on other sites

Alright, i tried it and it didn't work. I followed everything you said in the point of view that a young child like me would understand it as. I added the light beams into my cell, I changed the ID to 'LightbeamRef001', then I checked the 'Persistent Reference' and 'Initially Disabled' box's. My NPC's ID was 'AAADEADREF001' and he was in the following position:

 

X = 3070.5613

Y = 956.2997

Z = 7358.2505

 

I opened up the script thingy and went 'New', I left in as an 'Object' Script (Thingy in the top right of the window), and I typed in:

 

scriptname LightBeamScriptTest

BEGIN ONDEATH

 

LightbeamRef.MoveTo AAADEADREF001 x y z ; where x, y and z are the position relative to the body

LightbeamRef.enable

 

END

 

Was i supposed to leave something out? As i had said before... Im not that good at scripting and i lack the experience...

Link to comment
Share on other sites

Okay, try:

 

LightbeamRef.MoveTo AAADEADREF001 0 0 0

 

This puts the light beam exactly where the NPC is when s/he dies. Once you get it working, you can adjust the value for x, y and z to your liking.

 

Object script is correct. Make sure you edit the NPC's *base* object to attach the script.

 

For the effect of instantly respawning daggers, you can make an activator that looks like a dagger. It's no different to a button that adds gold when pressed, except that the button uses a dagger's mesh, and instead of adding gold, it adds a dagger to the player's inventory.

 

Added: I suspect that most people learn scripting by inspecting a mod that does something similar to what they want, and then checking the functions in the CS wiki.

Link to comment
Share on other sites

Why make it an activator?

 

Just put this on it;

 

scn DaggerInfinite

begin OnActivate
player.additem WeapSteelDagger 1
end

 

Put this on a weapon, activator, item or whatever, and it will give you infinite amounts of daggers, as the original object will never be lost. If you do want it to be lost eventually, add a "disable" at the end. Applies to everything, no need to make it an activator (especially since that means you'd have to unpack you bsa).

 

 

 

Lucifer

Link to comment
Share on other sites

Why make it an activator? .... Applies to everything, no need to make it an activator (especially since that means you'd have to unpack you bsa).Lucifer

 

Actually, either a weapon or an activator would work perfectly well.

 

You probably don't want bumps or spells to move the dagger or activator accidentally, so either way, you'll have to to extract the mesh from the BSA and modify it to be immovable. Why an activator then? It has the slight advantage that you'll never have to worry about a dagger that defies the laws of physics somehow ending up in the player's inventory. ;)

 

Now if it doesn't matter that the dagger could end up lost somewhere, putting the script on a copy of the dagger would definitely be easier. :)

Link to comment
Share on other sites

You could indeed rework the mesh to remove collision, so it can't be moved. But if you did that (make an extra static mesh), you could still make it into anything you want.

 

Besides, if you want it to be immovable, you could script that as well. And if you script it all neatly, the static version or scripted version could never end up in your inventory anyway....

 

 

But hey, that could just be me... If you're a mesher, I understand you wanting to change the mesh...

 

If you're a general modder, scripter, or actually anything but a mesher, I suggest you take the easy way, and instead of extracting the bsa, modifying the mesh, and still scripting it ( :blink: ! ), just script it right away, just with a slightly more expanded script.

 

 

 

Lucifer

Link to comment
Share on other sites

If it's all about removing the colision "completely" from a .Nif, this is easy, open the meshe in Nifskope find the "bhkColision" block and right clic > block > delete, And save it with a new name !

it will do the job in the game... but it's always better to have a Static .Nif !

 

Reaper

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...