Page 2 of 4

Re: PC at _place_ do _task [Dungeon Exteriors]

Posted: Fri Jun 01, 2018 1:35 am
by Interkarma
Nice! I'll work on this over the next day or so. Thanks for your patience as I came to grips with what you were after.

Re: PC at _place_ do _task [Dungeon Exteriors]

Posted: Fri Jun 01, 2018 1:59 am
by Jay_H
If implemented, this'll open a lot of potential for quests :D I'm imagining some already!

Re: PC at _place_ do _task [Dungeon Exteriors]

Posted: Fri Jun 01, 2018 2:21 am
by Kamer
Yea, might even be able to check when the player isn't at any place at all.

Re: PC at _place_ do _task [Dungeon Exteriors]

Posted: Fri Jun 01, 2018 2:36 am
by Interkarma
Good idea! Fits in with this perfectly.

Re: PC at _place_ do _task [Dungeon Exteriors]

Posted: Sun Jun 10, 2018 12:35 am
by Interkarma
I'm working on this one today. I've had a while to think about how this should function, and feel it's important to be distinct from "pc at" as you need a trigger not a toggle in this situation. The syntax will look like the following:

Code: Select all

when pc enters exteriorLocationType
when pc exits exteriorLocationType
You can use any of the exterior types from "Quests-Places", including anywhere. This will allow you to set up wilderness detection as well. Once you dig into it, you should be able to create some powerful outcomes from simple scripts.

Code: Select all

labyrinth
keep
ruin
graveyard
coven
farmhome
wealthyhome
poorhome
tavernhome
templehome
cult
city
hamlet
village
anywhere
I'm still working through the implementation so it might be a couple of days away. I'll post an example when I can to show how flexible it can be.

Re: PC at _place_ do _task [Dungeon Exteriors]

Posted: Sun Jun 10, 2018 1:02 am
by Jay_H
This sounds excellent. One thing I'll mention is that when I was testing quests back in September, I tried using a "pc at" condition at one of the domed outdoor shrines, the little blue insignificant ones on the world map. For some reason I couldn't get "pc at" to function at them. It was way too soon to report it as a bug and I'm still not bothered with it, so I just wanted to mention that in case you run into the same problem.

Re: PC at _place_ do _task [Dungeon Exteriors]

Posted: Sun Jun 10, 2018 1:36 am
by Interkarma
Thank you Jay. Can you remember which exterior type you were using for them? I'll need to check my mapping in the Quests-Places table. From memory, they are of the type "cults".

Re: PC at _place_ do _task [Dungeon Exteriors]

Posted: Sun Jun 10, 2018 2:05 am
by Jay_H
I actually managed to save a copy of it, luckily enough. IIRC the problem was with both cult and templehome, but I can't remember clearly. That's just what my notes about it said.

Actually, it was with cult. Templehome was functional IIRC.

Re: PC at _place_ do _task [Dungeon Exteriors]

Posted: Sun Jun 10, 2018 5:04 am
by Kamer
Great news. This is gonna cut down the quests lines to almost nothing and give so many more outcomes. I can have sieges work then way I need them to now. I can't thank you enough.

Re: PC at _place_ do _task [Dungeon Exteriors]

Posted: Sun Jun 10, 2018 10:54 pm
by Interkarma
This is on git now and will be in next round of builds. Here's an example of use.

Code: Select all

---- Example quest to track entering "home" location types or wilderness
---- Start from console: 'startquest __demo20"

Quest: __DEMO20


QRC:

QuestLogEntry:  [1010]
%qdt
  You must find any home location
and also explore the wilderness.


QBN:

---- Quest startup
log 1010 step 0

variable _atAnyHome_
variable _inWilderness_

---- Clear wilderness var when entering any location type
---- Also re-arms exit anywhere task so it can fire again
_entersAnywhere task:
	when pc enters anywhere
	clear _inWilderness_
	clear _exitsAnywhere_

---- Set wilderness var when exiting any location type
---- Also re-arms enters home task so it can fire again
_exitsAnywhere_ task:
	when pc exits anywhere
	setvar _inWilderness_
	clear _atAnyHome_
	clear _entersAnywhere_
	clear _entersAnyHome_
	
---- Set home var when entering any "home" location type
_entersAnyHome_ task:
	when pc enters farmhome
	when pc enters wealthyhome
	when pc enters poorhome
	when pc enters tavernhome
	when pc enters templehome
	setvar _atAnyHome_
Start the above quest from console using "startquest __demo20". It shows how to do wilderness detection using "when pc enters anywhere" and "when pc exits anywhere". Note how the tasks clear each other to re-arm trigger.

There's also an _entersAnyHome_ task that fires when player enter any "home" location. If you have the quest debugger open, you will see the variable states switch on/off as you cross back and forth over the location boundary line.


In this first screenshot, player is in a normal town. They are technically somewhere, but it's neither a home nor wilderness.
in-town.JPG
in-town.JPG (28.82 KiB) Viewed 3945 times

In the second screenshot, player is in wilderness.
in-wilderness.JPG
in-wilderness.JPG (27.68 KiB) Viewed 3945 times

Finally, the player has entered a home-type location.
any-home.JPG
any-home.JPG (25.57 KiB) Viewed 3945 times

With careful re-arming and no end conditions, you could build a quest that performed all kinds of actions based on where player is in world. Because this is a trigger (not a toggle) you can stack them up underneath the parent task and any one of them will trigger the task. You just have to re-arm task as in example above. But this gives you the power to choose exactly when and how the task is shut down or re-armed.