Jump to content

AdirB

Member
  • Content Count

    236
  • Joined

  • Last visited

  • Medals

Everything posted by AdirB

  1. AdirB

    AI spawns twice

    WOW that's very nice, thank you! :) hm I think the last thing is the if (isserver) Is it required? I'm using it here: if (isServer) then { [] execVM "base_ai_guards\hireguards.sqf"; }; In the "hireguards.sqf" there's lines that spawns a unit (GuardBoss), it checks if it's a server because when it's not it spawns the unit per machine connected. (https://forums.bistudio.com/topic/187557-ai-spawns-twice/#entry2970256) That's the reason I'm asking, I don't want the AI to spawn twice, one per machine connected.
  2. AdirB

    AI spawns twice

    Both of the commands worked. I've tried to use "group player" and "getpos player" on my lines and it worked, but only after I deleted the "isServer" if statement (THIS STATEMENT IS RECOMMANDED?) Then I used the original positions, they are really far away from the position I wanted them to be. is there a way to get the right X Y Z? The way I did take the X Y Z is saving a mission with these units and then searching their position in the mission.sqm.
  3. AdirB

    AI spawns twice

    I changed now the height to something lower so the fall will be shorter but they are not spawning again.
  4. Hello, I've tried to use createUnit but I couldn't get it working since I'm new to this. This is the script: if (isServer) then { guardgrp = creategroup west; _pos = [14745.541,17.91,16732.02]; guard1 = guardgrp createUnit ["Exile_Guard_01", _pos ,[],0,"form"]; guard1 setDir 270; guard1 setPosATL _pos; _pos = [14732.757,17.91,16731.408]; guard2 = guardgrp createUnit ["Exile_Guard_02", _pos ,[],0,"form"]; guard2 setDir 270; guard2 setPosATL _pos; _pos = [14737.639,17.91,16731.543]; guard3 = guardgrp createUnit ["Exile_Guard_03", _pos ,[],0,"form"]; guard3 setDir 270; guard3 setPosATL _pos; _pos = [14741.549,17.91,16731.746]; guard4 = guardgrp createUnit ["Exile_Guard_01", _pos ,[],0,"form"]; guard4 setDir 270; guard4 setPosATL _pos; }; Which called from an addAction command. Everything else I'm adding to the script above is working, that means the commands are wrong. I have no errors both in from the showScriptErrors and the RPT file. I'd apperciate it if you help me to solve it :)
  5. Hello, thank you for your response. Tried setPos to the unit's spawn coordinates, it didn't work.
  6. AdirB

    AI spawns twice

    I've tried to change it from "form" to "FORM", it didn't work. I've tried everything. The unit classname doest exist but I tried another one, it didn't work. The custom unit side is independet and the group side was west, I've tried to change it to independet, it didn't work. The script is calling the SQF properly, I know because other commands (like "hint") is working in that SQF. SQF: if (isServer) then { guardgrp = creategroup independent; _pos = [14745.541,17.91,16732.02]; guard1 = guardgrp createUnit ["Exile_Guard_01", _pos ,[],0,"FORM"]; guard1 setDir 270; _pos = [14732.757,17.91,16731.408]; guard2 = guardgrp createUnit ["Exile_Guard_02", _pos ,[],0,"FORM"]; guard2 setDir 270; _pos = [14737.639,17.91,16731.543]; guard3 = guardgrp createUnit ["Exile_Guard_03", _pos ,[],0,"FORM"]; guard3 setDir 270; _pos = [14741.549,17.91,16731.746]; guard4 = guardgrp createUnit ["Exile_Guard_01", _pos ,[],0,"FORM"]; guard4 setDir 270; }; init.sqf (addAction): [] spawn { waitUntil { !isNil "GuardBoss" }; GuardBoss addAction ["Hire Guards", "base_ai_guards\spawnguards.sqf"]; };
  7. AdirB

    AI spawns twice

    Hello, I've tried to use createUnit but I couldn't get it working since I'm new to this. This is the script: if (isServer) then { guardgrp = creategroup west; _pos = [14745.541,17.91,16732.02]; guard1 = guardgrp createUnit ["Exile_Guard_01", _pos ,[],0,"form"]; guard1 setDir 270; guard1 setPosATL _pos; _pos = [14732.757,17.91,16731.408]; guard2 = guardgrp createUnit ["Exile_Guard_02", _pos ,[],0,"form"]; guard2 setDir 270; guard2 setPosATL _pos; _pos = [14737.639,17.91,16731.543]; guard3 = guardgrp createUnit ["Exile_Guard_03", _pos ,[],0,"form"]; guard3 setDir 270; guard3 setPosATL _pos; _pos = [14741.549,17.91,16731.746]; guard4 = guardgrp createUnit ["Exile_Guard_01", _pos ,[],0,"form"]; guard4 setDir 270; guard4 setPosATL _pos; }; Which called from an addAction command. Everything else I'm adding to the script above is working, that means the commands are wrong. I have no errors both in from the showScriptErrors and the RPT file. I'd apperciate it if you help me to solve it :)
  8. Hello, thanks for your response. If I do remoteExec, won't it do the same action everytime a player joins the server?
  9. Hello guys :) I'm trying to add a NPC with an action (scroll wheel), but it's not working. The NPC spawns but the addAction is not working. I've tried different addAction commands on different objects but it's always failed. //Office Guard Hire NPC _pos = [14602.1,16773.7,5.09502]; _guardboss = createVehicle ["Exile_Guard_02", _pos, [], 0, "CAN_COLLIDE"]; _guardboss setDir 90; _guardboss setPosATL _pos; _guardboss allowDamage false; _guardboss addAction ["Hint Hello!", { hint format ["Hello %1!", _this select 3] }, name player]; _guardboss disableAI "ANIM"; _guardboss disableAI "MOVE"; _guardboss disableAI "FSM"; _guardboss disableAI "AUTOTARGET"; _guardboss disableAI "TARGET"; _guardboss disableAI "CHECKVISIBLE"; _guardboss allowDamage false; _guardboss removeAllEventHandlers "HandleDamage"; //Action Fock_addactionMP ={ private["_object","_screenMsg","_scriptToCall"]; _object = _this select 0; _screenMsg = _this select 1; _scriptToCall = _this select 2; if(isNull _object) exitWith {}; _object addaction [_screenMsg,_scriptToCall];}; [[_guardboss,"Hire Guards",""],"Fock_addactionMP",nil,false] spawn BIS_fnc_MP; I'd apperciate it if you guys may help me! Thank you! :)
  10. AdirB

    AI spawns twice

    I actually thought it's "nill" too. Thank you :)
  11. AdirB

    AI spawns twice

    Ok thank you the group is working. I actually had the -showscripterros in the arma launch options, but no error shown up in-game, I also tried to add this line in the extra parameter section in the "Tophe's Arma Dedicated Server Tool" but it didn't work either. I could find erros in the RPT file. 19:56:59 Error in expression <qf"; }; [] spawn { waitUntil { !isNill "GuardBoss" }; GuardBoss addAction ["Hir> 19:56:59 Error position: <"GuardBoss" }; GuardBoss addAction ["Hir> 19:56:59 Error Missing ;
  12. AdirB

    AI spawns twice

    I don't understand why or how but it's still not working. I've done everything you (enigma) said. This is the init.sqf: if (isServer) then { execVM "base_ai_guards\hireguards.sqf"; }; [] spawn { waitUntil { !isNill "GuardBoss" }; GuardBoss addAction ["Hire Guards", "base_ai_guards\spawnguards.sqf"]; }; This is the _guardboss file: //Office Guard boss NPC _pos = [14602.1,16773.7,5.09502]; _guardboss = createUnit ["Exile_Guard_02", _pos, [], 0, "CAN_COLLIDE"]; _guardboss setDir 270; _guardboss setPosATL _pos; _guardboss allowDamage false; //Guard boss behaviours _guardboss disableAI "ANIM"; _guardboss disableAI "MOVE"; _guardboss disableAI "FSM"; _guardboss disableAI "AUTOTARGET"; _guardboss disableAI "TARGET"; _guardboss disableAI "CHECKVISIBLE"; _guardboss allowDamage false; _guardboss removeAllEventHandlers "HandleDamage"; _guardboss setVariable ["BIS_fnc_animalBehaviour_disable", true, true]; GuardBoss = _guardBoss; publicVariable "GuardBoss"; The addAction is still not working :unsure: About the addUnit I looked in the bohemia wiki and it seems it's like the addVehicle so I only change the addVehicle to addUnit but it's not working too.
  13. AdirB

    AI spawns twice

    WOW ok thank you for the explanation! So addAction have to be global as it suppose to work on all machines unlike the addVehicle/Unit which will multiply on every machine joins the server. Yeah, I know that, I'll figure out something. I didn't use the create unit already, I'll tell you when I do.
  14. AdirB

    AI spawns twice

    I want to spawn AIs that will patrol around a specific loaction. I don't really know what's better (createUnit or createVehicle), until now I only used createVehicle.
  15. AdirB

    AI spawns twice

    I deleted the isserver if statment and it worked but it's not good ^^
  16. AdirB

    AI spawns twice

    Alright, I made him sitting on a chair and know he's not moving :) but there's another problem, the addAction command is not working for some reason, I can't see the "Hire Guards" lable on him. _guardboss addAction ["Hire Guards", "base_ai_guards\spawnguards.sqf"]; it's in the save file you told me to execute in the init.sqf file with the isServer if statment.
  17. AdirB

    AI spawns twice

    NICE! it worked, thank you! I have two more question, if you may answer :) 1. When I'm getting really close to that AI it's like I'm pushing him, is there a way to make him completely static? 2. The Exile mod is familiar to you? because you knew that there's the initServer.sqf
  18. AdirB

    Add action

    Thank you, it worked :)
  19. AdirB

    Add action

    I see, Thank you for your help :) I'd apperciate it if you know and may to help me to excute the command inside the mission file.
  20. AdirB

    Add action

    I see, thank you. Including is the only way to execute scripts outside the mission folder?
  21. AdirB

    Add action

    Thank you for you response. I checked it too outside the Exile mod and it worked. It's maybe the place I'm putting the addAction, it's in a PBO file outside the mission folder, nothing calls it. (maybe that reason?) I did that because there's object working, including the NPC.
  22. what the name of the missiles and gatling gun on the LHD? i am pretty sure that they are in game originals
  23. Ok thanks. About the weapon, I noticed this, I prefer to leave it like that because the mission starts in a base, and weapon not suppose not be loaded.
×