Jump to content
Alleged Accomplice

Alleged"s/Bailing_outs finds and stuff

Recommended Posts

Or am I just a moron? I thought that if I put something, such as player addction, in init.sqf it would show up in a the player scroll menu but it does not. In single player yes it does. Yes I know their is no player in multi. Tried it initplayerlocal, NO DICE. I used unit, had to define unit, tried to just use addaction with nothing in front of it, well then one of the games commands, addaction is not defined. Tried remotexe, I basically tried everything I could find. I searched here and the internet, maybe I used the wrong search terms but I found no way of adding addaction to the scroll.

Share this post


Link to post
Share on other sites

People here taught me A LOT regarding addAction, especially. It has that "Local Execution" characteristic, so it's kind of "exigent".
One of the best tips someone gave me for multiplayer is to try to add the action on the object and activating it by checking if the player is nearby.

As most of my scripts are related to give several different stuff to vehicles, what I do is:
1.) add a building called "workshop" in the editor.
2.) add the lines bellow in both initCommon.sqf and initPlayerLocal.sqf
 

workshop addAction ["<t color='#f0cc0f'>EXECUTE script</t>",
{
        [] spawn {
            execVM "code\scripts\myScriptForVehicle.sqf";
        };
}];

 Once the player gets close to the workshop, the addAction will appear and the script will search whether the nearby vehicle is one of the specified ones for changing.
But, as usual, I am pretty sure guys here have MUCH better solutions for multiplayer. I won't dig further into them because all my "experience" in MP is inside APEX/Invade & Annex framework, which deals with it in a quite different approach.

That also does the trick for giving the actions to the players themselves as well. So let's say I want a new action for any player, I can just ask for them to go to the workshop and execute different actions there to receive their benefits - just like a menu/index.

;;;;;;;;;;

Edit:
Maybe you find some better stuff in my other topic, regarding using addAction to board some mounted sentries on vehicles.
 



https://community.bistudio.com/wiki/addAction

Edited by JCataclisma

Share this post


Link to post
Share on other sites
1 hour ago, JCataclisma said:

People here taught me A LOT regarding addAction, especially. It has that "Local Execution" characteristic, so it's kind of "exigent".
One of the best tips someone gave me for multiplayer is to try to add the action on the object and activating it by checking if the player is nearby.

As most of my scripts are related to give several different stuff to vehicles, what I do is:
1.) add a building called "workshop" in the editor.
2.) add the lines bellow in both initCommon.sqf and initPlayerLocal.sqf
 


workshop addAction ["<t color='#f0cc0f'>EXECUTE script</t>",
{
        [] spawn {
            execVM "code\scripts\myScriptForVehicle.sqf";
        };
}];

 Once the player gets close to the workshop, the addAction will appear and the script will search whether the nearby vehicle is one of the specified ones for changing.
But, as usual, I am pretty sure guys here have MUCH better solutions for multiplayer. I won't dig further into them because all my "experience" in MP is inside APEX/Invade & Annex framework, which deals with it in a quite different approach.

That also does the trick for giving the actions to the players themselves as well. So let's say I want a new action for any player, I can just ask for them to go to the workshop and execute different actions there to receive their benefits - just like a menu/index.

;;;;;;;;;;

Edit:
Maybe you find some better stuff in my other topic, regarding using addAction to board some mounted sentries on vehicles.
 



https://community.bistudio.com/wiki/addAction

I suppose I could add it to a vehicle and set the range on the action to cover the map but you'd still have to be facing the vehicle at least if not see it. This is the start of another of my windmills to tilt at, this is just the beginning 😬

Share this post


Link to post
Share on other sites

Okay I put it in a huge trigger which fires, I added the sounds and I hear them and I put this in the activation [] remoteExecCall ["bomb.sqf;"]. I then added waitUntil { not isNull player }; into bombsqf, still nothing. Then waitUntil { not isNull player && hasInterface }; but nothing.

Oh the addaction is this, player addAction ["Arm With Carbomb", "carbomb2.sqf","", 0, false, true, "", "true", 5, false, "", ""];

 

Edit. When I go back to try again I will try the addMPEventHandler

Share this post


Link to post
Share on other sites

this addAction ["Say something",
    {
        { null = execVM "yourscriptname.sqf" } remoteExec ["call", 0];
        
    },
    nil,
    1.5,
    true,
    true,
    "",
    ""
];

 

Put in the init of the object.

  • Like 2

Share this post


Link to post
Share on other sites

"this" for testing in editor, but change for "_this" in MP.
If you're going to test with eventHandlers, you can even use other stuff, regarding the params, like eventually "_this # 0" for the caller, "_this # 2" for the target unite, and so on - it will change providing the chosen EH, of course.

Share this post


Link to post
Share on other sites
18 minutes ago, JCataclisma said:

"_this" in MP.

 

In an object's init, which is the context to which you replied, "_this' is meaningless.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, major-stiffy said:

this addAction ["Say something",
    {
        { null = execVM "yourscriptname.sqf" } remoteExec ["call", 0];
        
    },
    nil,
    1.5,
    true,
    true,
    "",
    ""
];

 

Put in the init of the object.

 

1 hour ago, JCataclisma said:

"this" for testing in editor, but change for "_this" in MP.
If you're going to test with eventHandlers, you can even use other stuff, regarding the params, like eventually "_this # 0" for the caller, "_this # 2" for the target unite, and so on - it will change providing the chosen EH, of course.

 

1 hour ago, Harzach said:

 

In an object's init, which is the context to which you replied, "_this' is meaningless.

Since in all my missions I chose from the respawn thing shown here https://steamcommunity.com/sharedfiles/filedetails/?id=1986342104     Theirs no init to put it into. I have tried to make an init on those but in 3 unlike 2 theirs no adding to those inits. I saw A2 had an init line in the configure respawn it had. I tried to add one to mine but I got nothing. When I read people longing for stuff from A2 I understand even though I never played it.

 

Right now I have paused my tilting at this windmill, I will continue soon enough.

  • Like 1

Share this post


Link to post
Share on other sites

this addAction ["Blah blah",                  // fine. will run on each server, and client. If no interface, for nuts, but that doesn't hurt
    {                // inside code
       params ["_target", "_caller", "_actionId", "_arguments"]; // for better to start like this
       Here, is a code which will run locally on caller's PC. So...

        For GA GE command(s) or function(s), no problem, you can run them straight.

          Example : _target setDamage 1; (_target doesn't have to be on caller's pc like AI units in player's group. Can be another player or unit on server)
        For LA GE command(s) or function(s), remoteExec them if needed, where the Argument(s) are local, example:

           _target addMagazine "30Rnd_556x45_STANAG";
           if _target is not local (player(s group for example): [_target, "30Rnd_556x45_STANAG"] remoteExec ["addMagazine",_target];
           the reason why addMagazineGlobal was created (GA GE)
        For all LE (local effect), choose where the code must run. Example:
           [_target, "Miller"] remoteExec ["setFace", 0, true];

        For SE (server execution), you need (except if you 're the player on hosted server, but are you?) to remoteExec from the server:

           [_target, false] remoteExec ["enableSimulationGlobal", 2];
    },
    nil,  // arguments if any, nil otherwise
    1.5,
    true,
    true,
    "",
    ""
];

 

On respawnable unit like players, always add the addAction on respawn code. Example:

 

MY_Action = ["blah", {code},nil,1.5,true,true,""];    // prepare the array.

in initPlayerLocal.sqf for example:
player addAction MY_action;   // set the addAction on player

addMissionEventHandler ["EntityRespawned", {
  params ["_newEntity", "_oldEntity"];
  if (isPlayer _newEntity && local _newEntity) then {_newEntity addAction MY_action};
  removeAllActions _oldEntity;
  }];

  • Thanks 1

Share this post


Link to post
Share on other sites

Okay, I've done something and have no idea why it works.

2 triggers trying to attain an addaction on the player all of the time. Which is what this thread started out as.

 

Trig1 condition (player distance thistrigger) < 1000000000000 // figured that would cover the map 😁

activation - player addAction ["set off bomb","carbomb12.sqf",nil,1,false, true, "true", "true", 3, false];

 

Works, until you die then you don't get it again.

So I messed around with removing the action, still no go so then I added 2nd trigger

 

trig1_1 condition --triggeractivated trig1 && alive player &&
(player distance thistrigger) < 1000000000000

 

I get the action everytime so I get suspicious, like I always do if I mange to make something work, and delete the first trigger and just use the 2nd minus the triggeractivated condition.

 

so condition ---- alive player &&
(player distance thistrigger) < 1000000000000

 

I accidentally got what I wanted. Works ever respawn.

 

If anyone thinks "why not make a huge trigger covering the map", cause that really lags the game out. For some reason that does not.

 

I ran it in the multiplayer hosted thing, just me, so I have no idea how it would work with more than one player or on dedicated. I set up a dedicated one time and I do not plan on doing it again for awhile. I only did that to prove to myself that all the crap I put into that scenario would work and it had a lot of crap in it but it all worked.

 

Now I have to add some other conditions so it only works on either players in a certain role or with certain equipment.

 

Thank you for joining me on my weird journey to wherever its going. The Razorback game is about to start so I'm done for the day.

Share this post


Link to post
Share on other sites

Why trig1 if you want to run a code anyway?

btw, (player distance thistrigger) < 1000000000000  ... means TRUE. You could write TRUE as well in condition field...

 

But forget useless triggers!

In initPlayerLocal.sqf  (best place in MP for player's code which can stay local for each player):

if (!isMultiplayer or roleDescription player in ["test1","test2",...]  or getPlayerUID player in ["45761298390638725","45761298390638726",...]) then {
  myAction = ["set off bomb","carbomb12.sqf",nil,1,false, true, "true", "true", 3, false];
  player addAction myAction;
  player addEventHandler ["Respawn",{
    params ["_unit","_corpse"];
    _unit addAction myAction;
    removeAllActions _corpse;
  }];
};

 

the condition is TRUE or SP session or specific roles (like test1, test2,... in role descriptions (doesn't work in SP))  or even some players' UID if you know them.

An addAction on player must be recalled in respawn event.

  • Like 2

Share this post


Link to post
Share on other sites

I will make something from what you posted Pierre I swear 😐. Right now I've change the trigger to call a script that adds the action which calls another script to do something that I haven't figured out how to do yet exactly. IT HAS NO ERRORS, but alas it does not work.

 

I don't know if I forgot or I just now found out that if you use the default backpack on someone like Explosive specialist the way I  select my loadouts pictured.

image.png

 

Well you can put whatever you want in that backpack but it is going to spawn with the default for the explosive specialist even though the loadout.cpp says different. So when you make them in the edit loadout its best to start off with the basic rifleman or maybe a survivor/unarmed soldier.

 

I forgot, when you copy it out of the edit loadout screen, it will add what you put but it will still copy out the default along with it and even if you edit it out, still spawns with it, so if you want something different you basically have to start with nothing.

Share this post


Link to post
Share on other sites

This is a fun one I have not seen here

https://steamcommunity.com/sharedfiles/filedetails/?id=2529689111&amp;tscn=1694731551

 

_fuelTank = (_this select 0);
waitUntil {(damage _fuelTank != 0)};

sleep 0.5;
bomb = "DemoCharge_Remote_Ammo_Scripted" createVehicle (_fuelTank modelToWorld [0,0,-0.5]); //SMALL: DemoCharge_Remote_Ammo_Scripted || HUGE: Bo_GBU12_LGB
bomb setDamage 1;
deleteVehicle _fuelTank;
"Land_HistoricalPlaneDebris_03_F" createVehicle (_fuelTank modelToWorld [0,0,0]);
"Land_HistoricalPlaneDebris_03_F" createVehicle (_fuelTank modelToWorld [0,0,0]);
"Land_HistoricalPlaneDebris_03_F" createVehicle (_fuelTank modelToWorld [0,0,0]);


private _posATL = _fuelTank modelToWorld [0,0,-0.5];

// Fire
private _ps0 = "#particlesource" createVehicleLocal _posATL;
_ps0 setParticleParams [
	["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 10, 32], "", "Billboard",
	0, 1, [0, 0, 0.25], [0, 0, 0.5], 1, 1, 0.9, 0.3, [1.5],
	[[1,1,1, 0.0], [1,1,1, 0.3], [1,1,1, 0.0]],
	[0.75], 0, 0, "", "", _ps0, rad -45];
_ps0 setParticleRandom [0.2, [1, 1, 0], [0.5, 0.5, 0], 0, 0.5, [0, 0, 0, 0], 0, 0];
_ps0 setDropInterval 0.03;

// Smoke part 1
private _ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [
	["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 7, 1], "", "Billboard",
	1, 10, [0, 0, 0.5], [0, 0, 2.9], 1, 1.275, 1, 0.066, [4, 5, 10, 10],
	[[0.3, 0.3, 0.3, 0.33], [0.4, 0.4, 0.4, 0.33], [0.2, 0.2, 0, 0]],
	[0, 1], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [0, 0, 0], [0.33, 0.33, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.05], 0, 0];
_ps1 setDropInterval 0.5;

// Smoke part 2
private _ps2 = "#particlesource" createVehicleLocal _posATL;
_ps2 setParticleParams [
	["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 9, 1], "", "Billboard",
	1, 15, [0, 0, 0.5], [0, 0, 2.9], 1, 1.275, 1, 0.066, [4, 5, 10, 10],
	[[0.1, 0.1, 0.1, 0.75], [0.4, 0.4, 0.4, 0.5], [1, 1, 1, 0.2]],
	[0], 1, 0, "", "", _ps2];
_ps2 setParticleRandom [0, [0, 0, 0], [0.5, 0.5, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.05], 0, 0];
_ps2 setDropInterval 0.25;

Put that into a a SQF file name it what you will and then put this in the init of any object, I mean any, doesn't have to be a fuel tank, hell I put it into an AI dude and blew him up 😁

[this] execVM "explodingTank.sqf";

Of course if you name the first file something else it will have to be changed to that.

I highly recommend changing this line waitUntil {(damage _fuelTank != 0)}; to waitUntil {(damage _fuelTank != .02)}; . Things tend to explode on spawn if not, for me anyway.

 

You can take out the debris but if you do the flames will not go out so I did this

_fuelTank = (_this select 0);
waitUntil {(damage _fuelTank > .02)};

sleep 0.5;
bomb = "R_80mm_HE" createVehicle (_fuelTank modelToWorld [0,0,-0.5]); //SMALL: 
bomb setDamage 1;
deleteVehicle _fuelTank;

"Land_penblack_F" createVehicle (_fuelTank modelToWorld [0,0,0]); // you won't find these pens LOL
"Land_penblack_F" createVehicle (_fuelTank modelToWorld [0,0,0]);
"Land_penblack_F" createVehicle (_fuelTank modelToWorld [0,0,0]);



private _posATL = _fuelTank modelToWorld [0,0,-0.5];

// Fire
private _ps0 = "#particlesource" createVehicleLocal _posATL;
_ps0 setParticleParams [
	["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 10, 32], "", "Billboard",
	0, 1, [0, 0, 0.25], [0, 0, 0.5], 1, 1, 0.9, 0.3, [1.5],
	[[1,1,1, 0.0], [1,1,1, 0.3], [1,1,1, 0.0]],
	[0.75], 0, 0, "", "", _ps0, rad -45];
_ps0 setParticleRandom [0.2, [1, 1, 0], [0.5, 0.5, 0], 0, 0.5, [0, 0, 0, 0], 0, 0];
_ps0 setDropInterval 0.03;

// Smoke part 1
private _ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [
	["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 7, 1], "", "Billboard",
	1, 10, [0, 0, 0.5], [0, 0, 2.9], 1, 1.275, 1, 0.066, [4, 5, 10, 10],
	[[0.3, 0.3, 0.3, 0.33], [0.4, 0.4, 0.4, 0.33], [0.2, 0.2, 0, 0]],
	[0, 1], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [0, 0, 0], [0.33, 0.33, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.05], 0, 0];
_ps1 setDropInterval 0.5;

// Smoke part 2
private _ps2 = "#particlesource" createVehicleLocal _posATL;
_ps2 setParticleParams [
	["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 9, 1], "", "Billboard",
	1, 15, [0, 0, 0.5], [0, 0, 2.9], 1, 1.275, 1, 0.066, [4, 5, 10, 10],
	[[0.1, 0.1, 0.1, 0.75], [0.4, 0.4, 0.4, 0.5], [1, 1, 1, 0.2]],
	[0], 1, 0, "", "", _ps2];
_ps2 setParticleRandom [0, [0, 0, 0], [0.5, 0.5, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.05], 0, 0];
_ps2 setDropInterval 0.25;

The fires go out this way with the pens as debris. Turn up the damage to .8 or .9 so that things just blow up when they are basically destroyed kinda like normal. I made different files for different things, this one is for an AI, used a smaller bomb.

 

Maybe take out some of the debris and make the fires/smoke last longer, I have no clue as to why the debris makes a difference with that. When you search the web for ARMA stuff you find many things.

  • Like 1

Share this post


Link to post
Share on other sites

I created a module for that 😉. Compatible with DLCs and mods (CUP maps for example). Blowing or putting fire on gas, fuel tanks, fuel services & reservoirs, map embedded or edited ones. The fire or explosion depends on caliber/charge you fire on them :

MGI Blast & fire

Documentation

Link

 

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites
10 hours ago, pierremgi said:

I created a module for that 😉. Compatible with DLCs and mods (CUP maps for example). Blowing or putting fire on gas, fuel tanks, fuel services & reservoirs, map embedded or edited ones. The fire or explosion depends on caliber/charge you fire on them :

MGI Blast & fire

Documentation

Link

 

 

 

I have all your stuff, I just thought that that one that guy made was funny cause it doesn't matter what you put it in. I think I am gonna made the debris trash or something like that for the AI, maybe a table ☺️. If 3 tables end up being where the AI was, I will try to make a video of it happening. I cannot post to the tube, for some unknown reason, it just won't let me but I will find a place.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×