Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Implementation of a quest stage


Citrus
 Share

Recommended Posts

Since I am without a capable PC in which to mod, I've been thinking about the best way of implementing the first quest stage from my mod's main quest. It could be a rather simple affair of just telling you where to go next but, for the sake of consistency, I decided to make it more complicated.

There are two "places" that you need to visit during the main quest: a house and a Dwemer ruin. Both are locked from the start to prevent the player from wandering in. You can still mark them on your map if you pass close by and there lies the "problem". I want the first journal entry you get for the main quest to reflect whether you have found one, both or none of those two places. You get a different journal entry depending on the conditions (4 different entries, in total). If you only found the house, the marker will point directly towards the house and if you haven't found the house, the marker will point to a landmark from where you must start your search (the clues will be stated on the journal entry). If you found the ruin, well, everything stays as it is. If not, then the marker shows on your map (not the red arrow; the light brown marker instead to prevent fast travel). If you have found none, you get the red marker pointing to the landmark and the light brown marker on the ruin.

The problem I mentioned earlier is that there's no function that can register whether a certain map marker has been tagged as discovered or not. I decided that I could place an Xmarker to measure the player's distance to the Xmarker (which would be exactly where the Map Marker is in the CS) and set that distance to 1800 units (the default distance at which a place becomes "found", so to speak). I thought about making that a silent quest that would stop the moment you get the first journal entry. Those Xmarkers (two, one for each location) would modify a global variable that would record whether the place was found or not: it would be set to 1 if the distance from the player to the Xmarker was below 1800 units (so the place was marked as discovered) and would stay at zero if the player hadn't discovered the place (in other words, wouldn't have passed at less than 1800 units from the marker).

According to the values of both globals, the quest entry would be decided: if both were at 1, you'd get an entry that would point you directly to the house and leave the Dwemer ruin marker as it is (discovered); you the global pertaining to the house marker was at 1 and the Dwemer ruin's at 0, you'd get an entry pointing you to the house and would then mark the ruin on your map; etc.

I think this is a good way of doing this but I'd like to hear more opinions on the matter, mainly in ways of optimizing the process. There's no need to mention OBSE functions because I'm trying to stay away from it in my mod. If I can do it in vanilla without making things extremely complicated, I will.

If you want, I can post a rough draft of the scripts I intend to use. rough because I don't have the CS installed on this computer and I may get some things wrong.

Link to comment
Share on other sites

GetDistance is the way to go but you can just give your MapMarkers a Ref ID and do a If GetDistance MapMarkerRef < 1800 in your quest script, pointless to add the superfluous xmarkers. :thumbup:

There is likely a much simpler way but you left out how the quest initiates. Does it start when you discover one of these places? Do you receive it from an NPC? I can give a clearer answer if I know how its supposed to start. :candle:

Link to comment
Share on other sites

GetDistance is the way to go but you can just give your MapMarkers a Ref ID and do a If GetDistance MapMarkerRef < 1800 in your quest script, pointless to add the superfluous xmarkers. :thumbup:

There is likely a much simpler way but you left out how the quest initiates. Does it start when you discover one of these places? Do you receive it from an NPC? I can give a clearer answer if I know how its supposed to start. :candle:

That part of giving the Map Markers a unique RefID escaped me. Thanks for the suggestion :).

The "true" quest only initiates when you pick up a book in an Ayleid ruin. This part of the map markers is just the preparation for when you pick up said book (so it writes the correct journal entry). I forgot to mention I was planning on having the distance calculation as two separate quests, one for each place: they would stop as soon as you were within range (discovered the place) OR if you picked up the book (if both had been terminated by the time you pick up the book, it would be fine; if not, they would stop because checking if you had discovered the locations wasn't necessary anymore).

The two quests to calculate the distance and register if the location has been discovered or not would be running from the start (with Start Game Enabled checked). Having them separated allows me to terminate the quests when necessary and avoid running an entire script when only half of it would be necessary (in case you discover one of the places). I'm not sure about the impact of having two quests or just one for both places. Which one is the best option, performance-wise, is what I'm trying to find out with your help, as well as for the rest of the quest stage.

Link to comment
Share on other sites

You only need one quest, with four starting stages 1-4, one for each possible sceario (no location found, location A found, location B found, both locations found). Then put a script on the book itself that runs once OnEquip, checks the global count for your markers and sets the right starting stage (if global count is 0 setstage 1, if global count is 1 setstage 2, etc etc). Each possible start stage will have a different journal entry then :thumbup:

Your quest script will only need to hold the variable,the actual checks will be done when the book is equipped and will only run once so don't worry about performance impact from the quest running. :no:

Link to comment
Share on other sites

You only need one quest, with four starting stages 1-4, one for each possible sceario (no location found, location A found, location B found, both locations found). Then put a script on the book itself that runs once OnEquip, checks the global count for your markers and sets the right starting stage (if global count is 0 setstage 1, if global count is 1 setstage 2, etc etc). Each possible start stage will have a different journal entry then :thumbup:

Your quest script will only need to hold the variable,the actual checks will be done when the book is equipped and will only run once so don't worry about performance impact from the quest running. :no:

I see. The quest script would measure the distance and modify the global accordingly and then the book script will read it and put out the quest stage accordingly. The thing that's confusing me is the GetDistance function: if I pass at less than 1800 units from the marker, it will change the variable but what happens if I move away? Will it revert the variable back to 0? I'm sorry for the ignorance but not having the CS at hand just makes things more difficult (not to mention this is the first quest I'm scripting...)

Link to comment
Share on other sites

No once the variable is set it would take a reverse command setting it -1 to revert it backward. Moving away would have no effect once it's been counted. You do want to make sure to use a doonce command to prevent the same marker from counting against the global count more than once though. :yes:

[EDIT] As an alternative, you could avoid the mapmarker thing altogether and just use a script on the location doors to set the count OnActivate. I don't know many folks who would discover a new place and move along without trying the door, you know that which is why you planned on using dummy doors until the quest is initiated. You can script your dummy doors to give a message like "Strange, this place won't open to you now." but also kick the global count +1 that would mean less tracking for the quest script, you get to avoid a gamemode block, and ultimately the effect would be the same. :thumbup:

  • Upvote 1
Link to comment
Share on other sites

No once the variable is set it would take a reverse command setting it -1 to revert it backward. Moving away would have no effect once it's been counted. You do want to make sure to use a doonce command to prevent the same marker from counting against the global count more than once though. :yes:

You learn something every day :).

[EDIT] As an alternative, you could avoid the mapmarker thing altogether and just use a script on the location doors to set the count OnActivate. I don't know many folks who would discover a new place and move along without trying the door, you know that which is why you planned on using dummy doors until the quest is initiated. You can script your dummy doors to give a message like "Strange, this place won't open to you now." but also kick the global count +1 that would mean less tracking for the quest script, you get to avoid a gamemode block, and ultimately the effect would be the same. :thumbup:

That's a good idea. A great one, actually. That gave me another idea, in turn, as to what I'll write on the message. I'll move along with this since it opens up more roleplay possibilities.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...