Not logged inOpenClonk Forum
Up Topic Development / Scenario & Object Development / Crash Landing: Weird hotfix
- - By Clonkonaut [de] Date 2016-12-28 14:34 Edited 2016-12-28 14:39
I just made a very weird hotfix to Crash Landing because currently it's unplayable. Because you don't get your clonk, it is stuck inside the pilot (Pyrit).

The hotfix is weird because of this:

When players are joined, the clonks are stuffed into the dialogue object:

see here
for(var index = 0; crew = GetCrew(plr, index); ++index)

So far, when the plane crashes and clonks are ejected, they were taken from said object:

see here (old version)
                 Intro_CreateBoompack(RandomX(x-5,x+5), RandomX(y-5,y+5), 160)->Launch(290 + Random(26), this.dialogue->Contents());

For some reason, this didn't work anymore, because the clonks suddenly were inside the pilot. My hotfix is as follows:

var clonk;
while(clonk = this.pilot->Contents())
  Intro_CreateBoompack(RandomX(x-5,x+5), RandomX(y-5,y+5), 160)->Launch(290 + Random(26), clonk);

It works but I don't get why. Maybe someone knows why because he changed something in the sequence object that causes this behaviour. Maybe it's a sympton for another bug.
Parent - - By Maikel Date 2016-12-28 17:57 Edited 2016-12-28 18:09
Cool bug!

The problem is likely here:

The dialogue objects moves its contents to the speaker of the dialogue, i.e. the pilot. This change looks like it has been done by Sven2 during editor works.

The proper fix would be to never move the clonks into any dialogue object and maybe add a warning if the dialogue object does collect something (or only collect in editor mode?).
Parent - - By Sven2 Date 2016-12-28 22:15
Yeah, good find. Having inventory that was supposed to go into clonks in the dialogue instead was very annoying; that's why I did the change. I didn't think about sequences using the dialogue object as a storage.

I could change the editor to use a special property to simply ignore certain objects as drop targets and remove that special case form the dialogue object. Of course then Clonkonaut's solution needs to be reverted.
Parent - By Maikel Date 2016-12-28 22:19
I would be happy with that change.
Parent - By Clonkonaut [de] Date 2016-12-29 02:51
Either way sounds ok. Using the pilot for storage or changing the dialogue object.
- By Clonkonaut [de] Date 2016-12-29 14:48
Dark Castle needs the same fix.
Up Topic Development / Scenario & Object Development / Crash Landing: Weird hotfix

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill