Jump to content

Need Help With Scripting A Skeletonizing Mod!


Recommended Posts

13 hours ago, A.J. said:

 

Hello pal, how are you?

 

I give an idea for 1), what about this... you double click Bloody Mess, in the middle of the window you add 2 conditions, one is GetWeaponType == 4 and one is ==7, with OR flagged. Is it viable?

 

2) seems very tricky. There's one thing I was thinking... long time has passed and I don't remember well but it deserves to be looked maybe: when handling npc there's a normal behaviour, when you equip an armor you also add/remove a simple item like a pen on the next lines of script, to avoid the fact it won't equip the weapon back. It was on the wiki but I can't find it back now. Do you think it could be what makes the npc "lose" the weapon when they wear the skeleton armor?

 

3) if you check on the shaders window you can see a AFFECT SKIN ONLY flag, is it what you looking for? EDIT: no, I think I misunderstood. In this way, the armor over won't dissolve and simply disappears when you wear the skeleton. Unless when you try it in game you see it's a nice effect, I'd say I have no idea, you're probably on the right track thinking about the nif, it can be some flag under the BSShaderPPLightingProperty, like chaging the shader type or adding / removing the shader flags, but it's something I don't know. If there's someone who knows it, it's Wei for sure, the guy who makes all the cool mods with special effects and worked in Frontier too, I would try to send him a PM to ask

 

1) I'll try that, though not every weapon that's effected by the mod falls under those categories, such as the Tesla Cannon (TwoHandLauncher) and the Arc Welder (TwoHandHandle), as well as the various grenades. Would adding in the form lists I made work?

 

2) I did actually make a small breakthrough in trying to fix that problem- the way the script works is that upon death, NPCs are given a skeleton suit via AddItem, but the actual act of doing that makes them automatically un-equip their weapon. However, I found that if I disabled the AddItem part of the script, added the skeleton suit to their inventory manually via console, and then killed them via lasers, their skeleton would be holding the weapon as I wanted.

Still, I try your idea and see if it gets me anywhere. Because otherwise it seems like the solution would be to give every single NPC the skeletons suits from the get-go, and I'm not entirely sure how to do that. I've tried a couple things but the scripts I've written won't run.

 

3) Not exactly; if memory serves when I do that, the glowing/flame effects that engulf an NPC's body before turning them into a skeleton only appear on their actual skin while their outfits show no effects. Though I haven't dabbled with it in a while; I might try that.

 

I was mostly trying to look through the various shader properties on NifSkope (Vertex Alpha, Two Sided, etc) but can't figure out what does does what.

Edited by Omny87
Link to comment
5 minutes ago, Omny87 said:

 

1) I'll try that, though not every weapon that's effected by the mod falls under those categories, such as the Tesla Cannon (TwoHandLauncher) and the Arc Welder (TwoHandHandle), as well as the various grenades. Would adding in the form lists I made work?

 

2) I did actually make a small breakthrough in trying to fix that problem- the way the script works is that upon death, NPCs are given a skeleton suit via AddItem, but the actual act of doing that makes them automatically un-equip their weapon. However, I found that if I disabled the AddItem part of the script, added the skeleton suit to their inventory manually via console, and then killed them via lasers, their skeleton would be holding the weapon as I wanted.

Still, I try your idea and see if it gets me anywhere. Because otherwise it seems like the solution would be to give every single NPC the skeletons suits from the get-go, and I'm not entirely sure how to do that. I've tried a couple things but the scripts I've written won't run.

 

3) Not exactly; if memory serves when I do that, the glowing/flame effects that engulf an NPC's body before turning them into a skeleton only appear on their actual skin while their outfits show no effects. Though I haven't dabbled with it in a while; I might try that.

 

I was mostly trying to look through the various shader properties on NifSkope (Vertex Alpha, Two Sided, etc) but can't figure out what does does what.

 

1) If adding a condition actually solves the problem, deciding WHICH condition is the smaller part... because there's so many conditions avaiable, I'm pretty sure you'll find the one best suitable for you. Form lists are a very nice thing, but what about modded weapons if these are not added to the right form lists?

 

2) if you did that experiment, then I'd confirm it's the issue I'm talking about. However, due to the death of the npc, I expect it won't work then. I now suspect the adding / removing the pen is a way for the AI to re-evaluate the equipping of weapon. Well it deserves an attempt maybe.

 

3) yes I edited the previous message in the meantime, my bad

Edited by A.J.
Link to comment

1) Well, the solution you suggested to fix the Bloody Mess problem worked, so that's one thing off the checklist! I set it so it excluded anything in the big list I made containing all the weapons affected by this mod.

 

2) Unfortunately the solution you suggested here didn't work- I tried adding "RemoveItem Pencil01 1" to the script, but no matter where I placed it, it didn't affect the weapon disappearing bug.

 

3) I'm gonna try dicking around in NifSkope and see what happens. Trying to search for what each shader flag does is frustratingly fruitless. ?

 

EDIT: Well, so far I've learned that turning off ALL of the shader flags makes the skeletons completely invisible in-game, along with the membrane shader that would normally go over them. So that's something.

Edited by Omny87
Link to comment

Alright; so it looks like I've managed to fix both the Bloody Mess bug and the disappearing weapons bug! The latter was surprisingly simple to fix; I removed the "AddItem" line from the skeletonizing effect script and added an "AddItemAlt" line to the object script that activates the skeletonizing script, like so:

 

Quote

 

    if rKiller.IsWeaponInList OMNYListOfLasers
            if rActor.GetIsCreature == 0
                rActor.AddItemAlt OMNYLaserSkellySuit 1
                rActor.CIOS OMNYLaserSkellyFXSpell
            EndIf

 

 

 

There's just one last bug that's been plaguing this mod of mine: the "IsWeaponInList" command. Because of this mod, the skeletonizing effect only works properly when the player is holding the appropriate weapon. In normal combat when shooting at someone with a plasma rifle this is fine, but when it comes to mines or grenades, it's a different story: if you throw a frag grenade and then switch to holding a plasma rifle before the grenade explodes, the target will be turned into a green skeleton. Likewise if you were to throw down a plasma mine and are holding a shotgun while an enemy walks over it, they won't be turned into a green skeleton and will simply explode as normal.

 

So what I need to do is to re-write this script so that it detects what weapon they've been killed with, rather than what weapon their killer is holding at the time. Trouble is, there doesn't seem to be a convenient way of doing that. I've found GetCauseOfDeath, but the name is frustratingly deceptive- it can only determine if someone was killed via one of 8 broad categories. IsKillerObject seems to only refer to when someone gets killed by an object like a trap or something (the GECK wiki doesn't seem to know for sure, which is also annoying).

 

 

Link to comment
  • 1 year later...

Well, it's been a couple of years, but I finally am getting back to work on this little mod of mine. Been putting it off for too long.

 

I was working on a new version of it before, but after going back to it, it was just way too much of a mess to deal with so I scrapped the whole thing and decided to just start again on an updated version using the mod I currently have uploaded to the Nexus. I deleted all my currently installed mods, got a fresh and clean install of New Vegas, and re-downloaded just a few essential mods for this endeavor (namely NVSE as well as the JohnnyGuitar and JIP LN extender plugins), just to start with a nice blank slate.

 

I've managed to remake a couple of my original goals, namely fixing the "Bloody Mess" problem as well as the "disappearing weapons" problem, but now I've hit another roadblock. Because of course I fucking have.

 

So, the mod goes like this... it starts with this script here:

 

ScriptName OMNYSkellyQuestScript

Begin GameMode

    If GetGameLoaded
        SetJohnnyOnDyingEventHandler 1 OMNYLaserSkeletonizerScript 0
        Print "Welcome to the Bone Zone!"
    endif

end


Which then goes to this script here:

scn OMNYLaserSkeletonizerScript

Float Timer
ref rActor
ref rWeapon

Begin Function {rActor}

    set rWeapon to rActor.GetHitWeapon
    print "Skeleton Time!"

    if rWeapon.IsInList OMNYListOfLasers
        if rActor.GetIsCreature == 0
            rActor.AddItemAlt OMNYLaserSkellySuit 1
            rActor.CIOS OMNYLaserSkellyFXSpell
        print "Laser!"
        EndIf

    Elseif rWeapon.IsInList OMNYListOfPlasma
            if rActor.GetIsCreature == 0
                rActor.AddItemAlt OMNYPlasmaSkellySuit 1
                rActor.CIOS OMNYPlasmaSkellyFXSpell
        print "Plasma!"
            EndIf

    Elseif rWeapon.IsInList OMNYListOfShocks
            if rActor.GetIsCreature == 0
                rActor.AddItemAlt OMNYShockSkellySuit 1
                rActor.CIOS OMNYShockSkellyFXSpell
        print "Shock!"
            EndIf

    Elseif rWeapon.IsInList OMNYListOfFlames
            if rActor.GetIsCreature == 0
                rActor.AddItemAlt OMNYCharredSkellySuit 1
                rActor.CIOS OMNYCharredSkellyFXSpell
        print "Fire!"
            EndIf
    Endif

end

 

Each of those "OMNYListOf____" lists are Form Lists that contain all the various energy weapons that I want to have affected by the different colored effects.

 

The snag I've hit is that for some reason the game refuses to execute any of this last script past the "print Skeleton Time" bit, not adding the skelly suits or activating the FX spells no matter what I do.

 

Of course, this script was edited from the original version. It originally looked like this:

 

scn OMNYLaserSkeletonizerScript

Float Timer
ref rActor
ref rKiller

Begin Function {rActor}

	set rKiller to rActor.GetKiller

	if rKiller.IsWeaponInList OMNYListOfLasers
			if rActor.GetIsCreature == 0
				rActor.CIOS OMNYLaserSkellyFXSpell
			EndIf

	Elseif rKiller.IsWeaponInList OMNYListOfPlasma
			if rActor.GetIsCreature == 0
				rActor.CIOS OMNYPlasmaSkellyFXSpell
			EndIf

	Elseif rKiller.IsWeaponInList OMNYListOfShocks
			if rActor.GetIsCreature == 0
				rActor.CIOS OMNYShockSkellyFXSpell
			EndIf

	Elseif rKiller.IsWeaponInList OMNYListOfFlames
			if rActor.GetIsCreature == 0
				rActor.CIOS OMNYCharredSkellyFXSpell
			EndIf
	endif	
end

I changed it because using "rKiller.IsWeaponInList" caused a minor but annoying bug where the effect is decided on by whatever weapon the player is currently holding at the time rather than whatever weapon was used to kill the target (so if you threw a plasma grenade and switched back to a 10mm pistol, the plasma skeletonizing effect wouldn't happen).

 

This is particularly annoying because that edit is more or less how it looked when I first attempted to make an updated version, but it doesn't seem to be working now. What the hell am I missing? I tried a few things, mostly changing the "Begin Function" to "Begin OnDeath" but that just made the following error appear in the console:

 

Error in script 0B00137A (OMNYLaserSkeletonizerScript) in mod OMNYSkeletonizer02.esp
Begin Function block not found in compiled script data
Error in script 0B00137A (OMNYLaserSkeletonizerScript) in mod OMNYSkeletonizer02.esp
Failed to extract parameter 0. Please verify the number of parameters in function script match those required for event.

 

I tried looking up these errors but I couldn't find a single thing about any of them. Which is probably the most frustrating thing about this endeavor.
 

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use