djmystro Posted January 14, 2011 Share Posted January 14, 2011 [Contains minor 'A World of Pain' spoilers]:I am getting no-where with making a basic quest and the tutorials online have taken me to the brink fury and mindless material destruction with thier massive missing chunks of relevant info. If anyone can talk me through what will hopefully be a handful of realtively simple tasks it would be much appreciated and rewarded with credits and kudos where appropriate.I'll let you know what I am making so hopefully it will help with the feedback:I am creating a quest which revolves around the killing four large monsters in order to get an important key. Three giant gecko's form the first stage of the quest and one giant radscorpion will be the final test. Upon killing these creatures and returning to the NPC you will recive a key.1: Hopefully simple enough. I want a character (Frankie) to speak several lines of dialogue. This much I have achived. The speech appears in the correct order and flows properly the first time you speak with him. When you talk to him a second time all the used dialogue trees are visible when some should not be and should only branch off from others. Now I need a script so the lines only appear when you click to access them. I have found many scripts that command the line to only play once. This is not what I am after.2: I need a script so the quest line of dialouge can be accessed more than once untill the quest has been completed.3: I need a quest that points to three enemies at the same time and with death of all three being the end of that stage of the quest. I attempted this using a bodycount script but could't get the script to save (or the quest to start).I think I can figure the rest out although I can't really anticipate every prob I'll run into at this point.Any help would be appreciated. Link to comment Share on other sites More sharing options...
davidlallen Posted January 14, 2011 Share Posted January 14, 2011 (edited) This thread at bethsoft contains links to some other tutorials, which you may find less confusing. Or even if they just repeat the same thing different ways, maybe one will hit the right spot for you. The key idea for controlling which lines appear is the "condition" section. You need flags which permanently store whether or not some situation has already happened. Different people use different things for these flags. Two common ways are variables in the quest script, or (what I use) extra quest stages. Suppose you want a dialog choice to appear only before a creature has been killed; this choice should not appear after the creature has been killed. 1. Add a quest variable or quest stage "monster has been killed". When the game starts this will be false.2. Add an "ondeath" script to the monster which sets the variable true.3. In the dialog condition section, use "getquestvariable" or "getstagedone" to test the variable. Allow the line of dialog only if the variable is false. This is not detailed, but if you understand the big picture, then the dialog tutorials will help fill in the details. Regarding "pointing to three enemies", I think the right approach is to use multiple quest stages. So, suppose you create one quest stage for each of the three enemies, and you use three "ondeath" scripts to track whether each monster is killed. Suppose these are stages 10,11,12. You also need a fourth stage which is reached, when all three are dead; suppose this is stage 20. If the player kills the second creature, the ondeath script runs and does "setstage 11". This causes the result script of the quest stage 11 to run. This result script is like this: if (getstagedone myquest 10) && (getstagedone myquest 12) setstage myquest 20 endif Basically, it says, if the other two monsters are already dead, then advance to stage 20. The script for stage 10 checks 11 and 12; the script for stage 12 checks 10 and 11. Does this idea make sense? The more programming background you have, I guess the easier this is to internalize and cover different applications. Edited January 14, 2011 by davidlallen Link to comment Share on other sites More sharing options...
Quetzlsacatanango Posted January 14, 2011 Share Posted January 14, 2011 (edited) 1. It sounds like you have some of those topics added via the 'topics' box, instead of the 'choices' box (on the right). For topics that should only appear in their specific tree structure, you want them to be in the choices box, not topics. You also don't want the 'top level' box ticked, unless you want it to appear immediately after greeting. 2. Set a condition for the topic, choose getquestcomplete from the dropdown, choose your quest, set to 0 3. I would make a quest script with 4 variables: something like scn myquestscript short monster1 short monster2 short monster3 short keyavailable Begin GameMode if monster1 + monster2 + monster3 >= 3 set keyavailable to 1 endif End the 'keyavailable' variable is just for something to key your dialog off of. You could use setstage instead, or whatever you want there. On each monster, give them an object script that reads like: scn mymonster1script begin ondeath set myquest.monster1 to 1 End Repeat for other two creatures, using other 2 variables.Make the 3 monsters persisten refs, and on quest objective tab choose them in the bottom window. Edited January 14, 2011 by Quetzlsacatanango Link to comment Share on other sites More sharing options...
djmystro Posted January 14, 2011 Author Share Posted January 14, 2011 That makes sense with the scraps I have learned up until now. I shall try and put that advice into action right away. Shame about my programming skills - thats the only module I dropped out of at Uni. Thanks for the link, I'm checking it out now. Link to comment Share on other sites More sharing options...
djmystro Posted January 14, 2011 Author Share Posted January 14, 2011 Aha, thanx for the tip about the chioces box - that wraps that up nicely. I'm working on your other suggestions now. Thanks for the help. Link to comment Share on other sites More sharing options...
davidlallen Posted January 14, 2011 Share Posted January 14, 2011 3. I would make a quest script with 4 variables: something like [...] Begin GameMode [...] That will also work. If you have a number of quests like this, you may start to see a slowdown. This script evaluates every frame by default; you can slow down the update rate if you want, but it is still checking away all the time when you are working on other quests. The setstage/getstagedone approach is more efficient, because the other checks only occur when the quest actually changes state. I'm not sure if most modders care about this, or if any players notice. But I find quest stages to be better for efficiency. Link to comment Share on other sites More sharing options...
djmystro Posted January 14, 2011 Author Share Posted January 14, 2011 I seem to have run into another little problem. I have set out the quest objectives and a matching set of stages following your advice and a few of the tutorials.One part of the tutorial states that I should then link the stages by typing commands in the result script box of the quest stages tab, e.g "setObjectiveDisplayed 00FrankiesQuest01 5 1" with '5' being the first stage of the quest. The problem is everything I type in this box disappears when I select anything else in the quest window so have I missed something here? Link to comment Share on other sites More sharing options...
Quetzlsacatanango Posted January 14, 2011 Share Posted January 14, 2011 As long as you have that stage highlighted, it should show that result script box. Other stages would have their own result script box.You do have to do a right click-> new under log entry in order to type in that box. Maybe that's what you're seeing, if you're just clicking the 'edit' box. davidallen: thank you Professor Modstein. I will keep this in mind when coding tescript for my UNIVAC 1107. Link to comment Share on other sites More sharing options...
djmystro Posted January 14, 2011 Author Share Posted January 14, 2011 (edited) No, that does not seem to be the prob as I have created an new log entry and the result script box still just wipes clean whenever I navigate away.I think I can get around this, at least I have so far but I have run intoanother problem. I was following your advice regarding the monsters scripts and ran into one that won't save. I got through the first one fine, it looks like this: scn 00FrankieScript02short monster1short monster2short monster3Begin GameMode if monster1 + monster2 + monster3 >= 3 setstage 00FrankieQuest01 10setobjectivedisplayed 00FrankieQuest01 10 1 endif End It's set as a quest type. That saved with no probs. The following script for the first of the three monsters will not save and I have tried a number of variations with no success.This is the script: scn 00GeckoHunt01 begin ondeathset 00FrankieQuest01.monster1 to 1End I am getting the following error report from the GECK Powerup:'Line 3, Invalid block type for quest script" I can't seem to fix this, have I missed something? Edited January 14, 2011 by djmystro Link to comment Share on other sites More sharing options...
rickerhk Posted January 14, 2011 Share Posted January 14, 2011 For scripts on the monsters, make them 'Object' type scripts Link to comment Share on other sites More sharing options...
Recommended Posts