Billtcm Posted August 22, 2014 Share Posted August 22, 2014 I'm trying to write a script that checks that the player has killed an actor with only melee/unarmed attacks. This is what I currently have. scn KHMMeleeCheck Begin GameMode GetCauseofDeath End Begin OnDeath if KHMTooth.GetCauseofDeath == 4 setobjectivecompleted KHMQ01 10 1 setstage KHMQ01 20 showmessage KHMYup endif END Unfortunately this does absolutely nothing. I've searched the forums for other 'getcauseofdeath' posts but couldn't get anything out of what I found. Is there another way to go about this or at least a mod I can take a look at that has something similar? I know there are a few quests in the game but I haven't been able to track them down in the GECK as of yet.Any help would be much appreciated. Link to comment Share on other sites More sharing options...
Guest deleted2159825 Posted August 22, 2014 Share Posted August 22, 2014 I've never actually used this function, but judging by the official documentation, you would need to add a bit of code to check for both (I inserted "||" so that it reads as "3 or 4"). Additionally, this would be an object script for the NPC and/or creature that is being slain. If it's KHMTooth, then add this to his/her script: scn KHMNPCSCRIPT ;This is just a proposed name - use what you like if there isn't already a scriptBegin OnDeath if GetCauseofDeath == 3 || GetCauseofDeath == 4 setobjectivecompleted KHMQ01 10 1 setstage KHMQ01 20 showmessage KHMYup endifEND ***** On the other hand, you could place this in a quest script: Begin Gamemode if KHMTooth.GetCauseofDeath == 3 || KHMTooth.GetCauseofDeath == 4 setobjectivecompleted KHMQ01 10 1 setstage KHMQ01 20 showmessage KHMYup endifEND *** If you use the latter script, make sure KHMTooth is the reference id for the entity in question. I'm not 100% sure this will work, as I don't always trust the GECK's broader functionality, particularly when it comes to more obscure features. Good luck, and feel free to PM me if you run into any issues. Keep those hobos in line, too. ;) Link to comment Share on other sites More sharing options...
Billtcm Posted August 22, 2014 Author Share Posted August 22, 2014 Fantastic! For some reason it's not detecting 'fists' as an unarmed thing...but my baseball bat worked completely fine which works for me lol. Thanks for the heads up, I completely forgot about quest scripts so I'll definitely be using those more often. Thanks again for the advice, I'll definitely be keeping those hobos away :D P.S.Your latest companion is fantastic haha...especially that last umm...dialogue option :P Link to comment Share on other sites More sharing options...
Guest deleted2159825 Posted August 22, 2014 Share Posted August 22, 2014 P.S.Your latest companion is fantastic haha...especially that last umm...dialogue option :tongue:Fans asked for romance, so I delivered! Link to comment Share on other sites More sharing options...
Recommended Posts