Deleted2746547User Posted November 7, 2015 Share Posted November 7, 2015 (edited) Advice on tweaking/improving this script?I've attached it to a weapon that uses a form list for its ammo. One type of ammo is a depleted uranium round. One of the effects of firing a DU (in this mod) is it turns the body into a pile of ash.It seems to mostly work right except for a few problems. 1.) when a companion fires the same weapon but does not have the same ammo (eg a 308 round vs. a 308 DU round) - it still sometimes gives the same effect. 2.) Not a big deal but sometimes the ash pile disappears along with the body - I suspect that has to do with the disable/delete 3.) Not a big deal but the inventory completely disappears and the ash pile isn't searchable. Ideally any weapons etc would appear in the ash pile and when you emptied it, the ash pile would also disable/delete. **trying to always keep the memory eating garbage to a min.** I suppose for the sake of 'realism' only certain items would remain through a form list check of some sort - though that would take more knowledge than I have when coding. Would you go about attaching a self disabling/deleting script to the ash pile... but if so, how would that look?I suppose a workaround for the companion issue is to only place the script on a special weapon for the player if I can't figure another way around it since the script works 'right' when i fire it (ie if I fire a regular 308 round no ashpile and no disappearing body).Suggestions? ScriptName BlackbriarUraniumRoundScript Float TimerShort DoOnceshort IsPileref rTargetref rCurrentAmmoref rPile Begin ScriptEffectStart set rCurrentAmmo to GetPlayerCurrentAmmo if GetDead == 1 && rCurrentAmmo == BlackbriarAmmo308mm2RHIP ; if target is dead and if the ammo your gun is using is a specific itemset rTarget to getdeadSetCriticalStage DisintegrateStartPMS LaserCritGlowFXShaderPMS effectLaserDisintegrationSet Timer to 1.8Set DoOnce to 0elseSet DoOnce to 1endifEnd Begin ScriptEffectUpdateIf DoOnce == 0If IsPile == 0If Timer <= 0.5AttachAshPileSet IsPile to 1set rPile to IsPileEndIfEndIfIf Timer <= 0 SetCriticalStage DisintegrateEndrtarget.removeallitems rPileSMS LaserCritGlowFXShaderSMS effectLaserDisintegration Set DoOnce to 1EndIfSet Timer to (Timer - GetSecondsPassed)EndIfEnd Edited November 7, 2015 by Guest Link to comment Share on other sites More sharing options...
Recommended Posts