Spriterfight
Member-
Content Count
171 -
Joined
-
Last visited
-
Medals
Everything posted by Spriterfight
-
Check contonously nearest locations around player thenput them in an array
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have a question can i use foreach in a if statement or i have to use count? -
Trying make custom point& store system...
Spriterfight replied to bong oh's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yeah its easier but why dont you try something like a money system and you will gain money from kills and stuff -
Check contonously nearest locations around player thenput them in an array
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I will try it and give you a feedback. -
Check contonously nearest locations around player thenput them in an array
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Wow.Thank you! -
Trying make custom point& store system...
Spriterfight replied to bong oh's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I would advice a database like -
Trying make custom point& store system...
Spriterfight replied to bong oh's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You will need profilenamespace to store information -
HELP ammo with forEach returns nothing
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Meanwhile i realised the rifle was not 1715_Seapat so i renamed it and now works.Thank you -
HELP ammo with forEach returns nothing
Spriterfight posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
_all = {_x ammo "1715_Seapat"} forEach _musketers; hint format["%1", _all]; so i want the loaded ammo count for each unit from a gorup.If i loop throug them the script returns nothing but if i run the ammo code individually like this _ammocount = _musketer ammo "1715_Seapat"; it returns the loaded ammo.How can i return all the loaded ammo from a group? -
HELP ammo with forEach returns nothing
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
my squad conatins two unit the player and the teammate.If i fire it retruns 0 but it sohuld return 1 because my teammate hasn't shot yet.The 1715_Seapat has only 1 round in the magazine. -
Check contonously nearest locations around player thenput them in an array
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It is basically a custom spawn ai script that spawns ai on the nearest locations from the player,It is very custom and mission specific.But if i use this _locations = nearestLocations [ position player, ["Airport", "NameLocal", "NameVillage", "NameCity", "NameCityCapital","NameMarine"],worldsize*10]; _markerdist = 350; _locaiton = _locations select 0; while {true} do { { if (player distance getPos _x < player distance getPos _locaiton) then { _locaiton = _x; }; sleep 0.01; }foreach _locaitons; if (player distance getPos _locaiton < _markerdist) then { _locaiton call fnc_spawnai; } else {sleep 5;}; }; this script uses the first nearest location to player and spawns only one group of enemy unit.What i want is that if the player is close to several towns then in each settlement spawn an ai group. But to achieve this i need a change in the script to store the nearest locations from the player then call the spawn funciton on it. -
AI Following Player in Safe
Spriterfight replied to JoseRodriguez's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Please describe the problem detailed -
AI Following Player in Safe
Spriterfight replied to JoseRodriguez's topic in ARMA 3 - MISSION EDITING & SCRIPTING
if it is the player s group _group = group player; _pos1 = getMarkerPos "yourvillagemarker"; _wp = _group addWaypoint [_pos1,0]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "Full"; _wp setWaypointBehaviour "SAFE"; _leader = leader _group; units _group doFollow leader _group; this in the init.sqf of the mission -
AI Following Player in Safe
Spriterfight replied to JoseRodriguez's topic in ARMA 3 - MISSION EDITING & SCRIPTING
is the player in the same squad or separate? -
_locations = nearestLocations [ position player, ["Airport", "NameLocal", "NameVillage", "NameCity", "NameCityCapital","NameMarine"],600]; _markers = _locations; _markerdist = 500; while {true} do { { if ({player distance getPos _x < _markerdist} forEach _markers) then { hint "work"; { [_x] call fnc_detectai; } forEach _markers; } else {sleep 5;}; }; I have a problem.So i want that if the player is near multiple locations then the function will be activated.But when i go near a town it wont actiave the function.What is the problem?So i want that the funcion to be activated with each location where the player is close. For example my player is close to 2 location then the function have to be activated on each.
-
HELP With ai detecting script
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you.Just testing things around and i forget to change the names of the variables.If i use _loc = _locations apply {getpos _x}; it works -
HELP How to slelect random elements from an array with a specific number
Spriterfight posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
So i have an array _array = ["myArray", "myArray1", "myArray2", "myArray3", "myArray4", "myArray5","myArray6", "myArray7", "myArray8"]; how can i select ex 4 random elements and loop through it because i dont want to loop thorug every element -
HELP How to slelect random elements from an array with a specific number
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
it seems to be working.Thank you! -
HELP How to slelect random elements from an array with a specific number
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
No because those elements are locations and i dont want the units to spawn every nearest location from the player so i want to select random locarions from this array with a limited number,If its duplicated then a group will be spawned twice at the same location -
Here is my code fnc_spawn = { _selectableunits = ["CUP_B_HIL_GL", "CUP_B_HIL_MMG", "rhsgref_hidf_marksman", "rhsgref_hidf_sniper", "rhsgref_hidf_teamleader", "rhsgref_ins_g_machinegunner", "rhsgref_ins_g_medic", "rhsgref_ins_g_rifleman_akm", "rhsgref_ins_g_rifleman", "rhsgref_ins_g_grenadier", "rhsgref_ins_g_rifleman_RPG26", "rhsgref_ins_g_rifleman", "I_L_Hunter_F", "I_L_Looter_SG_F", "I_L_Hunter_F", "CUP_I_PMC_Sniper", "CUP_I_PMC_Soldier_MG_PKM", "CUP_I_PMC_Soldier_GL_M16A2", "CUP_I_PMC_Pilot", "CUP_I_PMC_Sniper_KSVK", "CUP_I_PMC_Sniper", "CUP_I_PMC_Soldier_AT"]; _c = 5; _group = creategroup east; _pos = (trg1 getRelPos [(random ((triggerArea trg1) select 0)), random(360)]); for "_i" from 1 to _c do { _unit1 = _selectableunits call BIS_fnc_selectRandom; _unit = _unit1 createUnit [_pos, _group]; sleep 1; // it gives me generic erro in expression _unit addEventHandler ["Killed", { _corpse = _unit; _corpse spawn BIS_fnc_DeleteCorpseofSoldier; }]; }; }; Sleep command gives me generic error in expresion.If i remove it it dosent give me error.
-
HELP With sleep inside function
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
i made another script so it works but yours gives me error in line 36 between the function and the arrays -
HELP With sleep inside function
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
invaild number in expression -
HELP With sleep inside function
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you! -
HELP With sleep inside function
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Now it says undefined variable in _unit also i dont use spawn because it messes with my character, it teleports somwhere on the edge of the map -
So i have a mp map where the ai respawns and have to move on a specified location. I want that if the ai respawns check if the waypoint is completed.If it is completed then copy the previous waypoints when they respawn. The problem was that if their waypoint is completed after respawn they dont have waypoint, Thew group's name is group1 and i tried copywaypoint but i cant do group1 cpyWaypoint group1;
-
HELP With respawn waypoint
Spriterfight replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanx, i think i will figure it out by myself