Tasks Run regardless of conditions?

For all talk about quest development - creation, testing, and quest system.
User avatar
Kamer
Posts: 583
Joined: Mon Mar 05, 2018 9:26 pm

Tasks Run regardless of conditions?

Post by Kamer »

I'm having an issue where tasks are run immediately. Even when I put up certain conditions for tasks to run they are ignored and everything is read in one straight go. I had a working quest last night but it randomly started running all tasks immediately, and being fed up I restarted from scratch. The fact if it works or not seems to be completely random. What am I doing wrong? I'm guessing it has something to do with how I'm spacing.

Code: Select all

Quest: TEST
-- Message panels
QRC:

QuestorOffer:  [1000]
<ce>

RefuseQuest:  [1001]
<ce>           

AcceptQuest:  [1002]
<ce>           

QuestFail:  [1003]
<ce>                     

QuestComplete:  [1004]
<ce>                     

Message:  1011
<ce> Quest Start

Message: 1012
<ce> You feel a strange presence

Message: 1013
<ce> Quest End

QBN:

Foe _warrior_ is Warrior

clock _time_ 0.0:45
clock _attack_ 0.0:25

--	Quest start-up:
	say 1011
	
_attack_ task:
	say 1012
	create foe _warrior_ every 1 minutes 1 times with 100% success
		
_time_ task:
	say 1013
	end quest

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Tasks Run regardless of conditions?

Post by Interkarma »

Actions should only run once something triggers them (such as your clock timer). I'm not aware of any problems that will cause this occur, but if your test quest is a good way to reproduce, I'll have a look at this in more detail later.

User avatar
Jay_H
Posts: 4061
Joined: Tue Aug 25, 2015 1:54 am
Contact:

Re: Tasks Run regardless of conditions?

Post by Jay_H »

I have rarely seen this in the past. I haven't wanted to report it since I couldn't see a reliable reproduction method. But I can say it's been around since September.

In my case it was with a Prompt action that insisted on happening out of turn.

User avatar
Kamer
Posts: 583
Joined: Mon Mar 05, 2018 9:26 pm

Re: Tasks Run regardless of conditions?

Post by Kamer »

I wouldn't call it rare. I can't seem to create a single quest without it breaking and wanting to run everything at once.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Tasks Run regardless of conditions?

Post by Interkarma »

Looking at your quest above to reproduce, what you've found is a parsing bug. :)

There are some extra tabs underneath each task that cause each task to become linked to the task before it. Basically the tabs cause each task header to be dropped and become joined to previous task - in this case all the way back startup task. Here's a screenshot showing the tabs under each task block.

I'll work on a fix for this now. If you remove the tabs under each task block it executes OK (tested).

Jay, I hazard this is the same problem you had but you managed to clean up formatting without realising it was part of problem.

extra-tabs.png
extra-tabs.png (7 KiB) Viewed 3102 times

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Tasks Run regardless of conditions?

Post by Interkarma »

I've fixed whitespace handling between task blocks now. It can handle your repro quest above without any problems. This will be in next round of builds.

Thanks for testing and feedback. :)

User avatar
Kamer
Posts: 583
Joined: Mon Mar 05, 2018 9:26 pm

Re: Tasks Run regardless of conditions?

Post by Kamer »

I knew it had something to do with that. Thanks a bunch! Now I can get back to work.

User avatar
Kamer
Posts: 583
Joined: Mon Mar 05, 2018 9:26 pm

Re: Tasks Run regardless of conditions?

Post by Kamer »

Code: Select all

Quest: TEST
-- Message panels
QRC:

QuestorOffer:  [1000]
<ce>

RefuseQuest:  [1001]
<ce>           

AcceptQuest:  [1002]
<ce>           

QuestFail:  [1003]
<ce>                     

QuestComplete:  [1004]
<ce>                     

Message:  1011
<ce> Quest Start

Message: 1012
<ce> You feel a strange presence

Message: 1013
<ce> Quest End

QBN:

Clock _time_ 00.00:10
Clock _attack_ 0.00:03

--	Quest start-up:
	say 1011

_attack_ task:
	say 1012

_time_ task:
	say 1013
	end quest
It's definitely working but now I'm having an issue that the clocks won't work. What I'm doing wrong now?

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Tasks Run regardless of conditions?

Post by Interkarma »

Don't forget to call:

Code: Select all

start timer _clockName_
You can also pause a clock with:

Code: Select all

stop timer _clockName_
You can chain timers together as well, e.g. start clock A at startup then start clock B from clock A task. Jay is an expert at this stuff and will be able to help more.

When looking at a timer in the quest debugger: grey=not started, green=running, red=finished.

User avatar
Kamer
Posts: 583
Joined: Mon Mar 05, 2018 9:26 pm

Re: Tasks Run regardless of conditions?

Post by Kamer »

Where do I find the Quest Debugger?

Post Reply