#arma3_scripting

1 messages ยท Page 217 of 1

pallid palm
#

hell yeah Arma 3 ๐Ÿ™‚

thin fox
split tulip
#

This is what I ended up using, I didn't apply it to the radar but the physical launcher, this also works for AAA too

0 = [this] spawn {
params ["_radar"];
while {alive _radar} do {
private _targets = getSensorTargets _radar;
{
private _targetObj = _x select 0;
if (((getPosVisual _targetObj) select 2) < 50) then {
(group _radar) ignoreTarget [_targetObj, true];
_radar forgetTarget _targetObj;
_targetObj confirmSensorTarget [side _radar, false];
} else {
(group _radar) ignoreTarget [_targetObj, false];
(group _radar) reveal [_targetObj, 4];
};
} forEach _targets;
sleep 1;
};
};

blissful current
#

I'm trying to get respawnTemplates to EndMission once all player tickets have been used. But for some reason the players get stuck on the respawn screen with zero tickets, and yet, the end mission screen is never called.

#

The wiki says, "Automatically fail the mission when all respawn tickets are exceeded (for INSTANT and BASE respawn types with Tickets template)". I've met that criteria.

fair drum
faint burrow
blissful current
blissful current
#

Thanks, I will play around with this.

faint burrow
pallid palm
#

respawn system works Awsome imho

hallow mortar
#

Sometimes people need stuff that's different from what you need

pallid palm
#

yes but if your using respawn=3 which he is then well you know

fair drum
#

not helpful, and actually hurtful. does not answer the OP

blissful current
#

Nice, I went with this approach:

if ( _respawn_mode == 1 ) then { // 1 is global tickets
    if (_globalTickets != 0) then {   
        setPlayerRespawnTime _respawn_delay;
        //["Global Tickets used"] remoteExec ["systemChat", 0];
    } else {
        ["defeat", false, true, true, true] remoteExec ["VN_fnc_endMission"];
    };
};

Now is it possible to use a spectator cam while the respawn timer is counting down? That's my next task.

fair drum
#

vanilla or ace spectator?

#

original poster

blissful current
fair drum
#

i was mainly getting at the comment of "just use this, no need for other stuff", which puts him backwards than where he started

hallow mortar
#

Respawn templates have specific functionality. If someone's trying to use them, it's because they want that functionality. Your advice, to not use any of the templates or any replacement for their functionality, was basically "you could just not achieve what you're trying to achieve", which doesn't really help.
If you're going to try to help solve a problem, it's really important to understand what the problem is, and give advice that keeps that in mind.

#

If someone's asking for advice on how to fix their bike, "you should buy a truck" isn't a great answer

pallid palm
#

i was thinking the problem was what he said: the mission would not end

#

when the tickets run out

thin fox
#

I'm asking him

fair drum
#

he just needs to factor in locality of setPlayerRespawnTime. its local.

finite bone
#

if I want to reuse an existing A3 sound in CfgSounds, should I add in the \ prefix? Like if I want to declare a new name for the same sound (A3\Sounds_F\arsenal\explosives\shells\30mm40mm_shell_explosion_01.wss) should I add the \ as prefix ?

thin fox
#

I've never got this command to work, maybe I'm confusing with another command with similar name ๐Ÿค”

finite bone
fair drum
finite bone
#

I want to reuse the vanialla arma for explosion so either using the classname defined in the vanilla config (or) cloning (without required to extract that sound source alltoegther) would be nice

fair drum
#

CfgSounds in description.ext just extends CfgSounds in game. So you can just use the vanilla config name/values.

finite bone
#

Yea but I dont know the vanilla name for the sound though

fair drum
#

let me see if i can look it up

blissful current
fair drum
thin fox
blissful current
hallow mortar
#

If you want the mission to not end until all the players are dead, then checking to see if all the players are dead is kind of the only solution

blissful current
#

I could use allPlayers and findIf off the top of my head.

#

Oh but that might include Zeus. So maybe just check the group the players are in.

blissful current
#

Why does this return true when players are alive?

units playerGroup findIf { lifeState _x == "ALIVE" } == -1

The wiki says that findIf returns 0 on the first success. 0 isnt not the same as -1, so it should return false.

sly cape
blissful current
#

Oh, what is "0 based index"?

sly cape
blissful current
granite sky
#

You have the wrong lifeState value.

#

But you should use alive _x anyway, because otherwise you have to check both HEALTHY and INJURED

#

well, I guess if you're using a revive system then you'll have to use lifeState. But use the right values.

blissful current
granite sky
#

yeah.

blissful current
#

I want it to return true if there are no alive or incapacitated units.

granite sky
#

looks correct.

blissful current
#

Oh wait my thinking is flawed. I only want it to return true if all players are incapacited or not alive.

#

Right? I'm so confused.

sly cape
blissful current
#

Incapacitated counts as alive.

sly cape
granite sky
#

I want it to return true if there are no alive or incapacitated units.

sly cape
#

Yes?

blissful current
#

If all players are downed I want it to return true.

granite sky
#

That's different :/

sly cape
#

Do you want the current code to be true if any is alive or all dead?
I think it's currently if they're dead.

blissful current
#

Yeah I'm so confused. I want this mission to end when all the players are dead. But I can't check that only cause incapacitated doesn't mean dead.

blissful current
#

I can't just do !alive.

sly cape
#
(units playerGroup) findIf { alive _x && !(lifeState _x == "INCAPACITATED") } == -1;
```? Does it not work / follow [#arma3_scripting message](/guild/105462288051380224/channel/105462984087728128/)?
blissful current
#

Players can't spawn on incapacitated players IIRC.

granite sky
#

Is this sentence correct?
"I want it to return true if all units are dead or incapacitated".

blissful current
#

Yes it is. For some reason I thought it wasn't before. Now I think it is.

#

Lemme test it again.

sly cape
blissful current
#

First one I'm testing is this:

units playerGroup findIf { alive _x || lifeState _x == "INCAPACITATED" } == -1;

Returns false when the last unit is incapacitated. After they force respawn then it returns true.

#

Now I test the other.

#
(units playerGroup) findIf { alive _x && !(lifeState _x == "INCAPACITATED") } == -1;

Returns true when the last unit is incapacitated and after force respawning.

sly cape
#

Which do you want?

blissful current
#

Hmmm, great question, I was going to put this in onPlayerKilled. I guess I need to figure out what is more expect from players. To have the mission end as soon as it's impossible to continue, or wait for that last player to for respawn.

#

I guess it makes more sense to end it immediately. Which means I can't put this in onPlayerKilled anymore. I guess I need to put it in a trigger.

sly cape
#

I think it would be better to remove the incapacitated part altogether and allow the player to decide when to have the mission end. In that case, you could use it.

blissful current
#

Like, not have an end mission screen and have players figure it out for themselves that it's impossible to continue, when they discover they can't spawn on their incapacitated teammates?

sly cape
#

I mean that they decide by force respawning.

blissful current
#

I guess they could hit escape and return to the lobby, but I would be afraid of that situation looking like a bug or unintended.

blissful current
#

Yeah, cause if I end it immediately there's a chance that they might not understand why it ended abruptly and feel like they got cheated. If they force respawn and see it's impossible to continue then it feels more "fair" to them.

sly cape
#

They also would have the opportunity for the admin to cheat, spectate, etc. I don't like it when MP missions suddenly end literally the second I get shot.

blissful current
#

Agreed. My current version has players able to set difficulty with tickets. If they have infinite tickets then one of the failure states is what ya'll just helped me with.

#

Thanks for talking this out with me ya'll.

jade abyss
#

Anyone of you got that before in your .rpt:
Transfer of uninitialized variables is not supported
?

blissful current
#

Lol, players can respawn on incapacitated units. Back to the drawing board... (for if players have infinite tickets)

sly cape
#

I feel like infinite tickets just shouldn't be fail-able.

azure portal
#

Okie pokie, just a quick little info dump in-case it helps. Always a chance it won't, but might as well try to be helpful

Arma 3 has 6 life states:

  • HEALTHY
  • DEAD
  • DEAD-RESPAWN
  • DEAD-SWITCHING
  • INCAPACITATED
  • INJURED

Don't ask me what the respawn and switching ones mean because I have no idea and can only assume that it's to cover the bases for the respawn/revive mechanics.

Here's the fun part. Incapacitated has three sub-states, discovered with incapacitatedState:

  • UNCONSCIOUS
  • MOVING
  • SHOOTING

If you're using the default revive mechanic, it returns unconscious if you're awaiting revive, an empty string if you're alive or waiting for respawn (because that's not confusing), and can return shooting while unconscious anyways...so it's lots hella confusing and not worth using, but essentially incapacitated means ragdolled and just don't use incapacitatedState.

It's also worth noting that checking if people are alive comes with some interesting toggling behaviour with a respawn mechanic where it'll change depending on what stage of respawn they're in as well. So if you've got the default respawn/revive system working, it'll do the following as someone respawns
true -> false -> true -> false -> true. That doesn't make it a bad tool to use, just a behaviour worth knowing

blissful current
azure portal
analog mulch
#

hi
when using 3den enhanced, setting map markers alpha to 0 makes them invisible in the map, any option to have them visible during the mission making process?

pallid palm
#

oh w8 3den enhanced oh oops

#

i don't have 3den enhanced

#

all i know is this for my editor its

#
"markername" setMarkerAlpha 0; //no show  marker
"markername" setMarkerAlpha 1; //show  marker
#

i have the markers set to type mil_dot or empty

#

so i can see them when im building the mission

#

and the when the mission starts i do the other things

analog mulch
#

yeah i'm aware of setMarkeralpha 0/1
i just wanted the markers to be visible to me during the mission making for troubleshooting

indigo wolf
#

I create sound with playSound3D in the server but its not being broadcast - does it have to be created on a client?

analog mulch
#

no its on a dedicated muliplayer server

#

its for BGM

#

i've defined the classnames in the description.ext

class CfgMusic
{
    tracks[]={};
 
    
      class waramb1
    {
        name = "waramb1";
        sound[] = {"waramb1", 1,1};
        titles[] = {};
    };
      class waramb2
    {
        name = "waramb2";
        sound[] = {"waramb2", 1,1};
        titles[] = {};
};
finite bone
finite bone
fair drum
analog mulch
fair drum
earnest valve
#

Strange... but if the variables didn't initialize, then how would the .RPT know of that. ;)

#

But it sounds like more of a game issue. I've never come across it in my ArmA years.

blissful current
#

I've run into the issue that AI in my squad are not subject to the tickets from BIS_fnc_respawnTickets.

#

I've set the tickets like this:

[missionNamespace, _respawn_tickets] call BIS_fnc_respawnTickets;

And I tested killing my own group but the ticket count does not reduce.

fair drum
finite bone
tulip ridge
#

Yes

tender fossil
#
// Example 1
compile format ["PLAYER_%1_AFK", name player] = false;
// Example 2
if (compile format ["PLAYER_%1_AFK == true", name player]) then {
``` I'm having trouble understanding how `format` works with `compile`. Tried all kinds of combinations with no luck. Both examples above throw an error in the logs
granite sky
#

compile is just a command that takes a string and turns it into code.

#

How you build that string is up to you.

#

Both of your examples seem to have too little code in them.

tender fossil
#

Hmm? I just want to form a global variable name dynamically and e.g. assign value to it

granite sky
#

Well, this chunk is legitimate:
compile format ["PLAYER_%1_AFK == true", name player];

#

If you want to actually execute it then you'd need call on the front.

#

If all you're doing is setting a single global variable then the better way is missionNamespace setVariable [format ["PLAYER_%1_AFK", name player], true];

tender fossil
#

Ah ffs ๐Ÿ˜„ The mission is full of call compile stuff, should've realized that by now. And the missionNamespace too...

rough summit
#

Anybody know how i can add checkmark in structured text?

hint parseText format ["<t align='center' valign='middle' size='1' shadow='0'>&checkmark;</t>"];

This one don't work

granite sky
#

What's a checkmark?

tender fossil
#

Arma uses UTF-8 right?

granite sky
#

Generally unicode is only a problem if it's a character that would confuse the HTML parser.

rough summit
#

But...If u call hint parseText format ["<t align='center' valign='middle' size='1' shadow='0'>&lt;</t>"]; Unicode symbol appears

granite sky
#

Isn't that just a left angle bracket?

rough summit
granite sky
#

That one exists because otherwise < would be eaten by the HTML parser.

dusk gust
#

Hm

rough summit
dusk gust
#

Doesn't seem to be usable by Arma ยฏ_(ใƒ„)_/ยฏ

granite sky
#

Well, other issue is that the font needs to have it.

#

I assume Arma has a fallback font but it's not necessarily very complete.

#

Otherwise &#10003 should work.

rough summit
granite sky
#

yeah, probably not in the fonts then.

meager granite
#

What I usually do is create RscEdit with needed font, then paste there unicode characters found on the internet and see which ones show up

#

Then copy them, do toArray and use them as toString where needed

meager granite
#

Its not like you'll have it text selectable anyway

#
hint composeText [image "A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_checked_ca.paa", " ",image "A3\Ui_f\data\GUI\RscCommon\RscCheckBox\CheckBox_unchecked_ca.paa"];
#

vanilla checkboxes

#
hint composeText [image "\a3\3DEN\Data\Controls\ctrlCheckbox\textureChecked_ca.paa", " ",image "\a3\3DEN\Data\Controls\ctrlCheckbox\textureUnchecked_ca.paa"]; 
#

3DEN checkboxes with actual checkmark instead of square

pallid palm
#

hello all : where can i find a list of all the icon = ```sqf
"a3\Ui_f\data\GUI\Cfg\RespawnRoles\assault_ca.paa";

meager granite
pallid palm
#

oh no thats what i was thinking ๐Ÿ™‚

#

ok will do ๐Ÿ™‚

meager granite
#

There's just 3

pallid palm
#

oh ok cool

hallow mortar
#

This conversation has a list of directly relevant ones: #arma3_scripting message and there's an icon viewer script you can run from the debug console a little lower down

pallid palm
#

oh yes i remember that thx Nikko: right now i have all on the assult_ca.ppa

#

whick is ok i guess

#

and thx to you aswell @meager granite

haughty hare
#

is there a way to add tailhook from black wasp to any other flying vehicles?

still forum
#

@jade abyss sounds like publicVariable "idontexist";

split ruin
#

me too want to land with A-164 Wipeout on a carrier ๐Ÿ˜ญ

indigo wolf
#

Hello again for some reason playSound3D is not playing when created on the server (dedicated)

hallow mortar
indigo wolf
#

No I explicitly checked that

hallow mortar
#

Are you sure it's the command, and not that the script is not running/failing before it gets to the playSound3D?

#

Are you sure all the other parameters are correct (for example, the file path and the position)?

indigo wolf
#

When I use the same command to create it in LocalExec it works fine but serverExec does not

#

I am spawning the code from the initServer.sqf

indigo wolf
#
params [
    ["_markerName", "", [""]],
    ["_musicClass", "", [""]],
    ["_musicPos", [], [[]]],
    ["_textureObject", objNull, [objNull]],
    ["_sadTexture", "", [""]]
];

if (isNil "STOP_THE_DAMN_MUSIC") then {
    STOP_THE_DAMN_MUSIC = false;
    publicVariable "STOP_THE_DAMN_MUSIC";
};

uiSleep 1;

// Main music loop
while {!STOP_THE_DAMN_MUSIC} do {
    private _songSource = playSound3D [
        getMissionPath (_musicClass + ".ogg"),  // filename
        objNull,                                  // soundSource (objNull = purely positional)
        false,                                    // isInside
        _musicPos,                                // soundPosition (3D coords)
        10,                                       // volume (0-5 default, can go higher)
        1,                                        // soundPitch
        5000,                                     // distance (max range with automatic falloff)
        52,                                        // offset (start time)
        false                                     // local (false = broadcast to network)
    ];

    // Wait until sound finishes playing
    waitUntil {
        uiSleep 1;
        soundParams _songSource isEqualTo [] || STOP_THE_DAMN_MUSIC
    };

    // Exit if music was stopped
    if (STOP_THE_DAMN_MUSIC) exitWith {
        stopSound _songSource;
    };

    // Small delay before looping to prevent overlap
    uiSleep 1;
};

// Music stopped - change texture to sad Mariah
if (!isNull _textureObject) then {
    _textureObject setObjectTextureGlobal [0, _sadTexture];
};

Executed via sqf ["the_damn_song_range", "my_music", [3725.18, 15121.6, 0], static_sound_source, "img\sounds\sawd.paa"] spawn MYMOD_SAWD_fnc_musicPlayArea;

hallow mortar
#

I guess the questions that come to mind are "does that marker exist on the server" (i.e. wasn't created on a client using local marker commands only) and "is static_sound_source defined on the server" (not just does the object exist, but does the server know about the variable)

indigo wolf
#

Both are part of the mission file

hallow mortar
#

That's not the question

#

Also, this shouldn't stop it starting, but you're going to have trouble stopping the sound like that. The sound ID is per-machine and stopSound is Local Effect, so stopping the server's sound ID doesn't affect other machines.

indigo wolf
#

So what is the best way to create a single sound source that can be stopped basically?

hallow mortar
#

You could try createSoundSource. Or you could make playSound3D work locally, and use a system of functions to handle stopping it locally as well.

finite bone
#

Stupid questions but if I create a global variable and later the same is being broadcasted with a different value as "publicVariable" will my global variable also get affected by the change?

#

Like say in my local client, I have a variable EP_VARIABLE = true; and another client/server pushes EP_VARIABLE = false; publicVariable "EP_VARIABLE" I'm assuming mine is made to false as well

hallow mortar
#

Yes

#

publicVariable is just "make the global variable of this name contain this value on all machines"

#

unless your global variable is in a different namespace. publicVariable is only for missionNamespace, which is the default but not the only possible namespace.

pallid palm
#

its a beautiful Day in the Arma 3 Universe ๐Ÿ™‚

silent comet
#

Does BIS_fnc_holdActionAdd need to be executed for every client or does it work in a MP mission if it's ran only on the server?

silent comet
#

I see. Thanks

proven charm
#

so if you add it to client only that client has the action

sly cape
#

Put the code after the params line.
E.g.:

this addEventHandler ["Dammaged", {
    params ["_unit", "_hitSelection", "_damage", "_hitPartIndex", "_hitPoint", "_shooter", "_projectile"];
    
    deleteVehicle _unit;
}];

Would run deleteVehicle _unit;, where _unit is the unit being damaged, whenever this was "dammaged".

fair drum
#

event handlers are essentially an observer pattern. if you don't know what that is, its worth giving it a lookup as its used everywhere in the gaming industry and it helps save resources on loops, frame checks, and duplicate code.

sly cape
#

Does it really move next to the box? It looks like you're using the wrong position commands.
What's the null = part for?

#

You can just do 0 spawn {}.

#

Is the explosion underground?

hushed turtle
#

Strange usage of position commnads

sly cape
#

Why are you using the grass cutter and setting position at all if it's just one already determined bomb?

#

Does it work if you you remove the move part and just place it beforehand?

hushed turtle
#

Why do you need to move the bomb?

sly cape
hushed turtle
#

I have no idea what's easier about it

thin fox
hushed turtle
#

It's also strange to get position above first surface below and use that to set position above sea waves

split ruin
#

@burnt matrix where is this box?

radiant lark
#

[_this,"bis_fnc_curatorrespawn",false] call bis_fnc_mp;

is this the engine? it's on my mpeventhandler.log and I cannot locate it anywhere in my code

fair drum
#

and yeah, are you using a zeus unit that dies?

stiff valley
#

I need a sanity check, the AM7 marshal for
isKindOf would be an APC correct?

#

I modified a pilot WL script to move players outta the driver seat of heavy vics if they're not a crewman. Works great for tanks (isKindOf 'Tank') , but nothing else.

fair drum
#

right click on it and hit find in config, it will tell you the hierarchy

stiff valley
#

Forgot that was a thing, youre a genius

granite sky
#

Generally isKindOf "Tank" means it's a tracked vehicle.

#

There is not necessarily a good way to distinguish wheeled APCs.

stiff valley
#

Originally it was

((_QS_v2 isKindOf 'APC') || (_QS_v2 isKindOf 'Tank'))

#

I assumed APC was the proper class name, got so locked in forgot the config was even a thing haha

stiff valley
exotic flame
#

Is there a maximum length for ropes ?

#

I tried ropeCreate [veh1, [0, 0, 1], veh2, [0, 0, 0],5000] but the rope is only about 100m long

pallid palm
#

hello all: is there a better way to make this or is this ok

// if all West players and West playableUnits are Dead
if (({alive _x && side _x == west && isPlayer _x} count allUnits) == 0 &&
    ({alive _x && side _x == west} count playableUnits) == 0) exitWith {
    // my code here
};
sly cape
pallid palm
#

oh wow nice looks good

#

thx m8

#

looks faster then mine

old owl
#

Could be something wrong with this since trying to edit on my phone but building off of what Sticky Joe said

if (
    (((units west) + playableUnits)  findIf {side _x isEqualTo _x && {alive _x && isPlayer _x}}) == -1) exitWith {
    // my code here
};
sly cape
pallid palm
#

also looks good

old owl
#

Might also be better to use faction instead of side- iirc unconscious and dead units return civilian regardless of side. Might even be better command usage there I am not accounting for since I don't know much about AI

pallid palm
#

well i don't use the unconscious system so

old owl
#

There is a performance button in the debug console tho if you ever wanna run stuff to see it's speed ๐Ÿ™‚

pallid palm
#

ok cool

old owl
#

It should be next to all the execute buttons

pallid palm
#

where do you mean @rain void

old owl
#

He means instead of faction that I proposed- which he's correct there

rain void
pallid palm
#

so im not sure where in the code to put that

old owl
#

John Jordan may have told me that a while ago and I think I forgot lol. I don't think we do that many places in our mission so perhaps just remembering less ideal practices pepekek

pallid palm
#

all them ( ) get me cornfused ๐Ÿ™‚

#

does this look right

#
if (((side (group unit) + playableUnits) findIf {side _x isEqualTo _x &&
    {alive _x && isPlayer _x}} == -1)) exitWith {
    // my code here
};
```this looks better
pallid palm
#

oh shit ๐Ÿ™‚

#

ok i changed it how about now

old owl
#

side_x isEqualTo _x will always be true

#

Oh

sly cape
old owl
#

I screwed that up initially KEKW

tulip ridge
pallid palm
#

no one said that yet: and thx m8

#

now im really cornfused ๐Ÿ™

#

so where in the script do i put this side group _x

#

and what do i remove from the script

old owl
#

The units command I think returns inconsistent results when it comes to deaths or something iirc. I think he's suggesting using that in your findIf instead

sly cape
tulip ridge
pallid palm
#

can you show me the best way

sly cape
pallid palm
#

side like east west and so on

tulip ridge
#

Data type, there's like west/east/independent/civilian/maybe some more

#

Haven't tested this but I think he's wanting something like this?

private _playableUnits = playableUnits;
private _playableWestUnits = allUnits select { side group _x == west && { isPlayer _x || _x in _playableUnits } }; // isPlayer and in _playableUnits might be redundant, not sure
if (_playableWestUnits findIf { alive _x } == -1) exitWith {
    // Code to run when all units are dead
};
pallid palm
#

wow holy cow ๐Ÿ™‚

#

hmm i see

tulip ridge
#

Oh nvm that includes players from all sides

pallid palm
#

yes sir

#

its only for wast players theres no east players

tulip ridge
#

Yeah just edited it, should be good

pallid palm
#

cool thx alot guys really

tulip ridge
#

Might need parenthesis around the _playableWestUnits findIf { alive _x } in the if statement, not sure though and don't have arma open to confirm

pallid palm
#

copy that

old owl
#

Maybe this?

if ((allUnits + allDeadMen) findIf {
    side group _x == west && {alive _x && isPlayer _x}
} == -1) exitWith {
    // my code here
};
tulip ridge
#

Maybe
I'm not sure if the is player and playable units thing is redundant or not, never used it before

pallid palm
#

cool

#

wow that looks fast

tulip ridge
#

Why the allDeadMen?

#

You're checking if they're alive anyway

old owl
#

Yes

pallid palm
#

yeah i need to get all players from the west side and the playableunits from the west side: to check if they are alive

old owl
#

Could also probably remove the need for that and the isPlayer _x then. I only left the isPlayer as pretty sure allDeadMen does return ambient life. Which although I think should be of civilian side anyway so lazy eval probably would've caught that

#

Left the isPlayer here to be safe but with it not including agents I am assuming that it shouldn't be necessary?

if (allUnits findIf {
    side group _x == west && {alive _x && isPlayer _x}
} == -1) exitWith {
    // my code here
};
pallid palm
#

or check if they are dead i guess

#

yes that looks like it would work good: but i dont know much

#

i guess if we are using side group _x == west maybe we don't need to check if there's players maybe

#

hmmm i got to think about this hmmm

#

maybe i can just use playableunits are players the same as playableunits

tulip ridge
#

Well if you have AI automatically fill player slots then I assume they'd be in playableUnits but obviously not a player

pallid palm
#

so if a player takes over a Ai playableUnit: then is that unit no longer a playableUnit

tulip ridge
#

I assume player controlled ones would still be in it

Wouldn't really make sense if they're not

#

You can check in-game pretty easily, I just don't have arma open. You can just load in and check playableUnits and see what it outputs

pallid palm
#

ok will do this is very insteresting ๐Ÿ™‚

sharp grotto
#

Maybe

if({side group _x == west && isPlayer _x && alive _x} count allPlayers < 1) then {}; 

Or maybe

if({side group _x == west && alive _x} count playableUnits < 1) then {};
pallid palm
#

hmmm that look good too dam ๐Ÿ™‚

#

ill try that

tulip ridge
#

Should still be side group _x

pallid palm
#

ok will check it

sharp grotto
#

grpNull enters the room nootnoot
but yea, idk, just test it #arma

tulip ridge
#

If the group was somehow null you'd just get sideEmpty

#

side _unit will give you different results because of things like rating (e.g. a unit friendly fired enough to be a traitor), captive, etc.

pallid palm
#

i see

#

@sly cape so i tryed Sticky Joe's code: and it worked perfectly so now i try the next one ๐Ÿ™‚

#

im going to try all of you guys code and they may all work ๐Ÿ™‚

#

all this is for my Team Respawn script so its really importent ๐Ÿ™‚

#

most times we don't have the team Ai on: but if someone plays my mission them selfs in MP they may have Ai on for the team: so well you know i must account for that

#

for the team respawn script

#

if they chose to have Team Respawn on that is

granite sky
pallid palm
#

oh man all the code you guys gave works: ๐Ÿ™‚

#

i think im going to Stick with Sticky Joe's code its the easy-est for me to understand ๐Ÿ™‚

#

thx you all for helping me my Arma 3 friends:

tame coral
#

I'm having a hard time spawning a unit with the following code _unit = createUnit ["Soldier_ClassName", getPosATL aMarker, [], 0, "NONE"]; I'm not sure what i'm doing wrong. I just want a single instance of a unit to be spawned on a marker. can some one please help me out?

hallow mortar
#

For markers you need getMarkerPos. Markers aren't objects and you can't use object commands on them.

granite sky
#

createUnit needs a group as left-hand input.

tame coral
#

something like this? _unit = group player createUnit ["Soldier_ClassName", getMarkerPos aMarker, [], 0, "NONE"];

granite sky
#

Yes, but with a real classname.

tame coral
#

and how do I make it use a new group as a whole? i'm trying to spawn it in as a target dummy

granite sky
#

createGroup _side

tame coral
#

still does not appear to be working. _unit = createGroup _side createUnit ["B_Officer_F", getMarkerPos TargetSpawner0, [], 0, "NONE"]; no errors are being thrown up, I am trying to make this work through a trigger though.

#

or am I stupide and need the specify blufor or opfor?

granite sky
#

Yeah you didn't say what side or hint at it, so I just left it as a variable name.

tame coral
#

thank you, I appreciate all the help ๐Ÿ™‚
I should have thought a bit more about the _side section, thought it was a magic variable for a moment

#

though it is now throwing up errors

granite sky
#

Probably whatever you used getMarkerPos on isn't a marker.

tame coral
#

It is a destroy marker

#

As long as itโ€™s a type marker that shouldnโ€™t matter should it?

granite sky
#

Well, technically a marker in SQF is a string that names a marker.

tame coral
#

This is trying to run off a trigger

granite sky
#

I don't see what triggers have to do with this.

#

I would strongly recommend you test each bit of your code in the debug console, starting with the smallest pieces. Like type TargetSpawner0 into the debug console, hit run as local and see what it returns.

#

If that is indeed a valid variable, it'll return the marker name as a string.

#

If that's the actual marker name then it should have quotes around it.

#

I don't know whether it's a variable name or a marker name unless you screenshot the editor.

tame coral
#

TargetSpawner0 was the variable in the attributes of the marker

granite sky
#

Give me a minute to check what that looks like. I don't use the editor that much.

tame coral
#

actually I think i might be completely blind you said qoutes and I have not even done that my apologies

granite sky
#

Yeah it says "variable name" in eden but it's not a variable name :P

tame coral
#

okay that worked, I am so sorry that took as long as it did

granite sky
#

It's the marker name.

tame coral
#

thank you so much for your help ๐Ÿ™‚

exotic flame
granite sky
#

I suppose you could string them together with helper objects but that's a horrible idea

charred monolith
#

Hi ! Is there a way to disabled the camera shake in the map while moving ?
I've tried this :

resetCamShake;
enableCamShake false;

But I don't think it's related at all.

warm hedge
#

They are not related commands at all

#

Map shake is not even a vanilla feature so you must look for Mod that does it, maybe ACE

charred monolith
#

It's not a vanilla feature ? Damn I play to much with mod.

I'll look from ace's side thanks !

pallid palm
#

because there is no other players or playableUnits on the map
i went with this: Thx guys for the help it all works Awsome now

if ( ((units west) findIf {alive _x && isPlayer _x} == -1) &&
    (playableUnits findIf {alive _x} == -1) ) exitWith {
    // my code here
};
```thx to   @ Dart    @ Sticky Joe  &   @ Milo
#

lol the enemy were kicking my ass cuz i was missing shots on them: so i tried to run them over with a hunter and they shot me with a RPG right in the front of the hunter: and i flew out of the hunter: and i went flying like 10 feet in the Air: as i was going into Spectating mode: lol it was Awsome funny ๐Ÿ™‚

#

lol i was upside down flipping over it was funny lol ๐Ÿ™‚

#

dam my enemy are set to be really good it was a Awsome fight ๐Ÿ™‚

#

i had Team Respawn on and all my Ai guys died on the 1st group of enemy ๐Ÿ™‚

#

but i was the 1st one to die ๐Ÿ™

#

so i could see the Team Respawn work correctly

#

and it did woohoo

#

i love Team Respawn its so much fun

#

when you get KIA you always say (shit dam) lol ๐Ÿ™‚

#

and then w8 till the other players die ๐Ÿ™‚

#

but most time we are nice and the last guys will KIA them self's so we can all Respawn

#

So much fun

pallid palm
#

i will edit the (Team Respawn script) when its PvP mode ๐Ÿ™‚

#

are we even allowed to have this much fun in a game ๐Ÿ™‚

#

thank god i don't use any mods sep for terrains
Arma 3 works So Awsome that way ๐Ÿ™‚

#

well i guess you could say i mod the enemy i guess

#

but that's just though scripting: i don't really consider that a mod

pallid palm
#

i think Lou is like that aswell ๐Ÿ™‚ don't use any mods

split ruin
#

I revived old foggy breath script and its working perfectly, the only problem is there is no fog if the players is moving ๐Ÿคท

private ["_unit"];
_unit = _this select 0;
_int = _this select 1; 

while {alive _unit} do 
{
  sleep (2 + random 2); 
  _source = "logic" createVehicleLocal (getpos _unit);
  _fog = "#particlesource" createVehicleLocal getpos _source;
  _fog setParticleParams       [["\A3\data_f\ParticleEffects\Universal\Universal", 16, 12, 13,0],
"","Billboard",0.5,0.5,[0,0,0],[0, 0.2, -0.2],1, 1.275,    1, 0.2,[0, 0.2,0],[[1,1,1, _int], [1,1,1, 0.01], [1,1,1, 0]],[1000],1,0.04,"","",_source];
  _fog setParticleRandom [2, [0, 0, 0], [0.25, 0.25, 0.25], 0, 0.5, [0, 0, 0, 0.1], 0, 0, 10];
  _fog setDropInterval 0.001;
  _source attachto [_unit,[0,0.10,0], "neck"]; 
  sleep 0.5; 
  deletevehicle _source;
};

probably attached breath doesn't move with player ?

pallid palm
#

ahh i see hmmm

hallow mortar
pallid palm
#

i have a old fsm fog system script that i would like to get working

hallow mortar
#

You could do some maths on the starting velocity so it inherits some of the source unit's velocity, but it would look weird if it was rigidly attached to the unit's movement.

split ruin
#

I mean when player is running there is no visible fog
I am bad with reality but I think there should be fog coming out and going to the side (depend wind I guess)

#

@pallid palm that would be great

pallid palm
#

yes im trying to look at your script and may mach it up to the fsm i have

#

cuz i think this fog system was for A2

split ruin
#

I changed the path for the particle effects and its working for a3 now

pallid palm
#

yes im looking at that

#

but well you know im not that good ๐Ÿ™‚

hallow mortar
split ruin
#

yeah, I suspected that, then everything is good I guess meowfacepalm
I just tested moving backwards, the fog is there ๐Ÿฅณ

pallid palm
#

Oh Shit it works WOW Awsome cool ๐Ÿ™‚

#

Woohoo

#

i can't believe it ๐Ÿ™‚

#

i guess i got luckey ๐Ÿ™‚

#

this is the execFSM line ๐Ÿ™‚

["l1",150,11,10,3,9,-0.3,0.1,0.5,1,1,1,13,12,15,true,.5,2.1,0.1,4,6,0,3.5,17.5] execFSM "Fog.fsm";
#

its Awsome WoW

split ruin
#

@pallid palm whats in fog.fsm ?

pallid palm
#

@split ruin can i send it to you

#

its there ๐Ÿ™‚

lime owl
#

Hey friends. I'm experiencing a possible scripting issue that only rears its head in multiplayer. Is this the correct place to look for help?

lime owl
#

Is there a known multiplayer work around for "createVehicle"? In SP it works perfectly and the Helo spawns and carries on, but when it's executed on a nitrado server, it immediately explodes.

old owl
#

What server host you use shouldn't make a difference

lime owl
old owl
lime owl
old owl
#

!sqf

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“ turns into โ†“

// your code here
hint "good!";
old owl
#

If you could format with the above would help

lime owl
#
_heli = createVehicle [ "RHS_UH1Y_UNARMED", 

[9162.07,9407.33,0]//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ACTION A

,[], 0, "FLY" ];

_heliCrew = createVehicleCrew _heli;

sleep 1;

[_heliCrew, getPosATL helipad, _heli] spawn BIS_fnc_wpLand;

WaitUntil {sleep 1; _aliveUnits = (units (group player)) select {alive _x};

({_x in _heli} count _aliveUnits) == (count _aliveUnits)};

sleep 2;

_heliCrew addWaypoint [

[10528.1,8573.36,0]//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ACTION B

,1];

sleep 10;

"end1" call BIS_fnc_endMission;
old owl
#

Are you getting any script errors? Your waitUntil isn't returning a bool

#

Oh wait I'm sorry

sly cape
lime owl
#

Spawns in the air

lime owl
old owl
lime owl
# sly cape Spawns where?

At the defined location, in this example [9162.07,9407.33,0], but 50 meters or so in the air not at "0"

lime owl
old owl
#

Could also try to createVehicle from a different position like [0,0,1000] then setPosATL/setPosASL after spawning too and that may also reduce collision issues if that's the problem maybe?

#

Between those two I feel like one of those (or both) have ought to fix it. Shouldn't really be a reason something immediately explodes with createVehicle unless instigated by some sort of collision

lime owl
#

Well with the disableCollisionWith, I think my first try is going to protect it from the creation of the helicrew...since that function needs an object to pair with.

sly cape
lime owl
sly cape
sharp grotto
hallow mortar
#

Where are you executing the code?
If it's only in MP, my immediate suspicion is that the code is running on multiple machines, creating multiple copies of the helicopter in the same position and causing them to immediately clip with each other and explode

lime owl
#

Ok. So createVehicle and BIS_fnc_spawnVehicle both result in an explosion....

I have discovered that it is spawning two helos and that's why it's exploding....

hallow mortar
#

Probably if isServer check to make it only run on the server, or if it's in a trigger and the trigger conditions are suitable, make the trigger server-only. But it depends on the context and where you're running the code.

lime owl
#

WR_WPL = execVM "WR_HELI_SPAWN_LAND_V4.sqf";

#

Let me try server only and report

lime owl
pallid palm
#
if (!isServer) exitWith {}; this ensures Only the Server Runs the script
```Meaning if its Not the Server  then exit With Nothing
old owl
#

Or alternatively !isDedicated if you run your mission as player hosted too catnod

spiral trench
#

So I was perusing BIS_fnc_reviveSetHelper and noticed setVariable can be used as follows

#

object setVariable ["name","value",[owner object1,owner object2]]

#

Holy shit, I had no idea...

hallow mortar
old owl
pallid palm
hallow mortar
pallid palm
#

i think you ment this Milo

#
if (!isDedicated) exitWith {}; this ensures Only the Server Runs the script
old owl
#

That is what I meant but @hallow mortar is still correct there- it would exitWith for him during a player hosted mission which would go against what I was intending

#

Would probably just rather be:

if (isServer && !hasInterface) exitWith {};

That's what we do, but we also don't use an HC so I was trying to account for that

pallid palm
#

well the player host is the server in a hosted mission

#

i found out that the player in a hosted Mission: is 3 things at the same time ๐Ÿ™‚

#

dam now i forget what them 3 are lol ๐Ÿ™‚

#

the host player in a hosted mission is the Server and Local Player and umm i forget the other

lime owl
#

It's a dedicated server. And it's spawning 2 helo's.

pallid palm
#

how is that posiable

old owl
#

I think probably because the script was being spawned globally

lime owl
#

createVehicle and BIS_fnc_spawnVehicle both result in an explosion both spawning two helos. but only BIS spawns one when repeating after the first fail

pallid palm
#

put this at the top of the script

#
if (!isServer) exitWith {}; this ensures Only the Server Runs the script
```Meaning if its Not the Server  then exit With Nothing
old owl
#

Really just depends on the context of where that script is being ran. Ideally though should just be ran on server

hallow mortar
#

I'm not really sure what you're trying to achieve.
if isServer works fine for ensuring only one machine runs the code, provided the code is run on the server at all (which it appears it is), and will work fine in player-hosted too.

hallow mortar
old owl
#

I mean if you do if isServer exitWith {} on server in a player hosted mission, that's gonna break it's functionality since player is server in that instance

pallid palm
#

hes on dedicated server

hallow mortar
#

Using if isServer exitWith{}; would be wrong on both DS and player-hosted, because it would only exclude one machine, allowing the code to run on every other machine. It wouldn't break the code, but it wouldn't solve the issue of duplicate copies running.

old owl
#

Yeah. Which I guess really is more the issue then anything else. Better to fix whatever is causing that unintended execution then add a check.

hallow mortar
#

* actually it would break the code in SP or in player-hosted MP with only the host playing

hallow mortar
pallid palm
#

@lime owl can we see your fixed code now

hallow mortar
#

Using a server-only trigger, as I mentioned earlier, could be another way, but a) it's essentially not very different and b) it depends on whether the trigger's conditions allow it actually if the conditions mattered, this probably wouldn't be an issue, because only a client would be triggering it anyway

old owl
pallid palm
#

is there a chopper with the same var name on the map: i guess that can't be cuz it would tho an erra

hallow mortar
# old owl I mean using an `exitWith` just prevents the script from running. It sounds like...

It was described as being executed with execVM from a trigger. Triggers that are not server-only exist separately on each machine. Each trigger copy will locally execute its own copy of the script. It doesn't inherently broadcast anything.
Using a server-only trigger would ensure the trigger exists only on the server, and so only the server's copy of the script is executed. Using an isServer check of some type in the script would mean every machine does execute the script, but it simply exits immediately on clients. A server-only trigger is therefore very slightly better, though not by enough to matter.

pallid palm
#

@lime owl can we see your fixed code now

#

and can you tell us where and how you are exec-ing that script

lime owl
# pallid palm <@228303458581741568> can we see your fixed code now
private _result = [[11187.1,10260.6,0], 225, "RHS_UH1Y_UNARMED", west] call BIS_fnc_spawnVehicle;

private _heli = _result select 0;
_result params ["_vehicle", "_crew", "_group"];

_heliCrew = createVehicleCrew _heli;

sleep 1;

[_heliCrew, getPosATL helipad, _heli] spawn BIS_fnc_wpLand;

WaitUntil {sleep 1; _aliveUnits = (units (group player)) select {alive _x};

({_x in _heli} count _aliveUnits) == (count _aliveUnits)};

sleep 2;

_heliCrew addWaypoint [

[10528.1,8573.36,0]//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ACTION B

,1];

sleep 10;

"end1" call BIS_fnc_endMission;```
#

This one spawns two helos on the first call. Then only one every subsequent call.

pallid palm
#

your still missing this at the top of the script

#
if (!isServer) exitWith {}; this ensures Only the Server Runs the script
```Meaning if its Not the Server  then exit With Nothing
lime owl
#

I was able to select Server Only. Isn't that the same thing?

pallid palm
#

well i would put that at the top of the script anyway

#

oh yeah:
i finaly got my remove partial magazines Script to work
oh Hell yeah woohoo

#

the script fills your mag in your weapon to full: so it dont get removed: and then looks to the rest of your ammo and removes all partial magazines: and also shows a hint of how many partial magazines were removed ๐Ÿ™‚

#

i may change some suff after i save it im not sure yet ๐Ÿ™‚

lime owl
#

NO EXPLOSION!

pallid palm
#

wooohooo hell yeah

lime owl
#

wow.

#

well done sir.

pallid palm
#

Awsome m8

#

thx m8: i just helped a little: all them other guys did all the hard work

#

i'm so happy its fixed m8:

lime owl
#

Now to find some testers ๐Ÿ˜‰

pallid palm
#

it will work good now m8

azure portal
#

Okay...I've got a peculiar issue that I'd love some help with. I've got a script that runs in the postInit of a unit, which we'll call Script #1, that unit gets created by another script, Script #2 and then control of it gets passed over to a player a couple lines further down in Script #2. Somehow, during all of that, Script #1 seems to run a number of times, which seems to fluctuate depending on the number of players on the server, leading me to believe that it's some kind of an issue with locality, so is there a way that I can prevent that from happening?

pallid palm
#

posinit of a unit im not sure what that is

azure portal
#

Script #1 in the class eventHandlers of the unit

postInit = "[(_this select 0),'SOR_Weap_INF_BR',['prpl_8Rnd_12Gauge_Slug'],'','','',''] call WKB_CreateWeaponSecond_Scripted;";

Script #2

_current = player;
_replacement = group player createUnit [_selClass, position player, [], 0, "CAN_COLLIDE"];
sleep 0.005;
selectPlayer _replacement;
deleteVehicle _current;
azure portal
pallid palm
#

hmmm this seems out of my knowledge limit

#

im just not sure why your going though all that just to make a unit

#

but i don't know much tho

azure portal
#

It's essentially part of a class selection system so the player can change their own class. I wouldn't consider it a perfect system but it's the best way I've figured out to do it

pallid palm
#

you made this config for a unit ?

azure portal
#

That Script #1 comes from? Yeah

pallid palm
#

i see hmmmm

#

its kinda funny to me: like strange i mean cuz when i want to make units i just spawn them with 1 script

#

but like i said i don't know much

azure portal
#

Well Script #2 does the spawning, Script #1 is just to give them a second primary weapon so that they can fulfill their role as a breacher

pallid palm
#

i see hmmm

azure portal
#

But Script #1 fires multiple times, which I believe is a locality problem, but I can't figure out how to fix that

pallid palm
#

im not sure but maybe you need somthing like this in the script

private _unit = player;
// Ensure the _unit object is valid and local
if ((isNull _unit) or { !(local _unit) }) exitWith {};
#

but like i said im not sure

#

or maby a waitUnil the player unit is alive

#

seems to me like the script keeps running till it finds all the players maybe: i'm not sure or something like that

#

im not so good at this: im just trying to give you some ideas ok m8

azure portal
#

I appreciate the effort, it's a particularly perplexing issue

pallid palm
#

yes i see im kinda stumped: i hope a real good guy replys to help ๐Ÿ™‚

#

so you say this script gives you the chose of diff kinds of units seems cool

#

oh i was just thinking if i want diff kinds of units i just spawn a diff loadout on them :

#

like i have soldiers and medics and RPG guys and so on

azure portal
#

Which is what I'd do too, except when you reset a loadout on a unit, it resets the loadout to that of the unit class, not what was spawned, so on the off chance that something goes wrong later down the line then it wouldn't be as easy of a fix

#

And it'd also be more involved with having to change medic/engineer traits, etc

#

At-least in my case

pallid palm
#

i see hmmm interesting

#

i make 10 player missions only and i have 2 medics on the map at the start and they have a medic loadouts at start: but they can chose any of the loadouts i have added in the box if they want so they can chose to be medic or any

#

same for all the rest of the soldiers on the map ๐Ÿ™‚

#

sep for all can't be a medic as it were : only them 2 can be medics

#

then i have a healing system that only the medics can fully heal all: or of cores the med tent can also full heal

#

so if no one choses Medic loadout: to be medic: you will have to go back to the med tent ๐Ÿ™‚

azure portal
#

Sounds like an interesting time ๐Ÿ™‚

pallid palm
#

it is: it puts great importance on the medic

#

and if we play team respawn then its really Awsome ๐Ÿ™‚

#

so if you get hit in my missions you go into shock: and you can hardly move: or fight: so you need a medic real bad ๐Ÿ™‚

#

when you get hit i increase the weapon sway to max and the fatig to max: its Awsome ๐Ÿ™‚

#

you can hardly do anything like in real life: is so much fun

#

you can fix your self a little bit: but not much: you need a medic real bad ๐Ÿ™‚

#

plus your guy is saying ahhhhhh and stuff like that ๐Ÿ™‚

azure portal
#

Sounds pretty cool to me

pallid palm
#

yes sir its fun as heaver: it all seems like real life in my missions ๐Ÿ™‚

#

well that's what i try to do anyway

#

the healing system is that selfheal thing in the wiki: it was broke before but now it works Woohhooo

#

i wish i could help you more m8: but i just don't know enough

#

i'm still learning

#

and will be for the rest of my life ๐Ÿ™‚

azure portal
#

Nothing wrong with learning, and it's all good. It took me writing a replacement of Script #1 in Script #2 in order for me to remember that the entire reason it's in the postInit to begin with is in-case someone spawns it as an AI

pallid palm
#

lol yup it seems cool: what your trying to do: oh cool POLPOX is here to help: he's good

warm hedge
azure portal
broken forge
#

Just a little tease of a framework I've been working on for a while^

granite sky
azure portal
granite sky
#

It's pretty rare for that to be true, unless you're just counting to a public variable or something.

#

But in that case isServer would be better :P

#

Normally local is better, because a lot of commands you'd want to run on a new vehicle would need to be local.

azure portal
#

Well worst case I do some troubleshooting and see what works and what doesn't, locality just gives me a headache sometimes xD

azure portal
#

Okay, it works and throws an error at the same time, so that's fun

#

Can someone tell me if I'm blind and what would be triggering an error for a missing closing bracket?

if (isServer) then {
   [(_this select 0),'SOR_Weap_INF_BR',['prpl_8Rnd_12Gauge_Slug'],'','','',''] call WKB_CreateWeaponSecond_Scripted;
};
granite sky
#

Paste the error. It tells you more than that.

azure portal
#

Disregard, the black error flash on-screen showed the script for the second weapon but it was actually whining about a script for unitInsignia

#

Which is only made funnier by the fact that it said a missing closing bracket when there was a missing comma

tender fossil
#

Is there any replacement for sqfbin where I could post a bit longer scripts?

#

I'm trying to modify existing script in Arma 2: CO so that player's units (both infantry and vehicles) would start blinking on map when they open fire. I've got the player themselves blinking now. But I don't think the current approach of spawning a thread for every blinking unit would be a good idea; maybe I should add them to (and remove them from) some (global?) array that a blinking script goes through. But I'm a bit worried about concurrent modifications there

mortal folio
#

is there "force freelook" command for players? i tried running lookAt with a pfh but it doesn't seem to work

tender fossil
#

It's sloppy code (and Discord's formatting made it even worse) but it works, although only the player's marker blinks currently.

// updateTeamsMarkers.sqf
// ...
if (player == leader _x) then {
  _marker setMarkerDirLocal (getDir (vehicle player));
  _last = leader _x getVariable "WASP_LastFiredTime";
                
  if (!isNil "_last") then {                
    _shouldBlink = ((time - _last) <= 10);                    
    _h = _x getVariable "WASP_BlinkHandle";
  
    if (_shouldBlink) then {

      if (isNil { _h }) then {  
        _h = [leader _x, _marker] spawn {
        _u = _this select 0;
        _m = _this select 1;
                                  
        while { alive _u && ((time - (_u getVariable "WASP_LastFiredTime")) <= 10) } do {
          _m setMarkerColorLocal "ColorRed";
          sleep 1;
          _m setMarkerColorLocal "ColorOrange";
          sleep 1;
        };
  
        if (alive _u) then { 
          _m setMarkerColorLocal "ColorOrange";
        };
  
        _u setVariable ["WASP_BlinkHandle", nil];
      };
  
        _x setVariable ["WASP_BlinkHandle", _h];
      };
  
    } else {
  
      if (!isNil { _h }) then {
        terminate _h;
        _x setVariable ["WASP_BlinkHandle", nil];
      };
  
      _marker setMarkerColorLocal "ColorOrange";
      };
                      
    };
  
  };

  _count = _count + 1;

} forEach clientTeams;
``` The "Fired" event handler gets added to units like this:
```sqf
// Init_Unit.sqf
// ...
_unit addEventHandler ["Fired", {
  _u = _this select 0;                 // unit that fired
  _u setVariable ["WASP_LastFiredTime", time, true];
}];
#

But yeah, I don't think adding a new virtual thread for every unit would make much sense, as we're talking about maybe, hmm, something like 100-200 units visible on the map at the same time in populated match

#

So that's why I was thinking of an array that the blinking script would go through

pallid palm
#

umm you know the BIS_fnc_EGSpectator has a blinking effect: when shooting maybe you could have a look at that: and get some idaes

errant jasper
# tender fossil So that's why I was thinking of an array that the blinking script would go throu...

Have the event handler set the countdown on a hashmap. Use _key = hashValue _unit, so for example:
WASP_LastFiredTime set [_key, 10] if 10 is the total time. It can also create a local marker, but otherwise you can just store the name of a local hidden marker on the unit.
Then run a single script that loops through them (forEach with _x and _y. It checks how much time as passed, and decrements the countdown. Then the countdown <0 it deleteAt thems. Otherwise you can either toggle, or so some math on the countdown to pick a color. It hardly matters here but if you are worried about concurrent modifications then wrap the relevant part in isNil { ... }.

tender fossil
thin fox
old owl
#

Hahaha was just gonna say that

#

Was just typing that

#

Man that Arma 2 crosshair throws me back to when I used to play multiplayer Operation Arrowhead as a kid w_sadcat

tender fossil
# thin fox I miss A2

Been playing it in multiplayer to this date ๐Ÿ˜„ Miss Life servers the most though

thin fox
#

so nostalgic

errant jasper
# tender fossil A2 doesn't support hashmaps unfortunately

My bad, you actually wrote that, but I forgot when I noticed I was in arma3_scripting...
Well you can do the same, by manually replicating a hashmap as key and value arrays. The annoying part if you want SP compatibility is netId cannot be used as id.
If you use CBA I think they still have most things covered for Arma 2.

tender fossil
tender fossil
#

Although there might be a possible issue in multiplayer... AFAIK time is not synchronized between clients in A2, so I guess it could break the system completely. I can think of mostly setVariable with global flag set or setting time with publicVariable from server to clients with short enough intervals

errant jasper
#

What? Surely you are running this locally on each machine ?

tender fossil
#

But if the timestamp gets set by the client that owns the units? Or should I just keep it completely client side including the EHs

errant jasper
#

Yeah I would keep it completely client side.

#

Only thing is Fired may not fire if the unit is out of range, but if you literally can't see the unit firing is the marker update then strictly required?

tender fossil
#

Yes, it would be required. It's kind of the point of the system: to be able to see spotted enemy activity by taking a look at the whole map at once ๐Ÿ˜…

#

Hmm

errant jasper
#

Shooting = spotted activity?
Anyway, you would want some decent intervals, then. Like 10s and then some "throttling" logic so that you only send an update if more than say, half was passed (e.g. 5s), so you don't spam the network because someone held down the trigger.

tender fossil
tender fossil
errant jasper
#

In that case, the best thing might be just to run the EH serverside-only, yeah and send out the updates.
Clock "sync" was a bi*** in A2, don't remember if it got fixed near the end, but just send the "refresh" signal and let each machine draw 10 long from receipt or refresh.

#

Yeah, worse case someone gets the message 2s later when their game resyncs and thus 2s later "map marker" than others, but if their connection is that bad, that probably won't help them anyway ๐Ÿ˜…

tender fossil
#

Yeah the markers are not time critical, a few seconds here and there is fine

queen cargo
spiral trench
#

I would but, unless I'm missing something, I can't create a wiki account...

sullen marsh
#

Wanted to start with Intercept but was waiting for the documentation?

#

Alpha documentation is out

harsh bloom
#

Has anyone a good method of killing infantry and ground vehicles outside a defined playable space?
I would like to kill them without killing aircraft.

#

Issue is on some maps those triggers would have to be utterly colossal or some troll might just fly outside it and do stuff out there.
Like at the moment i have four triggers that just kills anything that enters. But i would prefer if jets and the like could still do their thing.

#

But the trigger still needs to be massive to cover everything outside the play space right?

#

what about hills?

#

Thats a lot of triggers then to cover the hills and valleys. Or if its just 10ft above a mountain thats a still a huge kill zone.

#

Wouldnt it be better to just have a "kill everything outside x trigger" script? With a single trigger containing the play space

tulip ridge
#

What do you think +weapons _x; +magazines _x; +[_vehicle]; is doing?

#

It doesn't do anything

#

Just the deleteVehicle is fine, those extra bits do nothing

cobalt path
#

Is it possible to transition time very quickly. Like accelerate time command just faster, like going from 12am to 12pm in a few seconds without obvious "skip"

proven charm
cobalt path
#

ye I guess, but this makes it too obvious...oh wait

#

smooth time transition

#

I see, just need to figure out how to make it do it tot specific time

proven charm
cobalt path
#

smth like, not sure if this will work, but I will see

while {dayTime<16} do
{
    skipTime 0.00333;
    sleep 0.1;
};
ivory lake
#

potentially can use this and then set it back to normal

cobalt path
#

Interesting

while {dayTime<23} do 
{ 
    skipTime 0.3; 
    sleep 0.1; 
};
``` doesnt work, I get 
"Error suspending not allowed in this context", even tho
```sqf
while {true} do
{
    skipTime 0.00333;
    sleep 0.1; // smooth time transition
};
``` is literally in BI wiki
proven charm
#

you have to spawn

warm hedge
cobalt path
#

Thanks, its perfect

little raptor
dawn thunder
#

I have noticed that only AI wearing wetsuit uniforms will properly pathfind across bodies of water, like a river. I want to give this ability to all units, without making everyone wear wetsuits. I cannot find anything about this online, and the wetsuit Cfg looks ordinary. What makes wetsuits special that allows the AI to pathfind across water? How can I add this magic to a script that allows all AI to pathfind across water?

proven charm
dawn thunder
#

I have tested this. Only the uniform is needed to get them to properly pathfind over rivers and such. Tested with vanilla wetsuits and SOG PF BDU uniforms.

#

My question is more related to the AI pathfinding, than their particular swim mechanics.

proven charm
#

yeah i know

dawn thunder
#

Maybe the engine does a terrain height test. if the unit's head gets submerged, and isAbleToBreathe is false, the pathfinding returns false. I will test this.

jolly sierra
#

is there any way to attach EH "Assembled" to a backpack spawned on ground? On our server we have a system which limits the max amount of darters which can be "built" in factory, let's say 3. But players can cheese this by buying 3, then disassembling one or more, buying more again to fill the limit, but then you can assemble it from the backpack which you have, making it 4 out of 3 limited.

I managed to add "Disassembled" EH to every darter bought, and then "Assembled" to the bag which spawns when it's disassembled again. But the issue is:

  1. Player tries to assemble a darter
  2. System detects limit, so destroys the darter
  3. System places a new darter backpack on ground so player doesn't loose it
  4. Since attaching EH "Assembled" to that backpack doesn't work for some reason, player can pick it up again, and deploy it without issue
#

this is never executed

jolly sierra
#

And I already figured that part out

faint burrow
jolly sierra
#

But backpack cannot be disassembled?

#

Only assembled

dawn thunder
#

Sometimes AI does swim without a wetsuit, but it takes much longer for them to decide to do so, and their pathfinding is wonkier (they zig-zag, and stop as if undecided).

faint burrow
jolly sierra
proven charm
#

zig-zag is known bug with water movement

#

ive seen it with vehicles

jolly sierra
#

yeah its for vehicles too

jolly sierra
#

well this doesn't work

#

same behavios as when EH was "Assembled", so no reaction

faint burrow
jolly sierra
#
17:55:15 2cd7c7b2080# 1818339: uav_backpack_f.p3d B_UAV_01_backpack_F
17:55:15 "B_UAV_01_backpack_F"

cursorObject says:

2cd7c7b3580# 1818340: dummyweapon.p3d GroundWeaponHolder

#

I think this is literally impossible to code, only solution is to refund player cash, and kill the drone

granite sky
jolly sierra
#

uhhh so I need to figure out how to attach EH to the weapon holder, not to the backpack?

granite sky
#

I don't know. I haven't read the whole backlog.

proven charm
#

saw vehicle doing zig zag like from one island to another

granite sky
#

This is WeaponAssembled and WeaponDisassembled though? I don't know why you'd be adding those to either a backpack or a ground holder.

jolly sierra
#

I am using Assembled and Disassembled

#

and I need it only for darters

#

/other portable UAVs

#

no

granite sky
#

Not sure how that would work. IIRC Assembled doesn't fire on the first assembly because the object doesn't exist yet.

jolly sierra
#

yeah that's the issue

#

that's why it works 1 time only

#

since then I cannot attach "Assembled" EH to the backpack on ground since no object was created before

#

nor Arma 3 has a function to force disassembly of a unit afaik

#

this works cause the EH is nested

#

but yeah I guess it's just impossible to do

granite sky
#

Why not use WeaponAssembled?

#

Like that would actually catch everything at least.

jolly sierra
#

will it fire for darter too?

#

it's not a weapon?

granite sky
#

Assuming it's done via the vanilla assembly mechanic then it should.

jolly sierra
#

yeah it's vanilla assembly

granite sky
#

Oh yeah you could probably fudge the new-assembly case with EntityCreated if you have every other case working already.

#

but WeaponAssembled seems like the better bet because it tells you where the backpacks were.

jolly sierra
#

I'll try it

harsh vine
#
player addEventHandler ["WeaponAssembled", {
params ["_unit", "_weapon", "_primaryBag", "_secondaryBag"];

    if (UAV_count >= UAV_limit) then {
       
        _unit action ["Disassemble",_weapon];
        playSound 'AddItemFailed';
        ["You've reached the maximum number of UAVs allowed."] spawn BIS_fnc_WL2_smoothText;

    };
}];    
tulip ridge
#

Prefix your global variables

jolly sierra
#

ill figure out the rest. Thanks!

modern osprey
#

Help me figure out the HandleDamage.
I put an event in the editor on the bot and shoot it in the head, I get _hitPoint == "hithead".

I do the same thing in multiplayer with the player, and _hitPoint == "".

How can I get the limb that was hit?

proven charm
#

where you run the player HandleDamage from?

granite sky
#

How can I get the limb that was hit?
Do you really need to know? Because that's a hard problem in Arma.

#

Since 2.16 the _context parameter was added and in theory you can do it. But it requires collecting all the hitpoint damage values and then checking which one is largest.

modern osprey
granite sky
#

No.

meager granite
#

If you need it reliably, you can check in HitPart added to the target

#

No way to get how much damage you dealt though, not in MP at least

granite sky
#

For HandleDamage I'd recommend that you add diag_logs that include the part, damage and context values and see what it's doing.

#

It's a target-local EH though, so you also need to deal with that in MP. The context 3/4 cases don't turn up in the same order IIRC, although you want to discard those anyway.

#

In theory context 2 might be the last value from a single hit but I haven't tested it.

meager granite
#

The issue with using HD to figure out which part was hit is the damage, doesn't it just clamp it to 1 so if you hit already destroyed part you'd get old damage=1 and new damage=1 so no damage even though you hit that part?

granite sky
#

My old examples here aren't clamped.

#

I think it clamps afterwards.

meager granite
#

Oh yeah, they aren't

#

Still, its not 100% reliable as you might get more damage to unarmored part when hitting an armored part

granite sky
#

You do have to deal with shit like this too:

21:34:12 "hithead damage 2.64637"
21:34:12 " damage 1.01"
21:34:12 " damage 1.01"
21:34:12 "hitface damage 0.197448"
21:34:12 "hitneck damage 2.64637"
21:34:12 "hithead damage 2.64637"
21:34:12 "hitchest damage 2.64637"
hushed turtle
#

Last hit has context value 2

meager granite
#

But I guess its easier than HitPart on target or projectiles

drowsy geyser
#

i use setDriveOnPath command to make a vehicle drive on a path is there a way to make him ignore any objects or player on this path and strictly stick to the path?

granite sky
#

You can reverse the armour calc but that is also quite tricky.

modern osprey
granite sky
#

See my example. I think that was neck hit that also hits the chest.

hallow mortar
#

Hits can do collateral damage to adjacent selections

hushed turtle
#

For whatever reason hitting one part with bullet causes damage to other parts as well

granite sky
#

On top of that you have aggregated hitpoints and.. that one, eyah.

#

You can see the collateral damage easily if you shoot people with 50cal.

meager granite
#

Yeah you'll need to account for depends in hitparts too

drowsy geyser
drowsy geyser
#

guys i have set my keyframe animation but when i create a vehicle midmission and do this the created car dosent follow the path

0 spawn
{
    private _vehicles = selectRandom
    [
        "C_Offroad_01_F",
        "C_Offroad_01_covered_F",
        "C_Hatchback_01_F",
        "C_Offroad_02_unarmed_F",
        "C_SUV_01_F"
    ];
    private _car = _vehicles createVehicle [0,0,0];
    private _driver = createAgent ["C_man_1_1_F", [0,0,0], [], 0, "CAN_COLLIDE"];

    waitUntil {!isNull _car && !isNull _driver};

    _car allowDamage false;
    _driver allowDamage false;

    _driver moveInDriver _car;

    _car setVehicleLock "LOCKED";
    _car lockInventory true;

    _car setPosATL [4969.97,4194.14,0];
    _car setDir 270;

    _car synchronizeObjectsAdd [a1];//rich curve module
};
#

in the editor it works ofcourse

drowsy geyser
#

ended up using BIS_fnc_unitCapture/BIS_fnc_unitPlay turned out to be pretty reliable ๐Ÿ™‚

tender fossil
#

Note: Arma 2: CO! Is my array push somehow wrong? ```sqf
private ["_unit", "_unitMarker", "_markerColor"];

_unit = _this select 0;
_unitMarker = _this select 1;
_markerColor = getMarkerColor _unitMarker;

if (side _unit == side player) then {
if (side _unit == west) then {
ARRAY_UNITS_FIRING_WEST = [ARRAY_UNITS_FIRING_WEST, [_unit, _unitMarker, _markerColor]] call BIS_fnc_arrayPush;
} else {
if (side _unit == east) then {
ARRAY_UNITS_FIRING_EAST = [ARRAY_UNITS_FIRING_EAST, [_unit, _unitMarker, _markerColor]] call BIS_fnc_arrayPush;
};
};
};

diag_log "ARRAY_UNITS_FIRING_WEST:";
{
diag_log format ["Unit: %1, Marker: %2", _x select 0, _x select 1];
} forEach ARRAY_UNITS_FIRING_WEST;

diag_log "ARRAY_UNITS_FIRING_EAST:";
{
diag_log format ["Unit: %1, Marker: %2", _x select 0, _x select 1];
} forEach ARRAY_UNITS_FIRING_EAST;

proven charm
#

the arrays could be nil

tender fossil
#

They are initialized at game start in Init_CommonConstants.sqf: ```sqf
//--- Player marker flashing in combat.
ARRAY_UNITS_FIRING_WEST = [];
ARRAY_UNITS_FIRING_EAST = [];
FIRING_UNIT_BLINK_TIME = 1;

proven charm
#

ok and the script runs after that?

tender fossil
#

Yeah

proven charm
#

hmm

tender fossil
#

Wait a sec, I think I spotted something that's wrong

faint burrow
#

Use side (group _unit) and playerSide. Also you don't need to reassign to ARRAY_UNITS_FIRING_XXX.

old owl
# tender fossil Note: **Arma 2: CO**! Is my array push somehow wrong? ```sqf private ["_unit", "...

Honestly extremely unfamiliar with Arma 2 scripting so take this all with a grain of salt, relating a lot of this to my knowledge and existing documentation in A3 which may not translate. In Arma 3 object init event handlers are ran very early on in initialization. If you're using an event handler and it is being ran before Init_CommonConstants.sqf, then both of those variables would be nil which is what it seems to look like.

No idea what initialization order looks like in Arma 2 and couldn't find any documentation on it but kind of just relating it to this A3 documentation here:
https://community.bistudio.com/wiki/Initialisation_Order

In my eyes no other reason why ARRAY_UNITS_FIRING_<SIDE> should not be returning results from your diag_log.

faint burrow
#

I think if ARRAY_UNITS_FIRING_XXX were nils, there would be error about this when using forEach.
The issue is most likely that ARRAY_UNITS_FIRING_XXX aren't being populated.

proven charm
#

like if you run ```sqf
{} foreach nil

old owl
#

That's what my thinking was as well. Just reproduced in A3- no idea though if that would behave differently in A2

#

I presume it's the same though. I could be totally butchering this but I think in A3 when a script is done it implicitly ends with nil which is how the script knows when to end. Not sure how then diag_log continues to run, and perhaps I am misinformed how this works engine wise- but I think how it was explained to me at some point

hushed turtle
#
createSimpleObject ["a3\vegetation_f_enoch\tree\t_piceaabiesnativitatis_2s.p3d", getPosWorld player vectorAdd [0,0,7.6]];
#

๐ŸŽ„

little raptor
little raptor
little raptor
faint burrow
proven charm
proven charm
#

where you run that?

#

the .paa?

#

wrong path then

#

you have to know the path

granite sky
#

This also won't generate an error:

_arr = [nil];
_var = _arr#0;

But this will:

_arr = [nil];
_arr params ["_nope"];
_var = _nope;
proven charm
#

oh interesting. maybe i mixed something up because nulls also cause silent fails. like ```sqf
Alive objNull

granite sky
#

Well, in unscheduled the dereferences don't throw either. Which is a pain when you typo a function name.

proven charm
#

lot of different behaviours ๐Ÿ™‚

granite sky
#

The objNull cases are often very useful but they're not documented :/

#

Like objNull distance2d _whatever is always 1e10;

proven charm
#

yeah instead of writing !isnull _obj && alive _obj you can just write alive _obj

old owl
#

Gotta love classic [nil] # 0. I've probably fixed at least a dozen undefined variable script errors due to other people in our code base using [] as a default prior to selection tweaking_cat

granite sky
#

weirdest one there is that [] # 0 quietly returns nil but [] # 1 throws. At least that one's the same in unscheduled. Also IIRC that's actually documented.

old owl
#

I think it's because in the case of [] # 0 the length of [] is 0 so it's not out of bounds. Makes sense it doesn't zero divisor but definitely does my head in sometimes lol. Like in some cases if it'd have just zero divisor on the spot it would've saved me so much time in stack trace digging w_sadcat haha

timber shore
#

yo simple question, if a server script creates an object at a markert, ie. POTATO = "bla" createVehicle getMarkerPos _marker; can a client script destroy iit via deleteVehicle POTATO; ?

lean ice
#

Hello everyone. I have a server only for me and my friends. Is there a script already written that automaticly generates "random" mission. Like it select a mission (destroy convoy, liberate city, etc.) from a panel already written where I only have to add cords for each missions ? If it exist from open source does someone know where I can find it ?
I don't want to be annoying or anything else.
Thank you for reading, happy holidays ! ๐Ÿ™‚

thin fox
#

available in the steam workshop

faint burrow
#

Or Dynamic Combat Ops.

split ruin
#

@lean ice I hope its not MCC4 ๐Ÿคฎ

lean ice
#

No no I'm really looking for a script like I see on some servers. (I guess it's scripts) ๐Ÿ™‚ Thanks for the suggestions I'll look it

split ruin
#

you are asking about mission, a mission consist of different scripts

lean ice
#

But in my scenario, it's really basics like I put spawn, virtual arsenal, virtual garage and the rest I have to spawn with it or zeus. Can't I put a script that is already configure and take a mission from multiples ready missions on random coordonates and start a new everytime a mission is ended ?

split ruin
#

virtual garage does not work in MP ...

lean ice
#

Sorry if it's not understable, I'm level zero on this type of stuff

#

It work pretty well on my server

split ruin
#

basically i am making such mission, yopu have base, arsenal and you can start random mission type

#

but is not finished

#

if its vanilla virtual garage, your players wont even see the vehicle you make there

lean ice
#

Oh okok, I don't want to steal anything, I was just wondering if it already exist in free access

split ruin
#

why you don just make a mission on the go with Zeus?

#

if you sqf knowledge is limited, this is the way to go

lean ice
#

I used this if I remember to put virtual garage :

this addAction ["Open Garage", {
_pos = player getPos [20,getDir player];
BIS_fnc_garage_center = createVehicle ["Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE"];
["Open", true] call BIS_fnc_garage;}];

lean ice
split ruin
#

everything you make in the virtual garage is visible only to you

split ruin
lean ice
#

Oh that wasn't that script

lean ice
split ruin
#

BI made virtual garage only to test vehicles, it spawns vehicle on the players machine aka local only

lean ice
#

oh

split ruin
#

I will throw give you building vehicles script, you just have to change the classnames, prices are in score points but you can delete this part if you want free vehicles, you want it ?

lean ice
#

Yes with pleasure ! Thank you very much

#

You can throw it

split ruin
#

I send it with PM

#

with this script you can paradrop vehicles too, in case you don't want to drive 2hours with a tank across the map to the mission area ๐Ÿ˜‚

hushed turtle
timber shore
#

thought so, I did it

hushed turtle
# granite sky This also won't generate an error: ```sqf _arr = [nil]; _var = _arr#0; ``` But t...

Even following throws error:

_var1 = nil;
_var2 = _var1;

Complaining _var1 is undefined, when it's in fact defined and has value of nil. Undefined and nil aren't the same thing in SQF.

Very weird to throw error about reading nil from variable, yet at the same time don't when reading nil from array.

Following throws error and despite that it prints 10 just fine.

_var1 = nil;
_var2 = _var1;

call { _var1 = 10; };

systemChat str _var1;

If _var1 was undefined, then it wouldn't print anything, since code in call would have it's own local _var1 with 10in it and it would have no effect on undefined _var1 of parent scope.

vapid scarab
hushed turtle
#

This behaves same as above and it doesn't even matter what index is used

_var1 = [] select 0;

call { _var1 = 10; };

systemChat str _var1;
#

Same here, prints 10 and _var2 is undefined.

_var1 = _var2;

call { _var1 = 10; };

systemChat str _var1;

Looks like = always declares a variable and if it has nothing to assign, then i just assigns nil.

Only this doesn't print anything:

call { _var1 = 10; };
systemChat str _var1;
tulip ridge
#

This isn't anything new here

#

You're not using private for the _var1 in the call, so its modifying the one outside. Even if you're setting it to nil / another undefined variable first

hushed turtle
#

Until recently I thought nil and undefined are the same thing

tulip ridge
#

They aren't (as you now know)

hushed turtle
#

And it easy to think they are same when error says nil var is undefined

#

SQF behaves so strange sometimes. No other language I know behaves like this

old owl
#

Something doesn't even necessarily have to show nil to be nil either. Here's a good really wack example:

[1,2,3,4,5] apply {nil trim ['"',0]}

Should result:

[string,string,string,string,string]

Each of those elements would show true to isNil despite appearing to be a value. Honestly can't remember the explanation behind that. Hopefully the code is right, writing from my phone.

#

I wanna say the explanation was just that it's string representation is different from it's actual value although no idea why. Also been a while so don't quote me that tho lol

tulip ridge
runic heart
#

is there a version of the Speedboat minigun that has no ammo or guns?

distant venture
timber shore
#

@runic heart I wish

distant venture
runic heart
#

how about no ammo?

#

;0

pallid palm
#

@distant venture Ranger is that you from VC1 ?

timber shore
#

@runic heart you can just remove the ammunition and camera abilities off it though.

runic heart
#

Good idea

tulip ridge
#
private _niceList = allPlayers select { _x getVariable ["SC_isNice", true] };
_niceList = allPlayers select { _x getVariable ["SC_isNice", true] };
{ _x call SC_fnc_givePresent } forEach _niceList;
junior moat
#

Hey! Need help with a simple script that i cant understand why it wont work. I have in my mission an object that i want players to be able to interact with to randomly teleport them to a position somewhere near a target location. This part works fine, even in multiplayer, however, when players are spawned in, id like for them to be facing towards the center of the target location, but this for some reason wont work. Here is my entire initPlayerLocal.sqf:

["AmmoboxInit", [arsenalScreen, true, { _this distance _target  < 10 }]] call BIS_fnc_arsenal;

addMissionEventHandler ["EntityRespawned", {
    params ["_newEntity", "_oldEntity"];
    _newEntity enableStamina false;
    _newEntity setCustomAimCoef 0;
    
}];

missionNamespace setVariable ["battleLocation", "airBase", true];
battleLocation = missionNamespace getVariable ["battleLocation", "airBase"];

_teleportPlayer = {
    params ["_target", "_caller", "_actionId", "_arguments"];
    _locationPos = getMarkerPos battleLocation;
    _locationSize = getMarkerSize battleLocation;
    _teleportTarget = [
        _locationPos,
        _locationSize select 0,
        (_locationSize select 0) + (_locationSize select 0 / 4),
        2,
        0,
        0.7,
        0,
        [],
        [3800.5,8146.55,42.2586]
    ] call BIS_fnc_findSafePos;
    _caller setPos _teleportTarget;
    _angle = _caller getDir _locationPos;
    _caller setDir _angle;
};

playScreen addAction [
    "Teleport to Battle",
    _teleportPlayer,
    nil,
    1.5,
    true,
    true,
    "",
    "true",
    10,
    false,
    "",
    ""
];

Im assuming the problem is coming from lines 29 and 30 which are:

_angle = _caller getDir _locationPos;
_caller setDir _angle;

When the player teleports, their angle is sort of randomised, not facing inwards towards the target location. i get no errors.

warm hedge
#

Let's say the _angle is a static number eg 90 or 180 or whatrver. Does that work "intentionally"?

junior moat
#

lemme try real quick

junior moat
#
_angle = /*_caller getDir _locationPos;*/ 90;
warm hedge
#

What about printing number via hint and compare with the desired number?

junior moat
#

I managed to fix it myself, thank you for the help though!

granite sky
#

What was the issue? Can't see anything wrong with it.

junior moat
warm hedge
#

The bug himself debugs!

split ruin
#

any way to remove icons from CfgCommunicationMenu, they are very annoying ... ๐Ÿ˜”

timber shore
#

HowTo question: I have a particle effect script, I want that particle effect script to fire from the weapon, would I have a EVH onFired and attachTo the weapon? or is there another way? #flamethrower

proven charm
#

i wish you could set the direction of created vehicle in the createVehicle command so it would fit in tight spot

#

like place vehicles next to eachother

split ruin
#

setDir doesn't work ?

proven charm
#

it doesnt, the vehicles blow up

fair pilot
#

Use setDir right after createVehicle in unscheduled environment and it won't blow up

proven charm
#

i tried

#

i run this from console ```sqf
_veh = createVehicle ["B_Truck_01_mover_F", getposATL mar, [], 0, "CAN_COLLIDE"];
_veh setdir (getdir mar);

fair pilot
#

Try wrapping it in isNil

#

Also you can add setVectorUp surfaceNormal

proven charm
#

console is unscheduled, isNil didnt help

#

testing in VR

faint burrow
#

Try this:

_veh = createVehicle ["B_Truck_01_mover_F", [0, 0, 1000 + (random 1000)], [], 0, "CAN_COLLIDE"]; 

_veh setDir (getDir mar);
_veh setVectorUp (surfaceNormal (getPosASL mar));
_veh setPosATL (getPosATL mar);
split ruin
#

if somebody wonders how to remove comm menu icons, well its obvious

class CfgCommunicationMenu
{
  class returnbase
  {
    text = "Return to Base";
    submenu = ""; 
    expression = "bla-bla";
    icon = ""; //leave empty 
    cursor = ""; //leave empty
    enable = "true";
    removeAfterExpressionCall = 0;
  };
};
proven charm
#

thx

pallid palm
#

@split ruin does that go in the Description.ext ?

split ruin
#

solution is not perfect because the background of the icons remain ๐Ÿค”

pallid palm
#

oh no ๐Ÿ™‚

#

its ok

deft lion
#

@runic heart Is there any reason that you can't use a vanilla motorboat in the scenario instead of @timber shore's suggestion, as good as it is?

split ruin
#

I need some help with comm sub menu, I don't know where to put the submenu array

//description.ext
class CfgCommunicationMenu
{
  class menu_comms_1
  {
    text = "Menu Comms 1";
    submenu = "#USER:MENU_COMMS_1";
    expression = "";
    icon = "";
    cursor = "";
    enable = "1";
    removeAfterExpressionCall = 0;
   };
};
//main menu working
//where tf to put this ?
MENU_COMMS_1 =
[
    ["MenuName", false],
    ["Teleport", [2], "", -5, [["expression", "player setPos _pos;"]], "1", "1", "\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"],
    ["Kill Target", [3], "", -5, [["expression", "_target setDamage 1;"]], "1", "1", "\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"],
    ["Disabled", [4], "", -5, [["expression", ""]], "1", "0"],
    ["Submenu", [5], "#USER:MENU_COMMS_2", -5, [], "1", "1"]
];
#

its working when I add it in initPlayerLocal.sqf, the only minor problem its called in the beginning of the mission and opens the submenu automatically but its working after that

//initPlayerLocal.sqf
MENU_COMMS_1 =
[
    ["MenuName", false],
    ["Teleport", [2], "", -5, [["expression", "player setPos _pos;"]], "1", "1", "\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"],
    ["Kill Target", [3], "", -5, [["expression", "_target setDamage 1;"]], "1", "1", "\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"],
    ["Disabled", [4], "", -5, [["expression", ""]], "1", "0"],
    ["Submenu", [5], "#USER:MENU_COMMS_2", -5, [], "1", "1"]
];
showCommandingMenu "#USER:MENU_COMMS_1";
pallid palm
#

i have no idea m8 im new to this

split ruin
#

I am new to this too but will be extremely useful when fully understood

finite bone
#

Are you using CBA?

split ruin
#

no

proven charm
#

i think its the showCommandingMenu that opens the menu

finite bone
#

Yea that ^

#

You ideally want the showCommandingMenu "#USER:MENU_COMMS_1"; when you want it to actually show up

#

since you have it already enabled in the initPlayerLocal.sqf you will automatically have the menu show up

split ruin
#

I just want to create it, not create and open ๐Ÿ™‚

finite bone
#

then what you have is good enough in the initPlayerLocal.sqf

#

remove the showCommandingMenu

split ruin
#

thanks, now is fine

#

i am slowly winning the war against radio triggers

runic heart
#

Night spotlight

dire star
#

Anyone knows how to make countdown timer with hint and remoteExec?

#

Or any timer that other players are able to see on screen.

pallid palm
#

woohoo

#

hell yeah Arma 3 ๐Ÿ™‚

#

@dire star ```sqf
// use this what ever way you need

if (!isServer) exitWith {};
// Variables
private ["_timeleft"];

_timeleft = 30;// of course change this to whatever time you need
while {true} do {
hintSilent format ["HQ: Searching For Enemy %1", [((_timeleft)/60)+0.01,"HH:MM"] call bis_fnc_timetostring];
if (_timeleft < 1) exitWith {hint "";};
_timeleft = _timeleft - 1;
sleep 1;
};

#

i have this within a function so well you know ๐Ÿ™‚ you will have to edit it to your liking

pallid palm
#

thx so much @split ruin ```cpp
//CfgCommunicationMenu
class CfgCommunicationMenu
{
class ChopperSupport
{
text = "Chopper Taxi Hold LZ";
submenu = "";
expression = "0 spawn SFA_fnc_INS_ChopperHoldStart;";
icon = "\a3\ui_f\data\map\vehicleicons\iconhelicopter_ca.paa";
cursor = "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa";
enable = "1";
removeAfterExpressionCall = 0;
};
};

#

scripting in Arma 3 is so much fun i love it

#

even tho im not that good at it

split ruin
#

do you have scripted heli transport?

#

nvm I am using Halo jump normally to get to AO, AI pilots don't know what combat landing is ๐Ÿ˜‚

split ruin
#

why this gives error? (undefined variable) ๐Ÿค”

KIB_enemyMrkColor = ColorWEST;
publicVariable "KIB_enemyMrkColor";
KIB_friendlyMrkColor = ColorEast;
publicVariable "KIB_friendlyMrkColor";

seems it wants "", why I have no idea ...
this works

KIB_enemyMrkColor = "ColorWEST";
hallow mortar
#

ColorWEST is not a command or function name so it assumes it must be a variable. But it isn't a variable either, so...undefined variable.

#

Any word that isn't a "string" is always going to be treated as a command, function, or variable, in that order.

proven charm
#

arent functions variables though? i mean they exist in such

hallow mortar
#

Yes, but people may not think of them like that so I mentioned them specifically

proven charm
#

alright

pallid palm
#

@split ruin yes sir: i made a complete chopper command with 5 diff Scripts in it: each script does diff things for you

#

i had been calling them by radio trigger : so now im moving them to the Communication Menu

split ruin
#

after countless fails from AI pilots to deliver I decided all players will join paratroops ๐Ÿ˜‚

pallid palm
#

my chopper command never failed ever yet ๐Ÿ™‚

#

Dart helped me make it he Awsome

split ruin
#

fails is when he lands so slowly the enemy make the chopper to swiss cheese

pallid palm
#

oh well you must land not so close

split ruin
#

but good player pilot do this without problem

pallid palm
#

true:

#

it lands right where you click

split ruin
#

my halo jump script do this too ๐Ÿ˜‚

pallid palm
#

yup i also have halo para and ever para eject scripts

#

made by me of corse

split ruin
#

para eject script? you mean all units eject from a heli/plane ?

pallid palm
#

my chopper command and all my para and halo scripts work by EVH

#

yes all can or just one is up to each guy

split ruin
#

this is interesting, care to share it ?

pallid palm
#

the para eject script is just for players tho

#

of corse any thing for you budy: we are like Arma budys right ๐Ÿ™‚

split ruin
#

arma is our blood group I guess ๐Ÿ™‚

pallid palm
#

yes sir ๐Ÿ™‚

#

i'll send it to you by PM ok m8

#

maybe i should put all the instructions in it on all the ways you can use it ok m8

#

cuz you can add or remove the para eject script from the init of the plane or chopper ๐Ÿ™‚

#

im game

split ruin
#

๐Ÿ‘

pallid palm
#

roger m8 i'll work on that and get it to you as fast as i can

split ruin
#

is it possible to delete all object for spawned composition?

compound =
[
    ["Land_Cargo_House_V1_F",[-6.93091,-0.897949,0],267.76,1,0,[0,0],"","",true,false],
    ["Flag_AAF_F",[-5.72998,4.27148,0],0,1,0,[0,0],"","",true,false]
];
[randPos, 0, compound, 0] call BIS_fnc_objectsMapper;
//something like 
{deleteVehicle _x} forEach compound //very pseudo code lol 
sharp grotto
# split ruin is it possible to delete all object for spawned composition? ```sqf compound = ...

Since BIS_fnc_objectsMapper: Return Value: Array of Objects (https://community.bistudio.com/wiki/BIS_fnc_objectsMapper).

private _compound =
[
    ["Land_Cargo_House_V1_F",[-6.93091,-0.897949,0],267.76,1,0,[0,0],"","",true,false],
    ["Flag_AAF_F",[-5.72998,4.27148,0],0,1,0,[0,0],"","",true,false]
];
Kiba_AllCompoundObjectsTemp = [randPos, 0, _compound, 0] call BIS_fnc_objectsMapper;
//something like 
{deleteVehicle _x} forEach Kiba_AllCompoundObjectsTemp;
Kiba_AllCompoundObjectsTemp = [];
split ruin
#

@sharp grotto works perfectly, thanks a lot ๐Ÿ‘Œ

old owl
#

๐ŸŽ„catnod๐ŸŽ

thin fox
pallid palm
#

hello all: why is this now working i think this is correct: ```sqf
[Helo2, "whatyouwaitingforGi", 300, 1] remoteExec ["say3D", 0, true];

hallow mortar
#

Your remoteExec is not formatted correctly

#

remoteExec works like this:

_left command _right;
[_left, _right] remoteExec ["command", ...];```
In this case, the left argument for `say3D` is the speaker, and the right argument is the array of sound information. But that's not what you've given to `remoteExec`. As far as `remoteExec` can see, you've given it a left argument `Helo2`, a right argument `"whatyouwaitingforgi"`, and then two extra arguments that it doesn't understand what to do with because they don't fit the structure (`300, 1`)
#

Because the right argument for say3D is an array, it needs to still be an array within the array of arguments given to remoteExec

pallid palm
#

i knew i had it all messed up darn it'

#

hmmmmmm

#

interesting hmm

#

i was thinking the 300 was distance and the 1 was pitch

hallow mortar
#

Yes, they are. They are valid parts of the syntax for say3D, but you have not passed them to remoteExec correctly

pallid palm
#

hmmmm

#

darnit

hallow mortar
#

It doesn't have to be trial and error. I just told you how it works.

pallid palm
#

yeah im still not sure how to do it

hallow mortar
#

The right argument for say3D is an [array, of, values]. Just keep it as an array when you rearrange the arguments into the remoteExec.

granite sky
#

It's a bit counterintuitive because you can do "some text" remoteExec ["hint", 0]. But if you want to pass an array then you have to wrap it, otherwise Arma can't tell what you're trying to do.

pallid palm
#

hmm

#

man it seems so easy but i still cant understand

granite sky
#

Oh, this isn't one of those cases anyway :P

pallid palm
#

oh lol

granite sky
#

(binary commands always need the array)

pallid palm
#

array within the array of arguments hmmmm

#

im almost understanding

hallow mortar
#

We might casually say that say3D has several arguments on the right side, but really it's just one. An array, with several values inside. And remoteExec is expecting to receive an array of [_leftArgument, _rightArgument], where each argument is exactly the same as it would be when not remoteExec'd. If you flatten out the right argument like you originally did, it's no longer a single item which is an array, it's several items in the array of arguments for remoteExec. It's no longer receiving [_leftArgument, _rightArgument], but instead [_leftArgument, _rightArgument, _thirdArgument, _waitWhat], which it can't understand.

pallid palm
#

ohh ok hmmm

#

so i need an array within the array of arguments

#

yes ?

hallow mortar
#

Yes, just like I said

pallid palm
#

hmm ok im starting to understand

hallow mortar
#

You need to preserve each of the left and right arguments exactly as they would be if this wasn't a remoteExec. In your first formulation, you didn't. You changed the right argument.

pallid palm
#

hmmm i see i think

hallow mortar
#

In case it wasn't clear, "left and right arguments" means the two arguments which appear on the left and right sides of the command, in its normal syntax

pallid palm
#

roger that

#

so ummmm let me go out and smoke then come back after i let my brain cool down ๐Ÿ™‚

#

lol

#

brb

#

there was smoke coming off my brain ๐Ÿ™‚

#
[Helo2, ["whatyouwaitingforGi", 300, 1]]
granite sky
#

first one.

pallid palm
#

oh cool woohoo

granite sky
#

Helo2 on the left, ["whatyouwaitingforGi", 300, 1] on the right.

pallid palm
#

ahh ok Awsome

#

now i understand

#

wow thx so much guys really

#

it may take me a day to recover from this lol just kidding ๐Ÿ™‚

#

so this is correct just to be sure```sqf
[Helo2, ["whatyouwaitingforGi", 300, 1]] remoteExec ["say3D", 0, true];

#

right ?

granite sky
#

I don't know enough about the intentions to say.

pallid palm
#

ummmmm

granite sky
#

The JIP seems odd.

pallid palm
#

ok

#

so i shoud remove it

granite sky
#

Like do you want this playing immediately for players who connect later?

pallid palm
#

oh no oops

#

so this is correct just to be sure```sqf
[Helo2, ["whatyouwaitingforGi", 300, 1]] remoteExec ["say3D", 0];

granite sky
#

probably

pallid palm
#

ok thx so much guys you guys are the best thx so much

#

wow that was hard for me sorry about that

#

it seems like the more i learn the less i know ๐Ÿ™‚

granite sky
#

Going back to remoteExec params, there are really 3-4 different formats for different cases (unary command, unary command that takes an array, binary command, function). They're only described in example 1 on the remoteExec wiki.

pallid palm
#

yeah

granite sky
#

binary command is the [left, right] one.

pallid palm
#

roger that m8

#

or it seems like the more i learn: the more i realize i don't know that much ๐Ÿ™‚

#

but thx so much for the great help ๐Ÿ™‚ @ Nikko and @ John Jorden

#

man thats so cool thx again m8s

#

oh man this is going to be epic woohoo ๐Ÿ™‚

#

woohoo works Awsome thx so much guys i mean really ๐Ÿ™‚ _ after many min of playing _

#

oh shit we lost contact with the Aircraft ๐Ÿ™‚ chopper down

pallid palm
#

thx you so much guys i really, really, really, appreciate your help: Everythings working perfectly:

pallid palm
#

lol _waitWhat lol At Nikko ๐Ÿ™‚ thx man

formal brook
#

Anyone know where I can find the config for the Well Bay doors on the CUP USS Wasp LHD?

proven charm
#

id look from Wasp config

formal brook
#

Right but there's no "UserAction" section in the Config

proven charm
#

does it consist of multiple pieces? like USS Freedom does

formal brook
#

Doesn't seem like it, just different variants like Empty, Sea Control, Assault, etc

proven charm
#

ok

hallow mortar
#

I don't have the relevant CUP part installed myself so I can't look, but you could check its EventHandlers config

serene olive
#

I want to hide object in Zeus Camera only.
When a Zeus remote controls a unit, or moves as a player the object shall be shown.

I could not find any EventHandler for Entering/Leaving Zeus Camera/View.
Can someone give me a hint, where I shall put my hide/show code?

proven charm
#

i dont know what exactly you want but you can check if zeus is open like this: ```sqf
!isnull (findDisplay 312)

serene olive
manic sigil
#

Is there some issue with the LOITER waypoint type being set?

I have a custom script for spawning in reinforcements, and it mostly all works, except for the MI-24s. I have a section to add an additional waypoint after they finish dropping off troops to start loitering for a few minutes; instead, they always just stay on the deck.

The loiter subcommands all work, the waypoint itself reads as Loiter with the proper distance and timing, and waypointType reports "LOITER". In the Zeus interface, however, it reads as 'Waypoint', no waypoint number.

#
//Loitering gunship
if (_type == "MI24") then 
{
    _wp5 = _crewGroup addWaypoint [getPos _trans,0];
    _wp5 setWaypointType "LOITER";
    [_crewGroup,currentWaypoint _crewGroup] setWaypointLoiterAltitude 100;
    [_crewGroup,currentWaypoint _crewGroup] setWaypointLoiterRadius 500;
    [_crewGroup,currentWaypoint _crewGroup] setWaypointtimeout [180,180,180];
    _trans limitSpeed 75;
};
proven charm
#

you mean the heli lands but doesnt rise after that?

manic sigil
#

Yeah; it clears it's TR UNLOAD waypoint when the last trooper gets out as scripted, but when a LOITER waypoint is added something seems to not take.

thin fox
manic sigil
#

I did have to use landAt for my slingload reinforcements, the waypoints are handy because I can redirect their final target on the fly. I have an invisible landing pad appear when theyre 500m out on their TRUNLOAD waypoint.

Still, Ill have to see about making it the MI-24s only waypoint. Considering I have the exfil waypoints load in only after theyve dropped off troops, it shouldnt be too hard.

thin fox
#

you can use setWaypointStatements

proven charm
#

not expert with wps but have you tried "UNLOAD" instead of "TR UNLOAD"?

granite sky
#

Might need TR UNLOAD -> MOVE -> LOITER anyway.