Page 1 of 1
Cannot set "MZLED" effect direction
Posted: Tue Mar 03, 2020 12:57 pm
by NearHuscarl
Right now the "MZLED" effect's position and angle is the same as IObject's position and angle. that IObject's UniqueID is arg[0]. Looking at the script in Operation Sunrise campaign, Chapter 'The Courtyard', it looks like the second argument position is the direction Vector of the effect which doesn't work at all.
Re: Cannot set "MZLED" effect direction
Posted: Tue Mar 03, 2020 5:53 pm
by Gurt
If you want to rotate this specific effect you need to create an invisible block or something that's at the position and rotation you want the effect to be at. This is how the MZLED effect is designed and why it's not in the EffectName/ScriptAPI in a public way as it's quirky to work with. You will have to work around it's limitations.
Re: Cannot set "MZLED" effect direction
Posted: Wed Mar 04, 2020 1:12 am
by NearHuscarl
I can do that using EdgeGrab or something. But it doesn't take direction into account. When I flip the object horizontally, I expect the MZLED effect to be flipped too. Can you please fix that?
Right
Left
FYI I cannot fix this by simply by rotating 180deg and flipping it vertically because I cannot flip vertically in script. See
this thread
Re: Cannot set "MZLED" effect direction
Posted: Fri Mar 06, 2020 12:20 am
by JakSparro98
vertical flip can be achieved even with only horizontal flip, you need to add 180 degrees after the flip and you will get the same result as flipping vertically.
Off Topic
flip suggestion was supposed be marked as implemented after all this time.
Re: Cannot set "MZLED" effect direction
Posted: Fri Mar 06, 2020 3:38 am
by NearHuscarl
I mentioned the flip because I think it's pretty easy to implement and maybe the devs kind of forgot about it.
Off Topic
Thank you. I already solved that using an easier way. Use a small object like LedgeGrab tile and set the position and angle. It will also be the position and angle of the muzzle effect itself.
Re: Cannot set "MZLED" effect direction
Posted: Fri Mar 06, 2020 10:42 pm
by JakSparro98
NearHuscarl wrote: ↑Fri Mar 06, 2020 3:38 am
I mentioned the flip because I think it's pretty easy to implement and maybe the devs kind of forgot about it.
[..]
The ability to flip a tile is ALREADY implemented (IObject class) but only horizontally.

It's unclear if you got the point, but for obtaining the same result of flipping vertically you simply have to add or subtract 180 degrees after the SetFaceDirection in order to emulate a flip from up or from bottom.
Re: Cannot set "MZLED" effect direction
Posted: Sat Mar 07, 2020 2:50 am
by NearHuscarl
I was unclear at the first time. That's why I also want a flip method helper to make it more accessible for other scripters who may confuse like me.
Re: Cannot set "MZLED" effect direction
Posted: Wed Mar 18, 2020 6:10 pm
by Gurt
JakSparro98 wrote: ↑Fri Mar 06, 2020 10:42 pm
NearHuscarl wrote: ↑Fri Mar 06, 2020 3:38 am
I mentioned the flip because I think it's pretty easy to implement and maybe the devs kind of forgot about it.
[..]
The ability to flip a tile is ALREADY implemented (IObject class) but only horizontally.

It's unclear if you got the point, but for obtaining the same result of flipping vertically you simply have to add or subtract 180 degrees after the SetFaceDirection in order to emulate a flip from up or from bottom.
This is the correct way of flipping vertically. That's exactly what the map editor does internally too. If we were to add a flip vertically we would just get bug reports that the angle changes and you can still achieve the vertical flip with a rotation+horizontal flip.