[Serious Bug Found] Events can be started by the stop task..

This forum is the place to learn about and discuss ADRIFT 5. Feel free to mention any bugs you find here, but please also add these to the Bugs & Enhancements list.

Please also refer to the ADRIFT 5 Wiki for more information.
Post Reply
User avatar
DazaKiwi
Posts: 778
Joined: Thu Oct 21, 2010 10:05 am
Points: 61
Location: New Zealand

[Serious Bug Found] Events can be started by the stop task..

Post by DazaKiwi »

I have an event that is triggered by two tasks and another to stop it. It is set to repeat and when active is suppose to trickle down the life support oxygen- only when the life support sys has not been repaired. When it does get repaired a task runs that is suppose to stop this event from running. BUY it keeps running regardless. Is this because i have checked Repeat?

I thought the task that stops the even will do that regardless of Repeat being ticked and when triggered to run again by one of the other tasks it will go back to running and repeat once a turn- which will be trickling down the oxygen supply.

*Update: so Denk did a demo regarding this issue i had and discovered this bug, where the task that stops an event actually can start it (if the task hasn't been started). I changed the title of this thread to highlight this issue as it could really mess up a project or just get confused and think it is something else going on when they run into this problem.
Last edited by DazaKiwi on Tue Jun 25, 2019 12:52 pm, edited 2 times in total.
User avatar
Denk
Posts: 647
Joined: Mon Feb 22, 2016 6:21 pm
Points: 251
Location: Hjørring, Denmark

Re: Reapeating event wont stop even with a stop task?

Post by Denk »

I made a small test-file to test how ADRIFT behaves:
EventRepeating.taf
(14.96 KiB) Downloaded 55 times
You can type START and STOP to control the event, and you type TEST to get the value of the test variable, which only increases when the event is running.
(note I also made a task START2 because you mentioned that you had two tasks, which would start the event)

It seems that if the event has never been running, a stop-task wil cause the event to run! This must be regarded as a bug in ADRIFT. But if the event is started correctly with START, you will get the correct behaviour of START and STOP.

Here is a transcript from the test-file, which demonstrates the right behaviour as well as the bug:

Code: Select all

> restart
Untitled
 
 
Living Room
Nothing special.  
 
> test
Variable test is now: 0.
 
> test
Variable test is now: 0.
 
> test
Variable test is now: 0.
 
@ The variable is not increasing, i.e. the event is not running.
> start
Event should start
 
> test
Variable test is now: 0.
 
> test
Variable test is now: 1.
 
> test
Variable test is now: 2.
 
> test
Variable test is now: 3.
 
@ typing START started event.
> stop
Event should stop.
 
> test
Variable test is now: 4.
 
> test
Variable test is now: 4.
 
> test
Variable test is now: 4.
 
@ typing STOP stopped the event
> stop
Event should stop.
 
> test
Variable test is now: 4.
 
> test
Variable test is now: 4.
 
@ typing STOP again did not start the event. I.e. it behaves as expected
@ but before the event has run the first time, STOP will cause the event to start! :
> restart
Untitled
 
 
Living Room
Nothing special.  
 
> test
Variable test is now: 0.
 
> test
Variable test is now: 0.
 
> stop
Event should stop.
 
> test
Variable test is now: 0.
 
> test
Variable test is now: 1.
 
> test
Variable test is now: 2.
 
@ as seen above, STOP makes the event start, which must be regarded as a bug in ADRIFT.
 
This is a serious bug. Thus we should make a bug-report.

You can probably make a workaround for this bug, by ensuring that the stop-task never runs before a start-task has run.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
Posts: 647
Joined: Mon Feb 22, 2016 6:21 pm
Points: 251
Location: Hjørring, Denmark

Re: [Serious Bug Found] Events can be started by the stop ta

Post by Denk »

A workaround has been found for this bug. Idea by DazaKiwi:

Make a system task run immediately as the game begins. This system task starts the event. The event then calls a stop task after zero turns, which stops the event. With this method the event has already run once and so the bug will not appear.

The method is implemented in this demo:
EventWorkaround.taf
(15.04 KiB) Downloaded 56 times
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
P/o Prune
Site Admin
Posts: 4706
Joined: Mon Jun 24, 2002 9:18 am
Points: 93
Location: Denmark

Re: [Serious Bug Found] Events can be started by the stop ta

Post by P/o Prune »

Please report this bug.
Although I have no idea when/if Campbell will ever return, it is still important that bugs are reported.... Miracels can happen you know. :angel:
D-Day in progress 86Kb (Slowly drifting)
October 31st: 42Kb (possible entry for IFComp 2021 :wink: )
rotter
Posts: 1432
Joined: Sat May 08, 2004 1:12 am
Points: 20
Location: UK
Contact:

Re: [Serious Bug Found] Events can be started by the stop ta

Post by rotter »

P/o Prune wrote:Please report this bug.
Although I have no idea when/if Campbell will ever return, it is still important that bugs are reported.... Miracles can happen you know. :angel:
Yes, report the bug. Doubt it will ever get fixed but we can live in hope.
Currently working on "The Blank Wall" in ADRIFT 5 and "Again and Again" in Inform 7.
Delron, the home of Otter Interactive Fiction.
User avatar
Denk
Posts: 647
Joined: Mon Feb 22, 2016 6:21 pm
Points: 251
Location: Hjørring, Denmark

Re: [Serious Bug Found] Events can be started by the stop ta

Post by Denk »

I have now reported the bug in the Bugs and Enhancement List: http://www.adrift.co/bug/19205
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Post Reply