Jump to content

Super Mutant Skeletonizer (scripting help needed!)


Recommended Posts

With my Skeletonizer mod up and running properly, I want to take it to the next level and make Super Mutants skeletonize-able. I've already modeled, rigged and exported a super mutant skeleton model that works fine in-game, all I need to do right now is figure out how to make super mutants switch to that model upon death.

This is where I hit a bit of a snag: this here is my script that fires the laser skeletonization effect (which is called by a previous script that detects what projectile someone is killed by).

 

Here's my script so far:

scn OMNYLaserSpellFXScript
Float Timer
Short DoOnce
float fFloat

begin ScriptEffectStart
    if GetIsCreature == 0
        if GetIsID nvcrmrhouse == 0
            PMS OMNYLaserSkellyGlow
            Set Timer to 1.4
            Set DoOnce to 0
        Endif
    elseif GetIsCreature == 1
        if GetIsCreatureType 4 == 1
            PMS OMNYLaserSkellyGlow
            Set Timer to 1.4
            Set DoOnce to 0
        Endif
        set fFloat to Rand 0.2, -0.2
    Endif
End

Begin ScriptEffectUpdate
	SetVelEx 0 0 2
	Set Timer to Timer - GetSecondsPassed
	If DoOnce == 0
		If Timer <= 1.1
			if GetIsCreature == 0
				AddItemAlt OMNYLaserSkellySuit 1
				EquipItem OMNYLaserSkellySuit 1
				Set DoOnce to 1
			Endif
			elseif GetIsCreature == 1
				if GetIsCreatureType 4 == 1
					ToggleCreatureModel "nv_sm_v2_2_base.nif" 0
					ToggleCreatureModel "OMNYSuperSkelly.nif" 1
					Update3D
				Endif
			Endif
		Endif
    If Timer <= 0
		SMS OMNYLaserSkellyGlow
		Set DoOnce to 1
	endif
	if Timer <= fFloat
		dispel OMNYLaserSkellyFXSpell
	endif
End

 

 

The trouble is, while it does technically work (the flames/glowing effects don't go off) and they turn into a skeleton, when I reload my previous save, the super mutant is alive again but they are still a skeleton. Which is kinda cool but obviously problematic for what I'm trying to achieve.

For the record, I'm using Neil the super mutant as my test subject, hence why this script only looks for the one model in his model list.

All that said, any suggestions? Alternatives?

Edited by Omny87
Link to comment

UPDATE: Okay, I've sort of solved the persistent skeleton model problem. I've created a quest script that runs when the game loads that detects any nearby super mutants, checks if they're both alive and have the skeleton model active, and deactivates it while re-activating its original model.

 

Granted, at the moment, the actual checking part takes a few seconds when you first reload a save, causing any affected super mutants to appear as skeletons for a moment before re-appearing as their normal selves, though it's almost instantaneous if you skeletonize them, and reload a save a second time.

 

Anyway, here's the quest script:

scn OMNYSuperSkellyCheckQuest

array_var aMutants
array_var aModels
array_var entry


ref rMutant

Begin GameMode

	let aMutants := GetActorsByProcessingLevel 0

	If GetGameLoaded

	foreach entry <- aMutants
	ref rMutant = *entry
		if rMutant.GetIsCreature == 1
print "Creatures Found"
			if rMutant.GetIsCreatureType 4 == 1
print "Mutants Found"
				if rMutant.GetDead == 0
print "Living Found"
				let aModels := rMutant.GetCreatureModels 
					If eval (Ar_Find "OMNYSuperSkelly.nif" aModels) != Ar_badNumericIndex
print "skeletons found"
					rMutant.ToggleCreatureModel "OMNYSuperSkelly.nif" 0
					rMutant.ToggleCreatureModel "nv_sm_v1_1_base.nif" 1
					rMutant.Update3D
print "super mutant restored"
					Endif
				Endif
			Endif
		Endif
	loop
messageex "Super Mutant Skelly Check Complete."
	Endif

End

 

To clarify, all the prints and messages are for testing purposes only, and again I'm only testing this on Neil at the moment, so I'm only working with the one creature model of his.

 

That being said, I now have a couple new hurdles to clear in order to bring my vision to life: First of all, I need to figure out how to get dead skeletonized mutants to persist as skeletons after restarting the game session, because at the moment they don't do that. I've been looking into the "ExtraData" pages on the GECK wiki but I'm still rather confused as to how to actually use it in this case.

 

Second, I need to figure out how to get this Super Skelly Check to detect a super mutant's original base model and re-activating it while toggling off the skeleton model. The only solution I can think of at the moment is to make copies of the skeleton model to go with each the different super mutant base models- for example, "nv_sm_v1_1_base.nif" would have "OMNYSuperSkelly_v1.nif" as its companion skeleton, and detecting one will make them toggle on or off appropriately. I haven't tested this yet but I'm pretty sure it'll work.

 

Although even if it does, I will admit it's a bit inelegant and inefficient. I've been told elsewhere that storing the original model path in a temporary "Auxiliary Variable" can help streamline this process, though of course i'm not entirely sure how to do that either. If anyone here can offer their scripting knowledge please give me your thoughts and suggestions! I'll be looking over the GECK wiki in the meantime to try and figure this out myself.

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