#arma3_scripting

1 messages · Page 530 of 1

tropic linden
#

does anyone know if object publicvariables are ready (in multiplayer) before or after the objects init callback is called?

tropic linden
#

yeah this is not the thing

#

the mission is already completely initialized

winter rose
#

yup

still forum
#

Afaik they aren't ready. And you don't know when they will be

#

set a variable at the end after all your other pvar's were sent off, and then clientside do a waitUntil isNil on it

#

the order of pvar's is kept

tropic linden
#

i can't use waituntil in the init EH can i?

#

not that it is a problem spawning i guess

delicate lotus
#

How does ArmA actually handle respawning internally? Currently looking through most of the respawn templates and I can't fire anywhere an entry that contains information on how the unit gets respawned.

Is just a new unit created and player moved into that?

astral dawn
tropic linden
#

is that the same thing as the event handler?

astral dawn
#

Event handler is also unscheduled

#

It would make no sense to be able to waitUntil (block mission startup) in the init field

tropic linden
#

ah yep that'll be it

#

i decided to spawn it anyway, although i admit i don't like the idea of spawning a few hundred of these

#

i'm too lazy to set up some kind of manager haha

astral dawn
#

should be fine

#

scripts wait until, execute and scheduler is empty again

tropic linden
#

it's only really persisting these on the clients anyway, i'm sure they have plenty of spare cpu

astral dawn
#

Afaik they aren't ready. And you don't know when they will be
We don't know? This sucks. I guess for that reason remoteExec is better, because at least I know when it will be synced up?

#

Yes and scheduler can't load your CPU much anyway

#

it gets 3ms from each frame

#

max

tropic linden
#

that is not a lot of time

#

glad i optimize early lol

astral dawn
#

what do you need to initialize in vehicles that depends on some state dictated by the server? It smells like the right job for remoteExecCall

tropic linden
#

just a random setting for initializing what sort of lights these things have

astral dawn
#

well... remote exec call is a better thing for synchronizing persistent things

#

you can attach it to a specific vehicle object, with specific data and function call, and it will synchronize for JIP players

#

and for those who are online already, whatever you do

tropic linden
#

so it's an executed function and not a publicvariable?

astral dawn
#

function, executed with the data you set it to execute

#

and it will be passed to the function and executed when someone joins

#

you can also remove these things from the queue

tropic linden
#

yeah i probably should have used that.. ah well, publicvar should be alright here so long as you don't mind the silly spawning of functions for every object init'd

#

if it was something more complicated in nature i'd probably rewrite it but eh

#

my mission is already moving really slowly in terms of development

tough abyss
#

I'm having a little conundrum, I'm trying to include death sounds to AI, but when I have a trigger execute 'unit say3D "deathSound";' it won't play because the unit is dead and the game ignores that variable, is there anyway around this?

#

Try trigger as argument instead of unit

#

can i get an example of how to go about that? sorry for my incompetence, im still kinda new to this

#

What your trigger is called?

#

when i execute that same line through the debug console when the unit is alive, it works, but when he is dead it wont play

random crescent
#

go to cfgsounds, look up what file is played and use playSound3D

tough abyss
#

do i type something like 'playSound3D ["deathSound", unit, false, getPosASL unit, 1, 1, 1000]'

lavish ocean
random crescent
#

playSound3D ["path\to\death\sound", unit] is enough

tough abyss
#

i have "dearthSound" as the name for a class under CfgSounds and i have tested it with "playSound" and it works, i just need to have it play when the unit dies, i'll try playSound3D and see how that goes

#

no luck

random crescent
#

playSound3D needs a file path though. you can look up the file path in the config. i already told you that in my first reply.

tough abyss
#

oh wait i see now

#

sorry

#

i thought i could use the name

cunning crown
#

Hey, is there any framwork like CBA for key handling that behaves like the default one from Arma (so support for Left_CTRL, Right_CTRL, Double keys, ...)? I know that I can use Custom User controls but there's only 20 of them. Can't add more since those are partially defined in the engine (or can't find all files related to them with extensive search). Searched everywhere and can't find anything.

tough abyss
#

is it saying to place that text in description.ext?

#

im kinda confused

random crescent
#

@cunning crown why not CBA?

cunning crown
#

Doesn't make the difference between Left and Right Alt/Shift/Control, can have 2xKey nor Modifier+2xKey, etc.

random crescent
#

oh, gotcha

#

not even trying to shill CBA here, but it's most likely the most fleshed out system you're going to get.

cunning crown
#

Well, no choice to continue to figure out how to do it myself then xD Too bad Arma doesn't have a system for handling that the same way default controls does :/

random crescent
#

you can bind right and left ctrl and alt as their own bindings, just not in combination with other keys it seems

tough abyss
#

So I'm reading through the playSound3D wiki page (https://community.bistudio.com/wiki/playSound3D), and at the bottom it shows how to get custom sounds to work (im using custom sounds), but i'm kinda confused on how to properly go about that

cunning crown
#

@random crescent Unable to do that in CBA, modifier must be with another key.

hollow lantern
#
target1 = "LaserTargetW" createVehicle (getpos vehicle player);  
blufor reportRemoteTarget [target1, 2500];  
VALOR_VLS fireAtTarget [target1,currentWeapon VALOR_VLS];  
``` anyone can help me out? The VLS seems to be unable to seek the cruise missile into the target. The missile will just fly over the target straight forward and that's it
random crescent
#

it might not have locked it yet because you immediately fire

#

i'd not even fool around with that because AI

#

try this

hollow lantern
#

ok

digital hollow
#

I had the same issue. garbage collector deletes your laser target while the missile is in flight. use removeFromRemainsCollector

hollow lantern
#

doesn't work, Garbage collector still deletes it in flight. But a attachTo workaround does the job

#

so attach the laser to a object e.g. a crate

tough abyss
#

First time I hear that remainscollector deletes anything other than dead bodies and wrecks (probably because it is not true)

idle obsidian
#

Hi! I need to print coordinates of an object into a .txt file. Does anyone know how to do this?

cunning crown
#

extensions

tough abyss
#

This ^^^

idle obsidian
#

Thanks! Will try)))

digital hollow
#

Something was deleting mine. A deleted EH would fire about 10 seconds after it was created.

tribal stump
#

Anyone use Tedho's infantry capture script? Need some help.

sour island
#

I'm getting an error on this before COMBAT, am I missing something obvious?

waitUntil {behaviour nco_01 == "COMBAT"};
this setcaptive TRUE;
tough abyss
#

what the error says?

sour island
#

waitUntil {behaviour nco_01 |#| == "COMBAT"};
this setcaptive TRUE;
generic error

tough abyss
#

You cannot waitUntil in unit init unless you spawn it

sour island
#

Ohhh ok, how do I do the spawn thing again?

tough abyss
#

again?

0 = this spawn
{
    waitUntil {behaviour nco_01 == "COMBAT"};
    _this setcaptive TRUE;
};
sour island
#

It's been fucking ages since I've scripted, thanks

tiny wadi
#

Is it possible to change the size of a listbox dynamically? The same way the action menu changes size up until about 5 options I believe

tough abyss
#

ctrlSetPosition, ctrlCommit

still forum
#

@cunning crown if you think CBA not differentiating different ctrl/shift and so on maybe create a ticket on github.

tough abyss
#

anyway to make a trigger repeatable, but should only activate again once the whole execution of the code is finished?

still forum
#

set a variable at the start of your code

#

then delete it at the end

#

and add a isNil check to your trigger condition

cunning crown
#

@still forum Well the problème come more from the keyDown EH. But yeah, I'll try to create a ticket when possible.

#

To be exact, onKeyDown gives different keyCodes for left/right modifiers but treat them as the same for the modifiers states. Same goes for onKeyUp.

wispy cave
#

I need to know whether any player is within a given distance of a given object, currently I'm using a foreach loop with an exitwith in it. Is there a more efficient way? Code I'm using:

private _noPlayersClose = true;
{
    if ((_vehicle distance _x) < PARAMS_VehicleRespawnDistance) exitWith {
        _noPlayersClose = false;
    };
} forEach allPlayers;```
cosmic lichen
wispy cave
#

tnx

queen cargo
#
private _noPlayersClose = (allPlayers findIf {
    _vehicle distance _x < PARAMS_VehicleRespawnDistance;
}) == - 1;
wispy cave
#

thanks

still forum
#

Not sure if better performance wise but it might be.

private _noPlayersClose = (allPlayers inAreaArray [position _vehicle, PARAMS_VehicleRespawnDistance, PARAMS_VehicleRespawnDistance]) isEqualTo [];
queen cargo
#

chances are quite high i would say

still forum
#

Assuming that usually there are no players close, and findIf would have to iterate all players. This should be faster. But if findIf exits early then probably not

wispy cave
#

Usually there will be players close

surreal peak
#

Does isEqualTo run faster than just doing ==?

#

on school wifi so cant check as BI is blocked

spice axle
#

Yeah but it is case sensitive

tiny wadi
#

Thank you @tough abyss

hollow thistle
#

Also it behaves differently in case of different types.

#

== will error out on diferent types

#

isEqualTo will return false

surreal peak
#

what do u mean case sensitive @spice axle ?

hollow thistle
#

"aAaA" == "aaaa" true

#

"aAaA" isEqualTo "aaaa" false

spice axle
#

this

surreal peak
#

ahhh

wispy cave
#

Is it possible to have a kick message if you use serverCommand?

cunning crown
#

#kick [PLAYER #] (REASON) on BE's documentations. You could try that but iirc, Arma doesn't allow to kick/ban with a reason from SQF (without extensionsextension)

tropic linden
#

well that was more work than i would have liked.. cfgmagazines are a mess for classifying what bullets are tracers and which are not

#

a bunch of magazines are labelled tracer, some are reload tracers, some are not.. some use the same projectile name as tracers even if they aren't tracer projectiles lol

#

i now have a script attempting to guess which they are by running through all the weapons in my mission

#

of course when someone is hit, i have to actually go back to the firer and check his magazine instead of using the projectile

#

i just hope it's not going to be too sluggish

ionic beacon
#

Got a script that forces a loadout on players. Everything is working except for pistol attachments...

_unit addweapon "rhsusf_weap_glock17g4";                        
_unit addSecondaryWeaponItem "rhsusf_acc_omega9k";
_unit addSecondaryWeaponItem "acc_flashlight_pistol";```
The ```addSecondaryWeaponItem``` aint adding those 2 attachments(silencer, flashlight) to the rhsusaf glock. Any idea why or if i should use a different command?
tropic linden
#

would assignItem work?

#

_x assignItem "acc_flashlight_pistol";

ionic beacon
#

for the primary weapon its "addPrimaryWeaponItem" so i figured secondary might do the trick and it is a valid command, i guess i can try with assignitem next

tropic linden
#

maybe even linkitem

#

i'm not sure i understand the difference between the two

random crescent
#

secondary is the launcher

#

its stupid

tropic linden
#

haha

ionic beacon
#

oh my...

random crescent
#

i'm not sure i understand the difference between the two
linkItem is for all the stuff in other slots, like the map, compass, etc

winter rose
#

@ionic beacon
1/ enable -showScriptErrors
2/ when in doubt, read the wiki 😛

ionic beacon
#

do have it enable, wasnt giving me an error.
Was on wiki but of course i missed the command like an idiot

winter rose
#

ok np 😉 (and yes it wouldn't give you an error as this one is a valid (but incorrect in this case) command)

cosmic lichen
#

Does ctrlSetStructured text work with RscHTML?

swift lynx
still forum
#

There is an error. no there isn't

#

where are you adding the eventhandler?

#

maybe you need to remove the select 0 on _killer

swift lynx
#

init.sqf

still forum
#

Ah... That (_killer select 0) is nonsense

#

should be without parenthesis

cosmic lichen
#

Always a good idea to put some diag_log or systemChat inbetween lines. That way you can see at which line your code fails @swift lynx

#

Btw. does it need to run in init.sqf?

#

What the locality of addMissionEventHandler command?

still forum
#

local

#

afaik EntityKilled fires everywhere

random crescent
#

i just noticed that this channel's description contains code with a syntax error. seems quite fitting.

still forum
#

that's what this channel be about

#

ze errörs in za scrhpt

proper flower
#

Can someone help me with a script for starting mission unconscious then waking up?.. I’ve set up a heli crash site & want to start from there.. it’s been a while & ive lost my scripting skills, thanks guys

wispy cave
#

What's more efficient, a while true loop or a recursive function (fnc being spawned, not called)?

forest ore
#

What is correct way to add overcast in "Server overcast is %1" remoteExecCall ["hint"];?
I mean remoteExecing this hint format ["Server overcast is %1", overcast];

tough abyss
#

format ["Server overcast is %1", overcast] remoteExec ["hint"];

forest ore
#

So that way 🙂
Thank you M242 for the fast response 🙏🏼

signal kite
#

Hello, I try to get the vehicle deleted when reaching the waypoint, but it just stays there. Any hints? (Also I don't know how to properly format code in here - sorry)

[{
private _vehicle = "LIB_Kfz1" createVehicle [0,0,0];
createVehicleCrew _vehicle;
private _grp = group _vehicle;
private _wp = _grp addWaypoint [[0,0,0], 50];
_wp setWaypointStatements ["true", "{_vehicle deleteVehicleCrew _x} forEach crew _vehicle;
deleteVehicle _vehicle;"] ;}, [], 1] call CBA_fnc_waitAndExecute;

tough abyss
#

No _vehicle will be undefined.

#

Look up biki what arguments are passed to waypoint script

winter rose
#

@proper flower see setUnconscious 😉

proper flower
#

Ok.. I thought that was for staying unconscious.. will the guy get up with this?

winter rose
#

setUnconscious true then false yes

proper flower
#

Thanks

sour island
#

This script is playing my sound file, but it cuts out after 1 second. Any ideas?

MISSION_ROOT = str missionConfigFile select [0, count str missionConfigFile - 15];
bike1 addAction [ "CRANK THE TUNES", {   
playSound3D [MISSION_ROOT + "borntobewild.ogg", bike1];  
 },   
 [],   
    1.5,    
    true,    
    true,    
    "",   
    "true",  
    1,   
    false,   
    "",   
    ""   
]; 
mint sand
#

what happens if you change that 1 above false to like 216

#

@sour island

cunning crown
#

That's the radius of the addAction

mint sand
#

oof my bad

craggy adder
#

Does it cut off when riding or when sitting still?

keen bough
#

how can i make the AI look into a specific direction after it reaches its destination waypoint?

craggy adder
#

Because the point of sound creation is fixed and you may be riding away from it, I think

sour island
#

Sitting still

craggy adder
#

hmm

cunning crown
#

@keen bough lookAt

sour island
#

Here's my description.ext

{
sounds[] = {borntobewild,barmusic};
class borntobewild
    {
        name = "borntobewild";
        sound[] = {"borntobewild.ogg", db+15, 1.0};
        titles[] = {0,""};
    };
class barmusic
    {
        name = "barmusic";
        sound[] = {"barmusic.ogg", 150, 1};
        titles[] = {0,""};
    };
};
#

They're different because I noticed different syntaxes for the sounds in there so trying to figure out what works

keen bough
#

@cunning crown is there a possibility i can tell them to lookAt a specific direction instead of a pos/object? because setDir was too fast and the waypoints are not generated at the exact position.

Or should i make the waypoints bigger so they are completed instantly? Like a radius of 5 meters?

mint sand
#

could you use this?
playMusic "borntobewild";
I am not sure if just adding it in cfgSounds adds it to the music in game though

sour island
#

I want it to project from the bike itself

mint sand
#

ohhh

#

i misunderstood

cunning crown
#

@keen bough getRelDir

keen bough
#

ah! nice, yeah, thanks!

mint sand
#

I am working on a custom version of antistasi on takistan. I am trying to up the variety of vehicles that are able to be bought, the way I first thought to approach this was by setting the vehicle variables (usually like vehSDKAT or something like that depending what kind) to an array rather than an object.

I have successfully made it so a random vehicle from the array will spawn when you buy them, but have run into an issue with the way pricing works.

So prices are stored via setVariable and are called by the vehiclePrice function like so;

_tipo = _this select 1; _coste = server getVariable _tipo; server setVariable [vehSDKTruck,300,true];

obviously this will return 300 for the price of a truck, BUT in my new system it returns an error, as Arrays are NOT supported by setVariable unfortunately.

Any ideas how i can get around this?

cunning crown
#

Wait no, what I said is wrong, sorry

keen bough
#

already saw it ^^

cunning crown
#

getRelPos maybe

sour island
#

I've tried Say3d too, but same thing happens

keen bough
#

yeah, i dont wanna define extra position for the ai to look at in my generator. I think i try the waypoint radius thing

cunning crown
#

well just using %UNIT% lookAt (%UNIT% getRelPos [100, %DIRECTION%]) should work

sour island
#

I wonder if it's just the sound itself, I used Audacity to degrade it down to 400kb for a full song

keen bough
#

ah, that sould do it, i will test it @cunning crown

#

haha, nope, the ai just doesnt want to look XD

sour island
#

Huh. I went from .ogg to .wav and now the sound works

mint sand
#

glad you got it fixed

cunning crown
#

@keen bough Are you sure that everything is done correctly?
Just tried that and works perfectly fine for me:

[] spawn {
    myDirection = 0;
    while {true} do {
        myDirection = myDirection + 10;
        myUnit lookAt (myUnit getRelPos [100, myDirection]);
        sleep 1;
    };
};
sour island
#

Well sorta. It looks like if you try to get the filesize too low it doesn't want to work any more.

proper flower
#

Ok I got my guy to start mission unconscious but how do I get him to get up my script is : player setUnconscious true; sleep 3 .. I tried adding false but still didn’t get up... any help

keen bough
#

got it. I had to use "setFormDir" @cunning crown

sour island
#

Also the sound doesn't stick to the vehicle

#

Using Say3d fixed it for now, but I'll have to mess with getting the file under 22mb. I had it at 400kb, but it was cutting out after 1 sec

mint sand
#

22mb or 2.2mb?

slim oyster
#

Is there a way to get selectionPosition/position of memory points in a weapon?

still forum
#

the only commands to get positions work on objects, and you cannot get...... 🤔 .... mh... actually. Maybe you can createSimpleObject the weapon and then use the commands on it

proper flower
#

Can someone help me with getting out of setUncoscious.. I can start but I never get up

mint sand
#

@sour island try converting to m4a or mp3 or something, wavs are huge uncompressed, but compressing to 400kb is a bit excessive, you can get an mp3 or something to like 4-8 mb

sour island
#

I didn't know Arma took mp3s, ok

#

Is there a volume limit for the sounds? 1 is inaudible after 20m, and there's no difference between 100 and 500 volume (as defined in description.ext).

#

mp3 doesn't seem to work

sour island
#

Got it all working with .ogg files and say3d, now I need to figure out how to stop it from playing when I want

slim oyster
sour island
#

Is there something like forceAddUniform for goggles,headgear, and facewear?

winter rose
#

@sour island no, as there is no need

sour island
#

Well I have civvies wearing berets and goggles in the editor, but they won't wear them in multiplayer

#

I guess what I meant was is there a way to ignore the uniform restrictions?

winter rose
#

@sour island there is -no- headgear/goggles/facewear restrictions, only uniform ones

Your issue may be related to randomised headgear

sour island
#

Ohhhh ok, I forgot about that.

#

I tried this
this setVariable ["BIS_enableRandomization", false];
but they're still not wearing the same gear they have in the edtior

cosmic lichen
#

@sour island Have you tried ```disableRandomization[] =
{
//"AllVehicles", // No randomization at all
//"Air", // No randomization at all for air vehicles
//"land", // No randomization at all for land vehicles
//"Ship", // No randomization at all for sea vehicles
"air_f", // There won't be any randomization on every air vehicles
"C_Hatchback_01_F", // No random on Hatchbacks
"truck_withoutRandom" // No random for this given vehicle
};

sour island
#

I moved on to another project for the moment haha but I'll give that a try

#

I'm trying to see if there's a way to get weapons to attach to unarmed vehicles, in this case a motorycle from gac JSDF. I've tried some different things, including addWeaponTurret and also just spawning a 40mm from a point on the vehicle with an addAction, but nothing seems to work.

#

Alternatively, if we could get a gunner seat scripted onto the bikes, that would be good too.

sour island
#

@cosmic lichen I tried that, but no dice. I'm wondering if adding ACE into the mission will have any effect on the AI not wearing hats and goggles

prisma glade
#

Alright Arma scripting community, I heard you guys are good at this. I have a problem.
I'm making a side-mod to Operation: Trebuchet, that features a script that switches specific vests and helmets into a different variant that has something special about it, if you have a certain insignia. These scripts seem fine, and loading them seems to not cause any problems. Here's the problem though: we have multiple scripts for specific pieces, and how we repeat them is via a separate script that runs on a while loop, that spawns the other ones. This seems to cause an obscene amount of loading time added to mission loading though, so we are looking for a different method.
So far we've tried:
Separate while loops for each script.
Each script being an if statement that gets repeated through a fourth that runs on a while loop.
Each one causing the loading time seen in the vids below.
We are still sort of novices in sqf, so we need some help. We are at a loss.

For reference to show how bad loading times are:
Without Scripts:
https://youtu.be/3vBNpFavCDE
With Scripts:
https://youtu.be/NOiirL2o_Pw

#

Scripts:
fn_SecretEquipment.sqf:

//SpartanJackWar (My partner)
//This script runs the other three secret equipment scripts.
if (!hasInterface) exitWith {};
while {!isNull(player) && alive player} do
{
    waitUntil { isnull ( uinamespace getvariable "RSCDisplayArsenal" ) };
    [] execVM "\OPCOS_Functions\Functions\Secret\fn_SecretArmor.sqf";
    [] execVM "\OPCOS_Functions\Functions\Secret\fn_124thArmor.sqf";
    [] execVM "\OPCOS_Functions\Functions\Secret\fn_RevArmor.sqf";
    sleep 1;
};
#

I would give an example of the scripts called for, but it's more then 2000 characters.
Here's the breakdown though:

  1. Stop if running on server.
  2. Check what headgear, vest, and insignia is being worn.
  3. If headgear == CH252A && vest == M52D && insignia is correct, check if they're wearing the secret.
  4. If not wearing said secret, replace helmet and vest with secret.
    It's structurally similar to OPTRE's Slim-Leg script, yet OPTRE doesn't cause the slowdown shown.
spare crest
#

How are these scripts triggered?

tiny wadi
#

Is it possible to override the inventory mouse button event handler? My attempts havent been working

#
waitUntil {alive player && !isNull(findDisplay 46)};

player addEventHandler ["InventoryOpened", {
    params ["_unit", "_container"];
    [] spawn {
        waitUntil {!isNull(findDisplay 602)};
        (findDisplay 602) displayAddEventHandler ["KeyDown", "hint 'abc'"];
        hint "Added event handler";
    };
}];``` This code works using the KeyDown eventhandler but using any of the mouse ones does not work.
#

I've tried applying it directly to the soldiertab and soldiercontainer controls as well in the inventory

prisma glade
#

The scripts are triggred postinit, then told to waitUntil the player isn't null and is alive. Then after that's finished, it's triggered again every 10 seconds from the above script. From what we could tell, there isn't really a way to detect if the player changes gear, otherwise we would of utilized that instead of a while loop.

tiny wadi
#

Odd, using the event handler MouseButtonDown works, but onMouseButtonDown does not?

sour island
#

@tiny wadi If you make a mod to get rid of the annoying inventory scroll wheel thingy, please let me know

tiny wadi
#

Working on a context menu to drop a set number of items or all at one time

tough abyss
proper flower
#

@tough abyss It was a spelling error..

#

I got it to work.. just can’t get him to wake up

#

I got any idea how to do that?

#

U*

tough abyss
#

Are you using mods?

proper flower
#

I am.. will that matter.. I just want to start off the mission with a crashed heli & my squad waking up from being knocked out

tough abyss
#

@tiny wadi prefix on is well documented on UI EH page

#

Yeah it could matter, mods can break things. Try the command without mods, if works then you know where to look @proper flower

proper flower
#

I don’t have a command for the waking up part.. the unconscious part works tho.. just need them to get back up..

tough abyss
#

I don’t understand what you mean by wake up

#

There is no sleep mode for unit

proper flower
#

Mission starts with the guy unconscious. After a few seconds he wakes up

#

Snaps out of it.. becomes conscious .. however its worded

tough abyss
#

Try delaying setting it up, many things can go wrong if executed too soon

proper flower
#

I don’t have a script for getting up.. as I said the starting unconscious works..

#

I just need him to get up but don’t know how to do it

tough abyss
#

Now you are confusing me. setUnconscious works both ways true to set, false to undo

proper flower
#

Ok .. i trees to set both but the guy didn’t get up.. the script I have is:

#

Unit setUnconscious true;

#

Then I added unit setUnconscious false;

#

Maybe I’m writing it wrong with both of them

#

Should it be: unit setUnconscious true, false; ?

#

Or maybe true; false;

tough abyss
#

As I said, command works, you have either mod interfering or set it too soon when things are not fully initialised at the start

#

Or maybe true; false;
I gave you the link to biki there is no maybe

proper flower
#

Well I was talking to u, I didn’t click it yet.. I was getting your input first

#

Just read it.. same thing I’ve been reading trying to figure it out.. yes what is on that page works... but only to set unit unconscious.. He needs to get up..

winter rose
#

-_-

_unit setUnconscious true;
sleep 5;
_unit setUnconscious false;```  @proper flower
proper flower
#

I tried this & it didn’t work.. the other said maybe the mods were messing with it.. gonna try that tomorrow.. thanks😑

misty trail
#

I am logging my position in the editor , but i need to log the direction as well , how can i do that as I only see log position to clip ?

winter rose
#

@proper flower most likely an ace medical thing

mint sand
#

So basically I am making a custom version of antistasi, and the base code for buying vehicles is like so

initVar.sqf
server setVariable [vehSDKTruck,300,true]; vehSDKTruck = "rhsgref_nat_ural_open";

buyVehicle.sqf
_tipoVeh = _this select 0; _coste = [_tipoVeh] call A3A_fnc_vehiclePrice;

vehiclePrice.sqf
_tipo = _this select 0; _coste = server getVariable _tipo select 1;

and this works fine, the truck costs 300.

I have modified it so that vehSDKTruck is an array of many vehicles that are all similar, ural variants, kamaz variants etc, and the code looks like this

initVar.sqf
server setVariable [vehSDKTruck,300,true]; vehSDKTruck = [...];

buyVehicle.sqf
_arraytipounidad = _this select 0; //_this being the selected vehicle type (an array in most cases) if (_arraytipounidad isEqualType []) then {_tipoVeh = selectRandom _arrayTipoUnidad} else {_tipoVeh = _arrayTipoUnidad}; //to determine if its an array or not _coste = [_this] call A3A_fnc_vehiclePrice;

vehiclePrice.sqf
_tipo = _this select 1; _coste = server getVariable _tipo select 1;

BUT when I run my version, I get an error stating ERROR: 1 Element provided, 2 expected in reference to the _coste line. Everything else is working properly except code running the cost, so the cost returns 0 since it is in error, and everything is free, which is not ideal, as part of antistasi is resource management.

queen cargo
#

```sqf
your code
```

still forum
#

if (_arraytipounidad isEqualType []) then {_tipoVeh = selectRandom _arrayTipoUnidad} else {_tipoVeh = _arrayTipoUnidad};
Variable will stay undefined as you only define in scope of the then/else statement.

_coste = [_this] call A3A_fnc_vehiclePrice; Why do you all of the sudden expect the vehicle to be in _this?

#

ERROR: 1 Element provided, 2 expected getVariable with array argument needs atleast 2 arguments.

winter rose
#

@proper flower ah wait it also doesn't work well if you don't have a primary weapon

mint sand
#

@still forum _this is the selected vehicle. Also what should the second argument be?

still forum
#

and no, according to your code _this is not the selected vehicle, you said it's an array, and your old code uses _tipoVeh now you suddenly use _this and pass a whole array

#

there is way too much context missing in there

mint sand
#

right, the selected vehicle does not have a price, the array has a price, then after the price is determined, a vehicle is selected at random from the array

#

_this is the array, and the array is what is given a price with setVariable

#

i do not individually assign the vehicles a price, because that would be tedious and pointless, as all vehicles within the array are functionally the same just variants of the same thing for variety, and they cost the same

#

You click 'buy Truck' and it runs this code and serves you a random truck.

#

The reasoning behind using _this instead of _tipoVeh in the new code, is that _tipoVeh in the NEW code becomes a specific vehicle rather than just using the Array name as in the old code

#

I have read this page on getVariable a bunch of times, and I am still at a loss for how to properly get what I want out of it

mint sand
#

ok, so i found a way around this, and that is using setVariable ["vehSDKTruck",300] note the "" around the variable name, and then when it is time to use getVariable to somehow turn _tipo into a string, still not sure how to turn a variable name into a string though

mint sand
#

i found a way to convert a variable name to a string, but I am having trouble with it

basically I am using a macro to add "s around the variable name

#define QUOTE(VAR) #VAR

but when i do QUOTE(vehSDKTruck); it gives me ERROR: Missing ;

#

I can not figure out why it is doing this

#

:/

still forum
#

did you actually define the macro in your code?

#

And why not just put quotes around it manually ^^

mint sand
#

because i need it to be able to handle incoming variables, and yes i defined the macro in my defines.hpp

#

with the other 100 defines i have that work fine

#

actually, that will not work even if i fix the ; error, as it will just put output something like "_tipo" rather than figuring out _tipo=vehSDKTruck

So do you have any ideas how I can make _tipo = "vehSDKTruck" rather than _tipo=vehSDKTruck=[.....]?

still forum
#

I think you need to re-think what you are trying to do from the ground up

mint sand
#

:/

still forum
#

turning variables into string doesn't work

#

the data in the variable doesn't know it's own name

mint sand
#

is there a way to only procure the data in the variable after a certain point, and to keep its name throughout processing rather than the data being present all the way through?

still forum
#

just pass the variables name along and call getVariable everytime you need the data

mint sand
#

ok, i am thinking of a way to make that work. Is there a way to make selectRandom not consider a certain element of an array?

still forum
#

no.. why?

slim oyster
#

does inputAction not handle multiple key combinations for a display EH?

still forum
#

inputAction cannot handle combinations correctly because it only has a float value. It cannot represent the big numbers that combinations have internally

slim oyster
#

Ah so precision error, what is the workaround if any?

still forum
#

none

mint sand
#

I was thinking of storing the price as the first value of the array, vehSDKTruck = [300, "...","...".....]; and then getting the price via
_tipo = vehSDKTruck; _coste = _tipo select 0;

then spawning it via selectRandom (SOMEHOW EXCLUDING THE FIRST POSITION) _tipo;

#

actually, i see a possibility to do this with a multiArray, but I need to think about how selecting from it will work...

still forum
#

just use subarray

#

[price, [1,2,3,...]]

mint sand
#

ok, so if i do that, how would i go about selectRandom from the nested array?

still forum
#

selectRandom (_array select 1)

mint sand
#

i think this is exactly what i need, I will try to implement this. Thank you

slim oyster
#

is (ACE_player != vehicle ACE_player) still the meta?

#

or are people using that parent vehicle command?

still forum
#

objectParent is used more often in ACE I think

#

isNull objectParent ACE_Player to be exact

slim oyster
#

new command added to replace older slower and less reliable command

#

no discussion on biki page

#

what is this

queen cargo
#

mhh?

still forum
#

huh?

#

where

slim oyster
#

for objectParent

still forum
#

¯_(ツ)_/¯

queen cargo
#

i actually have no idea what the hell you talk about
what are you expecting @slim oyster ?

#

not to mention, that pretty much all contributors accepted that biki editing happens in #community_wiki channel here simply because nobody ever looks into talk pages and for those few that do actually edit the biki, waiting weeks or month on others to reply is literal garbage

slim oyster
#

Is there a way to get selectionposition from a potential/future animation? I want to get selectionPos/relative model pos from the start of an animation but check this before actually switching to the animation, is this possible?

#

Some hacky 1 frame animation switch and selectionPos?

jaunty ermine
#

I'm pulling my hair out of this. I'm trying to get onPlayerRespawn.sqf to select the player and give them an insignia, it works for when a unit loads in the first time (player is returning "B Alpha 1-1:1 Slatery") , but for what ever reason once the player respawns the returned string or object is garbled to "bis_o2_6431" both on a local host and dedicated server. I'm assuming this is normal but I need the player object returned. I've tried using waitUntil {!isNull player}; and `waitUntil {player == player] but that doesnt seem to help. Anyone have any suggestions?

slim oyster
#

if (condition) then { code }
or
if !(condition) exitwith {} code?

cosmic lichen
#

@slim oyster I believe that only matters if there are multiple conditions of which one can cause the code to not be executed.

#

Have you tested with BIS_fnc_codePerformance?

#

@jaunty ermine Make sure you are refering to the correct unit. onPlayerRespawn.sqf has the old unit and the new unit as paramters

jaunty ermine
#

maybe not, I'll do a little bit more snooping, thanks for the help so far

jaunty ermine
#

I'm an idiot, there wasn't anything wrong with the player statement. it was the insignia that was screwing it up. if you're using BIS_fnc_setUnitInsignia in any of the event scripts, make sure you un-set it before trying to set it to a specific insignia

mint sand
#

@still forum I appreciate all the help man, I finally got it working.

What I ended up doing was modifying the function for adding vehicle to take 2 inputs, I keep the array separate from the price which is a simple integer, and the price runs through the price function without the complication of the array, and the array randomizes by itself. It is much simpler now, thanks again for all the guidance

tough abyss
#

There are new params for server to kick idle in the lobby no need to try to workaround with scripts any more

still forum
#

waitUntil {{alive _x} forEach allPlayers}; forEach only returns the last value

tough abyss
#

what is this
Curious myself, what is that quote and where did you find it? @slim oyster

#

I made health pickups in my mission by using triggers, is there anyway to prevent a player from activating a trigger if said player has full health?

#

&& damage player > 0

#

i put this in the conditions correct?

#

What is the condition now?

#

this && !(thisTrigger getVariable ["healthkit1_spawn",false])

#

And trigger activation?

#

[thisTrigger] execVM "healthkit1.sqf"; thisTrigger setVariable ["healthkit1_spawn",true,true];

#

That’s onActivation

#

at the end of the .sqf it also has

_trigger = _this select 0;
_trigger setVariable ["healthkit1_spawn",false,true];

#

Who sets the trigger off?

#

the trigger deactivates when a player steps on it, its so players can't play the trigger again while the health kit is "spawning"

#

it activates again when the sqf finishes

#

i placed && damage player > 0 inside the condition and it works!

#

thanks!

#

It won’t work in multiplayer

#

dedicated server or local hosted server?

#

or both

#

Any multiplayer

#

When you have more that one player

#

what exactly won't work? the trigger?

#

im new to this mission making stuff

#

&& {{isPlayer _x && damage _x > 0} count thisList > 0}

#

do i add that to make it work with multiplayer?

#

This should work in multiplayer but trigger will fire on every pc and item will be created on every pc so multiple kits

#

Unless you selected server only option

#

Then it should be fine

#

server only is currently unchecked, am i better off checking it?

#

You should select server only and then you don’t need make your variable public

#

so with the current condition this && !(thisTrigger getVariable ["healthkit1_spawn",false]) && damage player > 0;

#

_trigger setVariable ["healthkit1_spawn",false,true]; this doesn’t need public flag

#

and server only checked

#

that won't work?

#

wait wrong condition

#

What won’t work?

#

i edited it

#

Use the other condition I gave you, don’t use player

#

this && !(thisTrigger getVariable ["healthkit1_spawn",false]) && {{isPlayer _x && damage _x > 0} count thisList > 0}

#

like this?

#

Yeah

#

gonna give it a quick test

#

And don’t need true here, just: _trigger setVariable ["healthkit1_spawn",false];

#

sweet that worked

#

the condition

#

Try with someone

#

im currently waiting for a friend to get on, i'll update you after we get it tested

#

If one of you has max health and one damaged it will count as damaged, only when both max health it will be ignored

#

does that mean if player 1 is damaged and player 2 is not, then player 1 can also pick it up regardless?

knotty arrow
#

if there any way to prevent player take any item

#

player addEventHandler["Take",{true}];

#

with this i can take everything

tough abyss
#

Yes @tough abyss

#

You need to rethink design with multiplayer in mind and edge cases

frigid dragon
#

Hello everyone, i am new to the arma show, and have a few questions and need a little help, as i did many many moons ago in a far far...ok i played arma when it first came out then due to work could not play, now that the game is available and cost effective i want to start again but need voice chat help if it is possible

tough abyss
#

Hello can someone help me with an script? In the script should the player (civilian) change the faction (opfor) when he takes an weapon but he should switch back when the weapon is´nt in the inventory! I had try this at the beginning:

#

if !(primaryWeapon player isEqualTo "Weapon_arifle_Mk20_plain_F") then
{
_newGroup = createGroup OPFOR;

if (playerSide isEqualTo BLUFOR) then
{
[player] joinSilent _newGroup;
};
};

winter rose
#

@tough abyss why not setCaptive?

tough abyss
#

I had found and try this, but the init.sqf didnt start:

#
  if (hasInterface) then { // don't add to HC and server
    ["weapon", {
        params ["_player", "_weapon"];
       if (primaryWeapon _player == "" && {secondaryWeapon _player == "" && {handgunWeapon _player == ""}}) exitWith { // if all weapon slots are empty
            _player setCaptive true; // set player as captive so he doesn't get shot at
        };
        _player setCaptive false; // otherwise set him back to normal
    }] call CBA_fnc_addPlayerEventHandler;
};                                                                                                                                                                                              
winter rose
#

please use

```sqf
// your code
```

around your code

tough abyss
#

Ok, should i send it again?

winter rose
#

just editing your message should be fine, thanks

#

also, you are doing

if (/* no weapon*/) then {
  player setCaptive true;
};
player setCaptive false; // this is wrong, you are missing an "else"```
#

it would immediately setCaptive true then false

#

@tough abyss

if (primaryWeapon player + secondaryWeapon player + handgunWeapon player == "") then {
   player setCaptive true;
} else { // ← this one
   player setCaptive false;
};```

or quicker yet uglier (less readable)
```sqf
player setCaptive (primaryWeapon player + secondaryWeapon player + handgunWeapon player == "");```
tough abyss
#

Thanks!

#

@winter rose

#

I had both, but the init.sqf did´nt recognize it! Or works this only for MP?

winter rose
#

all this in the CBA_fnc_addPlayerEventHandler EH right?

tough abyss
#

I think yes, i mean there is the notice that i should safe it as init or initPlayerLocal! Or is the Eventhandler an other file?

proper flower
#

Any chance there a thing like a scripting for Arma 3 class.. does that exist.. I want to learn more

#

Or official tutorials..

still forum
#

I'd say no to both

proper flower
#

I didn’t think.. I’ve seen the wiki with all the scripts but besides the YouTubes vids I haven’t seen anything good..

still forum
#

I don't know any good yt vids either

tropic linden
#

official class is copy paste other peoples mission scripts until you get it :p

#

even being 20 year vet programmer, arma's script is still the worst

still forum
#

IMO C is worse :u
I like SQF, Because I understand how it works, it's so simple

tropic linden
#

c at least makes sense

#

even if the bloat is insane

queen cargo
#

SQF makes way more sense then C ever could do

#

the operators (important difference btw. even though i also tend to call them commands) however do not always make the blatant simplicity and beauty of SQF clear

still forum
#

Okey. To be clear. The language itself is awesome, the commands implemented ontop of it aren't

dusk sage
#

Bloat in C 😃 ?

#

You missed two characters

daring pawn
#

does copyToClipboard have a character limit? Is there any way to export/copy an output to something with no or a bigger limit?

knotty arrow
#

if there any way to prevent player take any item ```sqf
player addEventHandler["Take",{true}];

#

with this i can take everything

tough abyss
#

@knotty arrow yes you can and you have already posted that earlier, please do not spam

whole light
#

Does anyone know how to write/append text from Arma to a text file? I've made a config generator, but the output is too long for copyToClipboard.

lost copper
#

@whole light you can try change limit of clipboard in your OS

tough abyss
#

@whole light you can use custom extensions to write to files

whole light
#

@lost copper Unfortunately the output is still too long.

#

@tough abyss Like a .dll? I don't have any experience with that, is it fairly straightforward?

tough abyss
#

Yes, you put one in your arma directory and call it with callExtension. If you can’t write one yourself you can find one that someone else has written already

whole light
#

Okay man, thanks for your response.

slim oyster
#

Can you get an object's init field from within a mission?

astral dawn
#

If there is no straight way, I remember someone suggesting to include a mission.sqm into description.ext

#

Then accessing it as a config

astral dawn
#

I want to implement such a feature but I don't quite know what to start with:
Player picks up some documents item from a killed enemy. When this happens, the mission generates some dynamic task. But I want each picked up document to be used only once. Is there a way to have unique inventory items in the game? Seems like 'take' event handler gives only the class name of the taken item. How should I go about this?

#

Hmm I think TFAR stores settings of radios... somehow 👀
🤔 🤔 Maybe I need to have a look at how ACE implements tag items

tranquil shoal
#

how do you create a new entity for zues to spawn? Like say i make a modded Pawnee with different guns. How can i get that pawnee to show up in zues to spawn.

#

like "Pawnee GMG Autocannon" show up in zeus

young current
#

not without a new config mod

pure arch
#

hey guys, does anyone know how could one preprocess inline function so that #define's work in them?

#

e.g. if I have a define like this:
#define DefinedString "some text to output"
and a function like this:
MyFunc = compileFinal "
systemChat DefinedString;
";

astral dawn
#

you must do it in a file, and then do preprocessFileLineNumbers

#

or use cfgFunctions, it also runs the preprocessor

pure arch
#

I know it works with files

#

but I wanna use #defines for an inline function

astral dawn
#

inline function 🤔

pure arch
#

now I wonder how to preprocess them so that defines work

#

with compileFinal

#

inline function -> I mean when the body of a function is written inline instead of loaded from the file

#

like

#

MyFunc = {
systemChat "this is my inline function";
};

astral dawn
#

ok so you have a file like doStuff.sqf:

#define MYSTRING "abcd"

myfunc = {systemChat MYSTRING;};

you must call compile preprocessfilelinenumbers "doStuff.sqf";

#

or I think compileFinal in your case

pure arch
#

this works when I'm not using compileFinal

astral dawn
#

hmm weird

pure arch
#

but I'm using compileFinal for all functions right away to protect them

#

like if you check my function above as an example

#

I'd use

#

MyFunc = compileFinal "
systemChat "this is my inline function";
";

#

and now I wanna use a #define instead of the string in systemChat like you written above

#

actually, one other question first

#

if I put a bunch of functions in a file 'MyFunctions.sqf'

#

and then from 'init.sqf' I do:
MyFunctions = compileFinal preprocessFileLineNumbers "MyFunctions.sqf";
[] spawn MyFunctions;

#

(as I have some executable code also)

astral dawn
#

compilefinal is supposed to work like: myCode = compileFinal "a = a + 1";
what I have written is: call compile preprocessfilelinenumbers "doStuff.sqf"; (note the call)
because the myFunc = {systemChat "123";} bit must be executed (run by SQF VM) so that it creates a variable myFunc and assigns the code-value to it.

pure arch
#

would all those functions inside of the 'MyFunctions.sqf' file get compileFinal-ed (and protected) or just the MyFunctions function (executable code part)?

astral dawn
#

I guess that only the executable code part will be compilefinal-ed, judging by the docs

pure arch
#

because I think I remember reading the KillzoneKid's stuff and that you should compileFinal all functions inside of your SQFs so that you protect them

#

so I guessed that only the executable part of a file will get compileFinal-ed and that's why you need to use compileFinal for all functions that are defined in there as well

#

and I'm doing that, but my defines don't work then

still forum
#

@daring pawn does copyToClipboard have a character limit? no.
@whole light look for "Arma AIO config" on google, there is a BIF post, with a pre-made DLL included that you canjust use.
@astral dawn Is there a way to have unique inventory items in the game? Yes. Create 1000 copies of the item with different classname each, BAM unique items.

astral dawn
#

How does TFAR do it then?

still forum
#

By creating 1000 copies of every item, with unique classname each

astral dawn
#

what

pure arch
#

so this is my testing scenario:

TestFile.SQF
#define DefinedText "some text"
//
waitUntil { sleep 3; !isNull player };
//
TestFunc = compileFinal "
systemChat DefinedText;
";
//
call TestFunc;

init.SQF
TestFile = compileFinal preprocessFileLineNumbers "EXT_Test.sqf";
[] spawn TestFile;

astral dawn
#

allright thanks 😄

pure arch
#

I'm getting errors cause of #define usage

still forum
#

@pure arch use single quoted string

astral dawn
#

yes preprocessor doesn't raplce things in strings

still forum
#

' instead of "

astral dawn
#

hmm really?

still forum
#

Yes really :U

astral dawn
#

so... preprocessor won't replace strings in a ""-string, but will in ''-string??

pure arch
#

if I don't use compileFinal and write TestFunc like this:

TestFunc = {
systemChat DefinedText;
};

then it works

still forum
#

yes

#

And yes that would be my second idea, but single quoted string should work fine

pure arch
#

I tried, it doesn't work

#

same error as when using "

#

the thing is, I wanna use compileFinal to protect the function

still forum
#

I did read your messages no need to repeat

#

use {} then, use str to turn it to string, and cut off the starting { and ending } using select

#

boom you have a string of your precompiled function

#

But why the hell not just use seperate files and CfgFunctions like any sane person would do

astral dawn
#

maybe he doesn't like to create a file per function (I hate it personally)

pure arch
#

I'm using separate files

#

but no cfgfunctions

#

it's just that compileFinal-ed function don't work with #define's no matter if " or ' is used in a #define so I thought there must be a solution I'm missing

still forum
#

they do

#

If you are using seperate files already, then just use CfgFunctions instead of playing around with stupid workarounds

#

And I already told you the solution above dude.

coarse plover
#

Hey guys, how can I modify this to only allow civilians to use the addaction? Blocking blufor would be enough, thanks!

h2 addAction [ "RADIO ON", {
h2 say3d ["denver1", 150, 1];
} ];

pure arch
#

if ((side h2) == civilian) then {
h2 addAction [ "RADIO ON", {
h2 say3d ["denver1", 150, 1];
} ];
};

spark rose
#

Alright gents, here's what I'm doing. I have a trigger (server executed) that runs a script to spawn two enemies randomly within a 360 circle in a cloud of smoke who then target a particular player. Everything works perfectly. EXCEPT THE SOUND! I cannot for the life of me figure how to get the sound to run across the network. I'm using playSound3D, but have tried say3d also. Both work when testing in 3DEN, but not when playing from a dedicated server. Ideas?

cosmic lichen
#

@spark rose playSound3D is not jip compatible according to the wiki, could that be the issue?

spark rose
#

because the trigger repeats, i didn't think that would be a problem. every time the enemies spawn the sound should play. Correct?

#

I thought maybe the problem is because the trigger is executed only on the server. But in the playsound3d wiki, it states it will be played on all machines on the network.

cosmic lichen
#

How long is the sound?

spark rose
#

10 seconds each time

cosmic lichen
#

If a player joins the mission after the sound started playing, he won't hear it

spark rose
#

Right. This plays multiple times in a mission, but never makes a sound when run from the server

cosmic lichen
#

Is it a mission sound?

#

Defined in description.ext?

spark rose
#

It's a custom sound in the mission folder

cosmic lichen
#

Try "A3\Sounds_F\sfx\alarm_independent"

#

See if that works

spark rose
#

This is what i have now, which works locally

#

//Smoke Sound
_soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
_soundToPlay = _soundPath + "sound\smoke.ogg";
playSound3D [_soundToPlay, _smoke, false, _smoke, 10, 1, 500];
//Volume db+10, volume drops off to 0 at 500 meters from _smoke

cosmic lichen
spark rose
#

funny enough, that doesn't work locally or on the dedicated server. My original works locally.

cosmic lichen
#

With the alarm sound?

spark rose
#

correct. inserting that into my script results in no sound being played.

cosmic lichen
#

Interesting, seems that this soundfile doesn't exist anymore. Seems I have to update the wiki example. Nevermind, sound file still exists

spark rose
#

What I think is happening is because the script is only evaluated on the server, the sound isn't being passed to network machines.

#

But I can't allow the script to be evaluated client side, otherwise we get oodles of spawning enemies

cosmic lichen
#

The effect of playSound3D is global and is broadcasted, that should not be the problem.

spark rose
#

hm.

tough abyss
#

Given a vehicle class name, can I get whether or not it has a driver/ gunner seat?

spark rose
#

@cosmic lichen, maybe it's something else in my script which just manifests itself as no sound when run on a server? I can send you the script.

cosmic lichen
#

@spark rose Post it here if it's not too long, maybe someone else can take alook. I am not really experienced with sound stuff.

spark rose
#

It's 131 lines

#

does that qualify as too long?

cosmic lichen
#

Nope

tough abyss
#

@cosmic lichen Does that not use the vehicle object?

spark rose
#

lol yep. discord won't let me paste it

tough abyss
#

Implying I have to spawn it first

young current
spark rose
cosmic lichen
#

@spark rose Sorry, the limit is 2000 characters, I thought it was 2000 lines (Which would be quite alot now that I think about it :D)

spark rose
#

@cosmic lichen yeah it would! lol

cosmic lichen
#

@tough abyss, yeah you are right.

#

Have you checked the config of the given vehicle for entries?

tough abyss
#

I'm not sure how to browse the config haha

cosmic lichen
#

In eden editor, right click on the vehicle and click on view in config viewer

tough abyss
#

Can I modify config for my mission?

cosmic lichen
#

Vehicle configs cannot be modified with a mssion.

tough abyss
#

Only read, okay

spark rose
slim oyster
#

For getting object varname for later use with setvariable/setVehicleVarName, vehicleVarName only returns editor/mission maker set varname and not the generated ones like bis_o2?

still forum
#

if some script generates vehicle var names, then that will be the vehicles var name

slim oyster
#

gotcha, simulating the bis counter increase by just a simple setvariable seems to work thanks

#

hmm

knotty arrow
#

how @tough abyss

coarse plover
#

Thanks @pure arch

tough abyss
#

What how? @knotty arrow

surreal peak
#

Does anyone know how to make an object invisible to all but 1 player?

#

I've tried [_boogy,false] remoteExecCall ["hideObject", _targetToMurder,true];

young current
#

make a local object

surreal peak
#

How so?

young current
#

createvehiclelocal

surreal peak
#

will that work with units?

#

Im trying to make it so he is invisible to everyone except for _targetToMurder, which changes every 60 seconds

young current
#

what is it youre trying to do

surreal peak
#

Using CBA, ACE and Achillies

young current
#

woah too much code to go through

#

explain it shortly

#

are you trying to mark a target for only 1 player?

surreal peak
#

yeah

#

ive got the targeting

#

what I need is the making it visible for only that player

#

So I did: _boogy hideObjectGlobal true;

#

to make invisible for everyone

young current
#

make what invisible

surreal peak
#

and am trying to do: [_boogy,false] remoteExecCall ["hideObject", _targetToMurder,true]; to make it visible

#

the _boogy unit

#

_boogy = _grp createUnit ["C_Soldier_VR_F",_pos,[],0,"CAN_COLLIDE"];

young current
#

why does it have to be invisible

surreal peak
#

because I want only one player to see it

#

because spooky

#

This is for zeus missions which is why it is a module and stuff

#

Ill give a quick run down of what happens in the code:

#
  1. Module created, user can select what side _boogy (VR soldier) is on before it is spawned
#
  1. Every 60 seconds, a target is chosen at random and _boogy is teleported 25m away from that target. The target is called _targetToMurder
#
  1. The target then SHOULD be the ONLY ONE able to see the _boogy unit
#

but, for some reason. Everyone can see him

#

What I'm assuming is that [_boogy,false] remoteExecCall ["hideObject", _targetToMurder,true]; is making everyone able to see him

knotty arrow
#

@tough abyss to prevent a player don't take items . without deleting it

young current
#

usually created units are synced on all clients

surreal peak
#

so even if I make him invisible to one client, all clients will see the change?

tough abyss
#

Make a mod @knotty arrow

knotty arrow
#

make a mod?=

young current
#

I dont quite understand that call youre making with remoteexec there

surreal peak
#

I wanted the change to be only applied for _targetToMurder, this is the only way I could think of it working

#

if there is a better way, please tell me

young current
#

yes but does that command youre feeding to it actually do something?

surreal peak
#

Well, it makes the _boogy unit visible to everyone so it does that

#

but I only want it to be visible to _targetToMurder

young current
#

so you have hideobject function defined somewhere

surreal peak
#

no

#

I was under the impression that I can use regular script commands in remoteExec for them to execute on a local player

#

From wiki:

Scripted function - scheduled environment (suspension is allowed, i.e. spawn, execVM).
Script command - unscheduled environment (suspension is NOT allowed). 
#

"hello" remoteExec ["hint"]; for example of how I am trying to use it (obviously with hideObjects instead)

young current
#

so it does indeed

#

so _targetToMurder is a player?

surreal peak
#

yeah

young current
#

are you testing this in true multiplayer?

surreal peak
#

I tested it with 1 player on my unit's server

#

It could be the possiblility that the person who executes the command will always be able to see it with the remoteExec command

young current
#

I wonder could it conflict with the earlier used hideObjectGlobal

surreal peak
#

so maybe if I do a loop of hideObject with the targets being all players?

#

with a remoteExec

proven crystal
#

i think you have to remoteexec hideobject on all clients except the one where you want it to be visible

surreal peak
#

sounds like a good idea

dim kernel
#

anyone good with anti hacks?

#

looking how to make an Anti Nuke Script to prevent kids from oofing the server

tough abyss
#

is there a way to make a trigger detect fall damage?

young current
#

probably not

#

what is it you are trying to do?

tough abyss
#

i was gonna see if i can have it play a sound effect everytime a player takes fall damage

young current
#

probably you would like to do that in damage eventhandler

#

trigger is not really good for such

tough abyss
#

You can have EH watch for fall animation and when detected make a note so that damage received soon after from objNull would most likely be from fall.

#

Or maybe check animation inside damage EH, think this should work as player would still be in fall animation

#

i have to use init.sqf for event handlers correct?

finite sail
#

define falling... if its moving donwards without moving in another direction, it should be possible to check for a negative velocitymodelspace in the z axis

tough abyss
finite sail
#

its not really good for that

#

yes, its for testing when objects take damage, but its much more about damage from bullet, rocket etc

turbid marsh
#

Anyway of making a player have a fixed direction? Trying to make a sit in chair script but as of right now people can rotate 360* when sitting down... :/

tough abyss
#

I binded a key to this code["Initialize", [player]] call BIS_fnc_EGSpectator; and another key to this code ["Terminate"] call BIS_fnc_EGSpectator;First key works ok, but the second don't work because the spectator mode blocks it. How can i stop spectator mode then?

#

😆

astral dawn
#

Damn I remember there was that scripting command to reload addons or something like that, so that I don't need to relaunch the game and re-pbo an addon?

hollow thistle
still forum
#

filePatching?

astral dawn
#

yes mergeConfigFile, thanks!

pure arch
#

is killzonekid present on this discord?

#

and what would be the best way of contacting him?

still forum
#

No he isn't.
Good question, maybe check his website for mail address

young current
#

He occasionally visits BI forums too I think.

#

But afaik hes not very active on Arma scene anymore?

still forum
#

Oh right BIF!

#

he's regularly online on BIF

#

no he's back.

young current
#

oh

tough abyss
#

What you need KK for, maybe we can help?

young current
tough abyss
#

Anyone can help with my question above?

cosmic lichen
#

@tough abyss Add the terminate code to the spectator display, then it won't be blocked.

tough abyss
#

@cosmic lichen thanks

#

@cosmic lichen do you have in memory what is the spectator display uid number?

pure arch
cosmic lichen
#

@tough abyss No sorry, but you can find it in the function, or the config viewer.

tough abyss
#

@pure arch @cosmic lichen holly thanks! Problem solved!

cosmic lichen
#

😉

pure arch
#

👍

tranquil shoal
#

is it possible to see the addon configs for vanilla assets like the pawnee? I'd like to copy it and then change it a little, rename it and make a variant that spawns in zeus

astral dawn
#

You can see all configs in the config viewer

#

probably you don't need to copy it then, but you can inherit from it and overwrite some fields?

tranquil shoal
#

ok thanks!

tough abyss
#

Hello, i have write an init.sqf which should activate an "take" and "put" eventhandler! The take part works fine, but the put part dos´nt work!

#

player addeventhandler [

"Take",

{
  if (primaryweapon player != "" || secondaryweapon player != "" || handgunweapon player != "") then {
      
      nul = [] execVM "scripts\faction\opfor_F.sqf";
      };
}

];

player addeventhandler [

"Put",

{
  if (primaryweapon player != "" || secondaryweapon player != "" || handgunweapon player !=         "") then {
      
      nul = [] execVM "scripts\faction\civi_F.sqf";
      };
}

];

#

This is in the civi_F.sqf

#

´´´

#

_newGroup = createGroup CIVILIAN;

if (playerSide isEqualTo OPFOR) then
{
[player] joinSilent _newGroup;
};

#

In the opfor_F is the same, only that opfor and civilian is interchanged !

#

Did someone know why its not working?

#

primaryweapon player != "" {missing} secondaryweapon player != "" {missing} handgunweapon player != "" {missing} = &&/||
if (playerSide isEqualTo east) then

#

Where you have write "Missing" is in the script II, didnt know why it´s not showing here

#

Where exactly did i have to the "if (playerSide isEqualTo east) then"?

#

I mean where did i have to put the line!

#

Put ``` before and after your code block

```
// Code here
```

// Code here
#

Did´nt get it to work, the "put" part! I had rewrite it now !

#

´´´´´

#

player addeventhandler [

"Take",

{
  if (primaryweapon player != ""  &&  secondaryweapon player != "" &&  handgunweapon player != "") then {
      
      _newGroup = createGroup OPFOR; 

      if (playerSide isEqualTo CIVILIAN) then 
      { 
      [player] joinSilent _newGroup; 
      };
}

];

player addeventhandler [

"Put",

{
  if (primaryweapon player != ""  &&  secondaryweapon player != "" &&  handgunweapon player != "") then {
      
      _newGroup = createGroup CIVILIAN; 

      if (playerSide isEqualTo east) then 
      { 
      [player] joinSilent _newGroup; 
      };
      
}

];

#

´´´´

#

I mean I'm not sure what you are trying to do you just switched all your logic, and seem to be making the player join the group of another faction

#

Also still should replace OPFOR with east: _newGroup = createGroup OPFOR; > _newGroup = createGroup east; Although does work is inaccurate in most cases eg. config

tough abyss
#

I want that the player switch to the opfor faction, when he takes an weapon, but he should switch back when he put the weapon on the ground (weapon not in weapon slot)!

#

I mean like in "Laws of War" DLC > Escape Mission!

tough abyss
#

Your logic in if condition is broken, it returns true when player has all 3 weapons in both cases.

#

Can you give me an example that it works?

cosmic lichen
#

The first one should be fine since he wants to joint opfor if he has weapons. The second one however is reverse

#

instead of != do ==

tough abyss
#

I´m an beginner in scripting can please write it for me correctly?

cosmic lichen
#
player addeventhandler [

    "Put",

    {
      if (primaryWeapon player == ""  &&  secondaryWeapon player =="" &&  handgunWeapon player == "") then //Switch to civilian if all weapons are gone
     {

          _newGroup = createGroup CIVILIAN; 
 
          if (playerSide isEqualTo east) then 
          { 
          [player] joinSilent _newGroup; 
          };

    }
];
tough abyss
#

Thanks!

tough abyss
#

@cosmic lichen The weapon lin is working (i had check it with an hint), but the player did´nt switch back to the civilian side, the blufor units fire again at the player!

tough abyss
#

The result should be true for success or false for failure

#

Which one you get?

delicate lotus
#

huh?

#

did you also try missiled of type "M_Titan_AT" ?

#

I create one and then set a target pos and it works just fine

delicate lotus
#

createVehicle

brave jungle
#

serverCommand doesn't seem to work with the correct serverPassword correct?

#

not really sure what else could be wrong

#

works fine otherwise xD

still forum
#

command password is seperate

brave jungle
#

Yeah, "password" serverCommand format ["#kick %1", someID];

#

Right?

still forum
#

Did you read the wiki page?

brave jungle
#

Yes, it's done in a UI environment

still forum
#

The other part about the password

brave jungle
#

I mean

#

I guess i've missed it?

delicate lotus
#

@tough abyss Yeah I use setMissileTargetPos and it works

finite sail
#

lazy evaluation.. should I be nesting the curly brackets in a complex or?

#

if ((cond1) or (cond2) or (cond3) or (cond4)) then

#

should be

#

if ((cond1 ) or {{{cond2} or {{cond3}

#

egh

#

i dont even know the question, let alone the answer

#

if ( (cond1) or {cond2} or {cond3} or {cond4} )

#

should 2 3 and 4 be wrapped in another level of {}

#

and then 3 and 4 be wrapped in yet another level of {}

slim oyster
#

(1stcondition) && {2ndcondition} && {3rdcondition}

finite sail
#

(1stcondition) && {{secondcondition} && {3rd condition}}

#

how about that?

#

does it gain anything?

slim oyster
#

it is exiting on first false

finite sail
#

right, yes, that makes sense

#

which is more than my question did lol

#

thanks

#

this is running on client every few seconds, so i want it as lean as possible

still forum
#

how about that? syntax error

#

{} && {} doesn't exist

finite sail
#

eh?

still forum
#

() && {() && {}} would work tho

#

Yes it does provide gain

finite sail
#

oh cool

#

dont feel so silly now hehe

finite sail
#

i think the trick is to get the most likely conditions to exit the condition right at the start

#

the most unlikely exit condition should be tested last

wary vine
#

anyone know why my rtt is completly fucking itself in the shithole on mp ?

#

i see it, they don't

tough abyss
#

Hold on lemmie bring my crystal ball

wary vine
#

I would show code, but im litteraly rewriting it for the 3rd time

tough abyss
#

So your question about the future code? Even more reason for the ball

wary vine
#

works fine locally

#

for anyone

tough abyss
#

Does it open dialog on remote clients?

wary vine
#

no

#

it opens the dialog for me, and then when i switch the feed, it updates on the monitor

tough abyss
#

Then the function probably doesn’t exist on remote clients when you call it

wary vine
#

im using setobjecttextureglobal with rtt..

tough abyss
#

Not in the code you posted

#

You ctrlSetText

wary vine
tough abyss
#

Anyway if you are withholding pieces of code trying to be clever you have succeeded

wary vine
#

im litteraly not.

#

im just getting pissed off with this shit now

#

3 times in the past week got it working fine, then just stops working again

tough abyss
#

Cool, carry on then

wary vine
#
private _all_cam_objects = []; 
(allMissionObjects "Land_HandyCam_F") apply  
{ 
 _all_cam_objects pushBack _x; 
}; 
 
missionNamespace setVariable ["Lega_AllCams", _all_cam_objects, true]; 
 
[cursorObject, 0, 3] call { 
 params [ 
  ["_monitor", objNull, [objNull]], 
  ["_screen_index", 0, [0]], 
  ["_cam_index", 0, [0]] 
 ]; 
 
  
 private _name = format ["rtt%1", str _cam_index]; 
 private _cam = (missionNamespace getVariable [format ["lega_cam_%1", _cam_index], objNull]); 
 
 if (isNull _cam) then  
 { 
  _cam = "camera" camCreate (getPos (Lega_AllCams # _cam_index)); 
 }; 
 
 _cam camCommit 0; 
 _name setPiPEffect [0]; 
 _cam cameraEffect ["INTERNAL", "BACK", _name]; 
 
 _monitor setObjectTexture [_screen_index, format ["#(argb,256,256,1)r2t(%1,1.0)", _name]]; 
}; 

``` litteraly just did basic as all hell, and even this isn't working globally.
still forum
#
private _all_cam_objects = []; 
(allMissionObjects "Land_HandyCam_F") apply  
{ 
 _all_cam_objects pushBack _x; 
}; 
 

You seem to not have understood how apply works

wary vine
#

im putting more stuff in there

still forum
#

that piece of code is literally equivalent to
private _all_cam_objects = allMissionObjects "Land_HandyCam_F";

wary vine
#

There is going to be more stuff in there,

still forum
#

Is that code running globally?

wary vine
#

the closest I have had it working, is getting it to flicker on the other peoples screens.

still forum
#

cameras are local

winter rose
#

I see more and more people using apply instead of forEach :-x

wary vine
#

im done for the night, might take a look at it again tomorrow morning, with fresh eyes.

still forum
#

well often apply is a good choice, but there are also people who simply don't understand what they are doing

jade abyss
#

Orange man bad!

#

damn furry harassing me again!!!111oneoneone 😠

still forum
#

Dscha has been banned

jade abyss
#

😘

#

Since when are you mod, dude?

still forum
#

don't remember

#

couple months maybe

jade abyss
#

gratz (or beileid?)

still forum
#

both, actually

jade abyss
#

At least, you can act quicker now, when dipshits show up

still forum
#

Currently that's literally every 10 minutes. Not fun.

jade abyss
#

A3 on sale again?

still forum
#

Spambots. Literally hundred per day :/

jade abyss
#

-.-

#

Had a sh*tload of them on another Server -> 5min delay until peeps could write after joining -> Haven't had one since ¯_(ツ)_/¯

still forum
#

We have 10 minute delay, they wait the 10 minutes, drop PM spam, and then go to the next bot account

jade abyss
#

😑

tough abyss
still forum
#

scope public doesn't say anything about being able to use it or not

#

If it's a DLC vehicle then only owners can drive

tough abyss
#

ok, thanks

tough abyss
#

Does Arma have a key-value type object?

#

Like a Map

young current
#

?

#

arma has a map?

tough abyss
#

Not the in game map

#

The map data type

young current
#

for what purpose?

tough abyss
#

So I have an array of sectors

#

I want to have a Map to store the sectors and their owners

young current
#

no there is no such thing

tough abyss
#

Aw damn

young current
#

you can save just about anykind of data but there is no special map thing for that

tough abyss
#

I'll have to use a parrallel array I guess

#

When doing a forEach, can I get an index?

#

_forEachIndex

dreamy kestrel
#

@tough abyss You could do an associative array of sorts in the form [[key,value]]. The only thing is, you have to provide your own API for it as well. I do not think the scripting in and of itself inherently knows how to work with that.

tough abyss
#

Ye that could work! _map select 0 select 1 haha

#

Is there a way to simulate time passing

#

Like actually simuatle the world and run scripts

#

at accelerated time

#

faster than the 4x in sp

young current
#

depends how your scripts are written

tough abyss
#

Okay

#

Is there any kind of tree structure??

#

Damn I wish it sqf was oo

#

JavaScript would be perfect

#

for arma missions

tough abyss
#

There is a plugin for it

#

looks cool

#

Is there something like curatorEditableObjects which returns all the groups a curator has?

#

Would make my code run far faster

tough abyss
#

You can create an object and use set/getVariable on it, it’s the closest you can get to map @tough abyss

#

You could do an associative array of sorts in the form [[key,value]].
This will be as slow as fuck

#

@tough abyss How can I create a "blank" object?

#

You could use createLocation for it

#

Cheeky.

#

I'm gonna put it on my curator object

#

How about trees?

#

@tough abyss Do you know how to add some kind of tree structure?

#

Like for example, a sector map

#

So each X is a point and each blue line is a connection between two points

queen cargo
#

uhm ... tree structure --> ["level 1", ["level 2", ["level 3", [...]]]]
nothing to thank bro

tough abyss
#

CBA does have a Map implementation of some description that might be worth looking into if you can use it.

tropic linden
#

well i am kinda stumped, something is affecting my containers and vehicles in grad persistence.. i can't take any items from containers and getting in vehicles gives me a black screen

#

i reduce grad persistance to just spawning the vehicle and not setting any parameters except the position and it still breaks it.. so there is some random interaction going on here

tropic linden
#

i think i found the fix, removing cba

#

no idea what is going awry there but ah well

#

not cba, but the handler itself with grads enableSimulation

#

odd that it affects inventories

west grove
#

but apparently with certain sound mods, it conflicts

#

it seems the event handler isn't removed correct (probably removes something from that sound mod)

#

(this is why i've send it to a variable... but apparently that doesn't work?)

#

can anyone take a look at it and tell me what i'm doing wrong?

tropic linden
#

CTRG_PLAYER removeEventHandler ["Fired", 0];

#

you are removing event id 0 during the event.. and not your handler?

#

that doesn't look at all right to me?

west grove
#

true, i forgot this line

#

but nontheless, later in code, i'm using CTRG_PLAYER removeEventHandler ["Fired", lxRT_FiredEH];

#

so that should remove it?

tropic linden
#

might want to print out what handler ID's you are creating and deleting

#

just to make sure somehow its not confused

west grove
#

problem is, this works perfect for me, but other players are using that one sound mod, which apparently throws fired EHs around

tropic linden
#

well maybe you should get that one sound mod and see how they are thrashing the handlers

west grove
#

😫

tropic linden
#

sadly i don't have any other suggestions

west grove
#

other mods are modders worst nightmares i guess

tropic linden
#

could be your handler removing random handles is actually causing them to silently fail the system

#

but eh.. impossible to tell

#

so far i've only really worked with a tight set of mods, but i have to say i've spent a heck of a lot of time ripping through their code to try and get things working how i want haha

west grove
#

i got used to not using any mods at all, because most of the time i work on missions and i hated it to constantly fix dependencies or workaround bugs that aren't issues in vanilla or the other way around

#

oh yeah, cba comes to mind. open any mission, save it, bam, dependency set.

tropic linden
#

yeah i have a fair bit of that with the older weapon packs now

#

tempting to ditch them but there's not enough variety with vanilla weaponry 😦

tough abyss
#

IS there a way to create custom Zeus categories?

#

Filled with existing characters/vehicles?

#

It's just "Infrantry" "Cars" "Tanks"

silk tulip
#

anybody know any ideas to keep vehicles from clipping into buildings and exploding when loading my mission?

astral dawn
#

place them correctly 🤷

keen bough
#

If i am not mistaken, mission Eventhandlers can be added within the initServer.sqf? or - basically any sqf that is server-sided?

still forum
#

Or clientsided

#

basically any script

#

Even sqs if you want

keen bough
#

I have a small problem (i use ACE 3) when i test, killer and killed person are the same person/unit/object. The handler is executed on the server. I tested it with system chat.

"person1 killed person1" instead of "killer killed person1"

I did probably something wrong?

#
private _killedUnit = _this select 0;
private _killer = _this select 1;

private _nameKU = name _killedUnit;
private _nameK = name _killer;

"OH NO! " + _nameK + " killed " + _nameKU + "!" remoteExec ["systemChat", 0];
still forum
#

ace has a variable for last damage source

#

use that to get the killer

keen bough
#

ah, so if i wouldnt use ace i would get the correct source? (just to be sure, i know about the last damage source)

still forum
#

not sure

keen bough
#

hmm, dont wanna restart arma XD ill go with the ace command ^^ thanksies.

slow isle
#

I would like to make a radio from TFR which has speakers on and volume max and with a custom freq (150), anyone know how I could do that? I didnt find any google results for that

still forum
#

TFAR*

slow isle
#

the radio is on the ground

#

yes TFAR

still forum
#

which tfar version?

slow isle
#

umm im not sure

#

how can I check

still forum
#

what's the radios classname

slow isle
#

Item_tf_anprc152

still forum
#

Then you can't

#

Well.. I guess you could spawn a instanciated radio manually

slow isle
#

wdym?

still forum
#

Old TFAR doesn't really support that

slow isle
#

oh ok

#

OH I HAVE AN IDEA

still forum
#

With new TFAR you can just double click the radio in editor and tick the "speakers enabled" checkbox and be done

slow isle
#

ill spawn in an entity, disable AI, make invisible and turn on speakers

still forum
#

AI's don't get instanciated radios

slow isle
#

wdym?

still forum
#

only human players get working radios

slow isle
#

oof

still forum
#

AI's only get dummys which don't work

#

until a human player picks it up

slow isle
#

how could I do the thing u are talking about

still forum
#

create a weapon holder
add tf_anprc152_1000 item. Then somehow get radio settings with right frequencies onto it, and call the setSpeaker function on it

slow isle
#

could you please right down the script because I have no idea of scripting

still forum
#

no

slow isle
#

ok, thank you a lot anyways

still forum
#

Don't have time for that currently

slow isle
#

no prob

#

1 more thing, do you know where I can find the script commands list of TFAR

still forum
delicate lotus
#

I need a little bit of help when spawning items on the ground using an GroundWeaponHolder.
I use building positions and it seems that some will always be spawned underground.
How can I fix that?

still forum
#

When you spawn on second floor, where does it spawn?
Underground? under the building or in the floor?
How do you set the position of the weapon holder

delicate lotus
#

Well. I spawn it using some building position and then use setPos.
I already tried it without setPos but that also yields underground issues.
For the first floor it spawns under the floor.
Nothing seems to spawn on the second floor and higher though.

#

Code to get building pos

_buildings = nearestObjects [_position, ["House"], _radius, true];
{
    _building = _x;
    _buildingPositions = _building buildingPos -1;
    {
        _pos = _x;
        _lootPositions pushBack _pos;
    } forEach _buildingPositions;
    
} forEach _buildings;

Creating + Setting

_holder = "GroundWeaponHolder" createVehicle _position;
_holder setDir floor (random 360);
_holder setPos _position;
#

Maybe I need to use ATL instead of AGL?
@still forum

slow isle
#

I cannot figure out how the syntax works, what am I doing wrong? I want it to wait and then do the script
SCRIPT: this playMove "AinvPercMstpSnonWnonDnon",sleep 1.3;

tough abyss
#

should be a semi colon

#

not a comma

slow isle
#

thanks!

tough abyss
#

Plus a new line, for good measure

#

Does anyone know how I can access a variable in a script within a keyevent?

still forum
#

@delicate lotus sorry for delay.
Actually the wiki page is quite confiusing. 2 places say AGL, but example says ATL...

delicate lotus
#

😂

still forum
#

You could try debugging the position and looking if the height value seems sensible

delicate lotus
#

well I checked the position of some items using getPos at it was below zero

still forum
#

ATL is the same as AGL while over land

#

🤔

#

maybe try setPosATL like wiki shows, maybe it makes a difference

delicate lotus
#

well once I tried teleporting to specific objects in buildings and setPos moved me one floor below it all the time while setPosATL worked perfectly

#

so I think it might work here to

#

huh it kind of works fine now

still forum
#

Wiki says AGL is the same as ATL ffs
Turns out it's not

delicate lotus
#

except that the items float a bit in the air... which is probably due to this:

_height = _position select 2;
if(_height < 0) then {_height = 0.25;};
_position = [_position select 0, _position select 1, _height];
#

Dedmen does that mean I can't trust the wiki anymore? XD

still forum
#

Don't think I can trust anyone anymore

delicate lotus
#

thats deep

#

only a little bit of tweaking is needed now. Then it will probably work fine.
Thanks for the help :)

There is no version of GroundWeaponHolder that reacts to gravity, right?

tough abyss
#

Pls help

still forum
#

WeaponHolder_Simulated

#

or similar name

#

TLDR; yes

tough abyss
#

Does an event handler run in a separate scope to the script it's in?

#

So it can't access/modify variables

delicate lotus
#

AFAIK an event handler is just a bunch of code that gets called when X happens

#

so yes?

still forum
#

only things that are executed "right here, right now" MIGHT execute in the same script

#

now think about when a eventhandler executes

tough abyss
#

Ye that's what I thought

#

So how can I make an event handler call a function from a script or access a variable?

still forum
#

call a function?
call my_fnc_function
access a variable? Exactly like anywhere else, a eventhandler is also just a script

tough abyss
#

But said function and variable are outside the scope of the event

delicate lotus
#

setVariable on the entity

#

getVariable in the event

#

or global variables

tough abyss
#

Okay

#

Got it working woo

astral tendon
#

Anyone know how to get the player that is carrying another unit one in ACE?

tranquil shoal
#

any ide with syntax highlighting for sqf?

young current
#

for what?

tranquil shoal
#

nm 😃

chilly wigeon
#

pretty much for every major IDE

tough abyss
#

I use IntelliJ

tranquil shoal
#

well i meant more specifically with arma 3 commands

surreal peak
#

I use notepad++ w/ plugins which works well

craggy adder
#

Sublime and VSCode work well for me

glad timber
#

So im not sure whats wrong here but it doesnt seem to work

_tele = _this select 0;
_caller = _this select 1;
_group1 = createGroup EAST;
_group2 = createGroup CIVILIAN;

if ((alive _caller) && playerSide isEqualTo civilian) then {
    {_caller joinSilent _group1} forEach units (group _caller)
} else if ((!alive _caller) && playerSide isEqualTo civilian) exitWith {
    {_caller joinSilent _group2} forEach units (group _caller)
};

Im trying to make it so that when a civilian tps they will join side EAST so the WEST can shoot them and if they leave an area or die they will be put back to side CIVILIAN. (In the code I posted I dont have it setup yet for if the civilian is in the area)

winter rose
#

see wiki page for joinSilent… it takes an array

glad timber
#

ok thank you

tough abyss
#

There is no else if

dim kernel
#

Anyone knows the Dialog Name for Video Settings menu?

oblique lagoon
#

What would be simplest code to give users set their custom shortcut to specifif action? I know how to give custom action for specific addAction via parameter but Im curious if I could give them default key and if any key is set as user action 1, use it then default shortcut.

#

In short.. Im asking what code should i put in addAction's shortcut parameter to give default key and make users override it with USER ACTION#

proper flower
#

How I can set up CAS on specific areas when called in by player? I got a hostage in a building that I don’t want to kill in the bombing? Thanks guys

tranquil shoal
#

so how do i start to make a addon, I know C#, pretty sure i can learn sqf quick. Do i make a mission then edit the files there? or do i make a server and edit the files there? I don't know where exactly to start. Ive googled it but there are way too many guides to sift through for just that first question.

young current
#

what kind of an addon?

#

there are a lot of different ways to mod Arma

tranquil shoal
#

wanted to start by changing the weapons of a pawnee

#

and have it load into zeus

#

spawnable by zeus

coarse plover
#

Hello fellas

#

Could I put this in a .sqf file in my mission folder? If so, where? And if not, where?

while {true} do
{
setdate _initdate;
sleep 60;
};```
#

just want to freeze time

tranquil shoal
#

answer to my own question was to go to steam>tools>Arma 3 samples and download those

#

@coarse plover id think that would be a infinite loop and freeze