I just made this pretty simple "kill x and return" quest for the temples of all types, and it luckily all seems to work as expected behavior wise, but the main issue is that when I "complete" the quest and get the reward my character is not getting +5 or whatever reputation with the faction that I just did the quest for, but instead getting -2, which makes no sense to me why it's doing this.
Here is the "quest pack":
As well as a save if you need it, clicking on the NPC just in front of you will complete the quest:
Why Is Completing This Quest Giving Negative Reputation?
- Magicono43
- Posts: 1141
- Joined: Tue Nov 06, 2018 7:06 am
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: Why Is Completing This Quest Giving Negative Reputation?
My first thought is you may be missing 'give pc nothing' before you end the quest? Usually quests have a reward, but if you don't you still need to trigger an action that marks the quest as having completed successfully.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods
- Jay_H
- Posts: 4070
- Joined: Tue Aug 25, 2015 1:54 am
- Contact:
Re: Why Is Completing This Quest Giving Negative Reputation?
This is an odd case, indeed. You placed the "end quest" action too soon. Either place it after "give pc reward" in each of the reward tasks, or add a timer like this:
This makes it trigger the reputation gain properly.
Code: Select all
Clock _delay_ 00:00
_success_ task:
when _clickqgiver_ and _vampdead_
pick one of _reward1_ _reward2_ _reward3_ _reward4_ _reward5_
start timer _delay_
- Magicono43
- Posts: 1141
- Joined: Tue Nov 06, 2018 7:06 am
Re: Why Is Completing This Quest Giving Negative Reputation?
Huh, I had a feeling it was something involving the quest ending too early. I think this happened because I did what Hazelnut told me not to do, which was looking at some of these "events" in a procedural sort of way and not in a "event handler" way like they actually work.Jay_H wrote: ↑Mon Aug 10, 2020 7:35 am This is an odd case, indeed. You placed the "end quest" action too soon. Either place it after "give pc reward" in each of the reward tasks, or add a timer like this:
This makes it trigger the reputation gain properly.Code: Select all
Clock _delay_ 00:00 _success_ task: when _clickqgiver_ and _vampdead_ pick one of _reward1_ _reward2_ _reward3_ _reward4_ _reward5_ start timer _delay_
So what I thought was happening was, the "pick one of" action was rolled and then it would immediately go to one of those reward events, and when that action was done, it would jump back to the _success_ task and THEN end the quest (like how a method call would work.)
But what is actually happening I think, is that "pick one of" is rolled and then immediately after the quest is ended (too early making it a failure reputation wise.) And THEN the reward is given after the quest has already been ended.
I also thought that "give pc" an item did give the proper quest completed signal like "give pc nothing" does, but that would not matter even if it was the case, since the pick one "call" does not immediately get one of the chosen "reward" tasks ran, only after end quest has already run.
So yeah, somewhat strange edge-case, but it does make sense where I messed up here, thanks for the correction, i'll try it out in a little bit and keep that in mind for future quests.
- Magicono43
- Posts: 1141
- Joined: Tue Nov 06, 2018 7:06 am
Re: Why Is Completing This Quest Giving Negative Reputation?
Your solution worked by the way, Jay.
It looks like this now under the QBN:
I may as well ask as well now that this is working. Is there a way to set the reputation gain to something specific? Like if I wanted a more difficult quest to give more rep or something around those lines?
It looks like this now under the QBN:
Code: Select all
QBN:
Person _questgiver_ group Questor male
Place _vampdung_ remote dungeon0
Clock _qtime_ 00:00 0 flag 17 range 1 5
Clock _delay_ 00:00
Foe _vamp_ is Vampire
Item _reward1_ item class 10 subclass 0
Item _reward2_ item class 10 subclass 1
Item _reward3_ item class 10 subclass 2
Item _reward4_ item class 10 subclass 5
Item _reward5_ item class 10 subclass 6
-- Quest start-up:
start timer _qtime_
reveal _vampdung_
log 1020 step 0
place foe _vamp_ at _vampdung_
_qtime_ task:
end quest
_vamphit_ task:
injured _vamp_
say 1060
_vampdead_ task:
killed 1 _vamp_
say 1061
_clickqgiver_ task:
clicked npc _questgiver_
_success_ task:
when _clickqgiver_ and _vampdead_
pick one of _reward1_ _reward2_ _reward3_ _reward4_ _reward5_
start timer _delay_
_delay_ task:
end quest
_reward1_ task:
give pc _reward1_
_reward2_ task:
give pc _reward2_
_reward3_ task:
give pc _reward3_
_reward4_ task:
give pc _reward4_
_reward5_ task:
give pc _reward5_
_clearclick_ task:
when not _vampdead_ and _clickqgiver_
say 1003
clear _clickqgiver_ _clearclick_
I may as well ask as well now that this is working. Is there a way to set the reputation gain to something specific? Like if I wanted a more difficult quest to give more rep or something around those lines?
- Hazelnut
- Posts: 3016
- Joined: Sat Aug 26, 2017 2:46 pm
- Contact:
Re: Why Is Completing This Quest Giving Negative Reputation?
The +5/-2 for success/fail is fixed, but you can change rep for the faction of any npcs your script defines.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods