Jump to content

flyxdvd

Member
  • Posts

    31
  • Joined

  • Last visited

Posts posted by flyxdvd

  1. They are the coordinates for changing the angle at which the building sits, if you remove them it will work fine on flat land but if they are placed on a hill they won't be how you placed them in the editor when you get in game.

    Thnx but basicly whats wrong with this one?

     ["Land_TentHangar_V1_ruins_F",[15067.4,16916.7,0],226.364,0,0,false],

     

    i suspect something with the ending i dont really see the necessary brackets

    kinda like this?

     

     ["Land_TentHangar_V1_ruins_F",[15067.4,16916.7,0],226.364,0,0,[false],

  2. Well the 1st 2 are coords 2nd is angle and I believe the bold would be height don't really know about that other bold though

    hmm well the wierd part is i took his list wich he wrote like this:

     

        ["Land_TentHangar_V1_ruins_F",[15067.4,16916.7,0],226.364,0,0,false],

     

    and replaced everything from 0,0 to 

     ["Land_TentHangar_V1_ruins_F",[15067.4,16916.7,0],226.364,[[-0.688844,-0.72491,0],[-0,0,1]],false],

      ["Land_WIP_ruins_F",[14205.6,15432.8,-0.896458],229.091,[[-0.688844,-0.72491,0],[-0,0,1]],false],

       ["Land_WIP_F",[14435.2,16757.1,0],313.636,[[-0.688844,-0.72491,0],[-0,0,1]],false],
       ["Land_TentHangar_V1_dam_F",[15140.8,16990.6,0],44.0909,[[-0.688844,-0.72491,0],[-0,0,1]],false],
       ["Land_TentHangar_V1_dam_F",[15064.4,16998.3,0],64.5455,[[-0.688844,-0.72491,0],[-0,0,1]],false],
       ["Land_TentHangar_V1_dam_F",[15046.7,17075.8,-1.90735e-006],269.546,[[-0.688844,-0.72491,0],[-0,0,1]],false],
       ["Land_TentHangar_V1_dam_F",[14457.4,16286.6,0],31.3636,[[-0.688844,-0.72491,0],[-0,0,1]],false],
       ["Land_Cargo_Tower_V1_No1_F",[14165.4,16287.1,0],223.636,[[-0.688844,-0.72491,0],[-0,0,1]],false],

     

    but really everything the same ,[[-0.688844,-0.72491,0],[-0,0,1]],false],

    then everything spawned on their positions not found any bugs in height or anything so to me those bold stuff looks not necessary because it didnt really matter what was in it 

  3. Ello,

     

    There are several ways to spawn in custom buildings etc with map editors and SQF

     

    one way is,

    _vehicle_1449 = objNull;
    if (true) then
    {
    	_this = createVehicle ["RoadBarrier_F", [3719.3022, 13044.572, 2.8610229e-005], [], 0, "CAN_COLLIDE"];
    	_vehicle_1449 = _this;
    	_this setDir -72.15435;
    	_this setPos [3719.3022, 13044.572, 2.8610229e-005];
    };
    
    

    Then another way is

    private ["_objs"];
            _objs = [
     ["Land_TentHangar_V1_ruins_F",[15067.4,16916.7,0],226.364,[[-0.688844,-0.72491,0],[-0,0,1]],false]
    
    ];
    
    {
    	private ["_obj"];
    	_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
    	_obj allowDamage false;
    	if (_x select 4) then {
    		_obj1 setDir (_x select 2);
    		_obj1 setPos (_x select 1);
    	} else {
    		_obj1 setPosATL (_x select 1);
    		_obj1 setVectorDirAndUp (_x select 3);
    	};
    } foreach _objs;
    

    Basicly my question is

     

    ["Land_TentHangar_V1_ruins_F",[15067.4,16916.7,0],226.364,[[-0.688844,-0.72491,0],[-0,0,1]],false]

    What are these Bold Numbers for and are they neccesary or can you just leave them and put them like this

     

    ["Land_TentHangar_V1_ruins_F",[15067.4,16916.7,0],226.364,[false],

     

    Why am i asking someone i know doesnt like M3Editor but like's the way it exports in the SQF

    its much easier to allowDamage False;

    instead of having to put allowDamage False; in every single building, M3 makes a list of buildings

     

     

    Might be a confusing question hehe so if you dont know what i mean feel free to ask

     

    FlyX

     

  4. Addactions have always worked on the standard AH if you are an admin, if you aren't an admin then 0.3.0.3 introduced the ability to let non admins use them too. Prior to that it was totally hit and miss as to whether it worked or not.

    Aah like that, i got confused thanks for explaining ;) 

  5. I recently got into scripting etc, But addactions do work with StockAH ( if i think that means the default epochAH)

     

    what i basicly do is calling the addaction in the Altis Mission,

    		player addaction ["Start Event", "addons\xxxxxxx\start.sqf","",5,false,true,"",""];
    

    Then start.sqf

    systemChat "Starting event";
    event = false;
    publicVariableServer "event";
    

    Then in the @epochHive Addon

    "event" addPublicVariableEventHandler {
    	[] execVM "x\addons\custom\serverside\xxxxxx\xxxxxxxx.sqf";
    };
    

    This way the addactions worked for me? and runs the scripts i want to run pretty easy.

    Or did i just got lucky, could be since the latest epochupdate but also had it working one build before 0.3.0.3

  6. Your server side script in epochHive only runs once when the server starts, so it will only run or not run based on whatever you have "event=" set to in the mission init.sqf since init.sqf is loaded by both the server and client. Anything else you do with "event" after that doesn't matter because the script is no longer running.

    To use public variables you need an addPublicVariableEventHandler on the server (or clients depending on where you want it to go off) and use publicVariableServer, it will only send the variable to the server, publicVariable will send the variable to everyone.

    My suggestions, remove 

    event = false;

    publicVariable "event";

    from your mission init.sqf

     

    In your start.sqf

    systemChat "Starting event";
    event = true;
    publicVariableServer "event";
    

    In your @epochHive script:

    "event" addPublicVariableEventHandler {
    	[] execVM "x\addons\custom\serverside\test.sqf";
    };
    

    (You don't need to use isServer on @epochHive scripts, they only run on the server)

    This way, when your addaction runs start.sqf, "event" will be sent to the server and the server will then run [] execVM "x\addons\custom\serverside\test.sqf";

    Thank you sir! gonna test this right now. And also thanks for the isServer no need. Didnt know that mainly did it because well just to be sure hehe

  7. Hello again,

     

    While figuring the addactions i found out a way to give people with the decent GUID to get an addaction tru the Epoch.Atlis mission.

     

     

    init.sqf //Mission pbo

    event = false;
    publicVariable "event";
    
    waitUntil {!(isNull (findDisplay 46))};
    	
    	if ((getPlayerUID player) in ["MY ID"]) then {
    	systemChat "Adding event";
    	removeAllActions player;   
    	waitUntil {!isNull player};
    	while {true} do {
    	   waitUntil {sleep 1.5; alive player};
    		player addaction ["Start Event", "start.sqf","",5,false,true,"",""];
    
    		waitUntil {sleep 1.5; !alive player};
    	};
    };
    

    it calls another script in the altis.mission

    wich basicly sets a public variable to true,

     

    start.sqf //mission pbo

    systemChat "Starting event";
    event = true;
    publicVariable "event";
    

    Then in my @epochHive

    it should see this if im not wrong thats its set to True

    and run this

    if (isServer) then {	
    
    if (event)then { 
    
    [] execVM "x\addons\custom\serverside\test.sqf";	
    
    };
    };
    

    This file is called test.sqf

    and i got an init.sqf calling this file in the addon.

     

    Now my question is

     

    When i set 

    event = false;
    publicVariable "event";
    

    to true at the start of the server it runs the code in @epochHive

    but when i try to set it to true with the addaction running a script setting it true it doesnt seem to work.

     

    Im probably just missing something small i guess. I hope you guys understand what i mean otherwise ask! ill try to explain it better haha. 

     

    Only yesterday i learned about AddpublicEventHandelers and Public variables so its still a bit fresh

     

    greetz FlyX

     

     

     

  8. With the new version of the server files addAction checking can be disabled.  Personally, I'd prefer to see it set up so that you can add a list of allowed addActions, just like they have for global vars now.  That way any addActions not whitelisted would be blocked.  

    Same, i would love to basicly whitelist some addaction i think that could work and the AH will still keep it safe

     

    Yep keydown or keyup.

    Set a hotkey for all your admin addactions.

    hmm how about would i go about doing that any examples or a wiki page i could link to?

    i tought of this before like this i found on the wiki but coudn't wrap my head around it

    moduleName_keyDownEHId = (findDisplay 46) displayAddEventHandler ["KeyDown", "hint str _this;"];
    
  9. Creating vehicles will have to be done on the server as 

    _vehicle call EPOCH_server_setVToken;
    _vehicle call EPOCH_server_vehicleInit;
    

    will have to be called, that's why the vehicles disappear after creation. That should solve the issue of creating vehicles.

    That aint the problem sorry for not clarifying, i use the setVToken

    _supplyChute1 = createVehicle ["B_parachute_02_F", position _supplyBox, [], 0, "FLY"];		
    _supplyChute1 call EPOCH_server_setVToken;
    _supplyChute1 call EPOCH_server_vehicleInit;				
    _supplyBox1 attachTo [_supplyChute1,[0,1,0]];	 

    and it works etc.

    but i can't add the addaction because of the epochAH thats my main problem.

    Trying to find a workaround or just an other way to make an admin start the event instead on server startup.

     

     

    need more info feel free to ask!

  10. Hello,

     

    Been busy writing a simple script starting an event like a mini battle royale, atm it works on server start

    but i want admins to be able to run it themselves so i was thinking of a simple 

     

    addaction ["Start Event", "addons\xxxxxx\xxxxxxx","",5,false,true,"",""];

     

    for admins.

     

    then when it just didn't show up in the actions etc i started to get a bit frustrated hehe...

    so i found out the stock epochAH blocks these actions seen a couple of topics about it.

     

    I run the script server sided in the @Epochhive

    from a pbo.

     

    I got addactions working when i run scripts in the mpmission but the script needs to be able to CreateVehicles and them not to dissapear when a player gets close

    Got supply boxes dropping from the air with a chute etc.

     

    my question for you guys is.. Is there a way to work around it?

     

     

    might have written some stuff wrong so if you need more clarification dont be afraid to ask!

    Also if you wanna take a look into it ask aswell and i will upload what i have so far.

     

    kind regards,

    FlyX

     

     

  11. You could try :

    _supplyBoxFnc = "B_CargoNet_01_ammo_F";
    _supplyBox = createVehicle [_supplyBoxFnc, [x,y,z], [], 10, "CAN_COLLIDE"];
    

    Where x and y are the map coords and z is the height you want to spawn at

    Yes this works, i dont need it to spawn exactly at a player anyways so thanks!

  12. Ello!

     

    Basicly im creating a mini battle royale event got most of it setup atm.

    I got this (atm addaction) that spawn a loot crate. What i want is it to spawn in height ive been searching all around i got into some array's etc but still coudn't get far.

     

    this is the createvehicle for now:

    _supplyBoxFnc = "B_CargoNet_01_ammo_F";

     

    _supplyBox = createVehicle [_supplyBoxFnc, getPos player, [], 10, "CAN_COLLIDE"];

     

    the getPos player is going to change later so it spawn randomly around the island where the event is happening but ofcourse i need them to spawn in the air 

    the Chute etc is for later allready found someways with attachto etc. Just want this height thingy solved hehe.

     

    Kind regards,

    Flyx

  13. Hello,

     

    i took a break on this, i don't know if people got my SP script working in MP atm...

     

    i looked into it i got most of the stuff server side except the messages can do that soon.

    the add-action works and all

     

    @shuriken

    it should be possible do make it like that but might take longer.

    atm its just kept  basic, and my first script-test wasn't even server side so that's why most of you got errors or it didn't even work he he

     

    regards FlyX

     

    and @

    rems_be  he sorted out my script to run on mp ( since i scripted it sp) so props to that ^^
  14. Hello,

     

    the wierdest thing. I used to do this alot test maps on epoch servers try them out edit script etc.

     

    I stopped for a while went on doing some personal stuff but i wanted to try some maps like Stratis but i totally forgot where and how to make it so it loads stratis and to altis.

    if anyone would be so kind to remind me again hehe..

     

    Thnx in advance!

     

    Edit: just after i wrote it i figured it all out again.

  15. If only i knew how to make something for epoch/multiplayer.

     

    i tried to make some type of get admin so i got up with this:

     

     

    it worked on LAN and Internet hosted in arma 3 but when i tried it on my test server it didn't even show up ;P

    no errors in the RTP aswell.

     

    Pretty new to arma coding.

     

    it works pretty simple, Declare your admins in the 

    if ((getPlayerUID player) in ["xxxxxxxxxxxxxxx", "xxxxxxxxxxxxxxx"])

    (or event leader)

     

     

     It give's you an addaction (the scroll menu) to start an event probs need to change that if you accidently click on it ;)

    then it gives the server based on who clicked on the button a hint: in the video it shows my name. 

     

    places a marker and the marker will follow your position ( you can make it delayed by changing  "sleep 0.5;" to something higher)

     

    made it today still not finished but could use some help to make it serverside ofcourse did alot of reading already haha

     

    need the files:  http://www.mediafire.com/download/qhte8g352ilsl8y/Catch.rar

     

    ps: if anyone manages to change it to work with epoch i would glady wanna know how it helps my study aswell

     

     

    after i manage to make it so epoch will run it ill add some more stuff.(otherwise i can't really test it, it might work for me ofcourse)

  16. Hello,

     

    im using this mission script from blackeagls.

     

    I like to edit/code some stuff in since i study game-development(early years) i like to experiment with code etc.

    Im trying to add that vehicle's despawn when the mission is finished it works atm, but not for the first time mission spawned.

     

    example: restarting server, going to the mission and clear it, i get the mission like "mission has been cleared by survivors" but the vehicles don't despawn/deleted. the mission then re-spawns for a second time and when i clear it i get

    "mission has been cleared by survivors" and deletes the vehicle's.

     

    so the main problem is why the first mission doesn't delete the vehicles.

     

    i edited a total of 2 files and added 1 files so here they are:

     

     
    the SM1.sqf

    private ["_coords","_MainMarker","_wait","_crate];
     
     
    //set variable
     
    //Find a safe position on map to spawn marker and AI units
    _FindNewPosition = false;
    _coords = [mapCenter,300,mapRange,30,0,10,0] call BIS_fnc_findSafePos;
    {
    if ((_x distance _coords) < MinDistanceFromMission) then {
    _FindNewPosition = true;
    };
    } foreach AllMissionCoords;
    if (_FindNewPosition) exitWith {[] execVM "\q\addons\custom_server\AIMission\Major\SM1.sqf"};
    AllMissionCoords = AllMissionCoords + [_coords];
     
    //Sleeps specifed ammount in init.sqf
    sleep blck_AISpawnTime;
     
    //Sends message to all players about the AI Mission
    ["Rebels are gathering! Check your map for the location!"] execVM "\q\addons\custom_server\AIMission\AIM.sqf";
     
    //Sets public variable for all units to see mapmarker
    Ccoords = _coords;
    publicVariable "Ccoords";
    [] execVM "debug\addmarkers.sqf";
     
    //Crates the crate
    _crate = objNull;
    _crate = createVehicle ["Box_NATO_Wps_F",[(_coords select 0) - 3, _coords select 1,0],[], 0, "CAN_COLLIDE"];
     
    //Sets variables (not sure if needed but left just incase so cleanup doesnt happen
    _crate setVariable ["Mission",1,true];
    _crate setVariable ["ObjectID","1",true];
    _crate setVariable ["permaLoot",true,true];
     
    //Fills the crate with items
    [_crate] call blck_FillBoxes_Major;
     
    //Spawns the AI
    [_coords,blck_MinAI_Major,blck_MaxAI_Major,blck_WeaponList_Major,blck_SpawnVeh_Major] execVM "\q\addons\custom_server\AIMission\spawnai.sqf";
     
    //Waits until player gets near the _crate to end mission
    waitUntil{{isPlayer _x && _x distance _crate < 10  } count playableunits > 0};
     
    //Announces that the mission is complete
    ["The Rebel Gathering has settled down!"] execVM "\q\addons\custom_server\AIMission\AIM.sqf";
     
    //Remove AI Mission Position Tracker
    AllMissionCoords = AllMissionCoords - [_coords];
     
    //Removes the markers
    [] execVM "debug\remmarkers.sqf";
    MissionGo = 0;
    Ccoords = 0;
    publicVariable "Ccoords";
     
     
     
    //the delete vehicle exec
    [] execVM "\q\addons\custom_server\AIMission\delveh1.sqf";
     
    //Spawns mission again

    [] execVM "\q\addons\custom_server\AIMission\major\SM1.sqf";

     

    the spawnVehicle.sqf

    //Debug information 
    diag_log format["SpawnVehicles _this: %1",_this];
     
    //Gets position information from spawnai1.sqf
    _pos = _this select 0;
     
    //Creates a group for Vehicles
    _aiGroup = createGroup RESISTANCE;
    _ai = ObjNull;
     
    //Finds a safe positon in area to spawn
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
     
    //Spawns 1 AI Unit
    "O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai = this", 0.1, "PRIVATE"];
    removeBackpackGlobal _ai;
    removeAllItemsWithMagazines  _ai;
    _ai setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _ai setVariable["LAST_CHECK",1000000000000];
    _ai setVehicleVarName "ai1"; ai1 = _ai;\\gave the ai's a name to delete it with. so with the rest.
    _ai enableAI "TARGET";
    _ai enableAI "AUTOTARGET";
    _ai enableAI "MOVE";
    _ai enableAI "ANIM";
    _ai enableAI "FSM";
    _ai allowDammage true;
    _ai setCombatMode "RED";
    _ai setBehaviour "COMBAT";
    _ai setVariable ["AI",true,true];
     
     
    //Spawns 1 AI Unit
    _ai1 = ObjNull;
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    "O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai1 = this", 0.1, "PRIVATE"];
    removeBackpackGlobal _ai1;
    removeAllItemsWithMagazines  _ai1;
    _ai1 setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _ai1 setVariable["LAST_CHECK",1000000000000];
    _ai1 setVehicleVarName "ai2"; ai2 = _ai1;
    _ai1 enableAI "TARGET";
    _ai1 enableAI "AUTOTARGET";
    _ai1 enableAI "MOVE";
    _ai1 enableAI "ANIM";
    _ai1 enableAI "FSM";
    _ai1 allowDammage true;
    _ai1 setCombatMode "RED";
    _ai1 setBehaviour "COMBAT";
    _ai1 setVariable ["AI",true,true];
     
     
    //Spawns 1 AI Unit
    _ai2 = ObjNull;
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    "O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai2 = this", 0.1, "PRIVATE"];
    removeBackpackGlobal _ai2;
    removeAllItemsWithMagazines  _ai2;
    _ai2 setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _ai2 setVariable["LAST_CHECK",1000000000000];
    _ai2 setVehicleVarName "ai3"; ai3 = _ai2;
    _ai2 enableAI "TARGET";
    _ai2 enableAI "AUTOTARGET";
    _ai2 enableAI "MOVE";
    _ai2 enableAI "ANIM";
    _ai2 enableAI "FSM";
    _ai2 allowDammage true;
    _ai2 setCombatMode "RED";
    _ai2 setBehaviour "COMBAT";
    _ai2 setVariable ["AI",true,true];
     
     
    //Spawns 1 AI Unit
    _ai3 = ObjNull;
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    "O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai3 = this", 0.1, "PRIVATE"];
    removeBackpackGlobal _ai3;
    removeAllItemsWithMagazines  _ai3;
    _ai3 setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _ai3 setVariable["LAST_CHECK",1000000000000];
    _ai3 setVehicleVarName "ai4"; ai4 = _ai3;
    _ai3 enableAI "TARGET";
    _ai3 enableAI "AUTOTARGET";
    _ai3 enableAI "MOVE";
    _ai3 enableAI "ANIM";
    _ai3 enableAI "FSM";
    _ai3 allowDammage true;
    _ai3 setCombatMode "RED";
    _ai3 setBehaviour "COMBAT";
    _ai3 setVariable ["AI",true,true];
     
     
    //Spawns a AI Vehicle
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    _veh = ObjNull;
    _veh = createVehicle["B_G_Offroad_01_armed_F", _safepos, [], 0, "NONE"];
    _veh setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _veh setVariable["LAST_CHECK",1000000000000];
    _veh setVehicleVarName "veh1"; veh1 = _veh; \\gave the vehicle a name so i can delete it. did this with both of em.
    //Moves 2 AI units into vehicle
    _ai moveInAny _veh;
    _ai1 moveInAny _veh;
    //So Vehicle doesnt despawn
    EPOCH_VehicleSlotsLimit = EPOCH_VehicleSlotsLimit + 1;
    EPOCH_VehicleSlots pushBack str(EPOCH_VehicleSlotsLimit);
    _slot = EPOCH_VehicleSlots select 0;
    _veh setVariable ['VEHICLE_SLOT',_slot,true];
    EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_slot];
    EPOCH_VehicleSlotCount = count EPOCH_VehicleSlots;
    publicVariable 'EPOCH_VehicleSlotCount';
    _veh call EPOCH_server_setVToken;
    //Creates vehicle inventory
    clearWeaponCargoGlobal    _veh;
    clearMagazineCargoGlobal  _veh;
    clearBackpackCargoGlobal  _veh;
    clearItemCargoGlobal       _veh;
     
     
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    _veh2 = ObjNull;
    _veh2 = createVehicle["B_G_Offroad_01_armed_F", _safepos, [], 0, "NONE"];
    _veh2 setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _veh2 setVariable["LAST_CHECK",1000000000000];
    _veh2 setVehicleVarName "veh2"; veh2 = _veh2;
    _ai2 moveInAny _veh2;
    _ai3 moveInAny _veh2;
    EPOCH_VehicleSlotsLimit = EPOCH_VehicleSlotsLimit + 1;
    EPOCH_VehicleSlots pushBack str(EPOCH_VehicleSlotsLimit);
    _slot = EPOCH_VehicleSlots select 0;
    _veh2 setVariable ['VEHICLE_SLOT',_slot,true];
    EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_slot];
    EPOCH_VehicleSlotCount = count EPOCH_VehicleSlots;
    publicVariable 'EPOCH_VehicleSlotCount';
    _veh2 call EPOCH_server_setVToken;
    clearWeaponCargoGlobal    _veh2;
    clearMagazineCargoGlobal  _veh2;
    clearBackpackCargoGlobal  _veh2;
    clearItemCargoGlobal       _veh2;

     

    delveh1.sqf is the delete vehicle type of script which is called at the end of the mission.

    {
    _x action ["Eject", veh1];
    } forEach crew veh1;
    deleteVehicle veh1;
    deleteVehicle ai1;
    deleteVehicle ai2;
     
    {
    _x action ["Eject", veh2];
    } forEach crew veh2;
    deleteVehicle veh2;
    deleteVehicle ai3;
    deleteVehicle ai4;

     
    Any help would be greatly appreciated ^^
    kind regards,
    Flyx
  17. Hello,

     

    im using this mission script from blackeagls.

     

    I like to edit/code some stuff in since i study game-development(early years) i like to experiment with code etc.

    Im trying to add that vehicle's despawn when the mission is finished it works atm, but not for the first time mission spawned.

     

    example: restarting server, going to the mission and clear it, i get the mission like "mission has been cleared by survivors" but the vehicles don't despawn/deleted. the mission then re-spawns for a second time and when i clear it i get

    "mission has been cleared by survivors" and deletes the vehicle's.

     

    so the main problem is why the first mission doesn't delete the vehicles.

     

    i edited a total of 2 files and added 1 files so here they are:

     

     
    the SM1.sqf

    private ["_coords","_MainMarker","_wait","_crate];
     
     
    //set variable
     
    //Find a safe position on map to spawn marker and AI units
    _FindNewPosition = false;
    _coords = [mapCenter,300,mapRange,30,0,10,0] call BIS_fnc_findSafePos;
    {
    if ((_x distance _coords) < MinDistanceFromMission) then {
    _FindNewPosition = true;
    };
    } foreach AllMissionCoords;
    if (_FindNewPosition) exitWith {[] execVM "\q\addons\custom_server\AIMission\Major\SM1.sqf"};
    AllMissionCoords = AllMissionCoords + [_coords];
     
    //Sleeps specifed ammount in init.sqf
    sleep blck_AISpawnTime;
     
    //Sends message to all players about the AI Mission
    ["Rebels are gathering! Check your map for the location!"] execVM "\q\addons\custom_server\AIMission\AIM.sqf";
     
    //Sets public variable for all units to see mapmarker
    Ccoords = _coords;
    publicVariable "Ccoords";
    [] execVM "debug\addmarkers.sqf";
     
    //Crates the crate
    _crate = objNull;
    _crate = createVehicle ["Box_NATO_Wps_F",[(_coords select 0) - 3, _coords select 1,0],[], 0, "CAN_COLLIDE"];
     
    //Sets variables (not sure if needed but left just incase so cleanup doesnt happen
    _crate setVariable ["Mission",1,true];
    _crate setVariable ["ObjectID","1",true];
    _crate setVariable ["permaLoot",true,true];
     
    //Fills the crate with items
    [_crate] call blck_FillBoxes_Major;
     
    //Spawns the AI
    [_coords,blck_MinAI_Major,blck_MaxAI_Major,blck_WeaponList_Major,blck_SpawnVeh_Major] execVM "\q\addons\custom_server\AIMission\spawnai.sqf";
     
    //Waits until player gets near the _crate to end mission
    waitUntil{{isPlayer _x && _x distance _crate < 10  } count playableunits > 0};
     
    //Announces that the mission is complete
    ["The Rebel Gathering has settled down!"] execVM "\q\addons\custom_server\AIMission\AIM.sqf";
     
    //Remove AI Mission Position Tracker
    AllMissionCoords = AllMissionCoords - [_coords];
     
    //Removes the markers
    [] execVM "debug\remmarkers.sqf";
    MissionGo = 0;
    Ccoords = 0;
    publicVariable "Ccoords";
     
     
     
    //the delete vehicle exec
    [] execVM "\q\addons\custom_server\AIMission\delveh1.sqf";
     
    //Spawns mission again

    [] execVM "\q\addons\custom_server\AIMission\major\SM1.sqf";

     

    the spawnVehicle.sqf

    //Debug information 
    diag_log format["SpawnVehicles _this: %1",_this];
     
    //Gets position information from spawnai1.sqf
    _pos = _this select 0;
     
    //Creates a group for Vehicles
    _aiGroup = createGroup RESISTANCE;
    _ai = ObjNull;
     
    //Finds a safe positon in area to spawn
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
     
    //Spawns 1 AI Unit
    "O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai = this", 0.1, "PRIVATE"];
    removeBackpackGlobal _ai;
    removeAllItemsWithMagazines  _ai;
    _ai setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _ai setVariable["LAST_CHECK",1000000000000];
    _ai setVehicleVarName "ai1"; ai1 = _ai;\\gave the ai's a name to delete it with. so with the rest.
    _ai enableAI "TARGET";
    _ai enableAI "AUTOTARGET";
    _ai enableAI "MOVE";
    _ai enableAI "ANIM";
    _ai enableAI "FSM";
    _ai allowDammage true;
    _ai setCombatMode "RED";
    _ai setBehaviour "COMBAT";
    _ai setVariable ["AI",true,true];
     
     
    //Spawns 1 AI Unit
    _ai1 = ObjNull;
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    "O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai1 = this", 0.1, "PRIVATE"];
    removeBackpackGlobal _ai1;
    removeAllItemsWithMagazines  _ai1;
    _ai1 setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _ai1 setVariable["LAST_CHECK",1000000000000];
    _ai1 setVehicleVarName "ai2"; ai2 = _ai1;
    _ai1 enableAI "TARGET";
    _ai1 enableAI "AUTOTARGET";
    _ai1 enableAI "MOVE";
    _ai1 enableAI "ANIM";
    _ai1 enableAI "FSM";
    _ai1 allowDammage true;
    _ai1 setCombatMode "RED";
    _ai1 setBehaviour "COMBAT";
    _ai1 setVariable ["AI",true,true];
     
     
    //Spawns 1 AI Unit
    _ai2 = ObjNull;
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    "O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai2 = this", 0.1, "PRIVATE"];
    removeBackpackGlobal _ai2;
    removeAllItemsWithMagazines  _ai2;
    _ai2 setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _ai2 setVariable["LAST_CHECK",1000000000000];
    _ai2 setVehicleVarName "ai3"; ai3 = _ai2;
    _ai2 enableAI "TARGET";
    _ai2 enableAI "AUTOTARGET";
    _ai2 enableAI "MOVE";
    _ai2 enableAI "ANIM";
    _ai2 enableAI "FSM";
    _ai2 allowDammage true;
    _ai2 setCombatMode "RED";
    _ai2 setBehaviour "COMBAT";
    _ai2 setVariable ["AI",true,true];
     
     
    //Spawns 1 AI Unit
    _ai3 = ObjNull;
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    "O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai3 = this", 0.1, "PRIVATE"];
    removeBackpackGlobal _ai3;
    removeAllItemsWithMagazines  _ai3;
    _ai3 setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _ai3 setVariable["LAST_CHECK",1000000000000];
    _ai3 setVehicleVarName "ai4"; ai4 = _ai3;
    _ai3 enableAI "TARGET";
    _ai3 enableAI "AUTOTARGET";
    _ai3 enableAI "MOVE";
    _ai3 enableAI "ANIM";
    _ai3 enableAI "FSM";
    _ai3 allowDammage true;
    _ai3 setCombatMode "RED";
    _ai3 setBehaviour "COMBAT";
    _ai3 setVariable ["AI",true,true];
     
     
    //Spawns a AI Vehicle
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    _veh = ObjNull;
    _veh = createVehicle["B_G_Offroad_01_armed_F", _safepos, [], 0, "NONE"];
    _veh setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _veh setVariable["LAST_CHECK",1000000000000];
    _veh setVehicleVarName "veh1"; veh1 = _veh; \\gave the vehicle a name so i can delete it. did this with both of em.
    //Moves 2 AI units into vehicle
    _ai moveInAny _veh;
    _ai1 moveInAny _veh;
    //So Vehicle doesnt despawn
    EPOCH_VehicleSlotsLimit = EPOCH_VehicleSlotsLimit + 1;
    EPOCH_VehicleSlots pushBack str(EPOCH_VehicleSlotsLimit);
    _slot = EPOCH_VehicleSlots select 0;
    _veh setVariable ['VEHICLE_SLOT',_slot,true];
    EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_slot];
    EPOCH_VehicleSlotCount = count EPOCH_VehicleSlots;
    publicVariable 'EPOCH_VehicleSlotCount';
    _veh call EPOCH_server_setVToken;
    //Creates vehicle inventory
    clearWeaponCargoGlobal    _veh;
    clearMagazineCargoGlobal  _veh;
    clearBackpackCargoGlobal  _veh;
    clearItemCargoGlobal       _veh;
     
     
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    _veh2 = ObjNull;
    _veh2 = createVehicle["B_G_Offroad_01_armed_F", _safepos, [], 0, "NONE"];
    _veh2 setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _veh2 setVariable["LAST_CHECK",1000000000000];
    _veh2 setVehicleVarName "veh2"; veh2 = _veh2;
    _ai2 moveInAny _veh2;
    _ai3 moveInAny _veh2;
    EPOCH_VehicleSlotsLimit = EPOCH_VehicleSlotsLimit + 1;
    EPOCH_VehicleSlots pushBack str(EPOCH_VehicleSlotsLimit);
    _slot = EPOCH_VehicleSlots select 0;
    _veh2 setVariable ['VEHICLE_SLOT',_slot,true];
    EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_slot];
    EPOCH_VehicleSlotCount = count EPOCH_VehicleSlots;
    publicVariable 'EPOCH_VehicleSlotCount';
    _veh2 call EPOCH_server_setVToken;
    clearWeaponCargoGlobal    _veh2;
    clearMagazineCargoGlobal  _veh2;
    clearBackpackCargoGlobal  _veh2;
    clearItemCargoGlobal       _veh2;

     

    delveh1.sqf is the delete vehicle type of script which is called at the end of the mission.

    {
    _x action ["Eject", veh1];
    } forEach crew veh1;
    deleteVehicle veh1;
    deleteVehicle ai1;
    deleteVehicle ai2;
     
    {
    _x action ["Eject", veh2];
    } forEach crew veh2;
    deleteVehicle veh2;
    deleteVehicle ai3;
    deleteVehicle ai4;

     
    Any help would be greatly appreciated ^^
    kind regards,
    Flyx
     
  18. EDIT!

     

    I got it working so it removes both vehicle's and AI.(only for one mission for now)

    but, my main problem is when i restart the server and try the mission and finish it the first mission doesnt delete the vehicle's but when a second one spawn it does any tips on it?

     

    these are my script/edits:(highlight the edited in part)

     

     

    the SM1.sqf

    private ["_coords","_MainMarker","_wait","_crate];
     
     
    //set variable
     
    //Find a safe position on map to spawn marker and AI units
    _FindNewPosition = false;
    _coords = [mapCenter,300,mapRange,30,0,10,0] call BIS_fnc_findSafePos;
    {
    if ((_x distance _coords) < MinDistanceFromMission) then {
    _FindNewPosition = true;
    };
    } foreach AllMissionCoords;
    if (_FindNewPosition) exitWith {[] execVM "\q\addons\custom_server\AIMission\Major\SM1.sqf"};
    AllMissionCoords = AllMissionCoords + [_coords];
     
    //Sleeps specifed ammount in init.sqf
    sleep blck_AISpawnTime;
     
    //Sends message to all players about the AI Mission
    ["Rebels are gathering! Check your map for the location!"] execVM "\q\addons\custom_server\AIMission\AIM.sqf";
     
    //Sets public variable for all units to see mapmarker
    Ccoords = _coords;
    publicVariable "Ccoords";
    [] execVM "debug\addmarkers.sqf";
     
    //Crates the crate
    _crate = objNull;
    _crate = createVehicle ["Box_NATO_Wps_F",[(_coords select 0) - 3, _coords select 1,0],[], 0, "CAN_COLLIDE"];
     
    //Sets variables (not sure if needed but left just incase so cleanup doesnt happen
    _crate setVariable ["Mission",1,true];
    _crate setVariable ["ObjectID","1",true];
    _crate setVariable ["permaLoot",true,true];
     
    //Fills the crate with items
    [_crate] call blck_FillBoxes_Major;
     
    //Spawns the AI
    [_coords,blck_MinAI_Major,blck_MaxAI_Major,blck_WeaponList_Major,blck_SpawnVeh_Major] execVM "\q\addons\custom_server\AIMission\spawnai.sqf";
     
    //Waits until player gets near the _crate to end mission
    waitUntil{{isPlayer _x && _x distance _crate < 10  } count playableunits > 0};
     
    //Announces that the mission is complete
    ["The Rebel Gathering has settled down!"] execVM "\q\addons\custom_server\AIMission\AIM.sqf";
     
    //Remove AI Mission Position Tracker
    AllMissionCoords = AllMissionCoords - [_coords];
     
    //Removes the markers
    [] execVM "debug\remmarkers.sqf";
    MissionGo = 0;
    Ccoords = 0;
    publicVariable "Ccoords";
     
     
     
    //the delete vehicle exec
    [] execVM "\q\addons\custom_server\AIMission\delveh1.sqf";
     
    //Spawns mission again

    [] execVM "\q\addons\custom_server\AIMission\major\SM1.sqf";

     

     

    the spawnVehicle.sqf

    //Debug information 
    diag_log format["SpawnVehicles _this: %1",_this];
     
    //Gets position information from spawnai1.sqf
    _pos = _this select 0;
     
    //Creates a group for Vehicles
    _aiGroup = createGroup RESISTANCE;
    _ai = ObjNull;
     
    //Finds a safe positon in area to spawn
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
     
    //Spawns 1 AI Unit
    "O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai = this", 0.1, "PRIVATE"];
    removeBackpackGlobal _ai;
    removeAllItemsWithMagazines  _ai;
    _ai setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _ai setVariable["LAST_CHECK",1000000000000];
    _ai setVehicleVarName "ai1"; ai1 = _ai;\\gave the ai's a name to delete it with. so with the rest.
    _ai enableAI "TARGET";
    _ai enableAI "AUTOTARGET";
    _ai enableAI "MOVE";
    _ai enableAI "ANIM";
    _ai enableAI "FSM";
    _ai allowDammage true;
    _ai setCombatMode "RED";
    _ai setBehaviour "COMBAT";
    _ai setVariable ["AI",true,true];
     
     
    //Spawns 1 AI Unit
    _ai1 = ObjNull;
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    "O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai1 = this", 0.1, "PRIVATE"];
    removeBackpackGlobal _ai1;
    removeAllItemsWithMagazines  _ai1;
    _ai1 setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _ai1 setVariable["LAST_CHECK",1000000000000];
    _ai1 setVehicleVarName "ai2"; ai2 = _ai1;
    _ai1 enableAI "TARGET";
    _ai1 enableAI "AUTOTARGET";
    _ai1 enableAI "MOVE";
    _ai1 enableAI "ANIM";
    _ai1 enableAI "FSM";
    _ai1 allowDammage true;
    _ai1 setCombatMode "RED";
    _ai1 setBehaviour "COMBAT";
    _ai1 setVariable ["AI",true,true];
     
     
    //Spawns 1 AI Unit
    _ai2 = ObjNull;
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    "O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai2 = this", 0.1, "PRIVATE"];
    removeBackpackGlobal _ai2;
    removeAllItemsWithMagazines  _ai2;
    _ai2 setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _ai2 setVariable["LAST_CHECK",1000000000000];
    _ai2 setVehicleVarName "ai3"; ai3 = _ai2;
    _ai2 enableAI "TARGET";
    _ai2 enableAI "AUTOTARGET";
    _ai2 enableAI "MOVE";
    _ai2 enableAI "ANIM";
    _ai2 enableAI "FSM";
    _ai2 allowDammage true;
    _ai2 setCombatMode "RED";
    _ai2 setBehaviour "COMBAT";
    _ai2 setVariable ["AI",true,true];
     
     
    //Spawns 1 AI Unit
    _ai3 = ObjNull;
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    "O_G_Soldier_SL_F" createUnit [_safepos, _aiGroup, "_ai3 = this", 0.1, "PRIVATE"];
    removeBackpackGlobal _ai3;
    removeAllItemsWithMagazines  _ai3;
    _ai3 setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _ai3 setVariable["LAST_CHECK",1000000000000];
    _ai3 setVehicleVarName "ai4"; ai4 = _ai3;
    _ai3 enableAI "TARGET";
    _ai3 enableAI "AUTOTARGET";
    _ai3 enableAI "MOVE";
    _ai3 enableAI "ANIM";
    _ai3 enableAI "FSM";
    _ai3 allowDammage true;
    _ai3 setCombatMode "RED";
    _ai3 setBehaviour "COMBAT";
    _ai3 setVariable ["AI",true,true];
     
     
    //Spawns a AI Vehicle
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    _veh = ObjNull;
    _veh = createVehicle["B_G_Offroad_01_armed_F", _safepos, [], 0, "NONE"];
    _veh setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _veh setVariable["LAST_CHECK",1000000000000];
    _veh setVehicleVarName "veh1"; veh1 = _veh; \\gave the vehicle a name so i can delete it. did this with both of em.
    //Moves 2 AI units into vehicle
    _ai moveInAny _veh;
    _ai1 moveInAny _veh;
    //So Vehicle doesnt despawn
    EPOCH_VehicleSlotsLimit = EPOCH_VehicleSlotsLimit + 1;
    EPOCH_VehicleSlots pushBack str(EPOCH_VehicleSlotsLimit);
    _slot = EPOCH_VehicleSlots select 0;
    _veh setVariable ['VEHICLE_SLOT',_slot,true];
    EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_slot];
    EPOCH_VehicleSlotCount = count EPOCH_VehicleSlots;
    publicVariable 'EPOCH_VehicleSlotCount';
    _veh call EPOCH_server_setVToken;
    //Creates vehicle inventory
    clearWeaponCargoGlobal    _veh;
    clearMagazineCargoGlobal  _veh;
    clearBackpackCargoGlobal  _veh;
    clearItemCargoGlobal       _veh;
     
     
    _safepos = [_pos,0,27,0,0,20,0] call BIS_fnc_findSafePos;
    _veh2 = ObjNull;
    _veh2 = createVehicle["B_G_Offroad_01_armed_F", _safepos, [], 0, "NONE"];
    _veh2 setVariable["LASTLOGOUT_EPOCH",1000000000000];
    _veh2 setVariable["LAST_CHECK",1000000000000];
    _veh2 setVehicleVarName "veh2"; veh2 = _veh2;
    _ai2 moveInAny _veh2;
    _ai3 moveInAny _veh2;
    EPOCH_VehicleSlotsLimit = EPOCH_VehicleSlotsLimit + 1;
    EPOCH_VehicleSlots pushBack str(EPOCH_VehicleSlotsLimit);
    _slot = EPOCH_VehicleSlots select 0;
    _veh2 setVariable ['VEHICLE_SLOT',_slot,true];
    EPOCH_VehicleSlots = EPOCH_VehicleSlots - [_slot];
    EPOCH_VehicleSlotCount = count EPOCH_VehicleSlots;
    publicVariable 'EPOCH_VehicleSlotCount';
    _veh2 call EPOCH_server_setVToken;
    clearWeaponCargoGlobal    _veh2;
    clearMagazineCargoGlobal  _veh2;
    clearBackpackCargoGlobal  _veh2;
    clearItemCargoGlobal       _veh2;

     

    delveh1.sqf is the delete vehicle type of script which is called at the end of the mission.

    {
    _x action ["Eject", veh1];
    } forEach crew veh1;
    deleteVehicle veh1;
    deleteVehicle ai1;
    deleteVehicle ai2;
     
    {
    _x action ["Eject", veh2];
    } forEach crew veh2;
    deleteVehicle veh2;
    deleteVehicle ai3;
    deleteVehicle ai4;

     

    these are basicly the files i have edited.

     

    regards,

    fly

  19. Server specs? Maybe a ram issue? not enough? low disc space? etc etc need more info to help. 

     

    You may have reached the vehicle limit. Delete a vehicle and see if you can spawn another. 

    aah thnx, well what info do you need.

     

    i run on a client pc just at home. i can give any amount of ram i have it on 4gb atm

    disk space is like 1tb.

     

    ill try the vehicle limit ^^ might be it was thinking about that aswell

×
×
  • Create New...