Page 1 of 1

dsb_party_coords() and sys_enter_level()...?

Posted: Sat Sep 15, 2018 3:47 am
by Gambit37
This really simple function override does some very odd things:

Code: Select all

function sys_enter_level(level)
	local lev, px, py, pface = dsb_party_coords()
	dsb_write({222, 222, 222}, lev)
end
If I start on level 0, it writes 0.
When I go to level 1, it writes 0 again.
Returning to level 0, it writes 1.

I've tested this across multiple levels and it gets completely out of sync.

Why isn't dsb_party_coords() updating the current level correctly? Or am I doing something wrong?

(Also notice this when called in other functions, such as sys_game_load().)

Re: dsb_party_coords() and sys_enter_level()...?

Posted: Sat Sep 15, 2018 4:46 am
by Sophia
The value of lev returned by dsb_party_coords is correct for that instant but seems strange, because sys_enter_level is called just before the party is actually moved into the new level. For the most part this isn't an issue because it takes the new level as a parameter, so you know what level the party is actually (about to be) on.

Re: dsb_party_coords() and sys_enter_level()...?

Posted: Sat Sep 15, 2018 11:12 am
by Gambit37
Ok, i tested the parameter and that does seem more reliable, so I'll use that instead. 🙂