JuicyPwner Posted January 10, 2021 Share Posted January 10, 2021 Hi I'm trying to detect if npcs selected via quest are dead to move on to the next stage, however for some reason it doesnt change, here is my script: scn garrisonambushstage30 begin gamemode if getstage vangraffcrimsoncollab == 20 if getdead GarrisonVanGraff1== 1 && getdead GarrisonVanGraff2== 1 && getdead GarrisonVanGraff3== 1 && getdead GarrisonVanGraff4== 1 && getdead GarrisonVanGraff5a== 1 setstage vangraffcrimsoncollab 30endifendifend 5a is on purpose., and as for the quest itself, they have REFs targetted towards them, however I have the above script that should detect if npc is dead (==1) and if all are dead proceed to next stage but it is not working. Is there a different way I should be approaching this? Link to comment Share on other sites More sharing options...
ashtonlp101 Posted January 10, 2021 Share Posted January 10, 2021 "GetDead" has to be called on before the if statement: GarrisonVanGraff1.GetDeadGarrisonVanGraff2.GetDeadGarrisonVanGraff3.GetDeadGarrisonVanGraff4.GetDeadGarrisonVanGraff5a.GetDead Then write your if statements under this Link to comment Share on other sites More sharing options...
JuicyPwner Posted January 10, 2021 Author Share Posted January 10, 2021 (edited) Ok, so i dont know whats up with the above script, i got around with a different script though its not as fulfilling as I'd hoped. scn garrisonambushstage30 begin ondeath if getstage vangraffcrimsoncollab==20 setstage vangraffcrimsoncollab 30 endifend with an associated NPC that the player kills. Kinda sucks since I for some reason can't setstage when all are dead but it works. I am having trouble with a different thing but I hope some others may shed light on some ways to do what I was trying to do. edit: just saw the above, ill try it outedit2: didn't work, but I will give it another go at another time when I need to. Edited January 11, 2021 by JuicyPwner Link to comment Share on other sites More sharing options...
yojeff Posted January 11, 2021 Share Posted January 11, 2021 Is it possible that GetDead doesn't work on Leveled Actor? (I'm having the same problem in Oblivion) If you check the id of the NPCs during the game, does it begin with the Load number of your mod? Link to comment Share on other sites More sharing options...
McFearo Posted January 11, 2021 Share Posted January 11, 2021 Noob question, I am FAAAAAR from the most experienced person here, but couldn't you achieve something similar by setting up an OnDeath script for the goons you want killed and have them increase a death counter in the quest? I.e. You add a short to the quest script called "short GoonsDead" In the script for said goons you add a block that goes Begin OnDeath set YourQuestName.GoonsDead to YourQuestName.GoonsDead + 1 endAnd then have the next stage of the quest set to go off when GoonsDead == 5 or something. Just a thought, might be the long way to work around this. And it may not even work! I'm just spitballing. Link to comment Share on other sites More sharing options...
ashtonlp101 Posted January 11, 2021 Share Posted January 11, 2021 Noob question, I am FAAAAAR from the most experienced person here, but couldn't you achieve something similar by setting up an OnDeath script for the goons you want killed and have them increase a death counter in the quest? I.e. You add a short to the quest script called "short GoonsDead" In the script for said goons you add a block that goes Begin OnDeath set YourQuestName.GoonsDead to YourQuestName.GoonsDead + 1 endAnd then have the next stage of the quest set to go off when GoonsDead == 5 or something. Just a thought, might be the long way to work around this. And it may not even work! I'm just spitballing. It just depends on what you're trying to do. Either one works. Link to comment Share on other sites More sharing options...
JuicyPwner Posted January 11, 2021 Author Share Posted January 11, 2021 Noob question, I am FAAAAAR from the most experienced person here, but couldn't you achieve something similar by setting up an OnDeath script for the goons you want killed and have them increase a death counter in the quest? I.e. You add a short to the quest script called "short GoonsDead" In the script for said goons you add a block that goes Begin OnDeath set YourQuestName.GoonsDead to YourQuestName.GoonsDead + 1 endAnd then have the next stage of the quest set to go off when GoonsDead == 5 or something. Just a thought, might be the long way to work around this. And it may not even work! I'm just spitballing.Seems reasonable though. Link to comment Share on other sites More sharing options...
ashtonlp101 Posted January 11, 2021 Share Posted January 11, 2021 If you're going to do that, make sure you put parentheses in there. Don't think the GECK will compile it as it is, can't quite remember. Set YourQuestName.GoonsDead to (YourQuestName.GoonsDead +1) Be careful with doing this though, the engine doesn't always register OnDeath Correctly, especially if you have a lot of NPCs in one spot at the same time. So just playtest this script a lot before committing to it. I use that line that McFearo suggested to count how many enemies are killed during defense scenes, I always set the amount of enemies a few higher than my If Statement requires to set the next stage because like I said, it won't always register correctly like it should. Link to comment Share on other sites More sharing options...
Recommended Posts