Jump to content
snakeplissken

BotAI only moves after I "Host PC" activate the trigger.

Recommended Posts

Hello, I'm having some problems that I do not know if it's Bug or something is missing.

1 - In the script spawn a helicopter for extraction, it happens that a helicopter appears for each player online (my PC of which also play with them), in that these vehicles appear in the same place causing an explosion by the collision of them in the same place of the spawn.

 

Trigger activated by the presence of the player on the spot

 

Trigger command within ON ACT

 

null = [this] execVM "ExtraPlay.sqf"

 

File ExtraPlay.sqf

_veh = createVehicle ["B_heli_Transport_01_camo_F",getMarkerPos "mhel",[], 0, "fly"];
_veh setVehicleVarName "heli2";
missionNamespace setVariable ["heli2", _veh, true];
createVehicleCrew heli2;
{_x  allowdamage false} forEach crew heli2;
heli2 setVehicleLock "UNLOCKED";
heli2 setBehaviour "CARALESS";
heli2 setCollisionLight true;
sleep 3;

heli2 sideChat "Aqui é a equipe de Extração! Pedimos para marca no mapa com um click do mouse o local para extrairmos vocês!";

MapClicked = false;
onMapSingleClick "clickPos = _pos; MapClicked = true; onMapSingleClick {};";
waitUntil {MapClicked};
player sideChat format["Marcando posição em %1", clickPos];

Mark2 = createMarker [" ", clickPos];
Mark2 setMarkerShape "ICON"; 
Mark2 setMarkerType "hd_pickup";
Mark2 setMarkerColor "ColorRed";
Mark2 setMarkerSize [1,1];

////////////////////////////////////////////////////////////////////////////////////////////////

player sideChat "LZ já marcado no mapa!";

sleep (4);
heli2 sideChat "Entendido!";

sleep (3);
heli2 sideChat "Equipe de extração se movendo para o local marcado";

///////////////////////////////////////////////////////////////////////////////////////////////

_heliH = "Land_HelipadEmpty_F" createVehicle clickPos;
heli2 domove getPos _heliH;
heli2 setspeedmode "NORMAL";
	
//////////////////////////////////////////////////////////////////////////////////////////////////

waitUntil {heli2 distance _heliH < 1000};

//////////////////////////////////////////////////////////////////////////////////////////////////
sleep (1);
heli2 sideChat "Equipe de extração próximo do local marcado.";
//////////////////////////////////////////////////////////////////////////////////////////////////

waitUntil {heli2 distance _heliH < 200};

//////////////////////////////////////////////////////////////////////////////////////////////////

heli2 flyinheight 25;
heli2 domove getPos _heliH;
heli2 land "heliH";
waitUntil {player distance heli2 < 10};
heli2 animateDoor ['Door_R', 1];
heli2 animateDoor ['Door_L', 1];
commandstop heli2;
//////////////////////////////////////////////////////////////////////////////////////////////////

waitUntil {player in heli2}; // Condição para levantar voo, que aqui é após todos os jogadores estiverem embarcado
heli2 sideChat "Subam rápido! Preparando para leantar voo em 20 segundos";
//////////////////////////////////////////////////////////////////////////////////////////////////
sleep (20);
heli2 sideChat "Equipe de Extração levando nossos soldados em segurança!";
deleteMarker Mark2;
sleep (5);
heli2 domove getpos QG;
heli2 flyinheight 25;
heli2 setspeedmode "Limited";
heli2 domove getpos QG;
waitUntil {heli2 distance QG < 200};
heli2 domove getPos QG;
heli2 land "QG";
commandstop heli2;

exit;

 

 

2- In a simple trigger where a vehicle placed in the editor, it only moves after I (host PC) enter the vehicle.

If another online player enters the vehicle he does not leave the place, but the trigger recognizes that the player activated because the message appears by the command "hint"

Trigger to command the pilot to move to the waypoint already set on the map.

 

COND
 Player in car (car is the name of the vehicle)

 

ON ACT

Hint "Recognized Trigger"


So colleagues have these two problems, if anyone can tell me where the error is, I thank you.

 

*In all cases above, the Bot only obeys the trigger when I the host of the mission activates the trigger, any other player online the Bot does not obey, but the trigger recognizes the other player so much that the "tip" message appears, even the "hint" it has inside the SQF script lines work, but the BOT move does not work.

 

link mission in editor > https://1drv.ms/u/s!AvZrCEHeJxl_kc0k5BQvsKCV1ubSYA

 

English by Google tradutor

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×