Title Unreliable cmp_obstacle_state
Priority important Status open
Assigned To Keywords
Linked issues MO-HFGateAccessServer dialog won't proceed3 due to lua error
View: 824

Submitted on 2017-03-25 19h39 by jesusalva, last changed by jesusalva.

File name Uploaded Type Edit Remove
issue890.sav.gz jesusalva, 2017-03-26.15:58:19 application/gzip
issue890.shp jesusalva, 2017-03-26.15:59:29 application/x-qgis
issue890.thumbnail.png jesusalva, 2017-03-26.15:59:51 image/png
Author: jesusalva Date: 2017-03-25   19h39
events.dat is somewhat unreliable. As an example, it might be necessary severe
walks to and fro the map label on level 31 in order to close Open Sesame quest.
Author: fluzz Date: 2017-03-26   15h23
Please, send a savegame, with Tux near the map label, before to trigger it.
It will be easier to debug and fix.
Author: jesusalva Date: 2017-03-26   15h59
Attach a savegame. Do you need the backups too, from before crossing the gate? :>

Attached issue890.shp.
Author: fluzz Date: 2017-03-26   16h03
the backup, no, but I need the .sav.gz !
Author: fluzz Date: 2017-03-26   16h04
sorry, I did not see that you already attached it.
Author: jesusalva Date: 2017-12-22   12h01
I managed to find more or less the place of the bug.

I've changed the event code to:

	print(cmp_obstacle_state("HF-Gate-inner", "opened"))
	print(cmp_obstacle_state("HF-Gate-outer", "opened"))
	print(has_quest("Open Sesame"))
	print(done_quest("Open Sesame"))
	if ((cmp_obstacle_state("HF-Gate-inner", "opened")) and
		(cmp_obstacle_state("HF-Gate-outer", "opened")) and
		(has_quest("Open Sesame")) and
		(not done_quest("Open Sesame"))) then
			end_quest("Open Sesame", _"I found the gates. The firmware server should lay
beyond them.")

The values printed to terminal were:
-> false

Needless to say, using these savefiles (or not), both gates were open.
Lua syntax also seems to be correct, so the problem is not on events.dat, but at

Therefore, updating the title. (I've did a few debug printfs on the C part of
the code which handles positional events and none of them failed)
I've tested about Spencer's Death but found no bug there, Spencer death will
only trigger an event at Town but this is Game Design fault (that killing him at
level 59 does nothing)
Author: jesusalva Date: 2017-12-24   17h49
Linking possibly related issue 824.
While not directly connected, both are about identification problems at the same
place (except one ended with a crash, and another one ended with an event not

There is a possibility the bug is related to the obstacles itself and I'm not
looking at the right place (as in: cmp_obstacle_state may be innocent), so I'm
linking both issues for further analysis and study.
Date User Action Args
2017-12-24 17:49:53jesusalvasetmessages: + msg3525
linked: + MO-HFGateAccessServer dialog won't proceed3 due to lua error
2017-12-22 12:01:29jesusalvasetmessages: + msg3519
title: Unreliable events -> Unreliable cmp_obstacle_state
2017-03-26 16:04:39fluzzsetmessages: + msg3453
2017-03-26 16:03:59fluzzsetmessages: + msg3452
2017-03-26 15:59:51jesusalvasetfiles: + issue890.thumbnail.png
2017-03-26 15:59:29jesusalvasetfiles: + issue890.shp
messages: + msg3449
2017-03-26 15:58:19jesusalvasetfiles: + issue890.sav.gz
2017-03-26 15:23:32fluzzsetmessages: + msg3445
2017-03-25 19:39:36jesusalvacreate