Asenna Steam
kirjaudu sisään
|
kieli
简体中文 (yksinkertaistettu kiina)
繁體中文 (perinteinen kiina)
日本語 (japani)
한국어 (korea)
ไทย (thai)
български (bulgaria)
Čeština (tšekki)
Dansk (tanska)
Deutsch (saksa)
English (englanti)
Español – España (espanja – Espanja)
Español – Latinoamérica (espanja – Lat. Am.)
Ελληνικά (kreikka)
Français (ranska)
Italiano (italia)
Bahasa Indonesia (indonesia)
Magyar (unkari)
Nederlands (hollanti)
Norsk (norja)
Polski (puola)
Português (portugali – Portugali)
Português – Brasil (portugali – Brasilia)
Română (romania)
Русский (venäjä)
Svenska (ruotsi)
Türkçe (turkki)
Tiếng Việt (vietnam)
Українська (ukraina)
Ilmoita käännösongelmasta
This is my old function to assist gunner take machine gun when gunner is dead.
Via some effort you can make FSM or something of your choice to suit your needs.
fnc_Replace_MG =
{
/*
needs to be spawned becaous use of while and sleep (scheluded environment)
waitUntil {!alive Machinegunner};
if !(alive MachinegunnerAssistant) exitWith {};
nul = [Machinegunner, MachinegunnerAssistant] spawn fnc_Replace_MG;
*/
private ["_oldGunner", "_newGunner", "_weaponHolders", "_WeaponHolder", "_weapons", "_magazines"];
_oldGunner = _This select 0;
_newGunner = _This select 1;
_weaponHolders = nearestObjects [_oldGunner,["WeaponHolderSimulated"],5];
_WeaponHolder = _weaponHolders select 0;
_weapons = weaponCargo _WeaponHolder;
_magazines = Magazines _oldGunner;
//hint format ["Fallen gunner: %1\nNew Gunner: %2\nWeapon: %3\nMagazines: %4", _oldGunner, _newGunner, _weapons, _magazines];
while {_newGunner distance _oldGunner > 3} do
{
_newGunner doMove getPos _oldGunner;
sleep 10;
};
//I dont remember which one works best
_newGunner action ["TakeWeapon", _WeaponHolder, (_weapons select 0)];
{_newGunner action ["TakeWeapon", _oldGunner, _x];} forEach weapons _oldGunner;
{_newGunner action ["TakeMagazine", __oldGunner, _x];} forEach magazines _oldGunner;
//may need some editing but you probly know the rest
};
:)
As for AI to decide ideas
Why?
A) AI has now weapon -> go for function to search any weapon.
B) Squad has no spesific weapon [ units _Group findIf {(weapon _x) isEqualTo 'WantedWeapon'} == -1); ] -> go for function to search spesific weapon in range,
When?
A) no combat and choises around
B) Urgent need (No AT and engaging tanks
Who command the AI?
Squad leader virtualy via scripts and if player is squad leader maybe use limited functions.
Go/No Go.
Measure distances, think current loadout. Does unit have enough full magazines (or simplifiied just could count AI magazines)