#arma3_scripting
1 messages Β· Page 120 of 1
I am creating an anomaly module at the player's position, from Diwako's STALKER-like anomalies mod.There are function calls in the description to create various anomalies.But I need my own script.I created an anomaly using my script, but it is not deleted in the usual way.As I understand it, everything is tied to functions, which is probably why the usual way of deleting modules does not work.
[_pos] call anomaly_fnc_createMeatgrinder; //Meatgrinder
[_pos] call anomaly_fnc_createElectra; // Electra
[_pos] call anomaly_fnc_createSpringboard; //Springboard
[_pos] call anomaly_fnc_createBurner; //Burner
[_pos] call anomaly_fnc_createFruitPunch; //Fruit Punch
[_pos, _id] call anomaly_fnc_createTeleport //Teleport, _id is used to link teleports with matching _id's
[_position(pos ATL!), _radius(number), _isRectangle(Boolean)] call anomaly_fnc_createFog // create fog anomaly
[[[_pos, _radiusA, _radusB, _andlge, _isRectangle]],_howManySpringboards,_howManyElectras,_howManyBurners,_howManyMeatGrΓnders] call anomaly_fnc_createAnomalyField // create anomaly field with randomly placed anomalies
It's in the description of the mod
Likely module itself creates\spawns more things, you'll need to look into module code to figure it out
you are missing some semicolons, though I dont know if that's the problem
Thanks everyone.I solved everything with the help of functions."And the Casket just opened."
waitUntil {time > 0};
_EHDisconnect = addMissionEventHandler ["HandleDisconnect",{diag_log "test"}];```
Any idea why this isnt being fired?
how often is the KnowsAboutChanged event supposed to be called? I had some code in eachFrame that I moved to KnowsAboutChanged but it doesn't seem to trigger too often
Good morning
I'm currently making a script and I need to update the angle of an image based on the user's mouse position.
For the moment, I have searched and combined getMousePosition, ctrlSetAngle and a while but nothing conclusive...
The goal would be for the image to change angle depending on the user's mouse rotation.
Thanks in advance π
idk what you mean by rotation but mouse moving does have EH: https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onMouseMoving
ah okay thks
"rotation" mean that i want update angle of my picture when mouse moving depending on X and Y axis
ok, you can count the mouse movement using that event by saving the current position and then subtracting the new position from that
Yeah i tried this but no work π¦
what's wrong?
This is what I had in mind when I was talking about animating paa's. The 'AnimatePAA' that was linked here is too complicated imho. This function is only about 30 lines of code. It's only a matter of converting gifs or videos to paa frames. Works on anything I've tested so far and works as intented ^^.
So you want, basically an arrow which looks at your mouse?
not really
i want the lockpick who turn around and controlled by the position of the mouse
In this case, your mouse is located somewhere in top-right?
Or just move mouse left/right to rotate left/right?
no, in bottom-right x)
Its the best i did, the picture dont follow the mouse
i want to move 360Β°
I meant, your mouse supposed to be in top-right if the lockpick is facing there?
yes
@novel basin maybe KK's blog can help you?
I can recommend to use getDir command even though it is not really meant to be used in this way, but like, basicallysqf [0.5,0.5] getDir getMousePosition
[0.5,0.5] is the center of the screen, aka your axis of the lockpick
so it will update the dir of the picture like the dir of the mouse ?
good idea, i will check later
No, that should return 0 to 360 number, where 0 is the top, 90 is the right and so fourth, so, input the return from getDir into ctrlSetAngle
If that's what you mean, tho
ok now its almost work
On the screen, the cursor are at the opposite of the picture X)
Just +180
What's the file size of your missions when doing something like this?
i would have something like that as a mod rather than contain it all in mission file tbh
Yeah cause sending that for a mission download would suuuuuck lol
It does look pretty tho
maybe next Christmas we can get some transfer speed optimisations :D
hey. I know it is wrong channel but I dont know where to ask. I dont get stable 60 fps even if I go 1080p. I can play with 4k and still get 45 fps +-. What is causing this?
You want #arma3_troubleshooting .
There are a lot of things in Arma that can drain frame rate. Graphically, view distance is a big one. Other killers are the complexity of the local environment (e.g. dense urban), or having large numbers of AI or scripts running.
(and bad mods)
Depends really, if you wanna watch a movie or two then alot π
Having couple of smaller ones doesn't really affect the size that much. Average folder with the anims are like 5mb. The suv is about 30mb but it's a huge texture as is..
You could, the function stays the same. Just a matter of location reading π
yes i would recommend against reading more than 5 images from the mission file tbh
I agree. This was done purely for testing purposes though.
Is there any de facto standard solution for offloading AIs to headless client? Its license should allow republishing the scripts as part of another gamemode/mission. I'm using Werthles' mod/script right now but seeing that it's been updated a while ago, not sure whether it's the most appropriate tool nowadays (+ the licensing stuff)
Mostly for handling the possible corner cases that seem to be plenty (or used to be at least)
What did we get this Christmas?
lots of things 
Sorry, waking up a day late to open presents.
So this is where I ask script related questions?
Ok great. so....
I'm trying to pass an addAction to a scripted object, but since setVehicleInit was taken out of A3 I'm stumped as how to go about it. This is my latest attempt, which generates no errors, but doesn't add the action... Maybe some pointers in the right direction?
_pos = getpos (_this select 0);
deleteVehicle (_this select 0);
sleep 0.2;
private _d = "B_Slingload_01_repair_F" createVehicle _pos;
private _scr = "this addAction ['<t color='#FF0000'>Deploy container</t>','s\deployContainer.sqf'];";
[[_d,_scr]] remoteExec ["setVehicleInit"];
hint "Container packed up";
It's been more than 10 years since I scripted last, so bear with me π
Im calling the script with:```sqf
this addAction ["<t color='#FF0000'>Pack up container</t>","s\undeployContainer.sqf"];
from the object init in the editor
If no one gets back to you by the time I'm out of work I'll help.
thanks! Appreciated
I don't know if you're into it, but SCUM actually has a pretty decent lock picking micro game... might check that one out for ideas.
setangularvelocity π
ace hc module is pretty commonly used afaik
actually i guess those are right! :P
Description.ext: ```class CfgFunctions
{
class Spawn
{
class Nato
{
class variableNatopreInit{file = "natospawn.sqf"; preInit = 1;};
};
class Csat
{
class variableCsatpreInit{file = "csatspawn.sqf"; preInit = 1;};
};
}
}
};natospawn.sqf 0 spawn {
--1--
sleep 5;
_grp1 = "B_T_APC_Wheeled_01_atgm_lxWS" createVehicle getMarkerPos "spawnvehicles";
createVehicleCrew _grp1;
{
_x setSkill ["general", 0.6];
_x setObjectTexture ["clan", "\a3\missions_f_epa\data\img\orbat\b_111_texture_ca.paa"];
}
foreach units _grp1;
_grp1 setGroupId ["Armored Lions 102th"];
_grp1 setObjectTexture ["clan", "\a3\missions_f_epa\data\img\orbat\b_111_texture_ca.paa"];
addMissionEventHandler ["Loaded", {_grp1 setObjectTexture ["clan", "\a3\missions_f_epa\data\img\orbat\b_111_texture_ca.paa"]}];
[
_grp1,
["Olive",1],
["showBags",1,"showCamonetHull",0,"showCamonetTurret",0,"showSLATHull",1,"showSLATTurret",1]
] call BIS_fnc_initVehicle;
};```
I hope this is clearer now. If you need additional information, feel free to ask
You've put the part that adds the Loaded EH after a sleep 5. This means that although the function starts during pre-init, everything in it is delayed until 5 seconds after mission start.
To actually add the event handler during the pre-init phase, you need to do it before any suspension.
You don't have to use setVehicleInit at all. You use the parameters that addAction gives you to feed them to your function (make a function for this, not a script file), for example:
/*
MrB_fnc_containerDeployment
*/
params [
["_vehicle", objNull, [objNull]],
["_state", "pack", [""]]
];
switch _state do {
case "pack": {
_vehicle addAction [
"<t color='#FF0000'>Pack Up Container</t>",
{
params ["_vehicle"];
private _vehiclePos = getPosATL _vehicle;
deleteVehicle _vehicle;
private _newVeh = "B_Slingload_01_repair_F" createVehicle _vehiclePos;
[_newVeh, "unpack"] remoteExec ["MrB_fnc_containerDeployment"];
},
nil, 1.5, true, true, "", "true", 5, false
];
};
case "unpack": {
_vehicle addAction [
"<t color='#FF0000'>Unpack Container</t>",
{
params ["_vehicle"];
private _vehiclePos = getPosATL _vehicle;
deleteVehicle _vehicle;
private _newVeh = "SomeContainerClassHere" createVehicle _vehiclePos;
[_newVeh, "pack"] remoteExec ["MrB_fnc_containerDeployment"];
},
nil, 1.5, true, true, "", "true", 5, false
];
};
};
note "SomeContainerClassHere" needs to be changed to what you want.
to start put in init:
if (isServer) then { [this, "pack"] call MrB_fnc_containerDeployment };
Load your function into the game by using the function library:
https://community.bistudio.com/wiki/Arma_3:_Functions_Library
So that it exists on all machines.
Awesome. Superthankyou!!
Need to test it tomorrow though, very late here
maybe ` ["scriptname"] remoteExec ["execVM"];
hello, i have a mod that i published on steam, and i signed it with some bohemia tool (dont quite remember the process).
there is a .bisign file in my repo thats also included in the published mod as far as i can tell.
People on steam are asking for a .bikey, is that a different thing?
am kinda lost because i havent hosted dedicated in years
(also there is no pure mods channel so i use this one π )
nevermind, i have the bikey from the signing process but never published it.
The bikey is used to verify the bisign
Google "asymmetric encryption"
yeah just found a post explaining it, thx
just copy/pasted the public key into the mod folder and published as update π
Hope that works, to lazy to test
Anyone knows a way to enable dynamic simulation for mines?
Checking the checkbox in editor has no effect and using enableDynamicSimulationon a mine created with createMine doesn't work as well
I use enableSimulationGlobal
Yeah, but that's static, not dynamic
sorry? it worked for mines in my mission
How did you do it?
_mine enableSimulationGlobal false;
Yes, that works. But that's still static. I wanna use Dynamic Simulation to activate them on AI/player presence
Yeah, that would work. But I use no triggers
I wonder if mines were not implemented for dynamic simulation.
They aren't. I had to do a frame handler
any idea why this might not be working? I placed it into initplayerlocal
while {true} do
{
if (Alive Player) then
{
profileNamespace setVariable ["ptlme_loadout_01", (getUnitLoadout player)];
saveProfileNamespace;
};
Sleep 60;
};
as in
[]spawn
{
Sleep 5;
_playerLoadout = profileNamespace getVariable ["ptlme_loadout_01", []];
player setUnitLoadout _playerLoadout;
};
does not apply the loadout, so I assume it doesnt save properly into the variable
Okay so when I was in the mission I executed just
profileNamespace setVariable ["ptlme_loadout_01", (getUnitLoadout player)];
saveProfileNamespace;
than
_playerLoadout = profileNamespace getVariable ["ptlme_loadout_01", []];
player setUnitLoadout _playerLoadout;
and it worked
But once I restarted the mission and went back in, it didnt load anymore. As in now I know that "ptlme_loadout_01" should be diver loadout, but it doesnt seem apply it after 5 seconds
chsnge while true to while alive player
and get rid of the if
iirc player must be lowercase but thats only going off some sqf linters
okay one moment
ohhh okay
After 5 seconds it reapplies the same loadout I currently have
SQF commands are case insensitive
I know how to fix that one issue, one moment
yeah i know i think player is like the one exception because it complains about Player in either sqf-vm or adt's i cant remember which and never tried running it with either
does anyone know when does command from the initplayerlocal execute? is it when you join the server, or when you respawn etc?
ill try later
onPlayerRespawn.sqf is the event script you want for respawn iirc
but it only runs once when you join the server
nono I understand the onrespawn sqf thingy cuz it executes as you respawn, but what about initplayerlocal
^
okay, I think the issue might be that it saves the loadout that the "playable" characters have, and than just reapplies it after player respawns. Essentially keeping their "default" outfit
I am testing, did some changes and it works, but I will stay in respawn screen for longer to see if that is actually the case
put systemChat str _playerLoadout in the respawn handler and see
yup it definitely does save default loadout if you stay in respawn screen too long
cant I just put the save script in respawn sqf?
No, than it will keep stacking everytime player dies
Is the save block just that while loop in the init file?
ye
it executes too early
I need to run a check to only execute it once player respawns and do it only ones. And now that I think of it, if player dies, and goes back to respawn menu, it might set default loadout again, or maybe not if they take too long
If the auto-save is supposed to run throughout the mission, why not spawn the loop so initPlayerLocal can finish?
I don't know if that leads to unexpected behavior, but that would allow that init file to finish.
Its already looped, every 60s. I am thinking this. I will put respawn event handler, but how do I run a check to see if the script is already running, so it executes on respawn, but doesnt execute again and again every time player respawns in the same mission.
You could insert a flag in the uinamespace.
add a killed event handler to the player and make it save there instead
But than I also need them for server crashes, disconnects, connection lost etc etc etc. Or is there one for all of them. Having it run every X amount of time seems easier
check if alive player is true in respawn screen then
What I tried to implement in my loadout solutions is setting the save on an inventoryclosed EH and a reloaded EH.
Two moments where a loadout is most likely to change
I'm still trying to figure out how to handle for things likeACE that allow you to do things outside the inventory screen
Actually easier solution, is there a way to force respawn? So I would force a player to essentially spawn before the script gets executed
I use this for gasmask script, which essentially cuts people ace stamina in half if they have one on their face
I think there is a setting that does that in Description.ext
Maybe the mines themselves enable dynamic sim again π
Perhaps, idk
but afaik dynamic simulation works on "dynamic" (fast) objects
ok nvm the code checks for a base type that mines don't inherit from, so yeah it won't work on mines
Good to know as mines have the dynamic simulation attribute π
Hello everyone.Tell me, who understands how you can set the direction of flight of an object so that when you press the button, the object flies in the direction where the player is looking? Using the command :
OBJ setVelocity [20,0, 2];
_dir = getDir player;
_speed = 200;
OBJ setVelocity [_speed * (sin _dir), _speed * (cos _dir), 0];
``` @steady minnow - that I think π
obj setVelocity (getCameraViewDirection player vectorMultiply 20)
getDir is 2D. also I assume by "looking" he actually does mean looking. getDir returns the object dir
Leos solution gets z too which maybe wanted?
yeah player "look dir"
Thank you, you are the best, it works
alternatively modelspace commands also exist
in this case world space makes more sense
ya as i assume they want to be able to have a jump upwards or something
So this is what I get:
19:21:45 Error context ["_vehicle", objNull, [objNull]],["_state", "pack", [""]]];
19:21:45 Warning Message: File C:\Users\xxxxx\Documents\Arma 3 - Other Profiles\xxxxx\missions\Tanoa_assault_1.Tanoa\description.ext, line 21: '/CfgFunctions.params': '[' encountered instead of '='
19:21:45 Warning Message: Config : some input after EndOfFile.
19:21:45 Error context isServer) then { [this, "pack"] call MrB_fnc_containerDeployment };
19:21:45 Warning Message: File C:\Users\xxxxx\Documents\Arma 3 - Other Profiles\xxxxx\missions\Tanoa_assault_1.Tanoa\mission.sqm, line 0: '.if': '(' encountered instead of '='
19:21:45 Warning Message: Config : some input after EndOfFile.
19:21:45 Class destroyed with lock count 1
Did you put the function code directly into description.ext?
(because that would be wrong)
What you need to put into description.ext CfgFunctions is a config structure, that tells the game which .sqf file to look in to find the function code.
I don't really know where to ask this but would anyone know how to make that it choose a random number between 1 & 5 so that it shows a different image?
class CfgPatches
{
class aftrmth_loading_screen
{
units[]={};
weapons[]={};
requiredVersion = 0.1;
requiredAddons[] = {"A3_Characters_F", "A3_Weapons_F", "A3_Data_F", "A3_Anims_F", "A3_UI_F"};
};
};
class RscStandardDisplay;
class RscPicture;
class RscButton;
class RscDisplayConfigure
{
enableDisplay=1;
};
class RscDisplayMain : RscStandardDisplay
{
idd = 0;
idc = 1;
enableDisplay = 1;
class controlsBackground
{
class LoadingPic : RscPicture
{
idc = 1;
x = SafeZoneX;
y = SafeZoneY;
h = SafeZoneH;
w = SafeZoneW;
text = "aftrmth_loading_screen\images\desk"+str(floor(random 5))+".paa";
};
};
class RscActiveText;
class RscActivePicture : RscActiveText
{
style = 48;
color[] = {0,0,0,0};
colorActive[] = {0,0,0,0};
};
```
class Spotlight {};
class controls {
class Spotlight1 {};
class Spotlight2 {};
class Spotlight3 {};
class BackgroundSpotlightRight {};
class BackgroundSpotlightLeft {};
class BackgroundSpotlight {};
class B_Credits {};
class ConnectServer : RscButton
{
idc = -1;
text = " Connect to Fallout:NV RP";
style = 3;
onbuttonclick = "connectToServer ['*/IP/*', /*PORT*/, '852']";
soundEnter[]={"",0.30000001,1};
soundPush[]={"",0.69999999,1};
colorBackground[] = {1.08,0.21,0.2,1};
colorText[] = {0,0,0,1};
font = "PuristaMedium";
colorBackgroundActive[] = {1.08,0.21,0.2,0.4};
x = "0.4 * safezoneW + safezoneX";
y = "0.2 * safezoneH + safezoneY";
w = "0.20625 * safezoneW";
h = "0.033 * safezoneH";
};
};
class controlsBackground
{
class LoadingPic : RscPicture
{
idc = 1;
x = SafeZoneX;
y = SafeZoneY;
h = SafeZoneH;
w = SafeZoneW;
text = "aftrmth_loading_screen\images\desk"+str(floor(random 5))+".paa";
};
};
};
I'm not sure that's possible directly in text.
it can't be done via config. use scripts
You'd need an onLoad script or similar.
Also watch out with floor(random 5). It may very occasionally roll 5 rather than 0-4.
what would work the best for real random?
ooh ty!
Yup, re-read the page I linked to the function library. And post your description.ext
(Wakes up from dead) Thanks for the info π
Also speaking of CfgFunctions, I should finally fix some of the horror/hacky code I managed to write in the CfgFunctions generator VSC extension, plus noticed some bugs too
Q: about compileFinal as it relates to HASHMAP and setVariable... I tried setting a missionNamespace variable with such a compileFinal value, and got the following log, but I'm not sure I understand what it means.
17:49:54 Attempt to override final function - my_arsenal_configitems
Meaning what, exactly, and is there anything I should do to remediate the attempt. i.e. attempted and what, success? Go pound sand? Not really clear what the outlook, disposition, etc, is, toward the outcome.
Can you post your test code?
it means it failed
I think I see what's going on.
uiNamespacein which I am setting the var is rather sticky between sessions, correct? that is, state is sustained between missions starting.- yeah, echoing the responses, I see that it failed. but the message is ambiguous, IMO.
the message is ambiguous,
you can't override final functions. period.
the message is there to tell you that someone is doing something illegal
of course, I understand it is illegal to do so. but I did not see the yellow warning lights that accompanied the message. or even a hint of whether it should be considered success or failure. anywho.. I understand, thanks...
Q: HASHMAPS, insert, I think there be typos in the docs, can anyone confirm?
the form says along the lines hashMap insert [splitArray, [keysAndValues]] i.e. true, [[key1, key2, ...], [value1, value2, ...]]
_map insert [true, [_keys, _values]];
however, my log is claiming something a bit different:
_throwList insert [true, [_muzzleMagConfigNames, []>
20:52:46 Error position: <insert [true, [_muzzleMagConfigNames, []>
20:52:46 Error 2 elements provided, 3 expected
which suggests it should be closer to:
_map insert [true, _keys, _values];
yes, no, maybe?
I think so, yes
https://community.bistudio.com/wiki/insert#Syntax_4
_map is a HASHMAP, _keys are an array of STRING, and _values as indicated, [], the intent of which is for values to be nil throughout.
Make sure _map is actually a hashmap and not a normal array. If it is an array then the game could be trying to use syntax 1
it is.
Can we check your entire code?
_map insert [true, _keys, []] seems to work. it is a typo in the docs. note, should NOT repeat NOT be:
_map insert [true, [_keys, []]];
// ^ ^
drop the outer keys values brackets.
I'm dubious of whether assigning nil values to the keys is of any use as a test, because trying to retrieve a value will return nil if it was successfully set and if it failed and there's no key with that name.
or check it if you like, minimum cases:
_map = createhashmap;
_map insert [true, [1, 2, 3], []];
keys _map; // [1, 2, 3]
contrasted with:
_map = createhashmap;
_map insert [true, [[1, 2, 3], []]]; // error, verify RPT
I also have it on somewhat good authority that the stated objectives, nil for values, does indeed work as expected.
https://github.com/acemod/ACE3/blob/master/addons/arsenal/functions/fnc_scanConfig.sqf#L148
Hmm, I'll check later or, are you available to check rn @winter rose
no rush here, I have a sense how to proceed with it. thought you should know, squaring the trapezoid corners with the docs. π»
negative, 3:30 am here sowwy
It's usually pointless but, there are circumstances you still want the keys populated. Though they are very edge case as getordefault is sufficient enough. Should use getordefault first.
Why you're still online thenn!!??
they outlawed sleeping in france in 1875
ποΈ .zZ .zZ .zZ
incroyable!
Does anyone know how to script for a rp server on Arma?
I just need another scripter
In case I am not available
isTouchingGround player && player in thisList as a trigger condition works in editor preview but not on dedicated server. Anyone know what to do about it?
Do Arma rp servers cost money or any server that requires hosting?
Can someone pls dm me
player command returns unit that current machine controls
Dedicated servers controls no unit, thus player return null
so your condition is never true
Also isTouchingGround is very unreliable for remote entities, so you can't reliably check that from dedi side either
Damn, what do you recommend as an alternative?
I don't use triggers to tell you how it can be setup better
Since you're checking for player, you can send some kind of notification to server once trigger activates
On Activation:
[[player, thisTrigger], {
params ["_player", "_trigger"];
diag_log format ["Player %1 just activated the trigger %2", _player, _trigger];
}] remoteExecCall ["call", 2];
This will send arguments with your player and trigger object and code to execute to server
But its far from ideal because you're sending entire function each time you activate the trigger to server, its better have functions ready beforehand and just call them
init.sqf:
myCoolTriggerActivationFunction = {
params ["_player", "_trigger"];
diag_log format ["Player %1 just activated the trigger %2", _player, _trigger];
};
On Activation:
[player, thisTrigger] remoteExecCall ["myCoolTriggerActivationFunction", 2];
You can have another function in the similar manner for deactivation
And run same code in several triggers with trigger passed into function as argument so you can check which one was triggered on dedicated server exactly
Hope this made sense
It does, thank you! I'll give it a try
use BIS_fnc_call
interesting that when KnowsAboutChanged triggers the unit/group may not have any targets ```sqf
// Placed on unit
(group this) addEventHandler ["KnowsAboutChanged",
{
params ["_group", "_targetUnit", "_newKnowsAbout", "_oldKnowsAbout"];
private _unit = (units _group) # 0;
private _targets1 = (_unit nearTargets 1000000) select { (_x # 2) != (side _group) };
private _targets2 = (_unit targets [true, 1000000]) select { (side _x) != (side _group) };
systemchat format ["knows changed %1 %2", count _targets1, count _targets2]; // Prints zeros
}];
would need EH that triggers on new targets
you can just do a targets check its not too expensive
or monitor targets for new ones
yeah Im doing that but would like to avoid loops
You can do it in the EH. Save the value from the previous firing and compare it (or just count it). No loop needed.
cant because there is no targets
value = nil
easy
and dont avoid loops
people only avoid loops if they code badly
or have... long loops π
I don't see how that prevents you from doing a targets check in the EH
"no targets" is just one of the things you would check for
but thats what Im doing, in my example code above
So where does the loop come in then?
that's my current solution
now I would like to optimize
Okay, see, I was confused by the connection you made between "do a target check" and "want to avoid loops"
ah ok , np
so already have loops?
Just start the EH with a check that counts targets or compares current targets to the saved value from last time. If it's 0 or no new targets were added, exitWith
yeah one loop that goes thru some vehicles in an array. looping it self isnt CPU demanding but its rest of the checks/code that I'm worrier about
a looping targets check isnt expensive 
problem is I need targets once the EH triggers and I dont have those. doing the stuff later is too late
now I have EachFrame EH that does the thing
Hello folks, just a quick question please. When i open atributes of any object in editor, i can enter X, Y and Z coordinates and therefore set the location of that object. Let's say i would like to do that by a script and be able to enter the very same numbers to the script just like i would do it in atributes in order to reach the exactly same location. Especially the correct height. My question is, are those coordinates in atributes in ATL, ASL, ASLW or AGL? I guess it's ATL but i'm not sure. Thanks
ATL
Thank you, so using ```sqf
object setPosATL pos
yep
thanks, i appreciate it
there is no limit
hmm. They didn't inherit the array-size limitation?
Hey, how don i call a function and skip a few optional parameter?
[UNIT, ROPE_LENGTH, ANCHOR_POSITION, RAPPEL_DIRECTION] spawn AUR_Rappel_Unit;
I only want to provide UNIT and RAPPE_DIRECTION, and yes ROPE_LENGTH, ANCHOR_POSITION, RAPPEL_DIRECTION are optionals
To my understanding doing [UNIT, vectorDir UNIT] would not work?
Correct, because it'd interpret vectorDir UNIT as the rope length.
you need to do [UNIT, nil, nil, vectorDir UNIT]
music to my ears
time to use a hashmap as a database π½
If it's an editor object while in the editor, you have to use _object set3denAttribute ["position", [x,y,z]]
Like to move an object around the editor using a script
Is there a way to get unit loadouts of playable units in an MP environment?
In other words, I have a bunch of playable units and most of them will not be filled. However, I want to automatically get ALL of their loadouts into a list.
This is what I have tried:
private _playersLoadouts = [];
{
// Collect all units loadouts into a single list
_playersLoadouts pushBack (getUnitLoadout _x);
}forEach (playableUnits + switchableUnits);
While this works in SP when all playableUnits exist, it doesnt work in MP unless players select those units. Is there a way to collect loadouts on playableUnits that aren't selected by players at mission init?
Units that arent selected and arent set to be filled with ai are not spawned and therefore do not exist. So they can't be referenced
Is there a workaround for this? I'd like to collect the units' loadouts automatically to add them to the arsenal later. I can't do that if the units do not exist.
Are you defining the units loadout in the editor?
Yes I am
Would it be too much to just copy those loadouts manually and then load them later?
I have that written out and it works exactly as you described. I just want to see if there is a workaround that automates this.
You might be able to have it get the units loadouts in the editor, but I am not familiar with how that would work
I was thinking of that, I could write something that runs in the editor. However, I do not know how to save data so that it appears in a dedicated MP server.
You could maybe attach it to an object or to the missionnamespace
Maybe, but it might not persist if I export the mission file.
You're right, it might not unfortunately :(
You could have ai set to fill those characters and have script delete them or something after you pull their uniform data maybe
Q: about unit animations, "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon" is the "surrendering" animation? hands behind head? if so, not sure I understand that from the description "Puts hands behind his head and back". thanks...
You can check which animation it is using switchMove or similar commands on a unit
Or find it in the animation viewer
animation viewer? thanks I'll check it out...
Ya its built into arma, it should be under the tools tab in editor
Genuine question:
I've seen a lot of usage of .sqf via the eden editor but can it be done outside of it? (For example in a Zeus mission or while playing?)
Can you show me what it looks like? Wherever I put addMissionEventHandler, it doesn't work
if you have access to the debug menu, then yes... in zeus if you use zeus enhanced, you can exec code as well. you can also execute .sqf outside of the editor in the mission files before the mission starts (its how we make scripted missions mainly)
I have my CfgFunctions defined as such:
class CfgFunctions
{
class UL
{
tag = "UL";
class Spawning
{
file = "Core\Modules\Spawning";
class createSpawnDialog {};
class spawnPlayer {};
};
};
};
But when I start my server, I'm getting this message spammed and the server appears to repeatedly re-initalize the mission.
Warning Message: Script Core\Modules\Spawning\fn_createSpawnDialog.sqf not found
Warning Message: Script Core\Modules\Spawning\fn_spawnPlayer.sqf not found
Seems like its not using the tag for some reason.
omg i thought i was going crazy... ok pro pro tip for sqf memory searchers, look for sqf functions with only ONE function type :P
i was searching for random in the dev branch, and they added the new form of random
any idea how to set like an area as a trigger for ace arsenal? like being able to walk into a room and scroll wheel to open the arsenal? (not sure if to post here or misson makers)
like how would I remove this
player addAction
["<img size='1.3' image='\a3\ui_f\data\IGUI\Cfg\Actions\reammo_ca'/> <t color='#FF4821' size='1.25'>Arsenal</t>",
{[_this select 0, player, true] call ace_arsenal_fnc_openBox},nil,2,true,true,"","true",10,false,"",""];
oh it looks you already have that
// Activation
private _handle = player addaction [/*stuff*/];
player setVariable ["arsenal_open_handle", _handle];
// Deactivation
private _handle = player getVariable ["arsenal_open_handle", -1];
player removeAction _handle;
thank you
this didnt work
do you have the trigger set to repeatable? and you added your code into it?
We figured it out, thank you π
Hello I am having an issue with a modded mission on a server. In singleplayer instance, the mission does not begin until the mods have loaded. But when placed on server, loading screen dissapears then the screen is black whilst the mods load. I suspect "BIS_fnc_activateAddons" may be related. It says it only initializes on mission start. I've set the mission to only start when a player has joined, and sure enough the first player joining doesnt get this black screen. It does this in SP, one screen ends and another appears, and when its complete the mission is started. But on MP you spend the exact same amount in the black screen instead of a second loading screen.
My question, is it possible to use a script to extend players loading screen until this process is completed for them locally once the addons have initialized..
Have you tested without mods? Do you know which mod is causing it? Whats the mod list? etc etc
The duration of the black screen differs. Less mods, less time. More mods, more time.
Now, when in SP, same mission, instead of a black screen, a second vanilla loading screen appears.. and does not go away until mods have loaded. Without mods, this second screen is extremely quick like less than a second
When starting in the editor, it will behave different, and will display a message about "BIS_fnc_activateAddons"
and the message?
Ill check it again but its something about not being in singleplayer. This doesnt show up outside the editor and its a little yellow text message and not an error and doesnt show in the RPT
But it led me to research BIS_fnc_activateAddons and I saw that it only happens at mission start.. then tested around and I see that it may be related. I dont know much about JIP and all that stuff
Because the missions not starting for the player I think instead of a neat nice looking loading screen it just puts you into a black screen
it sounds to me like a particular mod is doing it or poor scripting. there is too much to unpack. does it happen in other missions or just this mission?
Happens in any mission that is persistent and someone joins after mission start. I thought it was a mod but I actually tested removing all mods.. then slowly added more, and game start time and this black screen time both increased with the amount of mods loaded
If the mission starts with all players, nobody has the issue, they get a second loading screen
I may need to just live with it lol
Granted it is obviously related to mods in general, but not a particular mod
if (!(_objHit == _hitter)) then {
if (_objHit getVariable 'Fighter_Health' <= 0) exitWith {
_objHit removeAllEventHandlers "HandleDamage";
_objHit setDamage 1;
};
if (!(_objHit == _hitter)) then {
if (_objHit getVaria>
Error position: <== _hitter)) then {
if (_objHit getVaria>
Error Generic error in expression
this is the error im getting im lost
Post your context please
what context it is there
so I shot the unit and when I shot the unit I got that error
Could you show me how or where?
This is telling you that the error is in the condition: _objHit == _hitter
Probably one of those variables is either a different type or is nil. Either change == to isEqualTo or find out why one of them isn't an object.
Thank u
Just in case you can.
At work atm so I can't send screens, but to enable debug during your mission, go into description.ext and add enableDebugConsole
https://community.bistudio.com/wiki/Description.ext#enableDebugConsole
For Zeus Enhanced, any object that you double click on will have an execution box.
Thank you!
I'm trying to make a detector for an ACE action where, when the action is triggered, a trigger condition in the mission is met and removes the action. The trouble I'm having is detecting when the action gets triggered and removing the action. Here is my script.
_actionDetector = 0; //This is the variable I want incremented
_actionRoot = ["unlockNuke0","Unlock 3VB3 Shellrack","x\zen\addons\modules\ui\nuke_ca.paa",{nil},{true}] call ace_interact_menu_fnc_createAction;
[artyVeh, 1, ["ACE_SelfActions"], _actionRoot] call ace_interact_menu_fnc_addActionToObject; //This adds the parent action to the vehicle
_action = ["unlockNuke1","Confirm Nuclear Authorization","z\ace\addons\vehiclelock\ui\key_menuicon_ca.paa",{
artyVeh addMagazine ["rhs_mag_atomic_2a33",1]; //Script being run when the action is triggered
_actionDetector = _actionDetector + 1; //This is the variable I want incremented
},{true},{},[], [0,0,0], 1] call ace_interact_menu_fnc_createAction;
[artyVeh, 1, ["ACE_SelfActions","unlockNuke0"], _action] call ace_interact_menu_fnc_addActionToObject; //This adds the childAction "unlockNuke1" to the parentAction "unlockNuke0"
How to I make this variable more "Global" in that the trigger condition can see it and then make the trigger effect something like this?
[artyVeh,1,["ACE_SelfActions","unlockNuke0"]] call ace_interact_menu_fnc_removeActionFromObject; //remove parentAction
[artyVeh,1,["ACE_SelfActions","unlockNuke0","unlockNuke1"]] call ace_interact_menu_fnc_removeActionFromObject; //remove childAction from parentAction
I don't even know if this is correct form to remove an action that has a parent. Any help is GREATLY appreciated.
Dumb question: Anyone knows how to change Text Color ?
Depends, for what? Cause there are multiple types of syntax.
For a Task that needs some red in the description to highlight some enemy
Added: New command selectRandom which returns a random element of a given array
Tweaked: The random command now accepts an array as alternate syntax to support Gaussian distribution
I'm not sure Tasks support custom text formatting
Normally you would use Structured Text, but task commands only take String for their text stuff, and I don't think that gets parsed into Structured Text either
Thank you! That worked
But still no new/updated str command that escape quotations in strings
every code inside the actions are local and in a diferent scope
remove _ on the detector
and if you want to share it to all players and server use publicvariable "varname"
I decided to try to add a variable to the detector trigger with setvariable, would that have worked?
its practily the same
ok, I'll continue and report results. Any ideas with the removal of the ACE actions?
is there really no way to set a unit side? particularly once the setCaptive thingy has taken effect?
causing vehicles to be taken over civilian, especially once loaded.
this in spite of the fact he is in my group (opfor).
okay so using the SetVariable in the ACE action SQF and the GetVariable in the Trigger has worked along with the ACE action removal in the trigger effect. Thank you!
is there a way to allow player vehicle entry once captive units are loaded into a vehicle? because right now it is blocking.
Put a player or friendly ai in the vehicle first?
Or you can move the captive unit to the players group
Or make the captive unit join a new group on the friendly side
Or possibly, unlock the vehicle fully instead of leaving it on default?
the unit is in my group already, yes.
NSWYM unlock vehicle fully? I scanned the locked, lockedDriver, for instance, and the vehicle is definitely unlocked in both cases, with captive (civilian) unit loaded.
next I guess will try forcing the issue moveIn... but I suspect will be met with a hard no in that instance as well. along similar lines as with the ACE Get In actions, was a no-op, effectively, did nothing, or was blocked somehow.
There are two levels of unlock state: 0, which is fully unlocked and anyone can get in, and 1 (the default state), which is mostly unlocked but AI rules are in effect for AI-led groups, so leadership orders are required to get in.
You previously reported that the vehicle is in lock state 0, so this isn't the issue.
either is not the case, to be honest. i.e. not an AI led group, but a player led group.
tried, I can at least moveInDriver so there's that
but the action menu actions for any of the vehicle positions goes away.
as a workaround could probably introduce a menu item.
although still a bit odd that for ACE Get In is a bit more casual in its response, and also blocks, a no-op.
// _x being the vehicle
[locked _x, lockedDriver _x]; // [1, false]
cleared the locking, _x lock 0, but still cannot get in.
once in, I can negotiate the positions freely. just cannot get in the first time without an assist.
is there a way to programmatically check player is aiming (rather than weapon lowered from combat pace/double tap ctrl etc) or make player aim
to clarify,
- player led group, not AI led group.
- unit is captured from hands over head (surrendering) to hands behind back, so any notion of unit commands is a non-sequitur.
- rather, escort directs unit to load transport vehicle via custom action, which I did.
at which point, vehicle entry blocked.
player led group, not AI led group
Yes, but that doesn't necessarily mean there can't be inconsistencies or things having unexpected effects. We've already established that this is not the problem, since the vehicle is in state 0 anyway, but it was a potential issue that was worth exploring.
unit is captured from hands over head (surrendering) to hands behind back, so any notion of unit commands is a non-sequitur.
The animation a unit is in doesn't have any connection to what commands it can give. The "surrendered" state does not exist in vanilla, onlysetCaptive, which doesn't affect the AI's behaviour. Any such state is scripted by a third-party mod, and could therefore have unknown loopholes, side effects, or elements that remain under the control of the engine, which has no concept of a captured unit.
Anybody know how to make an object an inventory in game like in the init
I do not disagree; player led, best I can offer is AI involved if you would. if there is a bug, it is that, IMO.
Well-well-well: https://twitter.com/lmk_nathan42915/status/1740569454701072817
On client side I have initPlayerLocal.sqf which I know is triggering as all diag_log statements are provided.
diag_log "Player Initializing....";
if (hasInterface) then
{
waitUntil {!isNull player};
//private _playerInfo = getUserInfo getPlayerID player;
[] call UL_fnc_createSpawnDialog;
[ ] remoteExec [ "UL_fnc_initPlayerServer", 2 ];
diag_log "createSpawnDialog called";
};
I have fn_initOaterServer.sqf on the server side in the "Modules" diectory with just this code.
"Hello" remoteExec ["hint"];
"Hello" remoteExec ["diag_log"];
diag_log "Testing";
In my description.ext in CfgRemoteExec > Functions
class UL_fnc_initPlayerServer { allowedTargets = 2; };
On my server in config.cpp I have
class CfgFunctions
{
class UL
{
tag = "UL";
class Modules
{
file = "Modules";
class initPlayerServer {};
};
};
};
I tried messing with file var, with different paths based on code I was seeing online with no luck.
I'm probably doing something dumb here but I can't get initPlayerServer to trigger. I know there's a file I can use for that, but right now I'm just trying to figure out how to call server functions from client.
Is this a mission or a mod?
And you mean it's in modules\fn_initPlayerServer.sqf, not functions\modules\fn_initPlayerServer.sqf?
Mission; has the client mission and a server side component, which might be considered a mod? not entirely sure, it's not meant to provide a dependency though. Think Altis Life.
Correct, I didn't think the functions directory was a requirement, but it's possible I missed that in the documentation that's kinda everywhere. It works without functions directory on client, assumed it would work fine on the server side too, could be wrong.
Well, you're not using CfgFunctions for the client function.
This was a typo, right:
I have fn_initOaterServer.sqf on the server side in the "Modules" diectory with just this code.
Separate "server side component" sure sounds like a mod to me.
In which case you need to figure out prefixes.
This is what I have in client side
class CfgFunctions
{
class UL
{
tag = "UL";
class Spawning
{
file = "Core\Modules\Spawning";
class createSpawnDialog {};
class spawnPlayer {};
};
};
};
class CfgRemoteExec
{
class Functions
{
mode = 1;
jip = 0;
class BIS_fnc_effectKilledAirDestruction { allowedTargets = 0; jip = 0; };
class BIS_fnc_effectKilledSecondaries { allowedTargets = 0; jip = 0; };
class BIS_fnc_fire { allowedTargets = 0; jip = 0; };
class BIS_fnc_objectVar { allowedTargets = 0; jip = 0; };
class BIS_fnc_setCustomSoundController { allowedTargets = 0; jip = 0; };
class BIS_fnc_debugConsoleExec { allowedTargets = 0; };
class UL_fnc_initPlayerServer { allowedTargets = 2; };
};
};
Wasn't sure I needed to define a server function in CfgFunctions.
Yes typo, should be fn_initPlayerServer.sqf
You need to figure out whether you're writing a mod or not anyway.
I'm not really sure the different terminology. With "mod" my mind goes to workshop mod you have to subscribe to. Which isn't what I want, but maybe the term means soemthing else too.
How many PBOs do you have?
2, the mission PBO and server PBO, which I guess is the mod in this case, used by the server, but not distributed to clients.
How are you loading the server PBO?
It's in the root folder of the server in folder @UL.Server/addons/UL.Server.pbo
Loaded through -serverMod=@extDB3;@UL.Server
UL.Server? prefix in this context just refers to the name of the PBO?
The clients is UL.Altis
Ok you need to read this a few times:
https://community.bistudio.com/wiki/Arma_3:_Creating_an_Addon
Prefix is the virtual filesystem path of the PBO. It's an attribute set on the PBO by your build tool.
Alright guessing I'm missing that because I'm using PBOConsole.exe to pack as part of a powershell script, and I just run
& $pboManagerPath "-pack" "$serverSourceFolder" "$serverOutputFolder\UL.Server.pbo"
Yeah I don't know that build tool.
There is apparently a default prefix but it's not documented anywhere.
Alright, that could be the entirety of my problem, not sure if PBOManager has that option. I have to leave shortly, but I'll go through that documentation and make sure everything is setup correctly before I bug anyone else.
Thank you, saved me from a massive headache.
Once you figure out how to set the prefix, you'll need to update your CfgFunctions file parameters to include it.
Otherwise it won't know where the files are.
I advocate for HEMTT for mod making
https://github.com/BrettMayson/HEMTT
I'll check that out thanks
I hear people say hemtt is better but honestly it's like 1000 miles over my head
how so?
Seems complicated to me, maybe I'm just the dum
Kinda looking for a simple way to do a Zeus Enhanced Task of when players gets close to an area a task popup appears...
Also does anyone knows how to clear out tasks or make tasks that pop ups but aren't assigned in tasks board when players open their map?
if you are at the point where you want stuff to appear when players get close, just script it before hand in the mission. don't use zeus for it
Can you do that in an antistasi mission with progress already made?
I suppose you can just take the map data?
its more complicated than that. didn't know you were modifying an already existing mission
My fault. I just really like of making "antistasi" more than it is by default you know
HI All,
want time to pass faster at night. It's started to pass faster but not switching back to normal after 6:30 a.m. What I'm doing wrong?
init.sqf
[] call compileScript ["core\time_cycle.sqf"];
core\time_cycle.sqf
if (!isServer) exitWith {};
while {true} do
{
if (daytime >= 17.5 || daytime < 6.5) then
{
setTimeMultiplier 20 //for night time
}
else
{
setTimeMultiplier 1 //for day time
};
sleep 120;
};
That looks correct, does your actual code have semicolons after the setTimeMultiplier code?
no. it's copied as is
oh, add semicolons then
setTimeMultiplier 20; ?
yes
thx. will try
now it's not switching to faster time at 17:30
if (!isServer) exitWith {};
while {true} do
{
if (daytime >= 17.5 || daytime < 6.5) then
{
setTimeMultiplier 20; //for night time
}
else
{
setTimeMultiplier 1; //for day time
};
sleep 120;
};
Add a systemChat str daytime before the if so you can see what time it's detecting
@hallow mortar executed dayTime throuth debug console - 18.0853
I'd like you to do it as part of the loop script, so that we know what time it is at the moment the loop happens, and so there's a clear indicator the loop is running at all
not sure where exactly to add it
just put it before the first if statement
7:38:49 Error in expression < 20;
}
else
{
setTimeMultiplier 1;
};
sleep 120;
};>
7:38:49 Error position: <sleep 120;
};>
7:38:49 Error Suspending not allowed in this context
7:38:49 File mpmissions__cur_mp.takistan\core\time_cycle.sqf..., line 13
systemChat str daytime;
if (!isServer) exitWith {};
while {true} do
{
if (daytime >= 17.5 || daytime < 6.5) then
{
setTimeMultiplier 20; //for night time
}
else
{
setTimeMultiplier 1; //for day time
};
sleep 120;
};
Need to either to spawn the time_cycle function like this 0 spawn time_cycle instead of calling it.
Read here why: https://community.bistudio.com/wiki/Scheduler
Or wrap it inside a spawn
0 spawn {
systemChat str daytime;
if (!isServer) exitWith {};
while {true} do
{
if (daytime >= 17.5 || daytime < 6.5) then
{
setTimeMultiplier 20; //for night time
}
else
{
setTimeMultiplier 1; //for day time
};
sleep 120;
};
};
- this is being done with an external script file so just use execVM instead of call compile, for making it scheduled
- HOWEVER, the call compile is being done in init.sqf, which is scheduled, so suspending is allowed and this error doesn't make sense
About the position of the systemChat, that's my mistake for not being precise. It should be after the while {true} but before the if (dayTime >= ..., that is, inside the loop but before the condition that depends on it being a certain time.
If you tested this by doing it from the debug console instead of continuing to use init.sqf, that's why this error has now appeared. The debug console is unscheduled. Keep using init.sqf
just put on server. working like a charm. thank you guys!
executed from init.sqf with execVM "core\time_cycle.sqf";
time_cycle.sqf
if (!isServer) exitWith {};
while {true} do
{
systemChat str daytime;
if (daytime >= 17.5 || daytime < 6.5) then
{
setTimeMultiplier 20; //for night time
}
else
{
setTimeMultiplier 1; //for day time
};
sleep 120;
};
still no chat messages with daytime but it's not a problem since all is working
You won't see the chat message when running on an actual server, because the code is running only on the server, so only the server sees the message. So if it's working, you can remove that line for a small performance saving.
However, this should have worked in local testing or not at all. There's nothing about it that should work differently (in terms of what matters for the problem) between local and DS.
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
https://community.bistudio.com/wiki/Modules I'm a little confused, if I want to add custom modules to my mod, would I add to the existing config.cpp, or do I need to create a new directory with its own config.cpp for modules specifically.
For the god sake I don't know what to do with these damn ORBAT Groups
What does not work
class CfgORBAT
{
class 2ndDivision
{
id = 2;
idType = 0;
side = "West";
size = "Company";
type = "Infantry";
commander = "Baller";
commanderRank = "Major";
text = "%1 %2 %3";
textShort = "%1 %3";
color[] = {0,0,1,1};
assets[] = {{"B_MRAP_01_F", 1},{"B_Plane_Fighter_01_F",2}};
class 1stSquad
{
id = 1;
idType = 0;
side = "West";
size = "Squad";
type = "Infantry";
commander = "Caos";
commanderRank = "Lieutenant";
text = "%1 %2 %3";
textShort = "%1 %3";
color[] = {0,0,1,1};
assets[] = {{"B_MRAP_01_F", 1},{"B_Plane_Fighter_01_F",2}};
};
};
};
//PATH
missionConfigFile >> "CfgORBAT" >> "2ndDivision" >> "1stSquad"
//Ceiling
missionConfigFile >> "CfgORBAT" >> "2ndDivision"
It's a ORBAT Config from some Bohemia Forum but it does not work for me neither
I still have no class found error
And, yes I have correct file expansion EXT
description.extfor sure?- Reloaded (or save) your mission?
The guy from yt said I can name it whatever...
You can name what whatever?
You cannot. description.ext. Either you misread the guide or he doesn't know what he said
Case insensitive AFAIK though
Honestly this guide just makes me confused
U know this one?
Know what? I know what description.ext is but I don't know what this guide tries to tell
He said in vid to name it description.ext but in the comments he said "Name it Anything" so that's what I did u feel me
Pretty much nothing is different than regular modding. You make your own config.cpp, you make your own Mod, call it a day
Alright, I try what you said thanks in advance
I'm not repling to you
Ok thanks, english is not my native language, so to me the phrasing made it seem like it was required rather than optional
Dw english is not my native language either like many people here
Anyways am out
Yes, I know I made many mistakes I don't think after fighting with those damn ORBAT Groups
Is there a way to detect waypoint being created with high command?
Hi, i have a house with many doors like 10 doors. how i can desactivate only the doors 1 2 and 3.. ItΒ΄s posible? only with INIT ?
Like this:```sqf
bldg setVariable [format["bis_disabled_Door%1",_doorIndex], 1, true];
actually the arg was 1 not true (edited above)
but, where i spesificate the doors 1 , 2 and 3 ?
_doorIndex
so, only need remplace _doorIndex with 1,2,3?
yes
i go to try.
for "_i" from 1 to 3 do {
_bldg setVariable [format["bis_disabled_Door_%1",_i], 1, true];
};```
and _bldg is the building object
Just trying to confirm my thinking is correct with locality. I usually use the code below for objects I'm trying to increase their size in MP but if I'm ticking the local attribute on the object I should remove the if statement right?
if(isServer)then{
_obj = [this] call BIS_fnc_replaceWithSimpleObject;
_obj setObjectScale 3;
};
Probably yes, otherwise only the server's local copy of the object will be converted to a simple object and scaled
but it's creating the object for each player locally so the init would also run for that local object right?
Yes, but the isServer check would fail for any machine other than the server, so nothing would happen to the clients' local copy of the object
yeah that's why I was going to remove the if statement for the local objects
Also when you put vehicles' names from this website https://community.bistudio.com/wiki/Arma_3:_CfgVehicles_WEST Can you put into ORBAT Group every single vehicle?
Am I misunderstanding the structure of custom modules, essentially I have a script that currently is activated by a trigger, but I would like to make it all into just a single module so its easier for my friends to use. To achieve this I need to define a module, than a module function (which contains the script)?
Its especially hard since with a trigger you can just do simple things like thisTrigger getPos to get the trigger location, but with modules you have to define it in the attributes (somehow) then pass it to the module function? If anyone has any non-BI sources that explains this stuff, that'd be greatly appreciated.
if you put the code in init field change the "_bldg" to "this"
actually ignore what I said, figured it out.
i do, but nothings happend π¦
the door open has well
this setVariable [format["bis_disabled_Door_%1",1], 1, true];
this setVariable [format["bis_disabled_Door_%1",2], 1, true];
this setVariable [format["bis_disabled_Door_%1",3], 1, true];
the door 1 2 and 3 still open
maybe its custom building that does not support the bis_disabledDoor variable?
wait, its supposed to be "bis_disabled_Door_%1"
not "bis_disabled_Door%1"
ugh this chat changes the name
bis_disabled_Door_%1
that one ^^
\_ needs escape yes
or code tag
If a mod isnβt working on a dedicated server, is it possible to configure the server itself to make it dedicated server compatible?
no
// Function
fnc_LockDoors = {
params ["_Building","_DoorsToLock"];
if(_DoorsToLock IsEqualTo [0]) then
{
private _doorCount = getNumber (configFile >> "cfgVehicles" >> typeOf _Building >> "numberOfDoors");
for "_i" from 1 to _doorCount do {_Building setVariable[format["bis_disabled_Door_%1",_i],1,true]};
} else
{
{_Building setVariable[format["bis_disabled_Door_%1",_x],1,true]} foreach _DoorsToLock;
};
true
};
// Call the function with the _Building defined (Will lock door 1,2 and 3).
[_Building,[1,2,3]] call fnc_LockDoors;
// This would look all doors
[_Building,[0]] call fnc_LockDoors;
But as already mentioned here some mod building miss something for it to work properly.
let me try
anyone know if it's possible to get a video to loop seamlessly, I have a video playing on a loop atm but it just snaps to black for a third of a second before the next loop starts.
Could someone clarify the difference between arguments and attributes in the module framework
are you using https://community.bistudio.com/wiki/BIS_fnc_playVideo?
they are both the same, however, for your purposes, use attributes. arguments are from old BI systems and tend to have backend things going on that you won't be able to customize
Perfect, thanks
And best way to retrieve an attribute value is with getVariable right
yes,
https://github.com/hypoxia125/Modules-Enhanced
look through my code for examples. contribute if you want as well.
looking through the function, it doesn't have some sort of return for the ctrl, nor does it have a scripted event handler you can work off of when it detects the video is done. you'll probably have to write your own in your own way
Tysm
if i want to convert execVM'd script to function, i would spawn the script, right?
If you want to run in scheduled, yes
Anyone got a quick solution to turn off collision damage?
I am trying to have vehicles be unharmed when crashing into walls, and have infantry not die by being crashed into by vehicles
so question for yall: im running this script in itemList.sqf in the root menu of the MP mission im making:
// Define the item sets
_itemSets = [
["rhs_weap_aks74u", 3, "rhs_30Rnd_545x39_7N6M_AK"],
["rhs_weap_akmn", 3, "rhs_30Rnd_762x39mm_bakelite"],
["arifle_Mk20_plain_f", 3, "30Rnd_556x45_Stanag"],
["rhs_weap_g36c", 3, "rhssaf_30rnd_556x45_Tracers_G36"],
["rhs_weap_hk416d145", 3, "rhs_mag_30Rnd_556x45_Mk318_Stanag"],
["rhs_weap_m14", 3, "rhsusf_20Rnd_762x51_m62_Mag"],
["rhs_weap_m249_light_S", 3, "rhsusf_100Rnd_556x45_mixed_soft_pouch"],
["rhs_weap_M590_8RD", 5, "rhsusf_5rnd_00Buck"],
["SMG_05_F", 3, "30Rnd_9x21_Mag_SMG_03_Tracer_Red"],
["rhsusf_weap_glock17g4", 3, "rhsusf_mag_17Rnd_9x19_JHP"],
["hgun_Pistol_heavy_01_F", 3, "11Rnd_45ACP_Mag"],
["hgun_Pistol_01_F", 4, "10Rnd_9x21_Mag"],
["launch_RPG7_F", 2, "RHS_rpg7_TBH7V_mag"]
];
// Randomly choose an item set
_selectedSet = _itemSets select (floor(random(count _itemSets)));
// Spawn the selected item set
_unit = createUnit [_selectedSet select 0, getMarkerPos "marker_0", [], 0, "NONE"];
// Add magazines to the spawned unit
{
_unit addMagazineCargoGlobal [_x select 2, _x select 1];
} forEach _selectedSet;
This script is meant to select a random weapon+ammo set from the list, and then spawn it in game.
When itemList.sqf is called in game (eventually it will be tied to a trigger) arma says line 22
(_unit = createUnit [_selectedSet select 0, getMarkerPos "marker_0", [], 0, "NONE"];) is missing a semi colon. Do any of you know what the issue might be here?
i have also tried running this directly on a trigger in game (in the activation box) however im getting the same error, and the wiki says the in game triggers dont read "//" as comments
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
Please format so we can understand which is the code easily
im doing something wrong because pressing enter just adds more whitespace and doesnt post it
Just click outside of your code so you're good
its not often im too stupid to understand something but clearly this is one of those times. the only place on my entire screen where clicking on it and then pressing enter does NOT make more whitespace in the code is my task bar. if i press my task bar nothing happens at all when i press enter.
Task bar? I didn't mentioned about anything about it
you said click outside of the code
there it is, i see the problem (i think)
//
// Define the item sets
_itemSets = [
["rhs_weap_aks74u", 3, "rhs_30Rnd_545x39_7N6M_AK"],
["rhs_weap_akmn", 3, "rhs_30Rnd_762x39mm_bakelite"],
["arifle_Mk20_plain_f", 3, "30Rnd_556x45_Stanag"],
["rhs_weap_g36c", 3, "rhssaf_30rnd_556x45_Tracers_G36"],
["rhs_weap_hk416d145", 3, "rhs_mag_30Rnd_556x45_Mk318_Stanag"],
["rhs_weap_m14", 3, "rhsusf_20Rnd_762x51_m62_Mag"],
["rhs_weap_m249_light_S", 3, "rhsusf_100Rnd_556x45_mixed_soft_pouch"],
["rhs_weap_M590_8RD", 5, "rhsusf_5rnd_00Buck"],
["SMG_05_F", 3, "30Rnd_9x21_Mag_SMG_03_Tracer_Red"],
["rhsusf_weap_glock17g4", 3, "rhsusf_mag_17Rnd_9x19_JHP"],
["hgun_Pistol_heavy_01_F", 3, "11Rnd_45ACP_Mag"],
["hgun_Pistol_01_F", 4, "10Rnd_9x21_Mag"],
["launch_RPG7_F", 2, "RHS_rpg7_TBH7V_mag"]
];
// Randomly choose an item set
_selectedSet = _itemSets select (floor(random(count _itemSets)));
// Spawn the selected item set
_unit = createUnit [_selectedSet select 0, getMarkerPos "marker_0", [], 0, "NONE"];
// Add magazines to the spawned unit
{
_unit addMagazineCargoGlobal [_x select 2, _x select 1];
} forEach _selectedSet;
those are "`"s not "."s
Okay so...
selectRandom _itemSets;is enough to select one element of an arraycreateUnitis not the command to make a weapon holder, it is for an AI unitforEach _selectedSetisn't a proper way to do in this case, it iterates_selectedSet's each element, in this case"rhs_weap_aks74u",3,"rhs_30Rnd_545x39_7N6M_AK", not your array- So instead of
forEach'ing, just_selectedSet select 0or so - However I recommend to use
addWeaponWithAttachmentsCargoGlobal, and use"WeaponHolder_Single_F"withcreateVehicle
so i kind of understand the first part, and can work that one out. what does weaponholder+create vehicle do in this instance?
actually, the second part creates the box/bag whatever and "addWeaponWithAttachmentsCargoGlobal" populates it with stuff from the array?
Ah hmm, I misunderstood a bit of the intention there
But my understand is this:```sqf
private _itemSets = ["arifle_MX_F",3,"30Rnd_65x39_caseless_mag"];
private _groundHolder = createVehicle ["GroundWeaponHolder_Scripted",getPosATL player,[],0,"CAN_COLLIDE"];
private _magazineCount = getNumber (configFile >> "CfgMagazines" >> (_itemSets#2) >> "ammo");
_groundHolder addWeaponWithAttachmentsCargoGlobal [[_itemSets#0, "", "", "", [(_itemSets#2),_magazineCount], [], ""], 1];
_groundHolder addMagazineCargoGlobal [(_itemSets#2),(_itemSets#1)];```
I wouldn't bother getting the ammo count from the magazine config tbh. Just set it to like 500 or something, it will only add up to the max capacity
I am trying to find the "Get in" action IDs for a vehicle, looking at it, cursorobject, but it does not appear to have any.
are those instead added to player?
or possibly are they configuration based?
trying to find info about each of them, specifically for iconagraphy, paths and such.
Some actions, like Get In, are engine-controlled and don't have IDs.
hrm... where might I find the icons?
If you're looking for the action icons, the "UI that shows all icons" script here is very useful https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
like specifically I want the "Get in commander" icon.
the + with two rings
if I have to screen shot it I will, but I hate to do that if there is a resource I can leverage.
.
now we cooking with some oil getingunner_ca.paa...
hmm I may not be reading this correctly which icons are being displayed where/how in a commanding menu.
https://community.bistudio.com/wiki/showCommandingMenu
as far as I can tell, for vehicle roles, driver for instance, the icon paths are correct. but that is not what is being displayed. let alone where.
need more info? https://community.bistudio.com/wiki/Arma_3:_Communication_Menu
Anyone able to help me with some script stuff?
Ok im sorry
Ill elaborate on my problem:
Im in a server that runs several scripts that seem to clash together. Im not entierly sure how to fix it (If Possible)
TThe scripts that seem to clash is: "taw_vd." "RifleTargets" And "Fawks Medical".
anyone know an easy way to fix this? Its with the "cfgfunctions" between Fawks and Rifle targets and "Defines" between Fawks and Taw
no easy way. requires us to go through 3 mods worth of code and fix a compatibility issue. suggest choosing a different combo of mods.
But as i see it its 4 "Files" Here causing issues
Thanks for the feed back tho
hey all, i am trying to create a sub scroll menu any idea on how i do that
What is a sub scroll menu
I suspect the idea is a sub-menu off the action menu, similar to sub-menus in e.g. the Windows context menu.
If that is the idea then the answer is "you don't"; there is no proper way of doing such a thing, and trying to manually build your own is a bad idea
Damm ok
Anyone got any help with this CBA thing https://forums.bistudio.com/topic/186190-cba-fleximenu-help/#entry2941753
correct me if im wrong but ... that what youre showing there is not CBAs flexi menu
that should be the normal menu of tactical battlefield
whilst this https://i.ytimg.com/vi/LLZqk5by_RI/hqdefault.jpg is the flexi menu of CBA
poor quality but ... still
first img i could find
No men the door i thiink is the objetc
thanks for share all that
Happy new year to all, so i created a SP misson for my self. but i cant work out the what the scrip is to preload RHS water and fuel jerry cans as ace cargo, just to save me having to load them manually every time i restart after a edit.
i know there is this -
["ACE_Wheel", cursorObject] call ace_cargo_fnc_loadItem
so for a jerrycan it be
["rhsusf_props_ScepterMWC_D" , cursorObject] call ace_cargo_fnc_loadItem in the vehicle init?
if i wanted say 8 then would it be
["rhsusf_props_ScepterMWC_D, 8" , cursorObject] call ace_cargo_fnc_loadItem in the vehicle init?
i do not really understand how it work
many thanks
ace_cargo_fnc_loadItem does not have a quantity parameter, and can only do one object at a time. If you want to do multiple, use a for loop:
for "_i" from 1 to 8 do {
["rhsusf_props_ScepterMWC_D", _vehicle] call ace_cargo_fnc_loadItem
};```
(If it did have a quantity parameter, it would _not_ be provided as part of the classname string.)
`cursorObject` is not the appropriate command to use to find the target vehicle. `cursorObject` returns the object the local player's cursor (roughly centre screen) is currently over. That would be fine if you wanted to add something to the vehicle you're looking at, but it's no good for an init field.
In an object init field, the special variable `this` contains a reference to the object the init field belongs to, so use that instead.
Note that object init fields are run on every machine, when the mission starts or when they join the game. You'll want to ensure your code only runs once, at the start, instead of running as many times as there are connected machines, and again when someone joins. A sensible way to do this is to ensure all machines apart from the server ignore it.
```sqf
if isServer then {
for "_i" from 1 to 8 do {
["rhsusf_props_ScepterMWC_D", this] call ace_cargo_fnc_loadItem
};
};```
@hallow mortar amazing thank you so much for the help
actually the server-only stuff doesn't matter if it's SP, since there will only ever be one machine connected. It doesn't hurt though, so you can leave it in in case you want to play co-op in the future.
thanks
I looked at cba's files and saw the graphics there
It's the same type of menu, just the appearance that changes a bit.
Could be, but I have no idea how to script that menu in
bumping this as still cant find it
No idea either never looked at the code, if it's the ace type of menu instead call me.
read the docs?
I have read the docs, but they don't really help that much
main problem is just the "combat pace" thing
Yeah, I was just wondering if anyone here knew about it so I could take the easy road
most getters (stance etc) dont consider that
I think the docs are rather clear on it
the icons are not showing up in the menu like I would expect. instead an icon is drawing center screen. and it is not the one that I am providing.
the icons I want are:
\a3\ui_f\data\igui\cfg\actions\getinpilot_ca.paa
\a3\ui_f\data\igui\cfg\actions\getindriver_ca.paa
\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa
\a3\ui_f\data\igui\cfg\actions\getincargo_ca.paa
as I initially stated, my goal is to present in a commanding menu the same icons that appear in the actions.
what's going on with this example, for instance... should I be flagging custom icons false, then? because it appears as though at least two of the actions have icons associated with them?
https://community.bistudio.com/wiki/Arma_3:_Communication_Menu#Submenu
if icons appear at center of the screen it sounds like the icon bar is misplaced in the layouts
strange, dunno.
I left that false for now, still no icons however, being rendered in the commanding menu. are there size restrictions on the icons? i.e. they should be 32x? or 16x? I think these may be 64x, which are fine for the action menus.
tried with other icons?
which other icons? the ones I enumerated above.
other than the example icons in the docs.
both appear to be 64x
like ```
"\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\artillery_ca.paa"
I mean I 'could', but like I said, they are both 64x.
what else do I need to convey for icons?
What am I doing wrong here? I'm using KK's neat function that combines findEmptyPosition and isFlatEmpty.
Calling code: sqf _finalPos = [[_tempPos],[50,-1,-1,1,0,false,objNull]] call PEAK_fnc_AI_isFlatEmpty; PEAK_fnc_AI_isFlatEmpty: ```sqf
params ["_pos", "_params"];
_pos = _pos findEmptyPosition [0, _params select 0];
if (_pos isEqualTo []) exitWith {[]};
_params = +_params;
_params set [0, -1];
_pos = _pos isFlatEmpty _params;
if (_pos isEqualTo []) exitWith {[]};
_pos;
`findEmptyPosition` (in the fnc) always returns an empty array, but I can't find the source of the error. (`_tempPos` is properly defined also according to debugger, and I'm testing in VR)
have you tried ```sqf
[_tempPos] => _tempPos
Haha, that was it! Thanks π
from my log, these were the commanding menus I constructed. can be 1+ such chained menus, depending on how specialized the vehicle positions may be.
[
["Get in transport...",false]
, ["Driver",[2],"",-5,[["expression","[player, [0, 0]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getindriver_ca.paa"]
, ["Passenger (Left Seat 2)",[3],"",-5,[["expression","[player, [0, 1]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa"]
, ["Passenger (Right Seat 2)",[4],"",-5,[["expression","[player, [0, 2]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa"]
, ["Passenger (Right Seat 1)",[5],"",-5,[["expression","[player, [0, 3]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa"]
, ["Passenger (Right Seat 3)",[6],"",-5,[["expression","[player, [0, 4]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa"]
, ["Passenger (Left Seat 3)",[7],"",-5,[["expression","[player, [0, 5]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa"]
, ["Gunner",[8],"",-5,[["expression","[player, [0, 6]] call MY_fnc_captives_onCommandingEscortGetInTransport"]],"1","1","\a3\ui_f\data\igui\cfg\actions\getingunner_ca.paa"]
, ["Abort",[1],"",-5,[["expression","[] call MY_fnc_captiveUI_hideEscortGetInTransportMenu"]],"1","1","\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"]
]
the menu does present, and the choices do function correctly. just the icons are not cooperating.
I can do a smoke test,
fileExists '\a3\ui_f\data\igui\cfg\actions\getindriver_ca.paa' // true
so I am reasonably confident that the files do exist.
I cannot imagine, is it something dumb like commanding menus is treating icon paths as case sensitive? that would be dumb...
which and for grins, responding to your suggestion, threw in the iconcursorsupport_ca.paa for good measure.
no joy in any of these, no icons are showing
The icons show where the cursor is not next to the items
If you want to show icons next to items, use structured texts
huh? if that's the case, not according to this (?)
https://community.bistudio.com/wiki/Arma_3:_Communication_Menu#/media/File:CommunicationMenuIconsA3Beta.jpg
That's different
Those icons don't come from commanding menus
They're always there (support icons)
bear with me one sec while I screen shot with icons true
It looks like those are from the CfgCommunicationMenu config-based top-level menus. Note how they have two icon types (icon and cursor properties), while the function-based submenu, which you're using, only has the cursor icon.
this is what I get.
- the icons do not render in the menu, but if the workaround is structured text, fair enough, so be it.
- but furthermore, consistent with the claim, the icon is at the cursor position center screen, but those are not what I spec, literally from the array above.
https://pasteboard.co/I2B7vOu610Vw.png
and for that matter, why mention this note in the docs at all, if that is not what is happening...
// icon path: The path to the texture of the cursor, that should be used on this menuitem.
Please post in wiki channel what should be changed.
Maybe your paths are wrong
I know that it does work because I've used it before myself
no the paths are correct, literally copied from the source dump paths, verified with fileExists
but moreover, looking into the structured text approach, does not seem to work quite right...
https://pasteboard.co/IEC5lkg1ZJFA.png
oh wait a sec silly me... might have a typo in there...
Then post the error and surrounding code
yes. in and of itself I can structure
_t = text 'test';
_t setattributes ['valign', 'middle'];
_i = image '\a3\ui_f\data\igui\cfg\actions\getincargo_ca.paa';
_i setattributes ['valign', 'middle'];
hint (composetext [_t, _i])
that works. working on a rinse repeat use case...
breakthrough https://pasteboard.co/EC1LQLpqHaTC.png
I can work with that, thanks for the guidance all!
Maybe I am just an idiot.
Hello!
Players on my server can open a dialog window after pressing a button. A window shows up and among other things, there's also a button that can be clicked. When a player clicks this button, it executes this: sqf ExecVm 'cams\startfeed.sqf' And inside that .sqf file (among other things) i have this line: sqf _camera setGroupIdGlobal ["CCTV %1", name player]; It is supposed to name an UAV drone as CCTV and name of the player who clicked the button. But it just gives the drone name CCTV and no name so i suppose i defined name player incorrectly. Can someone suggest me a correct solution to this please? Thank you.
Post the whole file. Use pastebin if needed
May i Dm you or do you want me to just pop it inhere?
Just pop it here. Use pastebin if it's long, otherwise look at the pins on how to use discords formatting
Copy
understood, this whole thing works perfectly fine, it just doesn't give the UAV the correct name, however it does name it as CCTV at least, just the players name is missing, here: ```sqf
_camera = player getVariable ["fw_cam_operator", objNull];
if (!isNull _camera) then {
deleteVehicle _camera;
};
private _camera = createVehicle ["B_UAV_01_F", [2122.586,4555.780,38.408], [], 0, "CAN_COLLIDE"];
createVehicleCrew _camera;
_camera setVectorDirAndUp [[1,0,0], [0,0,1]];
_camera allowDamage false;
[_camera, true] remoteExec ["hideObjectGlobal", 2];
_camera setFuel 0;
_camera setGroupIdGlobal ["CCTV %1", name player];
player setvariable["fw_cam_operator",_camera,true];
This is the first Error:
Mission\config\CfgFunctions.hpp. line 39: .CfgFunctions: Member already defined
Link to pastebin:
https://pastebin.com/zfJP5XAJ
Most likely clashing with:
https://pastebin.com/4PPSJ3Dk
https://pastebin.com/cZLrZA6c
The two other CFG files is not stored in the same Config folder
Exactly
what's in your description.ext?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
that's your problem
Have a look at line 20 and at line 28
CfgFunctions is twice in there
its actually... 3 times from 20 to 24, then 1 more time in 28 i think
I depends what's in the defines
The naming is questionable
As it suggests all these files have CfgFunctions in it
How can i fix it?
The includes most likely need to be within CfgFunctions {...}
controversial opinion:
just so you can see the structure of things, try not using #include at all, and put everything exposed in the description.ext. when you understand the structure, then start to go back and do includes
ok?
But the problem started when Fawks got added
But? But the issue is mostly because you're confused what is and does #include
Line 28 in the description.ext you posted is using #include to bring in a CfgFunctions definition from a separate file. However, CfgFunctions has already been defined a few lines earlier, so this creates a duplicate.
You need to go and find out what is happening in configs\CfgFunctions.hpp, because the contents of that file is being directly placed into description.ext as if it was typed there in full.
Ah
tldr: #include does only dumb copy and paste
I dont get how to fix it π
configs\CfgFunctions.hppwill start with a line that hasclass CfgFunctions {and end with a line that has};. Remove those- move
#include "configs\CfgFunctions.hpp"to a line inside theclass CfgFunctions {in description.ext, for example directly below the#include "RifleTargets\cfgfunctions.hpp"line
Well, i fixed that now it comes with a new problem
New problem:
dialogs\defines.hpp, line 52: .RcsText Memver already Defined
I would like to politely remind my question, just in case someone's got a moment to have a look. Thank you π
_camera setGroupIdGlobal [format ["CCTV %1", name player]];
or I guess:
_camera setGroupIdGlobal ["CCTV %keyword1", name player];
Reading the error usually gives some insight.
You have an RscText class defined in dialogs\defines.hpp. You also have an RscText class defined somewhere else in description.ext or one of the files #included in it. One of these must go, either by deletion or renaming, because you can't have two classes with the same name.
Thanks Mate, apreciate it
I changed the name but now it cant find the base class
Change it back, then go ask for help deconflicting your configs in #arma3_config . You will probably need to show them the contents of the files.
thank you @little raptor , i appreciate it, i'll test it and will let you know, also happy new year! π₯³ (it's already after midnight here)
Well, I got it to show up, but it doesn't use the correct rsc for the menu, if anyone wants to look at the code http://pastebin.com/rqFuAJi1
Just working on an S-Vest script and looking for an explosive somewhere between M_PG_AT and R_60mm_HE
Anyone know off hand of one?
certainly my favorite
for hud stuff, I like the mission event handler "draw3D"
instead of CBA each frame
client - server model is good, but keep UI, sounds, etc local on the client
use hemtt and build with dev
if you are making something modular, the CBA/ACE addon organization is pretty nice. if not, as long as your PBOPREFIX is correct, you can do whatever you want
alright machine gun, slow down lol. just read this:
https://community.bistudio.com/wiki/Arma_3:_Creating_an_Addon
marker positions each frame over network?
The first one worked, therefore i didn't try the second variant. Thank you for your help. I didn't expect this kind of solution because the wiki suggested not to use format in setGroupIdGlobal but i'm glad it works now. Thanks once again π
Just learning how to put modules together and this is part of my config ```sqf
class nzf_svest_explosion : Combo
{
displayName = "Explosion Size";
tooltip = "Size of explosion";
property = "nzf_Module_hvt_svest_explosion";
defaultValue = "M_PG_AT";
class Values
{
class small_boom { name = "Small"; value = "M_PG_AT"; };
class medium_boom { name = "Medium"; value = "IEDUrbanSmall_Remote_Ammo"; };
class large_boom { name = "Large"; value = "R_60mm_HE"; };
};
};
What am I doing wrong?
I use numbers with combo
Everything seemed to work fine, the classnames get passed etc, could that really be what's stopping the default working?
possibly. trying doing string in string for default your way """M_PG_AT"""
but i still like using numbers instead
Yeah I had that initally, no joy.
Maybe I'll rewrite it to use numbers, seems silly if that's the case though
Yeah, just seems silly because then I have to convert from the number to classnames once it's passed to the function.
That does work, guess I'll have to roll with that then, thanks
Seems like my problem is only that I can't get fleximenu to load up any other rsc
can you get the view distance that is saved to user profile? i dont want to use viewDistance command because that may changed by scripts
nice thx π
I haven't messed with this so can't say it does what you need
it is
Good
Hey. Iirc, the inheritance for a combobox isnt complete. You need to set a control value in your combo's config or something. Go to config viewer and check an example of a combobox for a value named "control" or "controlScheme" or something of the sorts. I like checking the menus for 3den modules for examples.
No, bring that emoji back, but make it B I G G E R
Hey there people of scripts, I found a script in this channel which worked great for what I'm trying to do but I had to execute it in the local console thingy for it to work. I would like it to work for everyone always on a map/server
Here is the code:
[missionNamespace, "arsenalClosed", {
missionNamespace setVariable ["Saved_Loadout", getUnitLoadout player];
hint "Selected gear saved!";
}] call BIS_fnc_addScriptedEventHandler;
player addEventHandler ["Respawn",{
[player] spawn {
params ["_player"];
waitUntil {sleep .2; alive _player};
_player setUnitLoadout (missionNamespace getVariable ["Saved_Loadout",[]]);
};
}]```
Looks like you missed part of it
What I miss?
call BIS_fnc_addScriptedEventHandler at the end probably
What does that do?
you're just declaring an array there, this will actually call the function that uses that array
not sure how you had it working in console to be honest
unless you executed something else
I hit the execute locally button
or only the bit inside curly brackets
anyway, adding it into init.sqf probably should be enough
with that bit that I posted
Ok, so it should look like this?
missionNamespace setVariable ["Saved_Loadout", getUnitLoadout player];
hint "Selected gear saved!";
}] call BIS_fnc_addScriptedEventHandler;
player addEventHandler ["Respawn",{
[player] spawn {
params ["_player"];
waitUntil {sleep .2; alive _player};
_player setUnitLoadout (missionNamespace getVariable ["Saved_Loadout",[]]);
};
call BIS_fnc_addScriptedEventHandler
}]```
Oh wait, your indentation confused me, you already have BIS_fnc_addScriptedEventHandler there in the middle
your code is fine
The original one
Ok ok
[missionNamespace, "arsenalClosed", {
missionNamespace setVariable ["Saved_Loadout", getUnitLoadout player];
hint "Selected gear saved!";
}] call BIS_fnc_addScriptedEventHandler;
player addEventHandler ["Respawn",{
[player] spawn {
params ["_player"];
waitUntil {sleep .2; alive _player};
_player setUnitLoadout (missionNamespace getVariable ["Saved_Loadout",[]]);
};
}];
This is how it should've looked
How you make it colored? lol
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
Wrap it all inside a
0 spawn {
waitUntil{player == player};
...code here...
};
```and put in `init.sqf`
Ok, now where do I find init.sqf?
in the root of your mission
if it doesn't exist, create it
otherwise just add the code at the top before everything else
You probably can create some logic entity and put the code into its Init field too
if you're only working with the editor
Ok, I do not have one. I had another sqf when I tried something else before but I am not sure that wone works properly as I just made a txt and made it into .sqf and then also edit it with notepad, is that good?
Should be
Just make sure you have extensions visible so Windows doesn't save it as init.sqf.txt
Yea I do
Gonna test it now
@meager granite It working! Thank you so much for the help this has been bothering me for a year lol I really appreciate it
is there a way to make particles remain relative to player? trying to do accurate jetpack particle effects
think similar to the thermal blur on planes or w/e
WDYM relative to player?
IIRC, usually, when you arrange particle effects, these are client side JIP handlers.
usually the best way to handle it.
probably some combination of remoteExec ...
like how jetpack fire is relative to the person who is jetpacking 
you'd have to figure on the jetpack as a backpack object, bare minimum.
possibly an attached particle source on the player with a sensible relative offset.
along these lines.
but like I said, needs to be client side.
as long as you have the objects, player, backpack, etc, you can attach the particles to the source to your heart's content.
yes
i have done that
the particles do not maintain a velocity relative to the player
maintain velocity? sounds like could be a combination of things, particles, material weight, you can also specify velocity, there are many, many factors.
just have to tinker until it feels right
if you care to maybe share the snippet that is configuring your particles
the entire problem is making the particles inherit the velocity of their emitter
i am fully aware of the parameters of the command
this goes beyond that
share the code
no one can help you if you are not willing to share at least that snippet, how the source is being configured, etc.
my two cents, FWIW... best of luck
snippet doesnt matter
because its not about what the code is doing
its about what needs to be done
right but that is your baseline, and evidently something does need adjustment, but from what?
anyway leaving it with share your code.
Anyone got tried and true script for making fixed wing aircraft fire gun to a spot?
The aircraft is sort of a mission objective so it cannot be cas module. I have tried dowatch and fireAtTarget examples but i dont seem to be getting them to work
Yes but it's insanely complicated :P
well you can script a simple version π
Basic principle is to point the plane in roughly the right direction and then correct the projectiles with a Fired EH
There's some very fancy maths for the gravity adjustment but you could fudge that if you know the range and weapon beforehand.
it's not just gravity but drag too
I recently wrote a message about Arma 3: "Is it possible to make a system that processes node js based http requests in real time in Arma 3? For example, xxx:3031/car will run the car.sqf file when the command is entered?
or will exec the car.sqf " For this, I worked a little on the script that will make the connection to node.js. However, I am missing the command in the car.sqf file or how to read this command and how Arma will get information about this .dll. For this, Can anyone write an example script to guide me?
(I don't have much coding skills).
Could i take a look?
It's in Antistasi's CAS code. Not very readable though because there's a lot of other shit in there.
ah alright
plus it's two-coder frankenstein
ok, then its probably over my head
you should use the Unmanaged Exports package to export these:
//--- Called by Engine on extension load
__declspec (dllexport) void __stdcall RVExtensionVersion(char *output, int outputSize);
//--- STRING callExtension STRING
__declspec (dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function);
//--- STRING callExtension ARRAY
__declspec (dllexport) int __stdcall RVExtensionArgs(char *output, int outputSize, const char *function, const char **argv, int argc);
//--- Extension Callback
__declspec (dllexport) void __stdcall RVExtensionRegisterCallback(int(*callbackProc)(char const *name, char const *function, char const *data));
//--- Engine passed context [steamID, fileSource, missionSourceName, serverName] since Arma 3 v2.11
__declspec (dllexport) void __stdcall RVExtensionContext(const char **argv, int argc);
```(see https://community.bistudio.com/wiki/Extensions for C# version)
what you need here is the extension callback.
when you receive a POST message, call that callback, which will trigger this event handler:
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#ExtensionCallback
```sqf
addMissionEventHandler ["ExtensionCallback", {
params ["_name", "_function", "_data"];
}];
and there you can parse the message and for example exec a script
on the SQF side you just need to do callExtension to start listening on an IPEndPoint (or the HttpListener you've done), and also register the "ExtensionCallback" event handler
maybe i just lock the planes direction when it points at target with setdir and make it sweep the gun
oh, thank you. "addMissionEventHandler ["ExtensionCallback", {
params ["_name", "_function", "_data"];
}];" Could you please elaborate on this part a little more? For example, when I export the file as mission.pbo, how will the car.sqf in the .dll be read? Or can it read it?
the car.sqf in the .dll be read?
it doesn't get read in the dll. the dll just receives the message, and sends it to SQF (via the extension callback)
sorry for my bad eng
How to run the car.sqf file in the mission.pbo file.
I'm really bad at scripting.
here's some pseudo code for example:
this part is from that Extensions wiki page:
public static ExtensionCallback callback;
public delegate int ExtensionCallback([MarshalAs(UnmanagedType.LPStr)] string name, [MarshalAs(UnmanagedType.LPStr)] string function, [MarshalAs(UnmanagedType.LPStr)] string data);
#if WIN64
[DllExport("RVExtensionRegisterCallback", CallingConvention = CallingConvention.Winapi)]
#else
[DllExport("_RVExtensionRegisterCallback@4", CallingConvention = CallingConvention.Winapi)]
#endif
public static void RVExtensionRegisterCallback([MarshalAs(UnmanagedType.FunctionPtr)] ExtensionCallback func)
{
callback = func; // save the callback that Arma gives you, to call it later
}
this part is from your code
if (urlSplit[0].Length > 0)
{
string cmd = urlSplit[0];
string username = parsedPostData["username"] ?? "";
string custom = "";
if (urlSplit.Length == 2)
{
custom = urlSplit[1].Trim();
}
// call the callback (this is just an example and you should validate the data, etc.)
callback("myextension", cmd, custom);
....
and in SQF, you execute this code once to register the event handler:
addMissionEventHandler ["ExtensionCallback", {
params ["_name", "_function", "_data"];
if (_name != "myextension") exitWith {}; // only handle messages from your own extension
switch (_function) do
{
case "execVM": {execVM _data}; // assuming _data was "car.sqf"
};
}];
I'll try it now. I found an example of the system I want to build, but it was made for GTA 5. If you want to check it out: https://github.com/smeysu/GTA5-TikTok-Integration
Aweseome, I got it under the class for the Combo they all have sqf defaultValue = "''"; expression = "_this setVariable ['%s',_value,true];"; and then in the values I had to add a default "key" for want of a better term, so that looks like```sqf
class Values
{
class small_boom {default = 1; name = "Small"; value = "M_PG_AT"; };
class medium_boom {default = 0; name = "Medium"; value = "IEDUrbanSmall_Remote_Ammo"; };
class large_boom {default = 0; name = "Large"; value = "R_60mm_HE"; };
};
Thanks for the push
Thanks for helping. This is my last edit on the script
I figured it out, thanks and sorry!
well what was it then?
no. it's wrong
Hey, Iβm relatively new to sqf, but Iβm posting here because I want to know how I can make johnnyboyβs SOG AI mod run properly on a dedicated server? Iβm running my mission on a dedicated server mainly just to get a decent framerate in my ALiVE mission. From my tests, some of the AI functions of the mod work (ordering troops to get in craters/helis, placing mines, burning huts), but all of the wheel commands do not. I looked at the scripts and found one script that I think is responsible for the wheel commands. My guess is that they are getting sent to the server and not replicated back on my client or something like that? So I guess the question would be is it possible to use remoteExec to make the command wheel function on the server?
call compileScript ["trackerCustom.sqf"];
[Area1, vet_fnc_customizeTrackerLoadout] call vet_fnc_onTrackerSpawn;
[Area2, vet_fnc_customizeTrackerLoadout] call vet_fnc_onTrackerSpawn;
``` the [Area1, vet_fnc_customizeTrackerLoadout] call vet_fnc_onTrackerSpawn; works but the second area doesnt
do I need a comma or something?
Does anyone know if it is possible to use setObjectMaterial on armed remote explosives? I am trying to give one a flashing emmisive selection
What is that function? Maybe you need to spawn it instead?
Probably not, explosives are CfgAmmo and probably don't support most commands
You'll probably need a dummy object just for effect or something
this is the other function
yeah, this function is an infinite loop
your first call to it ends up with thread doing an infinite loop
how do I set up multiple areas?
spawn it instead, so its a separate thread with that infinite loop
oooh
so
call compileScript ["trackerCustom.sqf"];
[Area1, vet_fnc_customizeTrackerLoadout] spawn vet_fnc_onTrackerSpawn;
yeah
call compileScript ["trackerCustom.sqf"];
[Area1, vet_fnc_customizeTrackerLoadout] spawn vet_fnc_onTrackerSpawn;
[Area2, vet_fnc_customizeTrackerLoadout] spawn vet_fnc_onTrackerSpawn;
this better?
im trying to write a script to detect how many buildings are within a trigger area and output the number with a hint once the player enters the area. im very very new at this so it obviously is not working. Here is the script:
{(_this buildingPos [-1] (count [_this]))};
hint str _this;
im refining the code as i realized that was structured poorly, how would yall tackle this though?
What is _this?
a trigger covering the area id like it to consider
ive also tried "this" with no quotes and i get thrown an uninitialized variable error
which is where im at currently, ive moved the code around a bit to :
_buildingsInTown = _this buildingPos [-1];
count [_buildingsInTown];
hint str _buildingsInTown;
but im still getting the uninitialized variable error for line 1
Is this a ChatGPT code or something?
no, this is code straight from the mind of a person whos been trying to learn SQF for 3 days
buildingPos returns certain position or all positions inside a provided building, you don't need it here
You probably want to get trigger size and feed it into https://community.bistudio.com/wiki/nearestTerrainObjects
How do you call your function and where from?
a triggers "on activation: field, right now its sitting right next to where the spawn is for easy testing but eventually these triggers will be copied and pasted all over the towns on the playable map
the triggers sits encompassing a town, with "bluefor" and "present" as activation conditions. the on activation field calls the SQF to count the buildings
you might be on the money with terrainObjects, ill have to list the type but that might actually give me better control over whats considered
What's your activation field code exactly?
execVM "townRecog.sqf";
What are the arguments for execVM?
oh wait you can call it without arguments unlike spawn
Anyway, triggers are ancient thing and they have a local variable thisTrigger (without the _) for the trigger, not _this
You need to pass the trigger that is starting the script as argument
[thisTrigger] execVM "townRecog.sqf"
Then inside the script you can get the trigger entity with:
params ["_trigger"];
You can get your trigger size with https://community.bistudio.com/wiki/triggerArea
Since nearestTerrainObjects only accepts radius and not a more complex shape like a trigger's rectangle or an ellipse, to account for trigger being a rectangle, you'll need to calculate hypotenuse of trigger sides
And then narrow down the results to precisely area of the trigger with inAreaArray
params ["_trigger"];
triggerArea _trigger params ["_a", "_b"];
private _hypo = sqrt(_a*_a + _b*_b);
private _buildings_near = nearestTerrainObjects [getPos _trigger, ["BUILDING", "HOUSE"], _hypo, false];
private _buildings_trigger = _buildings_near inAreaArray _trigger;
buildingPos is useful for filtering because Arma sucks at classifying objects, but yeah, nearestTerrainObjects first.
Then you can do your hint:
hint format ["Buildings in this trigger: %1", count _buildings_trigger];
π€― ok, ive definately got more stuff to google now, thank you guys
Just checked and cargo containers have "HOUSE" type
So you'll probably want more checks if you want real houses in that array
Look up what commands do @ https://community.bistudio.com/wiki/Category:Arma_3:_Scripting_Commands
@meager granite nearestTerrainObjects was the ticket. Itβs all very tidy now thank you very much!
Note that nearestTerrainObjects only picks up objects that are built into the map (mission objects don't count). Hopefully doesn't matter for your use case.
It shouldnβt, this particular instance is meant for areas that the players have not modified extensively. Eventually Iβll build this script out into a system that detects when a player enters an area (right now itβs ~50m blocks) and it will spawn loot off a randomized list as well as control enemy spawning (zombies) on a leveled basis depending on some external variables.
Basically Iβll use this part for Indian country, and Iβll use a different script for player controlled areas that have seen more extensive modification.
You want to cache your found building into a trigger then as these object lookup commands are relatively expensive
Look into setVariable/getVariable
damn where is something wrong? Programmer really needs to be respected
sorry 1 min
Hi all!
I want to combine the method of equipping units as in this mission https://file.io/sm3u7rubycsC with DUWS_X
DUWS_X has factions/config/*.sqf
blufor_SOLDIER_LAT_X = "UK3CB_CW_US_B_LATE_LAT"; //initHQ\fnc_HQguards, supports\fnc_paradrop
blufor_SOLDIER_GL_X = "UK3CB_CW_US_B_LATE_GL"; //initHQ\fnc_HQguards, supports\fnc_paradrop
shared with file.io - super simple file sharing
In a mission, equipment is initialized from mission.sqm : init="call{[this, ""WEST"", ""YKS""] call Serp_unitprocessor;}";
Any ideas on how to implement this?
Is here somebody that could pass me the idd of the mp chat? I'm tired of searching in the config viewer :D
Hello and best wishes to all for the new year. Does anyone know how it is possible to edit these sections? Posting a multiplayer mod, I noticed that the description at the bottom carried the text on the Steam page.
https://imgur.com/jNNpyAl
Hi
Made custom loadouts for my team and an empty ammo crate. I need the ammo crate to contain a set number of only the weapons and items of the player load outs and nothing else
you can right-click on the crate and set specific items?
or do you want the crate's content to be specific per player
No the crate is for everyone
I might forget an item or something doing it manually π
Plus takes a wee bit time
ah well, then you can check 1s after mission start the loadout of everyone and add in this order yes π
hello polpox, I just released a multiplayer persistent campaign. I mean in that section at the bottom appears the text that is on the Steam page of the published mod.
I see it happens for other released mods as well, however I guess there is a way to put a description there
That's in the mission Overview info https://community.bistudio.com/wiki/Arma_3:_Mission_Overview#Description.ext
Thanks ampersand, so I have to use Config.cpp
since there is nothing missing in the Description.ext in this regard
After all we would want to check out how is your config
Oh, sorry. The workshop description (and bbcode) showing in mission select is how it is =s
https://imgur.com/a2R5DGj
this is the specific part, until it was released on Steam it worked well, it showed up with text and pictures intended etc. Then it took on the appearance mentioned
And is this what you see on your mission?
Can you show which is your Workshop item?
Oh so it is a scenario not a Mod
Yeah sorry for calling it mod
I see. Thanks anyway, I appreciate. I think I have seen so far, among the downloaded scenarios, only Anistati not having the same text as Steam in the Mission Summary
so I was wondering if there was a known solution, thanks again
Mmmmmaybe I'm misrecalling smth but, for example, which mission doesn't have this issue?
https://steamcommunity.com/sharedfiles/filedetails/?id=378941393
my friend had downloaded several scenarios and indeed all except Antistasi had this problem, I am trying myself actually to see
they are actually different π€·π»ββοΈ
No it is the same
Maybe some part is cut out for whatever reason, but it is essentially the same issue with you
And they didn't fixed this for a decade smh
how can i get the output from
hint str weaponsItems player;
to be logged as a copyable output in the ingame console?(executed in game/mission of course
Just weaponsItems player in Debug Console
now i feel dumb! Thx @warm hedge
could also replace hint with copyToClipboard
24 i believe
even better thx!
Hey ive got a question my script is not working can anyone help me figure out the issue ?
if (cursorTarget == player) then {
hint "Player was frozen" && ccursorTarget player
disableUserInput true;
} else {
hint "There are no players";
}
}];
Well, ccursorTarget for one thing
But also, it seems unlikely that the player's cursorTarget will ever be...themselves
yeah I don't know what this is trying to do. maybe isPlayer cursorTarget as the condition, but then you'd need to remoteExec the disableUserInput.
Yeah its not working i don't know how to use the function disableUserInput Theres not to much of it on the wiki
(cursorTarget returns the cursor target of the local machine, and player returns the player unit of the local machine, so you're checking whether the player who did the action is targeting themselves)
disableUserInput disables input on the machine where it's executed. As the Syntax section describes, it does not accept a target unit to affect.
Cause i wanna make that freeze the player targeted
That's also not how && works. It's a comparison operator for checking whether two things are both true.
I'd suggest doing something a bit more like this:
player addAction [
"Freeze targeted player",
{
params ["_target"];
[true] remoteExec ["disableUserInput",_target];
hint format ["%1 was frozen",name _target];
},
nil,
0,
true,
true,
"",
"(isPlayer cursorObject) && {(_this distance cursorObject) < 500}",
0,
false
];
- only shows the action if the cursor is over a player within 500 metres
- remoteExecs the
disableUserInputto the targeted player's machine - displays a hint showing who you froze
I recommend looking up all the commands used, and carefully reading their documentation to get an idea of how and why this works.
Im gona check the docs and thanks for your time π
That error isn't from the code I posted. You have some other code running somewhere and that code is wrong.
It kind of looks like you're testing in singleplayer.
In singleplayer, nothing you put your cursor over will ever be a player, because there are no other players, so the action won't be shown.
even if not looking at player i wan't the addaction be displayed cause im doing admin menu and like when you activate it all those action would spawn and be removed when disabled
Still not working in multiplayer
That can be done, I guess.......but why bother showing the action when not looking at a player, if that means nothing will happen when you use it?
BTW, the action showing/not showing because of its condition, is completely separate from the action existing. You can have an action that only shows itself when looking at a player and is added/removed by an admin menu. Both of those things are possible at the same time.
And was the person you tried it on actually a player?
nope i don't have another person to test on
Well funnily enough, an action that checks whether you're looking at a player doesn't work if you're not looking at a player. So not really a surprise (or a bug) that it's not working, is it?
kinda
Allright, I managed to get the files sorted ( I got a bit much on my plate right now som I'm not the sharpest tool in the shed lol)
However, the spawned vehivles do not get the addaction. Is it as simple as swithching the order of code around, or is it more sinister?
Again, haven't touch a line of code in 10 or so years. Consider me a noob.
Can someone help. Trying to find if unit have weapon with GL and if there is some explosive shells in the box then give it to unit.....
params ["_unit", "_container"];
_gun_cfg = configFile >> "CfgWeapons" >> _x;
_muzzles = getArray (_gun_cfg >> "muzzles") - ["this", "safe"];
if (count muzzles == 0) exitWith {};
_underbarrel_cls = _muzzles select 0;
_gls = _muzzles select { getText (_gun_cfg >> _x >> "cursorAim") == "gl" };
if (_gls isEqualTo []) exitWith {};
{
_compat_mags = compatibleMagazines _gls;
_HE_compat_mags = {getNumber (configfile >> "CfgAmmo" >> _x >> "indirectHit") > 0};
_GLinbox = (weaponCargo _container) arrayIntersect (_HE_compat_mags );
} forEach _gls;
_GL = if ((count _GLinbox) > 0) then { selectrandom _GLinbox } else { "" };
Of course, something goes wrong
I would add in every if then {} some debug (systemChat , hint , diag_log) to get the result is your conditions true or not.
Q: about 'releasing' a captive _unit (true) back into the wild, as it were.
I've done that, and subsequently recruited the unit into my group, but he is unresponsive to unit commands.
is there anything else about the unit that I must clear, _unit setCaptive false, for instance, that would free him up to follow commands?
thanks...
setCaptive doesn't alter their ability to respond to commands.
Normally you need several additional commands to make a unit act like a surrendered unit, if that's what you're talking about.
setCaptive just sets their side.
I am talking about the recruiting unit uptake side of the equation. the unit just sits there unresponsive.
I don't know what "recruiting" means in context.
in ARMA terms, simply joining the unit to my group
Are they the same side as you and the group?
they are civilian, but IIRC this has never been a problem before, would respond to commands in other mission scenarios...
but I can try a same side unit as well
nope that's not working either, but the same blufor unit was also passing through the captive state, so in effect was also civilian.
hmm okay so I have created some units, civilian, blufor, apart from everything, they are responsive...
not sure what I did to cause the other units to be unresponsive however.
could be something, they have a blue slash in their unit signal. as does mine.
I suspect, if I can understand what that is, and undo it, then it will probably be fine
never seens this before sorry
no worries if anyone has can some light be shed on what that is please thanks...
thinking unit behavior maybe, or combat mode?
what effect does setting the animation have on unit commands? playing a move? switching move? and how to clear that aspect?
Hello, does anyone have an easy script that allows me to spawn random loot in crates? I'm working on a custom mission in Eden and it in part relies on a looting aspect, I don't want to manually place loot down. Any help is appreciated
worst case scenario maybe I could just create a new unit and swap it out for the old one... server side. kind kludgy, but if that would work.
I just want to understand possibly what I might have done.
Will attachTo help keeping a logo on vehicle?
well, it's kludgy, but it works, to 'serialize' the key bits of the unit, delete the old object, then '(re-)create' him afresh, grouped to the player.
Better to just have a custom skin unless you need it for a multitude of vehicles
But if you really wanted to you could attachTo a 1x1 picture object and setObjText
btw. if somebody wants to know how OOS looks like
https://github.com/X39/XInsurgency/tree/OOS_Insurgency/InsurgencyModule/src
started a "little" rewrite of my insurgency mission (planned that for ages now and finally found the perfect time for it :))
I am trying to customize vehicle speeds for my community. I see that maxspeed governs what the vehicle tops out at, but what governs offroad vs onroad speeds, acceleration, etc.?
That's all config stuff. And it's complicated to say the least for engine configs.
Head over to #arma3_config
Thanks. I'll post it over there. π
im trying to create triggers using the createTrigger command but i suspect im doing it wrong, as all the next step that relies on the trigger does not execute. the code im using is this:
{
_lootTrigger = createTrigger [(str (random 9000)), getPos _x];
"Sign_Arrow_F" createVehicle getPos _x;
_triggerStatement = setTriggerStatements [_x, execVM "itemList.sqf", hint "trigger off"];
}forEach _buildings;
am i using the wrong name for it?
also _buildings is a valid array containing building locations. I was able to test this by placing markers on all the _buildings locations.
_unit switchMove ""
The blue hashmarks are just combat behaviour STEALTH, IIRC
It's on the 7 menu for commanding.
tried that... also, yes, realizing the stealth behavior. neither worked.
wish I knew exactly what that was, other than the things covered here. nothing that I can think of.
Look into command syntaxes
also was the problem, youre at least half the answer to most of my scripting problems lol
@meager granite i have a set of arrays within an array. i pull random arrays out of the set using select, and i have observed each array being pulled at least once successfully. Neither the array nor the set changes, but after every 15 or so (not a precise or consitent number) calls select fails to select an array at all, what might cause that failure?
you're not using selectRandom?
i am but further down the chain, ill post it
_randomSetNF = _itemSets select {_num=round(random[1,2,5]);
(_x select 3)isEqualTo _num;};
_randomSet = selectRandom _randomSetNF;
those are the next two line
s
_itemSets is the large array that contains the sets
any tips on how to get a unit to move and path on its own ?
I never done scripting but I am trying to get my unit with a rifle to move and fight the players but when they see my player it looks and shoots but does not chase
Have you made sure there is indeed a corresponding set in _itemSets for each possible number? Like if you roll a 3 and there aren't any sets whose 4th element is 3, you'll get nothing
yup, everything in the array is weighted 1-5 hence the additional layer of select, and each number has at least one array associated with it
ill post the array set if you need
well, how large is it?
13 arrays in the set
["arifle_AKS_F", 3, "30Rnd_545x39_Mag_Tracer_F",2],
["rhs_weap_akmn", 3, "rhs_30Rnd_762x39mm_bakelite",3],
["arifle_Mk20_plain_f", 3, "30Rnd_556x45_Stanag",3],
["rhs_weap_g36c", 3, "rhssaf_30rnd_556x45_Tracers_G36",3],
["rhs_weap_hk416d145", 3, "rhs_mag_30Rnd_556x45_Mk318_Stanag",3],
["rhs_weap_m14", 3, "rhsusf_20Rnd_762x51_m62_Mag", 4],
["rhs_weap_m249_light_S", 3, "rhsusf_100Rnd_556x45_mixed_soft_pouch",5],
["rhs_weap_M590_8RD", 5, "rhsusf_5rnd_00Buck",2],
["SMG_05_F", 3, "30Rnd_9x21_Mag_SMG_02_Tracer_Red",2],
["rhsusf_weap_glock17g4", 3, "rhsusf_mag_17Rnd_9x19_JHP",1],
["hgun_Pistol_heavy_01_F", 3, "11Rnd_45ACP_Mag",1],
["hgun_Pistol_01_F", 4, "10Rnd_9x21_Mag",1],
["launch_RPG7_F", 2, "RPG7_F",5]
I don't understand how that correspends with your code.
thats initialized as _itemSets,
oh wait, I see.
_randomSetNF selects a weight which gives me a smaller list of pssible arrays
_random set pulls from that to give me a randomized item
and then spawns a box and spits that array into a box for a player to pick up
Just out of curiosity, if you want weighting, why not selectRandomWeighted?
the correct answer is ill google that, but the real answer is because ive been doing this for 4 or 5 days now and didnt know it existed
ill reevaluate how it could fit in though
And _itemSets is invariant? you're not deleting elements from it?
its not accessed by anything other than _randomSetNF
which in turn is only accessed by _randomSet
the array its self is static
oh I see. This is very weird code ;P
haha it could prob be better but its written in a way where i mostly understand it
It's not guaranteed that _randomSetNF has anything in it.
yea, i added a small patch to fix that, but i dont understand why it wouldnt have something in it if were rounding its selection
I'm not sure you realise what select does.
The code inside the select is run once for each element in the array.
If it returns true, that element is included in the output array.
youre right, im not seeing the disconnect
I think what you're trying to do is just this:
_num = round random [1,2,5];
_randomSetNF = _itemSets select { (_x select 3) == _num };
With your version it can just miss on every element if the RNG falls right.
Or alternatively, hit on every element.
(very unlikely)
how can it come up empty when its given a choice of 5 possible numbers and told to pick between them then round the number?
which i think it the heart of my question, i dont understand how that works
It's checking that value against the current element each time.
alright, im gonna pray on this and do some more googling, thank you for your help!
It's re-rolling the value for each element in the array, so which number would result in a hit is different for each element it checks. First element needs a 1 to hit. Second element needs a 3 to hit. ... And because random, they could all be misses.
What you need is to roll once and use the same value for checking every element.
Run this several times in the debug console. It can generate any of four results: [0, 1], [0], [1], []
_test = [0, 1];
_test select { _num = round random 1; _x == _num };