adinaq Posted February 23, 2011 Share Posted February 23, 2011 i'm just learning how to make scripts reading through the g.e.c.k site and it seem a little vague on adding the getdead into a trigger script or quest section what i want it to do is when i enter a room or another cell .. i want it to check is soandso is dead and if so skip to a farther part of the quest line otherwise continue as normal with the next stage involving the npc im trying to add a few conditions to the trigger in case the player killed the npc before they got the quest and it will skip that section and make the player guess what that person would have help them learn here is my guess at what its sopposed to say but apperntly something is wrong with it since geck keeps asking me to save when i try to close Scn questnameStage20Script ;used questname for example will change to real quest names when using it Begin OnTriggerEnter player if (ActorRef.GetDead == 1) Setobjectivedisplayed questname 60 ;if the npc the (actorRef) is dead skip to stage 60 and complete stage 10 for entering the room Setobjective completed questname 10 1 ElseIF (ActorRef.getDead == 0 ) SetStage questname 20 ; if npc is not dead set the stage to 20 and complete stage 10 for entering the room SetObjectiveCompleted questname 10 1 Endif End any tips / help would be great Link to comment Share on other sites More sharing options...
SonOfCapiz Posted February 23, 2011 Share Posted February 23, 2011 that means theres something wrong with your script so its not saving. im just starting to learn scripting myself and thishas proved invaluable. use it to validate your scripts. also try thisinstead of your usual geck and you'll see error messages that the usual geck ignores. Link to comment Share on other sites More sharing options...
rickerhk Posted February 23, 2011 Share Posted February 23, 2011 SetObjectiveDisplayed takes two parameters. Also, you aren't setting a stage here if the NPC is dead, just displaying an objective. That's ok, if it's what youe want. Just an FYI that the stage numbers and objective numbers don't necessarily track each other. Scn questnameStage20Script ;used questname for example will change to real quest names when using it Begin OnTriggerEnter player if (ActorRef.GetDead == 1) Setobjectivedisplayed questname 60 1 ;if the npc the (actorRef) is dead skip to stage 60 and complete stage 10 for entering the room Setobjectivecompleted questname 10 1 Else SetStage questname 20 ; if npc is not dead set the stage to 20 and complete stage 10 for entering the room SetObjectiveCompleted questname 10 1 Endif End Link to comment Share on other sites More sharing options...
adinaq Posted February 23, 2011 Author Share Posted February 23, 2011 @SonOfCapiz -wootthank you for those links :) it should save me a lot of eye strain looking for misplaced periods and such \O/ @rickerhk right i add the objectdisplay to have the next step apear on the screen when the criteria has been met to advance, i prob should make it display the completed step before displaying the new step. just not sure how to code it to check if the npc is dead ontrigger and send the quest in the correct path, i shall test out those links and check back Link to comment Share on other sites More sharing options...
davidlallen Posted February 23, 2011 Share Posted February 23, 2011 i'm just learning how to make scripts reading through the g.e.c.k site and it seem a little vague on adding the getdead into a trigger script or quest section ...if (ActorRef.GetDead == 1) Setobjectivedisplayed questname 60 You are using the correct function "getdead". But, if this syntax is legal, I have never seen any script use it. In this scripting language, AFAIK, you can only put one statement per line, and an "if" must have an "endif" even if you have only one statement. (It looks like you are assuming C/C++ syntax). It would have to be: if ActorRef.GetDead Setobjectivedisplayed questname 60 1 endif (Also including the missing argument for the function as pointed by others.) You should really use geck powerup if you are doing any script development. This is the only way to see syntax errors for yourself, rather than having to post each one and wait for somebody to help. Link to comment Share on other sites More sharing options...
adinaq Posted February 23, 2011 Author Share Posted February 23, 2011 (edited) hmm i see that now that you mention it, guess i get carried away sometimes throwing in diffent code formats also i notice some spaces where there shouldnt be cleaned up some of the mess with the aid of the power up seems to be valid Yipee Scn checkisdeadscript Begin OnTrigger player If (SarahWeintraubREF.GetDead == 1) SetObjectivecompleted Checkisdead 10 1 ; objective to finish just for entering Vault 22. SetStage Checkisdead 60 ; goes to a stage where i must continue with out her help Else IF (SarahWeintraubREF.getDead == 0) SetObjectiveCompleted checkisdead 10 1 ;objective to finish just for entering Vault 22. SetStage checkisdead 20 ; she isnt dead and get to the talk to her to progress easily. Endif Endif End sarah seems a little goofy so i had to include her appreciate the feed back, kudos for all .-* \o/ *-. Edited February 23, 2011 by adinaq Link to comment Share on other sites More sharing options...
Astymma Posted February 25, 2011 Share Posted February 25, 2011 (edited) The usual process is add a script to the NPC whose death you want to track and have it update a quest variable.Like so (script attached to the NPC): Begin OnDeath Set MyQuest.MyQuestVariable to 1 End And then check for a value of 1 for MyQuestVariable in the MyQuest script. Do not forget to include a comment in your MyQuest script and in this script mentioning the linkage.Basically you want to modularize your coding specific to the events you want to track... tends to make the game less unstable and, for me at least, reminds me what I was doing. Edited February 25, 2011 by Astymma Link to comment Share on other sites More sharing options...
mastar891 Posted December 20, 2014 Share Posted December 20, 2014 How would you apply this to multiple people? Link to comment Share on other sites More sharing options...
Ladez Posted December 20, 2014 Share Posted December 20, 2014 Simply include additional checks in your if-statement. If (SarahWeintraubREF.GetDead == 1 && SomeOtherPersonREF.GetDead == 1) Link to comment Share on other sites More sharing options...
mastar891 Posted December 20, 2014 Share Posted December 20, 2014 Adding && doesn't compile apparently :o Link to comment Share on other sites More sharing options...
Recommended Posts