Can I change the questgiver's location in a Radiant quest?

Post » Thu Jun 21, 2012 4:31 am

Hey guys, I'm about to make a Radiant quest for the first time, and the Bethesda tutorial only seems to mention things like picking dungeons and bosses. However, what I'd like to do, is have the quest-giver start off in a number of random locations- specifically, I'd like him to be locked up in a prison cell in a Bandit Fort. I've got a specific NPC I want to use, but I want his location to change depending on a number of the usual conditions (has the dungeon been visited recently, is it close by, etc etc)

Can I do this using the Radiant Story feature, and if so, how?
User avatar
Emma Pennington
 
Posts: 3346
Joined: Tue Oct 17, 2006 8:41 am

Post » Thu Jun 21, 2012 7:48 am

I'm a little confused with what you want:
  • First you say Radiant might help you make Quest-Givers "random"
  • Then you say you want a quest-giver to be at a specific location
While "radiant" could help with both, the second bit sounds as though you know which NPC you want to be the quest giver? (If so, "radiant" is not needed)

If you want a specific NPC to give the Quest, but to change locations
Then you can either set the NPC as a Quest Alias and move it - the alias - using scripts OR move the NPC using an AI-Package

If you go with moving by script, then the NPC can change location depending on which quests/quest-stages the player is engaged on.

This does not use Radiant (though your quests could still be Radiant)

If you want any NPC to give Quests (random NPCs)
Quest Giving is just a dialogue option that one or more NPCs can speak. So, in your quest, you could assign the bit of necessary dialogue to a Quest-Alias (Reference Alias). If you set that Reference Alias up to be dynamic then you can simply assign the relevant dialogue to the dynamic alias.

Then any NPC that matches the criteria can say your Quest-giving line. So you could setup a dynamic Reference Alias that select any NPC in a particular dungeon (and using Match Conditions, any Orc in a particular dungeon ... or random dungeon)

This does use "Radiant" for the Quest-Giver.


Indeed: Having thought about it for a bit longer. If you set your piece of quest-giving dialogue so that it can be spoken by any "Orc" voice, you have just created a "Radiant" Quest-Giver (just make the correct setting in the Dialogue Options Box). I guess you would say that is part of the "Radiant" system.


Note: "Radiant" isn't really anything. It's just a term Beth gave to making various things dynamic. A "Radiant" Quest is like any other quest, but some Aliases in the Quest are dynamically assigned (any Orc, or whatever).
User avatar
Jack Walker
 
Posts: 3457
Joined: Wed Jun 06, 2007 6:25 pm

Post » Thu Jun 21, 2012 7:24 am

I'm a little confused with what you want:

Like I said, it's my first time making the jump from regular quests to quests using Radiant Story stuff. Sorry for not using the terms correctly. :smile:

Okay. This is what I want. I want my NPC to spawn in one of a number of random dunegons- but to ONLY show up in that one dungeon, using the typical radiant quest conditions of finding a dungeon that hasn't been cleared recently, is in the same hold, etc etc.

EDIT: Another thing (this is probably the most "radiant" part), I want the player, when he enters this randomly-selected dungeon, to have a quest pop up telling him to actually rescue the quest-giver from the prison. Which would of course tie into the NPC spawning in one and only one dungeon.

Also, I can use your suggestion about using the voice instead of the NPC in the conditions, but how do I stop the other NPCs from spawning?
User avatar
N3T4
 
Posts: 3428
Joined: Wed Aug 08, 2007 8:36 pm

Post » Thu Jun 21, 2012 7:04 am

The first part of what you need should be pretty easy. Set a location alias up with "find matching location" and give it the condition LocationHasRefType of CaptiveMarker.
Now you have your location, now set up an alias for the captivemarker with for your location's captive marker.
And of course an alias for your captive.

Next I looked in quest CR08 for hints on how to get the actor to the captive marker. Looks like the following lines of code should work:
Actor poorSap = Victim.GetActorReference()poorSap.MoveTo(VictimMarker.GetReference())poorSap.EvaluatePackage()ReferenceAlias Property Victim autoReferenceAlias Property VictimMarker auto
This is cut from the quest script, so you can change poorSap, Victim and VictimMarker to what you want. Put this in the first stage of your quest and don't forget to set the properties of Victim and VictimMarker.

The second part of having the quest pop up when the player enters the dungeon I'm not as sure about. Maybe set up the player as an alias then put a script on the player alias with a script like:
Event OnLocationChange(Location akOldLoc, Location akNewLoc)If akNewLoc == MyDungeon  GetOwningQuest().SetStage(10)EndIfEndEventLocationAlias Property Victim auto
The problem with this might be that some locations contain the exterior cell, so the quest may start when the player is outside.
User avatar
Matthew Warren
 
Posts: 3463
Joined: Fri Oct 19, 2007 11:37 pm

Post » Thu Jun 21, 2012 5:02 am

Just to be totally clear (oh, and thanks, by the way, this is exactly what I was after!), the "MyDungeon" you've put in the second script, that's the Location Alias you've used, right?
I'm still trying to get my head around Papyrus after spending 5 years or so mastering Oblivion and Fallout 3's scripting language. :tongue:

EDIT: I seem to be having some trouble with the properties. I thought I added them properly, but I keep getting this error when I try to compile that first script you posted:
Starting 1 compile threads for 1 files...
Compiling "QF_danIntroQuest_01014305"...
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_danIntroQuest_01014305.psc(26,0): no viable alternative at input 'ReferenceAlias'
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_danIntroQuest_01014305.psc(26,24): no viable alternative at input 'Victim'
c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\QF_danIntroQuest_01014305.psc(29,0): missing EOF at 'EndFunction'
No output generated for QF_danIntroQuest_01014305, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on QF_danIntroQuest_01014305

User avatar
Stephanie I
 
Posts: 3357
Joined: Thu Apr 05, 2007 3:28 pm

Post » Wed Jun 20, 2012 5:35 pm

I seem to be having some trouble with the properties. I thought I added them properly, but I keep getting this error when I try to compile that first script you posted:

Take a look at the scripts in Quest CR08 - Your problem is probably that your script is not extending the right object (look at the top line of the script in CR08) OR that you have not set "victim" and/or "victimMarker" as ALIASES in your Quest? (I think the later ... they aren't Properties, they are Aliases)

... Everything in a quest should be an alias ... from the UberSword you get as a prize, to all characters in the plot, to the note you get from the courier to start it all off ...

Remember: Radiant is just a fancy word for assigning VALUES to ALIASES by using a set of conditions (dynamic). Look at CR08 and check out how the Aliases are chosen ("victim" is a good one to look at).


But also remember that CR08 is STARTED by speaking to a partially random NPC (one of the Companion Leaders).

So, in CR08 you have:
  • A Quest Giver (a member of the Companions) - Who has dialogue to give the PC the Radiant Quest
  • A Victim (who is trapped in a random dungeon and must be rescued)
  • A Dungeon (selected at random) in which the Victim is placed

Note that the Companions Quest Line is quite complex and so you are being pointed at a complex example ... when your requirements are not exactly the same and not as complex as the whole of the Companions Saga.


Spend a bit of time thinking about exactly what you want your mod/quest to do:

1) How do I give the PC the (sub) Quest to go and find my NPC ("victim" in CR08) - You could get a note from a Courier (or read a book), or it could be start-game-enabled
2) How do I move/place a QUEST-GIVER in a random location? A radiant Quest could be used to do this ... but this would NOT be your main quest ...
3) When the PC goes and finds the NPC (and completes the Radiant sub-quest) the NPC would have dialogue to give the PC the actual Quest that you want
User avatar
Crystal Birch
 
Posts: 3416
Joined: Sat Mar 03, 2007 3:34 pm

Post » Wed Jun 20, 2012 5:53 pm

Take a look at the scripts in Quest CR08 - Your problem is probably that your script is not extending the right object (look at the top line of the script in CR08) OR that you have not set "victim" and/or "victimMarker" as ALIASES in your Quest? (I think the later ... they aren't Properties, they are Aliases)

I've got my Properties and Aliases using the same name, could that be the problem?

And my first line says: Scriptname danIntroScript1 extends Quest Conditional

Also h4vent, my modding background is purely Construction Set and GECK-related, so the way the Creation Kit does things makes absolutely no sense to me (10 years of expecting scripts to work a certain way tends to do that). So I get your intent of trying to get me to figure it out on my own, but honestly, if you could just spell it out like DangerManzo, I'd have a much easier time of understanding. :)
User avatar
Bloomer
 
Posts: 3435
Joined: Sun May 27, 2007 9:23 pm

Post » Wed Jun 20, 2012 11:21 pm

I'll look at the Compile errors a bit later ... When my CK is open ... if no one else responds by then.


As to the other point I'm trying (and failing!) to make:
  • You need an "event" to start a quest (whether it is radiant or just normal) - This means some sort of Quest-Giver (could be reading a book, could be talking to an NPC).
  • When that event occurs, some script runs myQuest.Start() - This runs the stage you have flagged as the "Start" stage
So, you can't move your Questgiver to a random dungeon using a radiant quest, because you have not STARTED the radiant quest


From what I understand of your situation:

1. You will need a way to start a radiant quest, the purpose of that quest is to place your NPC Alias (your Quest-Giver) in a random dungeon (this is a pre-quest to your main quest)
2. Once that pre-quest is complete, the player will have found your NPC (that's the pre-quest Objective)
3. Now your NPC can give out his Quest to the player (via Dialogue)

At least, that is what I think you want?


And yeah - From a scripting point of view, Skyrim takes a bit of adjusting to (from Oblivion/Morrow modding), but you'll get there in the end. I know it will seem like teaching Granny to svck eggs, but I recommend the Bendo Tutorials, before you go any further (on the wiki). It's baby stuff, but - if you follow them right through in a temporary esp file that you create - it will show you a lot of the main differences. Do both the beginner and the intermediate extension.

Everyone suffered with the changes ... You should have seen this place a couple of months ago! ;)
User avatar
Rachel Tyson
 
Posts: 3434
Joined: Sat Oct 07, 2006 4:42 pm

Post » Wed Jun 20, 2012 6:10 pm

I'm sorry, I screwed up that second script pretty bad. I made 2 errors. First, I forgot to change "Victim" to "MyDungeon" in the property line (I was copy/pasting from earlier to save time). Second, akNewLoc is a Location while MyDungeon is a LocationAlias. So we need GetLocation(), which can be used on the LocationAlias to return the Location.

I booted up the CK and got this version to compile, although I can't know if it will work without testing it, and this one is going to be hard to test because it is a random dungeon. This code goes on the Player alias.
Scriptname RadiantTestPlayerScript extends ReferenceAliasEvent OnLocationChange(Location akOldLoc, Location akNewLoc)If akNewLoc == MyDungeon.GetLocation()  GetOwningQuest().SetStage(10)EndIfEndEventLocationAlias Property MyDungeon auto

The way I am setting this quest up is to be always running. The player won't get a "Quest Started..." message until stage 10 though, so stage 0 can be used to move the victim to the victimmarker. In this case the script would go in the fragment for stage 0, and what I posted earlier is also bogus.
In script fragments the aliases are automatically properties, so you can refer to them with Alias_XXX where XXX is the name of the alias. So in the fragment for stage 0 paste this in:

Alias_Victim.GetActorReference().MoveTo(Alias_VictimMarker.GetReference())

The EvaluatePackage() line in the earlier script was part of the script in CR08, and I copied it in, too. But in this case I don't think it is necessary. You will need a package that has the Victim stay at the VictimMarker, but the victim should use it automatically without the evaluate line.
I'm sorry to have given you bad scripts before, I was just trying to offer guidance on what to try and what has been done before, not actual working scripts. The scripts in this post will compile, but I haven't tested if they will work. If I have time later I will see if I can get it to work in game.

Oh, and having your properties the same name as your aliases is fine, in fact, it makes things easier because you can auto-fill them.
User avatar
CSar L
 
Posts: 3404
Joined: Fri Nov 09, 2007 9:36 pm

Post » Thu Jun 21, 2012 3:01 am


You sir, are brilliant. Thank you!

Going through the script, I think I'm getting an idea of how it all fits together. I still think Papyrus is bad and it should go back to the old way, but looking at the code, I think I can understand it. :)
User avatar
Elisha KIng
 
Posts: 3285
Joined: Sat Aug 18, 2007 12:18 am

Post » Thu Jun 21, 2012 8:58 am

I got a chance to test this in the CK briefly. For some reason the moveto command was not working in stage 0, but it did if I moved it to stage 10. I don't know if any captive markers are within view of the player when they enter the location, cause if they are the player will just see them appear there. Also, your victim should be protected or possibly in the captivefaction or they will be dead like mine was when I got there.

Add to your conditions for MyDungeon: LocationHasKeyword LocTypeDungeon. I got Riften Jail once.

In order to find out what dungeon to look in for debugging I made a short note and placed it in Riverwood inn. If you already know about http://www.creationkit.com/Text_Replacement you can ignore the rest of this paragraph. I set an alias for it and checked the "uses stored text" box. In the MyDungeon alias I checked the "stores text" box. Then in the note put: The victim is in .

Let me know how it works out for you.
User avatar
butterfly
 
Posts: 3467
Joined: Wed Aug 16, 2006 8:20 pm

Post » Thu Jun 21, 2012 3:30 am

I got a chance to test this in the CK briefly. For some reason the moveto command was not working in stage 0, but it did if I moved it to stage 10. I don't know if any captive markers are within view of the player when they enter the location, cause if they are the player will just see them appear there. Also, your victim should be protected or possibly in the captivefaction or they will be dead like mine was when I got there.

Add to your conditions for MyDungeon: LocationHasKeyword LocTypeDungeon. I got Riften Jail once.

In order to find out what dungeon to look in for debugging I made a short note and placed it in Riverwood inn. If you already know about http://www.creationkit.com/Text_Replacement you can ignore the rest of this paragraph. I set an alias for it and checked the "uses stored text" box. In the MyDungeon alias I checked the "stores text" box. Then in the note put: The victim is in .

Let me know how it works out for you.

Thanks, this is pretty awesome. I got it to work, but for some reason it moved my NPC to an ore vein. I might have to do some "digging" around the CK to see what went wrong there. :tongue:
EDIT: Turns out it was an XMarkerHeading that just so happened to have the correct ref type.

And I realised it was nearly impossible (without the debug note you suggested) to figure out where the NPC would spawn, so I went and made the whole thing activated by a courier greeting the player, as I found a great tutorial for that. It wouldn't be fair to have people download my mod and only stumble on the quest purely by chance, so I made it a bit easier for people that way. :smile:

Thanks again, DangerManzo!
User avatar
Kevan Olson
 
Posts: 3402
Joined: Tue Oct 16, 2007 1:09 am


Return to V - Skyrim