snkman 351 Posted October 20, 2008 Hey guy's, well just made some test's with the command countFriendly, and it seems that the command has a bug.... Player side = West Enemy side = East Seems to work with enemy Infanterie only, enemy Tanks or Aircraft will be detected as Friendly??? if i use: Place a soldier ( side West ) on the map ( Player ) Place a T72 on the map, called T72 ( This is side East ) Now the T72 should not be counted as Friendly to the player, becouse the T72 is East and the player is West! <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> if (player countFriendly [T72] > 0) then { hint "Bug!"; }; Someone can confirm this bug?? Share this post Link to post Share on other sites
t_d 47 Posted October 20, 2008 Maybe you need to recognize the tank as enemy before, otherwise it is probably still assumed to be friendly. Share this post Link to post Share on other sites
Namikaze 0 Posted October 20, 2008 To do what T_D is suggesting, you could try placing an enemy infantry unit somewhere on the map where he won't interfere, or you can use setFriend to do it through a script. Share this post Link to post Share on other sites
snkman 351 Posted October 20, 2008 Maybe you need to recognize the tank as enemy before, otherwise it is probably still assumed to be friendly. Thank's for the replays. Well but that's not logical... East is Enemy to West ( By Default ) so why telling a East Tank to have a West unit as enemy... Share this post Link to post Share on other sites
poweruser 10 Posted October 21, 2008 I can only confirm this for the time period during the mission initialisation. After that (a few seconds after mission start) everything works as expected, even if (in this example) the player doesnt know anything about the T72. Share this post Link to post Share on other sites
fasad 1 Posted October 21, 2008 I can only confirm this for the time period during the mission initialisation. After that (a few seconds after mission start) everything works as expected, even if (in this example) the player doesnt know anything about the T72. I get the same, for both empty vehicles and those occupied by enemy. Share this post Link to post Share on other sites
Lester 0 Posted October 21, 2008 I think you have to check the crew and not the vehicle ! A vehicle should be allways neutral, the side=? in the vehicle config is only used for bind crewed vehicles to a specific side. That's imo very logical  Share this post Link to post Share on other sites
snkman 351 Posted October 21, 2008 Hmm... yes sounds logical Lester but bevore i check with "countFriendly" i do GL3_Init.sqf <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _unit = _this select 0; if !(_unit isKindOf "Man") then {{[_x] call compile preprocessFile (GL3_Path+"GL3_Init.sqf")}} forEach (crew _unit); [_unit] execVM (GL3_Path+"GL3_Core.sqf"); So the Crew is already checked. Like dengibtsschon already said a few secounds after the mission is initialized the countFriendly command works like it should... So it's not working for me, becouse i do initialize all units and vehicles via a Init Event Handler, which is triggered way bevore the mission get's started. Share this post Link to post Share on other sites
VictorFarbau 0 Posted October 23, 2008 SNKMAN, if I remember correctly it always (even in OFP) took up to 30 seconds before a unit and its properties was really known by the game engine. You can still observe this behaviour if you spawn an empty vehicle right in front of you. It takes anything from 1 to 30 seconds before you can enter it. It could be that your script falls victim to this. To work around this I'd do this. If your script knows who's friend and foe (if west then east, if east then everybody ) you could use the "countside" command instead. Does your script know at runtime? Cheers, VictorFarbau Share this post Link to post Share on other sites
.kju 3245 Posted October 23, 2008 maybe reveal helps Share this post Link to post Share on other sites