#arma3_scripting

1 messages Β· Page 137 of 1

lethal heath
#

ok that makes sense

#

i will clean it up

#

thank you for taking the time to write me

proven charm
#

np

wet lion
#

What condition needed in a trigger Condition field if i want to trigger a vehicle's hull damage percent above 10%?

proven charm
wet lion
#

I have a tanker truck filled with poison πŸ™‚
The fuel tank is a part of the hull.
But if you have an idea for overall damage triggering, my ears is open too!

proven charm
#

well you can just get the overall damage: ```sqf
damage _vehicle >= 0.1

#

or specific part damage ```sqf
_vehicle getHitPointDamage "hithull" >= 0.1

wet lion
#

Many thanks @proven charm!

polar belfry
#

is there a way to spawn a flare that the flash is very big

#

Like make a flare where the flash is huge. I want it for particle effects to attach to a missile

granite sky
#

Yeah, it's an Arma issue where non-physX objects acquire velocity when you attach them and move the parent around, and then don't zero it when placed.

#

If you run into the other common issue where carried physX objects are extremely dangerous, the workaround is to setMass the object to near zero. But you have to remoteExecCall the setMass because setMass is super-slow propagation.

faint trout
hallow mortar
#

Is there a ballpark number for how much execution time is acceptable for eachframe unscheduled code? I'm looking at converting a scheduled loop to eachframe unscheduled; at the moment each iteration is about 0.06ms

granite sky
#

Not really. Just consider that a 60Hz frame is about 16ms and consider how much of that you want to use.

#

Note that an eachframe likely has additional overhead on top of the SQF, so spamming tiny eachframes that check a counter is probably not a good idea.

meager granite
fair drum
meager granite
hallow mortar
meager granite
#

Curious what it does

meager granite
fair drum
#

Yeah let me find it. I also had performance questions when I first started moving things to 100% unscheduled. The team told me to stop worrying about it cause whatever I'm doing is probably not gonna kill it.

granite sky
#

advanced_ballistics\functions\fnc_handlefirePFH.sqf

hallow mortar
#

I've played missions of similar size both with ACE and without, and to be perfectly honest I'm not going to take performance advice from ACE

granite sky
#

That is a single eachframe for all the bullets though.

fair drum
meager granite
granite sky
#

It's just doing some maths and returning :D

#

Wind deflection doesn't apply to AI bullets. Not sure about advanced ballistics.

proven charm
#

its possible to cause lag spikes with unscheduled. that's the main problem with it

#

or plain crawl πŸ˜‰

fair drum
#

Then the maker is doing something very wrong imo.

proven charm
#

yea CPU can handle only so much code

hollow thistle
#

and not on every frame

#

only for projectiles of player and as frequently as you've set in your CBA settings for simulation interval.

meager mist
#

I'm tackling a script to save a loadout, then that loadout will be loaded on respawn. It works, almost :p I keep getting a script error upon respawn and I cannot seem to figure it out. It loads me with the saved loadout but still want to get rid of that error.
This is the script

// in onPlayerRespawn.sqf 
if(_this select 1 != objNull) then {
    if(!isNil "VirtualInventory") then {
        hintSilent "Your loadout has been loaded from your save!";
        _this select 0 setUnitLoadout [VirtualInventory, true];
    };
};```

```sqf
// in ammobox INIT 
saveAmmobox addAction ["Save Loadout", {VirtualInventory = getUnitLoadout player}, 10]; 

See attached the error

hallow mortar
#

You can use isNull to check if something is null rather than comparing it directly to objNull

#

The only possibility I can see is if something else is setting VirtualInventory to a string, outside of these two bits of code

#

btw, why are you passing 10 as an argument to the addAction code and then not doing anything with it?

#

I'd recommend using a more unique name for VirtualInventory, it's pretty generic and something could be overwriting it

meager mist
meager mist
#

Funny enough, the error does not replicate on dedicated server..

hallow mortar
meager mist
#

Ill yeet it out. It’s not needed in this case

fair drum
#

I personally like using the unit's namespace for this kind of thing

meager mist
#

I found this post on reddit, seemed like a good working script.. but it never seemed to work for me :/ And I'm unsure why https://www.reddit.com/r/armadev/comments/60lw5w/comment/dfc8d5n/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

//onPlayerRespawn.sqf
[player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory;```

```sqf
//initPlayerLocal.sqf
sleep 1;    //Time to wait for player to initialize in the mission
//Save loadout when ever we exit an arsenal
[ missionNamespace, "arsenalClosed", {
    systemChat "Arsenal closed";    //Not actually needed, can say anything you want
    waitUntil {time > 0.2};    //Time to wait to make sure Arsenal items are applied
    [player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory;
}] call BIS_fnc_addScriptedEventHandler;```
Reddit

Explore this conversation and more from the armadev community

#

That one always mentioned that variable inventory_var was not found

molten yacht
#

Is it possible to replace the skybox using cfgWorlds in the mission file, or does this require an addon?

molten yacht
#

Assuming you had another skybox ready to go - say, overwriting Takistan's sky with Livonia's or something like that

hallow mortar
meager mist
#

I assumed that this only applies to the BI Virtual Arsenal? And not ACE arsenal?

fair drum
#

that is vanilla

meager mist
#

That's the only reason why I could not figure it out.

fair drum
#

are you wanting something that saves ace arsenal?

meager mist
meager mist
fair drum
#

I can write something. Kinda on a writers block on my own stuff atm so I got time.

meager mist
#

Would be appreciated! I'd like to learn it more indepth as well, but seeing working scripts helps me understand the functions often.

fair drum
# meager mist Would be appreciated! I'd like to learn it more indepth as well, but seeing work...
// init.sqf
if (hasInterface) then {
    ["ace_arsenal_displayClosed", {
        player setVariable ["BEAR_ACESavedLoadout", getUnitLoadout player];
        hint "Respawn Loadout\nSaved";
    }] call CBA_fnc_addEventHandler;
};
// onPlayerRespawn.sqf
params ["_newUnit", "_oldUnit", "_respawn", "_respawnDelay"];

private _loadout = _oldUnit getVariable "BEAR_ACESavedLoadout";
if !(isNil "_loadout") then {
    _newUnit setUnitLoadout _loadout;
};

now you just add the arsenal to anything and when the arsenal display closes, it saves the player's loadout. No actions needed.

meager mist
pulsar pewter
#

Yeah, the if (hasInterface) command means that the script only runs on player machines, so it should work on local or dedi servers

merry carbon
#

Hi, im looking for some help with holdactionadd. How do i make my action persist after being completed once?

#

For more detail: I'm trying to implement self-revive. I've added the following holdaction into onPlayerRespawn.sqf to attach it to players when they respawn. the problem is that it only works on the first time they're incapacitated

// Inject self-res action?
[
player,
"Self-Revive",
"",
"",
"player getVariable['incapacitated', false]",
"true",
{},
{},
{ player setDamage 0;
player setVariable['incapacitated', false, true]; },
{},
[],
4,
nil,
false,
true
] remoteExec ["BIS_fnc_holdActionAdd", 0, player];

granite sky
#

Are you sure you don't have something else removing actions from the player on revive?

merry carbon
#

maybe, there are a bunch of events in base Arma and the mods i run that trigger on players incap status. its possible that some other garbage is wiping out my data, which is big sadge

#

the best way i can think of is to reinject the action when a player is revived, but i can't seem to find an event tied to it. theres only "KILLED" and "RESPAWN"

merry carbon
#

SOLVED: I put the script into the core function that handles unconsciousness

#

fn_unconscious.sqf

granite sky
#

Is this Antistasi :P

merry carbon
#

yeep

#

antistasi legacy, hence why im maintaining it myself

#

the new A3A mod cant be hacked as easily as the old one 😦

meager mist
# fair drum ```sqf // init.sqf if (hasInterface) then { ["ace_arsenal_displayClosed", { ...

This works great!! I've added a hint to the Respawn code to notify people that their loadout is restored. Thanks!
I do got 2 questions though.. just to make me understand.

  1. in the onPlayerRespawn.sqf you have put the params in, the first 2, _newUnit and _oldUnit I understand why they are there. But what are the last 2 good for? I don't see them referenced anywhere else but they are vanilla params?
  2. How do you get the ace_arsenal_displayClosed function?
proper sigil
#

Hey,

I'm having 2 functions. One is only available to the server and handles reading data from inidb2. Other one is global and calls this function in order to retrieve data read by the server function. Is this a proper way of:

  1. Defining function in init.sqf

    call compile preprocessFileLineNumbers "Donut\Supplies\DNT_fncServer.sqf"; //In my understanding compiled functions are only available to the server
    
};

call compile preprocessFileLineNumbers "Donut\Supplies\DNT_fncCommon.sqf"; //Functions should be available globally```

2. Calling it between server and global function? I want for server function to retrieve data from db and then I want a global function to use those data

```DNT_updateSupplyTrackerTasks = { //Global function

    private _suppliesStatus = remoteExec ["DNT_readFromDb", 2, false]; //Calls server function and retrieves array returned by it

rest of function...
ebon citrus
#

is there a way for setting the image of a control by using an image from the mission folder? What would be the path structure? Example:
_control ctrlSetStructuredText parseText "<img image=\images\img1.paa />"

#

all the examples are from gamefiles

#
<img image='\a3\Data_f\Flags\flag_Altis_co.paa'/>
<img image='\a3\Data_f\Flags\flag_Altis_co.paa' />
<img image='\a3\Data_f\Flags\flag_Altis_co.paa'></img>```
meager granite
#

<img image='mydir\mypicture.paa'/>

#

will be mydir inside your mission directory

ebon citrus
#

i just got "image mydir not found"

#

that is, replacing mydir with my image folder ofcourse

#

could be something with parsetext

#

i moved to using rscpicture

meager granite
#

hintSilent composeText [image "mydir\mypicture.paa" setAttributres ["size", "5"], " "];

#

to hint test a path

proven charm
proper sigil
# proven charm ```private _suppliesStatus = remoteExec``` remoteExec doesnt actually return a...

I'm a little confused then. If only server has inidb2 installed and only server can read data from db how do I make it accessible to different functions then? I tried calling DNT_readFromDb this way


hint _str(_state );

on client but instead of db contents it returns an array like ["any", "any", "any"] (it should be numerical values for different supplies). So it looks like data retrieved by server are not available to other global functions

proven charm
#

if you want server to read inidb2 you can send the data to client if thats what you want sqf // Server serverReadDB = { // Read inidb2 // Send data to client _inidbData remoteExec ["inidbRead", clientIDHere]; }; // client inidbRead = { params ["_inidbData"]; }; something like that

proper sigil
proven charm
proper sigil
#

Okay, I'm going to try this way, thanks

buoyant hound
#

hey, need to reveal enemy units and mark theyr poses on the map.

#

using the nearestobject

#

or anymore syntax

proper sigil
# proven charm if you want server to read inidb2 you can send the data to client if thats what ...

Sorry, I'm still having problem understanding that. Let's say I have a globalFunction that want's to get data from db for a client. How would I go about calling it? Workflow I want to achieve is:

  
  _dbData = call inidbRead; 

  ...

};

But the thing is inidbRead only receives data when serverReadDB is fired. But then if I run serverReadDB why would I pass it to inidbRead instead passing it directly to the variable?

#

Like someGlobalFnc should both initiate server function and then get data from client function so how to achieve that as I'm a bit lost on that πŸ˜†

proven charm
proper sigil
#

someGlobalFnc would have to execute serverReadDB and then serverReadDB also instantly distributes data to clients via inidbRead function but I'm not sure how to access data from inidbRead if that makes sense?

proven charm
#

my bad actually inidbRead was not good name, I meant it as inidbReceive , where the server sends the data

proper sigil
#

Okay so let there be 3 functions

  1. updateValuesFunction - global, requests data from db using serverReadDB and then updates some globally available values by reading inidbReceive
  2. serverReadDB - serverside, when called reads data from db and then passes it to client scope by calling inidbReceive
  3. inidbReceive - global - stores data passed by serverReadDB

Now what I want to achieve is:


updateValuesFunction = {

  remoteExec ["serverReadDB ", 2, false]; //Requests data

  _data = call inidbReceive ; //Stores data in variable

};

It seems wrong to me though as inidbReceive by itself does nothing so it shouldn't be called separately from serverReadDB but then serverReadDB does not return anythign by itself so I can't assign it to the variable?

proven charm
#

so client calls updateValuesFunction which starts the whole thing?

proper sigil
#

Exactly

proven charm
#

ok so maybe you mean this: ```sqf

// Server only functions here
if(isServer) then
{

serverReadDB =
{
// Read ini db here to _data variable
_data remoteExec ["clientReceiveDB", -2, true]; // send db to clients
};

};

// Client only functions here
if(hasInterface) then
{

updateValuesFunction = {

remoteExec ["serverReadDB ", 2, false]; //Request data

};

clientReceiveDB =
{
params ["_data"];
// Do something with the DB data
};

};

proper sigil
proven charm
#

yes

proper sigil
#

Okay, looks legit, will give it a shot, thanks for the help ;)

proven charm
#

though i dont understand why one client calls updateValuesFunction and all clients receive the data. sounds like you could just directly call serverReadDB on the server

proper sigil
#

What I'm trying to actually to do is to have a fnc that just returns data from db for different purposes but I struggle with getting data by other functions that require it

#

Like server fnc actually is



    private _inidbi = ["new","Quartermasters_logbook"] call OO_INIDBI;
    private _suppliesStatus = [];
    
    private _ammoCount = ["read", ["Supply count", "Ammo",9999]] call _inidbi; 
    private _medicalCount = ["read", ["Supply count", "Meds",9999]] call _inidbi; 
    private _scrapCount = ["read", ["Supply count", "Scrap",9999]] call _inidbi; 
    private _vehicleGarage = ["read", ["Supply count", "Vehicles",[]]] call _inidbi;
    
    private _vehicleSummary = _vehicleGarage call BIS_fnc_consolidateArray;
    private _vehicleMissionTxt = "";
                                    
    {                    
        _vehicleMissionTxt = _vehicleMissionTxt + "- " + (_x select 0) + ": " + str(_x select 1) + endl;
    
    }forEach _vehicleSummary;
    
    _suppliesStatus = [_ammoCount, _medicalCount, _scrapCount, _vehicleGarage, _vehicleMissionTxt];
    
    _suppliesStatus;

};```
#

And it worked locally

#

    private _suppliesStatus = call DNT_readFromDb;

    private _ammoCount = _suppliesStatus select 0;
    private _medicalCount = _suppliesStatus select 1;
    private _scrapCount = _suppliesStatus select 2;
    private _vehicleMissionTxt = _suppliesStatus select 4;
    
    if((["Supplies"] call ENGTASKS_GetTaskState)== "") then {

        ["Supplies", ["Claimed supplies", (format["Current list of supplies brought to Haunter - ammunition: %1, medical: %2, scrap %3",
        _ammoCount,_medicalCount, _scrapCount])], "CREATED"] call ENGTASKS_CreateTask;
    } else {
    
        ["Supplies", ["Claimed supplies", (format["Current list of supplies brought to Haunter - ammunition: %1, medical: %2, scrap %3",
        _ammoCount,_medicalCount, _scrapCount])], false] call ENGTASKS_SetTaskDescription;
    
    };

    if((["VehiclesList"] call ENGTASKS_GetTaskState)== "") then {
    
        ["VehiclesList", ["Available vehicles", (format["Current list of available vehicle types: %1 %2",
        endl,_vehicleMissionTxt])], "CREATED"] call ENGTASKS_CreateTask;
    } else {
    
        ["VehiclesList", ["Available vehicles", (format["Current list of available vehicle types: %1 %2",
        endl,_vehicleMissionTxt])], false] call ENGTASKS_SetTaskDescription;    
    
    };
};```
#

But I just couldn't seem to pass data from db to DNT_updateSupplyTrackerTasks

proven charm
#

ok

#

put some loggin in there to see whats happening (where does it reach)

proper sigil
#

You mean RPT or something else?

proven charm
#

diag_log is probably the best if you end up testing it in dedi

proper sigil
#

Ah okay so I should just call it within let's say all relevant fncs and we'll get an idea which were called, right?

proven charm
#

i mean use loggin to see which line gets processed

proper sigil
#

DNT_initSupplies runs at mission start and should call subsequent fncs

#

So it looks like the data from DNT_readFromDb is not passed correctly to DNT_updateSupplyTrackerTasks

proven charm
#

it could be DNT_readFromDb fails to read the DB. so id log that data to see if DB is properly read

proper sigil
#

Okay, I'll log the values then

#

Welp to me seems like DNT_readFromDB reads values properly from db. DNT_updateSupplyTrackerTasks seems to be unable to reach them though

#

@proven charm

#

Oh wait, If I added diag_log at the end of function it wont return variable or is it alright?

DNT_readFromDb = {

    diag_log "start of DNT_readFromDb";

    private _inidbi = ["new","Quartermasters_logbook"] call OO_INIDBI;
    private _suppliesStatus = [];
    
    private _ammoCount = ["read", ["Supply count", "Ammo",9999]] call _inidbi; 
    private _medicalCount = ["read", ["Supply count", "Meds",9999]] call _inidbi; 
    private _scrapCount = ["read", ["Supply count", "Scrap",9999]] call _inidbi; 
    private _vehicleGarage = ["read", ["Supply count", "Vehicles",[]]] call _inidbi;
    
    private _vehicleSummary = _vehicleGarage call BIS_fnc_consolidateArray;
    private _vehicleMissionTxt = "";
                                    
    {                    
        _vehicleMissionTxt = _vehicleMissionTxt + "- " + (_x select 0) + ": " + str(_x select 1) + endl;
    
    }forEach _vehicleSummary;
    
    _suppliesStatus = [_ammoCount, _medicalCount, _scrapCount, _vehicleGarage, _vehicleMissionTxt];
    
    diag_log "DNT_readFromDb output:";
    diag_log format ["_ammoCount = %1", _ammoCount];
    diag_log format ["_medicalCount = %1", _medicalCount];
    diag_log format ["_scrapCount = %1", _scrapCount];
    diag_log format ["_vehicleMissionTxt = %1", _vehicleMissionTxt];
    
    _suppliesStatus; //Value to return
    
    diag_log "EOF DNT_readFromDb"; //Is it okay to leave it there and fnc will still return _suppliesStatus?

};
ivory marsh
#

Hey guys is it possible to script roads in a modded map ? Because the roads are here but some of them aren't considered as roads.

proper sigil
#

welp my bad

proven charm
# proper sigil <@499851213638991873>

you must not put the diag_log as last line in function because it will mess up the return. I mean put diag_log format ["READ: %1",_suppliesStatus];

#

to see if DB read ok

proper sigil
#

Yep fixed that and also logged values passed to DNT_updateSupplyTrackerTasks and it seems values are correctly put inside of it

proper sigil
#

Nope, that's what confuses me πŸ˜†

tender fossil
#

I'm not an expert when it comes to iniDBI stuff, but I noticed that you're trying to create new instance of the same DB repeatedly (I think). Maybe it causes it to fail? ```sqf
private _inidbi = ["new","Quartermasters_logbook"] call OO_INIDBI;

proper sigil
#

Yeah but if it would fail the values wouldn't be read properly from db and yet they are. What is happening here is:

  1. DNT_initSupplies is called from Init.sqf and it calls some other functions, one of them being DNT_updateSupplyTrackerTasks
  2. DNT_updateSupplyTrackerTasks calls DNT_readFromDb to receive data for update
  3. DNT_readFromDb reads data properly as I was able to log the values
  4. DNT_updateSupplyTrackerTasks receives the data as I was able to log them in it's scope as well

So SOMETHING happens at this piece I think

#
    
    diag_log "        start of DNT_updateSupplyTrackerTasks";
    private _suppliesStatus = call DNT_readFromDb;
    diag_log "        DNT_readFromDb is called by DNT_updateSupplyTrackerTasks";
    
    
    private _ammoCount = _suppliesStatus select 0;
    private _medicalCount = _suppliesStatus select 1;
    private _scrapCount = _suppliesStatus select 2;
    private _vehicleMissionTxt = _suppliesStatus select 4;
    
    diag_log "DNT_updateSupplyTrackerTasks _suppliesStatus output:";
    diag_log format ["_ammoCount = %1", _suppliesStatus];
    diag_log format ["_ammoCount = %1", _ammoCount];
    diag_log format ["_medicalCount = %1", _medicalCount];
    diag_log format ["_scrapCount = %1", _scrapCount];
    diag_log format ["_vehicleMissionTxt = %1", _vehicleMissionTxt]; //Works until this part```
#

        ["Supplies", ["Claimed supplies", (format["Current list of supplies brought to Haunter - ammunition: %1, medical: %2, scrap %3",
        _ammoCount,_medicalCount, _scrapCount])], "CREATED"] call ENGTASKS_CreateTask;
        
        diag_log "            task == empty, create new task"; 
        
    } else {
    
        ["Supplies", ["Claimed supplies", (format["Current list of supplies brought to Haunter - ammunition: %1, medical: %2, scrap %3",
        _ammoCount,_medicalCount, _scrapCount])], false] call ENGTASKS_SetTaskDescription;
        
        diag_log "            task == exists, update task";
    
    };

    if((["VehiclesList"] call ENGTASKS_GetTaskState)== "") then {
    
        ["VehiclesList", ["Available vehicles", (format["Current list of available vehicle types: %1 %2",
        endl,_vehicleMissionTxt])], "CREATED"] call ENGTASKS_CreateTask;
    } else {
    
        ["VehiclesList", ["Available vehicles", (format["Current list of available vehicle types: %1 %2",
        endl,_vehicleMissionTxt])], false] call ENGTASKS_SetTaskDescription;    
    
    };
    
};```
proven charm
#

more debug πŸ™‚

proper sigil
#

Arma is an unforgiving mistress πŸ˜”

tender fossil
proper sigil
#

Yeah something I didn't consider apparently it does reach this piece. I left the server, rejoined and values updated

#

But then I ran from debug console

remoteExec ["DNT_updateSupplyTrackerTasks",0,true]; and values are of "any" type again.

proven charm
#

if you ran that from debug console that means you ran it on client? there should be run at server option

proper sigil
#

I run it globally

proven charm
#

ok

#

i guess that means both server & client?

proper sigil
#

Yeah

proven charm
#

well it fails on client...

#

if you are running dedi check the server log

proper sigil
#

wait I got something

#

Running it like this results in properly updated supplies

#

Like this

#

Returns any

proven charm
#

how about call DNT_updateSupplyTrackerTasks on "Server"

proper sigil
#

Same as global, so it seems the server does not have DB data?

proven charm
#

it worked?

proper sigil
#

When run on server it didn't

proven charm
#

hmm not sure then

proper sigil
proven charm
#

0 means its ran everywhere

proper sigil
#

Yes but below you have scopes at which it is run, in this case I ran command on server

tender fossil
#

It doesn't matter, as the 0 makes it run everywhere

proven charm
#

yep and global runs everywhere also

#

so you can make it run everywhere twice (with global)

proper sigil
#

Yeah but in some order I guess? I noticed that in tasks the values are for like a 0,0001 second updated with correct values and THEN they are getting "any"

#

Like client overwrites correctly but then server overwrites with no data

tender fossil
#

Try to run exactly this on "Server" (no remote exec): ```sqf
call DNT_updateSupplyTrackerTasks;

proper sigil
#

Huh, yep that one worked

#

So I guess I should only run this on the server?

tender fossil
#

Definitely, only server should have access to DB and game logic anyways

proper sigil
#

Okay, big thanks lads, I've been struggling to wrap my head around locality for months now and I still fail spectaculary xD

tender fossil
#

Welcome to the club πŸ˜„

proper sigil
#

I'll try to restrict execution to server, hopefully that's it

bleak gulch
#
 } else {

grrr.

What do you mean when you call the function a "global"?

#

A global variable in the namespace or defined on the all machines in the network?

proven charm
#

it can mean two things. "Global" exec button. or 0 as remoteExec target πŸ˜‰

bleak gulch
#
_suppliesStatus; //Value to return

don't use semicolon for the returning value

#

and defining function(s) in the init.sqf is probably not good idea in general

#

because everything must be ready and compiled before your clients start to interact with the server

#

unless you're trying to load functions dynamically from the server on purpose

#

Also, do not expose functions you don't want to call over the network

#

Ideally only interface and unified functions must be exposed

#

everything else should not be whitelisted

#

Client and server can have same function identifier (a var name) but completely different functionality or even types.

#

So when you call something "global", it's basically not global, but the variable with the same name on the different machines. In general "global" is applied to the variable defined on the same maching outside the local scope

proper sigil
bleak gulch
#

something like this:

x = 1; // global variable
fnc_foo = {}; // global function
publicVariable "fnc_foo"; // propagate function over the network
bleak gulch
# proper sigil what's wrong about semicolon?
fnc_foo =
{
    private _result = 2 + 3;
    _result
};

private _x = call fnc_foo;
// is complete equivalent of
private _x = 5;

// whe you use semicolon, the equivalent changes to this
private _x = 5;;
#

it adds empty expression

#

in most cases it won't break things but in some it will (e.g. macro)

proper sigil
#

I see

knotty gyro
#

Why isn't the sub sinking, but flying up into the air???

private _d = 0;
while { _d != -20 } do { 
sub1 setposASL [(getpos sub1 select 0),(getpos sub1 select 1),(getpos sub1 select 2)+_d];
_d = _d - 0.05;
sleep 0.1};
hallow mortar
#

You're mixing two different position formats, positionAGLS from getPos and positionASL from setPosASL. AGLS is relative to the terrain; ASL is relative to a fixed sea level.
Use getPosASL instead to keep the formats consistent (it's also faster)

#

You can also use vectorAdd to simplify the maths.

#
for "_i" from 1 to (20 / 0.05) do {
  sub1 setPosASL (getPosASL sub1 vectorAdd [0,0,-0.05]);
  sleep 0.1;
};```
knotty gyro
#

Beautiful. Thanks

hoary saddle
#

hey there, trying to spawn a custom composition through a trigger.

// Define the position where you want to spawn the plane
_planePosition = getMarkerPos "planeSpawnMarker";

//Spawn The plane
_composition = createVehicle ["JUMP PLANE", getMarkerPos "planeSpawnMarker", [], 0, "NONE"];

its not working, and im not getting any errors. any ideas?

proven charm
#

technically that code doesn't try to spawn a composition but a vehicle. you should replace the "JUMP PLANE" with the vehicle class name

hoary saddle
#

so the vehicle is a c17 with crap in the back for testing, I made it a composition. Would i still want to use the C17 classname?

proven charm
#

not sure what ya doing but you need to get the plane class name for createVehicle command

hoary saddle
#

right now im just trying to spawn this c17 thats grouped with a few items as a composition on the ground in front of me.

#

i guess im having trouble understanding whats confusing?

proven charm
#

maybe someone can help you with that (eden?) composition because i havent used those but I know you dont use createVehicle for compositions

#

what i dont understand is if the stuff is already on the map why do you need to recreate them?

hoary saddle
#

thers no c17 with crates in the cargo bay on the map

#

eventually i want to spawn it in the air, not have it on the ground

#

just trying to figure this piece out first

proven charm
#

hmm

#

not getting clear picture

hoary saddle
#

Go in the editor and place a house, now put a table in it, now make that a composition.

Now what if you want to spawn that using a trigger?

im trying to do that with a plane and some crates.....

proven charm
#

ok gotcha you need some comp spawn function for that, i forgot which one

#

but im not sure how up to date that is

hoary saddle
#

ok thank you

lean magnet
#

Is there a way to send a post request in eden (on the server side)?

winter rose
lean magnet
#

No way to do it natively?

winter rose
#

no, if we are talking about Arma 3

lean magnet
winter rose
lean magnet
#

yeah i saw that

#

im gonna try make it work, see if its possible

#

i only need it to effectively ping something

winter rose
#

that's about it

lean magnet
#

k, thanks.

lean magnet
#

sorry to bug you again πŸ‘

winter rose
#

you could make some overlay with transparent or out-of-screen controls

meager granite
#

moveInDriver

oblique current
#

Hi, this is perhaps a noob question but I've been struggling with it for quite sometime. I have a vehicle that uses rtm based animations. The animations work fine in object builder and appear to be successfully binarized but I can't get them to play using switchMove, playMove or any others in a script. I've setup a CfgMoves class that defines the states for all these animations. Is there something I'm missing please? Also, the vehicle never shows up as one of the animated objects within Eden's animation viewer.

gloomy aspen
#

Hey πŸ™‚

I'm trying to setup a 'mission room' with plenty of screens playing videos from within the vanilla source files (better than having players download a load of video files)

It seems to be working ok, but I have two issues I was hoping somebody could help me with

  1. The videos are playing sound (not in 3d) and ideally id like them have no sound at all
  2. The videos play once and then end, id like them to loop infinitely

Any help is much appreciated!


_video = "\a3\missions_f_exp\video\exp_m04_v02.ogv";
this setObjectTexture [0, _video]; 
[_video, [10, 10]] call BIS_fnc_playVideo;
oblique current
#

Is it? I really don’t know. I’m presently using a script being called from the config file to run the animation (doesn’t work).

fair drum
# gloomy aspen Hey πŸ™‚ I'm trying to setup a 'mission room' with plenty of screens playing vid...

Reference KillzoneKid's blog on the topic

killzonekid.com/arma-scripting-tutorials-ogv-to-texture/

1.) Out of luck for 3D sound. Need to remake video without sound for no sound.
2.) There is an internal scripted event handler that is made within the function:

[missionNamespace, "BIS_fnc_playVideo_stopped", [_videoContent]] call BIS_fnc_callScriptedEventHandler);

you can use this event handler to find out when to run the script again

halcyon hornet
#

is there a way to get the model path for the current scope of a players main weapon?

#

I have something like this I normally use for other items:

_weaponConfig = configfile >> "CfgWeapons" >> (headgear  player);  
  
  
(getText (_weaponConfig  >> "model")); 
#

Just not sure what to use to check primary weapon scope

fair drum
halcyon hornet
fair drum
halcyon hornet
#

I want to get the model path from the players current scope

fair drum
#
primaryWeaponItems player params ["_silencer", "_laser", "_optics", "_bipod"];

private _model = getText (configFile >> "CfgWeapons" >> _optics >> "model");

// return
_model
halcyon hornet
#

That isn't returning anything for some reason

fair drum
#

just put _model at the end

halcyon hornet
#

Ahh thanks works now

gloomy aspen
tight cloak
#

so im trying to take a large composition, and turn it into 2 functional parts built around a turret.
the "base" of the turret will rotate to face the direction of the aforementioned turret. and the "barrel" of the turret will change its elevation based on the "turret" barrel elevation while also following the rotation of the base to create a rather large weapon. ive currently got both the "barrel" and "turret" rotating but not the elevation using attachtorelative fuckery. whats the best way to approach the elevation issue?

hallow mortar
#

BIS_fnc_attachToRelative doesn't have the features you need to do this (https://feedback.bistudio.com/T156957).
You need to use attachTo directly, and work out the relative positions yourself.

gloomy aspen
#

@fair drum (or anybody who may also know!) Apologies, I tried following your advice and have found a way to ensure the video plays correctly for a dedicated server too, I just cant figure out where to amend this to have it loop infinitely. Are you able to assist?

Thank you again!


 if(isServer) then { 
private _video_1 = "\a3\missions_f_exp\video\EXP_m06_vIntel.ogv"; 
_screen_1 = toc_screen_1 setObjectTextureGlobal [0,_video_1]; 
         
_screen_1 setObjectTextureGlobal [0, _video_1];  
        [_video_1, [10, 10]] remoteExec ["BIS_fnc_playVideo", ([0, -2] select isDedicated), false];   
    }; 
gloomy aspen
#

Sorry Nikko, tagged you by mistake there!

tight cloak
#

so before i get to work. as an outline:
using the turrets rotation im gonna have to get every object i wish to "follow" its rotation, get their offsets. maintain them while rotating them by the elevation of the turret and maintain their world offset from the turret

hallow mortar
#

No

tight cloak
#

my apologies, i must have misunderstood

hallow mortar
#

You're going to get all the objects you want to follow the rotation, and attach them directly to the bone that rotates by using attachTo, and turn on the "follow bone rotation" parameter in attachTo.

#

If you want to Editor-place them then you'll need to get their positions relative to the turret in order to copy their Editor positions (this is what BIS_fnc_attachToRelative does internally). Otherwise, you can just trial-and-error the attachTo offset until you have them positioned correctly.

tight cloak
#

im using 7erras attach to finder to test out some bits, but i cant even get a single object attached to the "turret" or "gun" memory point of a praetorian. i assume thats where the "selection names" comes from

#

so i can grab the memory point of the actual barrel

#

perfect. thats actually fixed my small scale testing

hallow mortar
#
_barrel = createVehicle ["Land_MetalBarrel_F",[0,0,0],[],0,"NONE"];
_barrel attachTo [yourTestTurret, [0.5,1,0], "gun", true];
_barrel setVectorDirAndUp [[1,0,0],[0,1,0]];```
tight cloak
#

do i even bother with the offset feature in attach to considering there is the "automatic offset" in example 3

#

assuming that does what it says

fair drum
# gloomy aspen <@177167602768936960> (or anybody who may also know!) Apologies, I tried followi...

Server Version

if (isServer) then {
    // Video function
    MON_PlayVideo = {
        private _video_1 = "\a3\missions_f_exp\video\EXP_m06_vIntel.ogv";
        toc_screen_1 setObjectTextureGlobal [0,_video_1];
        [_video_1, [10, 10]] remoteExec ["BIS_fnc_playVideo", ([0, -2] select isDedicated)];
    };

    // Repeat setup with event handler
    [missionNamespace, "BIS_fnc_playVideo_Stopped", {
        call MON_PlayVideo;
    }] call BIS_fnc_addScriptedEventHandler;

    // Initial video call
    call MON_PlayVideo;
};

and really, for something like this, its better to make it all local and not use remoteExec since those event handlers could fire at a different time on the server than the client:

Local Version

if (hasInterface) then {
    // Video function
    MON_PlayVideo = {
        private _video_1 = "\a3\missions_f_exp\video\EXP_m06_vIntel.ogv";
        toc_screen_1 setObjectTexture [0,_video_1];
        [_video_1, [10, 10]] call BIS_fnc_playVideo;
    };

    // Repeat setup with event handler
    [missionNamespace, "BIS_fnc_playVideo_Stopped", {
        call MON_PlayVideo;
    }] call BIS_fnc_addScriptedEventHandler;

    // Initial video call
    call MON_PlayVideo;
};
tight cloak
#

okay, figured out how to "automate" the attachto instead of using attachtorelative.
next question: why does this

_barrel = (8 allObjects 0) inAreaArray barrel;   

just fetch seemingly everything

#

i asked this a day or two earlier and someone said a precedence issue? not entirely sure how to fix it however in this case

gloomy aspen
hallow mortar
# tight cloak i asked this a day or two earlier and someone said a precedence issue? not entir...

The precedence issue was with this structure:

{ ... } forEach (8 allObjects 0) inAreaArray barrel;```
In that structure, the game goes "`forEach`? ok, let's see what you want to iterate over", sees `(8 allObjects 0)`, and immediately executes that to use as the array for `forEach`. _Then_ it reads `... inAreaArray barrel;` but it's too late.
The solution to that is to use these `( )` to force the correct parts of the expression to be executed first, same as in a maths expression.
tight cloak
#

wouldnt removing the () also fix it?

#

as it would instead read it all

hallow mortar
#

No, it still reads left-to-right *when the commands involved have equal precedence

#

In fact, it might then read 8 first and try to use that (then fail with an error because 8 is not an array)

tight cloak
#

(8 allObjects 0 inAreaArray testingtrigger); then?

hallow mortar
tight cloak
#

ill just crutch on that then

grave lagoon
#

Hey guys, idk where should i write this so im doing it here, anyone can help me out with UPnP error when i want to host a server to play with my friends?

hallow mortar
hallow mortar
#

You can also create everything through scripting once you find out the right offset and vectors to use, which will make it much easier to place the turret wherever you want without disturbing its accessories.

tight cloak
#

i dont see that really being an option as its a custom composition that is rather large

#

it would take a while

#
_relPos = john_1 worldToModel (getPosATL _x) 
_x attachTo [john_1, _relPos, "gun", true];

instead im gonna use something like this (gonna plug in a vectorDir and vectorUp finding solution to plug into the setVectorDirAndUp

#

and there will only be one of him

#

yes the turret is called john

#

so:

_base = 8 allObjects 0 inAreaArray testingtrigger;  
_barrel = 8 allObjects 0 inAreaArray barreltest;  
{
    _vDir = vectorDir _x;
    _vUp = vectorUp _x;
    _relPos = john_1 worldToModel (getPosATL _x);
    _x attachTo [john_1, _relPos, "gun", true];
    _x setVectorDirAndUp [_vDir,_vUp];
} forEach _barrel;
hallow mortar
#

I was working on writing something to do it mostly automatically for you but it seems like we're missing some ways to get information that would be needed for that, like which selection an object is attached to :U

tight cloak
#

why would that be necessary? wouldnt it be possible to just save the prior attached selection

hallow mortar
#

I wanted to let you design it in the Editor so you could see what you're doing, then scrape all the position information from the completed package to feed into a script to automatically recreate it

tight cloak
#

ill dm you it

hallow mortar
#

But associating the appropriate selection with each object would require you to do that yourself, which sort of defeats the purpose

tight cloak
#

couldnt i just use the two triggers ive got setup to attach those objects that way?

#

base gets attach to relatived. the barrel attached to the turrets barrel

hallow mortar
#

Yes, probably, though I think you need to do some more maths than you're currently doing, because the offset is relative to the selection, not the object origin

#

I'm just looking at ways to make the whole thing into a script, for my own satisfaction rather than because it's necessary

tight cloak
#

im just doing this for a cool op aswell as my own learning

hallow mortar
#

That's one of the ingredients, yes

tight cloak
#

would this be another

hallow mortar
#

Seems likely

tight cloak
#

for the correct setVectorDirAndUp

#

as currently my method has a strange slight vector issue

#

its a bit off

bleak mural
#

do any type of commands exist that forbid a certain heli being able to detect/land on a particular heli/invis heli pad?

#

for example i want to assign a landing pad to a specific unit and another one to another unit in close proximity but ensure unit A lands at pad A and unit B lands at pad B

#

UNITS will be flying back and forth over a long mission to their respective pads,so removing/hiding pads etc isnt an option

tight cloak
#

having a bit of a headache converting the selection position relative to the model origin to a world position to set the objects relative attachment

#

although at the same time im not entirely sure its necessary but its 3am and im losing my marbles

fair drum
#

i'm assuming you've already tested it and they land wherever the hell they want?

hallow mortar
tight cloak
#

so the current code ive got then is:

_base = 8 allObjects 0 inAreaArray testingtrigger;   
_barrel = 8 allObjects 0 inAreaArray barreltest;
_selectionL = steve selectionPosition "gun"; 
_selectionV = steve selectionVectorDirAndUp ["gun","Memory"];
private _selectionPos = steve selectionPosition "gun";
private _selectionPosASL = steve modelToWorldWorld _selectionPos;
{ 
 _vDir = vectorDir _x; 
 _vUp = vectorUp _x; 
 private _offset = _selectionPosASL vectorDiff (getPosASL _x); 
 _x attachTo [steve, _offset, "gun", true]; 
 _x setVectorDirAndUp [_vDir,_vUp]; 
} forEach _barrel; 
steve switchCamera "internal";  
player remoteControl steve;  
#

steve is my new test turret

#

got a bit of old code still stuck in there

#

okay the attached stuff is inverted

#

well, not inverted. off by 90 degrees

#

and upside down

hallow mortar
#

You're not converting the vectors. You're just getting their old (worldspace) vector and applying the same vector after attaching them. Now they're operating relative to the selection, the old vector is no longer correct.

#

You need to get the selection's vector in world space, get the child object's vector in world space, and compare them. The difference should be the relative vector you need.

tight cloak
#

I see

tight cloak
#
_base = 8 allObjects 0 inAreaArray testingtrigger;    
_barrel = 8 allObjects 0 inAreaArray barrel; 
_selectionL = steve selectionPosition "gun";  
_selectionV = steve selectionVectorDirAndUp ["gun","Memory"]; //parent vectors
 
{  
 _vDir = (_selectionV select 0) vectordiff (vectorDir _x);  //child vector dir
 _vUp = (_selectionV select 1) vectordiff (vectorUp _x); //child vector up 
 _relPos = steve worldToModel (getPosATL _x);  
 _x attachTo [steve, _relPos, "gun", true];  
 _x setVectorDirAndUp [[_vDir],[_vUp]];  
} forEach _barrel;  
steve switchCamera "internal";   
player remoteControl steve;  

something like this?

#

im a little bit lost at this point

bleak mural
#
randomPoint= selectRandom ["AO", "AO"];               
 { deleteWaypoint _x } forEachReversed waypoints EBIRD;              
_wp = EBIRD addWaypoint [position LIFTPADEBIRD, 0];               
_wp setwaypointtype "GETIN NEAREST";               
_wp setWaypointSpeed "NORMAL";               
_wp setWaypointBehaviour "AWARE";              
_wp = EBIRD addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];             
_wp setwaypointtype "MOVE";        
_wp setWaypointBehaviour "COMBAT";                 
_wp = EBIRD addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];             
_wp setwaypointtype "MOVE";   
EBIRD setBehaviour "CARELESS";      
_wp setWaypointBehaviour "CARELESS";       
_wp setWaypointTimeout [1, 2, 3];         
_wp = EBIRD addWaypoint [position LANDPADEBIRD, 0];   
EBIRD setBehaviour "CARELESS";            
_wp setwaypointtype "GETOUT";      
_wp setWaypointBehaviour "CARELESS";           
_wp setWaypointTimeout [1600, 1700, 1800];            
_wp = EBIRD addWaypoint [position LANDPADEBIRD, 0];             
_wp setwaypointtype "CYCLE"; 
#

you can see "liftpad" and "landpad"

#

the pads need to be close together, at 50 mtrs distance, and the wp in syntax above,all runs ok

#

but theres another aircraft and script and 2 more pads "landpadbird2" for example also close by. all seems ok actually and iv had no issues, however i just want to make 110% sure they follow directions to their sepcific pads and wondered if such a command existed

#

hmmm actually i could manipulate the pads with show/hide command when one particular aircraft flies to within a set range of landing area. that should garauntee it

hallow mortar
#

Once 2.18 arrives, you can use the new alt syntax for landAt to target a specific pad

bleak mural
#

thats awesome and lovely timing thanks for mentioning

hallow mortar
#

pretty much anything that's in a function is something you can also do yourself without the function btw. Functions are made from commands; they're just a way of condensing several commands into one quick reference. Unflipping things has always been possible (setDir resets orientation), the function just makes it more convenient.

bleak mural
meager granite
#

Is there a reliable way to preload music?

#

playMusic

#

Been an issue forever, you randomly end up with music not playing

#

I tried running playMusic on all tracks during loading, but it doesn't really preload it

#

You randomly end up with music not playing when you do playMusic

little raptor
#

Or do you randomly pick a music and that random music doesn't play?

meager granite
#

I only use 3 track, I do playMusic on each during loading

#

When time comes to play, playMusic randomly does nothing

#

(How the hell did I end up typing "on all vehicles"? thonk )

little raptor
#

It sounds like a bug. it makes more sense to make a ticket instead of looking for a workaround imo

meager granite
#

Preload:

    {
        playMusic _x;
    } forEach ["LeadTrack04_F_EPC", "LeadTrack01_F", "LeadTrack03a_F_EPA"];
    0 spawn {playMusic "";};

Usage:

    if(publicVar_game_winnerTeam == client_mySide) then {
        playMusic ["LeadTrack01_F", 130.6];
    } else {
        playMusic "LeadTrack03a_F_EPA";
    };
#

I think it fails with both?

#

Just had it fail with playMusic ["LeadTrack01_F", 130.6];

#

Next time I tried running same command, it worked

meager granite
#

thus the search for crutches

#

Asset preloading is a long going issue to be honest

little raptor
#

I don't think the problem is the preloading

#

Also I don't know if playMusic actually loads anything immediately when you call it

vapid dune
#

Help me figure out the addAction please.
I'm trying to make a mission script that allows locking/unlocking doors if player have a "key" in inventory. But I cannot add action to door and I don't understand why.
My current code is:

// init.sqf
DD_fnc_initDoors = {
    params ["_building", "_door", "_key"];
    _building addAction [
        "Try unlock", // Title 
        {
            params ["_target", "_caller", "_actionId", "_arguments"];
            _target setVariable [format ["bis_disabled_Door%1", _arguments], 0, true];
            }, // Script
        {_building, _door, _key}, // Args (_this select 3)
        1.5, // Piority
        false, // ShowWindow
        true, // HideOnUse
        "", // Shortcut
        true, // Condiditon
        15, // Radius
        false, // Unconscious
        "", // Selection
        "" //MemoryPoint
    ];
};

And in the init field of the building I call this

[this, 1, 1] call DD_fnc_initDoors;
// Door_1 is disabled via attributes

But action isn't added.

little raptor
#

The way you pass the args is wrong

#

Also where have you defined the function?

#

Are you sure it's defined when you call it?

vapid dune
#

The way you pass the args is wrong
So what's wrong, I'm too used to C-like languages and I'm a bit los in sqf

Also where have you defined the function?
Umm, in init.sqf.

Are you sure it's defined when you call it?
I tried calling it while in mission via execute field, same result

little raptor
#

It seems to me that you're only trying to pass the door number as arg, so the addAction args should just be _door, not {_building, ...} (which is a "code", due to being wrapped in {})

#

also, init.sqf gets executed after object init fields

#

So your object init never sees the function

vapid dune
little raptor
#

Also regarding your bis_disabled_doorX variable, wasn't it supposed to be assigned a boolean? You're assigning it a number

little raptor
vapid dune
# little raptor Also regarding your `bis_disabled_doorX` variable, wasn't it supposed to be assi...

I found this script where lock state controlled by integer as I understand https://forums.bohemia.net/forums/topic/215428-addaction-in-building-doors/

deft zealot
#

@meager granite thanks. Next question:
Is it possible to invoke push to talk ingame with SQF? (e.g. like player action ["pushToTalk"])

little raptor
#

I thought they were booleans. nvm then

vapid dune
#

So it isn't working because init.sqf is executed after object init? If so, I need to make sure function is loaded first by either using library (looks kinda complicated), or call it mid mission, right?
BTW, I used sleep in object init field to change texture of shoulder rank for CWR3 uniform and it worked as expected.

vapid dune
little raptor
little raptor
#

Using a delay is weird

#

And there's still no guarantee that init.sqf has completed running the bit you wanted (tho you can use waitUntil and isNil but that'd be overkill)

#

Functions library is complicated at first but once you figure it out it becomes far easier, cleaner, and more convenient than many other solutions

#

Especially if you intend to make a lot of functions

vapid dune
#

Ok, I'll try this way, thank you

modern osprey
#

Tell me please, how can I remove the standard action?

I need to delete the repair action

little raptor
# vapid dune Ok, I'll try this way, thank you

I recommend doing it this way:

  1. Make a folder in your missions folder called DD
  2. In DD make a folder called functions
  3. Make a file called functions.hpp in the mission folder, next to mission.sqm and description.ext, like this
class CfgFunctions
{
  class DD
  {
    class DoorStuff
    {
      file = "DD\functions\door"; // directory where the following functions are located:
      class initDoors {};
    };
  };
};
  1. In description.ext write #include "functions.hpp"
  2. Now create a folder called "door" in the functions folder, and put the fn_initDoor.sqf file in it (function files should be called fn_functionName.sqf, otherwise you have to specify their full paths for the game to find them)

That will create a function called DD_fnc_initDoors (DD comes from the "class DD" part)

When you add new functions, you have to stop the mission and go back to eden and start the mission again

indigo snow
#

VOIP is in a whole other layer of the engine'

vapid dune
#

Got it

indigo snow
#

you can't access it with SQF

#

only the radio channels in MP

thorn walrus
#

it goes into spectator but going out of spectator no longer works

bleak gulch
#

What will happen if that delay is not enough on 2010 machine?

#

Or you're loading the game and copying the files at the same time?

vapid dune
bleak gulch
#

yep

proven charm
#

you know there are those dubbing_radio_f sound files that have sounds for numbers directions etc. is there function that can play sentence using those? Like "enemy 50m east"

bleak gulch
modern osprey
dry igloo
#

Anynone know some good soundfiles for zombie screams?

#

from arma3 itself

vapid dune
# bleak gulch yep

Well, I have enough time to set delay up to 10 minutes. And as I understand this delay starts just after map screen, so, I don't see big issue in terms of old PCs.
Anyway this was only for testing purposes, in final variant I will do this via proper script.

dapper cairn
#
this addAction ["exit respawn island", {player setPos (getPos ex1)}]

Using this script to teleport my players back onto the carrier from where the respawn point is but it spawns them under the boat in the water. I know theres something to change to fix that but I dont remember what it was

hallow mortar
#

Try using getPosASL and setPosASL instead of getPos/setPos. (And of course make sure ex1 is actually on the deck of the carrier)

#

Using getPos/setPos is strongly discouraged because a) they're slow and b) they do NOT use the same position format. There is a note on each command's wiki page explaining further.

red shale
#

How do i stop or delay players force respawning? using the ESC menu that is

fair drum
bleak gulch
#

moreover in MP you can experience the situation where player variable is not initialized at init.sqf script

#

It is better to strictly follow the guidlines, because A LOT A LOT of community creators commit the same mistake

#

Alternatively if you don't use postInit, it is good practice is to wait BIS_fnc_init

#

something like this

waitUntil {sleep 0.1; (!isNil "BIS_fnc_init") && {BIS_fnc_init}};
// set textures
#

Keep in mind, player variable can be <NULL-OBJ> if player's slot changed the group mid-game

#

Or even his AI avatar was killed

#

In this case you have to detect and resolve this.

#

It's common mistake to use these constructs

waitUntil {player == player};
waitUntil {!isNull player};
waitUntil {local player};
// etc

because in some cases player will never be initialized and this will waitUntil to stuck infinitely checking the variable.

#

For example if your mission doesn't even have player slots

#

If player variable was not init before postInit or even in "PreloadFinished" EH there is definetly something went wrong

#

If you're using CBA's Settings, in general CBA_fnc_addSetting called in XEH_preInit.sqf. Code in the argument #7 is executed AFTER preInit phase. It means of you set global variable in that code you cannot use these vars in XEH_preInit.sqf:

XEH_preInit.sqf:

// Add CBA settings
[
    "MyOption_enable",
    "CHECKBOX",
    ["Enable", "Enable description."],
    ["MyModName", "General settings"],
    true,
    1,
    {
        // code executed after preInit
        MyGlobalVariable = _this;
    },
    false
] call CBA_fnc_addSetting;

// error! MyGlobalVariable is nil
if (MyGlobalVariable) then
{
    hintSilent (format ["Checkbox is set to %1", MyGlobalVariable]);
};
#

The good example is WBK's Death and Hit Reaction mod (by Webknight).

#

I hope he will fix that someday

#

TL;DR It is very crucial to develop the habit of writing code properly from the very beginning. IMO. Sure you can code whatever you want without limitations, but the users probably will curse everyone and arma developers for "bad unstable and glitchy" game.

modern osprey
#

Hi guys.

I'm trying to damage a technique module using

_vehicle setHitPointDamage ['hitfuel', 1]

But after some time (3-4 seconds), the value is set to the previous value itself.

The only problem is the multiplayer. If you run it locally, everything is fine

proven charm
modern osprey
proven charm
#

make sure _vehicle is local to wherever you call that code from

modern osprey
hallow mortar
#

That doesn't really have anything to do with locality

#

Use remoteExec to send the command to the machine where the vehicle is local

proven charm
#

i think this is what Nikko means , (hope i got the code right πŸ™‚ : ```sqf
[_vehicle , ['hitfuel', 1] ] remoteExec ["setHitPointDamage", owner _vehicle];

hallow mortar
#

owner isn't needed

modern osprey
#

Oh shit. I tried to do

[cursorObject, "hitfuel", 0] remoteExec ["setHitPointDamage"]
#

Thank you very much

proven charm
#

you only need remoteExec if you dont know where the vehicle is local though

hasty pond
#

I am so confused about ExtDB2 not working for me...

tame bison
#

Hello, please tell me,how can positions array?
nearestObjects [pos1,pos2,pos3, ["LandVehicle"], 100, true];

meager granite
#
private _nearest = [];
{
    {
        _nearest pushBackUnique _x;
    } forEach (nearestObjects [_x, ["LandVehicle"], 100, true]);
} forEach [pos1,pos2,pos3];
#

to make sure there are no duplicates

#

(You can also use arrayIntersect to remove duplicates from code bit 1)

tame bison
# meager granite ```sqf private _nearest = []; { _nearest append nearestObjects [_x, ["LandVe...

Can you tell me where the error is?

_pos = [22810,18166,0.00143886];
_pos2 = [22997.9,18433.9,0.00143886];                        
_posmove = [22768.4,18364.4];        
private _nearest = [];
{
    _nearest append nearestObjects [_x, ["LandVehicle"], 100, true];
} forEach [_pos,_pos2];                    
_arr = nearestObjects [_nearest, ["LandVehicle"], 300, true];
{
    if (_x isKindOf "LandVehicle") then {            
    _x setVehiclePosition [_posmove, [], 250, "NONE"];
    };                
} forEach _arr;
#

My task is to take cars from several positions and move them

#

I think I understand

to
_arr = nearestObjects [_x, ["LandVehicle"], 300, true];
#

in the end something like that

_pos2 = [23995.1,18074.7,0.00143886];                        
_posmove = [22768.4,18364.4];        
private _nearest = [];
{
_nearest append nearestObjects [_x, ["LandVehicle"], 100, true];
    _arr = nearestObjects [_x, ["LandVehicle"], 300, true];
    {
        if (_x isKindOf "LandVehicle") then {            
        _x setVehiclePosition [_posmove, [], 250, "NONE"];
        };                
    } forEach _arr;    
} forEach [_pos,_pos2];```
tight cloak
#

as a continuation from previous entry of mine in this chat

_base = 8 allObjects 0 inAreaArray testingtrigger;     
_barrel = 8 allObjects 0 inAreaArray barrel;  
_selectionL = steve selectionPosition "gun";   
_selectionV = steve selectionVectorDirAndUp ["gun","Memory"]; //parent vectors 
  
{   
 _vDir = (_selectionV select 0) vectordiff (vectorDir _x);  //child vector dir 
 _vUp = (_selectionV select 1) vectordiff (vectorUp _x); //child vector up  
 _relPos = steve worldToModel (getPosATL _x);   
 _x attachTo [steve, _relPos, "gun", true];   
 _x setVectorDirAndUp [[_vDir],[_vUp]];   
} forEach _barrel;   
steve switchCamera "internal";    
player remoteControl steve;

trying to attach a load of objects within a trigger to a turrets barrel, attempting to get the correct vectors so they stay as they are when the attachment happens

#

this currently works to attach them to the turrets barrel, but they are all rotated wrong (presumably due to my bad vector math)

terse tinsel
#

I have a request, do you know how to use a script to increase the volume of the environment played in the trigger??? 3d sound

hallow mortar
coarse dragon
#

hello

#

how would one make a helo troop immune to damage untill they get out of the helo then be killable again?

faint oasis
#

Is there a script command to avoid the AI to get in inside all vehicles in his group ? Because when i put 8 soldiers on the ground and i add to that group, 2 vehicles like transport trucks or even Apcs like the Marid for example, the AI order to all units on foot to get in.

coarse dragon
#

... hmm i whish i had the skill to understand that 😦

fair drum
coarse dragon
#

hey, would you mind writing it for me? as im bad at arma scripts? thank you

fair drum
coarse dragon
#

that simple?

fair drum
#

yeah, anybody that gets in is immune, anyone that gets out is not

coarse dragon
#

i shall kiss you

#

thanks

terse tinsel
tight cloak
# hallow mortar You're comparing the selection vector (modelspace) to the object vectors (world ...

like so?

_base = 8 allObjects 0 inAreaArray testingtrigger;    
_barrel = 8 allObjects 0 inAreaArray barrel; 
_selectionL = steve selectionPosition "gun";  
_selectionV = steve selectionVectorDirAndUp ["gun","Memory"]; //parent vectors
 
{  
    _vDirRel = steve vectorModelToWorld (_selectionV select 0);
    _vUpRel = steve vectorModelToWorld (_selectionV select 1);
    _vDir = _vDirRel vectordiff (vectorDir _x);  //child vector dir
    _vUp = _vUpRel vectordiff (vectorUp _x); //child vector up 
    _relPos = steve worldToModel (getPosATL _x);  
    _x attachTo [steve, _relPos, "gun", true];  
    _x setVectorDirAndUp [[_vDir],[_vUp]];  
} forEach _barrel;  
steve switchCamera "internal";   
player remoteControl steve;  
hallow mortar
#

Move the vectorModelToWorld conversion outside the forEach, you only need to do it once

tight cloak
#
_base = 8 allObjects 0 inAreaArray testingtrigger;    
_barrel = 8 allObjects 0 inAreaArray barrel; 
_selectionL = steve selectionPosition "gun";  
_selectionV = steve selectionVectorDirAndUp ["gun","Memory"]; //parent vectors
_vDirRel = steve vectorModelToWorld (_selectionV select 0);
_vUpRel = steve vectorModelToWorld (_selectionV select 1);
 
{  
    _vDir = _vDirRel vectordiff (vectorDir _x);  //child vector dir
    _vUp = _vUpRel vectordiff (vectorUp _x); //child vector up 
    _relPos = steve worldToModel (getPosATL _x);  
    _x attachTo [steve, _relPos, "gun", true];  
    _x setVectorDirAndUp [[_vDir],[_vUp]];  
} forEach _barrel;  
steve switchCamera "internal";   
player remoteControl steve;  
hallow mortar
#

That should be right

#

Please bear in mind that I hate maths, and 3D maths is obviously 3x as bad, so it's possible I'm wrong about some of this

tight cloak
#

im getting an error on setVectorDirAndUp

#

1 elements provided, 3 expected

hallow mortar
#

_vDir and _vUp are already arrays, you don't need to give them more []. That just turns them into arrays of arrays.

tight cloak
#

_x setVectorDirAndUp [_vDir,_vUp]; ?

hallow mortar
#

Yes

#

_vDir is literally the same as [x, y, z]. If you do [_vDir] that's the same as [[x, y, z]], which is not the array format the command expects.

tight cloak
#

so uh

#

result of the code is in DM's

hallow mortar
#

That don't look quite right

#

Well, I tried my best and now I'm out of ideas. Good luck someone else πŸ‘

tight cloak
#

no, it doesnt

fair drum
#

maybe you should have named him greg

hallow mortar
#

ps. go accept the rules or whatever it is and you'll be able to post pics

tight cloak
#

i can now post pictures

#

behold the monstrosity

#

vector math is my enemy

fair drum
#

ship it

#

good enough

tight cloak
#

this is my learning experience

#

agony

#

so my friend who doesnt know a whole lot about a3 scripting but has read the documentation suggested this:
vDir has [x,y,0], and vUp has [0,0,z]
so you need
newVectors [x1, y1, z1] = vectorModelToWorld [x, y, z];

vDir = [x1, y1, 0]
vUp = [0, 0, z1]

#

not correct syntax but the best way he could articulate the idea

#

any weighins while i write the code?

little raptor
tight cloak
#

im at a roadblock with this

#

trying to attach objects within a trigger to a memorypoint via attachto, but automating finding the vector so it just attaches everything without the need to do them individually

#

as otherwise it just rotates everything incorrectly

#
_base = 8 allObjects 0 inAreaArray testingtrigger;    
_barrel = 8 allObjects 0 inAreaArray barrel; 
_selectionL = steve selectionPosition "gun";  
_selectionV = steve selectionVectorDirAndUp ["gun","Memory"]; //parent vectors
_vDirRel = steve vectorModelToWorld (_selectionV select 0);
_vUpRel = steve vectorModelToWorld (_selectionV select 1);
 
{  
    _vDir = _vDirRel vectordiff (vectorDir _x);  //child vector dir
    _vUp = _vUpRel vectordiff (vectorUp _x); //child vector up 
    _relPos = steve worldToModel (getPosATL _x);  
    _x attachTo [steve, _relPos, "gun", true];  
    _x setVectorDirAndUp [_vDir,_vUp];  
} forEach _barrel;  
steve switchCamera "internal";   
player remoteControl steve;
``` curent code
meager granite
#

_x setVectorDirAndUp _selectionV doesn't work I assume?

bleak mural
#

im attempting to make a dynamic set of tasks simply involving a set of vehicles being destroyed. the thing is i only want the task to complete if the player is the one who destroyed them,and the task cancel if it was anyone else

#

i cant find any info on condition if player does x

meager granite
#

You probably want Killed event handler

#

You're creating them in editor?

bleak mural
#

yes all in editor

meager granite
#

It works on all objects

#
this addEventHandler ["Killed", {
    params ["_unit", "_killer", "_instigator", "_useEffects"];

    private _task = _unit getVariable ["mytask", taskNull];
    if(isPlayer _instigator || crew _killer findIf {isPlayer _x} >= 0) then {
        _task setTaskState "Succeeded";
    } else {
        _task setTaskState "Failed";
    };
}];
#

_killer could be a tank so that crew _killer findIf {isPlayer _x} >= 0 checks if any of the crew is player, in case player was driving and AI unit shooting or something

#

I guess you have your tasks setup through task framework or something so change that setTaskState to that instead

#

(This is a code bit for init field)

#

You'll need to set your ask to a vehicle as "mytask" variable btw

#

depending on how you setup your tasks

bleak mural
#

yep using it through task framework, thats awesome thank you il get to testing as soon asπŸ‘

onyx hearth
#

hey, good morning!
i have a problem i'm not able to resolve.

we have special logic in our gamemode that a player character will not instantly die, but will enter an "incapacitated" state instead. a bleedout timer will start, and if the player is revived within it, he'll be back in business.

the problem is, that it works only once. during testing:
i throw a grenade at myself, it goes off, i go unconscious (perfect)
get healed by AI
i throw again, get again unconscious (also fine!)
a second later the game engine kills me

is there anything i'm not considering?

will throw some code here shortly

#
_unit addEventHandler
    [    "HandleDamage",
        {
            private [
              "_unit", 
              "_selections", 
              "_getHit", 
              "_selection", 
              "_killer", 
              "_projectile", 
              "_oldDmg", 
              "_curDmg", 
              "_newDmg", 
              "_EnemyDam"];
            diag_log format["HandleDamage eventhandler invoked - unit %1 - killer %2", name _unit, name _killer];
            _unit = _this select 0;
            _selections = _unit getVariable ["selections", []];
            _getHit = _unit getVariable ["gethit", []];
            _selection = _this select 1;
            _killer = _this select 3;
            _projectile = _this select 4;
            // Check if damaged part is already damaged
            if !(_selection in _selections) then {
                _selections set [count _selections, _selection];
                // Add placeholder damage value
                _getHit set [count _getHit, 0];
            };
            // this is used later to apply damage to AI soldiers (if non-lethal damage)
            _i = _selections find _selection; 
            _oldDmg = _getHit select _i;
            _curDmg = _this select 2;

            if (isPlayer _unit) then {
                diag_log format["Damage (%2) for player %1 would have been fatal - intercepting", name _unit, _curDmg];
                _newDmg = 0;
                if (local _unit) then {
                    private _incapSide = side _unit;
                    // here we handle that the unit goes into "incapacitated" state
                    [_unit, _EnemyDam] spawn fnc_enterIncapacitatedState; 
                    [_unit, _incapSide, _killer] spawn fnc_onKill;
                };
                _newDmg;
            } else { ... }
    ];
#

sorry for the formatting, let me try fixing this

#

i do have experience in software development, but quite new to Arma3 scripting - please forgive me any beginner mistakes in that code πŸ™‚

#

i checked the logs a couple of times and improved the logic, but it keeps happening, though the logs do now look as i expect them. i really have no idea what's going on. i would have expected the eventhandler ot intercept my death, pushing me to incapacitated state and removing damage from my unit.
thankful for any help!

meager granite
#

Could be your incapacitated state issue

#

Post code for it

warm hedge
#

Also private is not the way to define arguments in an EventHandler

#

params it is

meager granite
warm hedge
#

Ah okay, that code is very hard to read

meager granite
#

Another potential issue, game retains both EHs and variables on respawned units

#

So your "selections" and "gethit" from previous life would persist on respawned unit

onyx hearth
#

not sure about it, but as the unit is not actually "killed", does it matter (as a respawn should only be applied to actually killed units, shouldn't it)?

#

let me see what to post from the incapacitated state code

meager granite
#

Oh you didn't actually die, AI healed you

onyx hearth
#

exactly!

meager granite
#

Also I don't see _EnemyDam defined in your script

#

I'd suggest to just post the whole thing, would be easier to figure

#

pastebin for big chunks of code

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
meager granite
#

for small

onyx hearth
#

nice! thanks for that, i was already wondering how to achieve the highlighting! πŸ™‚

give me some minutes to prepare pastebin - and thanks for the assistance in advance!

one more thing - in order to give you more context, my brother and me are playing "The forgotten few 2" gamemode here - we love it, but didn't like the medical system, thus we decided to do some minor updates to it. so it's not all my code here, but i do understand it quite well so far. and one more disclaimer - we are only using the modified version for our private games ONLY (2 players + AI).

wise grove
#

Anyone got a pointer as to how to make these pretty white background squad overview tables you see in singleplayer missions?

wise grove
meager granite
#

If you say death happens after some time, perhaps previous script causes it somehow?

#

I see that's it scheduled and there are some sleeps

#

Since you use unit variables, maybe you don't reset some after being healed?

#

Make a diag routing to show all your variables somewhere?

#
onEachFrame {
    hintSilent parseText ([
         "TFFG_fnc_ReviveSuccess"
        ,"someothervar1"
        ,"someothervar2"
    ] apply {
        format ["<t size='0.7' align='left'>%1</t><t size='0.7' align='right'>%2</t>", _x, player getVariable _x]
    } joinString "<br/>");
};
wise grove
#

Further question about ORBAT

I want to load my own config, defined in description.ext for all player slots. I cant seem to get the correct syntax for the ORBAT Module. Can someone help me with that?

onyx hearth
# meager granite Uff, really hard to figure it out. So your incapacitated state ends with `setDam...

from line 276 a bleedout timer starts counting down. it's within a while loop here. and if that expires, the script continues, checking if the unit is still incapacitated and alive (meaning no first aid was applied -> bleeded out) - in this case it kills the unit by setting damage to 1

i'm currently not near my private laptop, in 2-3 hours i will be back and then paste the code of the revive action as well (from the top of my head, we deal with it - we re-set damage and "incapacitated" variables for the player after revival)

can it be that very severe trauma lead to instant death, regardless of that interception? somehow controlled by the game engine?

dry igloo
#

Cheers. I've used GPT and some less than basic scripting knowledge in my head to try & make a zombie script for public zeus as i cant find any online. Please don't hate me for using GPT. I did enough revisions to get the code to work with one exception. In the beginning there is a check for the zombies damage that, in case it did take any damage, changes the variables that declare the distances for the zombie to react to. However, when shooting the unit, it keeps behaving like before and for the love of god, i cant seem to figure out why...

umbral sentinel
#

Hello. Is there a way to disable 3rd person view only in vehicles? And when on feet 3rd person allowed

bleak mural
#

had a question,im testing a task system and i have a pretty simple one here,the task is to level a building and in trigger there is con: !alive h1

#

however this is satisfied before the house is FULLY destroyed

#

seems to trigger after the first level of desctruction is applied

#

is there an alternative to " !alive" for objects that satisfies once the house is caput? its an editor placed building

#

iv also tried "h1 getHit "dam1"==1" doesnt do anything in this case except removes the 3D task trigger when house is partially destroyed

meager granite
#

Buildings get replaced with damaged version after certain threshold

bleak gulch
#

I've used GPT
well...

bleak gulch
#

something like

Marky_fnc_perFrameHandler =
{
    if (player == (vehicle player)) then
    {
        // player is on foot, force FPV
        player switchCamera "INTERNAL";
    };
};
#

(personally I hate non-schedulled code)

#

alternatively you can use waitUntil:

waitUntil {call Marky_fnc_perFrameHandler; false};
bleak mural
bleak mural
#

i thought this would be easy, theres then no way around doing this right?

meager granite
#

There is MEH that fires on building change

#

you can watch it there

bleak gulch
#

But probably locking the the keyboard action is better in terms of resource consuming.

umbral sentinel
#

and how do i implement this codes ?

#

sorry im not so good at this

bleak gulch
#

it waits until condition in the brackeds is true

bleak mural
# meager granite you can watch it there
addMissionEventHandler ["BuildingChanged", {
    params ["_from", "_to", "_isRuin"];
}];

how would i call this effectively from a trigger con? my triggers are going to be synced to buildings for task marker positions

bleak gulch
#
waitUntil {1 == 0}; // wait until 1 is equal 0 (never)

the idea of using waitUntil instead of PFH is how fast waitUntil evaluates the condition. It evaluates it in scheduled environment and each frame at maximum speed.

meager granite
bleak mural
#

i see

meager granite
#

then check if _from is one of your scripted\target buildings

bleak mural
#

like your example earlier

meager granite
#

and maybe swap it in variables?

bleak mural
#

thanks man il experiment

bleak gulch
#

Both methods are working, waitUntil is more resource friendly, PFH is reliable

meager granite
#
addMissionEventHandler ["BuildingChanged", {
    params ["_from", "_to", "_isRuin"];
    if(_from == myBuilding && !_isRuin) then {
        myBuilding = _to;
    };
}];
bleak gulch
bleak gulch
#

init.sqf:

// by Prodavec
// Edited by Lou Montana

// Do not execute on HC or Dedi server
if (!hasInterface) exitWith {};

// Define the event handler
Marky_EachFrame_EH =
{
    // if player is Null -> skip the frame
    if (isNull player) exitWith {};

    // if player is not inside the vehicle and the camera mode is 3rd person view -> force FPV
    if (((isNull (objectParent player)) && {cameraView in ["GROUP", "EXTERNAL"]}) then
    {
        // player is on foot, force FPV
        player switchCamera "INTERNAL";
    };
};

// Assign event handler with its corresponding name
Marky_EachFrame_EHID = addMissionEventHandler ["EacHFrame", {call Marky_EachFrame_EH;}];

// execute this if you want to remove the EH and disable the feature
//removeMissionEventHandler ["EachFrame", Marky_EachFrame_EHID];
//Marky_EachFrame_EHID = -1;
umbral sentinel
#

can i add this into a pbo?

#

rather than in init of all players?

bleak gulch
#

are you making an addon or mission?

winter rose
#

you can allow optics, right πŸ™‚

addMissionEventHandler ["EachFrame", {
  if (isNull player) exitWith {};
  if (isNull objectParent player && { cameraView in ["GROUP", "EXTERNAL"] }) then { player switchCamera "INTERNAL"; };
}];
bleak gulch
#

it's just an example, because this code must be executed on human controled clients.

winter rose
#

initPlayerLocal.sqf?

bleak gulch
#

yep

winter rose
#

(I think it also runs on Headless, beware)

umbral sentinel
umbral sentinel
#

i dont understand how i implement this

bleak gulch
#

edited the original code according to @winter rose proposition to allow optics view, credit added.

winter rose
#

big thanks, no need ^^

bleak gulch
#

is initPlayerLocal.sqf working from the addon PBO? If yes, just put this code into that file

#

oh... and just in case it's headless client.....

umbral sentinel
#

wait so i create a text doc, copy paste the code above and name the text doc initPlayerLocal.sqf and then pack it into a pbo?

bleak gulch
#

yes

umbral sentinel
#

do make a config or no?

#

jsut pack it now?

bleak gulch
#

pack and test

#

you don't need config

#

To use an Event Script, create a file of the given name in the mission directory.

#

well it seems it doesn't

umbral sentinel
bleak gulch
#

I suppose initPlayerLocal.sqf doesn't work from the addon. You just need to test. If it doesn't fire, we will create config.cpp with CfgFunctions

umbral sentinel
#

Did not work

bleak gulch
#

as expected...

bleak gulch
#

okay, create config.cpp defining your addon and add CfgFunctions section:

class CfgFunctions
{
    class Marky
    {
        class MyInitFunctions
        {
            file = "functions";
            class myPostInitFunction
            {
                postInit = 1; // postInit attribute
            };
        };
    };
};

create file
<ADDON_ROOT_DIR>\functions\fn_myPostInitFunction.sqf
and put that code into the file.

onyx hearth
umbral sentinel
meager granite
#

I posted a snippet that hints variables each frame

#

for easy debugging

umbral sentinel
#

oh i see

#

wait

#

nvm im stupid

bleak gulch
#

config.cpp

class CfgPatches
{
    class MarkyAddon
    {
        units[] = {};
        weapons[] = {};
        requiredVersion = 1.00;
        requiredAddons[] = {};
    };
};

class CfgAddons
{
    class PreloadAddons
    {
        class MarkyAddon
        {
            list[] = {};
        };
    };
};

class CfgFunctions
{
    // ...
};
umbral sentinel
bleak gulch
#

my eyes πŸ˜„

umbral sentinel
#

what

bleak gulch
#

(dark mode)

umbral sentinel
#

haha

#

oh

#

but this is all?

#

or do i put cfgfunctions in there too

bleak gulch
#

no I mean u need to insert the CfgFunctions posted above

onyx hearth
bleak gulch
umbral sentinel
#

Like this?

bleak gulch
#

πŸ˜„

#

THis is even better

umbral sentinel
#

wait

bleak gulch
#

alright let me post the full version.... wait a bit

umbral sentinel
#

There?

bleak gulch
#

yes but remove that CfgFunctions with // ...

umbral sentinel
#

like this?

bleak gulch
#

looks good

umbral sentinel
#

nice i ill try now!

bleak gulch
#

Don't forget to create a file
<ADDON_ROOT_DIR>\functions\fn_myPostInitFunction.sqf

#

with the code

umbral sentinel
#

i did forget

#

wym by that

#

this all i got in here

bleak gulch
#

u need to create the directory called "functions"

#

initPlayerLocal.sqf can be deleted

#

it doesn't work anyway

umbral sentinel
#

folder names "functions"?

bleak gulch
#

yes

umbral sentinel
bleak gulch
#

the code listed above )))

bleak gulch
#

this one ^

umbral sentinel
bleak gulch
#

yes

#

oh crap, I found a mistake πŸ˜„

#
if (hasInterface || isDedicated) exitWith {};

must be

if (!hasInterface) exitWith {};

! is missing.

winter rose
#

!hasInterface only is required πŸ™‚

#

(a dedi doesn't have an interface either ^^)

umbral sentinel
#

bro

#

thank you

#

but i found ace has this function

#

i really appreciate your help! thanks bro

onyx hearth
# meager granite I posted a snippet that hints variables each frame

The snippet was indeed very helpful. But it looks like all the state variables around the incapacitation are maintained properly.
Can it somehow come from the game itself? Or another event is raised that i do not explicitly handle?
i'm really lacking more ideas to be honest, i've spent hours on that already and it seems like i haven't moved anywhere

umbral sentinel
#

so im making an arsenal with whitelists, and blacklisted bunch of shit. If i go to attributes in ace arsenal and do the same on all box, mission file will be huge. Any way to make the arsenal not have big file?

#

like by script in init or sum, i tried using ace framework but i got nowhere

tight cloak
#

this is the result:

#

i need the objects to maintain their current vectors from before the attach is run

onyx hearth
#

@meager granite
allow me some minor final question please:

  • when i blow myself up with grenades (or get hit with a tank shell, or whatever), is there any chance that any other mechanic kills me instantly if i am too close to the grenade? (that's how i did most of the testing)
    i came to the conclusion that while my unconscious script is running, somewhere inbetween the unit is killed by the game - for whatever reason. logs do confirm that.
granite sky
#

You could test with falling damage instead.

#

I don't recall units ever being insta-killed with grenades though.

#

Usual issue is that there can be multiple fatal HandleDamage calls for one hit, and they're not necessarily all in one frame.

#

But I haven't seen your script.

junior moat
#

i have this code in the init of a unit but nothing seems to happen and i get no errors, anyone know why?

[this, "AmovPsitMstpSlowWrflDnon"] remoteExec ["switchMove"];
hallow mortar
#
  • init field may be executing too soon during mission initialisation, before the unit is actually capable of animating
  • the unit may be immediately switching back out of the animation
  • you don't need to remoteExec from an Editor init field. Init fields are already executed on all machines.
bleak gulch
#

remoteExec in the init field is O(n^2) work.

ivory marsh
#

Hey guys, how to make "else if" script ?
does this work :
if (blabla) then {blabla}
else if (blabla) then {blabla}
else if (blabla ......
else {blabla} ?

hallow mortar
#

There is no direct elseIf in SQF.
You can nest another if within the else of a previous if, or you can use a switch structure.
e.g.

if (true) then {
   // blah
} else {
  if (_condition) then {
    // blah 2
  };
};```
<https://community.bistudio.com/wiki/switch>
Or you can combine the two, or find another approach that doesn't need elseIf.
meager granite
#

or exitWith

#
private _value = call {
    if(condition1) exitWith {result1};
    if(condition2) exitWith {result2};
    if(condition3) exitWith {result3};
    if(condition4) exitWith {result4};
    defaultValue;
};
ivory marsh
#

alr thx guys

granite sky
#

There's also the hashmap switch method if you really need something fast with a lot of cases.

junior moat
hallow mortar
#

You can't sleep in an init field because it's unscheduled; you'd freeze the whole game so it doesn't let you. You'd need to use spawn to make a scheduled scope.
The animation name still needs to be a "string".
If this unit is meant to change animation at some point in the future, then don't use an init field at all. It's executed for all machines including JIP, so if someone JIPs later after the unit has changed to another animation, that will reset it back to the one in the init field.

junior moat
queen cargo
#

when something is not working for you which should work

#

write it yourself @hasty pond

hasty pond
#

been doing that, but this language I'm facing isn't familiar

cedar kindle
#

@lunar mountain might happen if the server is running AI mods (or scripts), using HC etc..

lunar mountain
#

Not running AI mods, but using HC. However I tried without HC too. Looks like the first waypoint always gets completed instantly, but not the others. Is it a problem if I'm using the same variable ( _wp) for all waypoints?

cedar kindle
#

not if you're creating a new one, no

lunar mountain
#

Obviously the variable changes after I set all of the waypoint parameters.

#

It is my first time working with AI and waypoints, but I hate it already :D

cedar kindle
#

what mods?

lunar mountain
#

As I said, not running any AI mods, completely vanilla

queen cargo
#

"been doing that, but this language I'm facing isn't familiar"
ehhh ... c/c++?

bleak gulch
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
bleak gulch
#

I suppose if units are in danger, they won't follow the order to move unless you explicitly tell them to ignore the danger.

#

Not sure.

abstract bay
#

Yes, it is sure. Please no questions

bleak gulch
#

Also this line

{_x doMove (getmarkerpos "wp")} foreach units _grp1;

inside another loop

foreach units _grp1;

looks weird

#
{
    // ...
    {_x doMove (getmarkerpos "wp")} foreach units _grp1;
} foreach units _grp1;

For each unit of your group you goes through each unit of your group to order them to retreat.

#

I just don't understand why do you need to loop through the group to get count of the remaining units.

#

Maybe there must be kind of while {...} do loop, not forEach?

#

and units MUST be local to the script

#

I mean, you cannot control AI from the server side if they are local to some player (and vice versa).

abstract bay
#

I corrected it but it still doesn't work: _grp1 = [getMarkerPos "spawnunits", west, (configfile >> "CfgGroups" >> "West" >> "CUP_B_US_Army" >> "Infantry" >> "CUP_B_US_Army_WeaponsSquad_OCP")] call BIS_fnc_spawnGroup; { _x setSkill ["general", 0.3]; [_x, "111thID"] call BIS_fnc_setUnitInsignia; _x setFormation "DIAMOND"; } foreach units _grp1; _grp1 setGroupId ["US Army, Infantry 893th"]; if (({alive _x} count units _grp1) <8) then {_x doMove (getmarkerpos "wp")};

#

does anyone have a solution?

#

I repeat without brainstorming, please only clean solution

bleak gulch
#

wtf

#
{_x doMove (getmarkerpos "wp")};

_x is undefined

winter rose
#

also _grp move _pos works fine

tight cloak
tight cloak
#

nvm i got it

#

@hallow mortar as you hit a roadblock also:

_base = 8 allObjects 0 inAreaArray testingtrigger;    
_barrel = 8 allObjects 0 inAreaArray barrel; 
_selectionL = steve selectionPosition "gun";  
_selectionV = steve selectionVectorDirAndUp ["gun","Memory"]; //parent vectors
_vDirRel = steve vectorModelToWorld (_selectionV select 0);
_vUpRel = steve vectorModelToWorld (_selectionV select 1);
_vDirandUP = [_vDirRel, _vUpRel];
{  
    private _vectorDirAndUp = [_x, steve] call BIS_fnc_vectorDirAndUpRelative;
    //_vDir = _vDirRel vectordiff (vectorDir _x);  //child vector dir
    //_vUp = _vUpRel vectordiff (vectorUp _x); //child vector up 
    _relPos = steve worldToModel (getPosATL _x);  
    _x attachTo [steve, _relPos, "gun", true];  
    _x setVectorDirAndUp _vectorDirAndUp;  
} forEach _barrel;  
steve switchCamera "internal";   
player remoteControl steve;
#

simple as

#

there is some "fine tweaking" required but this was the major factor in getting about 90% of it working

hasty pond
#

yeah...

onyx hearth
# granite sky You could test with falling damage instead.

thanks for the reply, i completely missed it yesterday - sorry!
meanwhile, i finally fixed it by introducing a different method how damage is handled. it's a workaround, but works quite well. but I appreciate your help and will keep in mind for future issues!

sullen sigil
#

BIS_fnc_unitCapture/BIS_fnc_unitPlay are linked to specific vehicles, right? as in, I can't just stick it on an AI driver in a dynamically created car?

warm hedge
#

No

#

...I mean, yes. Which vehicle doesn't matter, AFAIK

sullen sigil
#

oh

#

sweet

#

is there any benefit to keeping fps for it at 20? 5mb of data just for movement is a bit much πŸ˜…

#

i.e it interpolates between points right

gusty forum
#

Hey, does anybody have a script that can be put into hold action complete, which will remove the object?

#

Tried this:
deleteVehicle _this;

#

but that didn't work. It only works if I give the object I want deleted a variable name (hedgehog1) and put this into the hold action complete:
deleteVehicle hedgehog1;

#

It works on a small scale, but on a large scale it's gonna get too tedious setting the variable name for each singular hedgehog and changing the target every single time

warm hedge
#

_this#0 refers to the target object

warm hedge
sullen sigil
#

i will find out

hallow mortar
sullen sigil
#

yeah framerate of 2 gets really noticeable on corners

#

not only that but it makes the wheel screeching much longer for some reason too lmfao

undone flower
#

anyone got an up to date syntax highlighter for VSC/notepad++?

sullen sigil
#

sqf-vm, hemtt etc

vital silo
#

Hello

#

How can I add this filter to befilters?

#

This dont work

winter rose
proven charm
#

im having trouble disabling collision with the player object. my code: ```sqf
_pobj = createSimpleObject ["Land_Plank_01_4m_F", getposASL player, true];

_pobj disableCollisionWith player;
player disableCollisionWith _pobj;```

hallow mortar
#

You don't need to do it both ways. The command already does that.

flint topaz
#

To my knowledge your issue is that you are trying to disable collision with a simple object and the player

sudden yacht
#

Question how do i detect if a player has intel, like a laptop in his inventory, or files?

flint topaz
#

try createVehicle

hallow mortar
polar belfry
#

hi need help with cfgsounds

sudden yacht
#

ty

hallow mortar
polar belfry
#
class CfgSounds
{
    sounds[] = {};
    class burst_missile_global_sfx
    {
        name = "burst1";
        sound[] = {"burst_missile_global_sfx.ogg", 1000, 1, 10000};
        titles[] = {0,""};
    };
};

I want to make my sound play over 10km and be heard from within planes

#

I run this command from a composition
playSound "burst_missile_global_sfx";

#

should I do it within the
forEach playableUnits;

hallow mortar
#

playSound isn't a positional command. It will indeed be audible at over 10km; it will be audible everywhere as if it was transmitted into the player's brain.

#

Also, the volume setting is capped at 5.

proven charm
proven charm
polar belfry
hallow mortar
# polar belfry since I run it in a custom composition so it's local compared to a trigger shou...

If the custom composition is being placed by Zeus, then it is local and you'll need to remoteExec it to the relevant units. I would suggest doing it outside of any forEach and instead just use playableUnits as the remoteExec locality target.
If the custom composition is being placed in the Editor, then it is not local-only - init fields will be executed on all machines same as any other Editor-placed objects.

polar belfry
#

I'll post a pastebin

hallow mortar
#

Again, playSound is not a positional sound. When you do this, all players will hear the sound without any sort of 3D simulation - it will be as if it's projected directly into both ears at point-blank range. If that's what you want then OK, but some players may find this jarring.

polar belfry
#

I had someone tell me that the sound while I was testing in zeus the sound was getting fainter and fainter

polar belfry
hallow mortar
#

Yes, if you want everyone to hear the sound.

polar belfry
#

thanks

#

will do

#

the sound is meant to be deafening

hallow mortar
#

Well, it will be equally deafening literally everywhere on the map, and it will always sound like it's coming from inside your head. There is no positional simulation, no speed of sound simulation, and no maximum range.

polar belfry
#

so the 10000 in cfg sounds wasn't needed

#

since I use playsound

hallow mortar
#

It doesn't make any difference at all when using playSound because it is a non-positional command (you might have noticed you don't provide any position as part of the command syntax)

polar belfry
#

yes

hallow mortar
#

The description.ext CfgSounds distance values are only used when using say3D without specifying any overrides

polar belfry
#

how would it work with say3d

#

the position name is _newpos1

hallow mortar
#

say3D doesn't use positions. It's used to make objects project a sound. You would need to create a dummy object at the position.
The alternative would be to use playSound3D, which does use positions, but doesn't use CfgSounds.

polar belfry
#

["burst_missile_global_sfx.ogg", 0 , false ,_newpos1, 5, 1 , 10000 ] remoteExec ["playSound3d", 0];

the 0 is where the object is

#

I don't have an object but I have a position which is _newpos1

undone flower
#

is there an elegant way of defining if a vehicle uses Dynamic Loadouts?

#

because i'm using getAllPylonsInfo, if it returns !isNil, then it is a dynamic loadout vehicle trollface

undone flower
meager granite
#

command never returns nil

undone flower
#

i'll take a look at the cfgs to see if I can use any hint from there

meager granite
#

The proper way would be a config check

#
isClass(configOf _vehicle >> "Components" >> "TransportPylonsComponent")
undone flower
#

ty

hallow mortar
hallow mortar
brave venture
#

I return in search of more answers.
Im trying to use attachto to put an object on a door. How do I get the doors memory point?

hallow mortar
# proven charm selectionPosition

That will return the modelspace position of the memory point once you have it (not actually useful for attaching things to the memory point). It will not help you get the memory point to begin with.

proven charm
#

the names are like Door_1 , Door_1_trigger, etc

proven charm
#

i have ```sqf
private _pos = _bldg selectionPosition format [_x, _doorIndex];
private _doorpos = _bldg modelToWorld _pos;

#

maybe my code is buggy then lol

hallow mortar
proven charm
#

ah ic, im mixing mempoints and selections then

hallow mortar
#

Same thing for this purpose

#

The real answer to this question is to either use selectionNames and code in the selection you want to attach the object to (easiest, harder to do dynamically for different objects), or use something like lineIntersectsSurfaces to get the selection the player is currently looking at (pain in the ass but doesn't need hardcoded selection names)

proven charm
#

wouldnt attachTo to work with the offset instead than memory point? using selectionPosition as the offset

hallow mortar
#

That would attach the object to the position of the door but not to the door.

proven charm
#

right

hallow mortar
#

It would still be attached to the main part of the parent object and wouldn't move with the door when it's opened or closed.

proven charm
#

yeah would have to run loop or something to update the pos. unless there is no way getting open/closed pos

#

there is Door_1 , Door_1_trigger, Door_1_axis but i forgot what each one doesπŸ™‚

proven charm
undone flower
#

can someone shine a light into this issue i'm having once again?
I have a function that adds a magazine to the turret of a vehicle once its current magazine runs out of ammo.
it works well until, for example, I spend all the magazines in a tank (HE, AP, HEAT)
after that, every single shot adds another magazine to the turret

#
if (_thisvehicle magazineTurretAmmo [_magazine, _thisvehicle unitTurret _gunner] == 0) then {
        systemChat "No ammo on this mag!";
        _currentTurretPath = _thisvehicle unitTurret _gunner;
        _thisvehicle addMagazineTurret [_magazine, _currentTurretPath];
    };
#

for some reason, this condition is always satisfied even after reloading with a new magazine created by addMagazineTurret

undone flower
#

it is as if the Fired event handler's _magazine refers to the old, empty magazine

undone flower
#

finally, that did it. thank you removeMagazineTurret

#

fixed statement:

if (_thisvehicle magazineTurretAmmo [_magazine, _thisvehicle unitTurret _gunner] == 0) then {
    systemChat (format ["No ammo on this magazine: %1", _magazine]);
    _currentTurretPath = _thisvehicle unitTurret _gunner;
    _thisvehicle removeMagazineTurret [_magazine, _currentTurretPath];
    _thisvehicle addMagazineTurret [_magazine, _currentTurretPath];
};

if someone finds or knows a better way to do this let me know

#

"why not just set ammo to 100%/max value/etc" - that's because I want to force a reload, if anyone asks

brave venture
tame bison
#

Hello, please tell me how to specify the radius?
instead of 100 (_pos1 select 0)

_tomove = [14734.5,16693.3];    
_pos1 = [100,[15166.4,16726.5,0]];
_pos2 = [250,[14665.7,16213.3,0]];    

private _near = [];
{
_near append nearestObjects [_x, ["LandVehicle"], 100, true];

    private _arr = nearestObjects [_x, ["LandVehicle"], 100, true];
    {
        if (_x isKindOf "LandVehicle") then {                                    
                    _x setVehiclePosition [_tomove, [], 50, "NONE"];
        };                
    } forEach _arr;
} forEach [(_pos1 select 1),(_pos2 select 1)];    
abstract bay
#

As I wrote somewhere yesterday that I want the soldiers to move towards a certain point when the number of the group is less than 8 soldiers. I have the code in the trigger and it works perfectly, but how can I transfer this code to the script if there is no condition? I do not understand. Condition: ({alive _x} count units nato_units1) <8 and On Activation {_x doMove (getmarkerpos "mk1")} foreach units nato_units1; nato_units1 setSpeedMode "FULL"; nato_units1 setBehaviour "AWARE"; nato_units1 setCombatMode "YELLOW";

fair drum
mental badger
#

how regulate a trigger sound? I need a radio with music for a mission and, when i spawned to test a few things, the trigger "radio" is fucking loud.. how fix it?

bleak gulch
#

you want to replace 100 to _pos1# 0?

#

why not just pass the whole var to the forEach?

#
{
    _x params [_radius, _coords];
} forEach [_pos1, _pos2];
grim cliff
#

hey does anyone know if it is possible to create config files on the fly?

im digging through a mod that has thousands of configs that are needlessly bogging down loading times, so i wanted to look into creating them only as needed, thus allowing the mod to work right but not have a bunch of data that another dynamic server mod is pulling from and literally barfing out these ghost items that the player cant see the useable items through

#

the config.cpp is literally 99383 lines

warm hedge
#

If I understand your goal, here is what you'll get:

  • will reduce no config load time, but only increase
  • yes it's possible to hide or even delete some of things using a Mod
  • there is no way to load dynamically created config
  • loading data (as in, models or textures or such) does not increase config load time, are different things
bleak gulch
#

you can update config in the dev branch

proven charm
#

whats the best way to make something happen on key press knowing that the key is not mapped to some action?

still forum
still forum
# bleak gulch it adds empty expression

Without semicolon:

"endExpression
push 2
push 3
callOperator +;
assignToLocal _result;
endExpression
getVariable _result;
"

With semicolon:

"endExpression
push 2
push 3
callOperator +;
assignToLocal _result;
endExpression
getVariable _result;
"
still forum
tame bison
bleak gulch
#

hm

#

It was believed at one point that the returning statement should not have a semicolon ; after it; this is false and having a semicolon does not change anything and is recommended.

bleak gulch
still forum
#

diag_dumpScriptAssembly command is available to look at the assembly.
But the expression end marker is just empty string in that one

proven charm
#

cant figure why I cant (fully) disable collision between player and object : ```sqf
private _pobj = createSimpleObject [placingObjType, [0,0,0], true];

player disableCollisionWith _pobj;

bleak gulch
#

It seems you're using 'local' parameter, but if that code executed on the dedicated server, it will fail.

proven charm
#

all is local right now (from the editor)

#

i tried also private _pobj = createVehicleLocal [placingObjType, [0,0,0], [], 0, "CAN_COLLIDE"]; but same effect

bleak gulch
#

"CAN_COLLIDE" disables checking with the other objects at the creation time

proven charm
#

yeah i know

bleak gulch
#

is player not null?

proven charm
#

yeah its fine

bleak gulch
#

probably this one: this command does not disable collision between PhysX objects

#

not sure

proven charm
#

hmm i was thinking the same but it seems to work on editor placed object

bleak gulch
#

well, I placed Sun Chair in the Editor and disableCollisionWith removes collision partially

#

it still is in effect somehow

proven charm
#

yep im getting the same result. I can walk thru the plank object but I can also walk over it.....

bleak gulch
#

also it behaves differently for the truck (C_Van_01_fuel_F) - it works perfectly, I can go through the truck model but for some reason Land_Sun_chair_F allows me to walk over it and even ramp up πŸ™‚

#

same results)

#

need some clarifications

proven charm
#

looks like a bug, partially disabled collision

#

or in other words player's feet-ground contact code doesnt take disabled collision into consideration

bleak gulch
#

Also I tried to climb on the truck with

player setPosATL ((getPosATL player) vectorAdd [0, 0, 3]);

but the collison doesn't work

proven charm
#

yea it seems its the objects top surface that prevents player from falling through even collision is disabled

bleak gulch
#

yep

undone flower
#

is it possible to get a vehicle like the Slammer's Eden editor class?, it would, for example, be "Tanks"

#

I'm trying to make a script that classifies vehicles, however, they're a total mess to classify using isKindOf as some APCs are tanks, some aren't. blufor MLRS is artillery but of the MLRS type, Zamak is also rocket artillery but MLR type

#

oh yes editorSubcategory

#

that should work

fair drum
undone flower
#

editor subcat is much more reliable, much better for mod compatibility too

#

that if they use the same category

cosmic lichen
#

Really depends on what you want to achieve.

#

Not all mods use the same categories.

viscid anvil
#

Hi, I want to allow users to configure my mod. is there a native way to do it?

#

I'm trying to avoid cba_settings here

undone flower
undone flower
#

but cba is by far the best and pretty much everything depends on it

#

and very simple to use too

viscid anvil
#

@undone flower
so to clarify, arma has built in support for function comilation but no native mod configuration

undone flower
#

i'm afraid you'll need to come up with a solution yourself because I recall trying to not depend on cba a few years back

#

but it's too much effort and bloat

#

so I just used cba

sharp grotto
modern osprey
#

Hi. Tell me please. How do I remove certain vehicle from the radar?

bleak gulch
viscid anvil
bleak gulch
#

back in the days Arma community used

<ARMA_ROOT>/userconfig/your_mod/your_config.hpp

files to configure the mods

#

it is just SQF file (a header) with global variables which was parsed by your modification and the used as settings

#

This way has its own downsides

#

Users prefer fancy GUI over dealing with text files which are very sensitive to misstakes and spelling

#

And it is potential security breach. Because client has to turn of -EnableFilePatching option (and it must be allowed on the server).

#

without that option client cannot load code outside the packed (and signed) .PBO files

viscid anvil
#

In short, its better to stick with cba for now

bleak gulch
#

If you don't want to use CBA, you still have an option to use userconfig or implement your own mechanism

#

100% better unless you need something very specific

viscid anvil
#

got it, thanks a lot

bleak gulch
#

alternatively, make your own GUI which stores options into user profile

hallow mortar
rocky cairn
#

Anyone aware of an A3 script for a notebook similar to the one ACE 2 had?

spring stone
#

What exactly do you want to achieve (haven't played ACE2 for years)

rocky cairn
#

I'm working on a mission where a squad has to do battle damage assement on a crashed jet and I want to give them a proper form that needs to be filled out. Something to make them hang around while under fire

indigo snow
#

Theres a mod out there that lets you fill in a notebook, 9 liners, 6 liners etc

spring stone
#

Mhhh, sorry I don't remember having seen something like that

rocky cairn
#

@indigo snow Do you iknow the name of that off the top of your head?

indigo snow
#

got you one better

spring stone
#

9Liner ^^

rocky cairn
#

Thanks

indigo snow
#

seems like the notes get saved to profileNamespace so you can parse what they wrote down as well

rocky cairn
#

cool

bleak mural
#

general question: are add actions applied to units,such as an add action to recruit a unit with a distance of 5 meters, heavy on performance if applied to many units?

#

and does dynamic simulation have any effect on an add action in this case if so?

little raptor
# bleak mural general question: are add actions applied to units,such as an add action to recr...

No. It's just a distance check, when you look at the unit (the condition is also checked once you're close enough)
But instead of that you can also add the action to the player himself and use cursorObject in the action condition to check if a unit is recruitable (it won't make much difference in terms of performance, but it's easier to handle than having potentially hundreds of actions)

bleak mural
#

in this case my units recruitable need a name in the addaction though

#

"co pilot" for example

#
this addAction 
[ 
"Recruit co pilot", 
{ 
  { 
     [_x] joinSilent group (_this select 1); 
     _x removeAction (_this select 2); 
  } forEach units group (_this select 0); 
}, 
[], 
5, 
true, 
true, 
"", 
"_this distance _target < 3" 
];
#

but if no hit on performance il use this way, only about 25 potential units to go through

icy igloo
#

what would the script be in order to fold the wings on aircraft

little raptor
#

nvm that was for comms stuff πŸ˜…

little raptor
icy igloo
#

Got it, preciate

bleak mural
#
h1 addAction ["Open side door", {  h1 animateDoor ['door_R',1];   
h1 animateDoor ['door_L',1]}]; 
   h1 addAction ["close side door", {  h1 animateDoor ['door_R',0];   
h1 animateDoor ['door_L',0]}]; 

#

not sure why actions like this arent default Arma3

#

as far as i recal even the Ifrit had anims for its boot(trunk)

hallow mortar
bleak mural
#

....or maybe its full of storm troopers and Darth vader is opening the doors for them πŸ˜‰

#

beauty of Arma aye

#

no limits

vague bane
#

SOO - I have a mission, Sound files and a small script to stop the death when you spawn - when i put them both into the ext they dont work - Whats wrong with this? 😭 πŸ˜‚

#

The sound files in my sounds folder and all thats set

#

(both bits work fine on their own but having them both in here breaks them both)

hallow mortar
#

In what way does it break?

#

Those two items can coexist perfectly fine in description.ext and I don't see any issues with how they're written there

vague bane
#

The respawn on start still makes me respawn and then the sound rubble comes up as not found - Theyre wrote the same on the mission, like i say they work fine individually they just dont like being there together

hallow mortar
#

if:

  • your sound is located in the Sounds folder inside your mission folder and is called rubble.ogg
  • this is the only text in your description.ext file
  • your description.ext file is actually called exactly description.ext, not description.ext.txt or something like that
  • your code is correctly looking for the "rubble" cfgSounds class (that is, using a command that looks at cfgSounds rather than say playSound3D)
    then there shouldn't be any problem.
vague bane
#

But surely if any of these was the issue the sound file wouldnt play if its isolated right? i took respawn on start out to test if maybe i wrote something wrong and it works just fine - Upon second test the sound file works W/ Respawn script - but the respawn script seems to not be recognized, confused as to why lmao - Heres the mission file, afaik everything works just fine

hallow mortar
#

The description.ext is correct in all aspects.
The mission.sqm file is binarized so I have no idea what's happening there (that contains everything you've done in the Editor)

vague bane
#

Thats why im confused lmao - As far as i see, it should work, but, well, it doesnt lmao, Im no code guy lmao

viral yew
#

Is there an modelToWorld command with a position instead relative to an object?

half sapphire
#

hey guys. in a bit of haze here. the "playerViewChanged" event handler, ON DEDI. i was oh so sure i could use it for an auto view distance script. but it does not seem to recognize vehicles i go in until i drive them (take ownership)... which completely ruins the concept for me.
i've tried adding the event only to the server, nothing works (the "mission" event handler part made me thing it was.... well, to only be added to whoever is running the mission).
then i've tried adding globably. now i get the afore mentined ownership issue.
help???

#

also noticing objectParent suffers from something similar. returns the player if exec localy, and the vehicle if exec on server (all playable units are var named [s1, s2, etc])