Leperkhaan Posted January 29, 2014 Share Posted January 29, 2014 So, 1 million years later, I have a question about this post. Maybe I just need to learn how to script but I figured I'd copy from here to get me started and this is what I've come up with... scn DeathDismemberScript short doOnce ref thisRef Begin OnLoad if doOnce == 0 set thisRef to getSelf KillActor DismemberLimb: 1 CauseOfDeath: 0 set doOnce to 1 endif End According to the wiki, DismemberLimb is the correct is the correct syntax for which limb to be dismembered and the integer, 1, represents which limb. In this case it's the head.CausOfDeath should also be the correct syntax for the cause of death with the integer, 0, representing which cause. In this case, the cause is an explosion.The error that I'm receiving is"SCRIPTS: Script 'DeathDismemberScript', line 11Item 'DismemberLimb' not found for parameter Actor (optional)." Thus, it will not save my script. Any ideas as to what the problem may be? Link to comment Share on other sites More sharing options...
vforvic Posted January 30, 2014 Share Posted January 30, 2014 A couple of things. When putting optional parameters you only put the parameter itself. Also, you did not put the thisRef you set. I'm a hack at scripting, but that should work. scn DeathDismemberScript short doOnce ref thisRef Begin OnLoad if doOnce == 0 set thisRef to getSelf KillActor thisRef 1 0 set doOnce to 1 endif End Link to comment Share on other sites More sharing options...
Leperkhaan Posted January 30, 2014 Share Posted January 30, 2014 It still isn't working. I appreciate your help. I'm just going to have to actually learn to use the scripting tool better. I've been programming in other languages for years just have not done any modding before this week so it's all very new to me. I'll tackle these steps one at a time. Link to comment Share on other sites More sharing options...
vforvic Posted January 30, 2014 Share Posted January 30, 2014 Let me tell you this much imformation about the GECK. Scripting itself is not so much important as knowing when to use the script and what scripts work when and where. You take a good script and it should work and it does not. Usually the reason is because where and how it is being used. Often times you find yourself having to get creative in how you implement the script in the GECK. In other words often it is not making the script itself work as much as adjusting your environment to make the script work. Sometimes the real annoying part is when you make one tiny change that should not make a difference and boom it starts working. Good luck and feel free to tap into my limited knowledge on scripting. :smile: Link to comment Share on other sites More sharing options...
jazzisparis Posted January 30, 2014 Share Posted January 30, 2014 Just making sure: Did you attach this script to the NPC's base object? In other words, is the NPC using this script?Also, try replacing Begin OnLoad with Begin GameMode and see if it's working. Link to comment Share on other sites More sharing options...
Leperkhaan Posted January 30, 2014 Share Posted January 30, 2014 (edited) Jazziparis, you saved the day. With the original code of Begin OnLoad, I was getting an error in game that wouldn't let me use the coc command to enter my mod. Something about the script but all of vforvic's other alters work just fine. The Begin OnLoad was the real kicker though.I made a vault that gets raided, the one from the Bethsoft tutorials. I wanted to have an exploded Protectron in there and I was trying all different sorts of ways with just removing the head or dropping the HP to zero but nothing seemed to work.This did the trick. Thanks all. Hopefully this will help someone else too. Edited January 30, 2014 by Leperkhaan Link to comment Share on other sites More sharing options...
jazzisparis Posted January 30, 2014 Share Posted January 30, 2014 Then I think I have a good idea why it didn't work for you with OnLoad. This block type runs once, every time the parent cell of the calling reference (in this case, the NPC) is reloaded. In an interior cell, this happens every time you enter it (unless you re-enter it after just leaving), whereas in exterior cells this only happens every 3 game-days. I suspect that, when testing it, you either loaded a saved game where you were already in the same cell as the NPC, or you returned to an exterior cell which was not yet reloaded since your last visit to it.OnLoad is actually more suitable to use here than GameMode, but the latter works just as well. Link to comment Share on other sites More sharing options...
Recommended Posts