I have been informed by a forum member (AL-97), that the newest version of Gzdoom breaks some of the scripts in Ashes: 2063. Specifically, the script where the player is transformed into a motorcycle (don't worry. all will be explained) and then back into a regular player. A summary of how this script works is detailed below:
Spoiler:
A switchable item, the motorcycle pickup, activates a script on use and then pickup, that morphs the player into a new playerclass; motorcycle player. This is to allow the giving of new player animations as well as restrict movement and weapon selection until the motorcycle is "dismounted" (the player switches back to regular playerclass). This process is controlled by the use function as well as two triggered scripts.
The problem is, is that the player, after returning to normal, is left unable to switch weapons, and their inventory, including cash, is reduced to zero. Is this a problem within my scripts? Is this something I can fix myself? This is irritating but would not be a problem otherwise.
My greater concern is that this will break other morph actor playerclasses in other games, such as heretic and hexen, or mods that use this function. Hence why I am bringing this up as a bug until I can further investigate this problem.
Have any changes been made to the morph actor function? Any help in this matter would be greatly appreciated.
I have tested it in hexen and heretic, and it doesn't seem to be a problem. It seems to be a problem exclusive to Ashes, or at least custom morph actors. I will write up a small test map and see if I can replicate it. I will post it if necessary here, but it sounds like this is my problem.
@Vostyok, there's a forum post on the Brutal Doom Moddb page (in the thread for BD v21 RC5 testing) that details a very similar issue, too, where after the demon rune ends and the player returns to normal that their inventory is reset, including removing any keys that they were holding.
If it worked differently before in a previous, official version, and now it doesn't work the same anymore, it's definitely an engine bug and will/should be fixed, provided you prepare a runnable example file that the devs can conveniently load up for testing
I am posting a small, cut-down version of the original beta file. It doesn't require any other files apart from Gzdoom to run.
Simply get on the bike behind you with "use", and get off again with "jump". You'll notice that you are now unable to switch weapons. The example cash items are also removed from your inventory, although you'd need a custom hud to see this change, this is definately the case.
The uncompiled scripts that run the motorcycle are included in the wad, under the 'scripts" file, for reference. I hope this helps.
Vostyok wrote:The example cash items are also removed from your inventory, although you'd need a custom hud to see this change, this is definately the case.
I just tried that test wad with gzdoom-x64-g3.8pre-62 and used the give all command before getting on the bike so that all keys, weapons and ammo were given to the player as these do show up on the classic Doom statusbar. When getting off the bike all of these are removed from the player leaving just the pistol and a small amount of pistol ammo, just as if it had reset to the pistol start.
I'd guess its something with the GC's read barriers again. Unmorphing is a horrible mess because it happens in the completely wrong place and may just result in something getting nulled that is still needed.
It accessed the address of the owner's first inventory pointer. I hate this linked list crap, especially if written like here. In my experience, linked lists just do not work in any conceivable situation and I would have redone the inventory storage as an array if it hadn't been exposed to ZScript already.
Couldn't agree more. I could see inventory being much easier to maintain inside of a dynamic array, simply because one can delete nulls from the inventory and move on until it hits the size. Huh. Guess I might look into that for my own mods.