#arma3_scripting

1 messages ยท Page 356 of 1

subtle ore
#

Init line is a bad place to start

chrome rain
#

no no, not for that script. just meant the only place i do anything is in that. never do scripts myself.

polar folio
#

pretty sure you can do it with some help. all you need is the will. i'm going by what you tryin to achieve not saying you can script anything right away

chrome rain
#

what im hoping to do is have a team hold an embassy, have riot/uprising outside, and then later on when things heat up, a car bomb and it goes from there. just so u know what im trying to do

subtle ore
#

Yeah that's totally possible.

#

What are you using to create the civilians?

#

Are you using cup mods?

chrome rain
#

rhs and project opfor

subtle ore
#

Okay. "playMove" and "switchMove" will play rtm animations on a unit from the animation viewer

#

doMove will have a unit move to a position

#

And createVehicle can be used for explosions

chrome rain
#

yeah have been looking into the animations. but havent seen any rock throwing.

polar folio
#

can you answer questions though?

#

do you have civs in the mission already or nah?

chrome rain
#

the explosion will be easy just using zeus, its just the rock throw part

#

no, havent placed them down yet, just messing around in a template until i get anything working

subtle ore
#

You should script this, zeus isn't going to replicate your concept very well

chrome rain
#

im zeus

#

๐Ÿ˜‰

polar folio
#

you should start with some editor tests. AI can be unexpected

subtle ore
#

Hmmm, tricky bastard ๐Ÿค”

polar folio
#

place a player as blufor

#

and place a civ and give him the stone grenades. then place an opfor guy and group the civ to him. now set "probability of presence" to 0% inside the attributes window of the opfor dude

#

if you are lucky you will get a hostile civ that will throw stones at you

chrome rain
#

havent tried that yet! will do right away!

polar folio
#

might need to make him feel like a bad ass with some AI commands. like allowfleeing and stuff

subtle ore
#

Have to have the unit throw the roc

polar folio
#

what's the class name of the stone grenade magazine? di you look it up already?

subtle ore
#

"HandGrenade_Stone" iirc

astral tendon
#

dosStop car2;
dosStop car3;
dosStop car4;

#

so what is the generic error here?

indigo snow
#

the typo

#

sSsSsSs

subtle ore
#

๐Ÿ˜‚

peak plover
#

Can't stop the dos

astral tendon
#

one day im gonna break this keyboard

polar folio
#

should break your fingers instead

indigo snow
#

car1 dosStop car2 will stop both cars obviously

peak plover
#

๐Ÿ˜‚

polar folio
#

i knwo the feeling though. i'm the sloppiest of slops in terms of typing

chrome rain
#

@subtle ore yeah the HandGrenade_Stone

polar folio
#

^see?

peak plover
#

Brutal

chrome rain
#

im right to assume i cant get the stones not to make the blow up sound right?

little eagle
#

Those aren't really stones. They are grenades without the splash damage.

chrome rain
#

yeah but needed a stone. thanks for the help guys!

tough abyss
#

Dedmen brings a God.

indigo snow
tough abyss
#

Ahh, he already posted.

subtle ore
#

@little eagle imaginary stones

little eagle
#

You'd need a mod for throwable stones.

#

imaginary stones

#

โ“

subtle ore
#

Those aren't really stones. They are grenades without the splash damage.

little eagle
#

Yes, they just named them stones. I think I made it clear already that I don't believe in names.

subtle ore
#

Jokes ensue commy

little eagle
#

Jokes are meant to be funny.

#

๐Ÿ‘ ๐Ÿ‘„ ๐Ÿ‘ <<< like this face

subtle ore
#

Hey now Commy. You're jokes are cruel.
๐Ÿ– ๐Ÿ‘ ๐Ÿ‘„ ๐Ÿ‘ ๐Ÿ–

little eagle
#

Two right hands

subtle ore
#

They don't have left hand icons unfortunately

peak plover
#

๐Ÿ‘Œ๐Ÿฟ ๐Ÿคฆ๐Ÿฟ๐Ÿ‘๐Ÿฟ

subtle ore
#

Damn discriminatory is what that is

#

๐Ÿ‘ฝ ๐Ÿšฌ

little eagle
#

Thumbs up is left hand, OK sign is right hand.

#

What does it mean?

subtle ore
#

๐Ÿค” :๐Ÿ‘Œ < :+1:

peak plover
#

๐Ÿ‘Œ๐Ÿฟ ๐Ÿ†

little eagle
#

What does the aubergine mean? People keep posting it.

subtle ore
#

Australian natives?

peak plover
#

Aubergine is eggplant

little eagle
#

Yes.

peak plover
#

aboriginal is australian native

subtle ore
#

I see

peak plover
#

As much as I've researched, my studies have showed that the aubergine usually represents a solid shaft

little eagle
#

So it's a dick.

peak plover
#

I think

little eagle
#

Stop sending me dicks, thanks.

peak plover
#

*๐Ÿšฌ *

subtle ore
#

@peak plover probably the structure reference

#

๐Ÿ‘ฝ ๐Ÿšฌ

peak plover
#

๐Ÿ™ƒ

subtle ore
#

๐Ÿ‘ ๐Ÿ‘ƒ ๐Ÿ‘

little eagle
#

. ๐Ÿ‘„

#

my god

#

That looks disturbing.

subtle ore
#

๐Ÿ‘ ๐Ÿฝ ๐Ÿ‘
๐Ÿ‘„

peak plover
#

๐Ÿšฌ โ˜• โค

sleek nova
#

hello, i am trying to create a dialog via script with the following code: ```// Create dialog
_display = findDisplay 46;

// Create controls
_ctrlResources = _display ctrlCreate ["RscText", 645];
_ctrlResources ctrlSetPosition [0.644375 * safezoneW + safezoneX,0.027 * safezoneH + safezoneY,0.0464063 * safezoneW,0.022 * safezoneH];
_ctrlResources ctrlSetBackgroundColor [-1,-1,-1,-1];
ctrlSetText [_ctrlResources, "Resources"];
_ctrlResources ctrlSetTextColor [1,1,1,1];
_ctrlResources ctrlSetFontHeight -1;
_ctrlResources ctrlCommit 0;```

#

but for some reason it doesn't do anything or does not show up..

#

i know i set the position correctly, because when i add the control with only a background set to [1,1,1,1] i see a white block in my screen...

#

can somebody please take a look at my code and tell me what i am doing wrong?

polar folio
#

so you are saying the ctrlSetText is failing? or what?

#

slightly confusing because you are implying it is creating and palcing the control proven by setting its background color. so doesn

#

't sound like "it doesn't do anything"

sleek nova
#

Yeah i think it is not showing the text

polar folio
#

did you try the other syntax?

#

_ctrl ctrlSetText _txt

#

i also think you are using the syntax wrong. afaik it requires the idc as input and not the control itself

#

so you mixed both syntax into a crippled hybrid that painfully whispers "kill me!"

#

i think...could be wrong. i never use these types of syntax

astral tendon
#

what does the "weapow aim" at AI features do?

#

so what it do?

#

what is this error?

indigo snow
#

youre missing a required mod

astral tendon
#

but ares is activated

little eagle
#

@sleek nova Do yourself a favor and do it with the description.ext

sleek nova
#

already tried that but then i cannot move

#

because i get the mousepointer

little eagle
#

That has nothing to do with config vs sqf.

sleek nova
#

i just want a little icon in the top right corner of my screen that shows the amount of resources available

#

i tried it this morning but then as it says on the wiki: Displays created with both createDisplay and createDialog will take control of the mouse pointer and will close when user presses Esc. that is exactly my problem

little eagle
#

Make the control a base class in the description.ext (== mission config) and then use ctrlCreate with your classname.

sleek nova
#

okay thank you i will try that

little eagle
#

Also, without mods this is really annoying to make, because this game is weird with the mission display #46

#

Vanilla?

sleek nova
#

nope haha

#

a lot of mods ๐Ÿ˜ฆ

#

but i will try with cutrsc too

little eagle
#

Is this supposed to work in a savegame too?

sleek nova
#

no

little eagle
#
// description.ext
class Extended_DisplayLoad_EventHandlers {
    class RscDisplayMission {
        MyMission_initCounter = "call compile preprocessFileLineNumbers 'initCounter.sqf'"
    };
};
// initCounter.sqf
params ["_display"];

private _control = _display ctrlCreate ["RscText", -1];

_control ctrlSetText "splendid";
_control ctrlSetTextColor [0.1,1.0,0.1,1.0];

_control ctrlSetPosition [
    safezoneX + safezoneW - 0.2,
    safezoneY + 0.0 * safezoneH,
    safezoneW * 0.1,
    safezoneH * 0.3
];
_control ctrlCommit 0;

MyMission_Counter = [_control];
#

To change the text:

(MyMission_Counter select 0) ctrlSetText "hello world";
#

If you care about the savegame, then you have to reapply the text with a MissionLoad eventhandler.

sleek nova
#

i want to set text with a pubvareventhandler everytime the resources change

little eagle
#

Sure, why not.

sleek nova
#

okay thanks i'll give that a go ๐Ÿ˜ƒ

#

lol that works ๐Ÿ˜ƒ

#

i was just about to cry in my sleep...

little eagle
#

lol

sleek nova
#

and then this hero comes along

little eagle
#

Written in 5 minutes, mate. Step up your game.

sleek nova
#

i will, i will.

#

haha

runic surge
#

Is there a way to find a number from another array in the same position as a string in another using forEach?

sleek nova
#

_forEachIndex

little eagle
#

find select example???

runic surge
#
Array1 = ["Thing1", "Thing2"];
Array2 = [50, 75];

Thing1 should have 50 and Thing2 should have 75

sleek nova
#
_str = Array1 select _forEachIndex;
format ["%1 %2", _str, _x];
} forEach Array2;```
little eagle
#
Array2 select (Array1 find "Thing2") // 50
#

Or just use a namespace instead of an array with setVariable, getVariable.

#

Oh, 75, not 50

runic surge
#

I need to have an array of class names as a list and I was going to use the second array for the resource cost of those classes

little eagle
#

Mods, vanilla?

runic surge
#

It needs to be sort of dynamic with no set number of classnames. Vanilla

#

So I suppose I could create the variables with a forEach statement

little eagle
#
// init
MyMission_Costs = createLocation ["Name", [0,0,0], 0, 0];
MyMission_Costs setVariable ["Thing1", 50];
MyMission_Costs setVariable ["Thing2", 75];

// mid mission
MyMission_Costs getVariable "Thing2" // 75
runic surge
#

what is the location for?

little eagle
#

It's the container for the costs. Just like an array, but you can access the contents with a hash / string and not just a index/number.

runic surge
#

And I could create dynamic setVariables for each thing in an array using forEach

little eagle
#

LOCATION type is just the cheapest one, because it has no simulation and you can have millions before the map fps start to drop.

runic surge
#

Ah

little eagle
#

Sure.

runic surge
#

How long have you been doing this? I literally wouldn't have even though to do it that way

little eagle
#

Instead of set, you use setvariable, insetad of select, you use getVariable.

#

How long have you been doing this?
I bought A2 26 december 2011 and mod A3 since Alpha.

runic surge
#

I assume you also have past programming experience as well?

little eagle
#

I am of the opinion that the best possible solutions for most things don't get used enough, so I post the weird stuff here. : P

#

No, I hate these hackers.

runic surge
#

well my experience in any type of programming begins and ends with A3 missions and modding lol

little eagle
#

My grandparents bought me a game boy in the 90s and because I'm a dirty cheater, I used these adapter thingies to change the memory addresses of my games when I was like 10. So I am predisposed(?) to this shit.

runic surge
#
WEST_Inf_List = [
    "B_Soldier_lite_F",
    "B_Soldier_F"
];

WEST_Inf_Cost = createLocation ["WEST_Inf_Cost", [0,0,0], 0, 0];

{
    WEST_Inf_Cost setVariable [_x, 50];
} forEach WEST_Inf_List;

So this would set each unit to have a cost of 50.
Would using two arrays (one for classnames, one for cost) still be inefficient? The goal is to have it be dynamic so anyone can just change or add new classnames and set their costs

little eagle
#
// edit these
WEST_Inf_List = [
    "B_Soldier_lite_F",
    "B_Soldier_F"
];

WEST_Cost_List = [
   50,
   75
];

// don't you dare touch these
WEST_Inf_Cost = createLocation ["WEST_Inf_Cost", [0,0,0], 0, 0];

{
    WEST_Inf_Cost setVariable [_x, WEST_Cost_List select _forEachIndex];
} forEach WEST_Inf_List;

like this?

runic surge
#

It looks like that would work, if the _forEachIndex commands works like that. Still don't quite understand but I will test it

indigo snow
#

I would personally make a pairs array for easier editing. [ [name,value], [name,value] ... [name,value] ]

runic surge
#

I suppose that would work as well

indigo snow
#

If you start putting in more than say 5 things

runic surge
#

again, didn't even occur to me

little eagle
#

I can agree with this.

runic surge
#

that makes it so much more organized

little eagle
#

You don't even need the sub arrays tbqh.

runic surge
#

instead of losing count trying to line up the classname with the correct index

indigo snow
#
{
   LOCATION setvariable_x;
} foreach pairsArray;```
little eagle
#
// edit these
WEST_Inf_List = [
    "B_Soldier_lite_F", 50,
    "B_Soldier_F", 75
];

// don't you dare touch these
WEST_Inf_Cost = createLocation ["WEST_Inf_Cost", [0,0,0], 0, 0];

for "_a" from 0 to (count WEST_Inf_List - 1) step 2 do {
    WEST_Inf_Cost setVariable [_a, _a + 1];
};
#

Why is step highlighted red -__-'

indigo snow
#

Already a syntax error, tsk

runic surge
#
// Recruitable units available to team BLUFOR - Classname, Cost
WEST_Inf_List = [
    ["B_Soldier_lite_F",50],
    ["B_Soldier_F",75]
];

// Don't edit below this comment
WEST_Inf_Cost = createLocation ["WEST_Inf_Cost", [0,0,0], 0, 0];

{
    WEST_Inf_Cost setVariable [(_x select 0), (_x select 1)];
} forEach WEST_Inf_List;

Like this?

indigo snow
#

Dont even need to select

#

Can use _x directly

little eagle
#

Fixed the comma.

indigo snow
#

Lots of people make mistakes adjusting the commas with arrays, idk which version would be more "idiot proof"

runic surge
#

I feel like the sub arrays are easier

#

they seem to to me

#

but that's just me

indigo snow
#

Whatever works for you

little eagle
#

Then do that and also change

#
WEST_Inf_Cost setVariable [(_x select 0), (_x select 1)];
#

to

#
WEST_Inf_Cost setVariable _x;
runic surge
#

Oh

#

right

#

just use the entire subarray

#

since it is the right syntax already

little eagle
#

Yup. cptnnick suggested that.

runic surge
#

I couldn't figure out what he meant to be honest

indigo snow
#

You might also wanna think about adding the third boolean flag for sending accross network

runic surge
#

I overthink things too much

#

What do you mean?

indigo snow
#

And yea my bad i hate typing select syntax on phone

little eagle
#

Well, you can't do it with a LOCATION.

indigo snow
#

Ah really?

little eagle
#

No, LOCATION only accepts the 2 element version.

indigo snow
#

Of course, were talking arma

#

Then forget about all that, rylan

little eagle
#
Syntax:
varspace setVariable [name, value]
Parameters:
varspace: Namespace, Object, Group, Team_Member, Task, Location, Control, Display - variable space in which variable can be set
#
Syntax:
varspace setVariable [name, value, public]
Parameters:
varspace: missionNamespace, Object or Group - variable space in which variable can be set
[name, value, public]: Array
#

LOCATION are strictly local, which is part of what makes them so nice for this.

#

If you need a global one, createSimpleObject with "Building" as class is the best you can do.

indigo snow
#

Can i subscribe to the commy hacks wiki, i forget these specifics from time to time.

little eagle
#

This but with vanilla you have to use Name / Building

#

Oh, @runic surge , change
createLocation ["WEST_Inf_Cost"
to
createLocation ["Name"

#

To avoid an RPT entry complaining about using an invalid location class name

runic surge
#

is name the name of the location or type of location

little eagle
#

Type / classname.

#

Like B_Soldier_F

#

It's one without text and image for maximum fps on the map.

#

Because some people want 10000 of them, looking at you ACRE

tame portal
#

@little eagle ๐Ÿ†

#

I think I came too late for the party

little eagle
#

^^

runic surge
#
{
    private _unitList = WEST_Inf_Cost getVariable _x;
    private _unitType = _unitList select 0;
    private _unitCost = _unitList select 1;
    private _unitDisp = getText (configFile >> "CfgVehicles" >> _unitType >> "displayName");
    private _UnitPict = getText (configFile >> "CfgVehicles" >> _unitType >> "portrait");
    private _unitStr = format ["Recruit <execute expression=""hint 'test'"">%1</execute>, Cost: %2", _unitType,_unitCost];
    private _unitAdd = _pLocal createDiaryRecord ["Procure Assets", [_unitStr]];
} forEach _sInfList;

I have this in the local player initialization function. _sInfList is just SIDE_Inf_List so if player is blufor it becomes WEST_Inf_List

#

I don't see any issues here, but I usually don't so that doesn't mean much

peak plover
#

What was the fix for call compiling resistance

little eagle
#
(WEST_Inf_Cost getVariable _x) params ["_unitType", "_unitCost"];
peak plover
#

I'm getting GUER instead of resistance

little eagle
#

That is how the side is displayed though.

runic surge
#

for condition it only works with resistance

peak plover
#

ohh

#

If I do "resistance" (doubles my qoutes) it works

runic surge
#

if I do

(WEST_Inf_Cost getVariable _x) params ["_unitType", "_unitCost"];

shouldn't _unitType return a string of the unit's classname? I get an error that says it got a number

little eagle
#

Oh, wait.

#
{
    private _unitType = _x;
    private _unitCost = WEST_Inf_Cost getVariable _x;

    ...
} forEach _sInfList;
#

_sInfList is a bunch of classnames, right?

runic surge
#

it is WEST_Inf_Cost but for the player it is run for's side

#

which reminds me, I need to change that in the forEach expression as well

#

so if a player is opfor, it would be EAST_Inf_Cost

little eagle
#

Can't you use one namespace for all costs?

#

Doubt they share classes between sides.

#

And even then, it'd be fair if they cost the same.

runic surge
#

I just want to keep it separate for organizational purposes

#

also the sides might be asymmetrical

little eagle
#

True, but don't all sides have their own ammo boxes, static weapons etc. even if they are just retextures?

runic surge
#

yeah

#

I just prefer it this way honestly

#

also I still get an error, this time it says type array

little eagle
#

You could make it like this:

WEST_Inf_Cost = bla bla bla
EAST_Inf_Cost = bla bla bla
INDEP_Inf_Cost = bla bla bla

MYSIDE_Inf_Cost = [WEST_Inf_Cost , EAST_Inf_Cost, INDEP_Inf_Cost] select ([west, east, resistance] find playerSide);
#

dumb brackets

runic surge
#
private _pSide = format ["%1_balance", side _pLocal];
private _pFlag = format ["%1_flag", side _pLocal];
private _pInfList = format ["%1_Inf_List", side _pLocal];

private _total = missionNameSpace getVariable [_pSide,0];
private _sFlag = missionNameSpace getVariable [_pFlag,0];
private _sInfList = missionNameSpace getVariable [_pInfList,0];

so this is unnecessary

little eagle
#

Yeah. You'd also run into the GUER problem with independent/resistance.

runic surge
#

WEST_balance = 0;
EAST_balance = 0;
GUER_balance = 0;

#

I have it like that

little eagle
#

oh, lol OK

runic surge
#

They are all four letters

#

it is beautiful

little eagle
#

CIV has 3

runic surge
#

well CIV isn't a military force so they don't need 4 letters

#

_unitCost returns as an array

#

not sure why that is happening everything looks right

peak plover
#

for some reason

#

west,east work, resistance does not

#

 1:44:30 """east"""
 1:44:30 "true"
 1:44:38 """resistance"""
 1:44:38 "true"
#

isEqualType sideEmpty

#

Current issue: it can save west/east to an array, but not resistance

little eagle
#

post code

peak plover
#

Goes across 2 scripts

runic surge
#

why didn't BI just stick with GUER for independents

peak plover
#

Also contains ugly code, you'd regret looking

runic surge
#

would have saved a lot of trouble

peak plover
#

yesh

little eagle
#

Can't be worse than XEH before I rewrote it.

peak plover
#

HAHA

polar folio
#

is there a way to get all entries or at least the number of entries a listbox has?

little eagle
#

lbSize

peak plover
#

I would _listBox setVariable when creating the entries

polar folio
#

yea jsut found it. thx though

#

it's not a listbox i'm creating myself. but good idea generally

peak plover
#

Ayy literally had to compile it in the same file it's used in because apparently #noserilization is cool

#
    _task params ["_target","_group","_description",["_destination",[]],["_type","default"],["_state","CREATED"]];
    _conditions params [["_condAdd",{true}],["_condWin",{false}],["_condLose",{false}]];
    _code params [["_codeAdd",{}],["_codeWin",{}],["_codeLose",{}]];

    if (_destination isEqualType objNull && {isNull _destination}) then {_destination = []};
    if (_destination isEqualType [] && {(_destination param [0]) isEqualType objNull}) then {
        _destination = [];
    };

    // Search current vars for this taskVar
    private _searchResult = _mission_tasks_currentVars select {(_x param [0]) isEqualTo _taskVar};

    // Task main handler
    call {

        // If task state is none or it was not in search results
        if (_currentState isEqualTo 'none' || {(_searchResult isEqualTo [])}) exitWith {

            if (call _condAdd) then {

                if !(_description isEqualType []) then {
                    _description = [_description];
                };

                private _taskTarget = _target;
                str _taskTarget call debug_fnc_log;
                if (_taskTarget isEqualType "") then {
                    _taskTarget = call compile _taskTarget;
                };
                str (_taskTarget isEqualType sideEmpty) call debug_fnc_log;

                private _taskID = [
                    _taskTarget,        //target
                    _group,            //name
                    _description,    //description
                    _destination,    //destination
                    _state,            //state
                    0,                //priority
                    true,            //show notification
                    _type,            //image type
                    true            //share
                ] call BIS_fnc_taskCreate;
little eagle
#

Just use my gist to serialize it.

#

It must be good code when the lines begin with 28 spaces.

peak plover
#

those r not spaces ๐Ÿ˜„

#

It's in a count

#

That's the part that was erroring

#

and exploding

little eagle
#

line?

peak plover
#

_target was told "Undefined variable"

#

I added the stuff between debug_fnc_log; to fix

#

That was in the file previous to this

#

moved it here so it works now

#

Because the target comes from a textbox it's a string

#

west, east, player etc. worked. But group player, resistance, civilian would error

#

Now they all are gucci

little eagle
peak plover
#

I don't understand

little eagle
#

y?

peak plover
#

ohhh

#

That would only work with resistance

#

*not work

#

also groups

little eagle
#

It would work with resistance. And no, not with groups.

peak plover
#

SIDES find _side

#

SIDES does not contain "resistance"

#

also toUpper _side

little eagle
#

independent and resistance are aliases. The game can't tell the difference.

peak plover
#

yeah, but what if I type in resistance, find is going to return -1

little eagle
#

[independent] find resistance // 0

peak plover
#

๐Ÿ˜ฎ

#

holy shit?

little eagle
#

I told you five times now that they are aliases^^

peak plover
#

Damn I need more โ˜•

little eagle
#

It's like:
1/2
and
2/4

ionic orchid
#

anyone used say3D and had it play sounds twice?

little eagle
#

Same thing

peak plover
#

@ionic orchid yeah. Ran script globally when 1 player on server

#

if you are using the mp variant

little eagle
#

1/โˆš2
vs.
โˆš2/2

peak plover
#

That's too much

ionic orchid
#

I'm just running it locally via 3den

little eagle
#

sin x
vs
cos (ฯ€/2 - x)

ionic orchid
#
[player, "an_m_e_1"] spawn {
    params ["_sourceObj", "_soundName"];

    _spawnPosition = getPosASL _sourceObj;

    _obj= "Land_HelipadEmpty_F" createVehicleLocal _spawnPosition;
    playSound _soundName;
    sleep 5;
    deleteVehicle _obj;
};

being the script I'm running

runic surge
#
    private _unitStr = format ["Recruit <execute expression=""hint 'test'"">%1</execute>, Cost: %2 <br /><img image=""%3""/>", _unitDisp,_unitCost,_unitPict];
    private _unitAdd = _pLocal createDiaryRecord ["Procure Assets", [missionNameSpace getVariable [_unitStr,0]]];

I can see the "Procure Assets" subject in the map, but when I click it it just shows a blank diary record with no text in it. The expression part works fine, I tested it earlier and it displays fine and executes the hint command normally. It says 1 element provided, 2 expected. I tried just putting the _unitStr variable in the array after "Procure Assets" but that didn't work either. I also tried with just _unitStr and having the format in an array

little eagle
#

e^(iฯ€)
vs
-1

#

Same

#

thing

peak plover
#

ugh...

#

umm

#

nerd!

#

I don't see why that would play the sound twice

#

Unless it's running twice

ionic orchid
#

it might be something to do with the bitrate conversion I've done to the files...

peak plover
#

@runic surge missionNameSpace getVariable what?

ionic orchid
#

44k stereo -> 22k mono = plays twice
44k stereo = plays once

peak plover
#

wth... :/

runic surge
#

@peak plover it didn't work with just _unitStr so I just pasted that in to see what would happen

peak plover
#

dat's wrong

runic surge
#

even though it is supposed to be a string

peak plover
#

It's looking for a variable that's called Recruit <execute expression=""hint 'test'"">%1</execute>, Cost: %2 <br /><img image=""%3""/>

runic surge
#

Yeah I realized that shortly after I ran the code

#

not sure what I was trying to accomplish there

#
private _UnitAdd = _pLocal createDiaryRecord ["Procure Assets", _UnitStr];
private _UnitAdd = _pLocal createDiaryRecord ["Procure Assets", [_UnitStr]];

neither of these work either

ionic orchid
#

haha yeah, if I use "Stereo Track to Mono" in Audacity, the audio will play twice in Arma

#

both when saving directly to .ogg and when .wav->.wss with the tool

#

that's nuts

peak plover
#

do "test" hintC [_unitStr];

runic surge
#

where?

peak plover
#

after you make the string

runic surge
#

have the expression blank?

peak plover
#

see if string works

runic surge
#

oh I got it

#

seems to work

#

maybe the image is messing it up

#

or it needs single quotes

peak plover
#

img does not close

#

    player createDiarySubject ["roster","Team Roster"];
    player createDiaryRecord ["roster", ["Team Roster","<execute expression='[] spawn briefing_fnc_roster'>Click here or press J to open roster</execute><br/>"]];
#

this one works on my machine

#

Looks like your image was not closing?

runic surge
#

something is wrong with the way I am getting the image path I think

#
private _UnitPict = getText (configFile >> "CfgVehicles" >> _unitType >> "portrait");
#
    private _UnitStr = format ["Recruit <execute expression=""hint 'test'"">%1</execute>, Cost: %2", _UnitDisp,_UnitCost];
    private _UnitAdd = _pLocal createDiaryRecord ["Procure Assets", _UnitStr];

This works, aside from the title text of the diary record being blank

#

I will figure out the image part later

peak plover
#

_unitStr has to be an array

runic surge
#

it didn't work as an array

#

now it does

little eagle
#

Unlikely.

runic surge
peak plover
#

That warlords gamemode the BI emploey made had something similar

#

Check it out for inspiration

runic surge
#

I did

#

I don't even know what to look at

#

that is kind of the idea I am going for here though

#

the warlords function uses the same format method

#

I will see if I can't replicate that part

#

Got it

    private _UnitStr = format ["Recruit " + "<execute expression=""hint 'test'"">%1</execute>, " + "Cost: %2", _UnitDisp,_UnitCost];
    private _UnitAdd = _pLocal createDiaryRecord ["Procure Assets", ["Infantry", _UnitStr]];

https://i.imgur.com/AcB7vol.png

austere granite
#

not unless you write a custom framework for it

#

comparing the mouse position with an array of created icons

tough abyss
#

Just curious did you benchmark
if ( toUpper(_substring) isEqualTo toUpper(_stringToCheck) )
is faster than
If (_substring == _stringToCheck)

ionic orchid
#

more double-audio weirdness

#

maybe it's just an audio length problem - I added some silence to the end of a short clip that repeats and the problem stopped

robust hollow
#

how do i remove the magazine loaded in a weapon? simply doing removeMagazine isnt working/

little eagle
#
private _items = primaryWeaponItems _unit;
_unit addWeapon primaryWeapon _unit;
removeAllPrimaryWeaponItems _unit;

{
    _unit addPrimaryWeaponItem _x;
} forEach _items;
runic surge
#

is says generic error in expression sometimes and missing a closing bracket other times

#

nul = [type,cost,caller] call BTH_fnc_RecruitUnit
that is the syntax for my function

#

it seems that for some reason the player doesn't work

#
    private _unitCode = format ['nul = [%1,%2,%3] call BTH_fnc_RecruitUnit',_unitType,_unitCost,_pLocal];
    "Debug" hintC [_unitCode];
    private _unitDisp = getText (configFile >> "CfgVehicles" >> _unitType >> "displayName");
    private _unitStr = format ["Recruit " + "<execute expression='%3'>%1</execute>, " + "Cost: %2", _unitDisp,_unitCost,_unitCode];
    private _unitAdd = _pLocal createDiaryRecord ["Procure Assets", ["Infantry", _unitStr]];

BTH_fnc_RecruitUnit:

// Script run to purchase units from the map menu
// nul = [type,cost,caller] call BTH_fnc_RecruitUnit
// type: Classname - Type of unit to create
// cost:--- Number - Resource cost of unit
// caller:- Object - Player that recruited the unit
// Example: nul = ["B_Soldier_F",50] call BTH_fnc_RecruitUnit;

params [
    ['_unitType',"",[""]],
    ['_unitCost',[0]],
    ['_pLocal',objNull,[objNull]]
];

private _p_balance = [WEST_balance , EAST_balance, GUER_balance] select ([west, east, resistance] find side _pLocal);
private _u_spawn = [BLU_FLAG , RED_FLAG, GRN_FLAG] select ([west, east, resistance] find side _pLocal);

if (_p_balance < _unitCost) exitWith {hint "You cannot afford that unit!"};

private _soldier = _unitType createVehicle (getMarkerPos _u_spawn);
nul = [_soldier] call BTH_fnc_UnitSetup;

sleep 0.1;

nul = [_unitCost,_soldier,false] call BTH_fnc_HandleBalance;
robust hollow
#

why do you donul = every time you call something? also by putting _pLocal in the params by formatting it the param itself isnt an object.

#

thanks commy, thought there may have been a command for it but that will have to do ๐Ÿ‘

runic surge
#

@robust hollow so is there a way to pass it as an object?

robust hollow
#

use the netid instead

runic surge
#

also I don't know about the nul just habit I guess

#

does netId work in MP as well

robust hollow
#
private _unitCode = format ['nul = [%1,%2,%3] call BTH_fnc_RecruitUnit',_unitType,_unitCost,str netid _pLocal];```
```sqf
    ['_pLocal','',['']]
];
_pLocal = objectfromnetid _plocal;

what? netID is made for MP...

runic surge
#

oh ok

#

wiki says it only works for MP

#

that's unfortunate

robust hollow
#

its the network ID, netID itself isnt made for SP but there is a function varient that makes it work for sp apparently

runic surge
#
private _unitCode = format ['nul = [%1,%2,%3] call BTH_fnc_RecruitUnit', _unitType, _unitCost, str (_pLocal call BIS_fnc_netId)];
    ['_pLocal',"",[""]]
];

_pLocal = _pLocal call BIS_fnc_objectFromNetId;

@robust hollow this works (as far as I can tell so far, the actual function loads properly and I get no errors)

#

in case you were curious about the SP compatibility

robust hollow
#

๐Ÿ‘

runic surge
#

it appears to work but it says generic error in expression

#

not sure why though

robust hollow
#

show the error

runic surge
#

It was a problem with the the quotes I guess

#

works now

manic sigil
#

Does calling the advanced hint function display to all players in MP, or just the person who activated it?

#

I have them called via an addaction that runs a tiny sqf that just calls the hint in question.

simple solstice
#

always check out the wiki and look out for small eL pictures

#

they say if the effect is local or global

#

hints have an local effect

#

so you would have to remoteexec it so other players see them

manic sigil
#

Locality is my kryptonite :/ So that is true even for addAction events?

simple solstice
#

addAction is also local but can take global attributes

#

these are your friends or enemies

manic sigil
#

Yeah. The script works, so far as I know, for loading people up.

#

The script adds a weapon, then has the weapon's advhint pop up.

simple solstice
#

the pictures are next to the version it was implemented

#

if you want the hint to show up to everyone, remote exec it

manic sigil
#

Actually, I want it to show up only to the person who uses the action.

#

So if someone returns to a stockpile, it doesn't spam everyone.

simple solstice
#

oh, so you just want to addAction to every player?

#

which is attached to an object?

manic sigil
#

Yeah, a supply box.

#

Well, series thereof.

simple solstice
#

guess you made the mission on the editor, so give the boxes some variables eg. box1 = this

#

and then in the init file or initplayerlocal or whatever script fires on the players

#

add addAction with the box1 as an object

manic sigil
#

Not entirely sure I followed, to be honest :/ Would that change the function from just having the addAction in the boxe's init field?

simple solstice
#

or heck

#

I was about to write that

manic sigil
#

Ah :p

simple solstice
#

so much easier, sorry it's the morning :D

#

but if it's present on the editor init field

#

it should show up for every player

#

if it doesn't, then either the SQF code failed, or you wrote arguments for the action that dont return true

manic sigil
#

S'alright, I shouldn't be coding this late anyways ๐Ÿ˜› Got a friend to pop in and test my script, so I'll be able to objectively understand how badly I screwed up.

manic sigil
#

Tested online, functioned as hoped - Player joined, loaded the kit from the box, got the popup, all without me (hosting) seeing anything.

#

Well, besides teleporting gear, but that was expected.

thorn pine
#

Whether it is possible to write down in wiki, that b = array a, link to array a. If you change the array b, then the array a changes. I think this will be useful information. To copy an array b = + array a.
a = [0,1,2];
b = a;
c = +a;
c set [1, -2];
b set [0, -1];
a pushBack 3;
hint str a; //[-1, 1, 2, 3]
hint str b; //[-1, 1, 2, 3]
hint str c; //[0,-2,2]

indigo snow
#

Its mentioned

slender halo
#

hey, i try to get pitch/bank angles of an object in world space but i can't figure out how to correctly rotate my vector, can anyone help me

indigo snow
#

Welcome to euler angles, i gotnsome stuff laying around but as always you might end up upside down

#
Y = vectorDir vv;
Z = vectorUp vv;
X = vectorNormalized(Y vectorCrossProduct Z);

N = Z vectorCrossProduct [0,0,1];

_xrot = atan((Z select 1)/(Z select 2));
_yrot = atan(-(Z select 0)/sqrt(1-((Z select 0)^2)));
_zrot = atan((Y select 0)/(X select 0));
 _yrot = atan(-(Z select 0)/sqrt(1-((Z select 0)^2));
 _zrot = atan((Y select 0)/(X select 7
0));

Where vv is an object.

grand berry
#

This is very helpful

indigo snow
#

Meh. From quaternion to euler angles is trivial, the inverse not

slender halo
#

thanks guy, it gives me a better start point

#

i still get confused when it comes to vectors

little eagle
#

sqrt(1-((Z select 0)^2)))

#

Why?

indigo snow
#

Very late night code fuckery

#

More about learning than good code

little eagle
#

sinยฒx+cosยฒx=1

indigo snow
#

This was pulled straight from a paper on how to derive the angles

#

Im only now taking the uni course explaining it all :P

little eagle
#

The paper should apply the Pythaogrean identities to make it look prettier.

indigo snow
#

Its NASA

grand berry
indigo snow
#

About page 17

#

Arma / 3den doesnt seem to use XYZ rotation

little eagle
#

To rotate a vector:

  • convert to polar
  • add rotation
  • convert polar to cartesian
indigo snow
#

> add rotation is exactly the non trivial part or you run the chance of ending upside down

little eagle
#

It is trivial in polar coordinates.

#

10ยฐ+30ยฐ=40ยฐ

indigo snow
#

Sure and to covert back you take sine/cosine

#

And suddenly quadrants interect

#

cos(0) = cos(pi)

little eagle
#

ยฏ_(ใƒ„)_/ยฏ

#

cos pi is -1

#

?

#

cos(0) != cos(pi)

indigo snow
#

Confused with sin

little eagle
#

^^

indigo snow
#

In lecture :P

#

(About this subject)

#

I promise you its non trivial if you don't already "know" the solution

little eagle
#

Trigonometry is the best invention since sliced bread.

indigo snow
#

No vector math is since now you dont have to care about angles or anything anymore but eh

tough abyss
#

Trigonometry is one of the more interesting math subjects.

indigo snow
#

Need to convince BI to add a matrix type

little eagle
#

Trigonometry is something you can reinvent within an afternoon.

indigo snow
#

If you know angles, transforming is semi trivial. If you know the transformation, figuring out the angles is not, to conclude.

tame portal
#

This channel continues to amaze me

astral tendon
#

so, i wanna to use a DoStop to a AI unit that step on the trigger area, how i set it up?

indigo snow
#

So whats making it hard for you is that triggers arent meant to target incoming / outgoing units. You could simply do a continous loop that keeps setting doStop on thisList, but then theyd never move again

#

Do they have a waypoint in the trigger area? It might be better to use waypoint completion code

astral tendon
#

cant just be that?

#

i dont wanna the vehicle to move once it hit it anymore

#

i need this because enemy vehicles once finish move they start to go around and get on the road blocking it

#

and the stupid AI in convoy cant figure it out how to get out of the way

indigo snow
#

The vehicles never ever need to move anymore?

astral tendon
#

yes

indigo snow
#

Then just and always true, that does dostop on everything in thisList

astral tendon
#

he is just supouse to pop up and shoot the convoy

indigo snow
#

He might need to move into a better shootinf position, for example.

astral tendon
#

no he dont

#

he only gets on the road

indigo snow
#

But yea, always true trigger that does dostop on each element of thislist

astral tendon
#

so how do i set it up?

indigo snow
#

Condition: true, on act: {doStop _x} forEach thisList and set it to "anything present"

astral tendon
#

for some reason the trigger is activating when there is nothing in it

indigo snow
#

Yea thats why its set to true

#

Make it repeating with a slight timeout

astral tendon
#

wait

#

so the trigger is aways on?

indigo snow
#

Sure

#

You can make it repeating and detect a side, too

#

Doesnt really matter

astral tendon
#

cant i just make it soo the unit that hit it frist stop there?

indigo snow
#

Sure

#

Detect that unit

#

Condition : this, and set it to the right side present

astral tendon
#

nice, this is what i want

astral tendon
#

is there a way to remove the vehicle inventory option?

indigo snow
#

Not that i know

runic surge
#

Is there any obvious reason as to why this wouldn't work? If I add the player initialization script to the switch unit function, I see the hints, but the player doesn't change. If I aim at no friendly units, I get an error since nobody is found, so the code is running properly as far as I can tell

_pLocal addAction [
    "<t color='#53BE5F'>Control Unit</t>",
    {
        private _viewPos = screenToWorld [0.5,0.5];
        private _list = nearestObjects [_viewPos, ["Man"], 20];
        private _soldier = _list select 0;
        [(_this select 3),_soldier] call BTH_fnc_SwitchToUnit;
    },
    _pLocal, -1, false, true, "", "true", 1.5
];
params [
    ['_caller',objNull,[objNull]],
    ['_soldier',objNull,[objNull]]
];

if (side _caller != side _soldier) exitWith {hint "You cannot control a unit that isn't on your side or dead!";};

removeAllActions _caller;
removeAllActions _soldier;
addSwitchableUnit _soldier;
sleep 0.1;

selectPlayer _soldier;

I tried using nearestObject and nearEntities as well

simple solstice
#

@astral tendon

#
clearWeaponCargoGlobal _vehicle;
clearMagazineCargoGlobal _vehicle;
clearItemCargoGlobal _vehicle;
little eagle
#

_soldier has to be local to the client.

runic surge
#

is there a way to work around that?

#

I thought you could control any unit that was playable

little eagle
#

Is the soldier editor placed?

runic surge
#

no it is spawned in

little eagle
#

Spawn it in by the client that wants to switch to it.

#

addSwitchableUnit does nothing (in MP)

simple solstice
#

and also to make the UI not dissappear if the action is longer than 10 seconds

#

someone can add a note not to use the time higher than 10 because the action will vanish from the screen (its still executed tho)

#

my guess to the selection issue is to copy the function over and add it, but no idea what to do with the UI disappearing

queen cargo
#

create a copy of it

#

and use that @simple solstice

warm gorge
#

How can I return an array of all configs of headgear. It seems headgear and weaopns are all together in CfgWeapons, and I cant figure out a way to return only headgear.

still forum
#

type or simulation entry inside the config class

rotund cypress
#

@warm gorge configclasses (configFile >> "CfgWeapons") select {getText (_x >> "type") == "typename"}

#

Something along those lines

#

That probably wont work but something similar

#

At phone atm so a bit hard

little eagle
#
"getNumber (_x >> 'scope') >= 1" configClasses (configFile >> "CfgWeapons") apply {configName _x} select {_x call BIS_fnc_itemType select 1 == "Headgear"}
warm gorge
#

Awesome got it working thanks guys

astral tendon
#

@simple solstice This will remove the inventory option when near a vehicle?

indigo snow
#

no

#

you cant do that wuthout mods

late gull
#

can i get some help with that pls:

//Unit init:
null = [this, HC1] execVM "AIOwner.sqf"

//AIOwner.sqf:
waitUntil { !isNil "HC1" };
if (!isServer) exitWith {};
_unit = _this select 0;
_hc= _this select 1;
_grp = group _unit;
_hdIc = owner _hc;
_grp setGroupOwner _hdIc;

//error:
20:47:37 Error in expression <ct 1;
_grp = group _unit;
_hdIc = owner _hc;
_grp setGroupOwner _hdIc;
>
20:47:37   Error position: <_hc;
_grp setGroupOwner _hdIc;
>
20:47:37   Error Undefined variable in expression: _hc
#

or can anyone share a better/updated script to load AI to HC pls

indigo snow
#

that init script might run before HC1 is initialized since it runs in the init box

#

so you waitUntil { !isNil "HC1" }; but you already passed a nil in the passed array

little eagle
#

_hc is undefined ...

late gull
#

ok so, i can just send unit and after waitUntil { !isNil "HC1" }; assign _hc = "HC1" ?

little eagle
#

Or just replace _hc with HC1 ?

late gull
#

i know is undefined, but not the reason untill @indigo snow answer :p

indigo snow
#

if you already know itll always be HC1, yea

#

no reason to pass it

little eagle
#

It is undefined, because it is never defined, not because of the waitUnti loop ...

indigo snow
#

see the second line, commy

late gull
#

so i can just use HC1, will try

#

ok, thanks, seems like working now like this:

waitUntil { !isNil "HC1" };
if (!isServer) exitWith {};
_unit = _this select 0;
_grp = group _unit;
_hdIc = owner HC1;
_grp setGroupOwner _hdIc;

Or not, so there is my next question, how i can know if is really working?
i saw a thing like that -> https://forums.bistudio.com/forums/topic/184485-werthles-headless-module/
but i wont use it, i'm trying to understand how HC works and i prefer do it by myself

indigo snow
#

HC is just any old client, just without a player and a screen

#

units / groups / objects are local to a client which will do calculations for them

#

moving AI from server to HC gives server moer time for calculations by having the HC do those calculations

late gull
#

yes thanks, i do understand that, but how i know if the unit is owned by HC? i'm doing test with this in game console server exec:

_unit = cursorTarget; 
_group = group _unit; 
_owner = groupOwner _group; 
diag_log format["Owner: %1", _owner];

but the id is always 0, and btw, what means this number? the info about HC is too poor and old

indigo snow
#

When called from client, it always returns 0

late gull
#

ohh, dont mind if use server exec? :S

indigo snow
#

server doesnt have a cursortarget...

late gull
#

xD great

#

well my fast solution is giving to the unit some var name, show the owner before change and show after, this will give me a clue if works or not

indigo snow
#

make sure to pubvar the variable

late gull
#

ehm...

waitUntil { !isNil "HC1" };
if (!isServer) exitWith {};
_unit = _this select 0;

_unitOwner = owner _unit;
diag_log format["Unit Owner BEFORE: %1", _unitOwner];

_grp = group _unit;
_hdIc = owner HC1;
_grp setGroupOwner _hdIc;

_unitOwner = owner _unit;
diag_log format["Unit Owner AFTER: %1", _unitOwner];

"Unit Owner BEFORE: 2" "Unit Owner AFTER: 2"
๐Ÿ˜ข ๐Ÿ”ซ

vague hull
#

the command also returns a bool iirc

#

you might wanna check if it actually failed or not

indigo snow
#

youre aware owner is also a server only command btw?

#

_hdIc = owner HC1; is gonna return 0 on clients

vague hull
#

you saw the "!isServer" right?

indigo snow
#

no

#

do check the value of the variable, tho

late gull
#

i'm getting confusse, even more xD

ionic orchid
#

Figured out my looping audio problem from last night

class CfgSounds
{
    sounds[] = {
        test_0132a, test_0132b, test_0132c
    };
    class test_0132a
    {
        name = "test_0132a";
        sound[] = {"test\0132.ogg", 1, 1};
        titles[] = {}; //Plays once
    };
    class test_0132b
    {
        name = "test_0132b";
        sound[] = {"test\0132.ogg", 1, 1};
        titles[] = {1, ""}; //Loops for 1 second
    };
    class test_0132c
    {
        name = "test_0132c";
        sound[] = {"test\0132.ogg", 1, 1};
        titles[] = {5, ""}; //Loops for 5 seconds
    };
};
astral tendon
#

what does unladen weight do? make vehicle lighter if i lower it?

#

that mean i can fly a choper better?

runic surge
#

it is weight of the unladen variety

#

I have also been wondering that

#

never tried messing with it, because I have no idea what it does or how it works

astral tendon
#

if i give a doMove command to a helicopter how he will behave? like what altitude he will fly or he will try to land or hold and still?

runic surge
#

is there a way to make a locally spawned unit global? Or vice versa?

#

I have a script that lets a player recruit units locally but the units that spawn don't work with some features

#

namely a version of the remote control function

astral tendon
#

well, i test it, and he does go for the marker but he does not hover OVER the map marker just near it

#

well, there is also a way to give a doMove like command that also set the helicopter direction?

runic surge
#

@tough abyss that doesn't help me
Aside from the part where you used createUnit

astral tendon
#

i dont tink its gonna do what i want

runic surge
#

I'm stupid enough to not realize I have used createVehicle this entire time

#

created creepy statue people

#

that would probably be why the returned string for them is a model name

little eagle
#

haha

runic surge
#

yeah that was totally the problem this entire time

#

I suppose going out of my way to completely rewrite a bunch of functions to try and fix this issue wasn't entirely a waste of time though

#

thanks for the help anyway, though

#

Well on the bright side my mission currently allows the player to walk up to a box, gather any desired amount of money, buy a unit, take control of that unit, shoot their original body in the head, and fail the mission while still being able to walk around

little eagle
#

๐Ÿ‘

astral tendon
#

is there a way to make AI not react when see a enemy and keep following the freaking doMove i give?

little eagle
#

?

astral tendon
#

none of that works

#

its change how they move but they still feaking out when they see a enemy and go everywere

little eagle
#

Don't think you can change that then.

astral tendon
#

well, i "fixed" that by puting a AI Civilian to drive the helicopter

#

and now the enemy ignores him and the bluefor gunner

hallow mortar
#

you can use disableAI to prevent NPCs targeting things (which will make them ignore them)

#

i.e. this disableAI "AUTOTARGET"

runic surge
#

this disableAI "AUTOCOMBAT"

#

autocombat controls if the unit will automatically switch to combat mode when attacked or alerted to an enemy presence

astral tendon
#

autocombat was disable already

#

i selected on the AI things

hallow mortar
#

Do you mean you set it to "Careless" in the attributes? Because that's a Behaviour, not outright disabling a section of its AI, and there is a difference.

astral tendon
#

none of they work

#

AI still reacting

hallow mortar
#

put this in the AI unit's init: this disableAI "TARGET"; this disableAI "AUTOTARGET"; this disableAI "AUTOCOMBAT"

#

(I forget if you can disable multiple AI sections in one command)

runic surge
#

I think you can just put all

#

but that wouldn't be very helpful

hallow mortar
#

yeah, he still wants the AI to be able to move

#

I'm just not sure if you can do this disableAI "MOVE","TARGET" or something like that, it'd be easier

runic surge
#

you could also try setting the pilot of the heli to captive

#

{this disableAI _x} forEach ["MOVE","TARGET","AUTOTARGET"];

#

that might work

hallow mortar
#

interesting, I'll try that next time I'm disabling bits

astral tendon
#

do i need to put those in commands? mark on "disable AI sethings" wont work?

hallow mortar
#

Put exactly that code - the first bit I gave you, not the stuff I was discussing with Rylan - into the unit's init field. I don't know what else you're doing (it sounds like you're using an editor mod I don't know) - this is a safe, vanilla, way of doing it.

astral tendon
#

wait

#

you mean this is not a vanila optiom?

hallow mortar
#

I work without mods to avoid dependencies. I've never seen that set of checkboxes before in my life.

astral tendon
#

so it is possible that this thing is broken all along

hallow mortar
#

It looks like that's just a GUI for calling disableAI, but I don't really trust it. Just put the code in the init and see what it does.

astral tendon
#

the thing is, i created 100 AI units using those checkbox

hallow mortar
#

That probably isn't going to cause any problems

runic surge
#

@astral tendon create a gamelogic and put {{this disableAI _x} forEach ["Thing","Otherthing"];} forEach synchronisedUnits this and you can sync any units you want to have those features disabled to that logic

#

that syntax might not actually work

#

one sec, let me fix

#

actually idk maybe it will

hallow mortar
#

^replace Thing and Otherthing with the AI features you'd like to disable, such as AUTOCOMBAT

runic surge
#

using the synchronisedUnits command with gamelogics makes things much easier for adding code to many units in the editor

#

actually it is synchronizedObjects

manic sigil
#

I'm trying to wrap my head around locality, I'm working on a basic bootcamp map for my friends (full of memes and action, of course). While I've got the function to use advanced hints for loading up weapons, and the occasional signpost, I'm trying to get it to function for an area trigger.

The problem I'm having is who to execute it on - I want it to only operate on the player passing through the trigger area:

0 = [] spawn {

[["infantryMovement", "Basicspeed"]] remoteexeccall ["BIS_fnc_advHint", THISTHINGHERE];
};

#

I've tried the obvious (Player, object, player in thislist, etc), but it's throwing errors :/

#

Just running it by number (0, 2) works fine, as expected.

little eagle
#

It helps if you read or post the error.

astral tendon
#

if (isPlayer player1) then {
player1 moveOut car3;
};

#

what is wrong with this?

#

[] spawn {sleep 5};
if (!isPlayer player1) then {
player1 moveInGunner car1;
};

#

this one works

#

nevermind, fixed it

#

if (isPlayer player1) then {
moveOut player1;
};

runic surge
#
waitUntil {position(_ammoBox select 2) < 1};
#

shouldn't this work?

#

It tells me "Generic error in expression"

#

which is obviously very helpful information

#

I have tried with the parentheses in several configurations as well, same error

#

it also says generic error in expression on the sleep command

#

which should work fine

jade abyss
#
(position _ammoBox) select 2 < 1```
or:
```sqf
(getPosATL _ammoBox select 2) < 1```
runic surge
#

I have tried the first version already

#

testing the second

#

still generic error

jade abyss
#

First one should also work. In your Script, you selected (_ammoBox select 2), wich means: select 2 from _ammobox

#

Then the Prob is somewhere else

runic surge
#

seems to be an issue with scheduled scripting or something

jade abyss
#

doubt there is an issue

#

Just not spawned

runic surge
#

sleep command causes an error if that isn't commented

jade abyss
#

Of course

runic surge
#

that comes after the waitUntil

jade abyss
#

check where the # is (-showScriptErrors msg), then check there

runic surge
#

on the sleep command it is #sleep 0.4; and the waitUntil it is waitUntil {(getPosATL _ammoBox select 2) #< 1};

jade abyss
#

Then it's probably not spawned

runic surge
#

I have never had this issue using call before though

#

unless I just haven't used sleep or wait commands in those functions

jade abyss
#

You do know, that there is difference between sheduled and unsheduled "scripts"?

runic surge
#

I do

#

Kind of

runic surge
#

right

#

I'm an idiot

jade abyss
#

Yep

runic surge
#

It's always the simple shit that gets me

jade abyss
#

Yep

runic surge
#

I guess I'm just a simple person

jade abyss
#

Yep

runic surge
#

maybe I should just stick with terrain making

jade abyss
#

Yep

runic surge
#

You seem very agreeable

jade abyss
#

Yep

#

I mean, if you say you are a "simple person", i tend to agree, since you know yourself better.

runic surge
#

Simple people tend to lack self-awareness

runic surge
runic surge
#

sides resistance, independent, and guer don't work for green team in my scripts

#

seems to return civilian for some reason

#

if I hint the player side in game it returns GUER

#

the fuck man

#

if the format strings would just return the same name as the actual side name this shit wouldn't be a problem

#

setting the default side makes it work, but I feel like this solution is less than ideal

#

the default side in param I mean

astral tendon
#

SomaliansGroup doMove (getMarkerPos "raidmk1");

#

SomaliansGroup is a group

#

doMove works for groups?

#

or there is a equivalent?

queen cargo
#

Think move was for groups

astral tendon
#

move also make they brake fromations?

astral tendon
#

thislist move (getMarkerPos "raidmk1");

#

this trigger is supouse to make evreyone from the trigger area to the marker possition "raidmk1"

#

what i did wrong?

robust hollow
#
Syntax:
    group move position 
Parameters:
    group: Object or Group 
    position: Array - format Position (for Position3D --> PositionATL needs to be used.)

thislist is an array, not a group or object.

old glade
#

Hello, I'm having a massive problem with a module and a dedicated server -.-

#

I have a module that is synced to player units

#

On mission start it runs an event handler on each of the units

#

the problem is for some reason it isn't getting the synced units

#

The mod/module works fine in locally hosted multiplayer

#

I have abolsutely no idea what could be causing this

indigo snow
#

Are the players ingame when the mission starts?

old glade
#

no

#

so it's a jip issue then

#

So the way I have it setup is I have a module down in the editor yeah?

#

the module is set to globablly execute

#

it runs on clients as well

#

It doesn't detect the synced units on the clients either

#

for some reason

old glade
#

and figured it out

#

it's what I feared, now I need to do a complete rewrite >.>

runic surge
#

Is there a good way to put a configfile directory into an array? Or a string?

#
configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam"

Like this one, for example

indigo snow
#

it returns a CONFIG type value

#

you can handle it like any others

#
_myCfgs = [];
_someConfigYouFoundInAnAlley = configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam";
_myCfgs pushBack _someConfigYouFoundInAnAlley;
runic surge
#

I am trying to do it without assigning them with variable names

indigo snow
#

its just any old value

#

push them in there directly

#

_myArray pushBack configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam";

runic surge
#

Does pushback add it to the back of the array?

#

or the front

indigo snow
#

the back of an array is the last value

runic surge
#
WEST_Inf_List = [
    ["B_soldier_UAV_06_medical_F", 75],
    ["B_soldier_UAV_06_F", 75],
    ["B_soldier_UAV_F", 75],
    ["B_helicrew_F", 50],
    ["B_Helipilot_F", 50],
    ["B_Fighter_Pilot_F", 50],
    ["B_Pilot_F", 50],
    ["B_crew_F", 50],
    ["B_engineer_F", 100],
    ["B_Soldier_TL_F", 150],
...
];

I am trying to do something similar to this

#

but with groups

still forum
#

does pushBACK add it to the front or the back..
Dude?... What? ๐Ÿ˜„

indigo snow
#

yea i wasnt sure how to answer that one directly. anyway. Rylan where do you need the config value to be in your new array?

runic surge
#

The way I see it it either pushes the other values back or adds it to the back

indigo snow
#

like a new pairs one? or something else

runic surge
#

It needs to have the basic structure of group type, number

indigo snow
#

_array pushBack [configvalue, number]

still forum
#

So you have configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam" and only want "BUS_InfTeam" as a string?

runic surge
#

I need the whole thing in order to use the function to spawn the group I think

#

If I could just put the group classname there that would be very easy, maybe that could work, but spawning it later on would become an issue

still forum
#

you mean you need

_cfg = configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam";

You need what's inside _cfg in an array?

runic surge
#

yes

indigo snow
#

are you typing out this array by hand?

#

the issue might more be readability

still forum
#

if you just need _cfg in an array. Just add _cfg to an array.

#

Like @indigo snow posted above

runic surge
#

I am building a list of basic groups, but I want it in such a way that groups could be added or removed from the array

#

I will do t hat

still forum
#

Dynamically removed? Removing a group by name?

runic surge
#

No, just an init script where someone could change the groups for their own variant of the mission, or for easier editing later on

#
WEST_Grp_List = [];

WEST_Grp_List pushBack [configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfTeam", 600];

I have doubts that this would work

distant egret
#

If its hand written why not make the array by hand?

#

Why use pushBack?

runic surge
#

What I don't know about is just pasting the entire config file path into the array

#

pushBack is probably unnecessary

#

I don't know what type of value would be passed through params either

#

would it be param [0,configFile,[configFile]];

indigo snow
#

configNull would be a better choice for default var

#

And yea if youre typing by hand you dont need pushback at all

runic surge
#

ok thanks

distant egret
#

Lol

runic surge
#

heh, yeah

#

forgot about that

indigo snow
#

Should spawn the idap drone over your head, dropping a cooked grenade

distant egret
#

Lol

runic surge
#

perhaps I should

#

well shit

still forum
#

๐Ÿ˜„

runic surge
#

I will probably just have parameters for the faction name and have the actual group names be in the array

#

WEST_Faction = BLU_F;

still forum
#

only a missing ]. Just add it ?
What's the problem currently?

runic surge
#

it isn't exactly clear on where it is missing

#

it says in the actual config.bin

#

so I don't know if that format would work

still forum
#

can you pastebin what you have right now?

indigo snow
#

Rylan that config.bin is just your config value represented as text

#

The error is in the array you made.

runic surge
#

that is what it looks like

#

don't think the format command likes it very much

still forum
#

correct.

#

passing a config entry by string it will not work

#

It can work if you do some string operations on it

runic surge
#

which is why having the faction name and group name passed as individual variables to be reinserted into the config path in the group spawning function seems like an easy solution

still forum
#

What is _p_Grp_List ?

runic surge
#

the array for the players side

still forum
#

you could just put a WEST_Grp_List select %1 select 0 inside the format. where %1 is _forEachIndex.

runic surge
#

blufor would be WEST_Grp_List

still forum
#

If you know which side was choosen. You can just put the global variable name into the format

runic surge
#

_p_Grp_List is run in the player init to detect the player's side and add the right units and groups to that players menu

#

so it gets the correct global variable for his side

still forum
#

make a variable which contains the name of the global variable as a string

runic surge
#

private _p_Grp_List = [WEST_Grp_List, EAST_Grp_List, GUER_Grp_List] select ([west, east, resistance] find _pSide);

still forum
#

Yeah

#

Do another
private _p_Grp_List_Name = ["WEST_Grp_List", "EAST_Grp_List", "GUER_Grp_List"] select ([west, east, resistance] find _pSide);

#

Then replace

 private _grpCode = format ["[%1,%2,%3] call BTH_fnc_RecruitGroup", _grpType, _grpCost, str _pSide];

by

 private _grpCode = format ["[%1 select %2 select 0,%3,%4] call BTH_fnc_RecruitGroup", _p_Grp_List_Name, _forEachIndex, _grpCost, str _pSide];
runic surge
#

I don't understand but I'll see what happens lol

#

Doesn't appear to do anything

still forum
#

you can try to diag_log the string to check if it's correct

distant egret
#

Diag_log the shit out of it xD

runic surge
#

I would rather just do the thing with the faction names

#

maybe I will do that tomorrow

#

for now I will just get it working and go to sleep

#

that didn't do anything either

#

going to figure that shit out tomorrow

distant egret
#

Good night @runic surge

runic surge
#

good night gentlemen

distant egret
#

It's midday here.

runic surge
#

it's 3:33AM here

distant egret
#

Lol. That's the problem with coding xD.

little eagle
#

Does pushback add it to the back of the array?
The way I see it it either pushes the other values back or adds it to the back
That's genius. I like the way you think.

warm gorge
#

Does anyone know if initServer.sqf actually has any arguments? I see some people use if (!(_this select 0)) exitWith {}; but can't actually find any information that says this actually returns anything

simple solstice
indigo snow
#

Initserver doesnt, others do

little eagle
#
diag_log [_this];

and test it yourself?

warm gorge
#

Good point

sand pivot
#

i'm trying to develop a start script that prevents player movement, shooting, etc. until the server stabilizes and admin unlocks. does anyone have a good way of doing this? i've looked at using ACE_captives_fnc_setSurrendered and disableUserInput but surrender prevents loadouts from loading and disabling the input has it's own issues if players are actively pusing buttons.

still forum
#

player enableSimulation false ?

sand pivot
#

ooOOoo, i'll give that a shot

distant egret
#

Or have respect between players xD.

sand pivot
#

believe me, if i could i would, my other players are children (figuratively, not literally)

#

i think this will work @still forum . thank you!

#

and it allows me to zues still! game on!

#

well when i say game on that is...

tender fossil
#

Noob question: does the new Dynamic Simulation support offloading units to HC?

tough abyss
#

Those are 2 completely things

still forum
#

different* I only noticed that when I read that message for the third time ๐Ÿ˜„

worldly urchin
#

I keep on getting this error message when trying to create a marker using BIS' createMarkerLocal function.

 0:51:26 "::New Arma:: AI Spawn Point: [7285.12,8017.34]"
 0:51:26 Bad conversion: array
 0:51:26 Error in expression <awn Point: %1",_arrayValue];

_marker = createMarkerLocal["UberPickupLocation", >
 0:51:26   Error position: <createMarkerLocal["UberPickupLocation", >
 0:51:26   Error 0 elements provided, 3 expected
 0:51:26 File core\custom\civ\fn_getTaxiMission.sqf [life_fnc_getTaxiMission], line 81

What is behind the 0 elements provided, 3 expected error, and does anyone have a solution to it?

Full Script:

private ["_array","_arrayValue","_ai","_nearestRoad","_masterArray", "_markerPos", "_target","_marker"];
_array = LIFE_SETTINGS(getArray,"taxiArray");
_arrayValue =_array call BIS_fnc_selectRandom;                      //fetches the array and selects random map location
diag_log format ["::New Arma:: AI Spawn Point: %1",_arrayValue];
_marker = createMarkerLocal["UberPickupLocation", _arrayValue];
    "UberPickupLocation" setMarkerColorLocal "ColorBlack";

taxiArray:taxiArray[] = {"[7285.12,8017.34]","[7033.36,7121.48]","[8244.99,3141.4]","[9659.66,3341.04]","[5909.76,3603.36]","[5353.25,2734.99]","[3116.74,6286.78]","[5545.37,6998.3]","[8265.21,10043.7],[5557.69,11193.7]"};

astral tendon
#

is there a way to force AI to run to a map marker possition intead of doing shot stops?

#

i already turn of their stamina limit

indigo snow
#

@worldly urchin diag_log _arrayValue?

distant egret
#

@indigo snow he did.

#

Check log file first line

little eagle
#

taxiArray[] is wrong.

#

Arrays use curly brackets in config, not [ ]

#

And the quote marks don't belong there either.

still forum
#

@worldly urchin Show us the code between the diag_log and createMarkerLocal

tender fossil
#

I'll rephrase my last question: does Dynamic Simulation work with remote units?

#

Or does the server need to control the units utilizing DS?

little eagle
#

Last I heard it didn't work at all, so...

warm gorge
#

Any ideas why setWaves might not work? I've got Manual Override enabled in the mission, but the command just isn't working for me. All the other weather commands are though

little eagle
#

What is behind the 0 elements provided, 3 expected error
The command expects an array, but you supplied something undefined, an empty array or not an array, like e.g. a string.
and does anyone have a solution to it?
Giving the command an array with 3 elements.

#

setWaves has local effects (doesn't synch) and forceWeatherChange and simulWeatherSync have no effect on it.

warm gorge
#

Ohh damnit really? So I need to execute it on all players then I assume

little eagle
#

Yes, it's different from setRain.

warm gorge
#

Alright cheers

indigo snow
#

@JasperRab i suspect the array still has "" surrounding it, those wouldnt get logged that way

little eagle
warm gorge
#

Interesting finds. Its a shame weather has been an issue in arma for so long but is still yet to be resolved

astral tendon
#

is there i way by scipt turn off ammo count?

little eagle
#

kinda

#
this addEventHandler ["fired", {
    params ["_vehicle"];

    if (local _vehicle) then {
        _vehicle setVehicleAmmo 1;
    };
}];
subtle ore
#

Ammo count control is what i think they are talking about

#

showHud also can disable different individual elements

austere granite
#

Not the ammo count ctrl

#

I can't remember the display but

#

(_display displayCtrl 52003) ctrlShow false;

little eagle
#

It's a different controlsgroup for every weapon and vehicle potentially sadly.

austere granite
#

actually thats wrong, sorry

#

private _ammoCount = (ctrlText (_display displayCtrl 184));

#

but yea it has a habit of changing

subtle ore
#

๐Ÿค”

little eagle
#

Change weapon, or change vehicle -> new controls group is used.

austere granite
#

So unless you know you can rely on the RscUnit info (which basically means no mods and manually checking the configs for each one of them) then no can do really

#

I was doing some stuff with it a while ago that worked quite well between weapons, vehicles and so on though. Haven't checked in the last year or so, but it was okay

little eagle
#

Some of the RscUnit things don't put their display in ui namespace and you can't use findDisplay with displays (only dialogs).

austere granite
little eagle
#

I like it.

austere granite
#

never ended up using it

astral tendon
#

nop, ammo counter still working

subtle ore
#

Still not working or dissapearing?

austere granite
#

But yeah in general RscUnitInfo is a little bitch, because it has a habit of changing a lot with mods, so compatability can be annoying

little eagle
#

Could just ignore RscUnitInfo and make this ui it's own thing.

astral tendon
#

STILL working, i want to remove it

little eagle
#

You can't. Didn't you read what we wrote?

austere granite
#

Doesn't ACE do it? Or is that broken for some things then?

little eagle
#

Disables it completely with optional setting and all that stuff.

#

But idk if it breaks with some mods.

subtle ore
#

ACE does it yes, they have a ui module for all that stuff. Not sure where functionality lies though

#

What is the best practice for displays anyways? Manual config or gui editor export?

austere granite
#

depends on how advanced you need

little eagle
austere granite
subtle ore
#

@austere granite Base level information display

austere granite
#

if you dont plan on resizing things, adding/removing controls, GUI editor works fine

#

There's also some non-arma tool to make them i believe, not sure about the name

little eagle
#

I use paper personally.

austere granite
#

I'd still recommend doing it yourself, just because it's cleaner

subtle ore
#

Yeah i will just do it myself. If i find that it doesn't work out so well initially i will go 3rd party

austere granite
#

just start with something like ```cpp
#define pixelScale 0.5
#define GRID_W (pixelW * pixelGrid * pixelScale)
#define GRID_H (pixelH * pixelGrid * pixelScale)
#define CENTER_X ((getResolution select 2) * 0.5 * pixelW)
#define CENTER_Y ((getResolution select 3) * 0.5 * pixelH)

#define __GUI_GRIDX(var1) ((GRID_W * 4) * var1)
#define __GUI_GRIDY(var1) ((GRID_H * 4) * var1)

#

so you have a grid to work off

little eagle
#

Yes, setting up and choosing a good grid is step 1.

austere granite
#

Another good thing to keep in mind is using controlGroups

little eagle
#

So much.. fun with ui.

subtle ore
#

Gotcha. That makes sense, thank you both. This gives me some ideas on where to start

austere granite
#

... i started liking UIs

#

because in arma it basically means trying to come up with ways to do something that should be completely normal

#

it's like swimming upstream

subtle ore
#

Hey, that's the fun part right?

austere granite
#

A3 at least added a lot of very useful UI commands though

#

things like controlsGroupCtrl and the likes removed most of the need for crazy MACROs in configs and allow you doing things dynamically

#

For some reason I'm having an issue with CtrlDelete currently though, still gotta figure out waddap, but it crashes my game ๐Ÿ˜„

austere granite
#

Does anyone see what is wrong with this. I can't think and for some reason rather than returning the function with that name.... is calls the code (Even though there is no call anywhere in here....)

#

params [["_code", {}, [{}, ""]]];
if (_code isEqualType {}) exitWith { _code };
if !(_code isEqualType "") exitWith { { false } };

if (_code isEqualType "") then {
    diag_log str ["[#MB] Parsing: ", _code];
};

private _function = uiNamespace getVariable _code;
if (!(isNil _function) && { _function isEqualType {} }) exitWith {
    _function
};

_code = compile _code;
_code;
#

mehhhhhhhhhhh nvm

#

see it

#

isNil "_function" ๐Ÿ˜„

still forum
#

squint

#

isNil _function executes the function in unscheduled

austere granite
#

yes ๐Ÿ˜„

still forum
#

I'd recommend giving getVariable a default value

austere granite
#

some missing quotation

astral tendon
#

so, i put the vehicle to combat mode, why the hell he keeps going to the freakng road?

nimble hill
#

Is there any way to convert from string to group(eg from "B A4") or is it impossible without assigning said group to a global variable first and using that instead?

little eagle
nimble hill
#

Thank you, i will still have to make a seperate function, but it will make it easier anyway

golden storm
#

Hi there guys, so i have a small question, i want to know if my syntax is ok, what i want is a certain trigger to activate when 1 of 3 persons is in it so that it activates another task, this is the code i used for it to detect if they are inside the trigger:

narco1 in thisList || narco2 in thisList || narco3 in thisList;

still forum
#

looks okey

golden storm
#

Hmm for some reason the trigger wont be called and the other task wont appear

distant egret
#

@golden storm is your Activation (Trigger) setup?

golden storm
#

I solved it, i had it syncd to the mission itself,

distant egret
#

mission?

copper raven
#

just pop a hint everytime when u use a trigger, then sync etc

golden storm
#

But i do have another issue i want some markers to show up when said trigger activates, i used this:

Condition: triggerActivated trg_alfa;
On Act.: "marker_1a" setMarkerAlpha 1; "marker_1b" setMarkerAlpha 1;"marker_2a" setMarkerAlpha 1;"marker_2b" setMarkerAlpha 1;

#

or does it have to be on a scale of 0 - 100? as in percent?

still forum
golden storm
#

Yeah i read it so supposedly it should be working but it is not :/

still forum
#

does the code in onAct ever execute?

#

your condition is another trigger being activated? Why don't you just put the code into that other trigger?

astral tendon
#

{isNull gunner _x}

#

how i can change it to pasanger seat?

#

i could not find it in wiki

still forum
#

there might be multiple passenger seats

astral tendon
#

because there is no "Cargo"

#

maybe !if emptyPositions "cargo" ?

austere granite
#

emptyPositions "cargo" is what/

#

what does that command return

#

a number

#

so you can just "If <number>"

queen cargo
#

when does an object get "isNull"?
wondering right now if it is possible at all

austere granite
#

An existing object?

#

never

queen cargo
#

that is the question

#

iirc there was some case

austere granite
#

For your interpreter thingie right?

queen cargo
#

never would ask such weird questions in any other case ๐Ÿ˜›

austere granite
#

yea figured, just wondering

queen cargo
#

just remembered that i need to check for objNull

austere granite
#

I don't think i've ever run into that sorta scenario

#

yea obviously objNull

#

if you do testvar = <someobject>

#

then deleteVehicle testvar

queen cargo
#

problem with that is: if it is possible that an object turns null, i need to know when and adjust for that case

austere granite
#

testvar will be objNull

queen cargo
#

y

austere granite
#

but then the object doesnt exist anymore

queen cargo
#

that would be one case ....

austere granite
#

so 'an existing object?'

queen cargo
#

deleteVehicle would do objNull

#

now next step is to figure out how to map this in my tool ๐Ÿ™ˆ

#

and ... add the checks to all commands already handling objects

#

probably going to be a simple "isNull" variable

astral tendon
#

any other idea?

#

i just wanna a trigger to ativate when some one get into the passager seat

queen cargo
#

moveInto or something simmilar was the command to move ppl

#

moveIn

austere granite
#

So what is the thing you're doing and why not intercept?

queen cargo
#

not in this channel @Adanteh#0761

#

@austere granite gah ... discord broken again

astral tendon
#

so, for the trigger there is a way to ativate it if there is something in the passanger seat?