Page 1 of 1

setWidth & setHeight bugs (might want to look at this MD!)

Posted: Fri Jan 04, 2019 12:48 am
by KittyBeast
Explanation and causes (with examples):

I've known this bug for a long time but it doesn't seem like many other do. I thought I would bring it up, just in case anyone else has experienced this without knowing what causes it.

There's a bug with the setWidth and setHeight commands in the AI panel within the editor where: if you rotate a part to any angle, other than 0 and 180 degrees, and set a it's width and height to 0 (which should make the part completely invisible) it turns into a line, rather than "nothing".

Another odd behaviour is that if you continuously rotate a part and change its height and width from 0 to 100 it will change shape and size constantly.

I've seen MD's (the developer of Zetaflow) level have this issue where some of his presumably rotated guns which are supposed to be invisible, are still visible as tiny specks in his level Hammerhead Harrier due to this bug. Referenced level here: http://zetaflow.skylogic.ca/game/profile/13335

I've recreated the effect with a gif:
https://i.gyazo.com/920416e0500b5543164 ... de7474.gif

The AI used in this level is:

rotatePart,0,1
-
makeTrigger,timeRepeat,0,30,setWidth,87
makeTrigger,timeRepeat,0,30,setHeight,115
-
makeTrigger,timeRepeat,15,30,setWidth,0
makeTrigger,timeRepeat,15,30,setHeight,0


The same bug happens if the child part of a parent part which has rotated, changes it's height and width. This becomes especially annoying if you're working with a core which uses randomrotation, in which case this bug will always take effect.


Ways to avoid this bug:

One solution to this (and possibly the only one) is to make sure the parts that you want to make invisible via setting it's height and width to 0 are rotated 0 or 180 degrees. After that, you're free to rotate it. When reverting back to its original shape you need to rotate it back to either 0 or 180 degrees and then change it's width and height to whatever you want.

While this works fine as long as the part is able to go back to 0 or 180, it becomes impossible (to my knowledge) when the core is using randomrotation.

Re: setWidth & setHeight bugs (might want to look at this MD!)

Posted: Tue Jan 08, 2019 12:36 pm
by MD
Thanks for reporting this! I'll try to look into it sometime.

Re: setWidth & setHeight bugs (might want to look at this MD!)

Posted: Tue Jan 08, 2019 11:12 pm
by KittyBeast
Thanks! Would love to see a fix to this, that would allow for some really unique ideas :) Good luck!