Script to track multiple quest objectines in random order

Post » Mon Aug 22, 2011 6:02 pm

I'm working on a quest script that will track the completion of multiple Quest Objectives in any random order and once all options have been completed the main quest will update with a new objective. It seems to be working properly in game, and it validates in the script validator, but I'm no expert, lol. So, it this the correct way I should be approaching this, or is there a better, more efficient way of doing that I'm trying to do?

Basically, I have 5 optional objectives that can be completed in any random order. Once they're all completed the quest should update with a new objective and continue forward.



scn BalokTrackUpgradesSCRIPTshort DoOnceBegin GameMode	if DoOnce == 0		set DoOnce to 1	endif	if doonce == 1 && getobjectivecompleted BalokFinishSchoolQuest 75 && 	                             getobjectivecompleted BalokFinishSchoolQuest 80 && 				     getobjectivecompleted BalokFinishSchoolQuest 85 && 				     getobjectivecompleted BalokFinishSchoolQuest 90 && 				     getobjectivecompleted BalokFinishSchoolQuest 95		                     SetObjectiveDisplayed BalokFinishSchoolQuest 100 1		set doonce to 2	endifend

User avatar
Michelle Serenity Boss
 
Posts: 3341
Joined: Tue Oct 17, 2006 10:49 am

Post » Mon Aug 22, 2011 10:58 pm

I'm working on a quest script that will track the completion of multiple Quest Objectives in any random order and once all options have been completed the main quest will update with a new objective. It seems to be working properly in game, and it validates in the script validator, but I'm no expert, lol. So, it this the correct way I should be approaching this, or is there a better, more efficient way of doing that I'm trying to do?

Basically, I have 5 optional objectives that can be completed in any random order. Once they're all completed the quest should update with a new objective and continue forward.



scn BalokTrackUpgradesSCRIPTshort DoOnceBegin GameMode	if DoOnce == 0		set DoOnce to 1	endif	if doonce == 1 && getobjectivecompleted BalokFinishSchoolQuest 75 && 	                             getobjectivecompleted BalokFinishSchoolQuest 80 && 				     getobjectivecompleted BalokFinishSchoolQuest 85 && 				     getobjectivecompleted BalokFinishSchoolQuest 90 && 				     getobjectivecompleted BalokFinishSchoolQuest 95		                     SetObjectiveDisplayed BalokFinishSchoolQuest 100 1		set doonce to 2	endifend



Well, I could either make that form of your script slightly more optimized by taking out the pointless DoOnce setting:

scn BalokTrackUpgradesSCRIPTshort DoOnceBegin GameMode	if doonce == 0 && getobjectivecompleted BalokFinishSchoolQuest 75 && 	                             getobjectivecompleted BalokFinishSchoolQuest 80 && 				     getobjectivecompleted BalokFinishSchoolQuest 85 && 				     getobjectivecompleted BalokFinishSchoolQuest 90 && 				     getobjectivecompleted BalokFinishSchoolQuest 95		                     SetObjectiveDisplayed BalokFinishSchoolQuest 100 1		set doonce to 1	endifend


Or; You could change how you are doing it slightly to make it less complicated. In each place where you set one of those objectives to completed, also do 'Set MyQuest.DoOnce to MyQuest.DoOnce + 1' then make your quest script (I assume this is a quest script) look like this:

scn BalokTrackUpgradesSCRIPTshort DoOnceBegin GameModeBegin GameMode	If DoOnce == 5		Set DoOnce to 6		SetObjectiveDisplayed BalokFinishSchoolQuest 100 1	EndIfEnd


That way it simply looks for if 5 objectives have been completed, then forwards the quest. Really either way works, neither are super inefficient or anything, and the second way would take more work to change to. So I suggest the first one, simply take out the redundancy.

Alexander J. Velicky
User avatar
maria Dwyer
 
Posts: 3422
Joined: Sat Jan 27, 2007 11:24 am

Post » Tue Aug 23, 2011 12:31 am

Well, I could either make that form of your script slightly more optimized by taking out the pointless DoOnce setting:

That way it simply looks for if 5 objectives have been completed, then forwards the quest. Really either way works, neither are super inefficient or anything, and the second way would take more work to change to. So I suggest the first one, simply take out the redundancy.

Alexander J. Velicky


Got it! Thanks AV. I'm happy I was at least on the right track, lol. One other thing if you don't mind. As I was picking apart other scripts trying to figure out how to write mine, I noticed several scripts used "||" as opposed to "&&". What the heck is "||" for?

Thyanks again. :foodndrink:
User avatar
Ana Torrecilla Cabeza
 
Posts: 3427
Joined: Wed Jun 28, 2006 6:15 pm

Post » Tue Aug 23, 2011 1:05 am

Got it! Thanks AV. I'm happy I was at least on the right track, lol. One other thing if you don't mind. As I was picking apart other scripts trying to figure out how to write mine, I noticed several scripts used "||" as opposed to "&&". What the heck is "||" for?

Thyanks again. :foodndrink:

|| means 'Or'.

Glad I could help. :D
User avatar
Calum Campbell
 
Posts: 3574
Joined: Tue Jul 10, 2007 7:55 am

Post » Tue Aug 23, 2011 6:02 am

I've written a tutorial that covers the use of each operator available in Fallout scripting, if you're interested. Here's a link - http://www.cipscis.com/fallout/tutorials/operators.aspx

The "|" character is usually accessible via shift+\

Cipscis
User avatar
brenden casey
 
Posts: 3400
Joined: Mon Sep 17, 2007 9:58 pm

Post » Tue Aug 23, 2011 4:16 am

Thanks for the help. You both are a credit to the modding community and a great help to us beginners! I'll defenitely give that a good read when I can Cipscis. I love your validator utility. It's saved me a lot of time, especially since I write some stupid stuff trying to learn all this, lol.

AV, I can't wait to play D.E.I.M.O.S. I just gotta polish and clean this one right now. I'm gonna try to release in a week or two. But I'll definitely play it when I can actually get back to playing, lol. I'm sure you understand (I've been lurking on your comments page and know how busy you've been. :whistling: ) I did catch a little of a walkthrough and I can already tell see the clever use of resources you've come up with! Can't wait to try it.

Oh, by the way, all of my scripts are working! This is much more fun and creative setting things up at random as opposed to linear like this!

Thanks again!
User avatar
Pawel Platek
 
Posts: 3489
Joined: Sat May 26, 2007 2:08 pm


Return to Fallout: New Vegas