Devastator_cm 434 Posted May 3, 2017 Does anybody sets unit insignias via script? BIS_fnc_setUnitInsignia is not working globally although funtion description states it so. Each player can only see his own insignia. There was a comment in BI page which states[[ player, "111thID"], "BIS_fnc_setUnitInsignia", nil, true, true] call BIS_fnc_MP; can be used but even with this one I am getting same result :( Anybody has a solution? Share this post Link to post Share on other sites
killzone_kid 1330 Posted May 3, 2017 1 hour ago, Devastator_cm said: [[ player, "111thID"], "BIS_fnc_setUnitInsignia", nil, true, true] call BIS_fnc_MP; Could you justify the use of nil for target with BIS_fnc_MP??? Share this post Link to post Share on other sites
Belbo 462 Posted May 3, 2017 Use [player,"111thID"] remoteExecCall ["BIS_fnc_setUnitInsignia",0,true]; instead. Share this post Link to post Share on other sites
killzone_kid 1330 Posted May 3, 2017 17 minutes ago, belbo said: Use [player,"111thID"] remoteExecCall ["BIS_fnc_setUnitInsignia",0,true]; instead. This will not work, because player is taken from PC you execute your code on, when in fact it should be taken from each PC it is remote execute on. {[player,"111thID"] call BIS_fnc_setUnitInsignia} remoteExec ["call",0,true]; This works, but I still want to know why OP is using nil? I find this very strange one wants to force undefined value to use fallback of the function when one can define exactly the target. This seems mighty silly. Share this post Link to post Share on other sites
Belbo 462 Posted May 3, 2017 12 minutes ago, killzone_kid said: This will not work, because player is taken from PC you execute your code on, when in fact it should be taken from each PC it is remote execute on. That's weird, as it does work for me like intended. I execute it locally on the client of the player who's supposed to wear the insignium. Maybe that's why. Btw.: nil is exactly what's put in there in a comment in the biki: https://community.bistudio.com/wiki/BIS_fnc_setUnitInsignia Share this post Link to post Share on other sites
killzone_kid 1330 Posted May 3, 2017 Just now, belbo said: That's weird, as it does work for me like intended. I execute it locally on the client of the player who's supposed to wear the insignium. Maybe that's why. Of course it works locally. Log with 2 players and see how your method doesn't work for all players. Share this post Link to post Share on other sites
Belbo 462 Posted May 3, 2017 1 minute ago, killzone_kid said: Of course it works locally. Log with 2 players and see how your method doesn't work for all players. No, that's what I meant... It works on a dedicated server with quite a lot of players. #edit: I think, I see the problem. With your code it'll apply the same insignium on each and every player, whereas mine will apply the insignium to one player and pass that along in the network. Share this post Link to post Share on other sites
killzone_kid 1330 Posted May 3, 2017 1 minute ago, belbo said: No, that's what I meant... It works on a dedicated server with quite a lot of players. It doesn't as it cannot. I will not repeat myself why. And thanks for the link, I have got answer to my question. Note removed. Share this post Link to post Share on other sites
Midnighters 152 Posted May 4, 2017 Why do people still use the mp function? It's definitely going to slow down your mission especially if you're running more scripts on top of that. Share this post Link to post Share on other sites
killzone_kid 1330 Posted May 4, 2017 1 hour ago, Midnighters said: Why do people still use the mp function? It's definitely going to slow down your mission especially if you're running more scripts on top of that. It was that stupid example in comment on BIKI, was old and broken 1 Share this post Link to post Share on other sites
Devastator_cm 434 Posted May 4, 2017 Here is the story behindhttps://community.bistudio.com/wiki/BIS_fnc_setUnitInsignia states argument and effect are global. So I tried simply [ object , className ] call BIS_fnc_setUnitInsignia; inside initPlayerLocal.sqf but didn't work out. Then I looked again to wiki page and saw a comment from someone who states there is a locality issue with this command in dedicated and instead of calling the function as above it should be used [[ player, "111thID"], "BIS_fnc_setUnitInsignia", nil, true, true] call BIS_fnc_MP; so I did and again no result. The comment from that user is deleted ( KK did). Question is now, is this command not global argument and global effect? If not, then wiki is still showing wrong. I will try tonight the remoteexec version and report bacl. I suppose it will work as it looks like effect is actually local and not global like stated in wiki... 1 Share this post Link to post Share on other sites
killzone_kid 1330 Posted May 4, 2017 2 minutes ago, Devastator_cm said: Question is now, is this command not global argument and global effect? I will come back to you on this Share this post Link to post Share on other sites
Midnighters 152 Posted May 4, 2017 1 minute ago, Devastator_cm said: Here is the story behindhttps://community.bistudio.com/wiki/BIS_fnc_setUnitInsignia states argument and effect are global. So I tried simply [ object , className ] call BIS_fnc_setUnitInsignia; inside initPlayerLocal.sqf but didn't work out. Then I looked again to wiki page and saw a comment from someone who states there is a locality issue with this command in dedicated and instead of calling the function as above it should be used [[ player, "111thID"], "BIS_fnc_setUnitInsignia", nil, true, true] call BIS_fnc_MP; so I did and again no reason. The comment from that user is deleted ( I guess deleted after I opened the thread here). Question is now, is this command not global argument and global effect? If not, then wiki is still showing wrong. I will try tonight the remoteexec version and report bacl. I suppose it will work as it looks like effect is actually local and not global like stated in wiki... Is this for each player? Because if so, just throw that shit on server execution and have remoteExec do it for each player instead of each player individually, not sure if the insignia resets after respawn or not. Nor do i know if that is going to cause Jip isssues. Thoughts KK? Share this post Link to post Share on other sites
pierremgi 4871 Posted May 4, 2017 BIS_fnc_setUnitInsignia uses setObjectTextureGlobal command which was broken. I don't know if it's still the case. I'm quite sure it was fixed. On the other hand, I agree this function should be global without remoteExec it. One more thing, for thus reading here and who would like to display their own insignia in MP server: you must create your CfgUnitInsignia class in a config.cpp, i.e. an addon. That can't work in description.ext of a MP mission. In this case, that works only in SP. Share this post Link to post Share on other sites
Devastator_cm 434 Posted May 4, 2017 I already have the insignias inside MODs. So that is not the issue here Are you sure setObjectTextureGlobal is fixed? I am still using the setObjectTexture with remoteexec as workaround of that old issue :) I will check that one as well then Share this post Link to post Share on other sites
killzone_kid 1330 Posted May 4, 2017 2 hours ago, Devastator_cm said: Question is now, is this command not global argument and global effect? Well, function is broken. I fixed it internally, but there is datalock so will be committed after Jets and 1.70 3 Share this post Link to post Share on other sites
Midnighters 152 Posted May 4, 2017 1 minute ago, killzone_kid said: Well, function is broken. I fixed it internally, but there is datalock so will be commited after Jets and 1.70 sweet Share this post Link to post Share on other sites
Guest Posted May 17, 2017 Any update to this? I would very much like to add a unique callsign patch to each of my playable units. Share this post Link to post Share on other sites