badassmthfck Posted March 20, 2018 Share Posted March 20, 2018 What I need to do is spawn a boss enemy after dealing with several mobs. Essentially I need to advance the quest by a set amount on each subsequent kill, however I haven't been able to figure it out. The script I used earlier went as follows: Event OnDeath(Actor killer) Advquestondeath.SetStage(20) EndEvent For obvious reasons, this can cause sequencing errors if the player kills mobs out of one specific sequence What I need is for this "Advquestondeath.SetStage(20)" to become "Advquestondeath.SetStage(current quest stage+10)". I assume it's very simple to do for someone familiar with the engine, but without knowing the syntax I don't even know what errors I'm making when trying to script it. Any and all help will be greatly appreciated! Link to comment Share on other sites More sharing options...
WastelandAssassin Posted March 20, 2018 Share Posted March 20, 2018 I'm not sure if it's possible , but isn't it better to just create a counter , have it start with the amount of enemies you spawn , and have the counter go down with each kill?and have the quest advance once the counter reaches 0?would it not work best when the quest advances just once , when all enemies are killed? Link to comment Share on other sites More sharing options...
badassmthfck Posted March 20, 2018 Author Share Posted March 20, 2018 That absolutely makes sense. Could you please elaborate on how I would go about doing that? I only started scripting in Papyrus for the first time today so I'm VERY unfamiliar with it's many functions Link to comment Share on other sites More sharing options...
WastelandAssassin Posted March 20, 2018 Share Posted March 20, 2018 (edited) that's the thing , I've never used Papyrus in my lifeI know some basic scripting , and from what I understand some scripts resemble the syntax of C# (which the programming language I know)so I really have no idea how to go about doing something like thisI just thought this might be a better approach to this I'll try doing some digging and see if I can find something informative for you to use Edit : maybe this will help https://www.creationkit.com/index.php?title=Variables_and_Properties Edited March 20, 2018 by WastelandAssassin Link to comment Share on other sites More sharing options...
Evangela Posted March 20, 2018 Share Posted March 20, 2018 (edited) ; example int maxEnemies = 10 Event OnDeath(Actor akKiller) ; This event will expect the player to be the killer. ; If you don\'t want this, just remove the player assignment and if statement block. akKiller = Game.GetPlayer() if (!akKiller) return endif maxEnemies -= 1 if maxEnemies == 0 ; stage can be whatever you want myQuest.SetCurrentStageID(stage) endif EndEvent Sounds like Wasteland Assassin is talking about something like the above. Ah yes, the thing about changing the stage on *every* kill. I really can't think of a safe way of doing that there's also the concern I have about the count somehow going negative if the event is too slow to process the death, like if multiple actors die at the same time. '<= 0' might take care of that. Since I'm not able to test in game, I can't be sure. Edited March 20, 2018 by Rasikko Link to comment Share on other sites More sharing options...
WastelandAssassin Posted March 20, 2018 Share Posted March 20, 2018 (edited) ; example int maxEnemies = 10 Event OnDeath(Actor akKiller) ; This event will expect the player to be the killer. ; If you don\'t want this, just remove the player assignment and if statement block. akKiller = Game.GetPlayer() if (!akKiller) return endif maxEnemies -= 1 if maxEnemies == 0 ; stage can be whatever you want myQuest.SetCurrentStageID(stage) endif EndEvent Sounds like Wasteland Assassin is talking about something like the above. yep , that sounds like what I would write , if I knew Papyrus syntaxthanks Rasikko :) Edited March 20, 2018 by WastelandAssassin Link to comment Share on other sites More sharing options...
badassmthfck Posted March 20, 2018 Author Share Posted March 20, 2018 Thank you very much for your answers! I'll try to implement them tonight and I'll report back on how it worked :) Link to comment Share on other sites More sharing options...
Recommended Posts