

peacefull Nation
Member-
Content Count
54 -
Joined
-
Last visited
-
Medals
Everything posted by peacefull Nation
-
execute code globally
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
tested like this nothing happens sir. _allAI = allUnits - allPlayers; _enemyAI = _allAI select { [side player, side _x] call BIS_fnc_sideIsEnemy }; _cnt = count _enemyAI; { [_x,{ _this disableAI "PATH"; removeAllWeapons _this; while { alive _this } do { sleep 5; // ideally change this sleep to be just as long as the animation _this playMove "AmovPercMstpSnonWnonDnon_exerciseKata"; }; }] remoteExec ["spawn",_x]; } count ((allUnits - allPlayers) select { [side player, side _x] call BIS_fnc_sideIsEnemy }); also just like you typed tested this nothing happening to ai. i tried like this nothing happens to ai. your very first code worked that teleported all ai to me then they all did karated , i added your new code and tested it , nothing is happening am not sure why , like i tested your first code it worked with no problems. -
execute code globally
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
very nice , small issue with it boss , this is what it does. 1: when i click it , it teleports all enemy ai to me and puts all ai around me they all form a circle with me in the middle and they all do karate without the loop but yes karate works on all ai. 2: second issue is my player gets little frozen so i am unable to run or walk as normal it makes it like slow mothing for my player only. 3: will be ok to have animation loop so it goes on forever apart from that everything is ok other human players are not affected and that is good. if you can or if possible can we affect all ai without teleporting them to me ? cheers and off course without freezing my playing . i really dont know how to thank you but thank you so much , your code is master piece. , in years to come i hope i can learn the way you code , all it is the coding and strutcure of the game algo i need to get use to , will take little time but am trying , thank u so much and hope u can help me with an update fix for this boss. -
execute code globally
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
thanks for the reply sir. just to let you know i tested only this { removeAllWeapons _x; _x playMove "AmovPercMstpSnonWnonDnon_exerciseKata"; } forEach allUnits; and this worked but only my solder was affected by it and not enemy ai so this tells me the code execution does work on friends host , how ever i need to tweak this so that all enemy ai is affected by it and not my solder or my team. maybe i should add some if statement to this but not sure how to add it kindly if u can assist me on this will appreciate it alot sir. i will test your code out now thanks alot boss. -
execute code globally
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
pierremgi thanks alot for the kind reply really appreciate the effort you put in to make me understand. i am looking to use the code on mp game only and not sp , so am want an if statement to check IF AI THEN execute the code to affect all ai players and civilians , ignoring human players this is my goal. -
execute code globally
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
? what is this ? this is not post by me -
execute code globally
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
pierremgi thanks for your reply. the host allows any mods ,scripts to be run and also battle-eye is disabled on all host. back to the code so this code if(!isPlayer _x && side _x != playerSide) is thier anything i can do to tweak it so , it should be something like , if enemy ai thn execute the code ignoring human players. so in arma3 wiki it says player side = Returns the player's side isplayer = Checks if given person is player. Returns true for headless clients as well. will anything like this work if (side player == sideEnemy) then { my code here hint "We've got a renegade!"; }; or maybe if(!isPlayer _x && side _x != side player) then { } else { my enemy ai code here }; i am sorry for making them threads and i do apologise sincerly. -
execute code globally
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
in multiplayer i added { { if(!isPlayer _x && side _x != playerSide) then { _x setCaptive true; removeAllWeapons _x; doStop _x; } }forEach allUnits; } remoteExec ["spawn", 0, false]; its not doing it please help -
so i create a folder in game directory called scripts arma3/scripts inside the script i will put test.sqf. how how do i execute that file using execvm. _handle = execVM "C:\Gamess\Arma 3 Laws of War\test.sqf"; wil it work like that
-
make all ai do karate code help
peacefull Nation posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
currently this code makes my solder do karate. player playMove "AmovPercMstpSnonWnonDnon_exerciseKata"; if(!isPlayer _x && side _x != playerSide) then { allUnits playMove "AmovPercMstpSnonWnonDnon_exerciseKata"; } }forEach allUnits; this is not making ai do karate please help -
make all ai do karate code help
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
please bare in mind am trying to use this on friends host , u can use it on any of your friends host to se if it works . ok update this is wiered please help. this code here { if(!isPlayer _x && side _x != playerSide) then { _x switchMove "AmovPercMstpSnonWnonDnon_exerciseKata"; sleep 30; } }forEach allUnits; this code above has affect to all soldiers for 2 seconds then they go back to normal. why is is enemy stops animation after few seconds ? update on above code. ai in cars end up doing full karate while viehcle is moving. but ai that are on foot dont do it , when i click the button it makes them all stand strait for a second then they go back to normal state { if(!isPlayer _x && side _x != playerSide) then { _x playMove "AmovPercMstpSnonWnonDnon_exerciseKata"; } }forEach allUnits; this code has no affect on enemy ai at all. -
execute code server side
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
this is what i have ["fn_aikarate.sqf","BIS_fnc_execVM",true,false] spawn BIS_fnc_MP; and i have fn_aikarate.sqf in root of the game directory. when i click on the option all enemy karate it only effects enemies that are near me and not globally ? so if enemey ai is close to me then it works , normally it should affect all enemy ai in map. also when i click the button it says fn_aikarate.sqf not found but the code below works cause i se enemy ai do karate but not globally , when i say globally i mean all the enemy in map dont get affected only the ones that are near me inside fn_aikarate.sqf { if(!isPlayer _x && side _x != playerSide) then { _x playMove "AmovPercMstpSnonWnonDnon_exerciseKata"; } }forEach allUnits; ["root"] spawn BIS_fnc_guiMessage; this is the code that gets executed how ever the message root does not get triggered so maybe something is going wrong here. all these only works on my own dedicated arma3server.exe how come when i join my friends host it dont work -
make all ai do karate code help
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
how come if i add this line player playMoveNow "AmovPercMstpSnonWnonDnon_exerciseKata"; it works ? so here is the full code Karate_loop = {{if(!isPlayer _x && side _x != playerSide) then { player playMoveNow "AmovPercMstpSnonWnonDnon_exerciseKata"; }}forEach allUnits;}; {_x call Karate_loop} foreach allUnits this code works but it makes my player do karate , instead i want all ai to do karate , i understand that we add _x instead of player but its not working when i add _x normally we replace the string ( player ) with ( _x ) but i am not understanding what is going on please help -
make all ai do karate code help
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
i added another option to my menu http://www.armaholic.com/forums.php?m=posts&q=31212 second post and that is working. am not sure why the ai karate code is not working , am gona try and make another ai karate code with different name and no space in characters. -
make all ai do karate code help
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
your code works if i copy and paste it in that ncc command and click server exec it works nice. how ever in my own mod menu it dont work. i am able to use other codes i added my server such as teleport all ai to me. fn_getallenemy.sqf { if(!isPlayer _x && side _x != playerSide) then { _x setPos screenToWorld[.5,.5]; } }forEach allUnits; this code you use se teleports all ai to me works nice. i am using Tonis_Admin_Menu_Main.pbo and modified and added my own code next to other codes that are already their. and now i created a new menu with the file name fn_aikarate.sqf and copied and pasted all your code in their , when i join dedicated server and open the toni's menu and press button nothing happens. i am certainly sure that this fn_aikarate.sqf is being called , as i have added a simple messagebox just to se if it opens when i click the button and it does. how ever the code is not taking any effect on the ai at all. -
make all ai do karate code help
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
trying it now lets se. using it on dedicated server on pc ,using arma3server.exe -
make all ai do karate code help
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
ok update here is a code witch i am able to use when button is clicked , it brings all enemies to my location. fn_getallenemy.sqf { if(!isPlayer _x && side _x != playerSide) then { _x setPos screenToWorld[.5,.5]; } }forEach allUnits; and now here is the karate code again witch i am currently using but not working. fn_aikarate.sqf {if(!isPlayer _x && side _x != playerSide) then { _x playMove "AmovPercMstpSnonWnonDnon_exerciseKata" } }forEach allUnits; [_x] spawn BIS_fnc_guiMessage; i added the [_x] spawn BIS_fnc_guiMessage; just to se if my code executes and works and yes the button when its clicked the mesage box shows how ever the _x shows as blank this is why this karate is not working because the _x is returning no value on this message box is blank. how can i fix this. -
make all ai do karate code help
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
am trying to make it work on arma3.server if i use the code in game/host then it works. why dont it work when i try it on arma3server.exe please help. kindly look at this similar code i have on button click it works on arm3.server.exe { if(!isPlayer _x && side _x != playerSide) then { _x setPos screenToWorld[.5,.5]; } }forEach allUnits; this code brings all enemy ai to my location works nice. and now back at the main code ( karate ) am using the same if statement but not working. [] spawn { if (isServer && time > 2) then { while{true} do { { if(!isPlayer _x && side _x != playerSide && animationState _x != "AmovPercMstpSnonWnonDnon_exerciseKata") then { _x playMove "AmovPercMstpSnonWnonDnon_exerciseKata" }; } forEach allUnits; sleep 1; }; }; }; not working. { if(!isPlayer _x && side _x != playerSide && animationState _x != "AmovPercMstpSnonWnonDnon_exerciseKata") then { _x playMove "AmovPercMstpSnonWnonDnon_exerciseKata" }; } forEach allUnits; sleep 1; not working ai not doing karate.. -
make all ai do karate code help
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
what do you mean by Must wait until instead. Corrected above!? do you edit your code ? in post 3 should i try it -
make all ai do karate code help
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
if i paste this code Karate_loop = {{if(!isPlayer _x && side _x != playerSide) then { _x playMove "AmovPercMstpSnonWnonDnon_exerciseKata" }}forEach allUnits;}; {_x call Karate_loop} foreach allunits in this box in image then it works. this in game nss admin console was made by some one else and am testing it to se if code works and if it does then i start adding it to my filename.sqf here is what i done as you told me. in my fn_aikarate.sqf i have [] spawn { if (isServer && time > 2) then { while{true} do { { if(!isPlayer _x && side _x != playerSide && animationState _x != "AmovPercMstpSnonWnonDnon_exerciseKata") then { _x playMove "AmovPercMstpSnonWnonDnon_exerciseKata" }; } forEach allUnits; sleep 1; }; }; }; ["karate"] spawn BIS_fnc_guiMessage; so when i click the button from menu in my own menu app this code gets executed cause the message box shows up , how ever the karate code is not taking any affect on enemy ai ? -
make all ai do karate code help
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
ok update. if i run this same code in server exec ,global or local then it works. this code above u se i have that in my karate.sqf that code only. is it not working because am missing maybe "{} ? -
make all ai do karate code help
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
if i host then this code works Karate_loop = {{if(!isPlayer _x && side _x != playerSide) then { _x playMove "AmovPercMstpSnonWnonDnon_exerciseKata" }}forEach allUnits;}; {_x call Karate_loop} foreach allunits if my friend host then this code dont work how come ,please help this code is to make all ai do karate only . -
remove all weapons from ai only
peacefull Nation posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
this code is working {removeAllWeapons _x;} forEach allUnits; it removes all my guns and my team and thats not what i want. and i tried this but now working if(!isPlayer _x && side _x != playerSide) then { { removeAllWeapons _x; } forEach allUnits; -
command to show all ai on map
peacefull Nation posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
is thier a command i can use to execute test so that i can se all ai on map and un-hide so all players can se them. ? -
spawn dogs and following u and attack ai
peacefull Nation posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
_dog = createAgent ["Fin_random_F", getPos player, [], 5, "CAN_COLLIDE"]; this works nice it spawns the dog , but the dog wonders off doing its own thing. i was wondering if the dog can follow the play and if ai is close then atack it ? is it possible. =========================== 2nd question. spawn dog and let the dog run off to enemy location by its own and attack ? is it possible. ======================== 3rd question spawn dog and attack player -
command to show all ai on map
peacefull Nation replied to peacefull Nation's topic in ARMA 3 - MISSION EDITING & SCRIPTING
thanks alot boss you guys are awesome. am just noob in this game but not dumb to work with these codes. quick learner and love learning these things.