Jump to content

JacobJ

Member
  • Content Count

    308
  • Joined

  • Last visited

  • Medals

Posts posted by JacobJ


  1. hehe cool, didnt know that and I have def not 100 loops each second!!

    So all the scripts I want to be public/run on all clients, should start with if (!isServer) then { ??

    Can you explain the [] spawn { line? What does it do?

    ---------- Post added at 12:23 ---------- Previous post was at 11:53 ----------

    Now I have tried to do the thing you suggested, but now it will not load the ammobox into the heli1 (thats the one I have tried on):

    In the attach_ammoboxheli1.sqf:

    if (!isServer) then {
    
    // 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 {
    
    	removeW = execVM "removeActionW.sqf";
    	waitUntil {scriptDone removeW};
    
    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 (heli1 distance mhq1_ammobox < 16 and (!isEngineOn heli1) and (((getPosATL heli1) select 2) < 1)) then {
    
    	deletemarker "dropmark";		
    
    	// Attach the box to the MHQ roof.
    	mhq1_ammobox attachTo [heli1,[0,-0.2,0.4]];
    
    	removeW = execVM "removeActionW.sqf";
    	waitUntil {scriptDone removeW};
    
    
    
    // Change the action on the MHQ to unload the box now.
    
    [] spawn {
    	{heli1unload = heli1 addaction ["Unload ammobox from heli", "detach_ammoboxheli1.sqf"]} forEach allunits;
    
    	{dropbox1 = heli1 addaction ["Drop ammobox", "dropsupplyheli1.sqf"]} forEach allUnits;
    };
    
    } else {
    	// If the box isn't within 15m or the engine is running, tell them they have to try again.
    	hint "You must be on the ground, with your engine off, and within 15m of the ammo box to load it!";
    };
    };
    };

    Have I done something wrong with the command?


  2. Hey all

    I have a problem with removing the addactions that I place in objects on all clients. It works very well for the one that exec the addaction, but all others still have the same option alltho the crate is already loaded into that vehicle.

    Here is the code I have:

    In the init of my hummer:

    hum3load = hum3 addaction ["Load ammobox to hummer", "attach_ammoboxhum3.sqf"];

    In the attach_ammoboxhum3.sqf:

    // 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 {
    
    hum3 removeAction hum3load;
    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 (hum3 distance mhq1_ammobox < 16 and !isEngineOn hum3) then 
    {
    
    	deletemarker "dropmark";		
    
    	// Attach the box to the MHQ roof.
    	mhq1_ammobox attachTo [hum3,[0,-1.5,-0.5]];
    
    	removeW = execVM "removeActionW.sqf";
    	waitUntil {scriptDone removeW};
    
    
    	// Change the action on the MHQ to unload the box now.
    	hum3unload = hum3 addaction ["Unload ammobox from hummer", "detach_ammoboxhum3.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!";
    };
    };

    In the detach_ammoboxhum3.sqf

    // 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 {
    
    hum3 removeAction hum3load;
    hint "Nothing to unload!";
    
    } else {
    // Since it's alive, make sure the engine is off on the MHQ.
    if (!isEngineon hum3) then {
    
    	// Detach it, and move it 10m behind the MHQ, on the ground.
    	detach mhq1_ammobox;
    	_worldPos = hum3 modelToWorld [0,-5,0];
    	mhq1_ammobox setPos [_worldPos select 0, _worldPos select 1, 0];
    
    	hum3 removeAction hum3unload;
    
    	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!";
    };
    };

    In the addActionW.sqf:

    // 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"];

    In the removeactionW.sqf

    // Remove actions on WEST
    
    	heli1 removeAction heli1load;
    	heli2 removeAction heli2load;
    	heli3 removeAction heli3load;
    	heli4 removeAction heli4load;
    	Her1 removeAction her1load;		
    	hum1 removeAction hum1load;
    	hum2 removeAction hum2load;
    	hum3 removeAction hum3load;
    	truck1 removeAction truck1load;

    Why will the actions not disapear on all clients? Isnt that strange, now I havn't made anything _local.

    /Jacob

    ---------- Post added at 11:40 ---------- Previous post was at 11:24 ----------

    Would a ForEach command like this work:

    {heli1 removeaction heli1load} forEach allUnits;

    Would try, but I have heard it is not so good with so many forEach commands in a mission.


  3. Okay now I have another problem with this. I can get it all to work as it should, but I have another script I would like to override the time limit, but that I cant do somehow.

    Here is the script I would like to override the cntdown triggers timeout.

    Startgame.sqf:

    if (alive gate) then {
    
    	gate setPos [(getPos gate select 0),(getPos gate select 1),-10];
    
    	deleteMarker "respawn_west";
    	deleteMarker "respawn_east";
    
    	warlord globalChat "MISSION BEGINS!";
    
    	stang removeAction flash;
    
    	deleteVehicle gatedown;
    
    	cnttime = paramsarray select 3;
    	cntdown setTriggerTimeout [cnttime, cnttime, cnttime, true];
    
    };

    Here is what I have in the init.sqf:

    //Til Pre time
    _prepTime = paramsarray select 2;
    gatedown setTriggerTimeout [_prepTime, _prepTime, _prepTime, true];
    
    
    //Til timelimit
    cnttime = paramsarray select 3;
    cntdown setTriggerTimeout [(_prepTime + cnttime), (_prepTime + cnttime), (_prepTime + cnttime), true];

    It just won't let me override that time it gives in the ( )'s.

    What could be wrong?

    ---------- Post added at 19:25 ---------- Previous post was at 18:39 ----------

    I also have the problem, that my ammocrates give some weird numbers back after ive put them through this code:

    In init.sqf:

    //Til våben
    switch (paramsarray select 5) do {
     case 1: {ammoinbox1 = [mhq1_ammobox,"all","all",FALSE,15,50,15] execVM "crateFiller.sqf"; ammoinbox2 = [mhq1_ammobox1,"all","all",FALSE,15,50,15] execVM "crateFiller.sqf"};
     case 2: {ammoinbox1 = [mhq1_ammobox,"all","all",FALSE,5,12,10] execVM "crateFiller.sqf"; ammoinbox2 = [mhq1_ammobox1,"all","all",FALSE,5,12,10] execVM "crateFiller.sqf"};
     case 3: {ammoinbox1 = [mhq1_ammobox,"all","all",FALSE,1,12,5] execVM "crateFiller.sqf"; ammoinbox2 = [mhq1_ammobox1,"all","all",FALSE,1,12,5] execVM "crateFiller.sqf"};
     case 4: {ammoinbox1 = [mhq1_ammobox,"all","all",true,99,99,99] execVM "crateFiller.sqf"; ammoinbox2 = [mhq1_ammobox1,"all","all",true,99,99,99] execVM "crateFiller.sqf"};
    };

    In description.ext:

    class weapons 	{
    
    	title = "Number of Weapons/magazines/equiptment";
    	values[] = {1,2,3,4};
    	default = 1;
    	texts[] = {"15/50/15", "5/12/10", "1/12/5", "99/99/99"};
    	};

    It differs if I get the right number of weapons in the crate or if my testing parter gets the right number. If it doesnt give the right number it gives the defaultnumber 15/50/15 added with the number that isnt default.

    So if I choose 1/12/5 I get 16/62/20. Where could the problem be?


  4. Hey all

    I have a problem. Despide I have -world=empty in my shortcut to arma 2 OA, it still launches some war scenes in the menu's. Can I somehow force those off or have I done something wrong?

    Here is my whole shortcut-path:

    "C:\Program Files (x86)\Steam\steamapps\common\arma 2 operation arrowhead\ArmA2OA.exe" -world=empty -showscripterror -nosplash -winxp -cpucount=4 -maxmem=1500 -mod=@21VB-ACE-v2

    /Jacob


  5. Hello all

    I have made my own points/rating-system and I get an error when I load the mission. It says Preprocessor Error 7 with the point.sqs file.

    Here is my rating-system:

    #label
    _menW = count units group cmd1;
    _menE = count units group warlord;
    _tower = 0;
    _hummerdes = 0;
    _hummerres = 0;
    _cnt = 1000;
    
    if !(alive tower) then {_tower = 250};
    if !(alive hummer) then {_hummerdes = 100};
    if (triggerActivated humrescue) then {_hummerres = 250};
    
    _mst = (_cnt - ((10-_menW) * 100)) + ((10-_menE) * 50) + _hummerdes + _hummerres + _tower;
    
    hint str _mst;
    ~5;
    goto "label";

    What could be the problem? I can't see what could be wrong with my newbie-eyes...

    PS. The script works as it should in the preview in the editor.


  6. Hello all

    In my init.sqf I have this:

    //Til tiden
    skiptime (((paramsarray select 0) - daytime + 24) % 24);
    
    //Til vejret
    switch (paramsarray select 1) do {
     case 1: { 0 setOvercast 0; 0 setRain 0; 0 setFog 0 };
     case 2: { 0 setOvercast 1; 0 setRain 1; 0 setFog 0.2 };
     case 3: { 0 setOvercast 0.7; 0 setRain 0; 0 setFog 0 };
     case 4: { 0 setOvercast 0.7; 0 setRain 1; 0 setFog 0.7 };
    };
    
    //Til Pre time
    switch (paramsarray select 2) do {
     case 1: { gatedown setTriggerTimeout [1, 1, 1, true] };
     case 2: { gatedown setTriggerTimeout [1200, 1200, 1200, true] };
     case 3: { gatedown setTriggerTimeout [1800, 1800, 1800, true] };
     case 4: { gatedown setTriggerTimeout [2400, 2400, 2400, true] };
    };
    
    //Til timelimit
    switch (paramsarray select 3) do {
     case 1: { cntdown setTriggerTimeout [99999, 99999, 99999, true] };
     case 2: { cntdown setTriggerTimeout [1200, 1200, 1200, true] };
     case 3: { cntdown setTriggerTimeout [1800, 1800, 1800, true] };
     case 4: { cntdown setTriggerTimeout [2400, 2400, 2400, true] };
    };
    
    //Til Pointsystem
    switch (paramsarray select 4) do {
     case 1: { [] execVM "point.sqs"};
     case 2: {};
    };

    And in my description.ext I have this:

    class Params {
    
    class TimeOfDay {
    	title = "Time of day:";
    	values[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23};
    	default = 12; 
    	texts[] = {"00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00"};
    	};
    
    class Weather 	{
    
    	title = "Weather";
    	values[] = {1,2,3,4};
    	default = 1;
    	texts[] = {"Clear", "Stormy", "Cloudy", "Foggy"};
    	};
    
    class prepar	{
    
    	title = "Preparation time";
    	values[] = {1,2,3,4};
    	default = 2;
    	texts[] = {"none", "20min", "30min", "40min"};
    	};
    
    class cntdown	{
    
    	title = "Time limit after gamestart";
    	values[] = {1,2,3,4};
    	default = 1;
    	texts[] = {"none", "30min", "45min", "60min"};
    	};
    
    class pntsystem	{
    
    	title = "Point-system";
    	values[] = {1,2};
    	default = 2;
    	texts[] = {"On", "Off"};
    	};
    
    };

    As you can see I have both a preparation time and a timelimit on the map.

    How can I subtract the preparation time with the timelimit, so I get the correct timelimit after the game has started?

    /Jacob


  7. I don't I made myself clear (my english sucks bigtime, so bear with me).

    When I am a blufor soldier and run into the trigger the alarm sounds.

    When I am a opfor soldier and a blufor runs into the trigger, the alarm sounds by the blufor soldier, but not by me, the opfor soldier.

    Its like the alarmsound only gets put out to the playerside that activates it.

    It is a very bad alarm if the burgler can hear it, but the people owning the house can't..hehe


  8. I want to start spectating when you die in the mission. What do I do to make that so? I dont want to make it start when I call radio alpha.

    Maybe I was a bit unclear or maybe my english is a bit bad, so let me try other wise:

    I want to use the spectator to spectate when I die. I only want to spectate my own side's units. How do I do this?


  9. Hello all

    I can see that ace has a spectator script in it. How do I start this and make it work?

    I have looked at this, but it still is unclear to me, how to do it:

    http://ace.dev-heaven.net/wagn/Spectator+notes

    As I have understood it:

    1. I have to create the onPlayerRespawnAsSeagull.sqs and put it into my mission folder.

    2. Then I have to put this into the onPlayerRespawnAsSeagull.sqd:

    _this call ace_fnc_startSpectator;

    3. Then I have to add this to description.ext:

    respawn = "BIRD";

    And then it should work right? By me it doesnt seem to work, what have I done wrong?

    Where does this go and how to define what you are allowed to spectate and what not to?

    _unit setVariable ["ace_sys_spectator_exclude", true];

    /Jacob


  10. Okay, so far I have this and it works for running a script:

    disableSerialization;
    
    keyspressed = compile preprocessFile "wirecutter.sqf";
    _display = findDisplay 46;
    _display displaySetEventHandler ["MouseButtonDown","_this call keyspressed"];

    But as soon as I do anything else inside the last two "" it won't work. Maybe its my lag of knowledge about syntax, but I have seen others do it with success.

    If I want to change the "_this call keypressed" to a counterfunction that counts the number of times I press the key, how would I do that?

    I believe that I have to define a variable after the DisableSerialization; part like this:

    _numberOfCounts = 0

    Then I would need some way to get it to count

    _numberOfCounts = _numberOfCounts + 1

    And then maybe a If statement:

    (_numberOfCounts >= 20) and ("Ace_wirecutter" = currentWeapon player) then {fence setdamage 1};

    But how to put it all together I am a little lost I must say. Does it look totally wrong?

    ---------- Post added at 11:49 AM ---------- Previous post was at 10:32 AM ----------

    Okay now I have this and got the If command to work. But the counting part is still and issue. How to make a script count those mousebuttondown strokes..?

×