#arma3_scripting
1 messages · Page 151 of 1
Is there any way to add a preprocessor variable into a string like this?
#define COLOR #112233
private _text = "<t color='COLOR'>Hello</t>";
format can probably do it
private _text = format ["<t color = '%1'>Hello</t>", COLOR];```
Is there a reason why, if you have more than one hold action in the action menu the text for the hold action isn't shown for the other hold actions?
That's a bug.
Any idea if this bug will be fixed or is it a "It is what it is." type thing.
Don't know.
Is there a ticket or something I can view on it to check progress?
code pls?
i have multiple BIS_fnc_holdActionAdd in mission, i think...
ah nvm, i have the same bug
Yeah it's pretty easy to reproduce. I'm sure reforger takes up their resources. I wonder how many dev are actively on arma 3.
dont know, the bug should at least have ticket. if no ticket it probably wont be fixed
Where do you search for the tickets?
If it's a bug in BIS_fnc_holdActionAdd then you can just write your own fixed version.
I imagine that's not the simplest piece of code though.
anyone know where "defines.inc" is located? which pbo...
@tough abyss do you know a better way than setGroupOwner?
Which defines.inc? I'm pretty sure there are several for various systems
The one for Revive appears to be in one of the Marksman DLC addons
looking for the one BIS_fnc_holdActionAdd uses
#include looks at the script file's folder if there's no leading \, so it's going to be in functions_f in the holdActions folder
ok thx
Advanced Developer Tools shows you the function's file path at the bottom of the window in the Function Viewer
I have a hold action. When it completes it gives the player and addAction. It's all working well except if the play that has the addAction dies it is removed from their action menu on respawn. Is there a way to have it so they can keep the addAction on respawn?
I could do onplayerSpawn.sqf to give them the addaction but I don't want them to have access to it every time they spawn. Only if they had access before they died (as in it wasn't used yet)
Seems like you add the action to player itself? If so then add it to an object.
Yes it's on the player itself right now. It's a "touch off bomb" script. If I put it on the object then would that mean the player would have to have line of sight to use the action?
Yes.
Oh but the other consideration is if I put it on the object then ALL players would have access to it right? I just want the player that did the hold action to have it.
Depends on how the action was added. addAction has local effect.
Then you should use, for example, global variable holdActionActivated, check it in Respawn handler and add the action to player itself if it's true.
Im not finding a wiki on holdActionActivated
It's an example of your variable.
Oh okay so yeah my backup was to have a global variable fire in onPlayerRespawn. Is that the same thing as RespawnHandler?
I meant this event handler: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Respawn. I believe it's the same as onPlayerRespawn.sqf.
I've no experience with this one. Does it go in initPlayerLocal?
If you're going to use Respawn event handler, then it should be added where player is local.
As I wrote, I believe it's the same as onPlayerRespawn.sqf, so you can continue to use this file.
Okay so heres what I got:
onPlayerRespawn.sqf: GivePlayerDetonate = true;
that global variable is the condition for the addaction to be shown.
When the player dies they dont have the addaction but if they look at their dead body they DO. So it seems that the addaction stays with the corpse and isn't transferred to the respawned player.
Yes, since it's different objects. Remove the action from the corpse (it's passed to the event handler).
Okay I just read the wiki for removeAction How do I find the actionID? On the addaction wikie it says Return Value But doesn't explain how to find out what it is.
You should store it somewhere. For instance, in player object.
I can't store it if I don't know what it is 😛
Gotta find out what the number is.
@nocturne bluff >count instead of foreaching a crime
Isn't count faster?
Yes but it's a semantic thing
hello! I need help with a script for subtitles. it says "Suspending not allowed in this context" the script in question
call{cutText ["<t color='#00bfff'size='1.4'>Officer: </t> <t size='1.4'>TEXT</t>", "PLAIN DOWN", -1, true, true];sleep 5;call{cutText ["<t color='#00bfff'size='1.4'>Officer: </t> <t size='1.4'>TEXT</t>", "PLAIN DOWN", -1, true, true];
}};
Thank you in advance!
Use spawn instead of call.
changed both "call" to "spawn" and now it says missing ;
Well, add missing ";".
[] spawn {
cutText ["<t color='#00bfff'size='1.4'>Officer: </t> <t size='1.4'>TEXT</t>", "PLAIN DOWN", -1, true, true];
sleep 5;
cutText ["<t color='#00bfff'size='1.4'>Officer: </t> <t size='1.4'>TEXT</t>", "PLAIN DOWN", -1, true, true];
};
spawn the AI directly on the machine you want them on.....
so the second "spawn wasnt needed? I should learn how to code haha
I believe so.
or switch the locality of the group leader
works. Thank you. I will name a character after you
the speed difference is negligible even in a pretty much empty code block
as soon as you start executing more code within the loop
its negligible
Need some help with certain trigger actions
Can someone help me to turn the array into this.
[["30Rnd_65x39_caseless_mag",2,30],["30Rnd_65x39_caseless_mag",2,24],["30Rnd_65x39_caseless_mag",1,2],["Titan_AA",1,1]]
I collect all the magazines to store them in the database, so I want to reduce the length of the array code.
_mag=magazinesAmmoCargo cursorTarget; //The result and you need to turn it into what is written above
[["30Rnd_65x39_caseless_mag",30],["30Rnd_65x39_caseless_mag",30],["30Rnd_65x39_caseless_mag",24],["30Rnd_65x39_caseless_mag",24],["30Rnd_65x39_caseless_mag",2],["Titan_AA",1]] // <-- _mag
Try this function: https://community.bistudio.com/wiki/BIS_fnc_consolidateArray
Or write own based on this function.
This is what I was looking for. I completely forgot the name of this function. Thanks.
I'll have to modify the function so that the number is between the string and the bullets.
_mag =magazinesAmmoCargo cursorTarget; //[["30Rnd_65x39_caseless_mag",30],["30Rnd_65x39_caseless_mag",30],["30Rnd_65x39_caseless_mag",24],["Titan_AA",1]]
_result=_mag call
{
if !(_this isEqualType []) exitWith {[_this, "isEqualType", []] call (missionNamespace getVariable "BIS_fnc_errorParamsType")};
private _cnt = count _this;
private _cntNil = count (_this - _this);
private _ret = [];
{_ret append [[_x # 0, _cnt - count (_this - [_x]),_x # 1]]} count (_this arrayIntersect _this);
if (_cntNil > 0) then {_ret pushBack [nil, _cntNil]};
_ret
}
//_result = [["30Rnd_65x39_caseless_mag",2,30],["30Rnd_65x39_caseless_mag",1,24],["Titan_AA",1,1]];
// {_ammobox addMagazineAmmoCargo _x; } foreach _result;
Rdy 
@candid sun no, but when using macros like GVAR(_protected) it expands out to tag_sys__protected
which is nice for FUNC too because then the filenames are going to be fnc__protected.sqf
which makes it all the more noticable to people working with your code that this is something different
How do I get the attached missile to move with the animation of the bomb loader?
You need to use attachTo to attach it to an appropriate memory point or selection on the vehicle. You can use selectionNames to find candidates.
for zeus created units?
Ok gonna do some research on that
@hallow mortar i checked out the wiki https://community.bistudio.com/wiki/selectionNames and i ran the line of code in the debug console and got this in return
["proxy:\a3\data_f\proxies\truck_heavy\driver.001","wheel_1_1","wheel_2_1","wheel_1_2","wheel_2_2","steeringwheel","fork_1","fork_2","loadbed","light_01","light_02","camo_01","zbytek","wheel_1_1_hide","wheel_1_2_hide","wheel_2_1_hide","wheel_2_2_hide","gas_pedal","reverse_light","daylights","reflectors","mph","fuel","rpm","throttle_handle","fork_handle","decal","id_number_00","id_number_01","proxy:\a3\data_f\volumelightcar.002","proxy:\a3\data_f\volumelightcar.001"]
is this what I'm suppose to look for as the memory point?
Whats a good way to get an AI to not move in a multiplayer evironment. I am trying disableAI MOVE which seems to work but enableAI MOVE wont unfreeze him.
ahhh i see, thanks for the explanation @grizzled cliff
Normally it does?
how to make a trigger fire when ai in said trigger changes behaviour mode?
@deft zealot you basically want to keep a unit local to where it was created
use PATH for both, not MOVE. move basically makes the unit only able to move their head
I think I know whats going on I have a trigger thats server only and player distance pilot <10; in the condition field that lets the AI move.
well, player not existing on the server would be a problem.
indeed
So i have multiple zones set so that when controlled by independents they will complete my zone control tasks, and if they are taken(Opfor control) the tasks are changed to failed, like they are going back and forth taking control of the area. The problem is that if the zones are controlled fully(All zones captured) once but some are taken back by the enemy the trigger doesn't count the newly lost zones and fires anyway. I want the independents to successfully hold all zones AND eliminate all enemy forces, but since i have the zones controlled by IND from the start and they manage kill all the Opfor before retaking the lost zones the trigger activates prematurely. How to fix??
Isn't there a script line for checking or counting if said triggers activated/tasks complete?
I imagine "fork_1", "fork_2", or "loadbed" is probably the one you want, but you might need to do some experiments to get the right one.
// All tasks complete
["task_1", "task_2", "task_3"] findIf { !(_x call BIS_fnc_taskCompleted) } == -1;
// All triggers complete
[trigger_1, trigger_2, trigger_3] findIf { !(triggerActivated _x) } == -1;
ty
units in a group are local to the machine the group leader is local to
just switch the leader locality....
and units are local to the machine they're created on
Interesting bug in Local texture.
I rejoin in lobby and rejoin in server but anyway after setunitloadout unit in local have texture uniform. (but no have in inventory)
mb need wait complete loading screen
(example "time >5")
I didn't get anything, what are the repro steps?
Any ideas how to reliably tell if weapon is a horn? 🤔
Looking at vanilla and mods they use default string for displayName, could check getTextRaw against horn string name, but that won't cover some mods that might use custom name
I'd check if that uses a lethal magazine, does it use FakeMagazine though?
getArray(configFile >> "CfgWeapons" >> "SportCarHorn" >> "magazines") => []
Duh...
SOG:PF horns have magazines though as car horn don't work on non-car vehicles 🤔
A "horn" is just the dry sound of the weapon firing
Which means it's hard to detect if it is
Yeah, I guess checking if there is drySound, empty soundBegin, no magazines is enough for main horns
SOGPF horns gonna need more complex checks
they have simulation="sound" in them but there is nothing like it in vanilla, I guess this does nothing
From what I see reloadTime is 0 for horns (not sure how reliable it is)
There's also enableAttack 0 (probably for AI) and canLock 0
I'd ask "But why?" too. Why you need to check a horn?
Excluding weapons for being counted in rearm procedure. This could be solved by weapon having no related magazine, but I got still curious if there is a reliable way to say if something is horn.
By reliability, I'd say blaming someone who thought it is a good idea two decades ago is reliable
Mod-level solution for something that should've been in-engine 
horns are a shitshow - im pretty sure they're exclusive to car sim too
like I don't think they work on tanks for example
Yeah, that's why SOGPF horns on boats do use mags
Yeah
I don't even know WHY this is the case because it's just a 'drySound'
its like the tank sim is excluded from it
eh, all other sims*
I guess it is in-engine then, so its both mod-level hacky stuff AND in-engine bit that only works for one specific simulation kind
Even worse
Arma bad
yes but i know zeus who disconnect to move the units to the server
i just wnat to give them back if he reconnects
@blissful current i fixed the hold action text missing, I just hope I didnt break anything while I did that 😅 link to mission with the fix: https://drive.google.com/file/d/1lwp0RpIxMy9hu4KVANi1pJ5O9ZMJmaP4/view?usp=sharing Maybe it can be merged with the official hold action
Hi guys !
Is it real to calculate distance between player and missile from vls ?
Or find out the missiles flight time to the target ?
Yes just calculate the speed it flys at and how far it’s flying and that’s how long it will take
Well, can I check the speed with script command or... ?
back to .... zeus ? you mean just make them appear ?
speed velocity etc
no i am talking about locality
why the fuck would you want to switch locality to a player when you have a HC ?
it's increased network traffic for no gains.
It should also be in the ammos config aswell as max speed
do i have a HC?
Oh wow! What kind of wizardry dude you use? 🤣 I'll check out that mission file today.
i hope it works and I didnt break anything. if you have any problems please let me know
every one can figure out what is wrong on these scripts
script is loaded in game, but it didn't lock any turret, and no warning no error, nothing changed
What's [0,2] supposed to be?
AFAIK Abrams tank may have such turret path, so such a path is possible.
In any case, you need to make sure that a turret path is correct.
and _vehicle local
If there was only one possible value for that argument, there wouldn't be any point in letting you specify it.
That argument is the turret path, a way of specifying which turret you want to lock within the vehicle's hierarchy of turrets. [0] is the first turret on the base hull; [0,2] is the third turret on the first turret on the base hull. It's unusual for vehicles to have that many sub-turrets on one turret, but it is possible, and [0,0] is certainly not the only correct turret path.
isn't too crazy. spearhead tanks 0,2 is the pintle MG turret path for the commander/loader
0 gunner, 0,0 commander, 0,1 loader, 0,2 pintle mg
[0,2] is the third turret inside class mainturret >class turret , when [0,0] is the commanderOptic
the turret path is correct, because it works in class UserAction
the hatch script works, it allow player get in commander turret after get out from commander mg
Try to replace _vehicle by _this.
params ["_entity"];
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Init
no, it just doesn't work
simple question or stupid one, how make Ai enter helicopter and start up but not take off_
params ["_entity"];
If (local _entity) then {
_entity lockTurret [[0,2],true];
};
try adding a little delay
also they are right, _vehicle is not defined
Like waiting until the player(s) is inside / some group is inside your heli?
maybe it make sense, I checked the original sqf again, it has param in the headline which I just missed
In long terms yes, so start up heli and wait for soldiers to load up then take off
......because an update was released
Either link WP together between the pilot group and the ground infantry group, or the more precise way is to disable PATH on the pilot until a condition is met.
// Wait for all units in ground group to get in heli
units groundGroup_1 findIf {alive _x && !(_x in heli_1)} == -1
How do I make pilot just start up the engine?
What is the best and easiest way to loop a positional sound? playSound, if I am not mistaken, plays only once. So I need createSoundSource, right?
"need" is a strong word
That's one way to do it, but you can also just make a while loop
But for each sound with createSoundSource I need a CfgSFX and CfgVehicle class created, right?
For each type of soundsource yea
And there is probably no way of CfgVehicle pointing to a normal CfgSound, only to CfgSFX?
idk, why bother.
add to description.ext and done
class CfgSFX
{
class rummagingCorpse
{
name = "Exile Client Rummaging";
sounds[] = {"noise01"};
noise01[] = {"sfx\rummaging.ogg",db+10,1,20,1,0,0,0};
empty[] = {"",0,0,0,0,1,3,5};
};
};
class CfgVehicles
{
class Exile_Sound_Rummaging {sound="rummagingCorpse";};
};
private _soundSource = createSoundSource ["Exile_Sound_Rummaging", ASLtoAGL (getPosASL _corpse), [], 0];

Can you upload everything to GitHub or pastebin?
attachTo example 3 says “automatic offset”.
Does anyone know how to keep this offset but just adjust the height?
Because when I use example 3 it aligns the object perfectly to the surface, but when I do this:
_obj attachTo [player, [0,0,0]];
The object is below the surface
I'm trying to make a vehicle spawn at a specific location, with a pre-defined variable, via an addAction, but my vehicle doesn't spawn at the precise location i want it to spawn, any reason why?
reconUAV setDamage 1;
private _reconUAV = "mavik_3T_BLU" createVehicle [10966.8,7605.22,1.215247];
reconUAV = _reconUAV;
publicVariable "reconUAV";
[_reconUAV, "reconUAV"] remoteExec ["setVehicleVarName"];
i got this code from a forum
Maybe with the help of https://community.bistudio.com/wiki/getRelPos
With your syntax the game searches for a empty spot (Arma can have a weird opinion about that).
Try this
private _reconUAV = createVehicle ["mavik_3T_BLU", [10966.8,7605.22,1.215247], [], 0, "CAN_COLLIDE"];
ty
need some help on an error
_canvasCtrl drawRectangle
[ _ctr
, (_width/2.8)*vectorMagnitude _canvasVect
, (_length/2.8)*vectorMagnitude _canvasVect
, _dir
, [1,1,1,1]
, format (["#(rgb,8,8,3)color(%1,%2,%3,%4)"]+_color)
];
2:15:39 Warning Message: Cannot load mipmap #(rgb,8,8,3)color(0,1,0,1)
Is there a way to end functions prematurely (e.g. void return)? Should I avoid using it?
like midway state iv got what i need stop running the rest?
Sorry man, I don't know how to help you; I was asking a question of my own 😅
i know, im asking are you wanting to exit your function inside of itself with correct conitidion given?
https://community.bistudio.com/wiki/exitWith or https://community.bistudio.com/wiki/try or https://community.bistudio.com/wiki/switch
depends on use case etc
for whole functions i only ever used exitWith
for example:
if (not isPlayer _this) then {
return;
}
if (not isServer _this) then {
return;
};
//rest of the code here...
instead of continuously nesting branches
ok, thanks
exitwith yh
I'm still having issues trying to animate an attached bomb/missile to a bomb loader to be sync together.
this is the code i used
GBU_4 attachTo [BombLoader_1, [0,2,-0.7], "loadbed", true]; GBU_4 setDir 90;
"loadbed, fork_1 and fork_2" are the likely attach points to use but none seems to work, is there something wrong with the code I used or is there something else that I'm missing?
it will just be the wrong mempoint
it will only move if there is a mempoint actualy moving
the bed being animated dosent necessarily meant the mempoint it moving
worst case you could interpolate the offset position between the up and down based on the animation
@graceful kelp i'm not sure what you meant by interpolate the offset position
Do you know why removing all items and gear from newly created units via script right after spawning does not remove their facewear (balaclavas)? Is it possible that the class gear is being added to a unit even after the createUnit commad has finished, ie. overrinding my gear? Because when I appply the script that removes all things from a unit via debug console during the game, it works OK.
//Example
_newGroup = createGroup opfor;
private _newUnit = _newGroup createUnit ["CUP_O_RU_Soldier_MSV_VSR93", position player, [], 5, "NONE"];
removeAllContainers _newUnit; //Backpack, vest, uniform.
removeAllWeapons _newUnit; //Guns.
removeAllAssignedItems [_newUnit, true, true]; //All assigned items (including facewear).
_newUnit;
//Units still keep the balaclavas on their faces.
_heightlow = -0.7;
_heighthigh = 4; //change this to max ofset height
_animationPercent = vehicle player animationPhase "lift"; // change this to correct anim name
_inc = _heighthigh - _heightlow / 100;
_offsetheight = _heightlow + (_inc * _animationPercent);
_offset = [0,2,_offsetheight];
GBU_4 attachTo [BombLoader_1, _offset, "loadbed", true];
you might also need to do that so it moved fowards and backwards a bit
this would need to be in a perframe handler
if you deletevehicle trigger will a JIP player have a copy of it and can potentially trigger it?
Im trying to find a work around for this anyplayer present trigger. Condition is player distance pilot <10; . The activation fires some sound files, system chat, and enableAI "PATH", among some other things. Im trying to find a way that JIP players would trigger all that stuff from happening since they will easily satisfy the condition.
although setting the trigger to server only would solve the JIP issue, I cant do that because it would never fire because player in the condition field wont work
If the trigger is local then yes, all JIP will have it and potentially fire it
As for the condition, try going through a list of players and to check the presence of at least one
Maybe something in the realm of:
allPlayers findIf {_x inArea myTrigger} > -1
Then you can have it only serverside
Interesting. This might work for me. Except I don't want the trigger to fire with players in the area. but if i replace that with a marker that might work
what am i doing wrong here? my current problem is that the interaction doesn't appear at all, the Object is currently a ducttape just to see if the action appears
_Hackersman = ["Hackerman","Hackerman", "", {player setUnitTrait ["UAVHacker", true];},{true}, {}, [0,0,0], 100] call ace_interact_menu_fnc_createAction;
[Hacker, 0, ["ACE_MainActions"], _Hackersman] call ace_interact_menu_fnc_addActionToObject;
can i change variable type in SQF? like, initialize a variable as string:
_var = "foo";
and then change it to, lets say array?
_var = [2, _var];
yuppers. no strict typing
In the dev branch there is getBoneNames, I save this as a variable, then copy it to clipboard, then can paste it in a text file to get all the bone names, how come when using certain bone names as the mempoint and attachTo with followBoneRotation being true, objects don't attach to the correct bone?
I'm assuming a memPoint is a bone name.
I think bones are different from memory points, I guess followBoneRotation really means following memory point transformation resulted from bones movement?
Is there a command you are aware of to get all memPoints? I think maybe it might be selectionNames but the only reference I can find to memPoint is in the attachTo command description.
Bet its ENTITY selectionNames "Memory"
Example uses RightForeArmRoll which is returned by selectionNames so it must be it
This sounds like it, thank you very much
Name memPoints suggests its Memory LOD
Its strange though, because this command when executed on a standard man, does not return spine3but you can attachTo and follow bone rotation of spine3 for a person.
It does for me
"spine3" in (player selectionNames "Memory") => true
Each uniform changes unit selection names btw, it could be modded uniform with non-standard names
Vanilla uniforms are all "uniform" with selection naming nowadays
oh yep, I just misread it, you're correct.
Ok, I think I understand it now, thank you very much!
I think bones are different from memory points
Don't quote me on that, I'm a nobody when it comes to models, maybe somebody with better knowledge can explain
I want to say so, atleast in context to attachTo.
I'm trying to penalize players for looting enemy weapons by simulating unfamiliarity. Using https://community.bistudio.com/wiki/setUnitRecoilCoefficient partially solves it.
I also thought of drastically increasing the reload time. The command https://community.bistudio.com/wiki/setAnimSpeedCoef controls animation such as running, but as the BIKI says, not "upper body animations (reloading, etc.)".
Is there another command that specifically affects those animations?
Nope and I wish there was
GIB setGestureSpeedCoef
Engine doesn't have gesture speed coef
Tho it doesn't seem it would need much work to add
No. mempoint is a selection name in mem LOD. If you want to know which bone a selection is attached to use getSelectionBones
They are different yes
Could be super useful, if this also affects reload speeds and such, sounds like great scripted gameplay opportunity
As well as for cinematics and such
@lone glade no he want to move the AI that spawnd with Zeus to the server
is the function parameter in Params class JIP? I know it's executed globally upon mission start
I found this from the wiki: "You can also instruct the game to execute a script file instead and not just on server but on every client including the JIP clients:" https://community.bistudio.com/wiki/Mission_Parameters#Mission_Implementation HTH
wow I am blind thank you 👍
no i want to move them back to zeus
Hi guys!
What does it mean ? <no shape>
I used: attachedObjects player
could be a trigger
Realy...
But how can I ignore this if I want to check which objects attached to player ?
How does this happen ? When a player enter into the trigger, the trigger attached to him ??
Maybe you could collect from an attached array of your objects,
_objects = attachedObjects player findIf {typeOf _x == "yourWantedType"};
if (_objects != -1) then {
//do stuff if attached object is x
}
Thank you so much
I never would have thought that the trigger would attached when activated
It might not be. It could be some other kind of invisible placeholder thing, maybe from a mod or something.
Triggers don't attach themselves to objects that activate them by default. There would have to be a script actively doing that.
Just check the type of object
How can I force the AI to not turn off the engine when stationary?
Im trying to make enemy vehicles visible in thermals lol
yeah but AI turns it off after a minute @faint burrow
Use a loop where check if engine is turned off.
That's the issue im having, and init scripts dont allow suspending so I cant make a loop.
I tried the following though;
[] spawn {
while { true } {
this engineOn true;
sleep 1;
};
};
But it says this is not a variable.
(Init box)
It's true.
So.. any alternatives?
Pass vehicle object into the script.
this spawn {
while { alive _this } do {
_this engineOn true;
sleep 5;
};
};```
this is passed onto the spawn as _this?
Yes in this case.
Yes, although the names aren't causally connected - inside a script scope, the autogenerated variable _this contains all the arguments that were passed to the script. In this case, there is only one argument, the object reference that was in this in the init field, so we can just use _this directly.
If we'd passed an array of arguments, e.g. [this, 10] spawn { ... then _this would contain that array and we'd need to use select or params to grab the right element.
https://community.bistudio.com/wiki/Variables#Scopes
I see, thanks.
is there a command to disable the simulation of an object?
I have a missile launcher in my mission that shoots down an aircraft. Afterwards it aims the big missile at players LOL. I was thinking of using a trigger to somehow disable it from moving so that it wont break immersion.
Yes, disableSimulation, although you might prefer disableAI (or just deleting the launcher's crew) if you'd like it to remain destructible
Sorry, it's actually enableSimulation with true/false for on/off
SOG:PF uses this one. I will give your advice a try!
I know it doesn't look like it has a crew, but it does, it's just an invisible UAV brain unit
The launcher still spins around with this one:
samlauncher enableSimulation false;
Hmmm how would I find the crew for it? It doesn't some them in the entities list in the editor.
Use crew (for disableAI) or deleteVehicleCrew (for...deleting)
No effect for this one either.
samlauncher disableAI ALL;
Ill try the deleteVehicleCrew now.
Well no, because you can't disable the vehicle's AI, it doesn't have any. You have to use it with crew, like I said. (And the AI feature needs to be given as a "STRING")
{
_x disableAI "ALL";
} forEach crew samlauncher;
* you might also need to use remoteExec depending on where the unit is local and where the script is running - disableAI is Local Effect
@graceful kelp do i just change everything to the correct max height and correct animation name and just execute it?
heightlow = -0.7; _heighthigh = 0.3; _animationPercent = vehicle player animationPhase "fork"; _inc = _heighthigh - _heightlow / 100; _offsetheight = _heightlow + (_inc * _animationPercent); _offset = [0,2,_offsetheight]; GBU_4 attachTo [BombLoader_1, _offset, "loadbed", true];
No effect for this one either. I just had an idea. below will be a picture of the group the unit is in. I think these other units are needed for the function of the missile so maybe I try to diable those instead. But first I try your other examples Nikko
samlauncher deleteVehicleCrew samlauncher;
Thanks for the info!
As it seems straightforward, would there be any use of requesting this via feedback ticket? Or am I just going to irritate Dedmen?
TYVM! This stopped it from spinning. It still reloaded a missile though. Would there be a way to stop that behavior? It's not that big of a deal though it its super complicated. Ill test multiplayer next.
Yes, remove the ammo with setVehicleAmmo and it won't have any missiles to reload
Works great! So cool. I put the disableAI code in a trigger field so it works in MP during my test. I think I'm going to use it in an addaction thats in onplayerrespawn too. In which case I should need to remoteExec it right? Because addaction code is run locally right?
Yes, the action code is run only on the machine that activated the action
You can make a ticket yeah
Making tickets doesn't annoy anybody. At worst it gets ignored
Im having trouble writing a remoteExec for this command. I'm trying to follow the logic of [_left, _right] remoteExec ["command"]; but it looks weird
{_x disableAI "ALL";} forEach crew samlauncher;```
coverts to remoteExec:
```sqf
[{_x "ALL";} forEach crew samlauncher;] remoteExec ["disableA", 0, true];```
The forEach structure is not one of the arguments of disableAI; you don't put that in the remoteExec.
The original formulation is composed of these two sub-structures:
{ } forEach crew samlauncher;
_x disableAI "ALL";```
The `disableAI` is the only part you're trying to convert to a remoteExec. The `forEach` remains as it is.
```sqf
{
[_x,"ALL"] remoteExec ["disableAI",0,true];
} forEach crew samlauncher;```
while {alive _this} do {
_heightlow = -0.7;
_heighthigh = 0.3;
_animationPercent = _this animationPhase "fork";
_inc = _heighthigh - _heightlow / 100;
_offsetheight = _heightlow + (_inc * _animationPercent);
_offset = [0,2,_offsetheight];
GBU_4 attachTo [BombLoader_1, _offset, "loadbed", true];
sleep 0.01;
};
in the vehicle init
Ahhh that immediately make sense when I look at it. I'l count that as progress. Thank you.
{ { _x disableAI "ALL"; } forEach (crew samlauncher); } remoteExec ["call", 0, true];
How would I go about searching for animations? I'm looking for a "pilot takes helmet off" animation.
Its implementation would look something like:
pilot playmove "Takes Off Helmet";
Sleep 1;
removeHeadgear pilot;
There's an animation viewer in the Editor tools menu
Which reminds me:
@little raptor have you ever considered asking POLPOX if you can put their improved animation viewer from the Artwork Supporter into Advanced Developer Tools? It's substantially easier to use than the BI version, not to mention faster, and would be really useful for development stuff.
Trying to get this line of code so that players spawn In the vech when the fast travel as to outside
this addAction ["Teleport to Medical Truck", {
params ["_target", "_caller", "_actionId", "_arguments"];
if (vehicle b_medical_truck != b_medical_truck) then{
_caller moveInAny (vehicle b_medical_truck);
}else{
_caller setPosASL (getPosASL b_medical_truck);
};
}, nil, 1, true, true, "", "true", 5];
And where is your issue/question
One second
Polpox J3FF helped us a year ago to write this line of code that would allow players to fast travel to a different player acting as an officer. We are trying to modify the code so that we can have the player fast travel to the truck and spawn IN the truck. As of now that line of code above cause players to fast travel to the truck. The Issue we have Is they are glitch In the truck and should fast travel INSIDE the truck.
I am trying to modify It so that It will allow players to fast travel In the truck Is all.
Your wordings is very confusing so I can't really understand what's the point
And what your current code does
The code provided above allows players to fast travel to the truck but not inside the truck
Then it does mean that if statement is wrong
How would this be wrote In correct format?
IIRC using vehicle to a vehicle simply return objNull. Which means it always return false
I dont have a specific answer for you because Im a novice but I have this code which puts players in a vehicle. You could try to adapt it to your needs.
{
if (vehicle _x == _x) then {
_x moveInAny vehicle;
};
} foreach units playerGroup; //moves all player to inside vehicle.
It helps me to visualize stuff by separating a few things too:
this addAction ["Teleport to Medical Truck", {
params ["_target", "_caller", "_actionId", "_arguments"];
if (vehicle b_medical_truck != b_medical_truck) then {
_caller moveInAny (vehicle b_medical_truck);}
else { _caller setPosASL (getPosASL b_medical_truck);
};
},
nil,
1,
true,
true,
"",
"true",
5];
Lets give this a try
And since Im new I like to make things simple to start then add. So try this and see what it does first:
this addAction ["Teleport to Medical Truck", {
{if (vehicle _x == _x) then { _x moveInAny b_medical_truck;};
} foreach units playerGroup; //moves all players to inside vehicle.
};
},
nil,
1,
true,
true,
"",
"true",
5];
The line of code did not work
Its still the same result. Player fast travels to truck but on the bottom of the truck glitched In It as to spawning Inside a passenger seat
playerGroup there is undefined then no?
And the last code does not have any setPos. Which means you're not running that code but your old one
We had a line of code that worked with the officer that Is very similar that was created by J3FF on request from me. I will post It.
It works perfect. If the officer Is In a car the player will fast travel to the officer and be placed Into the car
Here the code...
this addAction ["Teleport to Officer", {
params ["_target", "_caller", "_actionId", "_arguments"];
if (vehicle BlueForCommander != BlueForCommander) then{
_caller moveInAny (vehicle BlueForCommander);
}else{
_caller setPosASL (getPosASL BlueForCommander);
};
}, nil, 1, true, true, "", "true", 5];
All we are tyring to do Is make It so that the medical truck players fast travel to, the script will place them Inside the car and not outside.
Why you want to post a very unrelated code when you aren't even trying that this time?
Again, Fox's last code won't do this. You are running your old code
Understood. I have to find a script that will.
...?
Everything works
just the player spawns outside the car
This Is why we are here asking
Its just that one...thing
Why don't you just try Fox's code then?
I did use foxes code
It did what the last code I posted did. It allows you to fast travel to the medical truck but It spawns you outside
Are you sure? 100%? Because Fox's last code does not have setPos
I can try again
With mine make sure your group variable is playergroup.
So I have this in my initServer. Its a loop that updates some marker positions on the map. It works great. But since its a loop I was worried about performance issues. Maybe I dont need to be worried. I dont know. But I was wondering if there was a way to turn the loop on and off at will perhaps with a publicvariable?
[] spawn {
private _offset = [(sin(random 360) * random 100), (cos(random 360) * random 100), 0];
while {true} do {
"PilotArea" setMarkerPos (getPos pilot vectorAdd _offset);
"RescuePilotText" setMarkerPos (markerPos "PilotArea");
sleep 1;
};
};
Depends how many similar things you're running, but unless it's in the hundreds then it's probably not worth worrying about. Swap getPos for getPosATL though, as the getPos is the slowest thing in the code.
Actually the old code is useful because it helps understand where you made the error. Your commander used to be a character, and the check (vehicle _x != _x) determines whether the character is on foot or in a vehicle. The logic being that in Arma the vehicle of an on-foot character is the character itself. The code goes on to provide two alternative executions: one for if the commander is in a vehicle and the other when they are not. You don't need that check or those alternatives if the respawn target is a vehicle.
So, instead of the whole if then statement just put: _caller moveInAny b_medical_truck
Sorry for the unformatted code, I'm on mobile.
And I understand you probably got your issue resolved already but I hope my response can help someone else.
I do thank you for the response. Yes J3FF Did help me and we have everything working perfect for our warlord server
I am trying to add a sleep timer to this @scarlet tree
The timer should be for 1 hour and then It can be used again.
this addAction ["Teleport Truck",
{
params ["_target", "_caller", "_actionId", "_arguments"];
[true] remoteExec ["openMap", _caller];
_caller onMapSingleClick {
b_medical_truck setPosASL (AGLToASL [_pos #0, _pos #1, 0]);
_str = (format["%1%2%3%4%5%6%7", "<t color='#ffffff' size='3'>", "Truck teleported to: [",round (_pos #0), ",", round (_pos #1), "]", "</t>"]);
titleText [_str, "PLAIN DOWN", 0.25, true, true];
[false] remoteExec ["openMap", _this];
};
}, nil, 1, true, true, "", "(str(side _this) == 'WEST')", 5];
as of now the player can keep teleporting this
You could just add variable time+3600 to object.
something like
this addAction ["Teleport Truck",
{
params ["_target", "_caller", "_actionId", "_arguments"];
openMap true;
_caller onMapSingleClick {
b_medical_truck setPosASL (AGLToASL [_pos #0, _pos #1, 0]);
_str = (format["%1%2%3%4%5%6%7", "<t color='#ffffff' size='3'>", "Truck teleported to: [",round (_pos #0), ",", round (_pos #1), "]", "</t>"]);
titleText [_str, "PLAIN DOWN", 0.25, true, true];
openMap false;
};
_target setVariable ["HBZ_time",time+3600];
}, nil, 1, true, true, "", "(str(side _this) == 'WEST') && _target getVariable ['HBZ_time', 0] < time", 5];
And you dont need remoteExec on client, because addaction stament is local, and it will be executed on client machine where its used.
This Is great. I thank you
what are ways to get addActions duplicated?
selectPlayer use, respawn from old to new body, teamswitch?
Ill-conceived remoteExecs
so with flyInheight0 does work but the helicopter does fly up first then it goes down and stays at 0 m. Is there a way to avoid the flying up?
Nope, I don't want to. I can add support for it tho. (so if you have POLPOX's anim viewer it would use that instead of the BI one)
Do you use the forced flag too?
The what?
I mean like this:
heli flyInHeight [x, true]
Eh, the point would be to not need Artwork Supporter loaded (for non-artwork tasks), since it can create dependencies and it's not something that should be used as a mission dependency or loaded in MP.
I have a problem that passengers are disembarking, thus the vehicle is not following its waypoints, when they spot an enemy. Do you know how to prevent this from happening? It happens even if the target is out of the line of sight. I tried disabling COVER and TARGET, but it doesn't help. I don´t necessarily want to turn all AI features off or lock the vehicle. Thanks
Try setUnloadInCombat
Thanks, this solves the problem perfectly.
hi
so i have this script
zCurator addEventHandler ["CuratorObjectPlaced", {
params ["_curator", "_entity"];
_unitName = typeOf _entity;
private _message = format ["%2", _curator];
_message remoteExec ["diag_log", 2];
if (_unitName == "ModuleEndMission_F" || _unitName == "zen_custom_modules_33") then
{
isEndex = true;
publicVariable "isEndex";
}
}];
it logs the curator's placed objects
my issue is, there are times that players get promoted to zeus
the zCurator is a placed object in the eden
how do i go about promoted zeus?
hi, haven't had your exact issue but I know there is the allCurators property, which you might be able to use from time to time to make sure the event handler is assigned to all curators
Does anyone have any suggestions how I could go about reproducing a bug that only occurs when there are at least 5-6 players on the server? Do I just run 6 instances of arma on my PC and pray that it does not explode?
Well what's the bug. Might be able to reproduce it with less
super. got to work something out with what you gave. thanks and cheers
never knew allcurators existed and ive been scripting for 2 years :v
I also keep finding new cool commands all the time lmao and I've been coding for about as long. Sometimes I find a command so cool I build a whole zeus mission around it.
I'm not sure I want to get into details as it involves a 250+ lines of code script with a lot of stuff happening, in other words it feels like a mess I don't want to subject anyone else to 😄 But if you're interested there was the discussion earlier: #arma3_scripting message
Right now I'm just looking for ways to emulate 6 players joining so I can start untangling my own mess
Are there any utility functions to populate a crate with ammunition and supplies for a specific unit (not a class, but an instance)? Just trying to not reinvent the wheel, BIS_fnc_spawnVehicle helped me a lot
@frozen seal The usual trouble with simulating multiple players is that Arma won't allow more than one player to connect with each steam UID unless you enable loopback in the server config.
And if you do that, only 127.0.0.1 works.
You can try getUnitLoadout to get the array with all the gear of the unit.
Then you can use a combination of addWeaponCargo addBackpackCargoGlobal, addItemCargoGlobal, addMagazineCargoGlobal to populate the crate
Send me everything and I'll look through when I get home tonight.
Best to use GitHub
I'd take the offer. At that point the first thing you want to do is get a second pair of eyes on your code to spot potentially problematic things.
does it only apply to dedicated server? I remember being able to run 3 instances of arma on my pc but one of them was the local server
Localhost might have different rules. Personally I couldn't make localhost + client work at all.
If it does work for you then maybe spamming clients with the launcher could work.
alright I appreciate, I do have it in a local git repo but it's been a while since I pushed anything to github because it keeps complaining about my SSO credentials and I can't be bothered.
But I'll try to fix it and push the repo.
Hi guys!
Can't understand why are the 2 sound playing instead of one
{
switch (side _x) do
{
case east: { ["Game_Lose"] remoteExec ["playSound", _x]; };
case west: { ["Game_Win"] remoteExec ["playSound", _x]; };
};
}
forEach playableUnits;
If this is locally hosted MP and the unit on the other side is an AI, then both your player and that AI playable unit will be local to your machine, so both remoteExecs will be sent to your machine
Nvm dedmen can't read
So if this is dedicated server, everything will work fine ?
Mostly.
If any playable units on the same side are AI, then they'll be local to their group leader and the group leader will receive multiple of the same remoteExec, so they could still get duplicate sounds if you have AI turned on for playable slots.
But I have similar case, and in it everything work fine:
switch (_hostage) do
{
case hostage_1:
{
{
if(side _x == west) then
{
["AreaLeaveHostage_one"] remoteExec ["playSound", _x];
};
} forEach playableUnits;
};
...
Well, you've only got one possible sound there, so it would be harder to notice.
If there are multiple playable units, then it's quite possible you are hearing the same sound multiple times, but when that happens it just makes it louder, so you might not be able to tell easily.
(because the remoteExec is only travelling internally in local MP, it can happen on the same frame)
So, with local test, I hear two sounds: one, because of my side, and one, because I am a server, right ?
You'll hear as many sounds (or copies of the same sound) as there are playable units that are local to your machine. AI are typically local to the server, or to their group leader if their group leader is a player, and remoteExecs targeting playable AI units go to the machine where those units are local.
You send a remoteExec to the machine where each playable unit is local.
When you're hosting a game alone with AI turned on for the playable slots, all those AI units are local to you.
So you receive every remoteExec being sent, which is one per playable unit.
On a dedicated server, things still work the same way, but the playable units will be local to different machines.
Units that are actually inhabited by a player will be local to that player's machine, so that player will receive the remoteExec targeted at them.
Units that aren't inhabited by a player and whose group leader isn't a player will be local to the DS, and the DS will receive all remoteExecs targeted at those units. Fortunately the DS doesn't care about hearing all these sounds.
Units that aren't inhabited by a player and whose group leader is a player will be local to their group leader, and that player will receive all remoteExecs targeted at those units, in addition to their own.
* units that aren't inhabited and don't have AI enabled for their slot don't exist, and so aren't counted
If not playable unit will be in player group, the player get two remoteExec instead one ?
Because of locality unit - player leader
Well, it depends on the remoteExec. Your remoteExec only targets playable units, so a non-playable AI wouldn't have a remoteExec sent to where it's local.
If you did have a remoteExec that also targeted non-playable AI, then yes, the machine where they are local would receive as many remoteExecs as it has targeted units.
I'm using POW2 setHit ["legs", 0.5]; to simulate a limp on an AI unit. But players can heal this unit removing the limp. What would be a solution to stop the unit from being healed and keeping the limp animation?
In theory, a handleHeal EH can prevent heals, but at the moment that part of it seems to be broken, to be fixed in 2.18
You could still use a handleHeal to simply immediately do setHit again upon being healed
I've set up the github, sent you a dm for creds
this addEventHandler ["HandleHeal", {
params ["_injured", "_healer", "_isMedic", "_atVehicle", "_action"];
POW2 setHit ["legs", 0.5];
}
];
This still allows heals do it look correct? Its in the init field for the unit.
things I have to do to reproduce a bug.
Sadly my PC was not able to launch 9th instance of Arma
bad news: the bug did not reproduce on the local server. Probably the bug is dedicated-only. I am so screwed 😢
Can you give a rough description?
Are you saying it doesn't work? If so, you might need to delay the setHit.
Exactly. I will add a sleep in there.
you'll need to spawn it too. Can't sleep in an EH.
I get the cant suspend error with this.
[]spawn
{
POW2 addEventHandler ["HandleHeal", {
params ["_injured", "_healer", "_isMedic", "_atVehicle", "_action"];
sleep 1;
POW2 setHit ["legs", 0.5];}];
};
spawn INSIDE the EH code
Also, you can use the _injured variable provided by the EH rather than hardcoding it to POW2 specifically (though you'll need to pass it as an argument into the spawned scope)
ahhh just the sleep then
this addEventHandler ["HandleHeal",{
params ["_injured"];
_injured spawn {
sleep 1;
_this setHit ["legs",0.5];
};
}];```
This doesn't apply the sethit unfortunately.
I tried this which works but is a little wonky cause you can see the blood on the les go away then come back after 1 second.
[] spawn {
while {true} do {
POW2 setHit ["legs", 0.5];
sleep 1;
};
};
And its a while loop which scares me cause I already have 1 while loop in my mission and I don't know how many will hurt performance. Though @granite sky has assaged my fears some since he mentioned you need hundreds.
I don't see the last postet script having much of an impact. Its only 1 command every 1 seconds
Leon! Nice to see you in here!
I'm making a SOG mission. I'd love to have you try it when its ready. Did you see Spearhead is going to do a big update?
Nice, I'll gladly try it. Yeah, I'm looking at Spearhead closely. I don't want to get too off topic here tho.
Ah shit, it actually does. There's no EH for when the heal is actually applied at the end of the animation.
I guess you could just sleep for longer.
Like time the heal animation and match the sleep time to that?
well, it doesn't really matter if it's a bit off.
just as long as it happens afterwards.
If the guy doesn't limp for a couple of seconds then that's not a problem, right
Well when the heal animation finishes the unit gets fresh clothes. So you would see: Bloodly > fresh > bloody if not timed properly is my guess.
Ill try it right now.
Theres an event handler for detecting when an animation is done
Confirmed.
So the implementation would be when animation is finished then set hit?
Might need to wait a frame or two. You're not gonna find any documentation on exactly when the engine applies the healing relative to the animation.
the sweet spot is sleep 7 for this heal animation.
Remember what we talked about with how it's not guaranteed to be 7 seconds
John is suggesting a frame delay instead.
I'm unfamiliar with what frame deplay is. I do see the AnimDone EH on the wiki. Gonna try this real quick
Are there multiple heal animations used here?
Im not sure. but its default ARMA
Triggered every time an animation is finished. Triggered for all animation states in a sequence. This means that the EH would be for the unit doing the healing not the unit being healed though right?
Well, so's the HandleHeal
wait
what the fuck
oh right, added to target but fires local to healer.
I guess that makes some kind of sense.
I'm overwhelmed, LOL. I'm moving on. This is the least jank part of my mission (And I've spent 2 hours already) so the EH that Nikko wrote is good enough. And I can always come back for a polish pass later and revisit the issue.
Thank you for the help everyone! 🫡
Is it possible to prevent player from being moved to sideEnemy (renegade) when doing an illegal action? Especially in MP, where you are then no longer a squad leader, and the AIs are just standing doing nothing?
You can use a rating EH to prevent rating changes:
player addEventHandler ["HandleRating", {0}];
Not my internet points
Could also just prevent it from going negative
Since this is a continuously looping script, would it be easier to simply check damage instead of the animation?
Eg
[] spawn {
while {true} do {
_legdamage = POW2 getHit "legs";
if (_legdamage >= 0.5) then {
POW2 setHit ["legs", 0.5];
};
sleep 1;
};
};
Excuse the tabbing; typing on phone.
is "Steerable_Parachute_F" exclusively for units while "B_Parachute_02_F" exclusively for vehicles? Is there a command to distinguish between the two? typename seems to reduce both to "Objects" and getObjectType doesn't seem to be for this
typeOf returns the class 🙂
but let's say, one is a rifleman and another is a rifleman AT
it will return different values, no?
you can get the "vehicle" in which they are
typeOf vehicle player = "Steerable_Parachute_F"
it is a function that creates and deploys a parachute at a given object
I was trying to make it work for both units and vehicles, but I don't know how to distinguish them
_parachute = if (_unit isKindOf "CAManBase") then { "Steerable_Parachute_F" } else { "B_Parachute_02_F" };
thanks!!
alternatively
_parachute = ["B_Paracute_02_F", "Steerable_Parachute_F"] select (_unit isKindOf "CAManBase");
What would be the final skill level if an AI unit had 0.7 set via Eden skill slider, but a player set the global skill level to 0.4?
this is something you'll have to write a tracking script for to see the results. i don't think the exact formula is known.
test it in your mission
IIRC this graph is correct: https://imgur.com/5pHXGsk
but yeah, if you can test it yourself.
skillFinal
Wich is a HC (Headless Client) or a Player?
Ref to nonnetwork object 735298: <no shape>
from what i understand this indicates sqf command tying to interact with non local entity (FX object here)
what i dont get, why this gets logged in eden hosted - yes its MP, but you are server+client. so its not remote
or is it rather the sqf command expects an object that needs network sync, but the FX object isnt one
I've been seeing it on local only created objects.
Hi guys!
Does anyone know what the problem could be?
When AI unit is sitting in the vehicle, player can't get on the vehicle. But when AI disembarks - player can get into the car
sounds like the vehicle is locked for the player. more info: https://community.bistudio.com/wiki/lock
So, when a unit jumps into a vehicle, it appears to be closing it
It happen after I told my AI unit get in the vehicle
Using radio command
what kind of vehicle, script created, or editor perhaps?
Doesn't matter. I try it with two vehicles: one, created by the editor, second created by the script command createVehicle
ok
All happen after I told my AI unit get in the vehicle. After that, nobody can get in the vehicle
weird
Is it right implementation ?
private _hostageArray = [hostage_1, hostage_2, hostage_3];
{
_x addEventHandler
[
"Killed",
{
params["_unit", "_killer", "_instigator", "_useEffects"];
_killerSide = side _killer;
{
if(side _x == _killerSide) then
{
["Game_KillHostage"] remoteExec ["playSound", _x];
};
}
forEach playableUnits;
}
];
} forEach _hostageArray;
Player can't hear playSound
you can omit the side check and playable unit stuff by just passing the side that should hear the sound as target parameter
private _hostageArray = [hostage_1, hostage_2, hostage_3];
{
_x addEventHandler
[
"Killed",
{
params ["", "_killer"];
["Game_KillHostage"] remoteExec ["playSound", side _killer];
}
];
} forEach _hostageArray;
Thanks)
I've had an issue where music triggered by a script stops when players leave a vehicle. Is there any way to fix that?
pls show the code
there's no code associated that I can visually see anywhere. I'm using vanilla trigger modules and using the Effect dropdown to play music. I'm wondering if there's a script-based workaround for this or something I'm missing.
im not familiar with effect dropdown but maybe its attached to the vehicle only or something
I'm testing now; driving into a Blufor Present trigger with a music effect has the music keep going even after I get out. Even syncing the trigger to the vehicle doesnt change anything.
Could you be using a mod that disables music or dynamically changes audio levels so it's muting music when on foot?
I might, but I've had this issue across mod lists. I appreciate it, I'll just work around it tbh
maybe it stops playing the music when the trigger's condition is no longer met - just a guess
I have a problem with a mission, and unfortunately it only popped up now, 1 hour from the mission starting, if anyone has suggestion on how to fix it, i would really appreciate it.
I have made use of the Artillery support module, and i synced it to a 2 players, and they both works - In Singleplayer. I also tried to host a server on my computer and it worked just fine. However the support does not seem to be enabled on a dedicated server, any ideas? (Edit: I have tried to look online for fixes, but it's all about scripting, and it's too convoluted to make sense for me 😦 )
how to create sleep between spawn scripts? I already have sleep in every spawn script, but it's more complicated because I can't type the same one, for example, sleep 5; for each spawn, I write so, sleep 5; sleep 10; sleep 15; if I want to spawn units in order
Could you share your content.
How do you want to delay spawn?
Every group?
Every unit?
Without content it's hard to say where you should use sleep and how.
problem is there are waitUntil loops, how to spawn in order
Uh, not 100% sure what you're trying to do, but just put the unit creation serially and spawn the escape/retreat loops instead?
Also put a sleep in those waituntils. They're wasting a lot of script time.
Example with some refactoring:
private _fnc_spawnGroup = {
private _group = [getMarkerPos "spawnunits", west, (configfile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "SpecOps" >> "B_T_DiverTeam")] call BIS_fnc_spawnGroup;
{
_x setSkill ["general", 0.9];
}
foreach units _group;
_group;
};
private _fnc_retreat = {
params ["_group"];
waitUntil { sleep 1; {alive _x} count units _group <= 3 };
_wpp = _group addWaypoint [getMarkerPos "escapepoint", 0];
_wpp setWaypointType "HOLD";
_wpp setWaypointSpeed "FULL";
_wpp setWaypointCombatMode "BLUE";
};
sleep 5;
private _grp1 = call _fnc_spawnGroup;
[_grp1] spawn _fnc_retreat;
sleep 5;
private _grp2 = call _fnc_spawnGroup;
[_grp2] spawn _fnc_retreat;
Wow, this is not bad, I will also try this way. what I want is to spawn different units together with the escape loop in order after sleep. I put another script with different units along with different escape loops to see what I want: ```0 spawn {
--1--
sleep 5;
_grp1 = [getMarkerPos "spawnunits", west, (configfile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "SpecOps" >> "B_T_DiverTeam")] call BIS_fnc_spawnGroup;
{
_x setSkill ["general", 0.9];
}
foreach units _grp1;
waitUntil {({alive _x} count units _grp1 <= 3)};
_grp = group leader _grp1;
_wpp = _grp addWaypoint [getMarkerPos "escapepoint", 0];
_wpp setWaypointType "HOLD";
_wpp setWaypointSpeed "FULL";
_wpp setWaypointCombatMode "BLUE";
};
0 spawn {
--2--
sleep 10;
_grp1 = "CUP_B_M163_Vulcan_USA" createVehicle getMarkerPos "spawnvehicles";
createVehicleCrew _grp1;
{
_x setSkill ["general", 0.6];
}
foreach units _grp1;
waitUntil {({alive _x} count units _grp1 <= 1)};
_grp = group leader _grp1;
_wpp = _grp addWaypoint [getMarkerPos "escapepoint", 0];
_wpp setWaypointType "HOLD";
_wpp setWaypointSpeed "FULL";
_wpp setWaypointCombatMode "BLUE";
};```
I leave the rework as an exercise for the reader
setCombatBehaviour is a Global Execution. So if I have that in the activation field of a Server Only trigger I *shouldn't * need to remoteExec it right?
Global effect. But yes, you don't need to use remoteExec to apply effect globally, but you need if you want to use this command to non-local units.
If you unit is local, then no
But if isn't then you need exec there where unit is local
The unit is placed in the editor. So who is it local to then?
@blissful current translation for the other comments. because the command requires a local argument (shown by the LA at the top of the page), it needs to be fired on the local client that owns that unit/group, but the effect of the command, is seen everywhere
[_unit, "AWARE"] remoteExec ["setCombatBehaviour", _unit];
[_group, "COMBAT"] remoteExec ["setCombatBehaviour", _group];
if a player takes over that group, then the locality changes. so its best for LA arguments to use remoteExec or CBA target events. If the group/unit is already local to where the script is running, then it will just do it without the network usage. Applies to all LA commands.
Ahhh that explains why I've been having to remoteExec enableai and allowdamage on server only triggers! 👏
So to keep everything in sync for JIP players you would need to add that true to the last index in the command right?
I would add _unit and _group respectively.
I'd be careful of doing that, because only one JIP message can be attached to an entity (e.g. unit or group) at a time.
For example, if you do this:
[_unit, "AWARE"] remoteExec ["setCombatBehaviour",_unit,_unit];
[_unit, "AUTOTARGET"] remoteExec ["disableAI",_unit,_unit];```
the disableAI JIP message will overwrite the setCombatBehaviour JIP message, and only that one will be applied for JIP clients.
If you know what you're doing it can work to your advantage (for example, overwriting old JIP messages with new ones that countermand them) but it's risky, because some other mod or script can still butt in with their own JIP message and overwrite yours. \*and even if you do know what you're doing, it's still only one at a time per entity
I know that.
but they might not, and their script might include other remoteExecs that would conflict with this
Yeah I didn't know that. So in my case, since its only one JIP message per unit then this should work, right?
[ranger, "CARELESS"] remoteExec ["setCombatBehaviour", ranger, ranger];
[rangercopilot, "CARELESS"] remoteExec ["setCombatBehaviour", rangercopilot, rangercopilot];
[doorgunner1, "CARELESS"] remoteExec ["setCombatBehaviour", doorgunner1, doorgunner1];
[doorgunner2, "CARELESS"] remoteExec ["setCombatBehaviour", doorgunner2, doorgunner2];
does setCombatBehaviour remExec need JIP support even when the execution is global?
i thought that might be something arma handles automatically
its a pretty rare instance that you need JIP compat for this scenario
not everything needs JIP when using remoteExec. only in specific instances. but I've been seeing that you seem to use it on every idea @blissful current
Yeah it has to do with my anxiety that the mission would break if my friends computer crashes (happens a lot) and has to return to the mission. And since I don't have a full understanding of the functionality its my first worry.
For example: I had [pilot] join (group player); in a .sqf and if the group leader left and came back the unit pilot wouldn't be in anyone's group. So then I decided to remoteExec this and JIP true. Now the player that left and came back still has pilot in their group.
Now there's a lot of moving pieces that I don't understand so this was my perception of the events but something else might have been going on.
And since I dont know the answers to this stuff I just test it with the client connected to LAN like you showed me and adjust from there until it works.
I just tested your script and it works perfectly, it seems to be faster and easier. It is still being tested, so I will contact you if there are any problems 👍
Okay perfect example. I have this in an addaction:
[ptboat, ["timebomb",50]] remoteExec ["say3D", 0] //play tick tock sound file
sleep 40; //wait till sound file is done playing
"M_Mo_82mm_AT_LG" createVehicle (getPos ptboat); //spawn explosion
If the client that does this addaction exits the server then the explosion never happens. Even if they they come right back. So this is where I want to do the true for JIP right?
Does anyone know of a way to set unit 2's move/gesture on unit 1's client (so locally) when both units are players? Using switchMove/gesture work only when unit 2 is moving, if they are stationary then their original gesture is played instead
responded to your dm about this
After taking the item, and put on the same place, show 0 items in area instead of 1
private _objectsInTrigger = nearestObjects [getPos e1, ["Item_SecretFiles"], 5];
private _neededItems = _objectsInTrigger select {typeOf _x == "Item_SecretFiles"};
The item is in a weapon holder.
And after putting it back on the ground too ?
Yes.
But if I want to check items by the class name, which locate in the area, which way should I choose to implement this ?
Try this:
_holder = (nearestObjects [e1, ["GroundWeaponHolder"], 5]) select { "Item_SecretFiles" in ((getMagazineCargo _x) select 0) };
1> INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe'
1> Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
When you really broke something.
😛
Can someone please tell me why this is not triggering a flare to launch? (Coordinates are accurate) Also independent is the enemy faction (I'm running a script to make them hostile))
No, the problem is that the script is running on the client that triggers it, so it disappears before it does the createVehicle. What you'd need to do is have the addAction remoteExec a function on the server to do the rest.
If you added JIP to the remoteExec then all it'd do is start the tick tock sound for players that joined afterwards.
Doesn't "Type" still need to be set?
Also why are you making the flare a global variable
Also are indep hostile from the start? If so, you can just change allegiance in "Attributes > General... > Misc"
So Type could be set to guarded by indep I guess
as for global variable I was told that If I wanted the flare to activate a script that would spawn a helicopter reinforcement I needed to do it this way... this may be wrong correct me if it is
and eys Indept are hostile although its through a script
So Type could be set to guarded by indep I guess
That's for guard waypoints
as for global variable I was told that If I wanted the flare to activate a script that would spawn a helicopter reinforcement I needed to do it this way... this may be wrong correct me if it is
That depends on how you're calling that script, and if you don't touch the flare object itself, then there's no point in making it global
and eys Indept are hostile although its through a script
I was asking if they're hostile from mission start, if they are, just change the setting
Also you can ignore the type thing I said, I haven't touched triggers in a long time
Then just change their allegiance in Attributes > General, you don't need to script it
As for testing your trigger, try just having something like systemChat "trigger executed"; to make sure it's being activated correctly
I'll see if it triggers (I've tried already and there was no flare so I at least want to see if it tries to run it)
So I can confirm that the trigger is excecuted but no flare 😦
https://community.bistudio.com/wiki/Initialisation_Order
In relation to the initialisation order for JIP players, when are
- remoteExec'd functions (jip=true)
- publicVariables
- setVariable (global=true)
ran?
Hey, real quick, using side can have some unusual results when used on units.
// use
side group _killer
// instead of
side _killer
None of those are specific to initialisation order, those are all statements that are executed during whatever step they belong in. That's like asking when systemChat executes, it depends on when the file it is present in is executed
no.
When they get called, they are JIP'd. So when do they run for JIP players.... Clarification added ^
That's a huge difference
But yeah, not even https://community.bistudio.com/wiki/Arma_3:_Remote_Execution says when they're executed
🙃 thats why im asking here, so hopefully someone that knows, answers....
I meant it more as surprised that it wasn't listed
Oh, yup! 🙃 🙃
For refenence:
https://community.bistudio.com/wiki/Initialisation_Order
In relation to the initialisation order for JIP players, when are
- remoteExec'd functions (jip=true)
- publicVariables
- setVariable (global=true)
ran?
anyone got the antistasi loot crate script? i need something that allows vehicle inventory to be sent to the arsenal
Test your code in the debug console, also use the Advanced Developer Tools mod if you're not already
https://steamcommunity.com/sharedfiles/filedetails/?id=2369477168
And no, it does not create a mission dependency
will do thanks
remoteExecs and remoteExecCalls appear to arrive after all publicVariables and global setVariables. Not sure about the order of publicVariable vs setVariable.
Also the order seems to be wrong in that table, and initPlayerLocal actually fires after postInit.
That is expected. It says that order is not gauranteed for the root init files.
Well, there's a BIS_fnc_log entry for initPlayerLocal that fires before postInit, but it doesn't seem to actually execute the file until after the postInit.
So remote execs run after global variables.
From my testing, it seems that remoteExecs and global variables are ran before even preInit functions...
Which is kinda wild.....
But that is on my two clients on a single computer... So I dont know if network latency over a server may have a different scenario (order not gauranteed)....
The remoteExecs ran after preInit here. Also local.
Maybe nothing is guaranteed and Arma is a total shitshow :P
So my testing is a setting a variable, and I checking to see if the variable exists in a preinit function, if it does then do not set to the preinit variable value (var=1)
Global variable set (var=0)
*test join -> global variable ran before preinit (var = 0)
remoteExec spawn function that sets that same variable (var = 2)
test join -> remoteExec ran after global variable set and before preinit function.(var = 2) (would this reverse if I ran remoteExec spawn before global variable?)
RemoteExec is after preInit.
Curiously, all the remoteExecs appear to maintain execution order (both for JIP and non-JIP), regardless of remoteExec and remoteExecCall mix.
But then it is apparently possible for remoteExecs to be silently dropped under heavy network load.
How do I make it so that a NPC with a machine gun shoots semi automatic and not automatic
Config only. You can't do that with script, as far as I know.
Well, unless you disable a bunch of AI entirely and use manual fire, but that's not usually an option.
his addEventHandler ["Fired",{
params ["_unit","_weapon","_muzzle","_mode"] ;
private _scripted = _unit getVariable ["_scripted",false] ;
if (_weapon == handgunWeapon _unit and _unit ammo _muzzle != 0 and !_scripted) then {
[_unit,_muzzle,_mode] spawn {
params ["_unit","_muzzle","_mode"] ;
for "_i" from 0 to 2 do {
sleep ((random 1) + 5) ;
_unit setVariable ["_scripted",true] ;
_unit forceWeaponFire [_muzzle,_mode] ;
_unit setVariable ["_scripted",false] ;
} ;
} ;
} ;
}]
As far as my use case goes, Im handling data synchronization that should't be overwritten by initialization. A mixed use of remoteExecs and global variable sets is confusing, so I just need to pick one.... Thanks for the info!
This is the opposite case tho
An easier way might(apparently not?) be setting group fire behavior between fire at will and forced hold fire?
They're not gonna stop mid-burst just because you changed group behaviour.
Well, I'd be very surprised anyway. That would be a horrible waste of CPU cycles in most cases :P
IIRC even with semi-auto they're kinda hard to break in the middle of a volley.
Ive zeused before and Im 99% sure thats how it works (that 1% is a pain in the butt cause nothing 100% with arma)
But testing it rn, GROUP setCombatMode "GREEN" does seem to stop the MG from firing almost instantly
And swapping to YELLOW causes him to fire again
yeah but can you make them fire one bullet at a time with 0.1s sleeps :P
Perhaps you could use a Fired EH and setWeaponReloadingTime to force something that is like semi-auto
what's the best way to get CfgSounds/CfgMusic entries from just the mission's description.ext?
is it possible to get all of them using https://community.bistudio.com/wiki/missionConfigFile ? i think i've been awake too long to figure it out now
Hi guys!
Do not understand a little bit: this event handler should be in initServer.sqf or in init.sqf ?
In initPlayerLocal.sqf I would say.
How bad are publicVariable hashmaps with less than 100 entries ?
[playerUID, [123,1234]]
Shouldn't be to bad, or ?
Depends on how often you set or get it. If its used in the scheduled environnent then it should be fine
If I have a trigger named Trigger1 set to Server Only and reference it in a if statement withing initPlayerLocal will it work? Im
if (triggeractivated trigger1) then {}```
The trigger could be local or remote Does remote mean Server?
Don't broadcast the whole hashmap, broadcast changes and let each client handle it
Remote means that another machine owns it
Or just don't clog the scheduler at all
Broadcasting a hashmap of 100 entries every couple seconds wont clog the scheduler
What does scheduler have to do with this anyway?! 
Every command is unscheduled. It doesn't make any difference where you run a command. All of them affect the game the same way
The only thing the scheduler can help with is running CODE (i.e. groups of statements) because then it can pause between commands (with the exception of isNil ofc, as it runs the code unscheduled)
Do you think it is a good idea to give players an option to choose from two or three enemy AI skill levels at the start of a mission, or is it better to have just one default difficulty? Thanks
There is no technical answer to that.
It literally just comes down to "do you want to put in the effort to implement a difficulty parameter?"
Wasn't talking about hashmaps specifically, I was talking about using scheduled at all
IME Arma player skill has such a wide range that you have to give people as many difficulty options as possible to keep them happy.
There's also the preference for more/worse enemies vs fewer/better enemies.
I did that like this.
But they will not be able to change it later on the fly.
If you've already put it in then 🤷
It doesn't do any harm to have it in as long as you're willing to maintain it and balance for it. The only reason not to have it is "I don't want to do it" - which can be a valid reason, but my point is there's no real technical or philosophical argument why it shouldn't be done in principle.
The only slight problem is when they choose Extreme and realize after 5-10 minutes that it is unplayable for them, leading to a restart. 😄
That's quite normal. There are plenty of full complete AA+ games where you can't change difficulty partway through.
That's not a "should I or should I not implement the system" issue, that's a "do I want to put in the effort to make a mechanism for mid-mission changes" issue, and if the answer is "no" that doesn't mean you have to remove the system entirely.
I will probably need to learn creating some simple GUI dialogues for these kind of things. Action menus are not the best for this. But thank you guys for tips. 🙂
That would be a remoteExec for every player, also JIP for joining player etc. Doubt that is better in terms of network performance.
Iam not sending huge hashmaps, absolute worst case its like 100 entries.
Only if a player gets revived, so not very often.
Drop in an ocean then
The king of hashmaps has spoken 😆
Thanks for the inuput
If you happen to use the zen mod, it has a dialogs script that can be used for quickly writing dialogs.
If you want some examples of vanilla or zen dialog scripts, DM me.
I don't know which channel is better to write to on EXTDB3, so I'm writing here.
I've been trying to figure out why I have an error for 6 hours now
(SQL Invalid Number of Inputs)
extDB3: SQL: Error extDB3Exception: SQL Invalid Number of Inputs Got 1 Expected 6
extDB3: SQL: Error extDB3Exception: Input: createPlayer:13456:and:["1"]:1:1:3
[createPlayer]
Input SQF Parser = false
SQL1_1 = INSERT INTO players_table
SQL1_2 = (uid,name,lastloadout,rank,playedtime,status)
SQL1_3 = VALUES
SQL1_4 = (?,?,?,?,?,?)
SQL1_INPUTS = 6
"Extdb3" callExtension "0:SQLState:createPlayer:13456:and:[""1""]:1:1:3"
I have already tried all possible changes and options for passing arguments. I even looked at the sources of the abstract class, but I still do not understand why the error appears.
Sqf parser = true
(Config Invalid Number Number of Inputs)
->
[createPlayer]
Input SQF Parser = true
SQL1_1 = INSERT INTO players_table
SQL1_2 = (uid,name,lastloadout,rank,playedtime,status)
SQL1_3 = VALUES
SQL1_4 = (?,?,?,?,?,?)
SQL1_INPUTS = 6
"Extdb3" callExtension "0:SQLState:createPlayer:[13456,and,[""1""],1,1.2,3]"
extDB3: SQL: Error extDB3Exception: Config Invalid Number Number of Inputs Got 1 Expected 6
extDB3: SQL: Error extDB3Exception: Input: createPlayer:[13456,and,["1"],1,1.2,3]
Help me :'c
Ps.
Find problem...
need was write
SQL1_INPUTS = 1,2,3,4,5,6
SQL1_INPUTS its array params , not number count
'huh, I mean I know its been ages since I touched this script, but why isn't it advancing past thi-'
sleep 4043;
Oh. 🙃
try without Input SQF Parser param
And the first formatting
So I have an array of itemtype, count pairs (from getItemCargo) and I want to set another unit's cargo to it. But foreach deep-iterates the nested array. What is the simplest way to write the non-deep version of {_car addItemCargo [_x select 0, _select 1]} foreach _savedItems;?
forEach does not "deep iterate", the way you've written should work fine (aside from _select 1 -> _x select 1)
let me get some logging going
That being said, if each element of your array is already in the ["classname",3] format and has no extra elements, you can just use _x and not bother selecting each element individually
So I log both the whole array I am foreach'ing over and each _x in the loop. and I get:
19:59:46 (0:00:07) Adding [["ACE_rope6"],[1]] to cargo
19:59:46 (0:00:07) Add ["ACE_rope6"] to 1e238442040# 1779972: lsv_01_f.p3d
19:59:46 (0:00:07) Add [1] to 1e238442040# 1779972: lsv_01_f.p3d
Code:
["", "Adding %1 to cargo", _vicItemCargo] call mc_fnc_rptlog;
{
["", "Add %1 to %2", _x, _spawnUnit] call mc_fnc_rptlog;
_spawnUnit addItemCargo _x;
} foreach _vicItemCargo;
Oh I am anidiot, it's not pairs. it's alternating.
sigh whyyyy
That'll do it
Guess I'll have to whileloop it an use i=i+2
Unless someone knows of a helperfunction (CBA?) to save and load whole-vic inventories
@faint dove _music = "true" configClasses (missionconfigFile >> cfgMusic);
I'm trying to remoteExec this working code:
playSound3D [getMissionPath "sound\PlaceBomb.ogg", getPosASL ptboat, false, ptboat, 5];
So I used the [left, right] logic to get this but it doesn't play the sound like the above one does:
[getMissionPath "sound\PlaceBomb.ogg", getPosASL ptboat, false, ptboat, 5] remoteExec ["playSound3D", 0];
playSound3D has already global effect.
Even when played from within an addAction like Im doing?
Yes.
The reason your remoteExec doesn't work is because remoteExec is interpreting your array as an array of arguments, like this:
[_left, _right, _wait, _up?, _down?, _what?] remoteExec ["playSound3D"];```
if one argument is an array (as playSound3D's right argument is) then it needs to remain an array within the array of arguments given to remoteExec
[[getMissionPath "..", getPosASL ptboat, ...]] remoteExec ["playSound3D"];```
(don't actually do this because of playSound3D being global effect already, but it applies to other single-argument commands too)
Ahhh Okay so In this instance it doesnt have a "left" spot. And I need the double brackets.
What are the use cases of PlaySound3d versus Say3d? I cant figure out which one is better over the other?
playSound3D is global (by default), can use positions without needing an object source, uses file paths instead of CfgSounds classes, isn't one-per-object-at-a-time, and doesn't follow the object source [if there is one]
It's not a case of "one is better", they do different things
Greetings folks, would anyone care to help me out with a certain problem? It's about an .sqf script not being found. 😦
I'll create a thread about it if anyone wants to join.
sqf script not found
@jade abyss a player
I’m trying to find a way to turn an aircraft into a UAV to make it controllable similar to a CoD killstreak. Any ideas on how to script it?
Context: I want my player base to have air support that is player piloted by Zeus/scenario controlled. I’d much rather keep the gun in the fight than have him sit in the airfield. Ideally, I imagine having an aircraft suspended in air, engine on, with a set velocity but simulation disabled. On queue, I notify the players “air is on station and ready for tasking, nominate a controller and go to town”. At that point, I’m faced with either teleporting a player from the ground into the aircraft or allowing it to appear on his UAV terminal and he take control of the aircraft (simulating a JFO/JTAC coordinating with it)
The Init.sqf is also being executed on JIP players, right?
yes
thanks for the sanity check
Does anyone have an explanation as to why this script works only for the transport unload and not for the Move?
_x disableAI "TRANSPORT UNLOAD";
} forEach units Heli;
{
_x disableAI "MOVE";
} forEach units Heli;
_x enableAI "TRANSPORT UNLOAD";
} forEach units Heli;
{
_x enableAI "MOVE";
} forEach units Heli;```
I should mention 1st script is on the heli 2nd script is on the trigger
chatGPT?
TRANSPORT UNLOAD isn't a valid option for disableAI. MOVE might not do anything for units when they're in a vehicle. It's not clear what you're trying to do with it.
I'm trying to have the heli move until its the right time to move and then when it IS time to move that It just drops off the troups
Ok, what's probably happening is that disableAI "MOVE" prevents the units from unloading.
but it doesn't prevent the pilot from flying.
Not tried either though.
essentially when the trigger gets activated the chopper should fly and come bring the troupes down and then it should fly away
Not sure exactly what units does with a vehicle input either. It's undocumented.
the units are unloading btw its just that the heli doesn't fly off even after the units have left the area
Why are you expecting it to fly away?
because after the transport unload there's a move waypoint placed further
You mean after a transport unload waypoint?
exactly
How far away is the move waypoint?
about 500m
Normally the two waypoints are sufficient. It'll land near the transport waypoint and unload the cargo group. Then it'll take off and fly to the move waypoint. All the other stuff isn't necessary and is possibly breaking it.
just tested in editor.
When using the Respawn EventHandler I'm having problems getting the unit to play an animation, the unit goes into the animation, but doesn't move about like the animation is supposed to. It's almost as if the simulation is disabled? Here's the snippet:
...
_unit attachTo [_stretcher, [0, -0.125, 0.45]];
[_unit, "Acts_LyingWounded_loop"] remoteExec ["switchMove"];
["Initialize", [_unit, [], false, true, true, true, true, true, false, false]] call BIS_fnc_EGSpectator;
...
This is just the snippet of it, I'm trying to animate the _unit or _this select 0 The unit is moved to the stretcher and lays down like the animation does, but then no simulation of the unit moving his eyes, head, breathing and etc
Here's the EH:
player addEventHandler ["Respawn", {
params ["_unit", "_corpse"];
[_unit, _corpse] spawn sof_client_medical_fnc_respawn;
}];
Heli flyInHeight 50; Adding this to the TRANSPORT UNLOAD waypoint completely fixed my issue now I just need to find how to despawn it that should be easy though
deleteVehicle Heli;
No simulation, just lays there, not sure what I did wrong, lol
That's the _unit or _this select 0 that would spawn in if I enable the respawn, the _corpse or _this select 1 gets deleted.
Is this a player or an AI?
I'm working on the economy part of my framework, the player needs to have enough money to spawn back in, if not they spawn on a stretcher and go into spectator mode until an admin spawns them back in.
This would be the player once the respawn process finished.
Maybe it's working as intended when it comes to the engine, because as soon as I give myself or the player money to pay for the respawn, that unit becomes the player. Which then the player gets up from the stretcher and is back to normal, lol
A quick question for replication: is there a reliable way to, on "Fired", move the projectile ownership from the client that launched the projectile to another client to fix the problem with lagging/rubberbanding jets avoiding SAMs? Could also avoid people who fired the SAM shot from lagswitching too, but that's less of a concern for me.
Seems like there could be a lot of issues with doing this, but wondering if any of the more multiplayer focused scripters have explored this approach.
Hi guys!
Can you give me a couple of tips for my case:
I'm interesting in set upping an AI units. So, in my mission I made hostages ( AI units ) which players can lead and force to follow. The technical part is ok, but units behaviour - something incomprehensible
So, the first problem was when units run away if hear some sounds, like a shoots. To solve this, I used behaviour shutdown - well, helped. So each time when units stayed by themselves, they stayed with behaviour shoutdown
The second problem was when player force to get in the vehicle, but in this case, after unit got in the vehicle, vehicle closed for everyone. After so many tests, I think, that this closing the vehicle by the unit maybe was because of different sides between player and unit - maybe no, just assumption
And the last problem was when a player give unit some radio command ( move to, get in ) and after this, unit, after he leaved a player group ( when player force to follow - unit join to group player, when stop follow - on the contrary) he could perform a previous tasks. For example, player give a radio command move to the place, but after stop following, unit could perform previous command get in the car
Units side: independent
Players sides: west, east
Projectiles are local already
I meant move the SAM missile projectile to the target client. So if the target client rubberbands, the missile is still tracking it.
And like I said they are local to every client. The game replicates them for everyone
Its neither pairs, nor alternating.
Its two arrays.
ty! having a look.
yeah, that's roughly what I implemented, though my code is not as fancy 🙂
I think this depend on your mission. Its not a bad decision to add them, but if you set up parameters there is always the possibility of no one ever using anything but default or nothing but the easiest, imo it will be related to your design view of your own mission and how flexible you are willing to be. For example, If I desing a mission to be extremely hard, and thats how I go on a balance it, I would probably use the hardest AI option I give as default.
I'm looking for a way to reverse the keybinds for how you back up and turn in a tank. For some reason it's opposite cars and other vehicles. I've done some research and havent found exactly what I'm looking for but maybe someone has seen the solution before? Here are some options that might work.
-
A mod that lets you have separate vehicle keybinds. For example: in default ARMA you have separate helicopter and vehicle keybinds. Some way to further separate the keybinds to make tanks their own keybind list would work.
-
The following page seems to be talking about keybind chaging on the fly. In theory I could add an event handler to a vehicle to look for a keypress and execute this keybind mod? https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding
The reason it feels different is because tanks have tracks instead of steerable wheels. If you were to somehow reverse the controls then it would be opposite moving forward.
So it can be achieved with a shift modifier. For example:
This makes it so the tanks reverse like in all other games while still driving forward with regular turn keys. Only problem is it does that for all vehicles in reverse. Cars too. So my idea was to somehow use that modded keybind to achieve this effect for just the tanks. And if I was able to get that working then maybe it would be possible to switch positions in the tanks with number keys too like all other games "1: Driver, 2: Gunner, etc" (instead of the cumbersome action menu).
That's only true for shotBullet IIRC. Larger stuff is only local on the firing machine.
As far as I know this is not possible. We don't have access to engine input actions like "turn right" etc through scripting, and modded keybinds work by scripting.
There is only one left/right shared with all the vehicles.
There's no way to split them to have an extra set for tanks
and you also cannot change the keybinds when you get into tank
If it could see the player use S+A but somehow use in S+D instead then maybe that could work?
better ask in #arma3_tools
Yeah but you can't, that's what I'm saying. You can detect the player using whatever keybinds, but we don't have access to the engine input actions to then give our own movement instructions.
Knowing when the player is turning and reversing is possible. Sending the opposite inputs is not possible.
Thanks for the advice 🙂
Ah gotcha. What about loading a profile keybind on the fly? Like a player is detected in the vehicle then it loads profile?
But the launching client has authority on where its location is, right? So if either of the client experiences a lag spike, the missile is not going to correctly adjust its flight path.
Here's a picture of what I'm talking about: https://i.imgur.com/YjjNnMG.png
Is it expected for an object with its simulation disabled to collide with another object? There isnt a roadway lod in either of them. One is a simple object, the other is a car
Is there an eventHandler (vanilla or modded) for when a player swaps sides?
swap sides in what way
there is UnitJoined if by swapping you mean being added to a different team
I suppose you could use the createGroup mission event handler plus the UnitJoined group handler for the general case.
oh, there is UnitLeft as well.
not sure what the locality is for the group event handlers.
That is about what I want.... but i would have add them to every group....
Prisoner in the ace discord pointed me to this https://cbateam.github.io/CBA_A3/docs/files/events/fnc_addPlayerEventHandler-sqf.html
Ill just use the group event there.
I am trying to use a script to allow medics to full heal all units inside a vehicle (using ACE medical). I have used the below script to successfully allow a full heal of all damaged units, however it allows all units regardless of traits to use the heal action. I would like only units with the ACE medic trait to be able to use it
"Heal soldiers",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_reviveMedic_ca.paa",
"([_this] call ace_medical_treatment_fnc_isMedic) && (_this in _target)",
"([_this] call ace_medical_treatment_fnc_isMedic) && (_this in _target)",
{hint format ["%1 is providing medical care inside the vehicle.", name player]},
{format ["%1, you're providing medical care inside the vehicle.", name player] remoteExec ["hintSilent", _this select 1]},
{
{[player, _x] call ace_medical_treatment_fnc_fullHeal;} forEach crew _target; format ["%1, you've provided medical care.", name player] remoteExec ["hintSilent", _this select 1];
},
{format ["%1, medical care was not provided!", name player] remoteExec ["hintSilent", _this select 1]},
[],
10,
0,
false,
false
] call bis_fnc_holdActionAdd;```
Add condition that check player is medic / ace_medic
something like this for vanilla medics: sqf isMedic = { params ["_type"]; getNumber (configFile >> "CfgVehicles" >> (_type) >> "attendant") == 1 };
I'm not sure how to/where I would add that. I can use
if([player] call ace_common_fnc_isMedic)
to return if they're a medic or not but I'm not sure how to then allow/deny usage based on that
did you write that code?
No, it's from the forums
Not sure, I'm trying to read through the ACE pages rn to see if that's the proper syntax
ok.. the condition : ```sqf
"([_this] call ace_medical_treatment_fnc_isMedic) && (_this in _target)"
regarding the syntax.. you should read https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
"_this" is the caller and "_target" is the vehicle they're in
oh right i forgot **in **checked vehicles 🙂
The script itself is working but it allows all players to activate it, for some reason ([_this] call ace_medical_treatment_fnc_isMedic) isnt working right I think. It should only be allowing medics to activate it
Use the variable instead of the function maybe
Yeah I'll try that now. Didn't realize that
cant google for the later 😄
Yeah that did it. Had the wrong call
Full working script if anyone wants it:
"Heal soldiers",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_reviveMedic_ca.paa",
"([_this] call ace_common_fnc_isMedic) && (_this in _target)",
"([_this] call ace_common_fnc_isMedic) && (_this in _target)",
{hint format ["%1 is providing medical care inside the vehicle.", name player]},
{format ["%1, you're providing medical care inside the vehicle.", name player] remoteExec ["hintSilent", _this select 1]},
{
{[player, _x] call ace_medical_treatment_fnc_fullHeal;} forEach crew _target; format ["%1, you've provided medical care.", name player] remoteExec ["hintSilent", _this select 1];
},
{format ["%1, medical care was not provided!", name player] remoteExec ["hintSilent", _this select 1]},
[],
25,
0,
false,
false
] call bis_fnc_holdActionAdd;```
I'm using a public variable AllSecTasksCokmplete as a condition check in a if statement. Works fine. Now if I want to check if that public variable was not activated would it be like this !AllSecTasksCokmplete or maybe AllSecTasksCokmplete = false?
!AllSecTasksCokmplete or AllSecTasksCokmplete == false
``` 😉
unless the variable is not defined... then its nil
Ahhh so if it's undefined then AllSecTasksCokmplete == nil?
isnil "AllSecTasksCokmplete"
How to black out the screen before the world starts to render. What I get is that the display is normal, until the game completes saving, and then it blacks out the screen, creating an ugly effect, and when I use titleText, it also blocks any other texts other than the title. Thx
one work around to this is to use the getVariable with the default...
missionNamespace getVariable ["AllSecTasksComplete", false];
this will return false if it is in fact false OR if it isn't even defined yet (nil)
whats the end result you want in order of things happening?
does anyone know why deleteVehicle Heli; Doesn't work for me? (the trigger in theory is set up correctly (type none activation opfor at present) (it is an ai heli) Name of the varibale is indeed "Heli" and the trigger is linked to the heli and the crew for good measure
I also found out that the trigger will only activate if I'm in the area
This will work if you have the object (not group) named heli. Trigger shouldn't activated with you in it (assuming you're BLUFOR)
I see what I did wrong thanks I also think that my heli is being stupid and is stopping right outside the trigger so when it finally decides to move it despawns
Has anyone experienced this behavior with helicopters? It happens to me seemingly randomly when I test my mission. Maybe only 2/50 times I've tested it. I have no idea how to reproduce it. And its not like Im doing anything crazy. Its just a standard invisible heli pad and land waypoint in the editor.
I get in a friendly AI controlled helicopter that has landed. The helicopter kicks me out then flys up about 50 meters and hovers.
Are you the leader of your group, or do you have an AI group leader?
I ask because if you have an AI group leader, they can decide they don't want you to get in a vehicle, and force you to immediately get out
@grizzled cliff i have those compiler errors quite often since MSVC 2015. Once even just removing a comment line fixed it for me its really weird
No. If it did it wouldn't be called "local". It would be called a "network object"
I'm not 100% sure about missiles tho. But bullets are definitely local
Maybe steerable missiles are non-local 
Hello,
I am trying to create a simple Scenario in which tanks spawn at random markers and move towards random markers. Essentially for target practice.
However, I can't figure out why the AI just stands still, is there something I am missing?
spawnTank = {
private ["_marker", "_tank", "_pos", "_crew", "_group"];
// Select a random unused marker
_marker = call getRandomMarker;
if (_marker == "") exitWith {}; // Exit if no available markers
_pos = getMarkerPos _marker;
// Adjust the spawn position to avoid collisions, by 1 meter
_pos set [2, (_pos select 2) + 1];
// Create the tank
_tank = createVehicle [tankClass, _pos, [], 0, "NONE"];
_tank setBehaviour "SAFE";
_tank setCombatMode "BLUE";
_tank setDamage 0.8;
_tank disableAI "COMBAT";
// Prevent crew from ejecting
_crew = crew _tank;
{
_x allowGetIn false;
_x allowFleeing 0;
} forEach _crew;
// Create a group for the tank
_group = createGroup east;
{_group addVehicle _x} forEach _crew;
activeTanks pushBack _tank; // Add to active tanks
// Select a random marker that is >200 meters away
private _farMarkers = spawnMarkers select {_pos distance getMarkerPos _x > 200};
private _targetMarker = selectRandom _farMarkers;
private _targetPos = getMarkerPos _targetMarker;
// Set initial waypoint towards the selected random marker
_wp = _group addWaypoint [_targetPos, 0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "SAFE";
_wp setWaypointCombatMode "BLUE";
};
one way to debug is to print some messages to make sure the values are ok```sqf
systemchat (str [_group,_targetPos,_wp]);
@ripe wind that at the bottom
also i dont see the crew being created in that code. you might be interested in createVehicleCrew
Yeah, I noticed. It's working as intended now 🙂
I am the leader of my group of 8 units. (Mix of human and AI)
The helicopter is its own group of four non-playable AI.
As a workaround, try this command, https://community.bistudio.com/wiki/setVehicleLock, or similar.
How to set viewDistance for MP games correctly in a mission scenario? Usually, when I start my mission, the viewDistance is very low compared to SP. Should I use a commad to set it to something more reasonable on all machines, or what is the best way to go about this? Thank you
AFAIK, in MP players can change view distance only via script command.
The thing is that I don't want to force their machines beyond their capabilities, but too low is not good either.
Provide them with a UI where they will be able to choose preferred view distance.
There is the video options distance, then server config, then mission parameter, also you can set it via sqf command. Who knows what is the right way, so that I don't override anything important. I just don't want it to be capped at 1600 meters from start.
It's just setViewDistance and setObjectViewDistance. Local effect, but server caps clients.
hmm. Mission parameter?
I would like to set it to like 3000 meters, but if server config says 2000, it will set 2000 for the server. If client settings are set to 1900, then client will have his 1900.
Using set command will override all this.
AFAIK, the server config view distance is only affects AIs.
Video options distance doesn't work in MP, as you wrote above.
The mission parameter is global, but you don't want "to force their machines beyond their capabilities".
The only solution I've wrote -- #arma3_scripting message
Video options distance works in MP. It's just capped by the server value. Same behaviour as the script commands.
Video options distance works in MP. It's just capped by the server value.
I was wrong then. Then you can increase view distance in the server profile to some big value, and players will be able to choose their preferred view distance.
Same behaviour as the script commands.
No, via script command you can set any value.
This is what happens if you use setViewDist on a client, and he has lower video options distance set. So this is not the optimal way.
I don't know why it looks like, but on my server in the server profile view distance is about 1500m, however players can set view distance up to 6000m via UI.
This is a listen server on local loopback, so it may be the cause.
What's the issue?
If you're referring to the tree cutoff, trees are objects.
Yes, there is object view distance which isn't limited by server, unlike overall view distance.
Like if I use the setViewDist on a client, the distance in video options, just does not move the mist.
Meaning, that either I have to force it from server, or create some GUI windows, as @faint burrow suggests, probably.
Not sure if either works for that.
You have fog set to zero?
There's a "haze" that's a separate thing again. Not sure how that works.
is it possible to play an audio file while in the Briefing phase of a scenario? I know the execute tag exists but a simple <execute expression="playSound 'mySound'">Play audio</execute> doesn't seem to work. Classname is defined in mission config. Basically I want player to be able to listen to the wall of text during the briefing phase instead of reading it or having to do so once the actual scenario phase starts.
What about playSoundUI?
(I have no knowledge of briefings tho so idk if you're doing it right at all)
Try addVehicle
Is there any way how to properly time a text intro? I use BIS_fnc_typeText followed by BIS_fnc_textTiles. And when the FPS are low, the effects tend to overlap, because of how SQF is being executed. Thanks
you could use waitUntil along with scriptDone to see if the first function ended
Thanks, my fault, I did spawned those functions instead of calling them.
https://community.bistudio.com/wiki/screenToWorldDirection
this command just does not work, can someone fix it? screenToWorldDirection [0.5, 0.5]; (wiki example) <@&105621371547045888>
screenToWorldDirection [0.5, 0.5];
[[s>
14:02:20 Error position: <screenToWorldDirection [0.5, 0.5];
[[s>
14:02:20 Error Undefined variable in expression: screentoworlddirection
Don't ping moderators for non-moderation concerns.
I cant ping bohemia in this channel
Why would you?
#rules specifically forbids doing that
cause they are the ones that can fix it...
No its your fault
ermmm
There is nothing broken here
is 2.18 dev branch or something
yes
added devbranch to the page
thank you good man, classy guy right here
imagine if all complains were about not working commands from the future builds 🤣
imagine if all the staff here were not discord ego made and just gave useful info like Lou cause the documentation is inconsistent 🤣
https://community.bistudio.com/wiki/screenToWorld even this command uses an example that has the future command but with a script error
erm, the information in the pictographics was clearly indicating build 2.18 you just ignored it
screenToWorldDirection_screenPos
ur welcome to point out where it says 2.18 in this
hard to point it out when you crop it out
thats all you need to see
again on the page alternative syntax is with 2.18 pictogram
If you notice an error on the wiki, feel free to politely and clearly point it out in #community_wiki - no need to ping anyone, the channel is monitored.
that example does not use alternate syntax
oh, that's because someone added the 2.18 screenToWorldDirection in recent edit
@little raptor made that edit so you can tell him, but like said before optimal place is then #community_wiki
It wasn't ansin, they just added the 2.18 indicator to the alt syntax. Leopard20 added the bluebox
you seen nothing 😁
and now
(ofc here)
next time a full-screen pop-up will be needed
With a small Quiz afterwards, to test if you really understood it. 
that you could have with cameraToWorldPosition or something
does anyone know why it isn't working? 
semi-seriously considering```js
alert('this command is for Arma 3 v2.18 dev branch');
tbh I don’t even think this would be a bad idea
cuz I miss the tiny icons as well and usually assume it works 💀
theyre impossible to miss dawg
how does while work? I'm trying to make the loop run if a unit is alive. Tried putting in alive unit1 and it doesn't seem to work
You can't put the loop directly into an editor init box, because it'll just run 10,000 times and then bail.
You need to use spawn to create a scheduled thread instead.
I was putting this in my init.sqf and putting sleep 10; It wouldn't work like that? Since it would only be running every 10 seconds
Share your code
I think it's fair to mention that the page their screenshot is from is the screenToWorld page, not screenToWorldDirection, which referenced screenToWorldDirection in an example without mentioning it was 2.18 (the link to its own page was broken because of the missing space, too). The indicator for the screenToWorld alt syntax was not relevant because the alt syntax wasn't used in the example. So none of those indicators were actually visible or applicable in the context of their screenshot, even if their overall approach was a bit unnecessarily spicy
(tbh it is true that sometimes people really get jumped on, including by BI staff, for making mistakes that seem obvious to veterans. Sometimes a question genuinely is obviously stupid, but sometimes people are just inexperienced or overwhelmed and they get rather rude responses)
(yup, making a mistake is possible, I'd like people to have room for that)
I agree about this of course, clicking the command page may help but the example itself is not saying anything about it (and won't, as release is not so far away)
How do you change the firing rate of a tank cannon?
?
I did try that, but I notice no difference
this addEventHandler ["Fired", {
_this # 0 setWeaponReloadingTime [_this # 0, _this # 2, 1/3];
}];
Applied on the "Init" of the Vehicle
Do you happen to know if the tank carries its cannon ammo in magazines of multiple rounds, or in single-round magazines?
This is relevant because setWeaponReloadingTime affects the time between rounds in one magazine, while if it's multiple single-round magazines then each reload will be a magazine switch and so not covered
The Rhino is a vanilla vehicle and those usually use multi-round magazines 🤔
How odd. Well, I don't see anything wrong with the code, it is an intra-magazine reload which is covered, and that command should work fine on vehicles.
Can you try adding a systemChat in the EH code to prove it's actually being triggered?
I prefer the burning version but this one's ok if it fits the UI design
OK last one before I stay serious for at least 5 minutes ^^
Oh noooo
Why not show a cooking warning like message that blocks 99% of the screen. Additionally you have to 55 times solve a captcha.
I can only do systemChat in the debug console 🤨
Huh?
Yeah. systemChat does not work either if I put it in a script or init in the SP Scenario. It only ever shows up if I put it in the debug console
you cannot systemChat in init
delay it a little bit
systemChat should work fine as long as it's inside the EH code itself - while the code is typed in an init field, the EH code is executed when the EH activates, rather than during the init phase where systemChat doesn't work
ex.
this addEventHandler ["Fired", {
systemChat "test fire";
_this # 0 setWeaponReloadingTime [_this # 0, _this # 2, 1/3];
}];
If it doesn't show up when you do that then the EH is not firing
Thanks for the tip, now it works
The systemChat is firing in the eventhandler :/
Specifically
// Add an event handler to the tank
player_tank addEventHandler ["Fired", {
_this # 0 setWeaponReloadingTime [_this # 0, _this # 2, 1/3];
systemChat "Weapon fired and reloading time set!";
}];
In init_sqf
Well, as far as I can tell, in principle this should work.
The only thing I can think of would be some quirk of how tank cannons work that makes the command not work on them (plausible, if unproven, because of how they fake reloading between shots). If that's the case, then I don't think there's much to be done about it.
Someone else might have more insight though.
I got it to work!
player_tank addEventHandler ["Fired", {
_this#0 setWeaponReloadingTime [gunner (_this#0),currentMuzzle gunner (_this#0),0.5];
systemChat "Weapon fired and reloading time set!";
}];

Thank you all for your help 🙂
While I'm still here, is addUserActionEventHandler the best approach to adding a custom keybind if I basically need just one custom button to execute a script?
Oh of course, because _this#0 was the vehicle again and the command requires the gunner 🤦
The fired EH reports the gunner as _this#7 btw, so you don't need to look them up with gunner. And once the gunner is provided properly, the reported muzzle name (_this#2) should work without needing to find it with currentMuzzle.
Anywone know how to spawn a waypoint for a unit, activated by a trigger? basically have a switchblade loitering near by and want to call it in and have it come to players position. thanks in advance!
thank you. but im trying to figure out how to make it a "loiter" waypoint
also says "type object, expected group" its a drone btw
There is a group of waypoints related commands: https://community.bistudio.com/wiki/Category:Command_Group:_Waypoints
https://community.bistudio.com/wiki/setWaypointType
private _waypoint = (group driver _drone) addWaypoint [ ... ];
_waypoint setWaypointType "LOITER";```
You can use setWaypointLoiterType, ...Altitude, and ...Radius to further customise the waypoint after creating it and setting its type
thank you. found an easier way by using SetWaypointPosition and syncing the second waypoint to that trigger
any way to get a position of the one that activates the trigger or "caller"? instead of getting a pos of a preset guy
thisList contains objects activated the trigger.
thank you. evrything works great and as imagined. but it shows an error when trigger is activated
What's the error? Could you provide its text from RPT file?
As error's text says, thisList returns array of objects, but getPosASL needs object, therefore select for instance the first object.
[group driver SD, 2] setWaypointPosition [getPosASL thisList, SD, -1];
So it should look like this? sorry I have no experience with any kind of scripting
forEach
Or if you want position of trigger / list, use thistrigger or if marker, use getMarkerPos
Use this command: https://community.bistudio.com/wiki/select
getPosASL (thisList select 0)
Im lost boys. any way to disable error messeges? I think its easier if I just raw dog this shit, I mean it works as intended.
Fix your issue works
You got that working or did you delete all 🙂
[group driver SD, 2] setWaypointPosition [getPosASL thisList, -1];
this one from Schatten works as needed. just shows an error when activated
but it works so I kept it
I moved on haha. now im trying to figure out how to make it so that "radio" trigger is only shown to west. So that east cant call in the suicide drones
Why didn't use the solution: #arma3_scripting message ?
if(side _x == east) then
SDtrig hideObject true;
this is what ive pieced together. probably wrong to all shit tho
I tried. but I have no idea how to put it in correctly. showed that " ] " was missing
_waypoint = (group (driver SD)) addWaypoint [getPosASL (thisList select 0), -1];
_waypoint setWaypointType "LOITER";
Yes, you missed brackets: https://community.bistudio.com/wiki/if
Also, if SDtrig is trigger, then hiding it doesn't make sense -- it's alredy invisible.
it is the trigger. idk how to make it so that only west can call it
this whole coding thing is some witchcraft fr
Change its activation attribute: https://community.bistudio.com/wiki/Eden_Editor:_Trigger#Attributes
Quick question, can cursorTarget be player like checking
cursorTarget == player
no because player is valid only in clients and player cannot point to it self
Ok, thx for the info
@indigo snow thanks very much!
if i run "call" function in sheduled enviroment will it wait until the "call" func completes?
yes, the code after that won't execute until it's done
In any environment call'ed function will be waited for to complete.
Hello! I'm having trouble finding out how to have a trigger activate a Keyframe Animation (basically trying to make it to where when a player steps in the area it will activate the Keyframe Animation) and I have been trying to google it for the longest time but, I cannot find it. Only one person ever made a post about it on online and he was asking the same thing. If anyone can help me that would be great!
_circ = floor ( (2 * 3.14 * _areaSize) / 17 );
_class = "CUP_A2_Road_grav_1_1000";
_part = floor(360/ _circ);
for "_i" from 0 to _circ do {
_pos = _sector getpos [_areaSize, _part * _i];
_o = createSimpleObject [_class, (asltoagl _pos), false];
_o setdir ( (_part*_i) + 90);
};
Any idea why this happen?
it can be seen from the air, but not in the ground

its like its using the wrong lod
Don't know. CUP bug?
asltoagl
its **agltoasl **
hmmmm, Error Undefined variable in expression: cfgmusic
Pardon me everyone.
A coop misison I'm playing has bugged. I am the host (have debug console).
What are the exact commands to create a curator and assign it to me?
Something with createVehicle and assignCurator, I know.
_music = "true" configClasses (missionconfigFile >> "cfgMusic");
@candid sun
I created a small scene where I test lights under water, because there are not flashlights available for divers. Is there any way how to make the light sources move smoother with the object they are attached to? Also, would this work properly in multiplayer, and affect AI spotting as well? Thanks
Are you not able to turn a flashlight on underwater?
you can assign yourself to the "hardcoded" Zeus module, similarily to how SSPCM works.
unit assignCurator CheatCurator;
CheatCurator addCuratorEditableObjects [allMissionObjects "all",true ];``` As far as I'm aware CheatCurator exists both in singleplayer and multiplayer missions
The underwater weapons doesn't allow flashlight, and when you are swimming, the weapons is lowered, so you can't see where your heading.
hello
keyframe_1 setVariable ["paused", false]
So to figure this sort of thing out, right click on the timeline and open in config viewer.
Open the drop down for it and find the attributes sub-config
These attributes are what are shown in the 3den attributes menu.
Select paused and view the property element.
That property element is what that variable is called on the keyframe logic object.
And you just set the variable on the timeline logic to un/pause the keyframe.
keyframe_1 setVariable ["paused", false]
Ah right, I forgot they're lowered while you're moving
Thank you. I will copy this to my private server and sticky it 😄
Any idea how SPE make the bombs explodes 5 seconds after hitting the ground?
any way to made a script to replicate it with any bomb?
Hello :D
Quick question, how would I go about creating a smoke grenade somewhere specific? Not just the smoke effect but as if the smoke grenade was thrown by a player.
You can createVehicle it
You could look at their configs and their functions
Advanced Dev Tools will help you there
yep already done it, the plane dont have an fired_eh, nither the pylon, or the bomb it self has some kind of eh that guide me how to do it...
Check function declarations maybe?
Fucking always make that error haha
@still forum it was cause i did a huge search and replace and it did something like constructor(int init) : val(init) to constructor(int init) : init
and it was like "woah, no idea"
@indigo snow @still forum thanks for the help, music/sound/radio preview tool incoming!
sounds cool!
Hey there people
I'm currently making a camouflage mod to reduce player detection by bots, I'm using an algorithm to compare surface texture to player uniform texture. I was wondering if I could take it further and apply weapon, vest and helmet to my calculations. Is there any way to get those object colors or textures?
I would be thankful if you could help me.
Quick and dirty, parse the equipment strings for "Camo", "Black", "Green" and assign value to them, penalty for big backpack capacity and high armor rating?
Would be more useful for vanilla, though, since mods tend to stray from overly descriptive item names.
I want it to be more accurate, As you said that won't work with many other mods.
Uniform texture approach that I use now gives me a RGB value to compere with the surface texture RGB, I want this to be the same but I haven't found any references.
@warm hedge Any suggestions?