drawicon3d will NOT flicker if it is just inside the foreach loop inside the spawn code scoop.
drawicon3d will NOT flicker if it is just inside the foreach loop.
drawicon3d will NOT flicker if it is just inside the spawn and used sleep command together.
try adding 1 sleep command inside the foreach loop inside the spawn code scoop will NOT cause strange flickering on icon3d.
{F24270}
Description
Details
- Legacy ID
- 2848862631
- Severity
- None
- Resolution
- No Bug
- Reproducibility
- Always
- Category
- Scripting
create a mission on any map
in editor, add a player unit. and then add 2 more units and give them names. Place those 2 units closely together
please place the uploaded sqf into the mission folder
in the init.sqf, add this line:
call compile preprocessFile "Mission_Giver.sqf";
// After that, in the sqf file, please find line 3, and add the name to the array
Mission_Givers=[yourUnitName];
Strange flickering on icon3d IS ONLY caused by trying to draw multiple icon3ds with the drawicon3d+sleep+foreach commands used altogether.
If drawing multiple icon3ds without sleep command, there will be NO flickering
Event Timeline
I'm pretty sure drawIcon3D is designed to be used onEachFrame, not in a For loop (especially with a sleep). The loop isn't necessarily going to run every frame. The flickering would differ with different frame rates.
Edit: Sorry, just looked at your code. You can have a for loop to draw multiple icons, but you shouldn't have any sleep in there. If it did work as you appear to expect, the game would freeze while waiting for your sleeps to finish.
As Lecks said, "drawIcon3d" has to be run onEachFrame to avoid flickering, that kinda makes the ticked invalid.
Check out the alternative solution of putting drawIcon3d inside a "addAction" condition. (those are also checked on every frame but only when you look towards them which makes it ideal for this sort of thing)
Like others have said, you should use OnEachFrame (https://community.bistudio.com/wiki/onEachFrame) or Draw3D (https://community.bistudio.com/wiki/addMissionEventHandler), because the drawing of the the icons/lines needs to be done every frame.
Mass closing tickets marked as resolved more than 1 month ago.
If the issue is in fact not resolved, please create a new ticket referencing this one and ask for it to be re-opened.