#arma3_scripting

1 messages · Page 664 of 1

raw haven
#

hello I try to create a trader in Arma 3 but it is not working in any way. Anyone who can help me?

raw haven
#

Little because I don't have much idea of ​​scripting in arma3

#

I tried with the MCCS mod trade but it doesn't work for me either

winter rose
#

then maybe it is better to use an existing framework yes
and seek assistance towards its creators/community 🙂 (I unfortunately don't know MCCS)

raw haven
#

Anything works for me, my goal is to create a trader

#

I'm using the translator in case you read something that doesn't make much sense haha

winter rose
#

I got that ^^ no worries, it is all clear so far

raw haven
#

My goal is to create a trader with personalized prices, but all the codes that I find online are either not available for download or do not finish working.

tough abyss
#

Okay got that sorted, Second question, in the fired event handler which parameter gives me where the projectile landed

#

because its not _projectile as that just spawns it underneath me

winter rose
tough abyss
#

booo damn it soo close

little raptor
#

@still forum how can I add hashmaps to intercept? meowsweats
is it of type std::unordered_map? notlikemeow

heady quiver
#

Does anyone know why i cant put 2x hintC "Press W to move forward"; right after eachother?

heady quiver
#

if you mean by example 4 this: hintC "foo"; sleep 0.1; hintC "bar" that aint working

little raptor
heady quiver
little raptor
still forum
#

probably no time think_turtle
but I guess I should

#

I have time to implement the GameDataHashMap, but not the new script commands

tough abyss
#

well it may be ugly but it works so far

if (isServer) then 
{
    {_x addEventHandler ["Fired", 
        {
            _extraction = false;
            _soldierName = (_this select 0);
            _weaponName = (_this select 4);
            _smokeProjectile =(_this select 6);
            _lzSite =(getPosATL _soldierName) findEmptyPosition [0, 200, "B_Heli_Transport_01_F"];

            if ((_weaponName == "SmokeShellGreen") && (_extraction != true)) then
            {
                _null = [_soldierName, _lzSite, _extraction] spawn
                {
                    _extractionInbound = (_this select 2);
                    _mySoldierName = (_this select 0);
                    _myLzSite = (_this select 1);
                    _mySoldierName groupChat "Popping green smoke"; sleep 5; "Land_HelipadCircle_F" createVehicle _myLzSite; _extraction = true;
                };
            };    
        }];
    } forEach playableUnits;    
};```
still forum
#

_extraction != true you never compare booleans to a constant boolean.

if ((_weaponName == "SmokeShellGreen") && !_extraction) then

#

_extraction = true; this won't do anything.
You set a variable that you throw away right after

#

_null = thats nonsense, remove that

#

_this select just use params.
As the wiki eventhandler page shows in its example

tough abyss
#

how i do that im just going of a tut that did it this way

still forum
tough abyss
#

yeah how does that work for calling them into my script i understand the way the tut did it

mighty vector
#

btw...killed eh which fired twice, was a bug in ACE/CBA, isnt it?

still forum
#

its also a engine bug

#

_mySoldierName = (_this select 0);
turns into
params ["_mySoldierName"];

Params takes the same order as your parameters. so all of them
[_soldierName, _lzSite, _extraction] spawn
will be like this in params:

params ["_soldierName", "_lzSite", "_extraction"];

tough abyss
#

yeah i dont get it; look i watch 1 tut on event handlers

hoary halo
#

Hey guys ! Anyone willing to help me on this, i'm trying to make an addaction resulting in healing the whole player squad if that's something doable

#

I know how to make a healing area with each persons in a trigger getting healed

tough abyss
#

is it sp or multi

hoary halo
#

MP on a local hosted server for me only

tough abyss
#

its doable

little raptor
tough abyss
#

but in light of not making and idiot of my self im not going to attempt it

little raptor
#

@hoary halo you can put it in initPlayerLocal.sqf

#

it's an instant heal script tho

#

like a cheat

#

also not compatible with ACE

hoary halo
#

and congrats on you ai commanding mod, always using it

still forum
#

@little raptor will you do the intercept script commands for hashmaps, once I implement the game data type?
I don't think I can get it done today, I should have more free time later this week tho 🤞

hushed tendon
#

I'm trying to make a script where at the start of the mission, the weather is random but with preset values. (It's MP)
initServer.sqf

_weatherType = [sunny, rainy, night] selectRandomWeighted [0.5, 0.3, 0.2];

sunny = {
  setDate [2020, 2, 25, 11, 0;
  0 setRain 0;
  0 setFog 0;
  0 setOvercast 0;
  0 setWind 1;
  forceWeatherChange;
  skipTime 24;
  setTimeMultiplier 0.1;
}; 

rainy = {
  setDate [2020, 2, 25, 18, 0;
  0.6 setRain 1;
  0.6 setFog 0.8;
  0.8 setOvercast 1;
  .2 setWind 1;
  forceWeatherChange;
  skipTime 24;
  setTimeMultiplier 0.1;
};

night = {
  setDate [2020, 2, 25, 20, 0;
  0 setRain .3;
  0 setFog 0.2;
  0.2 setOvercast 1;
  0 setWind .6;
  forceWeatherChange;
  skipTime 24;
  setTimeMultiplier 0.1;
};

[] spawn {
_weatherType;
};```
This should work right? (I don't have access to test this in MP rn)
winter rose
#

yes, but place it in initServer.sqf

hushed tendon
#

Got it 👍

little raptor
willow hound
#

Should be an undefined variable 'sunny' error in the first line though, need to move the definitions up above that line.

little raptor
winter rose
little raptor
#

initServer works in SP as well. If your code doesn't work in SP, it won't work in MP either (99% of the times; the only exception is MP-specific commands, such as netId)

#

undefined variable + spawn is just putting the code there

#

it never executes

winter rose
#

@hushed tendon ↑ ↑ ↑

#

define your stuff
then select
then execute

willow hound
#
private _sunny = {};
private _rainy = {};
private _night = {};
call ([_sunny, _rainy, _night] selectRandomWeighted [0.5, 0.3, 0.2]);
spark turret
#

Imrpovise. Adapt. overcome.

hushed tendon
#

Thanks for the help guys.

mental wren
#

Is there some way to detect if a curator goes from player mode to zeus mode? I'd like to show who is currently in the zeus interface so they can work together. But some players may have curator access but aren't actually in zeus. Any way to get that information?

#

And then additionally, send out a hint only to others in zeus, not everyone in the server (I assume BIS_fnc_curatorHint would be ideal for this)

#

I was looking at BIS_fnc_listCuratorPlayers but that also returns those who are not currently in the zeus interface

winter rose
#

see Zeus EHs

mental wren
#

EHs?

#

ah event handlers

#

it doesn't seem to be in there

#

Unless I can use CuratorPinged in combination with isCurator

winter rose
#

yeah dunno

mighty vector
#

I want all opfor units to share some common code/event handlers.
On the other hand, while playing zeus, some units may be added during mission time (and hence, don't have them).

Is there a way to check if a unit already has these handlers added? can I set a unit "flag" or something similar? can I addEventHandler to a SIDE (ie: every time a unit is killed for a side)?
I could use workarounds like setting variable names, but seems better to ask before reinventing the wheel

I dont think arma would like same addEventHandler invoked multiple times for the same object.

winter rose
mighty vector
#

yep...that's the flag i was thinking of...thanks!

heady quiver
#
trg1 = createTrigger ["EmptyDetector", getMarkerPos 'hq_base'];
trg1 setTriggerArea [25, 25, 10, false];
trg1 setTriggerActivation ["CIV", "PRESENT", false];

For some magical reason this trigger, triggers even tho there is not CIV present in the area.

#

🤔

hot kernel
#

How to determine if two units are facing each other with a tolerance of about 30 degrees? There seems to be a number of ways to achieve this so I thought I'd ask before overcomplicating things.

Any ideas?

little raptor
heady quiver
#

oops, sorry i have it PRESENT i was testing it and i gave up so i put it like that here x)

#

Edited it

#

but yea it triggers and complets my task even tho there is only bluefor in that area and no civs

little raptor
heady quiver
#

ah..

little raptor
#

I think even animals can trigger a CIV trigger

heady quiver
#

that makes sense then

#

kinda sucks tbh ..

#

if i add a civ to my group (bluefor) will he become bluefor or not 🤔

winter rose
#

blufor yes afaik

heady quiver
#

shit.

winter rose
#

heh, otherwise you could tell him to grab a gun and mow down every enemy without being worried

heady quiver
#

x)

#

How can i check if a unit is in a trigger 🤔

#
trg1 = createTrigger ["EmptyDetector", getMarkerPos 'hq_base'];
trg1 setTriggerArea [25, 25, 0, false];
trg1 setTriggerActivation ["CIV", "PRESENT", false];
trg1 setTriggerStatements ["this"," ACTIVE CODE HERE ",""];
#

cuz 'civ' is not gonna cut it anymore at that point

winter rose
#

Side: "EAST", "WEST", "GUER", "CIV", "LOGIC", "ANY", "ANYPLAYER"

#

if it's only for one unit, synchronize the trigger to that unit and use "VEHICLE"

cosmic lichen
little raptor
little raptor
heady quiver
#

how.

winter rose
#

magic

little raptor
#

I'm not sure if it'll be "performance friendly" tho. a loop might be better

trg1 setTriggerStatements ["this && {thisList findIf {side _x == civilian} != -1}"," ACTIVE CODE HERE ",""];
#

I guess...

winter rose
little raptor
#

but it's unscheduled meowsweats

#

that's what I meant

winter rose
#

oki

civic niche
#

Would this be the place to ask if a certain type of script exists? Or would that be for a different discussion channel?

heady quiver
#

Mppff.. cant get it working..

winter rose
little raptor
heady quiver
#

i might know why, how would i check if _unit exists in thisList ?

winter rose
#

if (_unit in thislist) ?

little raptor
#

@heady quiver try this:

trg1 setTriggerStatements ["this && {thisList findIf {_x isKindOf 'CAManBase' && side _x == civilian} != -1}"," ACTIVE CODE HERE ",""];
#

turns out side _vehicle returns CIV meowsweats
I thought it was supposed to be sideUnknown

heady quiver
#

Problem might also be the CIV is added to my group then he will become bluefor no ?

little raptor
#

yes

heady quiver
#

mmm

civic niche
#

Is there a script that does something like KP’s Liberation, where there is a fob crate that you go and deploy to set up defenses within a certain area?

heady quiver
#

So leo, i have a unit thats _unit and only HE can trigger it.

#
createMissionDeliverHostage = {
params['_unit'];

Cuz i pass on a param

little raptor
#

I don't know what you mean

#

no false positives

heady quiver
#
trg1 = createTrigger ["EmptyDetector", getMarkerPos 'hq_base'];
trg1 setTriggerArea [25, 25, 5, false];
trg1 setTriggerStatements ["_unit in thisList",
#

Well it doesnt have to be for civ's it has to be only for 1 unit.

little raptor
#

_unit is not defined

heady quiver
#

and thats _unit

winter rose
#

_unit in list myTrigger

little raptor
heady quiver
heady quiver
robust tiger
#

Can't you just attach the trigger to that unit?

heady quiver
#

this is where _unit comes from

#

i just wanna see if he is in that trigger

#

tried both above doesnt seem do work

#
// Hostage join squad
[_unit] join (group player);
trg1 = createTrigger ["EmptyDetector", getMarkerPos 'hq_base'];
trg1 setTriggerArea [25, 25, 5, false];
trg1 setTriggerActivation ["WEST", "PRESENT", true]; // FIX THIS ITS NOT WORKING
trg1 setTriggerStatements ["this && {_unit in list trg1}",
        "
        CODE HERE
        ",""];

what am i doing wrong meowsweats

#

&& {_unit in thisList} <-- this part seems to be wrong

robust tiger
#

_unit is not defined in the triggers scope

winter rose
#

what am i doing wrong meowsweats
the trigger does not know _unit

heady quiver
#

oh..

#

so if i make _unit global it would work 🤔

#

got it.

#

working

robust tiger
#

I still think you could just attach that unit to the trigger to make it activable ONLY by that unit, making it more clear, but if it works, it works

heady quiver
#

oh ty.

winter rose
#

@robust tiger not attach, synchronize

robust tiger
#

synchronize is not for units

winter rose
#

I is tired, I keep doing/telling/reading sh**

still forum
little raptor
little raptor
#

Btw. countSide might be faster, as you're not looping in SQF
I didn't know that existed! (but I guess it still won't solve the issue since side _emptyVehicle is CIV)

sharp peak
#

Any way to enable map markers on direct chat?
Map "drawing" is possible, but double-click markers arent'

still forum
#

direct chat not working is news to me

sharp peak
#

will check with no mods loaded incase one of them is doing this, but doubt it

little raptor
#

a little bit. private [] creates an array first

#

so it is less efficient

winter rose
#

also, first syntax is wrong

little raptor
#

yeah notlikemeow

winter rose
#

either ```sqf
private ["_var1", "_var2"];
// or
private "_var1";
private "_var2";
// or
private _var1 = "something";
private _var2 = "somethingElse";

#

and the latter is moar betterest

little raptor
still forum
still forum
#

is the chat channel maybe diasbled on server?

sharp peak
#

can make lines with ctrl+click, but no markers with double-click

still forum
#

can't place markers in disabled channel

sharp peak
#

I am in the editor, VR Map, 1 unit, no scripts

still forum
#

Though also shouldn't allow drawn lines then

#

Maybe something for @unique sundial

#

Can't place markers in direct chat, but can draw lines just fine ^

sharp peak
still forum
#

and direct chat works

#

as in text message chat

sharp peak
#

Yes

#

Nothing running, not even GM, open editor - place unit - play in MP

digital hollow
#

Seems like parachutes have a visual bug with ropes. When a player's chute is the lifter end of a rope, the rope visually stays where it spawns, but works in holding a cargo. On unit switch the visuals get fixed. https://youtu.be/90EA_Vj4zTQ

heady quiver
#
while {true} do {
  selectRandom hostage playMove "AmovPercMstpSnonWnonDnon_EaseIn";
};

<-- this is bad almost crashes my game (from 160 fps -> 40 in short time) and better ways to make a unit go into that stance ?

still forum
#

And the reason youre spamming that in a while true loop is what again?

heady quiver
#

well if i execute it once he goes into 'hands behind back' animation and then instantly out of it again.

still forum
#

Then don't use the EaseIn animation

#

but use the loop animation that stays

heady quiver
#

Which one is that exactly meowsweats

still forum
#

You also need to disableAI move and maybe some others. Otherwise the AI will just start moving into a different anim

#

Check ingame animation viewer

#

Its probably something like AmovPercMstpSnonWnonDnon_Loop

heady quiver
#

i think i found something else:

this switchMove "AmovPercMstpSsurWnonDnon"; 
this setVelocity [0,0,0];
this disableAI "ANIM";

Would this work for MP aswel?

#

Not sure what the velocity does tho

mighty vector
#

is there a function similar to diag_log that writes to an specific file/is there a way to write lines to specific file?

still forum
#

No

digital hollow
#

Indeed. will do

unborn drum
#

I'm attempting to create a script that will fully ACE heal all players/units within a defined volume. I have very little scripting experience, though, which is producing a bit of difficulty. Does anyone have any experience with this?

hollow lantern
#

theoretical question: https://i.imgur.com/hwqyoe1.png
Let's say I have a vehicle (Helicopter) that travels 200km/h and I want to reduce the speed gradually so that it reaches 10km/h but only 20m in front of the target. How do I calculate when to start the slow down? I tried to calculate that in theory it should do 55m/s but I'm not quite sure if that helps
Only thing that might be a starting point is to fiddle around with maxSpeed of the aircraft sqf (getNumber(configFile >> "CfgVehicles" >> (getDescription _aircraft select 0) >> "maxSpeed")); but I think it does not matter in this case does it?

unborn drum
#

calculus

little raptor
hollow lantern
robust tiger
#

Now that I think of it, you might wanna switch params 2 and 3 but whatever

idle jungle
#

any ACE experts here?

im trying to make a script to basically turn a specific unit type into a ace doctor
can anyone help?

#

ps. i forgot to change their attributes in the editor yes yes im dumb lol

hushed tendon
#

I'm running this in the initServer.sqf but it won't work and I'm not getting an error.

private _sunny = {
    setDate [2020, 2, 25, 11, 0];
    0 setRain 0;
    0 setFog 0;
    0 setOvercast 0;
    setWind [(random 999), (random 999), false];
    0 setGusts (selectRandom [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1]);
    forceWeatherChange;
    skipTime 24;
    setTimeMultiplier 0.1;
};

private _rainy = {
    setDate [2020, 2, 25, 18, 0];
    0.6 setRain 1;
    0.6 setFog 0.8;
    0.8 setOvercast 1;
    setWind [(random 999), (random 999), false];
    0 setGusts (selectRandom [0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1]);
    forceWeatherChange;
    skipTime 24;
    setTimeMultiplier 0.1;
};

private _night = {
    setDate [2020, 2, 25, 20, 0];
    0 setRain .3;
    0 setFog 0.2;
    0.2 setOvercast 1;
    setWind [(random 999), (random 999), false];
    0 setGusts (selectRandom [0.1,0.2,0.3,0.4,0.5,0.6]);
    forceWeatherChange;
    skipTime 24;
    setTimeMultiplier 0.1;
};

call ([_sunny, _rainy, _night] selectRandomWeighted [0.5, 0.3, 0.2]);
tribal skiff
#

Hi, I want to see if it is possible to get an APC into the game minus the turret using only mission files would it be possible? I have seen it done on KOTH but I was wondering if anyone here knew of a way to make it happen. Sorry if this isn't the correct channel.

hushed tendon
#

nvm

weary hare
#

Anybody know if it's possible to change the max ACE drag/carry weight? If not, are there any scripts for moving box objects?

hollow lantern
idle jungle
#

@weary hare yea check the ace wiki mate :)

#

All on there

tough abyss
#

question how do i get the bigger debug menu with the previous statment next statment buttons

weary hare
tough abyss
#

ah k thanks

cosmic lichen
#

But statement history is also available in vanilla

#

just use page up and page down

tough abyss
#

hmm ok then was looking for a way to spawn small bases at random positions, BIS_fnc_objectgrabber/mapper are pretty good not perfect but it will do.

dawn walrus
#

I'm having trouble with getting a particular trigger to fire. This is in an MP environment.

I have an AI soldier, variable name informant. He is grouped to a small player occupied team. In short, the objective is to get that AI back to the safe zone for objective to complete.

I have 2 outcomes for this objective, using the editor modules. The first is if the informant unit dies at any point, the objective will fail. That trigger works fine. The second however, him reaching the safe zone, only works 50% of the time. In testing, if I move informant into the zone when he is alone, not grouped to anything or a player, it triggers fine. If however he is in a player group, it does not.

I have tried activiation conditions with informant being tied as the trigger owner, and him being present inside trigger area. I have also tried un-synching him as trigger owner, and simply using "informant in thisList" which again works when he is not in a player group, but not the other way around.

My guess is that something about being in a group with a player messes with this, though he has a variable name applied, shouldn't it be firing with the in list option?

cosmic lichen
#

Sounds like a locality issue. When the unit is in the player's group it becomes local to the player.

dawn walrus
#

So that erases any sort of ownership of a trigger?

cosmic lichen
#

Have you ticket that "Server only" checkbox inside the trigger?

dawn walrus
#

Im curious why the death trigger works and the area doesn't, as the unit has a variable name that I would assume remainds consistent no matter what group the unit is a part of

#

I have, you think un-ticking would work? I had it originally like that because thats exactly how I set up a similar objective before, that worked fine. Only difference was that AI unit was his own group, and an enemy so was forcefully escorted.

cosmic lichen
#

Yes

#

The death trigger works because alivecommand has global argument. It will find "informant" even if it's not local to where the command is executed

#

The trigger however, only being evaluated on the server, does not know the "informant" since it is local to the player's computer in whose group he is

dawn walrus
#

Hm, I see. (probably). I'm not really a coder, and while Iv'e been mostly succesful with basic sqf stuff im still bad at it. I'll try out your suggestion in a bit after I eat. Thanks for the input, hoping it works.

cosmic lichen
#

Sure, I hope that's the issue you are having.

solemn gorge
#

Hello everyone. Anyone know why the script below gets skipped when the rearm _asset is a fixed wing aircraft? VTOL/Rotary works fine as does all vehicles. I put in text pop ups to see what was going on and from what I can tell, the if statement doesn't kick off when it's fixed wing.

if (_asset isKindOf "Air") then {  
      [player] spawn GOM_fnc_aircraftLoadout;    
} else {
     private _turret = _x;
     private _mags = (_asset getVariable "BIS_WL_defaultMagazines") # _forEachIndex;
      {
          _asset removeMagazineTurret [_x, _turret];
          _asset setVehicleAmmoDef 1; //_asset addMagazineTurret [_x, _turret];
       } forEach _mags;
};    
dawn walrus
#

Hmm, no dice. I tried splitting the informant AI from the group, and giving him a short move then join command, still nothing. I took the server only off the trigger. Its not the end of the world if it doesn't end up working, I can set up a manual method of triggering it with zeus if need be.

Edit: So, I am happy to report I got it working. I am sad that it was so simple a solution. Tying the informant unit as trigger owner, with conditions that he is present. The thing preventing it from working, was that I had the trigger going to a single change task state module, which was connected to two different tasks (one for the team that the informant is a part of, and one for the rescue QRF). Evidently the game doesn't like trying to share a change task state module between two tasks, so giving one to each, makes it work fine. I hate and love ArmA.

tough abyss
#

can i make it so that players can only respawn when the whole group is dead?

tough abyss
#

just curious, is there any fast way for me to extract loadout to use for setUnitLoadout ?

sacred slate
#

is it possible to "selectplayer" from "teamswitch next"?

#

the thing behind it is, i cannot script much, and this will break the game if i am the leader my self:
if !(isPlayer (leader group player)) then {
selectPLayer (leader group player);
};

#

if i control a squad member and get killed, i teamswitch back to the squad leader. but how can i get switched from a killed squadleader to the next appointed squadleader in the remaining team

little raptor
tough abyss
little raptor
tough abyss
little raptor
#
copyToClipboard str getUnitLoadout player
tough abyss
#

oh =)) ty so much 😄

unique sundial
unique sundial
little raptor
unique sundial
#

it is greyed out means it is not available for marker placement

little raptor
#

yeah but I don't have it at all

#

not even a grayed out version

#

it's just other channels like global, side, etc.

unique sundial
#

then maybe you don’t have all the files

little raptor
#

files?

unique sundial
#

verify installation, make repro,I dunno

little raptor
#

I'm on v2.03 (dev)

#

maybe it's been "fixed"

unique sundial
#

have you tried profiling?

little raptor
#

nope

unique sundial
#

2.02?

little raptor
#

I just tested dev. I'll try those later

unique sundial
#

please let me know, tag me

little raptor
#

sure thing

void delta
#

does the ControlsShifted EH apply when a player takes control of a UAV

unique sundial
#

Can UAV have pilot and copilot?

idle jungle
#

Please excuse the format I'm on my phone.

if ( (typeOf player == "classname of unit") ) 
then {_unit setVariable ["ace_medical_medicclass",2, true];}
 else {_unit setVariable ["ace_medical_medicclass",0, true];}```

Would this work if I put in a classname of unit and then anyone who is playing as those units will be ace Doctor otherwise they are not? 

Thank you in advance 
Again sorry for format
opal sand
#

trying to make a unit sit on the sofa, but they float above it, how/can i use that setunitheight to keep the units sitting animation so that the unit actually looks as though their sitting on the sofa, not floating? please help, thanks

warm hedge
#

Because the unit is colliding with the sofa. Try attachTo the unit to an Logic

opal sand
warm hedge
#

No, not to the sofa but another object, specifically Game Logic

little raptor
#

@sharp peak how did you make the direct chat appear there in the first place? normally it shouldn't even be there

opal sand
#

@warm hedge how would that work sorry? havent a clue, put a mobile phone (new) and tuck it under the sofa, and have the player sit on the phone to make it look like they sitting on sofa lol

copper raven
#

attach the unit to the logic, then adjust the logic position relative to the sofa

warm hedge
#

Place a Game Logic in Eden Editor (located in Systems (F5) -> Logic Entities), name it, attach the unit via attachTo, eg sqf unit attachTo [logic,[0,0,0]];, some effort to adjust the position, profit

opal sand
#

where does the attachto line of code go? in the init of game logic, or init of named unit(s)?

cosmic lichen
opal sand
#

'just casually relaxing awkwardly on the sofa ready for the next firefight' lol

cosmic lichen
#

if (local this) then {this attachTo [logic....};

in the init

#

of the unit

little raptor
#

then notlikemeow

idle jungle
opal sand
#

bruh...
if (local this) {this attachTo [logic,[0,0,0]]; << is this right?

cosmic lichen
#

then*

#

damn I need a coffee

warm hedge
#

) then { <- insert between them

opal sand
#

bruh you guys have got me well and truly bamboozled, as you can tell i know minimal coding, but trying to learn what i can as i go along

'if (local this) then { attachTo [logic,[0,0,0]]'; << yay or nay or cry?

cosmic lichen
#

nay

#

this attachTo and there is a } missing

warm hedge
#

slightly cry. this attachTo

#

Also what Revo said

cosmic lichen
#
if (local this) then
{ 
 this attachTo [logic, [0, 0, 0]];
};
opal sand
#

so do i need to name that sofa lol

cosmic lichen
#

no

#

the sofa is references in "this"

#

but please rename logic to something like furb_logic

opal sand
#

furb_logic is redundant, obsolete and useless, was thinking something more along the lines of 'r3vo_logic', makes more sense than i lol

#

😂

spark turret
#

it looks like you re used to object oriented programming, where you can call the classes methods

if (local this) {attachTo [logic,[0,0,0]];  //attachTo called without left param

but sqf is procedural, there are no functions that already know what object to do stuff with.
Every single function has to be told what object it should have an effect on.
thats usually the left parameter
_myObject attachto [_target,_offset];

tough abyss
#

Hi so i have this amazing mod that has died and i'm getting an error thats causing the Bonnie hats to spawn halfway down the bodies it looks like this
Embedded skeleton OFP2_ManSkeleton in 'a3\characters_f_bootcamp\common\vr_solider_f.p3d' in different p3d files.
Skleton/model 'discloseafghandata\panamah.p3d' will probably not work corectly.
any ideas?

opal sand
little raptor
tough abyss
little raptor
opal sand
#

@spark turret so this '_myObject attachto [_target,_offset];' gets put into the game logic? myobject is name of object? (player1), target is player name (player1) and offset is this 0,0,0 values?

sharp peak
little raptor
#

I know

#

but how do you make it appear?

sharp peak
#

With a different chat selected, you won't be able to have it appear there at all

#

When I have direct chat selected, and double click the map - it will appear there, but greyed out

#

If this isn't it then I don't fully understand the question

sharp peak
spark turret
#

more like "crate01" = object, "truck" = target

opal sand
#

Guys ( @little raptor @cosmic lichen @warm hedge @spark turret) making a unit attach to a sofa is absolutely impossible for me unless its given all in one simple to understand image, cant get my head past the principles and points, and parameters, just stumped, dumbfounded, dont want to waste your time (if one of yous could help with this id greatly appreciate it very much so) 😄

little raptor
sharp peak
#

So on the bottom left of the screen it says "direct chat"

#

And the try placing a map marker

cosmic lichen
#

Confirmed. Thanks for the info @sharp peak

unique sundial
#

and any disabled channels?

sharp peak
#

Wdym? Mission I sjust editor with nothing but 1 unit, didn't disable any channels

little raptor
#

but preferably don't use inits at all

unique sundial
sharp peak
#

Nope, if I disable the channels I am not able to select them therefor can't get them on the list

#

(If I remember correctly atleast)

little raptor
#

yes, disabled channels don't appear at all

unique sundial
#

and if you select disabled channel

little raptor
#

because they don't appear anywhere

#

so you can't select them

#

or do you mean using a command?

#

nope, that won't work either

#

tried this:

1 enableChannel false;
setCurrentChannel 1

returns false

#

@unique sundial yep, this makes it appear:

select them first, then disable them

#

but greyed out

#

in other words:

1 enableChannel true;
setCurrentChannel 1;
1 enableChannel false;
unique sundial
#

so working as intended then

little raptor
opal sand
#

@little raptor how did you do that? small screenshot insert marker photo previewed in discord? please

still forum
#

you just take a screenshot, crop it down and upload it here 🤔

opal sand
#

bruh my brain.exe is not responding, its a gif on my desktop 😿

finite jackal
#

Upload to imgur and post link with description

opal sand
#

i mean can this channel preview gifs, similair to the above screenshot?

little raptor
#

only veterans and above can do that

opal sand
#

ok, well here it is, thanks @little raptor @warm hedge @spark turret @copper raven for your part in trying to help, achievement unlocked ^^ 😂
https://i.imgur.com/TNhY5YL.mp4

warm hedge
#

Uhh

#

What is this situation 🙃

young storm
#

Can someone link me to the wiki that lets you skip time via trigger n get the X amount of hours screen appear?

Also anyone have the two part code to link a UAV /mini zeus cam to a tv?

And third question..is it possible to have a popup appear on ayers screens like a custom video made n inserted into arma? That the zeus can toggle on n off?

opal sand
#

@warm hedge the situation in that gif, is me dancing being overly happy (the guy dancing on coffee table and random loadout) about something thats very normal and mundane, (the guys in suits (represents you guys) sitting on sofa are boring to look at, but they feel/are confused, bewildered and not amused) (about the dancing guy (me) learning the attachto command, which, of course isnt anything special or a feat to celebrate) 😄

finite sail
#

good job it didn't need much explaining

opal sand
#

sarcasm or compliment, its not too clear

opal sand
#

lol cant do what you can do lou

#

@finite sail thankyou for the sarcastic compliment nonetheless, very thoughtful gesture lol

finite sail
#

🙂

turbid crag
#

Is it possible to use ctrlSetScale with a map control? I use ctrlCommit afterwards, but it doesn't seem to have an effect.
ctrlScale returns the value it has been set to, as if it had completed it successfully.

little raptor
#

scaled map controls have some bugs

#

also, to scale ctrls, use ctrlSetPosition

#

not ctrlSetScale (I'm not sure if it works tbh; I've never used it)

opal sand
#

is it possible to get the hovering helo above a scenario to sway and move slightly? this perfect hover is runing my immersive experience lol 😂

opal sand
turbid crag
#

I was ultimately trying to get get ctrlMapAnimAdd to work with a scaled down control. I thought it could be fixed by going with ctrlSetScale, as I had been using ctrlSetPosition before and it wasn't centering properly.

little raptor
#

yeah that's the bug I was talking about

turbid crag
#

I'm guessing it isn't possible to have it automatically center then?

#

with a simple command, that is

little raptor
#

nope

turbid crag
#

well, big sad
thanks though!

finite sail
#

makes it look much more natural

drifting girder
#

sorry to interrupt, but i have a problem: if i have 7 tasks on the map (let's call them task1 through task7), how would i make it so that if a group completes any 4 of the 7 it's a mission complete?

winter rose
#

either have an increased count on each task completion, or on task completion check how many of those are completed

drifting girder
#

👍

little raptor
#

@drifting girder an example of the latter:
lets say tasks are named: task_1, task_2, ... task_7

_cnt = 0;
for "_i" from 1 to 7 do {
  _task = format ["task_%1", _i];
  if (_task call BIS_fnc_taskState == "SUCCEEDED") then {
    _cnt = _cnt + 1;
    if (_cnt >= 4) then {
      ["END1"] call BIS_fnc_endMission;
      break
    }; 
  };
};
```but the first method that Lou suggested is more efficient.
drifting girder
#

thanks a bunch!

wary lichen
#

Hi everybody, how to launch a rocket into a helicopter or airplane, spawned script, in order to simulate a shot from a tunguska or any other anti-aircraft weapon

#

in other words, I need create rocket, and launch to vehicle, and make it appear on the victim's radar

#
 _target = _this select 0;
_startPos = _this select 1;
_missileType = _this select 2;
_missileHeight = _this select 3;

//defining parameters
//the faster the target, the more checks it will need 100 is good for fast moving targets such as aircrafts
_perSecondsChecks = 100;
//actual speed of a AIM-54 Phoenix AA missile
_missileSpeed = 6174;
_pos = [0,0,0];

//if no target is found -> exit
if (isNull _target) exitWith {hintSilent "No Target Found!"};


//create missile and setting pos
_pos = [_startPos select 0, _startPos select 1, _missileHeight];

//creating missile
_missile = _missileType createVehicle _pos;


//ajusting missile pos while flying
while {alive _missile} do {
if (_missile distance _target > (_missileSpeed / 10)) then {
_dirHor = [_missile, _target] call BIS_fnc_DirTo;
_missile setDir _dirHor;

_dirVer = asin ((((getPosASL _missile) select 2) - ((getPosASL _target) select 2)) / (_target distance _missile));
_dirVer = (_dirVer * -1);
[_missile, _dirVer, 0] call BIS_fnc_setPitchBank;

_flyingTime = (_target distance _missile) / _missileSpeed;
_velocityX = (((getPosASL _target) select 0) - ((getPosASL _missile) select 0)) / _flyingTime;
_velocityY = (((getPosASL _target) select 1) - ((getPosASL _missile) select 1)) / _flyingTime;
_velocityZ = (((getPosASL _target) select 2) - ((getPosASL _missile) select 2)) / _flyingTime;
_missile setVelocity [_velocityX, _velocityY, _velocityZ];


sleep (1/ _perSecondsChecks);
};
};```
#

I use this code for launch rocket at target

opal sand
#

why do some animations not play? on radio command, instead of the animation playing, the unit just goes straight to prone, pulls out a primary weapon he doesnt have and stands up, and does nout?

little raptor
wary lichen
little raptor
# wary lichen can you example?
_missile = createVehicle [_missileType, _pos, [], 0, "CAN_COLLIDE"];
_missile setPosASL _pos; //note: pos must be ASL
_missile setVectorUp [0,0,1];
_missile setVectorDir (_pos vectorFromTo aimPos _target);
_missile setVelocityModelSpace [0,300,0]; //init speed: 300 m/s
_missile setMissileTarget _target;
_missile setShotParents [_firedFrom, gunner _firedFrom];
#

_firedFrom is the vehicle that fired the missile

#

_pos must be in ASL format

#

_missileType is the type (classname) of missile

#

_target must be an object

#

also you should probably lead the target as well

serene valley
#

can change Gravity from 9.8m/s^2 in eden or in config?

still forum
#

no

serene valley
#

no??!!

still forum
#

uh

#

I don't know what to reply to that. Should I repeat what I said or.. what is the expected reply to that?

serene valley
#

there's a way

#

probably multiple ways

still forum
#

no, there isn't

#

gravity constant is hardcoded

finite sail
#

why ask a question if you are convinced you already know the answer?

serene valley
#

I have no clue of the answer, thats why I asked

#

I just never consider anything isn't possible

finite sail
#

Dedmen, this weeks lottery numbers please

wary lichen
#

again...

little raptor
desert lily
#

So I have a piece of code that is used to populate a listbox with vehicles for the player to use. Here is the code in question:

{
    _weapcount = count getArray (_x >> "weapons");    
    {
        if (_x isKindOf [ "SmokeLauncher", configFile >> "Cfgweapons" ]) then {
            _weapcount = _weapcount - 1;
        };
    } forEach (getArray( _x >> "weapons" ));
    if (_weapcount > 0) then {
        spawnvehicles pushBack configname _x;
        _entry = (_Display displayCtrl _lbvehicleselect ) lbAdd gettext ( _x >> "displayname");
        (_Display displayCtrl _lbvehicleselect ) lbsetpicture [ _entry, gettext ( _x >> "picture") ];
        (_Display displayCtrl _lbvehicleselect) lbSetCurSel 0;
    };    
} forEach (("(configName(_x) isKindOf 'Air') && (getNumber(_x >> 'scope') == 2)") configClasses (configFile >> "Cfgvehicles"));

My problem is that this code excludes 3 vehicles that I would like to appear in the list.
What is the best way to fix this?

willow hound
#

Look at which vehicles your selection logic yields and investigate why the three vehicles you want don't meet your selection logic's criteria 🤷‍♂️

desert lily
#

If I remove this part of the code

if (_x isKindOf [ "SmokeLauncher", configFile >> "Cfgweapons" ]) then {
            _weapcount = _weapcount - 1;
        };
#

They will appear. But so will a lot of other vehicles

#

Is there a way to make an exception of for just the 3 that I want to appear?
I'm quite new to scripting so I'm not really sure how such a thing could be done

spark turret
#

you can hardcode them into the script. have an extra check for "myClassNameOfVehcile" and then push that one back

outer fjord
#

How could I pull a value out of a config into a clipboard. IE like getting the hit value from CfgAmmo class?

spark turret
#

getNumber afaik

#

and similar commands

#

copyToClipboard

outer fjord
#

How would I point it to the proper cfg though? Is their API for navigating that?

#

Or can I just point right to CfgAmmo?

#

Oh wait, nvm there is code on Rithans post lol

unique sundial
#

in debug console type
utils 2
exec
then type CfgAmmo
enter
then browse it in similar way for values

outer fjord
#

This is amazing, thank you 😄

sharp grotto
#

Is there a way to get the "mute status" for VOIP from the player-list via scripts ?
I want it to affect the text chat as well. 🤔
So each player can mute other players if he wants to

outer fjord
#

I killed the tool sadly, tried to pull all the cfgs with their inherted properties as well.

round scroll
#

is there any advice how to create a 'build menu' for an object? In the MAAS mod we just place some trailers and wire but it would be nicer for players to do this with a build menu. See https://www.youtube.com/watch?v=plOxZSJLBiU for current operations

hollow lantern
# robust tiger I think this is what you're searching for https://community.bistudio.com/wiki/se...

do you have maybe a real word example of the command? I'm currently trying to build mine but I have some values I have no clues on what to put: sqf _aircraft setVelocityTransformation [ getPos _aircraft, _destination, velocityModelSpace _aircraft, [0,10,0], vectorDir _aircraft, _nextVectorDir, // idk what will be the next vectorUp _aircraft, _nextVectorUp, // // idk what will be the next 1 ];
_destination is an array of coordinates. _aircraft is the helicopter object

round scroll
#

I use it there like sqf _plane setVelocityTransformation [ getPosASL _plane, _pos2, [0, 0, 0], [0, 0, 0], vectorDir _plane, vectorDir _plane, [0, 0, 1], [0, 0, 1], 0.1 ];

hollow lantern
#

uuuuh, I gonna check that, THANKS. My goal is basically to let a chopper peform a hard landing. Like a real life pilot would do.

round scroll
#

I used setVelocity and flyInHeight back in 2013 in some missions ... but the sqf moved forward, luckily

hollow lantern
#

yeah my math isn't that advanced, which is probably the reason for my struggle. Gonna see if setVelocityTransformation or setVelocityModelSpace fits

hollow lantern
#

seems like setVelocityModelSpace could be the way to go, just need to figure that command out how to make it properly usable. Your implementation of setVelocityTransformation seems to work, but not as good as I hoped. It seems more static and built for moving on the ground. But that's probably because I don't use the command to it full extend

valid abyss
#

Hi, is there any way to check how many types of an item a person has in their inventory?

hollow lantern
#

so depending on the item you could something like ```sqf
if ("ItemName" in (items _unit)) then
{
// script

};```

valid abyss
#

Thanks!

still forum
#

in returns a boolean

#

comparing it to a number doesn't make sense

hollow lantern
#

ah, my bad

still forum
#

"how many types of an item" what do you mean by that? "an item" is always the same item thus the same type?
How can the same item be different types?

little raptor
#

he probably meant types of items

#

anyway, I guess it needs an arrayIntersect (to get unique items)

#

then getting the types (but again, what kind of types?)

#

then another arrayIntersect meowsweats

still forum
#

Better wait on explanation of what was actually meant instead of just throwing in random maybe solutions that probably don't solve the problem

little raptor
#

yeah notlikemeow

#

I didn't write anything anyway

#

it's just a "general" approach

little raptor
valid abyss
#

What exactly will this do?

still forum
#

{_x == "itemName"} count items player
but, if you use ACE mod or similar mods where you have hundreds of item in inventory, that can get very expensive very quick

little raptor
still forum
#

and your count is wrong too

valid abyss
#

Thanks for your help!

little raptor
still forum
#

your cnt will be 1

cosmic lichen
#

true 😄

little raptor
#

fixed

still forum
errant swan
#

hello all

#

sorry if this is stupid or maybe im jumping into fast but im having a lot of trouble with markers

#
_artymissions = player getVariable ["artymissions", 0];
_markername = str format ["arty_marker_%1_%2", _artymissions, _side];

player onMapSingleClick {player setVariable ["artySelected", true]; player setVariable ["artyCooldown", true]; _artymarker = createMarker [_markername, _pos, 1]; _artymarker setMarkerShape "RECTANGLE"; _artymarker setMarkerBrush "DIAGGRID"; _artymarker setMarkerColor "ColorRed"; _artymarker setMarkerSize [300, 300];};

when i actually run a systemChat it does show that the marker name has increased, but it does not create a new marker except for the first one, which tells me that _artymarker = createMarker is reading _markername as the same as before or it is not getting assigned _markername

cosmic lichen
#

notlikemeow You trying to fill the line in your text editor 😄

still forum
#

_markername is a undefined varaible

#

in your onMapSingleClick

#

player onMapSingleClick
thats a syntax error. onMapSingleClick doesn't take a unit on left side (okey it could, but thats nonsense)

errant swan
#

according to the wiki it does thats why iwas using it that way lol

still forum
#

yes you can pass a parameter

#

but the parameter you are passing is nonsense

#

you should rather pass the _markername as parameter, because that one you actually need

errant swan
#

ah i see that makes more sense thank you

#

it seems i misread the wiki in my sleepless stupor, thanks for the help mate.

brazen lagoon
#

Is there any way to select map objects near you that aren't like... trees? like the brush on the ground.

cosmic lichen
#

nearestTerrainObjects

brazen lagoon
#

yeah that doesn't select the brush

#

or bushes rather

bitter spire
#

Hey guys, leaving this here before i am going to bed:

i wanted all passengers of my helo "h1" to get unconscious upon impact. I tried using a trigger which was activated when the helo touches down and that worked, but i can't make my passengers black out.

I tried fullCrew h1 setUnconscious true, but that didnt work.

I am quiet new to this, I will look back at this when i wake up. Hope you can help me.

errant swan
# brazen lagoon yeah that doesn't select the brush

this is an example from my FOB script ```sqf
_terrainObjects = nearestTerrainObjects [getPos _holder, [], 40];

the [] means it searches without a filter so it grabs everything from trees, rocks, bushes, buildings, etc

if you want to just search for bushes add "BUSH" inside the []
brazen lagoon
#

@errant swan these are objects that don't show up with nearestTerrainObjects

half spear
#

I'm setting up a script to cause a specific player to explode when they die on a chance (variables are currently set to maximise possibility for testing). The player will die early but no explosive is spawned or set off like I hoped. Any idea as to why?

/*
    Author: Dev

    Description:
    Dreadnaught Explosion on Death

    Parameter(s):

*/

_unit = _this select 0;

if (isServer) then 
{

    _unit addMPEventHandler ["MPHit", {params ["_unit"];
        if (damage _unit > 0.01 and alive _unit) then 
        {
            _var = selectRandom [0,1];;
            if (_var == 0) then 
            {
                _pos = _unit modelToWorld [0,0,0];
                _unit setCaptive false;
                _claymore = "TIOW_melta_bomb_placeable" createVehicle position _unit;
                _claymore spawn
                {
                    sleep 1;
                    _this setDamage 1;
                };
                _unit allowDamage true; 
                _unit setDamage [1, true];        
            };
        };
    }];
};
little raptor
worthy willow
#

This runs when they take any damage

half spear
#

Yes. That’s to make it happen immediately rather than after I chunk their health pool

little raptor
#

if you want it to happen immediately after their death use "killed" event handler

half spear
#

Script activates upon the target taking damage in excess of 0.01

little raptor
#

what this does is randomly spawn an explosive if the unit has taken more damage than 0.01 and they're alive

half spear
#

They are a modded unit so have a significantly larger health pool

#

It spawns it in and kills them

#

I changed it to work with testing, I’m focussed on getting the explosive to spawn at all

#

I know the kill trigger is activating not the explosive

worthy willow
#

are you sure that is the class name?

half spear
#

For the explosive? Positive

#

I’m trying leopards fix now

little raptor
half spear
#

Replace it with what sorry?

#

OH

#

My bad

exotic tinsel
#

how can enable a player to keep moving and shooting when i create a cam for them?

half spear
#

I'm getting a "missing ;" error now:


if (isServer) then 
{

    _unit addMPEventHandler ["MPHit", {params ["_unit"];
        if (damage _unit > 0.01 and alive _unit) then 
        {
            if (random 1 >=0) then 
            {
                _pos = _unit modelToWorld [0,0,0];
                _unit setCaptive false;
                _claymore = "TIOW_melta_bomb_placeable" createVehicle _pos _unit;
                _claymore spawn
                {
                    sleep 1;
                    _this setDamage 1;
                };
                _unit allowDamage true; 
                _unit setDamage [1, true];        
            };
        };
    }];
};```
#

Supposedly on the _claymore = bomb line

worthy willow
#

_pos _unit

#

Should just be _pos

half spear
#

True as I defined it earlier

#

Thank you

exotic tinsel
#

@half spear you shouldnt use "and" in your if do this instead ((damage _unit > 0.01) && (alive _unit))

half spear
#

Ok I fixed that one up as well

exotic tinsel
#

is it working now?

half spear
#

Giving it a test rn

verbal saddle
half spear
#

I fixed that thanks to Jimbo but it still isnt working

#

if (isServer) then 
{

    _unit addMPEventHandler ["MPHit", {params ["_unit"];
        if ((damage _unit > 0.01) && (alive _unit)) then 
        {
            if (random 1 >=0) then 
            {
                _pos = _unit modelToWorld [0,0,0];
                _unit setCaptive false;
                _claymore = "TIOW_melta_bomb_placeable" createVehicle _pos;
                _claymore spawn
                {
                    sleep 1;
                    _this setDamage 1;
                };
                _unit allowDamage true; 
                _unit setDamage [1, true];        
            };
        };
    }];
};```
verbal saddle
#

do you get an error?

half spear
#

Nope

verbal saddle
#

Does the player die?

half spear
#

Yeah

#

They die short of their normal health pool too

verbal saddle
#

Make sure the classname is correct, you want to be spawning the cfgammo variant not cfgweapon or cfgmagazine

#

The _placeable gives it away as probably a magazine class rather then an ammo class

half spear
#

I'm trying to spawn the variant that is accessible from the editor, not entirely sure which one that is

verbal saddle
#

That would be the magazine varient

half spear
#

It is under the explosive category

verbal saddle
#

If you place it in the editor, then right click on it and click Find in config viewer IIRC what parent class is it under?

half spear
#

CfgVehicles

#

configfile >> "CfgVehicles" >> "TIOW_melta_bomb_placeable"

verbal saddle
#

have a look on the right hand side and look for an ammo = line

exotic tinsel
#

I am creating an external camera for a few seconds for the player but i would like them to be able to keep moving and shooting while viewing the camera. how can i do this?

half spear
verbal saddle
#

That's the classname you want to spawn

little raptor
half spear
sacred slate
#

somthing is wrong with this, it works if i use it in the ingame console, but if i exec it over ini, it fails with "undefined variable" for the marker_isp. its a normal elipse marker.

hqblu = [marker_isp, 500, 500, 10, 0, 0, 0] call BIS_fnc_findSafePos;
verbal saddle
exotic tinsel
#

@verbal saddle @little raptor thanks

verbal saddle
half spear
#

Still no dice 😦

#

if (isServer) then 
{

    _unit addMPEventHandler ["MPHit", {params ["_unit"];
        if ((damage _unit > 0.01) && (alive _unit)) then 
        {
            if (random 1 >=0) then 
            {
                _pos = _unit modelToWorld [0,0,0];
                _unit setCaptive false;
                _claymore = "TIOW_melta_bomb_placeable_Ammo" createVehicle _pos;
                _claymore spawn
                {
                    sleep 1;
                    _this setDamage 1;
                };
                _unit allowDamage true; 
                _unit setDamage [1, true];        
            };
        };
    }];
};
bitter spire
little raptor
#

it probably returns null

half spear
#

nothing came up while ingame

#

is there a specific window?

verbal saddle
#

systemChat outputs to the chat box

half spear
#

yeah nothing came up?

#

if (isServer) then 
{

    _unit addMPEventHandler ["MPHit", {params ["_unit"];
        if ((damage _unit > 0.01) && (alive _unit)) then 
        {
            if (random 1 >=0) then 
            {
                _pos = _unit modelToWorld [0,0,0];
                _unit setCaptive false;
                _claymore = "TIOW_melta_bomb_placeable_Ammo" createVehicle _pos;
                systemChat str _claymore;
                _claymore spawn
                {
                    sleep 1;
                    _this setDamage 1;
                };
                _unit allowDamage true; 
                _unit setDamage 1;
    
            };
        };
    }];
};```
cosmic lichen
#

if (random 1 >=0)
???

cosmic lichen
#

_pos = _unit modelToWorld [0,0,0];
???

half spear
#

makes the position 0,0,0 relative to the unit

little raptor
#

random 1 >= 0: always true

winter rose
half spear
#

I want it be to be true for testing as I'm not testing the chance I'm testing if the explosive will spawn, which it isnt

little raptor
#

are you sure your MPHIt even tirggers?

half spear
#

the 0,0,0 is just because I based it off another script that was for 1m ahead, looking at it now I don't need it

#

According to the code I'm basing it off of (TIOW Necrons) it does

#

if (isServer) then 
{

    _unit addMPEventHandler ["MPHit", {params ["_unit"];
        if (damage _unit > 0.1 and alive _unit) then 
        {
            _var = selectRandom [0,1,2,3];;
               _unit setObjectMaterialGlobal [1,"TIOW_NecronWarrior\Data\TIOW_NecronWarrior_Wound.rvmat"];
            _unit allowDamage false; 
            _unit setCaptive true;
               [_unit, ("TIOW_NecronWarrior_ReanimateDown"+str(_var))] remoteExec ["switchMove", 0];
               _unit disableAI "ANIM";                
            if (_var == 0) then 
            {
                _unit setCaptive false;
                _unit allowDamage true; 
                _unit setObjectMaterialGlobal [1,"TIOW_NecronWarrior\Data\TIOW_NecronWarrior_Dead.rvmat"];
                _unit setDamage [1, true];        
                
            } else {
                [_unit, _var] spawn 
                {
                params ["_unit", "_var"];
                sleep (5 + random 30);
                [_unit, ("TIOW_NecronWarrior_ReanimateUp"+str(_var))] remoteExec ["switchMove", 0];            
                _unit setDamage 0;
                _unit setCaptive false;
                _unit enableAI "ANIM";    
                sleep 5;
                _unit setObjectMaterialGlobal [1,"a3\data_f\lights\car_panels.rvmat"];    
                [_unit, "TIOW_NecronWarrior_idle_rifle"] remoteExec ["switchMove", 0];            
                _unit allowDamage true; 
    
                };
            };
        };
    }];
        
    _unit addMPEventHandler ["MPKilled", {params ["_unit"];
        if (!alive _unit) then
        {
           _unit setObjectMaterialGlobal [1,"TIOW_NecronWarrior\Data\TIOW_NecronWarrior_Dead.rvmat"];
        };
    }];    
};```
#

Necron revival script

#

brb

winter rose
unique sundial
#

_unit setObjectMaterialGlobal is bad

#

MP event triggers globally already

half spear
#
_unit = _this select 0;

if (isServer) then 
{

    _unit addMPEventHandler ["MPHit", {params ["_unit"];
        if (damage _unit > 0.1 and alive _unit) then 
        {
            _var = selectRandom [0,1,2,3];;
               _unit setObjectMaterialGlobal [1,"TIOW_NecronWarrior\Data\TIOW_NecronWarrior_Wound.rvmat"];
            _unit allowDamage false; 
            _unit setCaptive true;
               [_unit, ("TIOW_NecronWarrior_ReanimateDown"+str(_var))] remoteExec ["switchMove", 0];
               _unit disableAI "ANIM";                
            if (_var == 0) then 
            {
                _unit setCaptive false;
                _unit allowDamage true; 
                _unit setObjectMaterialGlobal [1,"TIOW_NecronWarrior\Data\TIOW_NecronWarrior_Dead.rvmat"];
                _unit setDamage [1, true];        
                
            } else {
                [_unit, _var] spawn 
                {
                params ["_unit", "_var"];
                sleep (5 + random 30);
                [_unit, ("TIOW_NecronWarrior_ReanimateUp"+str(_var))] remoteExec ["switchMove", 0];            
                _unit setDamage 0;
                _unit setCaptive false;
                _unit enableAI "ANIM";    
                sleep 5;
                _unit setObjectMaterialGlobal [1,"a3\data_f\lights\car_panels.rvmat"];    
                [_unit, "TIOW_NecronWarrior_idle_rifle"] remoteExec ["switchMove", 0];            
                _unit allowDamage true; 
    
                };
            };
        };
    }];
        
    _unit addMPEventHandler ["MPKilled", {params ["_unit"];
        if (!alive _unit) then
        {
           _unit setObjectMaterialGlobal [1,"TIOW_NecronWarrior\Data\TIOW_NecronWarrior_Dead.rvmat"];
        };
    }];    
};```
#

This isnt mine

#

This is what I'm basing it off

#
_unit = _this select 0;

if (isServer) then 
{

    _unit addMPEventHandler ["MPHit", {params ["_unit"];
        if ((damage _unit > 0.01) && (alive _unit)) then 
        {
            if (random 1 >=0) then 
            {
                _pos = _unit modelToWorld [0,0,0];
                _unit setCaptive false;
                _claymore = "TIOW_melta_bomb_placeable_Ammo" createVehicle _pos;
                systemChat str _claymore;
                _claymore spawn
                {
                    sleep 1;
                    _this setDamage 1;
                };
                _unit allowDamage true; 
                _unit setDamage 1;
    
            };
        };
    }];
};```
half spear
#

Anyone know the class name for an easy explosive, I'll attempt a test with that

verbal saddle
#

Here's a simple version that works,

_unit addMPEventHandler ["MPHit",
{
    params [["_unit", objNull, [objNull]]];
    if (random 1 >= 0.8 || true) then 
    {
        private _claymore = createVehicle ["DemoCharge_Remote_Ammo", getPosATL _unit, [], 0, "CAN_COLLIDE"];
        _claymore setDamage 1;
        _unit setDamage 1;  
    };
}];

When the unit gets hit > if the random check passes or true (for testing), then it spawns the bomb, blows it up and kills the player to make sure they are dead.
You can add to the condition to change when it triggers and you can add to when it does trigger.

#

Then once you have finished testing remove the || true which will mean it only runs if the rest of the condition returns true

half spear
#

and this 100% works?

#

I have a feeling it might be the unit causing the issue

verbal saddle
#

Yes, I've tested it

little raptor
# unique sundial MP event triggers globally already

This EH is clever enough to be triggered globally only once even if added on all clients or a single client that is then disconnected, EH will still trigger globally only once.
doesn't this mean it triggers only once?!

#

because I thought that's what it means meowsweats

half spear
little raptor
#

how are you even testing it?

half spear
#

the script is attached to the vehicle (unit) through a addon config and then I go to a virtual arsenal and shoot the bastard

little raptor
#

the script is attached to the vehicle (unit) through a addon config
wat?

half spear
#

I made a mod and the vehicle references the script

little raptor
#

how exactly?

half spear
#
class CfgVehicles
{
    class WBK_DT_5;
    class Exploding_Dreadnaught_CONS:WBK_DT_5
    {
        scope = 2;
        scopeArsenal = 2;
        scopeCurator = 2;
        displayName = "CONS Dreadnought (Exploding)";
        class EventHandlers
        {
            init = "_this execVM '\Dreadnaught_go_BOOM\Scripts\DreadnaughtExplosionScript.sqf';";
        };
        
    };
    
    
    
    
};```
#

Things can never be simple hahaha

verbal saddle
#

Have you checked to make sure it's actually running the file?

little raptor
ember path
#

i have a trigger that when players enter it activates and should execute
[introplane] spawn BIS_fnc_planeEjection
but nothing happens? I looked up the wiki and im a bit confused how BIS_fnc_planeEjection even works...

half spear
#

I just made some sideChat checks, so lets see

little raptor
ember path
#

i dont.. know, someone said they used that to create a script that ejects players from a plane....but

#

idk

#

so like even just [] does nothing

little raptor
#

that wat wasn't for you

ember path
#

i see

little raptor
#

I mean what on earth is that?!

ember path
#

zero clue xd

little raptor
#

better open the function file (or in function viewer) and see yourself

half spear
#

Ok so, checks say the script is loading, the if statement isnt

#

_unit = _this select 0;
[west, "HQ"] sideChat "Script loaded"; /* appears*/
_unit addMPEventHandler ["MPHit",
{
    params [["_unit", objNull, [objNull]]];
    if (random 1 >= 0.8 || true) then 
    {
        [west, "HQ"] sideChat "Script executing"; /* Does not appear */
        private _claymore = createVehicle ["DemoCharge_Remote_Ammo", getPosATL _unit, [], 0, "CAN_COLLIDE"];
        _claymore setDamage 1;
        _unit setDamage 1;  
    };
}];
ember path
#

(i think my best bet is to check if theres scripts in dynamic recon ops pbos, because i know that mission ejects you from a plane)

little raptor
unique sundial
bitter spire
#
player setUnconscious true forEach fullCrew h1;
player setvariable ["ACE_isUnconscious", true, true] forEach Crew h1;

I was trying to get all passengers to go unconscious, thanks to you it worked, but now i want them to wake up again after, say 30s.
The passengers will be ejected right after this line.

half spear
little raptor
bitter spire
little raptor
#

then why did you say:

thanks to you it worked
?

bitter spire
#

well somehow it did

half spear
little raptor
#

that literally means the same thing (but even more robust)

#

if it doesn't work the problem is somewhere else

bitter spire
#

well the passengers get unconscious, but i don't know how to make them wake up again

little raptor
bitter spire
#

Thank you, sorry for the inconvenience xD

still forum
#

"ACE_isUnconscious", false might not be enough to trigger a wakeup. If it doesn't work you might need to adjust the script

little raptor
#

I think it did (at least in SP) meowsweats
but I don't remember very well

still forum
#

the statemachine transition might only be triggered by event. I fiddled with that last week

little raptor
#

oh

still forum
#

["ace_medical_wakeup", player] call CBA_fnc_localEvent;

little raptor
#

yeah I think it checked constantly before

#

that event alone wakes them up then?

#

or is there more?

#

also what about becoming unconscious?
that variable alone still doesn't trigger the event right?

proud yacht
#

hey, so I made a script for calling in fire support, and I want the script to hold between each action, Im not sure if Im saying it right, can anyone help me?

[west, "FireBird 2-1"] sideChat "Target aquired, going in for attack";
// wait 30 sec
[west, "FireBird 2-1"] sideChat "Rifle";
// wait 20
scriptedCharge = "2Rnd_Missile_AA_04_F" createVehicle (laserTarget jtac1);

So my question is what to add insted of the //wait for it to acutely wait.....
(sorry if my question is very dumb, Im still learning all😅 )

warm hedge
#

sleep

proud yacht
#

sleep and then like how much time? like sleep 20 ?

warm hedge
proud yacht
#

thx so much!

ember path
#

okay so i can seem to figure out how to just tell the ai to drive this plane and have players eject.. even if i dont make a script that ejects players, and i do it manually the ai says like get back in the vehicle, and then plummets down.. and i really dont wanna record the movement cuz i suck at flying xd

hallow mortar
ember path
#

and i think theres no way to do this via waypoints? all waypoints seem to tell the plane to land

little raptor
#

do you mean with ejection seats?

ember path
#

no

little raptor
#

if you just want to throw them out use moveOut

ember path
#

i mean like halo jump

hallow mortar
#

When using the [side,"identity"] syntax, the identity string must be an identity that exists in CfgHQIdentities, and I don't think "Firebird 2-1" is one

little raptor
ember path
#

i'll try, hopefully the ai driver doesnt freak out again

little raptor
#

it has nothing to do with the driver

proud yacht
ember path
#

yeah, but if i for example eject... like..double tapping v, the driver freaks out and starts plummeting down to get players

hallow mortar
little raptor
hallow mortar
proud yacht
#

ok, thx 🙂

hallow mortar
#

Note the arrangement of parameters for the unit-based syntax is different, e.g. you don't need the side param. See the wiki page for details

ember path
hallow mortar
#

Also also, if this is a multiplayer script, you'll [Tapoz] need to make sure it's locality-safe as many of the commands you're using are local (either they only take effect on the client that executes them, or they only have an effect when executed where the target is local)

hallow mortar
#

That's fine then

thorn saffron
#

Is there a way to have dynamic text on a bilboard or something? Like some kind of ingame console. I want to display some text that is dynamically set during the mission. One way could be 3D icon, but it is a bit derpy solution

hallow mortar
#

You could choose from a set of premade textures with various options. I don't think you could do fully dynamic text without setting up the billboard to use the license plate system or something, and that would be a mod

half spear
#
params ["_unitD"];
[west, "HQ"] sideChat "Script loaded";
_unitD addMPEventHandler ["MPHit",
{
    params [["_unitD", objNull, [objNull]]];
    if (random 1 >= 0.8 || true) then 
    {
        [west, "HQ"] sideChat "Script executing";
        private _claymore = createVehicle ["DemoCharge_Remote_Ammo", getPosATL _unitD, [], 0, "CAN_COLLIDE"];
        _claymore setDamage 1;
        _unitD setDamage 1;  
    };
}];
little raptor
#

did you use sub-classes as I said?

half spear
#

Ty

dusty whale
#

Is there a way to check the reload state of a tank gun

#

since the gun cant be fired when it's reloading a new round after firing

copper raven
#

allthough im guessing that EH won't work, as you're reloading a round not the entire mag

willow hound
#

The Reloaded EH only fires after the act and yes, it should only fire for magazines.

winter rose
#

I believe unitReady says false when "can't fire"

willow hound
#

Might be able to grab the reload time from the config and use that together with the Fired EH to establish at least a time span where the main gun is definitely reloading.

maiden heath
#

I have a question:
How do i set up a infantry unit as live target?
Similar to how it´s done in the VR Arsenal for the player, i would like to set up a target range with respawning infantry targets which go on alert/keep standing and respawn.

Would i need some scripting or can i do everything in the editor with some modules or ?

winter rose
#

scripting - this is the way

warm hedge
#

(As I already told you)

maiden heath
#

;_;

warm hedge
#

?

dusty whale
#

setWeaponReloadingTime doesnt work

#

it does nothing

warm hedge
#

Yeah, as the name suggests it sets not gets

dusty whale
warm hedge
#

It does

dusty whale
#

it doesnt

warm hedge
#

It does

dusty whale
#

i set the reload to 0

#

fire the weapon

#

and the reload is as long as it always is

warm hedge
#

That's not how to do use that command. It “re-sets” your rechambering time

dusty whale
#

tried that aswell

warm hedge
#

Not magazine reloading, but rechambering

dusty whale
#

i fired the weapon, set the reload to 0 as it was reloading, and nothing happened

#

YES

#

the rechambering does not get effected by it

#

no matter if i do it before or after i shoot

warm hedge
#

Then you might passing the argument wrongly

dusty whale
#
vehicle player setWeaponReloadingTime [player, currentMuzzle (player), 0.0];```
#

i'm passing that

#

as the gunner of the vehicle

warm hedge
#

currentMuzzle player != currentMuzzle vehicle player

dusty whale
#

vehicle has no muzzle

warm hedge
#

It has

dusty whale
#

it doesnt

warm hedge
#

It has

#

¯_(ツ)_/¯

dusty whale
#

the muzzle of the player is the string of the muzzle

#

the muzzle of the vehicle is an empty string

#

go figure

#

even the example script gets the muzzle of the gunner

#

_success = _vehicle setWeaponReloadingTime [gunner (vehicle player), currentMuzzle (gunner (vehicle player)), 0.5];

#

not the muzzle of the vehicle

#

using the "muzzle of the vehicle" fails the command, returning false

#

the command im using returns true

#

but has no effect

warm hedge
#

Ah sorry I'm remembering wrong indeed

#

Aaaand... I guess the _vehicle is not defined on your end so it's not working? Otherwise it's working correctly

dusty whale
#

that is the example script

warm hedge
#

wha?

dusty whale
#

read the script i sent that im using

dusty whale
#

the one youre quoting is the example script

warm hedge
#

Couldn't see where's the difference between yours?

dusty whale
#

read the context

#

vehicle player not _vehicle

#

vehicle player returns the vehicle the player is in

warm hedge
#
vehicle player setWeaponReloadingTime [gunner (vehicle player), currentMuzzle (gunner vehicle player), 0];```
still forum
#

New stuff for HashMaps, feedback please

createHashMapFromArray [[key,value],[key,value],...] already existed.
[key, key, ...] createHashMapFromArray [value, value, ...] new alt syntax.
in alt syntax, both keys and values arrays need to be same size. Otherwise it will return empty hashmap.

New
toArray hashMap returns [[key, key, ...],[value, value, ...]]
hashMap toArray true returns [[key, key, ...],[value, value, ...]] (its just an alias and internally just calls toArray hashMap
hashMap toArray false returns [[key,value],[key,value],...] (This is performance wise inefficient, as engine needs to create tons of small arrays
Example
toArray hashMap params ["_keys", "_values"]

Current code
hashMap insert [[key,value],[key,value],...]
New alt syntax
hashMap insert [true, [key, key, ...],[value, value, ...]]
hashMap insert [false, [key,value],[key,value],...] (alias to current insert command)

More info: #community_wiki message
I'm still writing the code so now's the time for feedback. But I think this is the best solution

copper raven
dusky pier
#

@still forum i used it in my scripts, rly good thing - didn't find errors yet 👍

interesting thing - u can use it like JSON - something like map in map, works good

will be nice to have syntax (analog for get command - map.key or map.[key,defaultValue]) - something like work objects in js

still forum
#

would be potentially nice, but won't do

copper raven
#

it would be map."key" though right? 😄

dusky pier
copper raven
#

map.(configFile >> "cfgVehicles") map.{hint "hi";} how weird does that look xD

winter rose
#
myMap.get(configFile >> "CfgVehicles"); // Java
myMap[configFile >> "CfgVehicles"]; // PHP
little raptor
exotic flax
#
HAI 1.2
   CAN HAS ARMA?
   I HAS A HASHMAPZ ITZ MAPZ configFile >> "CfgVehicles"
KTHXBYE

LOLCODE anyone? 🤣

little raptor
#

😒

drifting girder
#

hey guys, i've created a "missionScore" variable in my mission's init but i'm not exactly sure how to make it so that it goes up when an objective is completed

#

i know it's missionScore = missionScore + 1 but i'm not exactly sure where to put it

exotic tinsel
#

@drifting girder give this a read to help you understand how to understand how they work.
https://community.bistudio.com/wiki/Variables
You would change the variable in a trigger or in your code that gets fired when the objective is complete.

#

I created a cam using camCreate that orbits the player for a few seconds. issue is that it looks choppy when player is moving or in vehicle moving. Even though im getting 70 FPS. camera shake is off but it still looks glitchy. is there something i can do to smooth it out?

winter rose
#

Nope, unless we see an issue with your code

exotic tinsel
#
v_feature_144_cam = "camera" camCreate _destination;
v_feature_144_cam camSetPos _destination;
v_feature_144_cam camSetTarget _player_object;
v_feature_144_cam cameraEffect ["External", "FRONT"];
v_feature_142_cam camSetFocus [-1, -1];
v_feature_144_cam camCommit 0;
v_feature_144_cam switchCamera "Internal";
showCinemaBorder false;

private _degree = 0;
while {!(v_feature_144_cancel)} do
{
    if (_degree >= 360) then
    {
        _degree = 0;
    };
    _destination = _player_object getRelPos [_maxLength, _degree];
    _destination = [_destination select 0, _destination select 1, ((getPosASL _player_object select 2) + (_maxHeight + 5))];
    v_feature_144_cam camSetPos _destination;
    v_feature_144_cam camSetTarget _player_object;
    v_feature_144_cam camCommit 0;
    _degree = _degree + 0.5;
    sleep (accTime / (diag_fps * 2));
};
crude vigil
#

@exotic tinsel

  1. Try setting camCommit after camSetTarget to 0.01 or 0.005 based on ur preference.
  2. getPosVisual _player_object instead of _player_object might help.

Out of topic: Is there a reason why among 144s , there is a 142 there on camSetFocus line?

winged wing
#

sleep (accTime / (diag_fps * 2)); -> sleep 0.001;
_degree = _degree + 0.5; -> _degree = _degree + 0.5 * accTime;

gleaming imp
#

Hello guys, i am trying to create a "railguard" for a bridges made from Airstrip platform
i want it to be spawned from script to reduce size mission file. Any idea how to do it?
i tried this but this is probably not the way...

private ["_bridge","_most","_pos","_guard1", "_guard2","_guard3"];
{
        _bridge = [];

    {

        _most = {getPos _x } forEach (nearestObjects [[9000,9000,0], ["Land_AirstripPlatform_01_F"], 999999]);



        _bridge pushBack  _most;

    };

    {
        _guard1 = createVehicle ["Land_Concrete_SmallWall_8m_F", _bridge, [], 0, "NONE"];
        _guard2 = createVehicle ["Land_Concrete_SmallWall_8m_F", _bridge, [], 0, "NONE"];
        _guard3 =createVehicle ["Land_Concrete_SmallWall_8m_F", _bridge, [], 0, "NONE"];

    } forEach _bridge;
};

and i want those railguards in relative position for each object. so it wont take surface level and will be parallel to that object surface

crude vigil
#

@gleaming imp Check the pinned message for code formatting.

exotic tinsel
#

@crude vigil
thank you and 144 is for the feature this code belongs to.

#

@winged wing thank you

willow hound
exotic tinsel
#

@crude vigil @winged wing
I applied both of your suggestions but unfortunately it did not help. Here is a vid of what is happening.
https://imgur.com/a/vdsq31U
the camera is till glitchy even though the fps is high.

willow hound
#

Probably because of camCommit 0.

#

You keep teleporting the camera instead of letting it smoothly glide to the next position.

gleaming imp
#

i want to create it for one object and repeat it for every object "platform" on map

willow hound
#

Okay, now, what is _most used for?

gloomy aspen
#

Hey guys can anybody help me with this? I would like to have this work with a trigger defining the area instead of a area marker .. But simply changing the area marker to a trigger doesnt work :/


private _myWhiteList = ["782485734"];

while {true} do
{
    {
        if (!(getPlayerUID _x in _myWhiteList) && (_x inArea "zoneA")) then
        {
            _x setPos getMarkerPos "zoneTP";// or getPos "zoneB", depending on what the zones are
        };
    } count allPlayers;
    sleep 0;
};```

P.s. I read inArea on the BIKI but couldnt quite figure it out
willow hound
#
_x inArea MyTrigger
```Should work though, provided your trigger is referenced by `MyTrigger`. What did you try?
copper raven
#

he has a string in there leftover from a marker

#

thats probably why

#

_x inArea "zoneA"

_x inArea zoneA

gleaming imp
willow hound
#

Does your bridge span two million meters? 🤨

gleaming imp
#

its just for testing 😄

willow hound
gloomy aspen
#

Will give that a go @willow hound & @copper raven thanks 🙂

crude vigil
#

@exotic tinsel isnt camSetTarget always targeting player, why is it inside while? If you remove it , it will be fixed most likely. This issue is happening because you are spamming camSetPos and camSetTarget together.

gloomy aspen
#

@copper raven @willow hound yeah fixed it, cheers guys! Needed the " " removing! 😄

exotic tinsel
copper raven
#

its because cam target is the person and not the tank iirc

exotic tinsel
#

@copper raven its the tank.

copper raven
#

ah didn't read the pastebin, _player_object 😄

exotic tinsel
winged wing
# gleaming imp Hello guys, i am trying to create a "railguard" for a bridges made from Airstri...
{
    private _platform = _x;
    private _platformDirAndUp = [vectorDir _platform, vectorUp _platform];
    {
        private _wall = createVehicle ["Land_Concrete_SmallWall_8m_F", [0, 0, 0], [], 0, "CAN_COLLIDE"];
        _wall setVectorDirAndUp _platformDirAndUp;
        _wall setPosASL AGLtoASL (_platform modelToWorld _x);
    } forEach [[5, -5.8081055, 13.806], [-5, -5.8081055, 13.806], [-5, 5.8081055, 13.806], [5, 5.8081055, 13.806]];
} forEach allMissionObjects "Land_AirstripPlatform_01_F";
copper raven
#

try camCommitting the same time you sleep? @exotic tinsel

exotic tinsel
#

@copper raven uh thats not a function. i do use camCommit in the while before the sleep.

copper raven
#

i meant the exact same delay as your sleep, you commit for 0.01, but sleep for a different amount, whatever that is, doesn't make sense

exotic tinsel
#

testing now

#

no improvement unfortunately. i have to be doing something fundamentally wrong.

copper raven
crude vigil
#

@exotic tinsel It works fine if you set camCommit to higher value...

#

tried with 0.5, 0.25,0.1

exotic tinsel
#

what degrees?

crude vigil
#

I didnt change any degree at all

#

wait I did, 0.1...

#

Almost same effect..

exotic tinsel
#

sleep time?

#

@crude vigil

crude vigil
#

didnt change it

#

sleep time and camCommit do not need to be same. You can camCommit a new camera position before previous camCommit is done, that is how you achieve smoothness, otherwise you would just be waiting for it to finish and then be changing position which would have some sort of tick-tocking effect of a clock hanged on a wall.

copper narwhal
#

Is it possible to prevent a player changing weapon attachments in the vanilla inventory but still allowing the likes of the ACE3 interaction menu to change attachments? If so would it be done using an eventhandler of some sort? 🤔

crude vigil
#

@exotic tinsel Be careful though, if you change timeAcceleration to interesting values, it may be obvious it is not exactly drawing a perfect circle around it (cos vehicle is moving so the rotation effect becomes a bit imperfect. To perfect it , you would need another while loop that camCommit spamming the new value from max value you define to as closest to 0. But I wouldnt suggest it as it is unnecessarily too much computation there.

#

Just make sure you test any potential timeAcc value you can have in your mission. Just saying because for some reason u bound your values to timeAcc...

heady quiver
#

Hi guys i've finally tested my mission today with a friend and came a cross a couple of bugs but one of them was weird, i couldn't hear my friend shooting and he couldnt hear me shooting. any one knows why this is 🤔

little raptor
heady quiver
#

-.-

#

why you bully me 😦

little raptor
#

it was a joke

heady quiver
#

i know

#

he he

#

Sound was fine, i heard the bullet impact just not the shooting lol.

past wagon
#

if I have 10 units all on the blufor side, if I do

blufor setFriend [blufor, 0];

will it make it so that
a) when a blufor kills a blufor, it wont be deemed "friendly fire"
b) players cannot see each other on the map, nor can they see blufor vehicles

little raptor
past wagon
#

damn

#

i will test it out to know for sure

#

but here is my current dilemma

#

a) I need to make it so that when players kill each other it is not considered friendly fire
b) players cannot see blufor vehicles on the map
c) players can open all crates (which are on the civilian side)

#

currently I have all players on the civilian team

#

any ideas?

crude vigil
#

@past wagon setRating -10000 ? ^^

past wagon
#

wouldnt that be the same thing as

civilian setFriend [civilian, 0];

?

crude vigil
#

I know even if u setFriend 0 a civilian, no one will attack them, altho I never tried civilian to civilian, maybe it is a different scenario...

#

so probably no.

#

setRating below a level puts those now sinners into a faction called sideEnemy

past wagon
#

ok

#

also this isnt for AI

#

this is for multiplayer

#

@crude vigil if I put

player addRating -10000;

in initServer.sqf, will that set the rating for all players who join the game?

crude vigil
#

initPlayerLocal.sqf or something like that...

past wagon
#

oh yeah thats what I meant

#

*initPlayerLocal.sqf

exotic tinsel
#

@crude vigil am i supposed to be creating a new camera over and over?

crude vigil
#

@exotic tinsel No?

exotic tinsel
#

@crude vigil I still can not get a smooth ride even with the suggestions. its really bad if im flying.

crude vigil
#

the faster the vehicle is , that issue will occur more severly so you ll need to give more time. Alternatively, if you change your method of calculation, you may use getPosVisual instead of getPosWhateverYouUse, which I believe could smoothen that.

#

But still will not solve your issue 100%

past wagon
#
//ADD NEGATIVE RATING
player addRating -10000;

//PLAYER SPAWN RANDOMIZATION
_randomPlayerSpawn = [nil, ["water", "EndZone"]] call BIS_fnc_randomPos;
_playerSpawnX = _randomPlayerSpawn select 0;
_playerSpawnY = _randomPlayerSpawn select 1;
player setPos [_playerSpawnX, _playerSpawnY, 500];

this is all that i have in initPlayerLocal.sqf and it works fine except when players join the mission in progress. Their position does not get set to a random point. they just stay where they are

crude vigil
#

meaning.. you need to wait till player actually becomes player. which can be checked with isNull player iirc.

heady quiver
#

Why does killing a OPFOR operator return CIV?

addMissionEventHandler ["EntityKilled", {
    params ["_unit", "_killer", "_instigator", "_useEffects"];
    systemChat format['%1', side _unit]    ;
}];
crude vigil
#

Because all dead people become civilians.

exotic tinsel
#

@heady quiver all dead are civ

#

he beat me

heady quiver
#

oh.

past wagon
#

welp his day is ruined

heady quiver
#

yea.

#

How in gods name can i check if the killed dude was opfor ?

past wagon
#

maybe for each unit, set their side to a variable, and when they die, check the variable?

crude vigil
#

handleDamage, see if calculated damage sets it to 1

exotic tinsel
#

@crude vigil i agree the getpos method seems to be the problem. Im using getRelPos which enables me to get a position x meters and x degrees away from object. Do you know the maths for calculating a 10m and 20degrees from a an asl pos? or a link to such maths

crude vigil
#

My support here does not involve math notlikemeowcry

exotic tinsel
#

lol rgr

crude vigil
#

Otherwise I tried it on your code without putting too much time on it.

#

but lost consistency so I gave up.

past wagon
crude vigil
#

Wouldnt hurt trying right? I dont see any other answer given that you could try.meowtrash I have a guess why it could be happening only to JIP but I am not a mission maker.

past wagon
#

ok

#
remoteExec [systemChat "asdfasdfasdfasdfasdf"];
#

would that show the message for all players?

crude vigil
past wagon
#

ohhhhh

#

thanks

past wagon
#

I dont know what to put for the else statement

#

i would need it to return to line 1

crude vigil
#
waitUntil {!isnull player};
//ADD NEGATIVE RATING
player addRating -10000;

//PLAYER SPAWN RANDOMIZATION
_randomPlayerSpawn = [nil, ["water", "EndZone"]] call BIS_fnc_randomPos;
_playerSpawnX = _randomPlayerSpawn select 0;
_playerSpawnY = _randomPlayerSpawn select 1;
player setPos [_playerSpawnX, _playerSpawnY, 500];
past wagon
#

oh

#

waitUntil is what i was looking for

#

got it

#

thanks

crude vigil
#

actually you need to do it at the very beginning (code edited)

#

@past wagon If it still doesnt work, go to #arma3_scenario as it is a problem about it.

past wagon
#

ok

#

thanks

thorn saffron
#

Does anybody here have a simple example of setVelocityTransformation? The ones on BIki are a bit complicated and my google-fu didn't yeld any satisfying results. I think what I have problems with is getting the interval.
I want to smoothly move object from one place to another, nothing fancy.

robust tiger
idle jungle
#

hey guys can i tweak this script so when a building gets to a specific damage level it will auto repair?

_vehicle = (_this select 0);  
_h = [_vehicle]spawn 
{while {true} do 
{ if ((getDammage (_this select 0)) < 0.15) then          
{ (_this select 0) setDammage 0;};           
sleep 120;};};```

```sqf
_x allowDamage false;
} foreach (nearestObjects [[15023.9,17600.6,0], ["house"],10000,true]);```
#

long story short we are having the issue of not being able to shoot out of building windows

robust tiger
#

To its most basic form, setVelocityTransformation is supposed to be used like this (I hope):

private _interval = 0;
private _increment = 1e-2;
private _refreshTime = 0.01;
while{_interval<1}do
{
   _object setVelocityTransformation 
   [
      _startingASL,
      _endASL,
      _startingVel,
      _endVel,
      _startingDirV,
      _endDirV,
      _startingUpV,
      _endUpV,
      _interval
   ];
   _interval = _interval+_increment;
   sleep _refreshTime;
};
#

Then you play around with _refreshTime and _increment to change the speed with which the transformation is performed

heady quiver
#

Is there a way to keep custom loadout on death ?

past wagon
#
sleep 1085;
while { true } do {
    waitUntil { sleep 1; alive player };
    systemChat "You are taking heavy damage because you are not inside the safe zone!";
    if !(player inArea "SafeZone") then {
            player setDamage (damage player + 0.05);
    };
};
#

will this only notify the player who is taking damage? (this is on multiplayer)

spark turret
#

more specifically: use eventhandlers. they react instantly and are far less costly for performance

idle jungle
#

Thank you

wispy cave
#

Is there a way in arma to have strike-through text?(like ~~this ~~) I'm thinking of having a hint/task description along the lines of "help st. Patrick clear Ireland altis of snakes

past wagon
#

how can I make a piece of code repeat a certain amount of times

wispy cave
real tartan
#

I have addMissionEventHandler ["EntityKilled", ... in initServer.sqf where I am checking isPlayer _instigator but due locality sometimes I get false "isPlayer" result

#

what should be the alternative ? _instigator in allPlayers maybe ?

fair drum
fair drum
# real tartan I have `addMissionEventHandler ["EntityKilled", ...` in initServer.sqf where I a...

isPlayer has errors naturally if you check the wiki page which you can't really avoid.
Yes your alternative should work.

In some cases, the identity of certain player units might fail to propagate to other clients and the server, which causes isPlayer and getPlayerUID to incorrectly return false and "", respectively, where the affected units are not local.[1] Therefore, beware of false negatives.

past wagon
#

do I need to use remoteExec if I want to play a sound globally? (playSound)

fair drum
#

yes

past wagon
#

"FD_Finish_F" remoteExec ["playSound"];

#

does that look good?

fair drum
#
["FD_Finish_F"] remoteExec ["playSound", 0]; // Clients and server (global)
["FD_Finish_F"] remoteExec ["playSound", allPlayers]; //All player clients
["FD_Finish_F"] remoteExec ["playSound", group unit]; //All units in a particular squad

ect ect

past wagon
#

but if I dont even put a 0 at the end, it will be 0 by default, right?

fair drum
#

always think

A command B  //normal

[A, B] remoteExec ["command", whereExecuted] //remoteExec
#

yes, it will default 0 and global if you leave out that value

#

I always write it out though

past wagon
#

wait if it is all clients AND server, then will the sound play twice for everyone?

fair drum
#

depends where its executed in the first place

past wagon
#

initServer.sqf

fair drum
#

then no, it won't play twice. it simply cannot play on the server cause it has no interface

#

but if you want, you can use -2 for every client but server

past wagon
#

nah thats fine

fair drum
#

but then its harder to test cause you won't hear anything in singleplayer since you are the server

past wagon
#

yea

#

ok

#

thanks

fair drum
#

now if you were in local space, say init.sqf and you did the same thing, then the sound would play for everyone, every time a client logged in, for however many players

agile pumice
#

is selectRandom broken?

winter rose
agile pumice
#

I also tried BIS_fnc_selectRandom with the following code:

_unit = cursorTarget;
_dismissive = ["I don't wish to talk to you.","I don't know anything.","Go Away!"]; 
if ((player == h1) or (player == h2)) then { 
  _line = [name _unit, [_dismissive] call BIS_fnc_selectRandom];
systemChat str _line; 
  [[_line],"SIDE",0.15,true] spawn Revo_fnc_simpleConv; 
};```
but the systemChat shows ``[Ed Snowe, ["I don't wish to talk to you.","I don't know anything.","Go Away!"]]``
Instead of the random element. ``selectRandom`` yielded the same result.
fair drum
#

LOVE

winter rose
#

ROCK N ROLL!

robust hollow
#

shouldnt it be _dismissive call BIS_fnc_selectRandom?

#

same as selectRandom _dismissive

agile pumice
#

ah, yeah you're right

dusty whale
#

is there a way to get mouse delta?

#

onMouseMoving is a tad bit unreliable

#

as it can get stuck to some value despite the mouse not moving at all

robust tiger
# dusty whale is there a way to get mouse delta?

I think the crux of your issue is the fact that the variable you're saving the mouse deltas to, does not get updated with zeroes when the mouse is static.
There's a complementary event handler "onMouseHolding" whose x and y values are always zero so you should use that to update your variable.
I might be wrong though 🙃

dusty whale
#

that is a good point

#

ofcourse the event handler would not be triggering when the mouse is not moving

#

😅

sacred slate
#

i like to remove weapons from all units in the group indigroup. i don't know why this is wrong:

{ 
 removeAllWeapons this; 
} forEach units IndiGroup;
sacred slate
#

thats it. thx

sacred slate
#

ok

#

another thing i have wrong:

if (({alive _x} count units IndiGroup) < 1) then {nul = [] execVM "myscript.sqf";);
fair drum
fair drum
sacred slate
#

thx

dusty whale
#

is there a way to set a magazine directly into a turret of a vehicle?

#

currently im using loadMagazine

#

but that has the issue that setWeaponReloadingTime doesnt work on it

leaden haven
#

I have an issue with this code.

[missionNamespace,"OnGameInterrupt", {
    params ["_display"];
    _btn3 = ((findDisplay 49) displayCtrl 120) ctrlSetText "Enemy insurgents have invaded Aghanistan. Destroy their assets and remove all enemies to free this suffering nation. This must be carried out in a humanitarian way, minimising damage to civilian assets.";
    hint "me";
}] call BIS_fnc_addScriptedEventHandler;

The hint shows when I press ESC, but the control text will not show. I wish to use the onGameInterrupt event handler, but I think I am missing one small thing.

#

I just want to know how to get started with this.

fair drum
tough abyss
#

Im making a mission and i need a script to loop and check if there's any disembarked crew and to kill them off if there is
Here and there i got a script from someone, which is the only one that does not show any errors, but it still doesn't actually kill off any disembarked infantry

while {_unitCheckLoop} do {
  {
     if (vehicle _x == _x) then
    {
     deleteVehicle _x;
    };
    sleep 60;
  } foreach (units blufor);
};```
copper raven
#

i don't think that sleep is supposed to be ran inside the forEach, move it into while scope

#

you sleep 60 seconds for every iteration of the forEach, so if you have 10 units, it's going to take approximately 600 seconds to loop through all of them

tough abyss
#

i am not that smart to actually change the script to fit into what you are saying

copper raven
#

move your sleep 60; a line below

tough abyss
#
while {_unitCheckLoop} do {
  {
     if (vehicle _x == _x) then
    {
     deleteVehicle _x;
    };
  } foreach (units blufor);
    sleep 60;
};```
#

llike this?

copper raven
copper raven
tough abyss
#

Thanks, it worked

#

minor issue is that with the respawn script im using it seemed to prevent a couple of groups from respawning
changing deletevehicle to setdamage worked, thanks still

winged wing
leaden haven
#

Oh, OK thank you. Now I understand.

#

But hints are a great way to test scripting though.

fair pilot
warm hedge
#

What?

fair pilot
#

I can't access it

warm hedge
fair pilot
#

Nvm it's fixed now

little steppe
#

I'm having an issue with the mod I've made where the signing tool recognizes it as signed but when joining my server it still boots me for it being an recognized mod. I can't for the life of me figure out why.

warm hedge
#

Did you packed your MOD with PboManager?

little steppe
#

Yes

warm hedge
#

That's the issue

little steppe
#

ah, ok, what am i supposed to use?

warm hedge
#

At least Addon Builder from Arma 3 Tools

little steppe
#

Probably me being a derp, I think i remember this now, Thanks!

opal sand
#

how can i make it so the module 'edit terrain object' upon a trigger activation, opens 'door 1' please (https://imgur.com/0KPna3X)

willow hound
#

Probably by syncing the module to the trigger.

wary lichen
#

I don't know how work with setText? How to change name of City for example? How get Location by city name

winter rose
#

I think you cannot change built-in locations

wary lichen
#

but on server I saw what Chernogorsk was named differently

#

I check stringtable.cvs, but name of location changed from string: dn_chernogorsk

winter rose
#

maybe terrain locations can be hidden and a new one edited

anyway, how do you use it?

wary lichen
#

Idk how to hide current default map location

#

I can create new location, when I create Location logic and set him text

#

on map it shown

#

But I can't remove for example Chernogorsk name

winter rose
dusty whale
dusty whale
#

I'm going to script logic for the reload time myself

copper raven
#

you can try removing magazines and the weapon, adding magazines back and the weapon afterwards, that will get rid off the reload time for the magazine