#arma3_scripting

1 messages · Page 669 of 1

next eagle
#

Does anyone have any familiarity with R3F? I see when you use their full Creation Factory, it has the ace repair items: tracks and wheels, but I can't for the life of me figure out how to add them to a custom whitelist. None of the parent groups seem to work, and I can't find it through the R3F files. It's like the last thing I need to hash out my mission lol

little raptor
next eagle
#

Not that I know of or could find, and the original forum post for the mod is dead it seems.

past wagon
#

how can I make it so that players cannot use saved loadouts to bypass virtual arsenal limitations?

past wagon
#

and is it possible to lock the inventory (and arsenal) of a container to a specific side?

cyan dust
heady quiver
#

Hello, i was wondering if i could save data in a data/ folder and read from it?

cosmic lichen
#

Nope. not without an extension

heady quiver
#

But i can save things like 'money ' in the namespace right?

#

profileNamespace getVariable ["money", ''];

#

and set ofc.

cyan dust
#

profileNamespace exists while game is running

#

check this

cosmic lichen
heady quiver
#

yea

#
profileNamespace setVariable ["SMM_money", [player] call HALs_money_fnc_getFunds];
saveProfileNamespace;
cosmic lichen
#

You don't really need to save the profile namespace

heady quiver
#

oh

cyan dust
cosmic lichen
#

Use it only if you wanna make 100% sure that it's saved since this command is quite performance heavy

cosmic lichen
heady quiver
#

So yea when he 'quits' thats fine

exotic flax
#

And, if it's for a MP environment, I wouldn't store info like that on the client. It will be very easy to simply modify it to gain an unfair advantage

opal sand
#

Hey (for video creation purposes); im looking for a quick and simple way to adjust an ingame light objects (e.g 'tent lamp')'s;

  1. Brightness/Luminosity
  2. Light Colour (if possible)

Can anyone assist please?

exotic flax
#

By default the variables set in this namespace will exist while the game is running. In order to make variables save permanently, use saveProfileNamespace before the game is over.
but
The profileNamespace is also saved when the game is closed.
So I gut the wiki needs a minor update (could be depending on which game)

cosmic lichen
#

Yeah, I am trying to figure it out

heady quiver
#

Just tested it and when i

#

'exit' it saves.

#
// Check if user has money from before
_money = profileNamespace getVariable ["SMM_money", false];

if(_money != false) then {    
    [player, _money] call HALs_money_fnc_addFunds;
    systemChat format ['Welcome back! You currently have %1', _money];
} else {
    [player, 4000] call HALs_money_fnc_addFunds;
}

Where am i missing ; 🤔

exotic flax
#

At the end (last })

heady quiver
#

oh

#

Yep

#

profileNamespace setVariable ["SMM_money", [player] call HALs_money_fnc_getFunds]; btw how often should i run this

heady quiver
#
_money = profileNamespace getVariable ["SMM_money", false];

if(_money == false) then {    <-- This breaks
``` 🤔
#

generic error.

winter rose
#

except… with isEqualTo

#

but the best would be to have -1 as value

heady quiver
#

mm

#
// Check if user has money from before
_money = profileNamespace getVariable ["SMM_money", -1];

if(_money == -1) then {    
    [player, _money] call HALs_money_fnc_addFunds;
} else {
    [player, 4000] call HALs_money_fnc_addFunds;
};

[] spawn {
    while {true} do {
        sleep 5; // Save money every 60 seconds
        profileNamespace setVariable ["SMM_money", [player] call HALs_money_fnc_getFunds];
    }
};

Not working notlikemeow

#

oh..

#

wait a second..

#

wrong operator x)

opal sand
#

Not sure whether this question is meant for here or #arma3_scenario, (lol @winter rose ), but, how do i put my texture on e.g a flat tv as part of a mission?

My attempt - do i just make a subfolder within the mission folder and viola?

( Dont quite understand the brief explanation - https://imgur.com/F2nsAxo )

winter rose
#

it isn't.

#

😁

heady quiver
#

He didnt even ask anything yet

#

x)

#

Something like this?

winter rose
heady quiver
#

Lou, i wanna save my gear also in the namespace profile i think i almost have it but not there yet:

// Check if user has money from before
_gear = profileNamespace getVariable ["SMM_gear", []];
systemChat format['%1',  _gear];
if(_gear isEqualTo []) then {    
    systemChat format['%1',  profileNamespace getVariable ["SMM_gear", -1]];
    [player, _gear] call BIS_fnc_loadInventory; 
// <-- (Array in format [ < Namespace, Group or Object >, String ] or [ output of BIS_fnc_saveInventory ] - usable with inventories saved via BIS_fnc_saveInventory)
};

[] spawn {
    while {true} do {
        sleep 15; // Save gear every 60 seconds
        _gear = [player, [missionNamespace, "BIS_inv"], [], true] call BIS_fnc_saveInventory;
        profileNamespace setVariable ["SMM_gear", _gear];
    }
};
cosmic lichen
#

use getUnitLoadout and saveUnitLoadout

#

and what is that loop

heady quiver
#

i need to save the gear of the player every 1 minute maybe

cosmic lichen
#

not a good approach

#

What if the user removes gear and disconnects

heady quiver
#

yea

#

thats not good notlikemeow

cosmic lichen
#

Give him an option to safe it somwhere

#

or add a shortcut to safe the gear

heady quiver
#

or

#

EH exit ?

cosmic lichen
#

handleDisconnect

heady quiver
#

yes

#

That would work?

cosmic lichen
#

sure why not

opal sand
cosmic lichen
#

All textures must have resolution 2^x / 2^y (16x16, 16x32, 64x256, 512x512, ...). The largest texture size commonly supported by graphics cards and RV engine is 4096x4096

heady quiver
#

Revo, if the players leaves does it still updates hes profile ns ?

#
addMissionEventHandler ["HandleDisconnect", {
    params ["_unit", "_id", "_uid", "_name"];
    _gear = [_unit, [missionNamespace, "BIS_inv"], [], false] call BIS_fnc_saveInventory;
    profileNamespace setVariable ["SMM_gear", _gear];
    true;
}];
cosmic lichen
#

yes

heady quiver
#

mmm

winter rose
opal sand
heady quiver
#

Got the gear saved now, but not loading up 🤔

#

[player, _gear] call BIS_fnc_loadInventory;

#

oh.

#

Nvm

#

if(_gear isEqualTo []) then { <-- how can i make this notEqualTo 🤔

opal sand
#

@winter rose - HDD\Users\username\Documents\Arma 3 - Other Profiles\profilename\missions\folder\mission\mission_textures\texture1?

How much of the file path is required?
profilename\missions\folder\mission\mission_textures\texture1?

winter rose
#

so from mission_textures\

heady quiver
#

didnt know that was a thing

#

😄

#
// Check if user has money from before
_gear = profileNamespace getVariable ["SMM_gear", []];
if(_gear isNotEqualTo []) then {    
    player setUnitLoadout _gear;
};

Nah this is not right notlikemeowcry

#

or maybe it is 🤔

opal sand
exotic flax
#

afaik is .gif not supported, only .taa, .tga, .png and .jpg

opal sand
winter rose
heady quiver
#

Lou, is there a specific file for when a user has actually spawned into the world?

fair drum
heady quiver
#
_gear = profileNamespace getVariable ["SMM_gear", []];
if(_gear isNotEqualTo []) then {    
    player setUnitLoadout _gear;
};

When i test this on local exec it works but as a script it wont cuz the player not loaded yet

fair drum
#

spawn it and do a waitUntil {alive _unitOrPlayer}

#

cause i'm guessing you are calling that in the init.sqf which will fire before players spawn in.

heady quiver
#

no

#

its in local

#

initPlayerLocal

#

or can i move all this to the init?

fair drum
#

still fires before the player is in the world

#

spawn it and use a waitUntil command

heady quiver
#
[] spawn {
    waitUntil {alive _unitOrPlayer}
    _gear = profileNamespace getVariable ["SMM_gear", []];
    if(_gear isNotEqualTo []) then {    
        player setUnitLoadout _gear;
    };

}
#

and change the var ofc.

#

but like that?

fair drum
#

yeah thats the idea behind it. now feed the spawn the necessary parameters and define them in the scope and replace _unitOrPlayer with whatever you want.

heady quiver
#

No need to feed it right cuz i will only use it right there and then use waitUntil {alive player};

#

i think i know whats wrong, when joining my server i force respawn.

#

respawnOnStart=1; i think thats messing with it

opal sand
winter rose
#

you would script it

ashen urchin
#

Hi, i try to edit my spawn.sqf

All my slot have this script and it works.

_handle = this execVM "spawn.sqf";```

On my spawn.sqf, I have and it works

[this, "soldier"] call BIS_fnc_addRespawnInventory;```

and now, i try to make

[this, "soldier"] call BIS_fnc_addRespawnInventory;
[this,'legion_Medic'] call BIS_fnc_setUnitInsignia;

legion_Medic is the classname insignia from one of my mod

My problem is that insignia don't appear when my unit respawn, any ideas ?

exotic flax
#

you have to set the insignia after they spawned

opal sand
# winter rose 1) see http://killzonekid.com/arma-scripting-tutorials-ogv-to-texture/

yeah i remember reading this link before tbh, well, .ogv files playing on textures afais have been great, no real playback issues, but;
'3. You cannot stop the video once it started playing, but you can know when it is finished.' is not the best situation, but could be worse

ok, my to do list for today, consists of;

  • get .ogv file successfully working on flat tv 😂

(Thanks again 😄 )

ashen urchin
exotic flax
heady quiver
#
// Check if user has gear from before
[player] spawn {
    params['_player'];
    waitUntil {alive _player};
    _gear = profileNamespace getVariable ["SMM_gear", []];
    if(_gear isNotEqualTo []) then {
        _player setUnitLoadout _gear;
    } else {
        removeAllWeapons _player;
        removeAllItems _player;
        removeAllAssignedItems _player;
        removeUniform _player;
        removeVest _player;
        removeBackpack _player;
        removeHeadgear _player;
        removeGoggles _player;
        player forceAddUniform "rhs_uniform_cu_ocp_101st";
    };
};

What am i doing wrong 🤔

ashen urchin
# exotic flax https://community.bistudio.com/wiki/Event_Scripts#onPlayerRespawn.sqf Will allow...

I found a script on https://forums.bohemia.net/forums/topic/213223-adding-insignias-to-units/

onPlayerRespawn.sqf:

{
if (str(player)in ['A1','A2']) then {
    [player,''] call BIS_fnc_setUnitInsignia;
    [player,'TTB_Alpha'] call BIS_fnc_setUnitInsignia;
    };    
if (str(player)in ['B1','B2','B3','B4','B5','B6']) then {
    [player,''] call BIS_fnc_setUnitInsignia;
    [player,'TTB_Bravo'] call BIS_fnc_setUnitInsignia;
    };
if (str(player)in ['C1','C2','C3','C4']) then {
    [player,''] call BIS_fnc_setUnitInsignia;
    [player,'TTB_Charlie'] call BIS_fnc_setUnitInsignia;
    };
} remoteExec ["bis_fnc_call", 0, True];```

What's A1, A2, B1... ?
exotic flax
#

Those are the variable names of the units you placed in the editor, so unless you did that the script won't work

ashen urchin
#

So, if I apply the variable name to each of my slots, it'll work for sure?

#

it works, thanks @exotic flax 🙂

heady quiver
heady quiver
#
addMissionEventHandler ["HandleDisconnect", {
    params ["_unit", "_id", "_uid", "_name"];
    systemChat 'Player leaving (saving gear)';
    _gear = getUnitLoadout _unit;
    profileNamespace setVariable ["SMM_gear", _gear];
    true;
}];
exotic flax
#

profileNamespace is local to the client, while the HandleDisconnect EH is serverside

heady quiver
#

So no way of saving before disco?

#

I mean i can make manual button for it but thats kinda lame

winter rose
#

you can save it on the server, that's safer

#

and reapply when player with identical uuid connects

exotic flax
#

you can by executing the code on the client (remoteExec) the moment the EH triggers

winter rose
exotic flax
#

true...

fair drum
#

i was thinking of tattoos for black shadow to get on the back of his hands. So far I've come up with... check params, check scheduled and now i can add check locality

heady quiver
#

y u bully me

fair drum
#

lol we've all been there and still do it too. you're just vocal about it atm lol

heady quiver
#

You know what they say

#

He who asks a question is a fool for five minutes; he who does not ask a question remains a fool forever.

#

in my case

#

20 minutes.

#

x)

winter rose
#

looks like a fool for five minutes 😉

heady quiver
#

Anyway.

#

Maybe another way i can 'save' it 🤔

#

I can do a button thats easy but meh

heady quiver
winter rose
#

wai

heady quiver
#

cuz i am already saving money the user profile way 😮

winter rose
#

and you allow them to edit that too 😬

heady quiver
#

yes

#

Its not pvp

fair drum
#

lets join his game and be billionares

heady quiver
#

its just 'co-op'

#

x)

#

alright you got a point

#

But what if i host my server through the arma launcher thingy can i still save data ?

#

missionNamespace returns the global namespace attached to the mission

#

All variables defined in mission namespace will cease to exist when mission ends

winter rose
#

wat?

heady quiver
#

Saving data on the server and reading it when a user joins

#

I really dont wanna use a DB or inidb2 mod.

winter rose
#

yeah, that you can do

cosmic lichen
#

use the servers profilenamespace

heady quiver
#

So if i execute saveProfileNamespace on local it saves on my side and if i execute it on initServer it executes on server?

winter rose
#

yes

#

it executes where it is executed 😄

wary lichen
#

hi, if I use cursorTarget setVehicleInit "selectPlayer _unit" this is was executed locally for cursor player?

fair drum
#

cursorTarget is local

cosmic lichen
#

setVehicleInit has global effect

wary lichen
cosmic lichen
#

The code added to a unit with it will be executed for every client and jip

#

The statement will be sent to clients connecting after the command has been executed.
Note that the statement will be executed automatically by JIP clients before init.sqs/init.sqf have been executed - see Initialization Order.

#

Ah

#

Doesn't even work in Arma 3

wary lichen
#

But, if I use selectPlayer on target, target will be switching?

wary lichen
cosmic lichen
#

If the biki is correct then this will not work at all

#

Because the command was disabled in Arma 3

wary lichen
#

I use arma 2

balmy creek
#

Is there a script that lets you increase a vehicles top speed?

fair drum
winter rose
#

_veh setMass -1

bronze tulip
#

Hi! I'm trying to make an AI soldier to move in a circle while looking at a center object. I tried working with only playMove and lookAt some time ago but it wasn't as smooth as I wanted it to be so I resorted to other methods. I wanted to do something similar to the unitPlay function but instead of having to rely on data from unitCapture, I can use math to calculate the movement data so I can adjust it for different positions, radii, etc. . I looked into the code of the unitCapture and saw that it's based on the setVelocitytransformation function which according to a note in the wiki is "likely a combination of setPositionASL, setVectorDir, and time multiplier". Since, I have an equation for the points, (I thought I don't need setVelocitytransformation) I decided to make my own function that calculates the next positon and direction vector of the AI soldier and sets it to that. The AI soldier does move in a circle and look at the center but it's nowhere near as smooth looking as my unitCapture I manually recorded. Should I just use setVelocityTransformation? Here's the code:

cosmic lichen
fair drum
bronze tulip
# bronze tulip Hi! I'm trying to make an AI soldier to move in a circle while looking at a cent...
params ["_PieFighter","_PivotPoint", "_MovementSpeed", "_radius"];
_pivotPostion = getPosASL _PivotPoint;
_FighterPosition = getPosASL _PieFighter;
_UcircleForm = [((_FighterPosition select 0) - (_pivotPostion  select 0))/_radius, ((_FighterPosition select 1)-(_pivotPostion select 1))/_radius]; //Unit circle form
_PieFighter setVectorDir [ -(_UcircleForm select 0), -(_UcircleForm select 1), 0]; //face toward center
_spf =1/10; //seconds per frame
_AngleChange = (_MovementSpeed /_radius)*_spf*180/pi; //change in angle in degrees
sleep _spf;
_newX = _radius*((_UcircleForm select 0)*(cos _AngleChange)-(_UcircleForm select 1)*(sin _AngleChange))+(_pivotPostion select 0); //new x coordinate
_newY = _radius*((_UcircleForm select 1)*(cos _AngleChange)+(_UcircleForm select 0)*(sin _AngleChange))+(_pivotPostion select 1); //new y coordinate
_PieFighter setPosASL [_newX, _newY, _FighterPosition select 2];

// repeated in a while loop 
#

Please do note that I suck at math and coding

cosmic lichen
#

Please see the pinned messages to find out how to properly post code

balmy creek
winter rose
fair drum
balmy creek
#

ill give that a shot, thanks

fair drum
#

its clunky and if you don't want to hurt yourself with math, just use it in a straight vector.

winter rose
#

vectorMultiply etc 🙂

bronze tulip
opal sand
# winter rose 1) see http://killzonekid.com/arma-scripting-tutorials-ogv-to-texture/

Hey, so, ran into another issue, when replacing "Land_FlatTV_01_F" with "Land_TripodScreen_01_large_black_F"
(ISSUE: theres 3 of these in the same room, only need it played on one of them, also, does enable simulation need to be ticked?),

how to make it play on one specific rugged large screen please?

with uiNamespace do {
    _tv = "Land_TripodScreen_01_large_black_F" createVehicle (player modelToWorld [0,0.5,0]);
    _tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"]; 
    1100 cutRsc ["RscMissionScreen","PLAIN"];
    _scr = BIS_RscMissionScreen displayCtrl 1100;
    _scr ctrlSetPosition [-10,-10,0,0];
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
    _scr ctrlAddEventHandler ["VideoStopped", {
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
    }];
    _scr ctrlCommit 0;
};
winter rose
#

how to make it play on one specific rugged large screen please?
well, _tv will be that screen

opal sand
winter rose
#

yes

#

remove the createVehicle part ofc

robust tiger
opal sand
# winter rose yes

Error notifi: https://imgur.com/undefined

with uiNamespace do { 
    _tv = "Land_TripodScreen_01_large_black_F";
    ***_tv setObjectTexture***;[0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];  
    1100 cutRsc ["RscMissionScreen","PLAIN"]; 
    _scr = BIS_RscMissionScreen displayCtrl 1100; 
    _scr ctrlSetPosition [-10,-10,0,0]; 
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv"; 
    _scr ctrlAddEventHandler ["VideoStopped", { 
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1; 
    }]; 
    _scr ctrlCommit 0; 
};
hint "good!";

Cant seem to make sense of where the error is, as far as my knowledge goes, sorry. can you please assist one in its quest to uncover the hidden secret of this mystery?

winter rose
#

you made _tv a string

#

you should point _tv to that screen of yours

opal sand
#

bruh

opal sand
winter rose
#

_tv = theTelevisionIhave

#
with uiNamespace do {
    _tv = missionNamespace getVariable "MyTV";
    _tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];  
    1100 cutRsc ["RscMissionScreen","PLAIN"]; 
    _scr = BIS_RscMissionScreen displayCtrl 1100; 
    _scr ctrlSetPosition [-10,-10,0,0]; 
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv"; 
    _scr ctrlAddEventHandler ["VideoStopped", { 
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1; 
    }]; 
    _scr ctrlCommit 0; 
};
hint "good!";

(_tv = MyTV;_tv = missionNamespace getVariable "MyTV";)

opal sand
opal sand
opal sand
opal sand
fair drum
#

if i disable simulation on a mine, can someone still disarm it?

winter rose
fair drum
#

uggh okay... just brainstorming away from home

opal sand
# winter rose properly!

sorry in advance, but looking at the biswiki (https://community.bistudio.com/wiki/forEach)

notifi error: error missing ;

?

    _tv = forEach [1, 2, 3, 4];
    _scr = forEach [1, 2, 3, 4];

with uiNamespace do { 
    _tv = missionNamespace getVariable "ifyourreadingthisitstoolate"; 
    _tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];   
    1100 cutRsc ["RscMissionScreen","PLAIN"];  
    _scr = BIS_RscMissionScreen displayCtrl 1100;  
    _scr ctrlSetPosition [-10,-10,0,0];  
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";  
    _scr ctrlAddEventHandler ["VideoStopped", {  
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;  
    }];  
    _scr ctrlCommit 0;  
}; 

hint "Not good";
winter rose
#

yep

#

because you did read but did not understand what was written there 🙂

opal sand
winter rose
#

forEach takes Code on the left, and Array on the right
so <code> forEach <array>

{ /* do stuff */ } forEach [tv1, tv2];
silk ravine
opal sand
true frigate
little raptor
opal sand
winter rose
#
{ systemChat str _x; sleep 1; } forEach [3,2,1];
hint "go";
```@opal sand
silk ravine
merry mason
#

So I need to execute this user action when the vehicle reaches a certain waypoint.

This is what it is: ```statement = "[this,true] spawn LIB_fnc_changeLightStatement";


**This is what I put: **```Transport1 LIB_fnc_changeLightStatement true = true;```

**This is the error:** Error missing ;
I just started getting into arma 3 scripting and it seems pretty fun.
opal sand
# winter rose ```sqf { systemChat str _x; sleep 1; } forEach [3,2,1]; hint "go"; ```<@!5405847...
{
with uiNamespace do {
    _tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];
    1100 cutRsc ["RscMissionScreen","PLAIN"];
    _scr = BIS_RscMissionScreen displayCtrl 1100;
    _scr ctrlSetPosition [-10,-10,0,0];
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
    _scr ctrlAddEventHandler ["VideoStopped", {
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
    }];
    _scr ctrlCommit 0;
}; 
}
    _tv = forEach [tv1, tv2];

This is as far as i got to understanding, played via own radio channel, you can hear the audio but cant see the visuals
@little raptor @copper raven

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

Quick question: Can this be used on a group?

winter rose
heady quiver
#

Gotta loop over each unit and set a EH then.

dusky pier
#

Hello, i trying to convert playerUID (i have number format) to string, but when trying to use toFixed 0 - is works wrong for me and given wrong id.

Is possible to somehow convert it to string?

copper raven
#

str won't work

little raptor
#

why?

copper raven
#

you'll get the scientific notation stuff

little raptor
#

then read it digit by digit

dusky pier
opal sand
#
{
with uiNamespace do {
    _tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];
    1100 cutRsc ["RscMissionScreen","PLAIN"];
    _scr = BIS_RscMissionScreen displayCtrl 1100;
    _scr ctrlSetPosition [-10,-10,0,0];
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
    _scr ctrlAddEventHandler ["VideoStopped", {
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
    }];
    _scr ctrlCommit 0;
}; 
}
{ _tv = forEach [tv1, tv2]};

This doesnt work?

winter rose
little raptor
#
_digits = ceil log _uid;
_dig_array = [];
for "_i" from _digits to 1 step -1 do {
  _quo = floor (_uid/10^_i);
  _dig_array pushBack str _quo;
  _uid = _uid - _quo * 10^_i;
};
_dig_array joinString "";

notlikemeow

winter rose
little raptor
#

then I wrote all that for nothing?! notlikemeow

winter rose
#

For ZCIENCE!!

little raptor
#

it won't work correctly anyway

#

due to floating point accuracy

opal sand
dusky pier
winter rose
#

your db is wrong 😬 it is SteamID now

merry mason
#

What does error missing ; mean most of the time

dusky pier
winter rose
opal sand
little raptor
#

ur db is bs meowtrash
oh look a sentence with only two-letter words!

winter rose
merry mason
#

Ah

#

Did I execute this action correctly? Transport1 LIB_fnc_changeLightStatement true = true; Its suppose to enable once it reaches a waypoint but keeps giving me the error I just talked about. Can't figure out what I did wrong. lol

dusky pier
#

@little raptor @winter rose thank you a lot! Gonna try to get uid in string format from database 🙂

winter rose
#

see the function's user guide

merry mason
#

Where would I find that?

winter rose
#

¯_(ツ)_/¯

heady quiver
#

Is there a way of getting a direction from 2 different pos? pos 1 is looking at pos 2 (west)

exotic flax
#

getRelDir?

heady quiver
#

Ah nice

#

systemChat format['Enemy reinforcements coming in from the %1', player getRelDir _spawn]; this gives me a direction in numbers (360) now, so how do i convert this do NW/W/ etc

winter rose
heady quiver
#

😮

split coral
#

You probably want to use player getdir _spawn. Reldir returns the direction relative to player's facing

exotic flax
#
_direction = _pos1 getRelDir _pos2;
if (_direction < 45 && _direction > 135) then { _return = 'N'; }
if (_direction > 45 && _direction < 90) then { _return = 'E'; }
... etc
heady quiver
#

Yea

#

Was working on that but uif @little raptor has a function ready that i would happily use it^^

copper raven
#
["N", "NE", "E", "SE", "S", "SW", "W", "NW"] select floor (_dir % 360 / 45)
heady quiver
#

😮

#

do i need to round _dir ?

#

or can it be 43.1

copper raven
#

round

#

or actually

#

select probably rounds already

#

not sure

exotic flax
#

input doesn't matter

#

but the math needs to be rounded

split coral
#

Yeah select does the rounding

copper raven
#

edited, need to floor actually

heady quiver
#
_moveMarker = [_position, 10, 20, 0, 0, 20, 0] call BIS_fnc_findSafePos;
_dirUnits = player getRelDir _spawn;
_dir = ["north", "north-east", "east", "south-east", "south", "south-west", "west", "north-west"] select floor (_dirUnits % 360 / 45);
[west, 'HQ'] sideChat format['Enemy reinforcements coming in from the %1', _dir];
copper raven
#

you can remove the mod, not needed in that case

merry mason
copper raven
#

%

heady quiver
#

oh

winter rose
heady quiver
#

Missing ) 🤔

#

["north", "north-east", "east", "south-east", "south", "south-west", "west", "north-west"] select floor (_dirUnits 360 / 45);

split coral
#

Also getRelDir -> getdir

copper raven
#

with the 360 😄

heady quiver
#

Mmmm

#

returns 'any'

merry mason
heady quiver
winter rose
#

@copper raven not missing 359°?

heady quiver
#
_dirUnits = player getRelDir _spawn;
_dir = ["north", "north-east", "east", "south-east", "south", "south-west", "west", "north-west"] select floor (_dirUnits / 45);
{[west, 'HQ'] sideChat format['Enemy reinforcements coming in from the %1', _dir];} remoteExec['call'];
heady quiver
dreamy kestrel
#

huh, so I learned something interesting, I have a CBA_fnc_waitAndExecute scenario in which I want to relay [player] as its arguments...
apparently, when you do that, you no longer have the actual player object, but a snapshot OBJECT of sorts, VARIABLES INCLUDED!
so, when I want to re-issue the wait, I have to do [player] for best results.

exotic flax
#

LOU_fnc_gimmeDirections 🤣

heady quiver
#

Yes

#

x)

potent dirge
#

just add an extra "N" at the end of the array blobcloseenjoy

little raptor
opal sand
#

Code attempt

{
with uiNamespace do {  
    _tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];   
    1100 cutRsc ["RscMissionScreen","PLAIN"];  
    _scr = BIS_RscMissionScreen displayCtrl 1100;  
    _scr ctrlSetPosition [-10,-10,0,0];  
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";  
    _scr ctrlAddEventHandler ["VideoStopped", {  
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;  
    }];  
    _scr ctrlCommit 0;  
}; 
}
   _tv = forEach [tv1, tv2];
   _scr = foreach [tv1, tv2];

Issue
Well and truly stumped, **error missing ; **as a refresher;

Target
to use foreach instead of _tv = missionNamespace getVariable "a3icsmpm1ctpcs6";, to no avail, (error missing 😉 on more than one object screen texture

attempt#1
(used the following resources):
i) https://community.bistudio.com/wiki/forEach
ii) https://community.bistudio.com/wiki/_Syntax#Comments
iii) { systemChat str _x; sleep 1; } forEach [3,2,1]; hint "go";
iiii) { /* do stuff */ } forEach [tv1, tv2];
iiiii) also, I see no Code ({}) on forEach's left


What i did
as far as my knowledge and learning slope permits, i got as far as closing the main bit of code with {}, and, trying to use foreach [tv1, tv2];, instead of _tv = missionNamespace getVariable "a3icsmpm1ctpcs6"; to no avail

Query
Can someone please help advise, it would be much appreciated

exotic flax
#

code forEach array
so

{ /* some code */ } forEach _array
little raptor
#

it is perfectly fine

heady quiver
#

that part.

#

mmm lemme check again

potent dirge
#

Patch it with an extra "N" at the end of the directions array

#

It's not pretty but it works

little raptor
potent dirge
#

try 359.1

little raptor
#

do you even know what % is?

potent dirge
#

yeah the mod

#

I also tested it and it gives any

heady quiver
#

%1, %2 etc

#

but im still getting any.

split coral
little raptor
#

I forgot the round

#

that's why

#
["N", "NE", "E", "SE", "S", "SW", "W", "NW"] select (round(_dir / 45) % 8);
heady quiver
#

still any ^^

little raptor
#

wat?

#

that's fine

winter rose
#

you are trying to remoteExec something with an undefined variable

heady quiver
#

yea i thought so myself so i changed it

#

to just try for myself.

#

but still any

little raptor
#

try that

heady quiver
#

wait

#

Got it..

#

ty ty

opal sand
#

guys, please dont forget my dissertation message (#arma3_scripting message) on making foreach work with my code, if anyone can help, thatd be great 😄

fair drum
#

forEach just means, hey let me take some code and do the code with every element in the array. <code> forEach <array>

#

code is inside squiggle brackets

#

im just trying to figure out your thought process in the original code anyways...

#

sec

cyan dust
#

Good day. Sorry for probably stupid question, but is there an easier way to store variable values between script calls rather than using 'localNamespace'?

fair drum
#

toss what you are doing up as well

opal sand
fair drum
#

first you dont have any magic variable _x

opal sand
silk ravine
#

How in all hell do I get append to only add an object to the given array if it is not already in it (unique)
pushBackUnique apparently only allows for Arrays to be modified. Maybe I am just stoopid

little raptor
copper raven
silk ravine
#

x = y pushBackUnique (_dud nearObjects["base",_range]);

little raptor
#

what?

#

pushBackunique returns number

#

anyway, for that you'll have to use insert

silk ravine
#

This gives me the error message that a number was given but an array was expected

little raptor
#

as I told you

#

pushBackunique returns number

silk ravine
#

okay

fair drum
#
_array = [];
{
  _array pushbackunique _x
} forEach blah blah
cyan dust
# copper raven uhm what? can you send some code
_earplugsActivated = localNamespace getVariable ["EarplugsActivated", false];

SOUND_TRANSITION fadeSound ( if(_earplugsActivated) then {SOUND_MAX} else {SOUND_MIN} );
localNamespace setVariable ["EarplugsActivated", !_earplugsActivated]
silk ravine
#
_x = [];
_x insert [-1, (_dud nearObjects["base",_range]), true];
copper raven
#

use global variables ...?

silk ravine
#

would this work?

little raptor
#

yes

silk ravine
#

thanks alot folks, I will try it out right now

little raptor
#

to avoid overwriting the variable by public flag I guess...

copper raven
#

yea, but it's a boolean anyway

fair drum
little raptor
fair drum
#

just working with what he gave to give the basic structure. i'm not familiar with doing things with uiNamespace. let me fix it

little raptor
#

otherwise the game will look for those variables in the uiNamespace

#

(but they're clearly in the missionNamespace)

fair drum
#

killin me lol. furbzeyy, its just {code} forEach [element, element, element];

heady quiver
#

Is it possibile to remotExec sideChat with a format (and param) 🤔

fair drum
#

yes

heady quiver
#

Looking at the wiki but very confusing

#

can find a lot of other ways to do it but i need need make a function first.

#

so i can remotely call it.

#

[west, 'HQ'] sideChat format['Enemy reinforcements coming in from the %1', _dir]; <--

fair drum
#

think A command B is normal, but remoteExec its [A,B] remoteExec [command, destination];

#

so whats your A and B?

little raptor
heady quiver
fair drum
#

yeah but do you understand how he got that?

cyan dust
#

Does he really need this to be remoteExec'd, it will send sidechat message by CROSSROADS wherever you call it, no?

heady quiver
#

Uhm

heady quiver
heady quiver
#

now*

copper raven
#

according to wiki it has local effect yes

fair drum
#

GA, LE

little raptor
#

Gale?

fair drum
#

woosh

cyan dust
#

Got it, thank you all

fair drum
#

this channel has been popping recently

opal sand
fair drum
#

do you have a _x? cause i saw you didn't earlier

opal sand
opal sand
fair drum
#

the way I see it right now, is if you choose _x for your setobjectTexture to iterate through, you are going to overwrite your ctrl screen how ever many times

opal sand
#

You guys, i cant find the missing link when you ask me questions/suggestion questions, i dont have a knowledge base to fill in the missing blanks, its like filling in the missing blanks on a language test for (e.g, arabic), when you dont even know even the slightest hint of knowledge, although i have made many attempts, all were futile and in vain*

fair drum
#
{
    _x setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];
} forEach [_tv1, _tv2]
#

this sets your textures to both displays

#

the problem I'm seeing is that you are grabbing display 1100 multiple times and it overwrites the previous every time if you include that code and its only going to function on the last run of the forEach

willow hound
#

Somewhat sure that you can't set videos as object texture

fair drum
#

functionality is there but its not "supported"

#

from KK's blog


1. BIS do not officially use/support this even though the functionality is there, so you are on your own (they did however fix the crash pretty quickly).
2. The sound in not positional and the volume is the same if you are next to the object or miles away.
3. You cannot stop the video once it started playing, but you can know when it is finished.
4. There is currently no way to make video to start on its own on the object, additional UI element must be used to trigger playback.
5. Depending on codec used you might have desync between video and sound.
potent dirge
#

Evening fellas, I'm having some issues with sector control.
Basically I'm trying to have the sector control tactic apply to AI that I have already spawned in game with a custom script, the same way it applies to those spawned by the Spawn AI module.

So I looked into BIS_fnc_moduleSpawnAI, BIS_fnc_moduleSector, BIS_fnc_moduleSpawnAISectorTactic and their related sub-functions for clues, sadly I wasn't able to find any.

I know that you can sync 'extra' AI to the Spawn AI module and have the Sector Control tactic apply to them, so I checked if BIS_fnc_synchronizedObjects was used in BIS_fnc_moduleSpawnAI to collect synced AI but still nothing.

I've run out of options, any suggestions?

fair drum
potent dirge
#

Thanks, but I already pulled them from the pbos. I'm having trouble deciphering where exactly the synced AI fit in

fair drum
#

ah okay let me take a look

heady quiver
potent dirge
#

I guess if I can figure out where the synced AI are handled I could probably pass my own AI to the script

heady quiver
#

Yep, im getting northwest from this lil function tho

fair drum
#
_affectedEmitters = [_module,["ModuleSpawnAI_F"]] call bis_fnc_synchronizedObjects;
_allEmitters = allMissionObjects "ModuleSpawnAI_F";

this is the part on tactics. its pulling all synced objects that are attached to the module logic and the units that are synced to the original module only. checking original for a workaround.

potent dirge
#

I see, what function is this in if you dont mind me asking?

fair drum
#

the sector tactics one

#

that is where entities are sent after the initial module load

#

so try ["_emitters","_sideStr","_cfgRoot","_side","_groupsVar"] call bis_fnc_moduleSpawnAI_main

potent dirge
#

This is great. Thanks alot 👍

fair drum
#

actually just [yourunits] call bis_fnc_moduleSpawnAI_main

#

@potent dirge

potent dirge
#

Alright I'll test this and get back to you 🤞

heady quiver
#

Is there a way to get a position on a trigger?

fair drum
#

of a trigger? or things in a trigger area

heady quiver
#

the trigger

fair drum
#

triggers are considered objects

#

so same way as an object

heady quiver
#
    [_task_name, thisTrigger] spawn {
                        params ['_task_name', '_trigger'];
                        for 'i_' from 1 to 3 do {
                            if(count (allPlayers select { _x distance2D _trigger < 10 }) > 0) then {
fair drum
#

why the "_i" line

heady quiver
#

cuz its gonna spawn 3 times a wave

#

but if there area no players in the area

#

mission is failed.

fair drum
#

and where do you have this placed?

heady quiver
#

wym?

fair drum
#

where is this code executed?

heady quiver
#

init

fair drum
#

of a trigger? the init box?

heady quiver
#

no no

#

init.sqf

#
_trg setTriggerStatements ["this", "
                    _task_name = thisTrigger getVariable ['current_task', ''];
                    [_task_name, thisTrigger] spawn {
                        params ['_task_name', '_trigger'];
                        for 'i_' from 1 to 3 do {
                            if(count (allPlayers select { _x distance2D _trigger < 200 }) > 0) then {
                                [getPos _trigger, 6] call spawnPatrolUnits;
                                sleep 120;
                            } else {
                                [_task_name, 'FAILED'] call BIS_fnc_taskSetState;
                            };
                        };
                        sleep 60;
                        [_task_name, 'SUCCEEDED'] call BIS_fnc_taskSetState;
                        { playSound 'cp_mission_accomplished_1';  [player, 2500] call HALs_money_fnc_addFunds; } remoteExec ['call'];
                        {[west, 'HQ'] sideChat 'Mission Completed, you have earned $2500.';} remoteExec['call'];
                        call createMissionLocations;
                        deleteVehicle _trigger;
                    };
        ", ""];
#

But wasnt done yet

#

need to remove trigger once that happends

hushed tendon
#

Hello. I'm looking to spawn a custom AI in the Zeus interface but I can't seem to find any information on this. Anyone know any articles on this?

heady quiver
#

i know

#

thats why i wrapped them both

#

x)

fair drum
#

but yes your distance line is fine

fair drum
hushed tendon
#

Oh I need a config. Found what I was looking for, thanks.

potent dirge
#

[units] call bis_fnc_moduleSpawnAI_main didn't work sadly, gave Generic errors. I tried using group object, an array of objects etc. But no joy

fair drum
#

two calls?

potent dirge
#

two?

fair drum
#

you have call call

potent dirge
#

oh sorry typo no it was a single call

merry mason
#

Alright so it seems once the AI get off the boat they just break. I give them waypoints once they got off the boat but they seem to only get to the start of the beach head then all crowd around the squad leader and go around in circles and not do anything. I am not sure what would be causing this but if any of you have an idea please let me know. Thanks.

This is the code inside the innit for the final waypoint

boat5 setFuel 0; boat5 setVelocity [0, 0, 0];
 
statement = boat5 animate ["Ramp", 1];boat5 say3d "fow_lcvp_ramp_lower"; 
null = [] spawn {  
{  
  if(((assignedVehicleRole _x)select 0) =="Cargo") then {  
  unassignvehicle _x;  
  moveout _x;  
  sleep 1.2;  
 };  
 } forEach(crew boat5);  
}; 
fair drum
# potent dirge oh sorry typo no it was a single call

add this to the scope you are in

_path = "\A3\Modules_F_Heli\Misc\Functions\ModuleSpawnAI\";
    [
        _path,
        "bis_fnc_moduleSpawnAI_",
        [
            "init",
            "initEmitters",
            "initSpawnpoints",
            "initGroups",
            "getManpower",
            "getRandomGroup",
            "getRandomPoint",
            "getGroupUnitCount",
            "getGroupCost",
            "getGroupWeight",
            "getGroupComposition",
            "getUnitCost",
            "getGroupType",
            "spawnGroup",
            "spawnVehicle",
            "cleanGroups",
            "cleanGroup",
            "startGarbageCollector",
            "deleteGroup",
            "getCargoSlots",
            "countCargoSlots",
            "logFormat",
            "log",
            "mergeGroup",
            "generateGroupId",
            "main"
        ]
    ]
    call bis_fnc_loadFunctions;
#

then retry

potent dirge
#

Roger that

fair drum
#

and try using the action "getout" instead of moveout under arma 3 actions wiki page

merry mason
#

I do yes

#

@fair drum its because they try and get back in

#

thats the issue.

#

I just moved the boat to them so it was within reach and they all ran inside and just stayed there then.

#

So how would I disable the ais need to get back inside the boat?

little raptor
merry mason
#

How do I do that?

little raptor
#

unassignVehicle 😐

merry mason
#

Ah

fair drum
#

but... you already had that in your original code?

little raptor
merry mason
potent dirge
#

@fair drum still no luck. It doesnt seem to do anything. I'm using an array of unit(s) as the argument for the function. If I try to use anything other than an array it gives a typeError

fair drum
#

eh worth a try tho

dreamy kestrel
#

hello, I've got a path to an image that we use for HUD overlay, i.e. \A3\ui_f\data\map\markers\handdrawn\warning_CA.paa, or \A3\ui_f\data\map\mapcontrol\tourism_CA.paa... is there documentation, or a way, that we may enumerate these for reference?

potent dirge
#

I'll try and look into the functions further and trace where the AI goes

dreamy kestrel
potent dirge
#

it is like a compiled subfunction within BIS_fnc_moduleSpawnAI

#

Like many others it is not documented

dreamy kestrel
#

it is compiled and ad hoc then?

#

is there any guarantee it will "be there" between invocations?

hushed tendon
#

Anyway to detect when a specific unit is spawned?

potent dirge
#

Well I mean its part of the game's pbos...

dreamy kestrel
potent dirge
#

You can decompile modules_f_heli.pbo if you want to looks at it

little raptor
merry mason
little raptor
merry mason
#

like the squad?

little raptor
#

some_group leavevehicle boat1;
and they will exit automatically

merry mason
#

Ah

little raptor
merry mason
#

so I need to put the variable name for the composition?

little raptor
#

you mean the group? yes

merry mason
#

yeah

merry mason
little raptor
#

yeah

dreamy kestrel
#

or is that literally unknown_CA.paa, following the same convention analogous to hd_warning and hd_unknown in the editor?

little raptor
#

you'll have to find them manually. they're not necessarily all in one place. (and they're not documented)

merry mason
little raptor
#

with moveOut

#

also have you defined squad1?

merry mason
#

yea

#

This is what I got

#
 
statement = boat1 animate ["Ramp", 1];boat1 say3d "fow_lcvp_ramp_lower"; 
null = [] spawn {  
{  
  if(((assignedVehicleRole _x)select 0) =="Cargo") then {  
  unassignvehicle _x;  
  Squad1 leavevehicle boat1; 
  sleep 1.2;  
 };  
 } forEach(crew boat1);  
};```
little raptor
merry mason
#

They still try and get in :/

#

hmm

merry mason
#

Would they still try and get in?

little raptor
#

probably not

hushed tendon
#

Anyway to run a script upon a specific type of unit being spawned? or am I forced to use a loop

#

I looked through the EH and the only one that seemed close was CuratorObjectPlaced

potent dirge
#

Alright, I've made some progress on my little sector control thing.
I've figured out that the real AI Sector Tactic is handled by FSM, and I'd easier speak French than figure out what those FSMs are doing, or worse try to replicate them.
Instead I think I'll just inject my custom AI into one of the functions and have it pass along the chain.

So right now all I need to know is how the engine 'calls' moduel functions, specifically what arguments are passed to BIS_fnc_moduleSpawnAI. I know it has at least 3 from looking at its contents, but can't figure out what exactly those arguments are.

fair drum
#

fsms are easy, i can show you if you want.

#

like one big switch do

#

so i've been working on some modules, this is the usual params that get passed to the function that you point out of the module

potent dirge
#

I don't know, have you seen the contents of the FSM files in the AI sector control? Plus I think there are other things the function handles as well that I don't know about

little raptor
potent dirge
#

I'd rather just have BIs function handle everything, and if that doesnt work I can try figuring out the FSMs

fair drum
#

these are your 3 params that come to a module

private _modulelogic = param [0, objNull, [objNull]]; //this is the logic itself. think of it as the "object" itself of the module. it contains the variables that are passed from the module you can use get variable for
private _syncedentities = param [1, [], [[]]];  //this is an array of all synced thingys
private _isActivated = param [2, true, [true]]; //this returns true if all triggers are activated and the module starts
potent dirge
#

wonderful

#

This is really good, thank you so much

fair drum
#

bigger example

if !(isServer) exitwith {};

// MODULE PARAM
private _modulelogic = param [0, objNull, [objNull]];
private _syncedentities = param [1, [], [[]]];
private _isActivated = param [2, true, [true]];

//VARIABLE DEFINES
private _units = _syncedentities;

private _rearmClasses = [];
{
    _rearmClasses pushBackUnique typeOf _x;
} forEach _units;

private _rearmTime = _modulelogic getVariable ["MagTime", 150]; //these are passed in the module config with whatever people select on the modul
private _persistent = _modulelogic getVariable ["Persistent", false]; //these are passed in the module config with whatever people select on the module

//CODE
if (_isActivated) then {
heady quiver
#

Hey leo, i just tested a couple missions with;

    _dirUnits = player getRelDir _spawn;
    _dir = ["north", "north-east", "east", "south-east", "south", "south-west", "west", "north-west"] select (round(_dirUnits / 45) % 8);
    [[west, 'HQ'], format['Enemy reinforcements coming in from the %1', _dir]] remoteExec ["SideChat"];

But the direction is completly off meowsweats

#

could it be because i use player (player getRelDir _spawn;) 🤔

#

Gives north are west.

little raptor
#

not absolute direction (north, west, etc.)

heady quiver
#

How do i get absolute direction.

little raptor
#

getDir

heady quiver
#

Ty sir

merry mason
merry mason
#

For some reason this will not work. When a vehicle hits a waypoint inside that waypoints innit is suppose to be this and what its suppose to do is change the light color inside the vehicle.

This is what it is: statement = "[this,true] spawn LIB_fnc_changeLightStatement";

**This is what I put: **Transport1 LIB_fnc_changeLightStatement true = true; Not sure what I'm doing wrong. Can't find anything about this on the forums so if anyone here has a link to a forum post or knows what I am doing wrong please let me know thanks.

little raptor
merry mason
#

Now that you say it.

little raptor
merry mason
#

thanks

fresh wyvern
#

Anyone who know what this means?
Trying to make custom Aircraft list in Warlords.

'...calize "STR_WL_aridrop_restr1";
if (|#|_category == "Infantry" && (count units ...'
Error Undefined variable in  expression: _category
File
A3\Functions_F_Warlord\Warlords\fn_WLSubroutine_purchaseMenuAssetAvailablility.sqf [BIS_fns_WLSubroutine_purchaseMenuAssetAvailability]..., line 60
#

Helicopters just parachute in without any AI inside to land them.

austere wigeon
#

If there is a .sqf file in an existing mod that I'd like to patch (make a small change to), is there any way to patch specific lines of these files, or do I just have to replace the whole .sqf file? The reason I'm asking is because I want to avoid hosting any code I didn't write in my patch mod; only the lines I want to change.

fair drum
#

The whole file has to exist for sqf. Hpp and cpp you can do includes though.

merry mason
fair drum
#

How are you defining _unit?

merry mason
#

😳

#

May have forgotten that.

fair drum
#

Go find it lol

merry mason
#

Any tips on where I should look lol.

fair drum
#

Well you sure your params are correct for that function?

merry mason
#

Under config viewer this is what I find under its features
statement = "[this,(call ww2_fnc_findPlayer)] spawn LIB_cargoStandUpStatement";

merry mason
zealous heath
#

Hello, I'm looking for a script that enables you to set AI as zombie (without mods, a zombie mod in the mod list is a bit too obvious in a "suprize zombie attack mission" and a script that makes it so that dead players will "ressurect" as zombie AI, anyone know some good ones?

fair drum
#

hate to break it to you but you might have to use a zombie mod

fair drum
#

and is there a params []; inside of the LIB_cargoStandUpStatement file?

robust hollow
#

findPlayer is just missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", player];
and cargoStandUpStatement assumes both arguments are objects. it doesnt use params

private _plane = _this select 0;
private _unit = _this select 1;
merry mason
#

There is a conditions section which has this condition = "[this,(call ww2_fnc_findPlayer)] call LIB_cargoStandUpCondition";

peak pond
#

Hi, most programming languages have a continue keyword for going to next iteration of a loop. Is there an analogous feature in SQF?

robust hollow
#

sqf has continue and continueWith

peak pond
#

Great, thanks!

fair drum
#

you had [plane, boolean] call.. instead of [plane, unit] call

merry mason
#

I didn't see that lol.

fair drum
#

is there an equivalent of goto in sqf? it looks pretty useful for sqs

little raptor
#

but I don't recommend it

full solstice
#

does anyone have an error locator program for script?

hoary halo
#

Hey guys, made a working teleport script (interact with a map board to get teleported to a nearby FOB) for the player and his squad. However, once teleported I get a big freeze (as the FOB is quite far) that can last a good 20/30 seconds at times! Could I add a "sleep" to it, to simulate a loading time and basically hide the freeze ?

#

said script : this addAction ["Fast travel to C.O.P Mike", {
params ["", "_caller"];
{
_x SetPos getMarkerPos "marker_cop1";
} forEach units _caller;
}];

warm hedge
#
this addAction ["Fast travel to C.O.P Mike", {
  params ["", "_caller"];
  _caller spawn {
    /*some blackout effect*/
    {
     _x setPos getMarkerPos "marker_cop1";
    } forEach units _this;
    sleep 5;  //suspends the script for 5 secs
    /*some blackin effect*/
  };
}];```
winter rose
#

@fresh wyvern don't crosspost (#rules)

proven charm
#

hey , I have zeus scripting question. Can you somehow disable zeus camera rotation (right mouse move) for a while?

warm hedge
#

Check the pinned please

ionic wren
#

I think this is good

#

a ok

#

sorry xD

warm hedge
#

I don't mean you have to delete

ionic wren
#

ok

stuck rivet
#

what is a script I can add to an ai to make it completely unresponsive to the player's presence or actions(shooting at it)?

#

for target practice

stuck rivet
#

so soldier1 disableAI "AUTOCOMBAT"?

winter rose
#

or "all" if you prefer

stuck rivet
#

well autocombat doesn't seem to work

#

i suppose all will stop them from moving, is there a way to disable all and then enable moving again?

winter rose
#

PERHAPS 🐮

#

that or disable all of them but the ones you want/need

opal sand
#

Ok, so i have a video (.ogv) in a subfolder, within the mission folder "temp1.altis\videos\temp1.ogv", but on preview, it cannot be found? help? please

heady quiver
#

Might have found an arma bug.

opal sand
#

hey @winter rose

where do i start writing the filepath to have the picture texture found please ? (Does it start in the mission folder to subfolder or..?) (in this case, .ogv) is it;
a) missionfolder1.stratis\videos\temp1.ogv
OR
b) videos\temp1.ogv
?

willow hound
#

The mission folder is the root, except for some special snowflakes, everything is searched for relative to that root. Usually it is option b.

opal sand
willow hound
#

No, BIS_fnc_StrategicMapOpen is a special snowflake for example

#

What code are you trying to use this path with?

opal sand
# willow hound No, `BIS_fnc_StrategicMapOpen` is a special snowflake for example

well, had tried two methods;

  1. object
  • variable name
    screen 1
  • texture
    videos\temp1.ogv
  1. (trigger - on act - via radio delta)
with uiNamespace do { 
    _tv = missionNamespace getVariable "screen1"; 
    _tv setObjectTexture [0,"videos/temp1.ogv"];   
    1100 cutRsc ["RscMissionScreen","PLAIN"];  
    _scr = BIS_RscMissionScreen displayCtrl 1100;  
    _scr ctrlSetPosition [-10,-10,0,0];  
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";  
    _scr ctrlAddEventHandler ["VideoStopped", {  
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;  
    }];  
    _scr ctrlCommit 0;  
}; 

At one point tried to preview scenario with both on

Questions;

  1. what does BIS_fnc_StrategicMapOpen do?
  2. what is a special snowflake exactly, never heard of a code be a special snowflake... (if you dont want to answer **question2, dont)
fresh wyvern
fresh wyvern
# fresh wyvern I guess this is a script issue.

Anyone who know what this means?
Trying to make custom Aircraft list in Warlords.

'...calize "STR_WL_aridrop_restr1";
if (|#|_category == "Infantry" && (count units ...'
Error Undefined variable in  expression: _category
File
A3\Functions_F_Warlord\Warlords\fn_WLSubroutine_purchaseMenuAssetAvailablility.sqf [BIS_fns_WLSubroutine_purchaseMenuAssetAvailability]..., line 60
opal sand
#

@willow hound if it helps;

with uiNamespace do { 
    _tv = missionNamespace getVariable "screen1"; 
    _tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];   
    1100 cutRsc ["RscMissionScreen","PLAIN"];  
    _scr = BIS_RscMissionScreen displayCtrl 1100;  
    _scr ctrlSetPosition [-10,-10,0,0];  
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";  
    _scr ctrlAddEventHandler ["VideoStopped", {  
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;  
    }];  
    _scr ctrlCommit 0;  
}; 

works
notice, it uses the default .ogv, so,

could it possibly be my video? is that a possibility?

willow hound
#

It's not possible to set videos as object textures.

opal sand
# willow hound It's not possible to set videos as object textures.

just found that out via trial and curiosity before you mentioned

so

we know

with uiNamespace do { 
    _tv = missionNamespace getVariable "screen1"; 
    _tv setObjectTexture [0,"**\A3\Missions_F_EPA\video\A_in_intro.ogv**"];   
    1100 cutRsc ["RscMissionScreen","PLAIN"];  
    _scr = BIS_RscMissionScreen displayCtrl 1100;  
    _scr ctrlSetPosition [-10,-10,0,0];  
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";  
    _scr ctrlAddEventHandler ["VideoStopped", {  
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;  
    }];  
    _scr ctrlCommit 0;  
}; 

does work, but;

with uiNamespace do { 
    _tv = missionNamespace getVariable "screen1"; 
    _tv setObjectTexture [0,"**videos\temp1.ogv**"];   
    1100 cutRsc ["RscMissionScreen","PLAIN"];  
    _scr = BIS_RscMissionScreen displayCtrl 1100;  
    _scr ctrlSetPosition [-10,-10,0,0];  
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";  
    _scr ctrlAddEventHandler ["VideoStopped", {  
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;  
    }];  
    _scr ctrlCommit 0;  
}; 

does not...

  • the file path, names, the videos name, have been cross referenced about 10 times
willow hound
#

BIS_fnc_StrategicMapOpen opens a special map view and one of the things that can be done with that special map view is adding images. That's where the special snowflake comes in because if your image is in the mission folder, you need to provide the full path to that image on the hard drive instead of the path relative to the mission root.
So instead of simply using "images\MyImage.jpg" you have to use something like [str missionConfigFile, 0, -15] call BIS_fnc_trimString + "images\MyImage.jpg" to get BIS_fnc_StrategicMapOpen working with your image.

willow hound
opal sand
# willow hound `BIS_fnc_StrategicMapOpen` opens a special map view and one of the things that c...

maybe, ive just missed a whole bunch of code, courtesy of killzone kid
(original site, fwd to me by @winter rose)
(http://killzonekid.com/arma-scripting-tutorials-ogv-to-texture/)

class RscMissionScreen
{
    idd = -1;
    movingEnable = 1;
    duration = 1e+011;
    fadein = 0;
    fadeout = 1;
    onload = "uinamespace setvariable ['BIS_RscMissionScreen',_this select 0];";
    class controls
    {
        class Picture_0: RscPicture
        {
            idc = 1100;
            text = "";
            x = "safezoneX";
            y = "safezoneY";
            w = "safezoneW";
            h = "safezoneH";
            autoplay = 1;
            loops = 1;
        };

--- snip ---

think this is the solution

(also, forward to from earlier, on some trigger activations, the pc screen object does flash white/colours, but doesnt actually play .ogv actual)

hence why my above maybe solution?

Will give it a test and let u know

#

ok,so...

with uiNamespace do { 
    _tv = missionNamespace getVariable "screen1"; 
    _tv setObjectTexture [0,"videos\temp1.ogv"];   
    1100 cutRsc ["RscMissionScreen","PLAIN"];  
    _scr = BIS_RscMissionScreen displayCtrl 1100;  
    _scr ctrlSetPosition [-10,-10,0,0];  
    _scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";  
    _scr ctrlAddEventHandler ["VideoStopped", {  
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;  
    }];  
    _scr ctrlCommit 0;  
};




class RscMissionScreen 
{ 
 idd = -1; 
 movingEnable = 1; 
 duration = 1e+011; 
 fadein = 0; 
 fadeout = 1; 
 onload = "uinamespace setvariable ['BIS_RscMissionScreen',_this select 0];"; 
 class controls 
 { 
  class Picture_0: RscPicture 
  { 
   idc = 1100; 
   text = ""; 
   x = "safezoneX"; 
   y = "safezoneY"; 
   w = "safezoneW"; 
   h = "safezoneH"; 
   autoplay = 1; 
   loops = 1; 
  }; 

Error missing ; (https://imgur.com/0khPd2q) (updated)

bruh, what now? lol

willow hound
#

Oh boy, I'm not entirely sure how and why KK's code works (How on earth does the video remain attached to the ingame object?!), but if you want to have any chance at using it with your own video, you are going to have to replace both instances of "\A3\Missions_F_EPA\video\A_in_intro.ogv":

with uiNamespace do {
    _tv = missionNamespace getVariable "screen1";
    _tv setObjectTexture [0, "videos\temp1.ogv"];
    1100 cutRsc ["RscMissionScreen", "PLAIN"];
    _scr = BIS_RscMissionScreen displayCtrl 1100;
    _scr ctrlSetPosition [-10,-10,0,0];
    _scr ctrlSetText "videos\temp1.ogv";
    _scr ctrlAddEventHandler ["VideoStopped", {
        (uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
    }];
    _scr ctrlCommit 0;
};
opal sand
#

Further question please, how do i loop/auto replay the .ogv file being played on the pc screen? is that possible? please advise

winter rose
#

sleep _videoDuration
repeat

opal sand
warm hedge
#

You're doing this in an incorrect context, you need to spawn or execVM it instead of call or something

opal sand
warm hedge
#

tldr: you can't use sleep in the certain condition

opal sand
# warm hedge https://community.bistudio.com/wiki/Scheduler

so... this applies?
(https://community.bistudio.com/wiki/Scheduler)
Suspension
Suspension is the process to wait a period of time or to wait for something to happen. Commands for suspension are sleep, uiSleep, waitUntil.

Suspension is forbidden in an unscheduled environment and trying to use such command will fail with an error; you must ensure that you are running your code in a scheduled environment and can suspend with the canSuspend command.

Category: Scripting Topics

?

warm hedge
#

Yes. Seems like you're doing this

opal sand
# warm hedge Yes. Seems like you're doing this

ok, will keep it to trigger radio activation on manual repeat (trigger repeatable box tick) then, not feasible to carry out this process at this time, but thanks for the heads up/help dude, also saved me alot of time, much appreciated

willow hound
#

Ah, figured it out now. Took me a while. KK is elegantly cheating the system with that video playback magic

winter rose
#

playing the video as a texture (OK)
playing the video on an invisible control to have the sound

willow hound
#

He has to play the video in an invisible control to play it at all, not just for the sound.

When you setObjectTexture on TV, no playback happens, but the texture is loaded. In order to start playback the same texture has to be loaded into RscPicture control, and not just any RscPicture control, but the one that has autoplay = 1
At first I didn't know what to make of this, but now I do. The video is loaded, sized and "attached" to the ingame object by setObjectTexture, but it doesn't play until the same resource starts playing somewhere else - that is what the hidden control is used for. When you place a bunch of screens, set all their textures to \A3\Missions_F_EPA\video\A_in_intro.ogv and then run KK's code once, all those screens start playing.

winter rose
#

okido, the control itself loads the video - noice

astral hamlet
#

hi, very simple answer to my problem probably, but i cant figure out what is wrong.

i have a trigger that will do On Activation this:

hint"The bomb is in the house marked on the map! Help!"; sleep 10; caller1 allowFleeing 1;

So i want the ai(caller1) to say the hint, than wait 10 seconds and run away. the sleep part is calling an Generic error, what do i have wrong? thanks

exotic flax
#

in 'On Activation' put:

[] spawn {
   hint"The bomb is in the house marked on the map! Help!";
   sleep 10;
   caller1 allowFleeing 1;
};

By putting your code in spawn it will allow you to use sleep (see a couple of comments higher: #arma3_scripting message)

astral hamlet
#

Thanks and sorry for spam!

exotic flax
#

It's a legit question and learning moment, so no problem 👍

zealous heath
#

Anyone know what arma's coding/scripting language is called?

zealous heath
#

Thx

fair drum
#

@winter rose is the wiki still locked down from making contributions?

gleaming imp
#

Hello guys, little question

I have a mission in wasteland.pbo its a convoy. i ahve a little bit problem with last AI driver and that is when he (sometimes) reach waypoint he will freeze, if i push him with zeus power he will continue but otherwise he will be still there (wont move)

    if (speed _lastCar <= 1) then

    {
         _lastCar setVelocity [0, 2, 0];

    };

i tried to create this lines added in mission file to check its velocity and if he will reach less then 1m/s then add 2m/s (forward) speed, problem is it will run only once when mission is spawned
any idea how to create like a loop or how to do it to check _lastCar speed each 10-30 sec?

dusky pier
#

Hello, have a question. Is possible to somehow get coords from selection on model, but for camera view?

I have a custom camera - focused on object camera placed just above the object.

// Got screen coords - this way, but for camera - they wrong
_selPositions = [];

for "_i" from 1 to 9 step 1 do {
  _selPositions pushBack (the_Obj selectionPosition [format["m%1_axis",_i],"Memory"]);
};

_tdPos = _selPositions apply {the_Obj modelToWorld _x};
_scrPos = _tdPos apply {worldToScreen _x};
little raptor
#

it won't really help you tho

little raptor
gleaming imp
still forum
#

You cannot set variables onto projectiles right?

potent dirge
#

Hi guys, quick question please.
Does using _groupA join _groupB or any of its related commands, add the assigned vehicles of _groupA to _groupB's pool or do I have to do that manually?

gleaming imp
#

And one last question for today 🙂 how to disable AI (one specific AI in car) to get out from vehicle?

#
_President disableAI "MOVE";

I used this and it doesnt work

copper raven
gleaming imp
copper raven
#

🤔

potent dirge
#

set the AI leader to driver then use setUnloadInCombat

#

That's what I usually do if I want AI to remain in a vehicle

grave thistle
#

a sligt interruption :D, does anyone know if there's a command to get the "precise coordinates of the crosshair".

Something similar to getPos cursorObject but without the requirement of an object to exist there.
cursorObject might just work here in fact, but it's not ideal

copper raven
potent dirge
#

allowCrewInImmobile also works for if the vehicle is damaged

grave thistle
#

cursorTarget seems to still require an object of some sort

grave thistle
austere granite
#

still not close. The crosshair can be on locations other than center of screen

copper raven
#

can maybe compensate for that

#

with some math

gleaming imp
grave thistle
#

well, tbh center of screen would work for this, too

#

It's really the same as I'd be looking thru a scope when executing the code anyway

#

or close nuff for me if not exactly the same

grave thistle
tidal ferry
#

Hey, is there any way to attach an object to something where only the position attachment is preserved, not the rotation? E.g. wanting a large background object like a planet to always move when the player moves, but stay the same distance/orientation away

little raptor
little raptor
#

just move it yourself

tidal ferry
#

But is there a way to do it?

#

I want it to follow the player's position, but not their rotation

little raptor
tidal ferry
#

With?

little raptor
#

an eachframe event handler

tidal ferry
#

Hmmm... alright

#

What commands would you recommend using with that? SetPosRelative or something?

little raptor
#

for testing you can try this:

onEachFrame {
  someObj setPosWorld (getPosWorld player vectorAdd [...]);
}

don't use onEachFrame in the final (release) version. use the event handler

tidal ferry
#

Alright, sweet

#

Will try it out real quick

#

Sick, that worked, thanks!

little raptor
tidal ferry
#

Will do, thanks a ton!

little raptor
#

@tidal ferry also change getPosWorld to getPosWorldVisual (it's smoother for eachframe stuff)

tidal ferry
#

Sure thing, thanks!

little raptor
#

@tidal ferry also change use vehicle player instead of player so that it also works when the player gets into a vehicle:getPosWorldVisual vehicle player
(I don't know why I remember the stuff in chunks 😅 )

#

actually no need (I think)

tidal ferry
#

Sounds good, made no difference either way haha

hushed tendon
#

Hello. I'm trying to run a script that only runs for every unit with the "C_man_p_beggar_F" classname. So far I have this but I don't know exactly what to put in place of the _x.

if (typeOf _x isEqualTo "C_man_p_beggar_F") then {
hint "it works";
};

I'm also running that script from this code here. Should I be using a param with the execVM?

["C_man_p_beggar_F", "init", {[] execVM "killerBunny.sqf";}, true, [], true] call CBA_fnc_addClassEventHandler;
fair drum
#

at the very crudest form, you'd put the whole if-then statement in a forEach setup with allunits

#
{
  if (typeOf _x isEqualTo "C_man_p_beggar_F") then {};
} forEach allUnits;
hushed tendon
#

Anyway to make it a little less crude?

fair drum
#

also, I believe CBA_fnc_addClassEventHandler doesn't let you bring in parameters from outside of it. so you'd have to use getVariables

#

no CBA_fnc_addClassEventHandlerArgs yet... (please I want)

fair drum
copper raven
#

but please avoid execVM, compile your script and store it into a variable, simply use img_fnc_killerBunny = compileFinal preprocessFileLineNumbers "killerBunny.sqf" <args> call img_fnc_killerBunny or spawn if you need suspension

fair drum
#

well "init" only allows for "_entity" i believe. so if he wanted to port something else like say, a time variable or a range variable, he couldn't get it into that addClassEventHandler since that command doesn't bring in external args like addEventHandler does

faint oasis
#

when i load 3 crate in the "y32 xian" with setvehiclecargo command this work perfectly but when i land on a runway the vtol explode when the ground contact the gear

#

why ? someone have an idea ?

little raptor
faint oasis
#

i don't know if it's a bug but it's very strange

fair drum
#

red beans and rice didn't miss xian

#

dummy thick

faint oasis
#

but the cargo doesn't use the "attachto" command because the attachto command doesn't have collision but what i need to do then ?

hushed tendon
copper raven
#

leave just call KB_fnc_killerBunny, _this will carry over

fair drum
#

are you doing a monty python scenario?

copper raven
#

if you want to suspend (sleep etc), then _this spawn KB_fnc_killerBunny

hushed tendon
#

I don't know enough to make config stuff like mods so that you can spawn the rabbit in as zeus so I'm changing an already made unit. When "C_man_p_beggar_F" spawns they will be replaced by a rabbit that will run to players and start nibbling on their legs. Kinda like a zombie rabbit

fair drum
#

so you are doing a monty python scenario lol

hushed tendon
#

Pretty much I guess

#

Now I need to watch the movie again

#

For like the 7th time

fair drum
#

remote IEDs/Explosives show up in allMines right?

winter rose
exotic flax
#

They should(?)
At least vanilla and ACE stuff does

#

or at least did (didn't test it recently)

fair drum
#

testing...

#

Survey Says...

Yes for Vanilla
No for CUP

hushed tendon
#

So I think I messed something up and I'm not sure what.
initServer.sqf

KB_fnc_killerBunny = compileFinal preprocessFileLineNumbers "killerBunny.sqf";
["C_man_p_beggar_F", "init", {[_this] call KB_fnc_killerBunny;}, true, [], true] call CBA_fnc_addClassEventHandler;

killerBunny.sqf

params ["_rabbits"];
if (typeOf _rabbits isEqualTo "C_man_p_beggar_F") then {
    hint "It works";
];
#

Hint won't show up

fair drum
#

wheres the error

#

is your machine the server?

hushed tendon
#

testing in a MP scenario rn

fair drum
#

listen server or dedicated

hushed tendon
#

planning to run this on a dedicated server tho

#

server

#

Trying to only hint for those who are "C_man_p_beggar_F"

distant oyster
hushed tendon
#

still doesn't work

distant oyster
#

killerBunny.sqf

params ["_rabbits"];
if (_rabbits =="C_man_p_beggar_F") then {
    hint "It works";
};``` ?
hushed tendon
#

nope

distant oyster
#
params ["_rabbits"];
if (typeOf _rabbits == "C_man_p_beggar_F") then {
    hint "It works";
};``` ?
hushed tendon
#

That's the same as

params ["_rabbits"];
if (typeOf _rabbits isEqualTo "C_man_p_beggar_F") then {
    hint "It works";
];

isEqualTo is just more efficient than ==

distant oyster
#

no the bracket is wrong

fair drum
#

badda bing, there it is lol

hushed tendon
#

?

#

omg

distant oyster
#

also isEqualTo is case sensitive, might be a source of error in other cases

hushed tendon
#

I'm an idiot

tidal ferry
#

Alright, remarkably stupid question here- is there any function or method to get the same functionality as eyePos, but with 3rd person camera instead of 1st person camera?

tidal ferry
#

Ah right, thanks!

#

To flex my last brain cell even harder, what's the best way to get the current position of the player camera?

#

Nvm, may have got it

#

Actually, would CameraOn be the right direction in getting the cameraPos for positionCameraToWorld?

winter rose
tidal ferry
#

That works great, but I get the same issue I had before using eyePos, where the background object I'm moving with the player's screen keeps bobbing whenever I move the camera

#

Probably can't be fixed but thanks for the assistance!

winter rose
#

what exactly do you want to do, and how do you do it?

tidal ferry
#

So basically, one of the people in my unit makes custom planet models, and I'm working to get it so we can basically upscale a planet and skybox and get it to appear in the distance as if it were actually in the night's sky

#

Someone earlier helped me get it working, and it works great for night sky

drifting sky
#

Can someone give me a quick idea bout how to trigger a script on a remote machine, with arguments? Is there an event handler for that? Or what?

tidal ferry
#

But when you're indoors, there's just this tiny little bobbing effect that gives away the illusion- it's not noticable with the skybox but it is with the planets

#

Did some changes to the code, I replaced getPosWorld with eyePos and it fixed it in first person, but still not working in third person

#

And sure @drifting sky, not as experienced as others here but I can try to help, what are you looking to do?

drifting sky
#

forgot to mention: A2OA.

tidal ferry
#

Ah, yeah sorry, no clue

drifting sky
#

I'm thinking CBA events are what I'm after, but I'm not sure.

drifting sky
#

can RE execute custom scripts?

winter rose
#

it has execVM 🙂

drifting sky
#

and I can specify only to run on specific machines, such as the server?

winter rose
#

afaik yes - but why do you want to remote exec it? the trigger can happen on the server, and if isServer then { ... } no?

drifting sky
#

I want a player to be able to initiate an action which happens on the server

#

for example, buying a unit and adding it to the group in which the player belongs

winter rose
#

maybe publicVariableServer and callVar (but that's hacky I would say)
buying a unit etc can happen client-side eventually

drifting sky
#

eh, well the server needs to verify certain constraints

winter rose
#

RE + execVM I would say then

#

you could execVM with a function name as a parameter, that could do

drifting sky
#

i'm reading the wiki for that function now. So far not seeing where i specify to run on server only

tidal ferry
winter rose
#

(or an AI)

drifting sky
#

What exactly is a logic?

winter rose
#

F7 iirc, a logic is a virtual unit

drifting sky
#

ok, so how would i use it to solve my problem?

#

geez, isn't there just a generic run this script on that machine with these parameters, function?

winter rose
drifting sky
#

just a sec

#

okay, so here's the syntax for RE: [nil_or_caller, nil_or_target_object, "loc", script_to_execute, par0, par1...] call RE;

#

So target_objects, would be the "server" logic?

winter rose
#

yep

#

I presume

drifting sky
#

and server doesn't need anything in it, just an empty logic?

winter rose
#

yeah

drifting sky
#

okay, what's the deal with the "caller". Is that made available somewhere on the machine in which the function is executed?

winter rose
#

IDK, the page is all there is

drifting sky
#

yeah, but BIS wiki is hard to understand

winter rose
#

remoteExec is clearly easier to use, too

#

but hey, A2

drifting sky
#

yeah A2AO

#

um, it's not clear to me how to set up parameters for a script with rEXECVM

#

I presume one of the params needs to be the script name

#

but then I need to get the actual parameters for that script in there as well

winter rose
#

maybe you can decompile A2 campaigns to see how it's done (and tell me so I can amend the page)

#

or make your own framework with addPublicVariableEventHandler, too

drifting sky
#

I was thinking something like that, but I'm not sure how to handle conflicts, for example, when multiple clients are manipulating the same variable

#

whether or not the ev will necessarily trigger for each change

#

or what

winter rose
#

IDK 🙃

drifting sky
#

I'm thinking CBA event handlers are what I'm really after. However, I'm struggling to find documentation for CBA.

#

I seem to recall there's some way to read documentation in game, but I don't remember how to.

winter rose
#

using the debug console, [] call BIS_fnc_help for functions info

drifting sky
#

actually, i just found the doc for cba. So I'll be reading that for a bit.

#

damn it, if anything their documenation is even worse than bis's. Is dev-heaven totally dead, or what? I try to follow links there and get nothing but a blank screen.

tidal ferry
#

Bold of you to assume there is a dev-heaven

#

I jest

winter rose
#

dev-heaven is dead yes

leaden haven
#

I am a bit confused with this code. It creates multiple concentric rings each time the for loop runs, but I wish it to start high and move down each time it runs, but I cannot work oput how to change the _zpos each time it creates a ring.

LtargetPos = [12302,17686.3,0];
_radius = 200;
while {_radius > 0} do {
 _k = 0;
 for "_k" from 0 to 360 step (270 / _radius) do {
  _xpos = (LtargetPos select 0) + ((cos _k) * _radius);
  _ypos = (LtargetPos select 1) + ((sin _k) * _radius);
  _zpos = (LtargetPos select 2) + 150;
  _location = [_xpos,_ypos,_zpos];
  createVehicle ["Sign_Sphere200cm_F", _location, [], 0, "CAN_COLLIDE"];
 };
 _radius = _radius - 20;
};

I want it to create a cone shape instead of a huge set of concentric flat rings.

winter rose
#

and reduce it on each loop

leaden haven
#

Thanks.

drifting sky
#

Does anybody know if addPublicVariableEventHandler will fire every time the variable it is attached to is changed, even if it changes several times in a single server tick?

hushed tendon
#

I'm trying to spawn each rabbit Exactly on the position of their beggar but they seem to spawn generally around where the beggar was. Anyway to put them directly on the position of where the beggar was?

params ["_rabbits"];
if (typeOf _rabbits isEqualTo "C_man_p_beggar_F") then {

_currentUnit = _x;

deleteVehicle _currentUnit;

{
    _bunnySpawn = getPos _currentUnit;
    KB_rabbit = "Rabbit_F" createUnit [_bunnySpawn, createGroup [civilian, false]];
} foreach [_currentUnit];
};
winter rose
hushed tendon
#

I get an error with KB_rabbit setPosATL _bunnySpawn;. I also get an error with deleteVehicle _currentUnit; when I spawn a new "C_man_p_beggar_F".

params ["_rabbits"];
if (typeOf _rabbits isEqualTo "C_man_p_beggar_F") then {

_currentUnit = _x;
deleteVehicle _currentUnit;
{
    _bunnySpawn = getPos _currentUnit;
    KB_rabbit = "Rabbit_F" createUnit [_bunnySpawn, createGroup [civilian, false]];
    KB_rabbit setPosATL _bunnySpawn;
} foreach [_currentUnit];
};
distant oyster
copper raven
hushed tendon
#

The killer bunny 🐰

copper raven
#

that if is redundant, it will always be true, _rabbits is not just some random variable, it's the reference to the unit, _currentUnit = _x; thats not how it works, plus you already have the unit reference from the params, you named it _rabbits for some reason.

#

setPosATL fails because the syntax you're using for createUnit doesn't return the reference to the created unit

hushed tendon
#

I thought KB_rabbit = ... was the way you can reference a spawned unit but it doesn't seem to work.

little raptor
hushed tendon
little raptor
#

use the other one

#

also rabbits should be created with createAgent, not createUnit

hushed tendon
#

Also can you tell rabbits to move to a specific position if they are spawned? or do I have to attach them to an invisible person

little raptor
#

you can but they're slow

hushed tendon
#

anyway to speed them up?

little raptor
#

blobdoggoshruggoogly
maybe setAnimSpeedCoef

hushed tendon
#

alrighty

hushed tendon
#

I'm getting an error with [_spawnedAnimal] call WAG_animalAttack;, it's saying that it's an undefined variable.

call compile preprocessFileLineNumbers "JBOY\JBOY_AnimalAIFuncs.sqf";
call compile preprocessFileLineNumbers "WAG\WAG_AnimalAIFuncs.sqf";
params ["_replacedAI"];

//Settings
WAG_animal = "Rabbit_F"; 
WAG_docileSpeed = "LIMITED";
WAG_hostileTo = ["EAST", "WEST", "INDEPENDANT", "CIVIALIAN"];
WAG_animalDetectionRange = 50;

deleteVehicle _replacedAI;

{
    _animalSpawn = getPos _replacedAI;
    _spawnedAnimal = createAgent [WAG_animal, _animalSpawn, [], 0, "CAN_COLLIDE"];
    
    [] spawn {sleep 0.1};
    [_spawnedAnimal] call JBOY_spawnAnimalAI;
    [_spawnedAnimal] call JBOY_enableAnimalToMove;
    [_spawnedAnimal] call WAG_animalAttack;
    
} foreach [_replacedAI];

WAG_AnimalAIFuncs.sqf

WAG_animalAttack = 
{
params["_animal"];

_target = nearestObjects [_animal, ["Man"], WAG_animalDetectionRange;

hint _target;
};
little raptor
hushed tendon
little raptor
#

so that does nothing

hushed tendon
#

oh yeah. I have to put the rest inside the spawned {}

little raptor
little raptor
warm hedge
#

Also the forEach has no _x, no point to do it

cyan dust
#

And please check the spelling in

WAG_hostileTo = ["EAST", "WEST", "INDEPENDANT", "CIVIALIAN"];
warm hedge
#

WAG_hostileTo is used nowhere, also since they're just strings will do nothing?

patent goblet
#

How can I give a random value for R, G, B?

cursortarget setobjecttexture [0,"#(argb,8,8,3)color(R,G,B,0,co)"];
warm hedge
#
format ["#(argb,8,8,3)color(%1,%2,%3,0,co)",random 1,random 1,random 1]```
digital vine
#

Morning all!

Bit of a niche Question this morning, would the following Script in the execute box in Zeus mode, Lock out (and off) the Autohover ability for Rotary Assets?


chopperOne action ["autoHoverCancel", chopperOne]

proven charm
#

hey , I have a question. Is it possible to disable zeus camera moving such as the rotation?

warm hedge
#

Probably you can set the Zeus camera position/rotation for each frame to achieve this

coarse sedge
#

hey guys i know this is a bit off the subject but i thought i might be able to get some help, im trying to find a way to call a value in a xml config like set/get var but not having much luck

warm hedge
#

loadFile and some process to profit I guess

proven charm
#

thx POLPOX, I will try that 🙂

proper sail
#

Quick one; does setOwner change its locality I forgot, when done on a vehicle

cosmic lichen
#

If it's AI Driven probably yes

#

If player is in it I'd assume it fails

#

But cannot be certain without testing

proper sail
#

right right

proven charm
#

I tried this code but it doesn't stop the camera from rotating;

winter rose
#

@proven charm see pinned messages about how to post code (```sqf) 😉

proven charm
#

ok thx 🙂

warm hedge
winter rose
#
camLastDir = vectorDir curatorCamera;
addMissionEventHandler ["EachFrame",
{
  curatorCamera camSetDir camLastDir;
  curatorCamera camCommit 0;
  hintsilent format["TESTING %1 %2",curatorCamera, camLastDir ];
}];```
#

@proven charm and that's because vectorDir returns an array, and camSetDir takes a number

warm hedge
#

Looks like it takes an array?

winter rose
#

wow

#

"back in my days…!"

proper sail
#

@cosmic lichen Found the problem, i was trying a local command too quick. The owner transfer was too slow, and the script was already trying the local command and failed

proven charm
#

ty all! it works now 🙂

winter rose
#

then someone removed the Number, how nice è_é

opal sand
#

is there a way to make the (Portable Lights (single) light up in the day? (need it for a portrait photoshoot of my character 😄 )

slim spire
#

Why has BIS_fnc_endMissionServer recently changed to "somewhat deprecated" on the biki?

distant oyster
slim spire
#

ah, I see. Thank you

smoky rune
#

Is addItemToBackpack command multiplayer-friendly or it needed to be broadcasted via remoteExec?

willow hound
#

@wicked roost !wiki when?

smoky rune
#

I know about this wiki entry, but there is no information about how it works in multiplayer environment

willow hound
#

Global Arguments
Global Effect

hushed tendon
#

Anyway to make all factions hostile to civilians? kinda like how they do it with zombie mods?

hushed tendon
#

Oh. Didn't even know that existed. Thanks

warm hedge
#

inb4 a warcrime time

hushed tendon
#

You probably can't set a single unit to be hostile to everyone right?

winter rose
#

make civilians enemies to everyone?

hushed tendon
#

I'll probably just make them inde then so they can be hostile to almost everyone

#

Making custom factions sides needs to be a thing

warm hedge
#

Side relationships are handled by sides, not factions... sadly. So you can't make AAF and Syndikat hostile (directly, there's some workaround though)

hushed tendon
#

meant to say sides

fair drum
#

i think ravage creates a new side that works well. might want to look into how they do it

warm hedge
#

Huh? Is this even possible? Sides are completely Engine-driven I thought

fair drum
#

so when i was messing around with it, they had an option for a rogue faction. at first i thought they just did some sort of add rating manipulation, but when you go into zeus to look at the units, they represent a whole different color other than blue, red, green, purple. I think it was yellow like an object color.

#

other thing i could think of is some sort of doStop manipulation on team leaders since I screwed up a script once that had doStops and what ended up happening was the squads left the opfor side and joined a "yellow" unknown side that was hostile to everyone. I should look into how i accidentally did it.

winter rose
#

yellow being objects, so maybe agents?

fair drum
#

well then these agents were allowed to function as normal AI as far as targetting and visual cones and stuff

smoky rune
#

Any way to disable "Eject" action on aircraft?
lock doesn't work for some reason

manic sigil
smoky rune
#

I have custom action - paradrop from aircraft
If player will use default "Eject" action, he will bypass code tied to this custom action

warm hedge
#

They're controlled by UserActions config, which doesn't have any condition related to the lockstate

#

Since Arma 3 Jets introduced a scripted ejection system, this is how it is

smoky rune
#

and that means there is no way to remove it, right?

warm hedge
#

condition = "player in this && {speed this > 1}";Technically you can remove, technically

smoky rune
#

buuuuuuuuuuut?

warm hedge
#

But make your plane stop midair isn't what you wanted to do

smoky rune
#

well, i guess it's looks like it's time to do old good waitUntil {vehicle player != aircraftVehicle} 😅

manic sigil
#

waitUntil {sleep .1;

#

Gotta save those frames

#

Kill the animals tho

smoky rune
#

to be honest, i noticed that everything that touches player input should be as quick as possible

warm hedge
#

You can _plane setVariable ["bis_ejected",true]; even before you do an eject action, so the ejection function will be terminated

ivory lake
#

this means everyone, including their own side/group will shoot them tho

tidal ferry
#

Addon 'CUP_Afghan_Data' requires addon 'CA_E'

^Anyone know what's throwing this error? Or what addon CA_E is from?

still forum
#

CA_E should be inside cup

tidal ferry
#

I know, but any idea what it does? I've got it loaded on our server but it's throwing this as not being loaded

#

Think it might be corrupted but I'm not sure

still forum
#

sounds like corrupted to me

tidal ferry
#

Alright

#

Do you know if it's CUP Core or Terrains?

#

Will save a lot of time on downloads if it's the former

still forum
#

CA_E should be core

tidal ferry
#

Hmmm... just redownloaded Core, and it's throwing the same erroor

#

Going to try redownloading Maps just for the hell of it, but I'm open to suggestions

hushed tendon
#

Anyone know where I can find some info on making an invisible ai target?

tidal ferry
#

Try these:

#

Anyways, reinstalling CUP didn't work

#

Any suggestions on the error?

hushed tendon
#

Try checking the mod PBOs. I know once with ace I had to manually delete the old PBOs when it updated

winter rose
tidal ferry
#

Yeah of course

#

And yeah will do

cyan dust
#

Good day. I can't find, is there a command to holster a weapon (make unit empty handed) ?

winter rose
cyan dust
glacial lagoon
#

Is there any condition to check if a vehicle is in a spezific gear? I want to make a reverse driving sound for a truck

winter rose
#

there are no gear-related commands unfortunately

glacial lagoon
#

ok thanks

willow hound