#arma3_scripting
1 messages ยท Page 217 of 1
btw, this is the script, it's silly but get the job done
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;
};
};
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.
just do it manually by checking ticket count and how many people are alive
What is the value of your respawnTemplates?
respawn = "BASE";
respawnTemplates[] = { "MenuPosition", "Tickets", "EndMission" };
Ok, I will give that a shot.
Thanks, I will play around with this.
Looks like the respawn system is broken, and you should manually check tickets and end the mission.
respawn system works Awsome imho
Sometimes people need stuff that's different from what you need
yes but if your using respawn=3 which he is then well you know
not helpful, and actually hurtful. does not answer the OP
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.
Vanilla.
add "Spectator" to the template. You will also need to apply some ui vars, see Conflicts: https://community.bistudio.com/wiki/Arma_3:_Respawn#Conflicts
i was mainly getting at the comment of "just use this, no need for other stuff", which puts him backwards than where he started
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
i was thinking the problem was what he said: the mission would not end
when the tickets run out
That setPlayerRespawnTime actually works?
I'm asking him
he just needs to factor in locality of setPlayerRespawnTime. its local.
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 ?
I've never got this command to work, maybe I'm confusing with another command with similar name ๐ค
OR is there a way to figure out what class a sound path is defined to/as
are you looking to just clone a sound?
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
CfgSounds in description.ext just extends CfgSounds in game. So you can just use the vanilla config name/values.
Yea but I dont know the vanilla name for the sound though
let me see if i can look it up
Yeah it works great. I got it in onPlayerKilled.
I'm not finding it atm, but if you just want to use the path in your description.ext, you would use the leading \ in this case
Awesome thanks!
interesting, thanks
I've ran into an issue with this check. I gate the end mission screen from happening by checking the player tickets. But tickets can be 0 with players still alive. I don't want to end the mission prematurely. I could also run a check to see if any players are still alive and not incapacitated. Is that a good solution?
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
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.
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.
Where does it say it returns 0? It looks like it says it returns the index or -1.
Oh, what is "0 based index"?
The index of the first success in the array, starting with 0 and counting up.
So if one of the players in the group are alive then it cannot return -1, right?
Maybe
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.
I've got this so far, is OK to use the or in the code portion?
units playerGroup findIf { alive _x || lifeState _x == "INCAPACITATED" } == -1;
yeah.
I want it to return true if there are no alive or incapacitated units.
looks correct.
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.
If any are alive is not true (what you almost currently have), then they are all dead.
Wait...
Incapacitated counts as alive.
Alive and not incapacitated is what you need.
I want it to return true if there are no alive or incapacitated units.
Yes?
If all players are downed I want it to return true.
That's different :/
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.
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.
Can't check what?
I can't just do !alive.
(units playerGroup) findIf { alive _x && !(lifeState _x == "INCAPACITATED") } == -1;
```? Does it not work / follow [#arma3_scripting message](/guild/105462288051380224/channel/105462984087728128/)?
Players can't spawn on incapacitated players IIRC.
Is this sentence correct?
"I want it to return true if all units are dead or incapacitated".
Yes it is. For some reason I thought it wasn't before. Now I think it is.
Lemme test it again.
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.
Which do you want?
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.
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.
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?
I mean that they decide by force respawning.
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.
Oh I see.
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.
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.
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.
Anyone of you got that before in your .rpt:
Transfer of uninitialized variables is not supported
?
Lol, players can respawn on incapacitated units. Back to the drawing board... (for if players have infinite tickets)
I feel like infinite tickets just shouldn't be fail-able.
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
Yeah, good point.
Thanks for the info.
No worries, the wiki pages have just a smidge more than what Iโve said so I recommend giving them a read as well just to cover the bases
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?
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
yeah i'm aware of setMarkeralpha 0/1
i just wanted the markers to be visible to me during the mission making for troubleshooting
https://community.bistudio.com/wiki/playMusic
for playMusic with custom songs, is there an example on how to execute the code for every player (remotexec)?
I create sound with playSound3D in the server but its not being broadcast - does it have to be created on a client?
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[] = {};
};
"<music classname here>" remoteExec ["playMusic", [0, -2] select isDedicated, true];```
So in your case it will be:
```sqf
"waramb1" remoteExec ["playMusic", [0, -2] select isDedicated, true];```
ty
not necessarily but i might be wrong
Yes Eden enhanced has that feature
Is it under Preferences?
Hide On Start in the marker attributes
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.
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.
it probably doesn't support AI. just use a KilledEntity MEH and check for AI and manually reduce the tickets
So if im reading https://community.bistudio.com/wiki/createSoundSource right, it will create a sound source that can possibly be attached to some object and have it emit the sound while moving?
Yes
// 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
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.
Hmm? I just want to form a global variable name dynamically and e.g. assign value to it
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];
Ah ffs ๐ The mission is full of call compile stuff, should've realized that by now. And the missionNamespace too...
Anybody know how i can add checkmark in structured text?
hint parseText format ["<t align='center' valign='middle' size='1' shadow='0'>✓</t>"];
This one don't work
What's a checkmark?
Arma uses UTF-8 right?
Generally unicode is only a problem if it's a character that would confuse the HTML parser.
But...If u call hint parseText format ["<t align='center' valign='middle' size='1' shadow='0'><</t>"]; Unicode symbol appears
Isn't that just a left angle bracket?
That one exists because otherwise < would be eaten by the HTML parser.
Hm
empty hint
Doesn't seem to be usable by Arma ยฏ_(ใ)_/ยฏ
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 ✓ should work.
Empty hint too
hint parseText format ["<t align='center' valign='middle' size='1' shadow='0'>✓</t>"];
yeah, probably not in the fonts then.
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
Since you use structured text might as well just use a real texture instead of a symbol
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
hello all : where can i find a list of all the icon = ```sqf
"a3\Ui_f\data\GUI\Cfg\RespawnRoles\assault_ca.paa";
Can't see this referenced anywhere in the vanilla config, I guess you'll just need to unpack the addon
oh ok cool
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
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
is there a way to add tailhook from black wasp to any other flying vehicles?
@jade abyss sounds like publicVariable "idontexist";
me too want to land with A-164 Wipeout on a carrier ๐ญ
Hello again for some reason playSound3D is not playing when created on the server (dedicated)
Are you using the 9th parameter, which makes it operate locally instead of globally?
No I explicitly checked that
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)?
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
What's the actual code?
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;
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)
Both are part of the mission file
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.
So what is the best way to create a single sound source that can be stopped basically?
You could try createSoundSource. Or you could make playSound3D work locally, and use a system of functions to handle stopping it locally as well.
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
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.
its a beautiful Day in the Arma 3 Universe ๐
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?
it only works on clients
I see. Thanks
so if you add it to client only that client has the action
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".
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.
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?
Strange usage of position commnads
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?
Why do you need to move the bomb?
"It's easier," but how is it easier if the grass cutter has to be placed anyway???
I have no idea what's easier about it

It's also strange to get position above first surface below and use that to set position above sea waves
@burnt matrix where is this box?
[_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
which part? bis_fnc_mp is the old way of doing remoteExec
and yeah, are you using a zeus unit that dies?
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.
right click on it and hit find in config, it will tell you the hierarchy
Forgot that was a thing, youre a genius
Generally isKindOf "Tank" means it's a tracked vehicle.
There is not necessarily a good way to distinguish wheeled APCs.
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
Works like a charm now, thanks a ton
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
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
};
I think you could do:
if (
((units west) findIf {alive _x && isPlayer _x}) == -1) &&
(playableUnits findIf {alive _x && side (group _x) == west} == -1)
) exitWith {
// my code here
};
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
};
Mine was a ) (and maybe more), so watch out.
also looks good
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
well i don't use the unconscious system so
There is a performance button in the debug console tho if you ever wanna run stuff to see it's speed ๐
ok cool
just use
side (group unit)
It should be next to all the execute buttons
where do you mean @rain void
He means instead of faction that I proposed- which he's correct there
The side of a dead unit can be civ, even if it is east, but not when using side (group unit).
so im not sure where in the code to put that
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 
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
I don't think so.
Isn't side (group unit) + playableUnits adding a string and an array?
What is side _x isEqualTo _x for?
Does {alive _x && isPlayer _x} inside the other code get executed?
I screwed that up initially 
Use side group _x if no one said that already
Unit side will give inconsistent results
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
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
Instead of side _x.
But what about #arma3_scripting message?
side returns the actualy side, it's still wrong though
can you show me the best way
What is a side?
side like east west and so on
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
};
Oh nvm that includes players from all sides
Yeah just edited it, should be good
cool thx alot guys really
Might need parenthesis around the _playableWestUnits findIf { alive _x } in the if statement, not sure though and don't have arma open to confirm
copy that
Maybe this?
if ((allUnits + allDeadMen) findIf {
side group _x == west && {alive _x && isPlayer _x}
} == -1) exitWith {
// my code here
};
Maybe
I'm not sure if the is player and playable units thing is redundant or not, never used it before
yeah i need to get all players from the west side and the playableunits from the west side: to check if they are alive
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
};
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
Well if you have AI automatically fill player slots then I assume they'd be in playableUnits but obviously not a player
so if a player takes over a Ai playableUnit: then is that unit no longer a playableUnit
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
ok will do this is very insteresting ๐
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 {};
Should still be side group _x
ok will check it
grpNull enters the room 
but yea, idk, just test it #arma
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.
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
Yeah, 100m sounds about right from the last time I tested it.
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:
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?
For markers you need getMarkerPos. Markers aren't objects and you can't use object commands on them.
createUnit needs a group as left-hand input.
something like this? _unit = group player createUnit ["Soldier_ClassName", getMarkerPos aMarker, [], 0, "NONE"];
Yes, but with a real classname.
and how do I make it use a new group as a whole? i'm trying to spawn it in as a target dummy
createGroup _side
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?
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
Probably whatever you used getMarkerPos on isn't a marker.
It is a destroy marker
As long as itโs a type marker that shouldnโt matter should it?
Well, technically a marker in SQF is a string that names a marker.
This is trying to run off a trigger
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.
TargetSpawner0 was the variable in the attributes of the marker
Give me a minute to check what that looks like. I don't use the editor that much.
actually I think i might be completely blind you said qoutes and I have not even done that my apologies
Yeah it says "variable name" in eden but it's not a variable name :P
okay that worked, I am so sorry that took as long as it did
It's the marker name.
thank you so much for your help ๐
Hmmm, i wanted to make wired torpedoes but i suppose i won't be able to show the wire
I suppose you could string them together with helper objects but that's a horrible idea
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.
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
It's not a vanilla feature ? Damn I play to much with mod.
I'll look from ace's side thanks !
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
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
same here ๐
i think Lou is like that aswell ๐ don't use any mods
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 ?
ahh i see hmmm
Foggy breath doesn't really move with you in real life either. It doesn't have a lot of mass, it gets stopped by the outside air pretty quick.
i have a old fsm fog system script that i would like to get working
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.
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
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
I changed the path for the particle effects and its working for a3 now
There's no reason the particles wouldn't be created if the player is moving, and the source is correctly attached. So it must be that the particles are there, but the player is simply moving through them before you can see them. That's why I said you could base the initial velocity of the particles on the source unit's velocity, so they move in the same direction a bit.
yeah, I suspected that, then everything is good I guess 
I just tested moving backwards, the fog is there ๐ฅณ
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
@pallid palm whats in fog.fsm ?
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?
Yeah
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.
What server host you use shouldn't make a difference
Understood. But I wanted to be clear that the mission is running on a dedicated server, not locally.
Ah gotcha. Do you have code you're willing to share?
!sqf
```sqf
// your code here
hint "good!";
```
โ turns into โ
// your code here
hint "good!";
If you could format with the above would help
_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;
Are you getting any script errors? Your waitUntil isn't returning a bool
Oh wait I'm sorry
Does it spawn in the air or on the ground? What happens to it?
This is an Arma 3 Eden editor tutorial on how to call for helicopter evac by throwing a green smoke grenade.
UPDATE
I have now changed the script (now at version 2) to work with player and player's group so you no longer have to name the units.
Link below is to the new file.
Dropbox link to SQFs:
Spawns in the air
SP it spawns in the air and flys to the designated location. MP it spawns and explodes.
Spawns where?
Honestly not sure right off get-go. What my head goes to though is some sort of collision issue maybe, as those tend to be more exaggerated in an MP environment. I would maybe try playing around with allowDamage and disableCollisionWith after your initial createVehicle to see if that helps then revert those changes after your waitUntil to see if it fixes your issue.
At the defined location, in this example [9162.07,9407.33,0], but 50 meters or so in the air not at "0"
And it exploads in the air?
Correct
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
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.
Protect it from the creation of the helicrew?
It's the first thing that is done after the helo is created... createVehicleCrew
That shouldn't be able to collide with the helicopter if it's already in the helicopter.
I checked the script i used and edited some years ago and it used https://community.bistudio.com/wiki/BIS_fnc_spawnVehicle
Maybe try that, just for the sake of ruling it out. Even tho i don't think it will change anything.
I will check that out. Thanks.
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
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....
Winner.
So how to prevent that?
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.
The sqf is a product of trigger activation
WR_WPL = execVM "WR_HELI_SPAWN_LAND_V4.sqf";
Let me try server only and report
In the same session, the first time I called it, it exploded...but during each subsequent call it spawned without issue. In the same session.
if (!isServer) exitWith {}; this ensures Only the Server Runs the script
```Meaning if its Not the Server then exit With Nothing
Or alternatively !isDedicated if you run your mission as player hosted too 
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...
Doing that in a player-hosted mission would mean no one runs the code. I'm not sure that would help.
Would it not? This is the documentation on the wiki:
if (!isDedicated) then {
// run on all player clients incl. player host and headless clients
};
i think he said its Ded server
if !isDedicated then { ... means the code will run on all non-DS machines. That doesn't help in this case where we're trying to ensure only one machine runs the code.
if !isDedicated exitWith{}; means the code will run only on the server if it's a DS (good) but means the code will not run at all if player-hosted (bad)
i think you ment this Milo
if (!isDedicated) exitWith {}; this ensures Only the Server Runs the script
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
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
It's a dedicated server. And it's spawning 2 helo's.
how is that posiable
I think probably because the script was being spawned globally
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
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
I think now I am doing my own head in- I don't think this #arma3_scripting message would be correct either
Really just depends on the context of where that script is being ran. Ideally though should just be ran on server
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.
This would cause the code to exit if run on a DS. Same effect as if isDedicated exitWith{};
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
hes on dedicated server
Sorry, I meant to say if !isServer exitWith{}; or if isServer then { ... };
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.
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.
* actually it would break the code in SP or in player-hosted MP with only the host playing
Adding a check is fixing the cause of unintended executions. The cause is that the code is being run on multiple machines; the fix is to stop every machine except one from running it
@lime owl can we see your fixed code now
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
I mean using an exitWith just prevents the script from running. It sounds like the script he has is executing globally and it would be better to limit that to just server as no reason to send network globally.
is there a chopper with the same var name on the map: i guess that can't be cuz it would tho an erra
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.
@lime owl can we see your fixed code now
and can you tell us where and how you are exec-ing that script
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.
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
I was able to select Server Only. Isn't that the same thing?
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 ๐
NO EXPLOSION!
wooohooo hell yeah
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:
Now to find some testers ๐
it will work good now m8
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?
posinit of a unit im not sure what that is
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;
I don't think it gets used often, it's only available in the config for a unit
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
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
you made this config for a unit ?
That Script #1 comes from? Yeah
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
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
i see hmmm
But Script #1 fires multiple times, which I believe is a locality problem, but I can't figure out how to fix that
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
I appreciate the effort, it's a particularly perplexing issue
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
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
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 ๐
Sounds like an interesting time ๐
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 ๐
Sounds pretty cool to me
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 ๐
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
lol yup it seems cool: what your trying to do: oh cool POLPOX is here to help: he's good
If you mean postInit EH of an unit config and it is running on every client, you can just filter it by
if (local _unit) then {};```or smth
I'll give it a shot and see what happens
Vehicle init and postInit events run on every client. You can prevent that either with isServer or local, depending on what you want to do with it.
I just want it to run once, that's all
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.
Well worst case I do some troubleshooting and see what works and what doesn't, locality just gives me a headache sometimes xD
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;
};
Paste the error. It tells you more than that.
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
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
you can send the file
is there "force freelook" command for players? i tried running lookAt with a pfh but it doesn't seem to work
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
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
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 { ... }.
A2 doesn't support hashmaps unfortunately
I miss A2
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 
Been playing it in multiplayer to this date ๐ Miss Life servers the most though
so nostalgic
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.
No need for SP ๐ I'll try to do that, thanks!
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
What? Surely you are running this locally on each machine ?
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
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?
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
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.
In this case yeah. Sorry, worded it badly ๐
Yeah, that's how it's supposed to work now. But I think I'll rewrite the whole thingy to be more clean and organized in any case
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 ๐
Yeah the markers are not time critical, a few seconds here and there is fine
@spiral trench update the BIKI then https://community.bistudio.com/wiki/setVariable
I would but, unless I'm missing something, I can't create a wiki account...
Wanted to start with Intercept but was waiting for the documentation?
Alpha documentation is out
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
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
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"
you mean like this https://community.bistudio.com/wiki/skipTime ?
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
maybe https://community.bistudio.com/wiki/dayTime not sure
smth like, not sure if this will work, but I will see
while {dayTime<16} do
{
skipTime 0.00333;
sleep 0.1;
};
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
you have to spawn
Thanks, its perfect
no. you can switch to some animation that doesn't aim and uses freelook tho
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?
i dont know if this helps but unit needs re-breather according to this page: https://community.bistudio.com/wiki/isAbleToBreathe
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.
yeah i know
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.
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:
- Player tries to assemble a darter
- System detects limit, so destroys the darter
- System places a new darter backpack on ground so player doesn't loose it
- 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
But disassembled is for existing unit, not backpack
And I already figured that part out
But:
Triggers when entity such as weapon/backpack gets disassembled.
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).
Try, according to BIKI, it can be.
Lol okay let's try then
yeah its for vehicles too
well this doesn't work
same behavios as when EH was "Assembled", so no reaction
What's class name of _backpack?
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
Backpacks are placed inside weapon holders when dropped on the ground, but they are genuine objects as well.
uhhh so I need to figure out how to attach EH to the weapon holder, not to the backpack?
I don't know. I haven't read the whole backlog.
saw vehicle doing zig zag like from one island to another
This is WeaponAssembled and WeaponDisassembled though? I don't know why you'd be adding those to either a backpack or a ground holder.
I am using Assembled and Disassembled
and I need it only for darters
/other portable UAVs
no
Not sure how that would work. IIRC Assembled doesn't fire on the first assembly because the object doesn't exist yet.
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
Assuming it's done via the vanilla assembly mechanic then it should.
yeah it's vanilla assembly
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.
I'll try it
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;
};
}];
Prefix your global variables
yeah weaponAssembled global EH is the thing I needed, works for darters too
ill figure out the rest. Thanks!
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?
where you run the player HandleDamage from?
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.
How can I do this? Is there an example?
No.
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
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.
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?
Oh yeah, they aren't
Still, its not 100% reliable as you might get more damage to unarmored part when hitting an armored part
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"
Last hit has context value 2
But I guess its easier than HitPart on target or projectiles
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?
You can reverse the armour calc but that is also quite tricky.
Yes, I found the same information. But it can't be that I hit the head and then the bullet went into the body, and in context 2 it would be hitPart of the body.
See my example. I think that was neck hit that also hits the chest.
Hits can do collateral damage to adjacent selections
For whatever reason hitting one part with bullet causes damage to other parts as well
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.
Yeah you'll need to account for depends in hitparts too
oh i think keyframe will work
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
ended up using BIS_fnc_unitCapture/BIS_fnc_unitPlay turned out to be pretty reliable ๐
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;
the arrays could be nil
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;
ok and the script runs after that?
Yeah
hmm
Wait a sec, I think I spotted something that's wrong
Use side (group _unit) and playerSide. Also you don't need to reassign to ARRAY_UNITS_FIRING_XXX.
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.
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.
the thing with arma usually is that commands silently fail if they get nil arguments
like if you run ```sqf
{} foreach nil
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
createSimpleObject ["a3\vegetation_f_enoch\tree\t_piceaabiesnativitatis_2s.p3d", getPosWorld player vectorAdd [0,0,7.6]];
๐
you probably do have to reassign when using that function (at least that's what the biki implies)
iirc only unscheduled doesn't show nil errors. scheduled does
you should test if the thens are even reached. log what you're pushing too
The array is passed by reference so changes inside the function will be reflected outside of it
hmm this doesnt give any errors (ran from debug console): ```sqf
[] spawn { {} foreach nil; }
It's not the command + nil that throws the error, it's the dereference. So {} forEach doesNotExist will throw in scheduled.
This also won't generate an error:
_arr = [nil];
_var = _arr#0;
But this will:
_arr = [nil];
_arr params ["_nope"];
_var = _nope;
oh interesting. maybe i mixed something up because nulls also cause silent fails. like ```sqf
Alive objNull
Well, in unscheduled the dereferences don't throw either. Which is a pain when you typo a function name.
lot of different behaviours ๐
The objNull cases are often very useful but they're not documented :/
Like objNull distance2d _whatever is always 1e10;
yeah instead of writing !isnull _obj && alive _obj you can just write alive _obj
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 
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.
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
haha
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; ?
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 ! ๐
Dynamic Recon Ops
available in the steam workshop
Or Dynamic Combat Ops.
@lean ice I hope its not MCC4 ๐คฎ
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
you are asking about mission, a mission consist of different scripts
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 ?
virtual garage does not work in MP ...
Sorry if it's not understable, I'm level zero on this type of stuff
It work pretty well on my server
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
Oh okok, I don't want to steal anything, I was just wondering if it already exist in free access
why you don just make a mission on the go with Zeus?
if you sqf knowledge is limited, this is the way to go
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;}];
Because I don't want to know what's exactly on the mission or where AI is
everything you make in the virtual garage is visible only to you
well this is how I began making missions 5 years ago ๐
Oh that wasn't that script
Oh okey I didn't know about that
BI made virtual garage only to test vehicles, it spawns vehicle on the players machine aka local only
oh
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 ?
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 ๐
All indexes are out of bounds when array is empty. That being said SQF can be very very weird
thought so, I did it
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.
I may be wrong by this... Does [] select 0 return nil?
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;
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
Until recently I thought nil and undefined are the same thing
They aren't (as you now know)
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
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
It outputs as string because trim returns a string
So engine knows the value should be a string, but there's an error in your code
is there a version of the Speedboat minigun that has no ammo or guns?
As far as I am aware, as it is the case in other languages. Nil or Null does not constitute as being defined for whatever reason. I typically just use 0
@runic heart I wish
I know Godots coding language works like this and a few others jump to mind but unsure
@distant venture Ranger is that you from VC1 ?
@runic heart you can just remove the ammunition and camera abilities off it though.
Good idea
private _niceList = allPlayers select { _x getVariable ["SC_isNice", true] };
_niceList = allPlayers select { _x getVariable ["SC_isNice", true] };
{ _x call SC_fnc_givePresent } forEach _niceList;
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.
Let's say the _angle is a static number eg 90 or 180 or whatrver. Does that work "intentionally"?
lemme try real quick
setting it to 90 worked fine
_angle = /*_caller getDir _locationPos;*/ 90;
What about printing number via hint and compare with the desired number?
I managed to fix it myself, thank you for the help though!
What was the issue? Can't see anything wrong with it.
Human error
i was facing the correct way im just stupid and i was just misoriented on where i thought i should have been looking ๐ญ
The bug himself debugs!
any way to remove icons from CfgCommunicationMenu, they are very annoying ... ๐
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
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
setDir doesn't work ?
it doesnt, the vehicles blow up
Use setDir right after createVehicle in unscheduled environment and it won't blow up
i tried
i run this from console ```sqf
_veh = createVehicle ["B_Truck_01_mover_F", getposATL mar, [], 0, "CAN_COLLIDE"];
_veh setdir (getdir mar);
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);
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;
};
};
nice that works ๐
thx
@split ruin does that go in the Description.ext ?
solution is not perfect because the background of the icons remain ๐ค
@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?
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";
i have no idea m8 im new to this
I am new to this too but will be extremely useful when fully understood
Are you using CBA?
no
i think its the showCommandingMenu that opens the menu
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
I just want to create it, not create and open ๐
then what you have is good enough in the initPlayerLocal.sqf
remove the showCommandingMenu
Night spotlight
Anyone knows how to make countdown timer with hint and remoteExec?
Or any timer that other players are able to see on screen.
yes you inspired me: to move my chopper command to the Communication Menu
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
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
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 ๐
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";
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.
arent functions variables though? i mean they exist in such
Yes, but people may not think of them like that so I mentioned them specifically
alright
@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
after countless fails from AI pilots to deliver I decided all players will join paratroops ๐
fails is when he lands so slowly the enemy make the chopper to swiss cheese
oh well you must land not so close
but good player pilot do this without problem
my halo jump script do this too ๐
para eject script? you mean all units eject from a heli/plane ?
my chopper command and all my para and halo scripts work by EVH
yes all can or just one is up to each guy
this is interesting, care to share it ?
the para eject script is just for players tho
of corse any thing for you budy: we are like Arma budys right ๐
arma is our blood group I guess ๐
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
๐
roger m8 i'll work on that and get it to you as fast as i can
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
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 = [];
@sharp grotto works perfectly, thanks a lot ๐
hello all: why is this now working i think this is correct: ```sqf
[Helo2, "whatyouwaitingforGi", 300, 1] remoteExec ["say3D", 0, true];
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
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
Yes, they are. They are valid parts of the syntax for say3D, but you have not passed them to remoteExec correctly
It doesn't have to be trial and error. I just told you how it works.
yeah im still not sure how to do it
The right argument for say3D is an [array, of, values]. Just keep it as an array when you rearrange the arguments into the remoteExec.
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.
Oh, this isn't one of those cases anyway :P
oh lol
(binary commands always need the array)
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.
Yes, just like I said
hmm ok im starting to understand
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.
hmmm i see i think
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
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]]
first one.
oh cool woohoo
Helo2 on the left, ["whatyouwaitingforGi", 300, 1] on the right.
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 ?
I don't know enough about the intentions to say.
ummmmm
The JIP seems odd.
Like do you want this playing immediately for players who connect later?
oh no oops
so this is correct just to be sure```sqf
[Helo2, ["whatyouwaitingforGi", 300, 1]] remoteExec ["say3D", 0];
probably
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 ๐
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.
yeah
binary command is the [left, right] one.
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
thx you so much guys i really, really, really, appreciate your help: Everythings working perfectly:
lol _waitWhat lol At Nikko ๐ thx man
Anyone know where I can find the config for the Well Bay doors on the CUP USS Wasp LHD?
id look from Wasp config
Right but there's no "UserAction" section in the Config
does it consist of multiple pieces? like USS Freedom does
Doesn't seem like it, just different variants like Empty, Sea Control, Assault, etc
ok
I don't have the relevant CUP part installed myself so I can't look, but you could check its EventHandlers config
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?
i dont know what exactly you want but you can check if zeus is open like this: ```sqf
!isnull (findDisplay 312)
That is what I am looking for, for entering curator interface:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#CuratorObjectRegistered
Triggered when player enters curator interface -> hideObject on all objects in my array.
Then regularly check if the curator interface is open and unhideObject all objects in my array again.
This should work.
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;
};
you mean the heli lands but doesnt rise after that?
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.
Loiter is a special case, it only works right if it's the only waypoint that the unit has
and I recommend stop using TR UNLOAD waypoint, and try to work with the command landAt, particularly syntax 3
https://community.bistudio.com/wiki/landAt#Syntax_3
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.
it's just a matter of deleting the waypoint and add other types later
you can use setWaypointStatements
not expert with wps but have you tried "UNLOAD" instead of "TR UNLOAD"?
Might need TR UNLOAD -> MOVE -> LOITER anyway.