Jump to content

JacobJ

Member
  • Content Count

    308
  • Joined

  • Last visited

  • Medals

Posts posted by JacobJ


  1. Okay, not totally sure what I am doing, but this seems to work for getting the addaction at the hum1:

    SHK_loadAmmobox = {
     private ["_box","_veh"];
     _box = _this select 3;
     _veh = _this select 0;
     _box attachto [_veh,[0,-1.5,-0.5]];
     _veh setvariable ["SHK_Loaded",true,true];
    };
    SHK_unloadAmmobox = {
     private ["_box","_veh","_pos"];
     _veh = _this select 0;
     _box = _this select 3;
     detach _box;
     _pos = _veh modelToWorld [0,-5,0];
     _box setPos [_pos select 0, _pos select 1, 0];
     _veh setvariable ["SHK_Loaded",false,true];
    };
    
    hum1 setvariable ["SHK_Loaded",false];
    hum1 addaction ["Load box","action.sqf",[mhq1_ammobox,SHK_loadAmmobox],1,true,true,"","hum1 distance mhq1_ammobox < 16 && !isEngineOn hum1 && !(hum1 getvariable 'SHK_Loaded')"];
    hum1 addaction ["Unload box","action.sqf",[mhq1_ammobox,SHK_unloadAmmobox],1,true,true,"","!isEngineOn _target && (hum1 getvariable 'SHK_Loaded')"];

    ---------- Post added at 10:26 ---------- Previous post was at 10:20 ----------

    Okay now I got two hummers and I can load to them both. BUT if I load the box from hum1 and directly to hum2, then the menu at the hum1 (unload box) doesnt disapear. Do I have to change some variables to make this option on hum1 go away?


  2. Okay it does confuse me, but maybe I will understand it when working with it.

    I have a few questions to this:

    1. Will this work on all clients or do I still need the hum1jumbo trigger?

    2. Can I just switch the hum1 name with any other name and then change the attachTo position to use it on any other vehicle?

    3. If I want to go to the hum1 to load the box, what would I do? Just changing the mhq1_ammobox to hum1 in the second last line doesnt seem to work.


  3. Okay, I will try to put that in there. Do I have to make the trigger that waits for the hum1jumbo to become true, to a repeatable trigger?

    Here is the addActionW.sqf:

    if (!isServer) exitWith {};
    // Addactions again to WEST
    
    
    	// Add the action to load it again boat.
    	heli1load = heli1 addaction ["Load ammobox to heli", "attach_ammoboxheli1.sqf"];
    
    	// Add the action to load it again boat.
    	heli2load = heli2 addaction ["Load ammobox to heli", "attach_ammoboxheli2.sqf"];
    
    	// Add the action to load it again boat.
    	heli3load = heli3 addaction ["Load ammobox to heli", "attach_ammoboxheli3.sqf"];
    
    	// Add the action to load it again boat.
    	heli4load = heli4 addaction ["Load ammobox to heli", "attach_ammoboxheli4.sqf"];
    
    	// Add the action to load it again boat.
    	her1load = her1 addaction ["Load ammobox to hercules", "attach_ammoboxher1.sqf"];
    
    	// Add the action to load it again boat.
    	hum1load = hum1 addaction ["Load ammobox to hummer", "attach_ammoboxhum1.sqf"];
    
    	// Add the action to load it again boat.
    	hum2load = hum2 addaction ["Load ammobox to hummer", "attach_ammoboxhum2.sqf"];
    
    	// Add the action to load it again boat.
    	hum3load = hum3 addaction ["Load ammobox to hummer", "attach_ammoboxhum3.sqf"];
    
    	// Add the action to load it again boat.
    	truck1load = truck1 addaction ["Load ammobox to truck", "attach_ammoboxtruck1.sqf"];


  4. There is a spectating script but I can't get it to work properly. It will not let me cut of the possibility to exit the spectating mode and turn into a butterfly, but I will post as soon as I find out something.

    I thought of making the units respawn a different place where they were locked in and could fight each other untill the mission had been completed by one of the teams. That works very well and the dead people have something to do. But for real matches you are intereseted in how your mates do in the battle so you would rather spectate them.

    The preparationtime is important I think. If nothing is setup before the mission begins, then the opfor can prepare themselfs. This they can do by placing IEDs or get all players in position. The Blufor (in my mission) is locked in a hangar where they can not escape. The opfor can start the mission before the preparationtime has run out and then the timelimit starts (if it is selected).

    But yes, as you say, keep it simple and fast. I have one city with 3 objectives and you really dont need to solve the one of them to win.

    Why do you have 9 vs 7?


  5. Hello all

    I can only relate to counter-strike and how maps are made there, so this is how I think a 10on10 should be designed:

    1. Spectator-mode (spec side only, no butterfly, no spec exit).

    2. If you die, you die, no respawn (spectate only).

    3. No AI forces.

    4. Timelimit

    5. Preparationtime, before the match begins.

    Are there anything else to add?

    It would be nice to make a template with these settings and make this template the minimum requirements for 10on10, 5on5 matches and so on.


  6. Okay this doesnt work as suppossed to and I suspect my scripts are the problem.

    Here is how my setup is:

    1. I have a empty trigger, condition: hum1jumbo Act: nul = [] execVM "attach_ammoboxhum1";

    2. I have a hummer, which has this is the init line:

    this addAction ["Load box to hummer1", "load.sqf"];

    3. In my load.sqf I have this:

    hum1jumbo = true;
    publicVariable "hum1jumbo";

    4. In my attach_ammoboxhum1 I have this:

    if (!isServer) exitWith {};
    
    // If for some reason the ammo box is destroyed, don't try to load it and remove actions to load or unload.
    if (!alive mhq1_ammobox) then {
    
    hum1 removeAction hum1load;
    hint "Nothing to load!";
    
    } else {
    // Since the box is still in one piece, make sure it's within 15m of the MHQ and the MHQ isn't on.
    if (hum1 distance mhq1_ammobox < 16 and !isEngineOn hum1) then 
    {
    
    	deletemarker "dropmark";		
    
    	// Attach the box to the MHQ roof.
    	mhq1_ammobox attachTo [hum1,[0,-1.5,-0.5]];
    
    	removeW = execVM "removeActionW.sqf";
    	waitUntil {scriptDone removeW};
    
    	// Change the action on the MHQ to unload the box now.
    	hum1unload = hum1 addaction ["Unload ammobox from hummer", "detach_ammoboxhum1.sqf"];
    
    
    } else {
    	// If the box isn't within 15m or the engine is running, tell them they have to try again.
    	hint "You must be within 15m of the ammo box, with your engine off, to load it!";
    };
    };

    5. In my detach_ammoboxhum1 I have this:

    if (!isServer) exitWith {};
    // If for some reason the ammo box is destroyed, don't try to load it and remove actions to load or unload.
    if (!alive mhq1_ammobox) then {
    
    hum1 removeAction hum1unload;
    hint "Nothing to unload!";
    
    } else {
    // Since it's alive, make sure the engine is off on the MHQ.
    if (!isEngineon hum1) then {
    
    	// Detach it, and move it 10m behind the MHQ, on the ground.
    	detach mhq1_ammobox;
    	_worldPos = hum1 modelToWorld [0,-5,0];
    	mhq1_ammobox setPos [_worldPos select 0, _worldPos select 1, 0];
    
    	hum1 removeAction hum1unload;
    
    	addactionW = execVM "addActionW.sqf";
    	waitUntil {scriptDone addactionW};
    
    } else {
    	// If the engine was running, warn the user.
    	hint "You can't unload while your engine is running!";
    };
    };

    The first player that runs the load.sqf can use it like supposed. The one that tries afterwards can't. He gets the "Load ammobox to hummer1" but it won't do anything. When the ammobox is loaded to the hummer by the first guy the menu "Load ammobox to hummer1" doesnt desapear by the second guy, only by the first guy.

    What could be wrong with my scripts? I just can't see it...


  7. Okay Ive tried the code you have posted and I can't get it to work. Nothing happens. Ive changed the HMMWV_MK19 to HMMWV and ive changed player to ammobox, but it just won't load the box. What could I have done wrong?

    ---------- Post added at 10:38 ---------- Previous post was at 10:04 ----------

    Okay now I got it to work. But another problem came up. If you have two vehicles of the same type within the range of lets say 10 meters, then it isnt sure that the box will be loaded to the vehicle that you want it to. How can I somehow do that?

    Here is my code:

    _nearestCar = getPos ammobox nearestObject "car";
    
    if ((_nearestCar isKindOf "HMMWV") && ((ammobox distance _nearestCar) < 10) && (!isEngineOn _nearestCar)) then
    {
    ammobox attachTo [_nearestCar,[0,0,1]];
    
    } else {
    
    hint "You are too far away or your engine is running";
    
    };


  8. Hello

    I have this script and it works fine, but I would like to have one script for hummer, one for helicopters (kind 1), one for helicopters (kind 2), one for hercules plane and one for trucks. So instead of having many scripts I just have one script that works for all vehicles of the same kind.

    Here is the original code:

    // If for some reason the ammo box is destroyed, don't try to load it and remove actions to load or unload.
    if (!alive mhq1_ammobox) then {
    
    hum1 removeAction hum1load;
    hint "Nothing to load!";
    
    } else {
    // Since the box is still in one piece, make sure it's within 15m of the MHQ and the MHQ isn't on.
    if (hum1 distance mhq1_ammobox < 16 and !isEngineOn hum1) then 
    {
    
    	deletemarker "dropmark";		
    
    	// Attach the box to the MHQ roof.
    	mhq1_ammobox attachTo [hum1,[0,-1.5,-0.5]];
    
    	removeW = execVM "removeActionW.sqf";
    	waitUntil {scriptDone removeW};
    
    	// Change the action on the MHQ to unload the box now.
    	hum1unload = hum1 addaction ["Unload ammobox from hummer", "detach_ammoboxhum1.sqf"];
    
    
    } else {
    	// If the box isn't within 15m or the engine is running, tell them they have to try again.
    	hint "You must be within 15m of the ammo box, with your engine off, to load it!";
    };
    };

    I guess I would need something with nearest object and some kind of telling the script what vehicle the script works for. How would I do this?


  9. Okay that I didnt know. Thank you very much for this info.

    So i make a addaction, this calls a script only containing this for example:

    publicVariable "jumbo";

    Then I create an trigger/emptydetector, and in the conditions field I put jumbo. In the on Act I put: [] execVM "realscript.sqf";

    And the realscript must start with If (isServer) then {

    Have I understood you right?

    Do I still have to use the spawn command together with the forEach allUnits, or can I just use the codes I originally had, because the realscript now is a server script?

×