#arma3_scripting

1 messages ยท Page 503 of 1

peak plover
#

You still need to save the path, right?

#

Just pass the _projectile and str _projectile as arguments to the pfh

vapid drift
#

Yeah... I think I'm too tired for this to click right now

#

but I saved that bit of code you posted

#

Thanks man, I appreciate it

drowsy axle
#

I'm looking to integrate support modules into Warlords @peak plover

peak plover
#

aah

drowsy axle
#

Could someone have a read over ^

cold pebble
#

Whereโ€™s private keyword at ๐Ÿ˜ฆ

drowsy axle
#

It should show up in the mission on the right hand side nor on the 0-8 action.

#

But it doesn't...

drowsy axle
slow elbow
#

Just had a look at the copyToClipboard command because i didn't know it existed until capwell mentioned it in the other channel. It turns out that you can only copy a maximum on 8192 characters to the clipboard. If this is correct, then perhaps somene could add a note to the wiki. i tried to do that before, but apparently i don't have permission.

#

just an FYI.

astral dawn
#

@slow elbow the format function has this limit. Are you sure that what you see is the copyToClipboard limit instead of format limit?

lament grotto
#

Does anyone want to proof read my description.ext, Its throwing up a Config: some input after EndOfFile. error. Ive searched online apparently its a syntax error but I cant see it

#

This si for the config to make custom assests in warlords

still forum
#

@lament grotto PM me the file

winter rose
#

@lament grotto it's usually due to an additional }

lament grotto
#

Yeah, I just cant find the damned thing

lament grotto
#

ah

#

that explains why

#

ty

queen cargo
#

that is stuff, that SQF-VM also should be able to find with ease ๐Ÿค”

#

or ... not Oo

#

though ... fixed now

cold pebble
#

@drowsy axle sorry for delay, how doesnโ€™t it work exactly? Do the system chats show what you expect

still forum
#
//Define Player
private _player = player;

why are you doing that @drowsy axle? why not just use player directly?
https://github.com/AxeriusNetwork/EC-Public/commit/5f5dbe09a51f1db8d4249b51601336ff7a64b214#diff-c6c75f026853246dd26b0b662d28c337R6 there. _requester is undefined.

https://github.com/AxeriusNetwork/EC-Public/blob/master/EpsilonWarlords.Altis/CORE/fn_supportBuy.sqf#L1
_this # 2 is the ID of the action. You put that into _caller variable and expect the number to be a object. That won't work.

Can you explain what exactly doesn't work of all that code?
Did you try putting systemChat's directly infront and after the line that you find not working?

drowsy axle
still forum
#

yeah you said the systemChat's are printed. But that the first 10 lines of the function seem to work properly, doesn't tell you whether the rest of the 216 lines are working properly

drowsy axle
#

These work: sqf private _text = format["Transport Created!"]; [_text,3,5,[1,0.8,1,1],true] call BIS_fnc_WLSmoothText; and you are right.

copper raven
#

why format there?

still forum
#

private _text = format["Transport Created!"]; that format is useless. you are not formatting anything there

drowsy axle
#

I know....

#

geez guys

#

come on

still forum
drowsy axle
#

Copied and Pasted... sqf private _text = format["Removed: %1 CP",_cost]; [_text,3,5,[1,0.8,1,1],true] call BIS_fnc_WLSmoothText;

#

Also, if I needed to use a format. I could just edit the string and add var

still forum
drowsy axle
#

Okay.

still forum
#

So what exactly doesn't seem to work in that code?

drowsy axle
#

Well. Everything up to the SmoothText... There are no "more" errors being displayed, however the support modules on the right or whatever the code is doesn't work, or show an effect.

still forum
#

have you tried adding systemChat's like.. before line 44 and after line 44. And after line 47. And before 59 ?

drowsy axle
#

Doing that.

#

Testing

#

Nothing works @still forum I had a brain fart..

#

I even have a onPlayerRespawn.sqf to handle it

#

(the player respawns at start, MP mission) Doesn't work in SP either.

silk ravine
#

Hi

#

is it normal that I am unable to forward params AND a switch selector when calling execVM?

#

like this: [500,initCenter] "init" execVM "customization\popups.sqf";

high marsh
#

Post your code

#

Syntax is
array execVM string or code

#

Don't know why you have "init" there

silk ravine
#

I have a Switch Do inside that popups.sqf

#

which is called init, setup and reset

high marsh
#

Okay, post your code.

#

all passed params need to be inside the array

short trout
#

hmm

silk ravine
#

ok, in that case I have to look for how switches are evaluated

short trout
#

_execution = _this; but params [["_dist",50,[1]],["_center",player,[objNull]]];
so
_execution = [500,initCenter]

silk ravine
#

because a simple "<casename>" usually worked :/

high marsh
#

_execution = _this
_this is the array of params not a string

#

Your third parameter "init" isn't getting passed for obvious reasons

silk ravine
#

I am not that great at scripting so its not that obvious to me :/

short trout
#

Use something like:

[ "init" , 500, initCenter] execVM "customization\popups.sqf";

and inside popus.sqf

params ["_execution ", ["_dist",50,[1]],["_center",player,[objNull]]];

and do not define execution below

or, in BI modular style:

["init", [ 500, initCenter]] execVM "..."

and in popups:

params ["_execution", "_data"];

switch (_execution) do {
   case "init": {
        _data params ["_radius", "_pos"];
       ...
   };
   case "not_init": {
      _data params ["_not_radios", "_not_pos"]; // parameters in that case has different meaning than in "init" case
  };
};
high marsh
#

You see how 500 and initCenter are passed to execVM? Those are where your passed values go

#

Dusin has the idea

silk ravine
#

ahhhhhhhh

#

click

#

thanks so much guys, so obvious now omg

high marsh
#

lol

silk ravine
#

wait wat

#

he altered it and now I am lost again

#

wot you doin to me ๐Ÿ˜ข

#

I am gonna use the first one which I do understand x,D

#

ok I think the second one now clicks as well

short trout
#

If you want function to use different parameters depending on mode -- you need to use 2nd example. But if params will always be the same (or may not pass) - you can stick to first one

silk ravine
#

but I will test the first one before, just to make sure o,O

#

Not sure but I may be spared of the 2nd example because the data params pos and radius are evaluated before the switch do

short trout
#

that means u need it every time functions is called. So use the first variant

ornate sky
#

Any idea how the drone in Mission 6 Apex is scripted to move? What I'm trying to do is make a Drone and make players only use the gunner view. I can do that with lockDriver and enableUAVWaypoints, but the players can still modify and delete the drone waypoints from the Terminal view by right clicking the blue arrows...

#

how did they do it in apex campaign?

#

Can I make the drone move in a loiter circle with something other than Waypoints

high marsh
#

you can use cameraView to detect gunner view, and switchCamera to force it

#

If you really want to prevent removing the waypoints, close the dialogue as soon as it opens.

#

You can always unpack the apex campaign mission files

ornate sky
#

But you can use the Terminal in Apex mission 6 normally, and no waypoints show up

#

hmm, but the scripts are usually buried in that strange file format

high marsh
#

Unpack it and look for yourself.

#

Strange file format? It's going to be all SQF

#

I'm almost positive they took off the data lock for apex, meaning no more EBOs .

ornate sky
#

let me have a look

#

oh yea, the strange format I mentioned is FSM

high marsh
#

Lol, FSM is state machine for AI

#

You can open it up with BI tools and have a look for yourself

#

You can use the same FSM in your own mission

ornate sky
#

alright, I wasn't really sure what that is or how to use it

#

I'm comfortable enough with sqf but I haven't touched fsm

#

this is strictly AI related right?

high marsh
#

Yeah. I would just take a look at it before using it though.

#

I don't think it's strictly AI related, but I know it's mainly used in conjunction with AI behavior

#

VCOM AI for example is FSM based

ornate sky
#

alright, thanks man

rigid plover
#

Is there a limit to the amount of memory arma 3 uses now? I know it was effectively 4GB before the 64 bit update

high marsh
#

Don't think so. Only use maxMem launch param for limiting memory

#

Otherwise, engine uses as much as possible

silk ravine
#

Thanks again for your help guys, worked great

high marsh
#

:+1:

carmine abyss
#

If I wanted to get an array of all Anti-Air on the map, would I use "map listObjects type" ?

carmine abyss
#

Anyone have a way of converting an array of class names into an array of Display names?

meager granite
#

_classes apply {getText(configFile >> "CfgVehicles" >> _x >> "displayName")}

still forum
carmine abyss
#

Awesome ty

red meadow
#

any scripters on right now i can DM need help with a issue

winter rose
#

You can ask here? What is your issue @red meadow

red meadow
#

so im trying to put a image ingame to pop up on screen using cutrsc and as far as i know im doing every thing right but i get resource title intro not found

proven crystal
#

so i guess if i have the option, i shoulduse a trigger instead of an areamarker with some waituntil loop going on? whats the difference there? i thought triggers work pretty much the same way? waiting until a condition is true...

#

how does is work differently?

red meadow
#

thats why i was asking to DM so i can show the script im using and someone smarter than me can tell me what im doing wrong here

cold pebble
#

But if you put it here, all of the smart people can see and help ๐Ÿ˜ƒ

red meadow
#

class RscPicture
{
access=0;
type=0;
idc=-1;
style=48;
colorBackground[]={0,0,0,0};
colorText[]={1,1,1,1};
font="TahomaB";
sizeEx=0;
lineSpacing=0;
text="";
shadow = 0;
};

class intro
{
idd=-1;
movingEnable=1;
duration=6;
fadein=2;
fadeout=0;
name="intro";
Controls[]={"logo"};
class logo: RscPicture
{
idc = 9999;
text="img\intro.paa";
style = 0x30 + 0x800;
x = safezoneX;
y = safezoneY;
w = safezoneW;
h = safezoneH;
colorBackground[]={1,1,1,1};
colorText[]={1,1,1,1};
};
};

#

my description.ext ^

#

2 cutRsc ["intro", "PLAIN"];

#

what im using to exect^

still forum
#

Uhm...

#

And you are wondering that it doesn't work?

#

You created a resource by the name GoA_Logo and then tried to display the resourced that's called intro

red meadow
#

oh sorry i was messing with it that was originally intro

#

still didnt work

still forum
#

Display a resource defined in RscTitles
"Display a resource defined in RscTitles"

#
class RscTitles {
class GoA_Logo {...};
};

red meadow
#

insert i feel stupid now here

#

still getting that error cant find resource intro

still forum
#

cant find resource intro

#

Is it intro now, or GoA_Logo?

red meadow
#

its intro

still forum
#

What does missionConfigFile >> "RscTitles" >> "intro" return in debug console?

tough abyss
#

@tough abyss this code places a destroyer on Stratis to the NW edge of the island mid mission and corrects the 45 degree angle aiming into the sky and other issues. I don't think the end result was much different to just placing it in the editor.

ourDestroyer = createVehicle [โ€œLand_Destroyer_01_base_Fโ€,[2500,7000,30],[],0,โ€œNoneโ€];
ourDestroyer setVectorUp [0,0,1];
ourDestroyer setVectorDir [-1,-1,0];
[ourDestroyer] call bis_fnc_Destroyer01PosUpdate;
#

I totally know what I am doing, that didn't take 10 attempts at all. ๐Ÿ˜ค

high marsh
#

@still forum Correct. Thanks for correcting me.

drowsy axle
#

@broken thistle did you message people in here for help?

broken thistle
#

Yes I did with no reply and no help from anyone.

#

@drowsy axle

still forum
#

No one answered because you solved your problem by yourself before anyone could read your message.

#

Plus you posted that message on 3AM european time, and most people here are european, there are not that many people active in the middle of the night.
And it took you just 4 minutes to get your problem solved by yourself.

Chance that someone replies to a message in the middle of the night within 4 minutes == slim
People started coming online and helping at 8AM that day. But your problem was already solved by then

devout stag
#

Quick question in regards to allPlayers

#
{
    if (_x alive) then {
        _justPlayersAlive pushBack _x;
    };
} forEach (allPlayers - entities "HeadlessClient_F");
pure blade
#

wrong

#

alive _x

devout stag
#

Will this code properly put all alive players into the _justPlayersAlive array

#

Ah cheers man

still forum
#

It might.. But why so complicated

devout stag
#

Also I hate so many of those commands are looking for params on one side compared to the other

high marsh
#

Select

still forum
#

_alivePlayers = allPlayers select {isPlayer _x && isAlive _x}

#

do you even need to filter out the HC? HC's are in allPlayers?

devout stag
#

Because it's going to be evaluating in a context where I need to verify if the client is not headless

#

They are

still forum
#

if isPlayer returns true for them you want to remove them in my code too

#

Or add a isKindOf to the condition

devout stag
#

the isKindOf would look for "HeadlessClient_F" correct?

still forum
#

ye

#

that's what entities command already does

tough abyss
#

One thing to be wary of is if you hand onto that array in the scheduled environment you could have a dead player in that array. The code might get suspended and a player die in the meantime. The longer you hang onto the array and the more processing you do the more likely it is to happen.

devout stag
#

This is being made into a function which will be called as needed

#

So in it's implementation I'll be fine.

signal pulsar
#

hey can someone send me a link and or explain to me how i could define the path of a config variable thats located in my config.cpp

#

like i forget what they call it but where they go from left to right and they use the >> symbols

#

MessageModes = 3; so would it would be like _MessageModes =

#

or what would u call that.

still forum
#

configFile >> "CfgWeapons" >> "WeaponClass" >> "Entry"

signal pulsar
#

yes thank you.

#

what do we call this @still forum ? also tagging a no no here?

still forum
#

what do you mean "what call this" ?

#

A "config lookup" I guess?

signal pulsar
#

yeah basically what i was looking for ty.

peak plover
#

hc are in all players

#

Also I think the support (airstrike) module is also in allplayers

carmine abyss
#

@meager granite hey i'm getting "type object, expected string" for _classes I put an array of class names using nearestObjects. sqf private _allUnitsNearDrone = nearestObjects [_dronePos, _radarObjects, 1000, true]; private _classToDisplayArray = _allUnitsNearDrone apply { getText(configFile >> "CfgVehicles" >> _x >> "displayName") }; hint format ["Jamming %1 Unit(s).\nJammed List:\n%2", _jammedCountArray, _classToDisplayArray];

high marsh
#

Well yeah

still forum
#

>> _x >> you are passing the object there

#

you want the classname of the object

#

you can get the classname of a object by using typeOf

carmine abyss
#

Well yeah

high marsh
#

Well maybe

carmine abyss
#

lol

signal pulsar
#

@still forum sqf _useAddonn = getNumber(missionConfigFile >> "CfgSGFramework" >> "CfgExileAutoMessages" >> "useAutoMessages");

#

hows that look?

#

is that like correct format?

carmine abyss
#

nice, figured it out. Thanks @still forum , your'e really coming around.

drowsy axle
#

Is it weird that while I was in the shower I was thinking of how I could make monopoly a thing in arma??

worldly locust
#

No

brave jungle
#

There is a mario-style gamemode

#

why not

worldly locust
#

Totaly normal

drowsy axle
#

@brave jungle link??

brave jungle
#

How he did it

#

I've no idea

drowsy axle
#

lol

#

looks aweseome

languid tundra
#

I'm unable to spawn modules properly with createUnit since the update.
e.g. tried to spawn smoke grenade with debug console

myModule = (createGroup sideLogic) createUnit ["ModuleSmokeWhite_F", screenToWorld [0.5, 0.5], [], 0, "CAN_COLLIDE"];
systemChat str [isNull myModule, typeOf myModule];

The object is created, but the module function apparently does not get triggered.

carmine abyss
#

I'm trying to get basically an array of every vehicle or unit that has anti-air capabilities. Currently, I made an array of all class names of vehicles that have any type of anti-air. The list is quite lengthy. Is there an easier way of getting all Anti-Air objects in an array? sqf private _allUnitsNearDrone = nearestObjects [_dronePos, _radarObjects, 1000, true]; The _radarObjects is the array I just spoke of, and this line looks for all anti-air capable objects near a drone. "condition configClasses config " maybe?

broken thistle
#

@still forum Sorry I didn't see your post. How ever to answer your question. No my issue still remains the same. 2) I didn't know that everyone would be in bed at that time I didn't know where or the time zone in that area. The idea should have been that when they did read my post. They should have replied. The point is that I didn't get the help I needed. It doesn't matter to me when I get the help. the issue is that I didn't get any help. @drowsy axle

restive leaf
#

Are you talking about the question asked on 10/11... cause you said then that you had a solution mate... Your entire conversation at that time, with no one posting in between was: Guys, what I'm trying to do is clear a cargo container or a jeep or anything Just is that the script command doesn't seem to work on a SP mission brb guys My friend said that for some reason the code is picky. We had to use global command like clearWeaponCargoGlobal. This seems to work. The other script command didn't work.

#

People are pretty friendly and pretty helpful here in my opinion though

#

Have had some good solid advice... but it is discord, and it is community help. The devs generally are not here to answer scripting questions. People with lives, jobs and servers of their own are.

peak plover
#

Don't expect people to write scripts for you lmao ๐Ÿ˜„

#

@languid tundra

#

        _zeus = mission_zeus_group createUnit ["ModuleCurator_F", [0,0,0], [], 0, "NONE"];
#

works on my machine

#

I can try after mission start, I guess..

#

nope

#

works after mission start

#

@languid tundra sqf veh = createVehicle ['SmokeShell', position player, [], 0, "FLY"]

copper raven
#

Heโ€™s talking about modules.

peak plover
#

Yes

#

I created a zeus module and it worked even after the mission was started

#

I don't see a reason why he would create a smoke via module?

#

He can just createVehicle the magazine

copper raven
#

The guy wants to investigate something that broke with the update. Createunit command, he doesnโ€™t want to know how to create a smoke shell.

peak plover
#
I'm unable to spawn modules properly with createUnit since the update.
#
I created a zeus module and it worked even after the mission was started```
#
 
mission_zeus_group = createGroup sideLogic; 
_zeus = mission_zeus_group createUnit ["ModuleCurator_F", [0,0,0], [], 0, "NONE"]; 

player assignCurator (allCurators # 0)
#

here's the code

#

createUnit works fine

copper raven
#

Did you try the module that he mentioned? There is also a guy on feedback tracker with same issue.

peak plover
#

hmm lemme see

#

Doesn't work

#

I have never used this before 'tho

#

So maybe it was broken before ๐Ÿคท๐Ÿป

#

I can tell for sure that modules that I've used before and that worked before work

slow elbow
#

@astral dawn "the format function has this limit. Are you sure that what you see is the copyToClipboard limit instead of format limit?" Ahh yeah, i don't think i used format, but i did use "str", it was done like this ```sqf
copyToClipboard str _myBigAssArray;

#

I suppose that's why they don't let begineer's post on the Wiki XD. Lesson learnt...

still forum
#

@signal pulsar das looking gut! Besides the addonn typo in the varname :D
@carmine abyss you can definitely read out of config which vehicles have anti-air capabilities, But I don't really know how to. I guess you could parse all weapons of a vehicle and check if any of their magazines are antiAir capable.
@broken thistle as i said. You wrote you solved your problem. What help do you expect about a problem that you already solved? Should people just reply "I'm happy for you that you managed to solve it by yourself" ? Or what do you expect?

@slow elbow I also fell into that trap once, don't remember what it was. But 100% copyToClipboard doesn't have a limit.
And I'm also not aware of str having one

slow elbow
#

I assume that copyToClipboard is still bound by the 2GB default limit in windows. Although that doesn't affect me. ๐Ÿ˜„

#

Need to double check the str one though, because i'm fairly sure that it is what i used, and it cut the output to 8192.

#

Ok confirmed, str is not limited to 8192, just got over 150,000

calm bloom
#

Hello. Can i get real world date from the game?

#

oh. already found it. sorry to bother

#

missionstart is giving its services since the resistance 1.80

still forum
digital jacinth
#

advanced pair programming.

peak plover
#

ooh woow

#

That's nice

#

There used to be a website like that which had sqf as well

#

Enable/Disable commands from CBA via "sqf.enableCBA". Default: disabled

#

how

still forum
#

CTRL+. or File->Settings

#

then Go to Extensions and "SQF Language"

peak plover
#

thanks

still forum
peak plover
#

You keep switching files, right?

#

It follows?

still forum
#

yep. You can also switch to your own file and explore on your own

#

And I can force you to focus onto what I'm doing again

hollow thistle
#

Nice it even supports audio calls and chat.

still forum
#

But only in VS Code. The Visual Studio one doesn't support that yet

peak plover
#

Ahh, I can choose who to follow

still forum
#

Other users can force me to follow them.. should probably disable that

#

yeh ๐Ÿ˜„

languid tundra
#

@peak plover
I'm not expecting people to write scripts for me. I'm here to raise awareness to scripters.
Your example with the curator module actually proofs my point.
The module function also does not get triggered in your example.
If you assign yourself to that module, you will notice that you can't open the attribute window by double clicking a placed unit, because the module function would add the event handlers.

peak plover
#

That's not a new bug

languid tundra
#

It is. The old bug was that you got duplicate event handlers.

peak plover
#

It happened to me all the time when I was local hosting

#

I always created zeus with scripts

#

When I tested my mission in local host

#

Using zeus I couldn't double click units

#

And some modules wouldn't work, said no selection or sth like that

#

When I tested same mission in multiplayer

#

all okay

#

Same is the case today

languid tundra
#

Gonna check MP

peak plover
#

I already checked today

#

Zeus works as intended

languid tundra
#

Yes, you are right, the module function indeed gets triggered. That complicates matters.

languid tundra
#

Problem solved!
Apparently, you now have to ensure yourself that a module gets triggered automatically in any case. You can do that by setting BIS_fnc_initModules_disableAutoActivation to false.

"ModuleSmokeWhite_F" createUnit [screenToWorld [0.5, 0.5], (createGroup sideLogic), "this setvariable ['BIS_fnc_initModules_disableAutoActivation', false, true]; myModule=this"];
systemChat str [isNull myModule, typeOf myModule];
tough abyss
#

How would one check if a value inside and array exists in another array? IE:

_arr = ["banana", "grape", "orange"];
_arr1 = ["apple", "banana"]; //true
_arr2 = ["apple"]; //false
_arr3 = ["orange", "apple", "orange"]; //true

Is there any find command for this?

languid tundra
still forum
#

nope

#

Also my first thought. but nope

tough abyss
#

Yeah, I couldn't find anything that doesn't require loops of some sort.

still forum
#

Maybe you can somehow intelligently use - ?

#

Yes. You can

tough abyss
#

no such thing as intelligence here ๐Ÿ˜‰

still forum
#
_arr = ["banana", "grape", "orange"];
_arr1 = ["apple", "banana"]; //true
_arr2 = ["apple"]; //false
_arr3 = ["orange", "apple", "orange"]; //true

_arr1hasElem = (count _arr1 != count (_arr1 - _arr));
_arr2hasElem = (count _arr2 != count (_arr2 - _arr));
_arr3hasElem = (count _arr3 != count (_arr3 - _arr));
#

Basically try to remove every element that's also in _arr. If the size changes, you know what you _arrX contained elements that were also in _arr

#

example on _arr2
It will take ["apple"] and remove all elements that are "banana" or "grape" or "orange"
It won't remove any. thus size will stay 1. 1 != 1 -> false. No element inside

on _arr1
it will remove all elements again. It will see that "banana" is in there and remove it.
So in the end you have 2 != 1 -> true

tough abyss
#

Dude, you just wrote this for me. Looking at that it should work 100% fine and the usage of count is something I'd never come up with myself.

still forum
#

It's still the same loops that you thought about using, but inside the engine and thus faster

tough abyss
#

Thanks! I'll make sure to test it out when I get the chance!

meager granite
#

Why not arrayIntersect?

#

count(_arr arrayIntersect _arr1) > 0

still forum
#

because it removes duplicates

#

_arr arrayIntersect _arr1 -> "banana", "grape", "orange", "apple"
Okey you can check something like
count _arr + count _arr1 != (_arr arrayIntersect _arr1)
If they don't contain duplicates, they should add together. If they didn't, then there was a duplicate

meager granite
#

_arr arrayIntersect _arr1 -> ["banana"]

still forum
#

so that works too. Dunno which method is faster

#

๐Ÿค”

#

wtf.

#

I had in my brain that this doesn't work

meager granite
#

I was rereading the question several times thinking I missed something that makes arrayIntersect not applicable here lol

still forum
#

Somehow the common from the biki description was missing in my brain. I recently had some problem with arrayIntersect where I was trying to do something like this and it turned out it wasn't possible.

#

@tough abyss don't use my method ๐Ÿ˜„

tough abyss
#

Yeah, I'm tracking. I wasn't thinking about count the whole time..

lucid junco
#

hey guys. Dont you know why during the night i have NV turned on automatically when i use camera? its future or bug? ๐Ÿ˜„

peak plover
#

future

languid tundra
#

lol, when I use the BIS_fnc_initModules_disableAutoActivation solution for CuratorObjectPlaced, the bug in Zeus regarding copying/pasting modules caused by the update gets fixed.

(allCurators#0) addEventHandler ["CuratorObjectPlaced", {params["", "_obj"]; _obj setVariable ["BIS_fnc_initModules_disableAutoActivation", false, true]}];
slow elbow
#

What would be the best way to use a string as a variable name, so that you can assign a value to it?```sqf
//Psuedo code

_array = ["test1","test2","test3","test4"];
{
_x = "classname" createVehicle pos;
} foreach _array;

test1 setPos newPos;
test2 setPos altPos;
//etc

I'm thinking that i could use compile or something, but this seems like a fairly simple thing, so assumed that there would be an easier way to do this that one of you might known of. Any clues?

thanks.
languid tundra
#
missionNamespace setVariable [_x, "classname" createVehicle pos];

but why would you do this in the first place? I mean why not just work with the array and select the element you need?

pure blade
#
_array = ["test1","test2","test3","test4"];
{
    _x = "classname" createVehicle pos;
} foreach _array;

???

languid tundra
#

The syntax is wrong, that's what it is.

pure blade
#

the logic behind this too, why do you define _x in a forEach codeblock?

#

@languid tundra take a look at setVehicleVarName command

languid tundra
#

Is that command still a thing? I don't think I've used it anymore.

still forum
#

It is. But not sure if moldisocks wants that command. He asked about setVariable

languid tundra
#

Nvm, I confused it with setVehicleInit

drowsy axle
#

Do scripting commands get r3moved?

digital jacinth
#

Not even setdammage got removed

still forum
#

usually not

#

because that would break everything that tries to use it

slow elbow
#

@languid tundra "//Psuedo code"

#

Also, "setVehicleVarName" that works for part of what i'm doing. But ended up using compile in combination with format. Thanks for the help.

still forum
#

compile format is almost always wrong

#

in this case too

#

we told you what you should be doing

slow elbow
#

"compile format is almost always wrong" how so, it is working, and with little performance issues (not that performance is an issue for this, is only running once at start of mission).

still forum
#

with little performance issues That's the issue

#

you are parsing and compiling code. For something for that you could just use setVariable directly

#

Plus it's kinda harder to read too

slow elbow
#

Yeah ok, all good. Probably best to change.

#

thanks again mate.

still forum
#

Based on your code above

_array = ["test1","test2","test3","test4"];
{
    missionNamespace setVariable [_x, 1];
} foreach _array;

Time: 0.0162ms

_array = ["test1","test2","test3","test4"];
{
    call compile format ["%1 = 1;", _x];
} foreach _array;

Time: 0.0236ms

And the more elements you have in that array, the worse it gets

slow elbow
#

Yeah right. I had 1600 ๐Ÿ˜ƒ

#

Well. Live and Learn eh.

languid tundra
#

You are setting 1600 variables? Are you gonna use all of them in some part of the code? ๐Ÿ˜„

slow elbow
#

Sorry, not setting 1600, i have that many elements, some with a blank string, some with varnames (extracted from missionObjects, where the mission had varnames set to objects, but not all ). So really, will only be < 30 global vars being set.

tough abyss
#

Anyone know why

_mags = magazines player;
{
    if (_x in magazines player) then {
        _mags deleteAt _forEachIndex;
    };
} forEach _mags;
hint format ["%1", _mags];

doesn't show up as empty array?

hollow thistle
#

you shoudnt delete from array that you are iterating on.

tough abyss
#

Well, I know but it's besides the point. Even if I do something like this

hollow thistle
#

} forEach (+_mags);

tough abyss
#

still doesn't show as empty

#

It was a legitimate question. Apparently now I created another array and it worked, but earlier it broke by switching to my pistol and back somehow lol (+_mags) don't work though.

still forum
#

if you delete while iterating. You'll skip the next element.
Thus every second element if you try to delete each

tough abyss
#

Yeah, I was thinking that. Just curious if it was the case or if there was something else behind it. The weird thing was it functioned properly sometimes so I got curious lol

pure blade
#
_mags = [test1,test2,test3,test4,test5]

1 loop:
{
    if (_x in magazines player) then {
        _mags deleteAt 0(_forEachIndex);
    };
} forEach _mags;

_mags = [test2,test3,test4,test5]

2 loop:
{
    if (_x in magazines player) then {
        _mags deleteAt 1(_forEachIndex);
    };
} forEach _mags;

_mags = [test2,test4,test5]

3 loop:
{
    if (_x in magazines player) then {
        _mags deleteAt 2(_forEachIndex);
    };
} forEach _mags;

_mags = [test2,test4]
ember verge
#

is there a way to shoot rockets from smoke screen instead of smokes ?

#

tried this vehicle player loadMagazine [[0],"m256","20Rnd_120mmHE_M1A2"];

#

but it doenst work

#

I want to troll my mates as an zeus with an ifrit who fires rockets xd

digital hollow
#

Use an armed one, attachTo a bunch of rocket tubes, and use addWeaponTurret and addMagazineTurret

ember verge
#

can u give me an example never did something like this

#

@digital hollow

digital hollow
#

The wiki pages for those commands give examples. Have a look there first.

ember verge
#

allright

gleaming cedar
#

How to make an driver AI look a certain position with head (Dowatch/lookat not working)

ember verge
#

@digital hollow I dont have an idea :/

#

ive checked out the examples but i didint understand it

#

I mean how should this work

#

ammoCrate attachTo [player];
even this doesnt work for me :/

digital hollow
#

Try

_ifrit addWeaponTurret ["rockets_Skyfire", [0]];
_ifrit addMagazineTurret ["14Rnd_80mm_rockets",[0]];
#

[0] is the turretPath for the gunner.

ember verge
#

if i make it -1

#

can i shoot in the driver seat ?

#

@digital hollow doesnt work

digital hollow
#

If you're just running it in the debug console while in the vehicle, you should replace _ifrit with vehicle player

ember verge
#

ah ok

digital hollow
#

_ifrit is just an appropriately-named variable

#

If you use [-1] then the rockets will just shoot straight forward.

ember verge
#

@digital hollow vehicle player addWeaponTurret ["rockets_Skyfire", [0]];
vehicle player addMagazineTurret ["14Rnd_80mm_rockets",[0]]; ?

digital hollow
#

Yeah.

ember verge
#

doesnt work buddy

digital hollow
#

Does the weapon show up in the gunner seat?

ember verge
#

nope

#

there is only an hmg

#

oh wait

#

actually yes it works @digital hollow thanx โค

digital hollow
#

When you say "doesn't work" in the future, try to include what you did, what you expect to see, and what you actually see.

#

It makes it way easier to help you.

ember verge
#

@digital hollow allright thanks for your information

digital hollow
#

Have fun >=D

ember verge
#

thx

#

@digital hollow last question if im in an unarmed ifrit and i want to shoot it like you shoot the smoke screen

#

do i need to change anything ?

digital hollow
#

You can experiment, but it won't be nearly as simple.

ember verge
#

hmm allright because when im in a unarmed one the bullet just disappears ๐Ÿ˜›

signal pulsar
#

can you list sounds out in an array and tell a file to randomly pick a sound from this array when the file is ran?

still forum
#

what is your definition of "a file" ?

#

a script?`

#

yes selectRandom is a thing. and scripts can play sounds

glad timber
#

Is there a way I can make some of my player slots whielisted

high marsh
#

Yes

#
_coolerPeopleThanYou = [uidhere];
if(getPlayerUID player in _coolerPeopleThanYou) then {
    endMission "end1";
};
#

obviously you don't want to construct the array everytime you have a player join

#

so store it somewhere on server or somethi g

steady egret
#

is there anyway of making ai invisible but still be detected as iam trying to make a script that hides that makes ai invisable to the player until the friendly ai detects them as sort of a fog of war currently i can only get it to hide the object for a short time otherwise detection does not work the loop iam running now is

_Rev = 0;

    {
        vehicle _x hideObjectGlobal false;
        sleep (0.1);
        if ((blufor knowsAbout _x) > 3.5) then {
            vehicle _x hideObject false;
            _Rev = _Rev + 1;
        } else {
            vehicle _x hideObject true;
            _Hide = _Hide +1;
        };
    } forEach allUnits; 

sleep (.1);
execVM "Hide.sqf";
hint ("Units:"+str count allUnits + "   Hide:" + str _Hide + "   Rev:"+str _Rev+"   "+str time);```
problem is with this however is that the ai have to be visiable for a short time in order to let the ai detect them this is on sp so the global vs client side hide object does not matter
lucid junco
#

can someone help pls. im looking for some easy way to disablecollisionwith for allunits in scenerio. for all to each other. like any unit can meet any other unit on the map and this two units will have collision disabled.

still forum
#

Not sure if you can disable collision between soldiers at all

#

disableCollisionWith is for physx afaik

lucid junco
#

all units are planes

#

arent vehicles physx?

still forum
#

yeah they are. usually

#

well you can just loop through allUnits twice and disable collision for all of them

lucid junco
#

can you point me how to do that pls? im without idea for this ๐Ÿ˜„

still forum
#
{private _unit1 = _x;
{private _unit2 = _x;
_unit1 disableCollisionWith _unit2
} forEach allUnits;
} forEach allUnits
#

something like that. But you need the vehicles instead of the soldiers that allUnits returns

lucid junco
#

thanks much!

glad timber
#

So I have a question about this

_whitelisted = [uidhere];
if(getPlayerUID player in _whitelisted) then {
    endMission "end1"; 
};
#

Can I change endMission "end1"; to what ever I want

#

?

pure blade
#

how do you mean? custom ending?

glad timber
#

oh no, like I want to set it to check if they have the whitelist first and then check if they are playing as a certain character class

pure blade
#
_whitelisted = [uidhere];
if(getPlayerUID player in _whitelisted) then {
    if((typeOf player) == "classname") then {
            endMission "end1"; 
    };
};
winter rose
#

@glad timber see endmission's wiki page, use BIS_fnc_endMission instead โ€“ and you can use whatever name is defined in CfgDebriefing

#

(iirc)

pure blade
#

or what do you mean with character class

glad timber
#

thats what I ment, but I can remove endmission and add some other condition. Also thanks for the help

astral dawn
#

Is ArmaDebugEngine working in the new arma version?

still forum
#

intercept dll needs to be updated

#

debugger itself dunno. should still work

astral dawn
#

I totally forgot how to run it. So I launch it without @intercept, but I have to update the intercept_x64.dll inside @ArmDebugEngine, right?

still forum
#

yes

#

you can get it from the intercept github page under releases. there is a hotfix for 1.86

astral dawn
#

Yeah I have replaced the .dll and the game doesn't crash any more, but it doesn't dump the callstack if I write some nonsense in my console. ๐Ÿค”

still forum
#

Does manually dumping it with ade_dumpCallstack work?

#

If you type it in debug console and press F1 does it recognize the command?

astral dawn
#

no and no ๐Ÿ˜ฆ

still forum
#

๐Ÿค” oof

#

I just went to bed. I'll try to fix it tomorrow. Remind me in case I forget

astral dawn
#

Don;t you use it for your projects?

#

Yeah sure, thanks!

still forum
#

My project for the last 2 weeks was working on armake.
And as the debugger VS Code Extension is not ready yet it isn't all that useful

still forum
#

Oh... I think the certificates were running out last month. That might be the problem.
Need to resign with new cert

uneven torrent
#

So I wrote a small script to equip spawned ai units with different weapons and mags via BIS_fnc_addWeapon. However, for some unknown reason a few of the units, despite getting both the weapon and the approriate magazines as well as a call to switch to their primary weapon, remain with their secondary weapon equipped.
Any ideas what's going wrong there?

meager granite
#

selectPlayer them and double check?

uneven torrent
#

I did. Everything's perfectly fine, I can switch to primary and load the magazines the unit got for that

#

that's why it baffles me so much

peak plover
#

just remove the pistol

uneven torrent
#

how have I not thought of that....

#

god damnit, I blame lack of sleep

#

cheers, let's try this

#

yup, that does the trick

young current
#

Vanilla weapons or mod weapons?

uneven torrent
#

mod

ember verge
#

Im going to create a modded server but i dont have a plan on how i can make an whitelisted gang menu

#

like this gang has a whitelist

#

and stuff....

calm bloom
#

Hello there, i have kinda messed up with a unicode numbers for tostring command, the table mentioned in the article (https://community.bistudio.com/wiki/toString) is completely different from the one i use .
Can someone give advice?
here is my function, i want to change "" in the tostring for a ' '

_arraytostring = {
    (str _this splitString '""' joinString tostring [34,34])
};
#

34 is digit four, not the QUOTATION MARK

#

i even managed to find the number, had to count the offset from the linked table

astral dawn
#

Yeah Dedmen you are right, changing system date makes ArmaDebugEngine work again

still forum
#

๐Ÿ™ˆ

astral dawn
#

I'm curious, what part of software has this system date lock?

still forum
#

the signature

#

right click the DLL and check details. It lists the sig there

still forum
astral dawn
#

I think it doesn't work even if I change date

#

Hopefully I can just change date, launch game, then change it back

still forum
#

I'll make a real fix then

astral dawn
#

You'll be a real human bean then ๐Ÿ˜„ Not sure if anyone except me and my friend use this thing, but we really love the callstack dump

still forum
#

ugh.. 32bit build doesn't work. Can't be bothered with that now ^^ x64 has to be enuff

rapid plume
#

since last update creating a module using :
_module = (creategroup sidelogic) createUnit ["ModuleName",mypos,[],0.5,"NONE"];
Doesn't initialize the module function.
where
_module = (creategroup west) createUnit ["ModuleName",mypos,[],0.5,"NONE"];
does

#

any info on that?

rapid plume
#

yeah seems like - i'll take a look. But calling the function manually isn't really a fix.

still forum
astral dawn
#

\o/ gonna test ASAP

#

Do you have to mess with certificate if you make a .dll or can you just ignore it so that it works forever?

still forum
#

I only tested the manual callstack dump and that worked. Don't see why the automatic one on error wouldn't work

#

I just run a batch script to sign the dll with the certificate

astral dawn
#

Works as usual! Now I can safely make numerous SQF errors, thanks!

still forum
hollow thistle
#

It needs to have intercept loaded separately doesn't it?

still forum
#

is included

hollow thistle
#

Nice. What exactly is "can also do much more things." :P

still forum
#

Well. It can debug scripts via the TCP interface.

#

SQF Debugger VS Extension and stuff. But as long as that's not done it isn't that useful

hollow thistle
#

Oh, yeah the extension I wanted to look at ๐Ÿ™ˆ

queen cargo
#

sqfvm could do that too though ... one needs to implement the endpoints ๐Ÿคท

ember verge
#

Is there a way i can make a phone system in a life script ? like to call someone ?

hollow thistle
#

But i can't hook sqfvm into existing framework. Easily.

still forum
#

It's possible to script things using scripts if that's what you're trying to ask.. yes.

astral dawn
#

Mobile phone extension for TFAR ๐Ÿค”

#

I must be the the millionth person to think of it though

austere granite
#

Maybe you should become a professional ideas guy

languid tundra
#

@rapid plume
It's not calling the module function manually, but a variable that ensures that the module function gets executed automatically. It's a new control variable in BIS_fnc_moduleInit they introduced in 1.86.

queen cargo
#

@hollow thistle Mhh?

#

Sqfvm has a TCP based api to access the Server
It lacks Features currently as no interest ever grew with its introduction, but adding required would not be hard

still forum
#

You can't just run a whole mission framework with AI's and real players that do unforseen things in SQF VM.

#

That's what he meant

queen cargo
#

Obviously not
But I doubt that doing that with intercept is a good idea ๐Ÿคทโ€โ™‚๏ธ

still forum
#

Intercept is just used to debug the SQF scripts

queen cargo
#

Which is the point
Sqfvm can do that too

#

Though, with Limits

still forum
#

SQF VM can't debug scripts while they are running in production though, which is the point

queen cargo
#

Technically, intercept should neither be able to unless you no longer Pause the Exekution of arma

still forum
#

Intercept pauses

#

but you can freeze the game while testing things, not a problem

#

as they are unscheduled scripts, you don't really have a choice there anyway

forest ore
#

Is it possible to "remove" declared publicVariable?

astral dawn
#

Set it to nil

#

oh wait... ๐Ÿค”

languid tundra
#

I thought so too.

pure blade
#

yeah that's right, set it to nil

forest ore
#

may I ask how publicVariable "pubVar" is set to nil?

pure blade
#
    pubvar = nil;
    publicVariable "pubvar";
astral dawn
#

I thought of using this: missionNamespace setVariable [name, value, public]

#

With public flag

pure blade
#

and what is with jip players?

forest ore
#

well, got me beginner into a sticky situation: which one to use ๐Ÿค”

astral dawn
#

From setVariable page: Since Arma 2: If the public parameter for supported types is true, the value will be synchronized also for a JIP player.

languid tundra
#

I'm pretty sure both approaches are equivalent

pure blade
#

yeah

proven crystal
#

how do i get the unit that a player/zeus currently controls. im trying to use nearunits around there, but i keep getting the nearunits around the original player unit obviously

still forum
#

do you have cba or ace?

#

or TFAR

proven crystal
#

me? cba and ace

still forum
#

just use ACE_Player then

proven crystal
#

does getPilotCameraPosition gove me the camerapos of where i am maybe?

still forum
#

That's a variable that auto updates when remote controlling units

proven crystal
#

oh ok sounds good

#

ahyes thats handy

still forum
#

there is also a cmaera pos command yeah

#

but not getPilot...

rapid plume
#

@languid tundra well changing a method 5 years into release from normally open to normally close - requires modders to go back all over their work - I guess this is just the way BI do stuff - the wrong way.

languid tundra
#

Yes, I agree. It has troubled me a lot too and it probably plagues many more mods and missions.

still forum
#

create feedback tracker item about it and throw it at bi devs ๐Ÿ˜„

languid tundra
#

You are better of fixing it yourself than waiting for them to fix it at some point ๐Ÿ˜‚

rapid plume
#

I've already fixed it - but the frustration every time BI decide to add something that breaks all your hard work is a real deal. Any way thank you for the help now I can fix MCC, I'll try to edit the module section in the wiki to add info about it

languid tundra
#

Probably should be mentioned in createUnit, since modules placed in Eden or in Zeus are not affected.

#

I'll add a comment

tame lion
#

Does ace_clipboard do what I think it does? (allow you to copyToClipboard while not being in editor/host environment?)

still forum
#

yes

peak plover
#

Does init for modules run on the next frame after creating unit?

hallow mortar
#

I'm trying to removeWeaponTurret from a Praetorian CIWS, on a dedicated server. I had it working in local testing with just the plain command, but it didn't work on the server. Attempting to overcome locality, I tried this: sqf [v_ciws1,["weapon_Cannon_Phalanx",[0]]] remoteExec ["removeWeaponTurret"]; but that does nothing, either from the debug console or the trigger itself.

#

I figured remoteExec'ing it for everyone would brute-force past any locality issues caused by it being UAV controlled, but clearly I was wrong

peak plover
#

Arguments local

#

It will only run if the vehicle is local

#

Does it not work at all in multiplayer_

#

?

#

can you confirm v_ciws1 is valid?

still forum
#

just execute it where veh is local

#

put veh as target to remoteExec

hallow mortar
#

fuck me

still forum
#

Only if you shave ๐Ÿ˜‰

hallow mortar
#

apparently at some point I replaced the CIWS and didn't re-apply the variable name

peak plover
#

๐Ÿ‘๐Ÿป

languid tundra
hollow lantern
#

easiest way to cuff a AI? ACE & CBA are available

#

via scripting I mean

still forum
#

just use the ACE set cuffed command thing

hollow lantern
#

damn yes I forgot it has been moved to that

#

thanks

proven crystal
#

i believe i had a command line or function in hand recently that would return me all the different ammotypes of a vehicle. something with weaponammo or so?

languid tundra
#

When you need the data for your toolkit, you may want to have a look at Achilles_fnc_getWeaponsMuzzlesMagazines, which returns pretty much anything you could want to know about available turrets, weapons, muzzles and magazines.

proven crystal
#

hm ok. but i thought there was something else

#

at least i have a scribbled note here that reminded me of it

#

something that returns all used ammotypes for an array of units apparently

languid tundra
#

magazinesAllTurrets?

proven crystal
#

hmm yea that does produce the desired result i suppose although also some other stuff

#

although no this returns magazines not the ammotypes

#

im pretty sure i had it tested and what i got as return was just an array of all ammotypes with no duplicates or subarrays

#

it was quite convenient because i could give it an array of units too

#

and it would return a clean array of all ammotypes

#

something in cba or ace or achilles i guess because thats what i use

still forum
#

cba has a compatible magazines function

#

but magazines, not ammotypes

#

but that's easy to do just a configlookup

proven crystal
#

maybe i dreamt of it ^^

#

anyhow, thanks

still forum
#

Well you can put everything into a single line

proven crystal
#

yeah will check it out tomorrow. getting late agan

#

oh do i need to add ace interaction on every client or so like normal actions?

glad timber
#
_medicwhitelisted = [uidhere];

if(getPlayerUID player in _medicwhitelisted) then {    
    if((typeOf player) == "CUP_B_US_Medic") then {
            endMission "end1";
    };
};

Do I have to change endMission "end1"; to allow the whitelisted people to spawn, cause I cant seem to get this working.

rapid plume
#

You probably want to change it to if((typeOf player) != "CUP_B_US_Medic") then

#

and there is no need for two if - use one.

peak plover
#

What is this whitelist?

#

@glad timber What do you want?

#

Your current code:

If player is a whitelisted medic then,
    check if his type is CUP MEDIC,
        in which case, end his mission
#

If that's your intention

#

You want to make it so if a player is in the medic slot, he will go to the menu, if he is not in the medic list?

#
private _medicwhitelisted = [uidhere];
if ((typeOf player) == 'CUP_B_US_Medic' && {!(getPlayerUID player in _medicwhitelisted)}) then {
    endMission "end1";
};
#

Do you have more than medic slot restrictions 'tho?

brave jungle
#

Is there a way to have the width and height dynamic - eg. use the image's, instead of defining it?

class RscDisplayLoadMission: RscStandardDisplay
{
    onLoad="['onload',_this,'RscDisplayLoading'] call (uiNamespace getVariable 'full_mission_load_fnc_load')";
    onUnload="[""onUnload"",_this,""RscDisplayLoading""] call (uiNamespace getVariable 'full_mission_load_fnc_load')";
    class controlsBackground
    {
        class CA_Vignette: RscVignette
        {
            colorText[]={0,0,0,1};
        };
        class Map: RscPicture
        {
            idc=999;
            text="#(argb,8,8,3)color(0,0,0,1)";
            colorText[]={1,1,1,1};
            x="safezoneX";
            y="safezoneY - (safezoneW * 4/3) / 4";
            w="safezoneW";
            h="safezoneW * 4/3";
        };
        class Noise: RscPicture
        {
            text="\A3\Ui_f\data\GUI\Cfg\LoadingScreens\LoadingNoise_ca.paa";
            colorText[]={1,1,1,0.3};
            x="safezoneX";
            y="safezoneY";
            w="safezoneW";
            h="safezoneH";
        };
    };
};

Looking at Map
Currently, the images are skewing to fit, which looks awful. I want it to be like the default loading screen, if I can, where it's zoomed in slightly on the image
Using this mod: https://forums.bohemia.net/forums/topic/210049-full-screen-mission-loading-screen/

#

I still want it to be the full screen, just not skew the overviewPicture when no custom image is present

peak plover
#

ST_KEEP_ASPECT_RATIO

#

try that?

brave jungle
#

I'll give it a try

#

This damn function is so annoying tho, all I want it to do is show a custom image if CUR_ is in the string of loading/overview picture, using BIS_fnc_inString here, if not use the same one as the old loading screen. Instead, it skews the overview picture, or just shows black

#

Perhaps another pair of eyes can help, I've looked at this code for too way to long.

        //--- Mission check
        _ctrlMission = _display displayctrl IDC_LOADING_MISSION;
        if (!(isnull _ctrlMission)) then {

            _author = gettext (missionconfigfile >> "author");
            _cur_custom = ["CUR_", gettext (missionconfigfile >> "loadScreen")] call BIS_fnc_inString;
            if (_cur_custom isEqualTo true) then {_pictureMap = gettext (missionconfigfile >> "loadScreen");};

            _worldName = getText (missionConfigFile >> "briefingname");
            if (_worldName == "") then {_worldName = gettext (missionconfigfile >> "onLoadName");};
            _loadingName = _worldName call (uinamespace getvariable "bis_fnc_localize");

            _loadingTextConfig = gettext (missionconfigfile >> "onLoadMission");
            _loadingText = _loadingTextConfig;
            if (_loadingText == "") then {_loadingText = ctrltext _ctrlMissionDescriptionEngine;}; //--- Use overview data
            if (_loadingText == "") then {_loadingText = gettext (missionconfigfile >> "overviewText");};
            //_loadingText = _loadingText call (uinamespace getvariable "bis_fnc_localize");
            //[missionconfigfile,_ctrlMissionAuthor] call bis_fnc_overviewauthor;
        };




        if (_pictureMap == "") then {_pictureMap = gettext (_cfgWorld >> "pictureMap");};
        if (_pictureMap == "") then {_pictureMap = "#(argb,8,8,3)color(1,1,1,0.9)";};
        if (_worldName == "") then {_worldName = gettext (_cfgWorld >> "description");};
        if (_loadingText == "") then {
            _loadingTexts = getarray (_cfgWorld >> "loadingTexts");
            _loadingText = if (count _loadingTexts > 0) then {
                _loadingTexts select floor (((diag_ticktime / 10) % (count _loadingTexts)));
            } else {
                ""
            };
        };
        _pictureShot = gettext (_cfgWorld >> "pictureShot");
#

Instead, it's either black or the loading screen, arma 3 Apex splash screen

peak plover
#

do diag_log _picturemap

brave jungle
#

I tried that last night, it was showing "

peak plover
#

*str _picturemap

brave jungle
#

yeah

peak plover
#

then put a diag_log into both of trhe picturemap ifs

brave jungle
#

Okay, two secs

#
11:12:06 "cur_PICTUREMAP = ""\ibr\dingor\data\pictureMap_ca.paa"""
11:12:06 "cur_pictureShot = ""\ibr\dingor\data\ui_dingor_ca.paa"""
11:12:06 "cur_pictureMap = ""\ibr\dingor\data\pictureMap_ca.paa"""

Are the only things, that's during the loading phase. Of course, it would different for different maps etc.

#

With this in the map class on the loading resource

        class Map: RscPicture
        {
            style="0x30 + 0x0800";
            idc=999;
            text="#(argb,8,8,3)color(0,0,0,1)";
            colorText[]={1,1,1,1};
            x="safezoneX";
            y="safezoneY - (safezoneW * 4/3) / 4";
            w="safezoneW";
            h="safezoneW * 4/3";
        };
proven crystal
#

guys, do i need to add ace actions on clients like normal addaction? or is it a smarter function?

proven crystal
#

yea but that doesnt really say if i would have to add the actions locally on each client, does it?

brave jungle
#

it does that for you

proven crystal
#

how nice of it

brave jungle
#

๐Ÿ˜ƒ

#

some examples of how to use it

proven crystal
#

i think i got it figured out otherwise. just wanted to check on the locality thing

peak plover
#

local effect

#

arugment global

proven crystal
#

what does that mean?

brave jungle
#

the effect of the script is local, so the player that executes it

#

the arguments you use are global

#

Want an example?

proven crystal
#

always helpful.

brave jungle
#

Okay, so

_text = someGlobalVariable;
while {true} do {
player sideChat str _text;
sleep 5;
};
```Every 5 seconds, it will display a string version of `someGlobalVariable`.
If one player sets `someGlobalVariable` to `true`, and then another random player changes it to `false`. It will take the most recent change.
#

Basically

#

anyone can change the global

proven crystal
#

ah i see

#

a question on that first argument for ace_interact_menu_fnc_createAction

#

does that have to be unique for every action? because yetsreday i accidentally used the same string there for multiple actions but ha no error

brave jungle
#

I'm not sure

proven crystal
#

but could be that they yre added one after the other and so only the next player would see issues?

brave jungle
#

I would presume it is for identification, like how Task IDs work

#

for scripting purposes

slim verge
#

quick question, did paramsarray every get fixed as in made available on the clients in an MP session at pre init or is it still not passed over the net till much later ?

#

just checked the Bug Tracker lots of closed tickets but none of them say it is now working

#

havent done any coding in a couple of years so trying to catch up with changes

#

am now seeing a function parameter and a script parameter which is new

verbal saddle
#

@slim verge

Local server:  Isnil Paramsarray: false
Dedi server as client: Isnil Paramsarray: true

Just tested it for you.

slim verge
#

k thx

frigid raven
#

Is this the right chat to ask for custom module functions and how they work?

peak plover
#

It's somewhat of a feature @slim verge

glad timber
#

@peak plover Yea I have more than just medic

tame lion
#

does anyone know how i can script custom content for the field manual? I know it can be done cause RHS, ALIVE, and other mods do it.

still forum
#

you can't

tame lion
#

i can't figure out how to google search it otherwise i would have already done so

still forum
#

it's not scripted

tame lion
#

ah, I figured it was probably a config entry

still forum
#

If you wanna find out how, you could just look into a AIO config

#

to find the entries

lucid junco
#

help pls! im trying to make overview for mission. When i use attributes >> general >> and then fill tittle or author box >> then export as singleplayer >> nothing show up in scenerios (i mean that mission is there but without overview, tittle). is overviewtext, or overviewpicture in description.ext equal to way i described?

brave jungle
#

Huh?

#

is for presentation of a mission via description.ext

#

I re-read that - If it's not showing after an export, make sure you're not defining it twice in different places, that can cause problems. If you're gonna use the in-game stuff, stick to that, if you're using a file for it, just use that.

lucid junco
#

i tryied both ways separately and without succes

#

and im sure i did not define it both ways at once...... really dont know lol

brave jungle
#

does it work if you publish it?

lucid junco
#

dont know... will try

#

just for sure in which format i should fill the box in eden ? just simple text right?

brave jungle
#

What do you mean by simple text

lucid junco
#

for example : My mission name

#

im trying like two hours now so im confused ๐Ÿ˜„ just if its not something like: "My mission name" ๐Ÿ˜„

#

or 'My mission name'

#

or whatever else.....

brave jungle
#

i'm confused

#

just put a normal string in place

#

but test if the workshop will export it correctly first

#

sometimes the export to single/multiplayer just doesn't work

lucid junco
#

is possible to use jpg for overview pic?

brave jungle
#

png or paa

#

It must be base 2

#

1024 x 512

#

2048 x 1024

#

etc

#

or

#

1024 x 1024

lucid junco
#

im using jpg for loadingscreen and its work.

lucid junco
#

ok ill use png

brave jungle
#

It's not recommended

#

imo

lucid junco
#

path to the picture? pic.png or /pic.png? ๐Ÿ˜„

brave jungle
#

just pic.png

lucid junco
#

ok

hollow lake
#

Sup boiz. Past two days I was trying to to create a static camera that would transfer video feed to a monitor. I am really stuck now. Was trying to use r2t. Keep in mind that I aint any script god, more of a "beginner". Looking for any kind of help q-p
[Feel free to ping me]

lucid junco
#

class ScenarioData
{
author="Prababicka";
overviewText="Prdel";
overViewPicture="over.png";
onLoadMission="prdel";
loadScreen="loadscr.png";
};

#

where is the problem

#

from mission.sqm

brave jungle
#

What does it do

#

what error does it produce

lucid junco
#

now it says cannot load both png

brave jungle
#

Check aspect ratio

lucid junco
#

"cannot load loadscr.png."

brave jungle
#

1:1
2:1

#

also

#

try a paa

lucid junco
#

why is that last dot in error message?

brave jungle
#

use A3 tools and ImageToPAA

lucid junco
#

yea will try

brave jungle
#

end of error message

#

edit it in paint

#

resize to 1024 x 512

#

then use image to paa

lucid junco
#

but why even tittle of missiondont show up

brave jungle
#

convert and apply

lucid junco
#

have proper res of images

#

1024x512

brave jungle
#

This while in preview of mission file?

lucid junco
#

and 2048x1024

#

just after loadscreen finish

brave jungle
#

Is it in preview in the editor

lucid junco
#

it shown when i was trying to go mission from scenerios, not in editor

brave jungle
#

and in the editor it says?

lucid junco
#

it shown few times but not always in editor

#

same error

brave jungle
#

I'd suggest using description.ext

#

and then doing it all there

#

But i've never had this issue

lucid junco
#

it was first what ive tried ๐Ÿ˜•

steady egret
#

just a quick question is there a way to access equipment storage using scripts ie have a addaction on a crate that allows a player to customize what is inside of it rather than dragging items in and out of it
iam well aware of the commands that add/remove items from a crate

lucid junco
#

@brave jungle so problem is in SP mission export or what. From steam its working fine. Except overview picture. I have got only default Arma workshop image there. ๐Ÿ˜•

meager granite
#

@steady egret You can script it, no ready solution (unless you search on forums\armaholic but unlikely you'll find exactly what you need)

steady egret
#

@meager granite i mean there is no way to execute a local bis fnc or something to that nature that opens the equipment storage like in zeus or eden

outer fjord
#

So I been using something like this to swap camo for vehicles as they spawn in.
_vehicle setObjectTexture [0, "A3\armor_f_tank\lt_01\data\lt_01_main_olive_co.paa"
Is there a way to use TextureSources instead to make it a bit cleaner?

meager granite
#

[_vehicle, "color"] call BIS_fnc_initVehicle;

manic bane
#

In that case,
[_targetvehicle,["Indep_Olive",1],nil,nil] call BIS_fnc_initVehicle;
Your vehicle is AWC Nyx, isn't it?

#

If you don't like AAF camo net on your olive AWC,
_targetvehicle setObjectTextureGlobal [2, "A3\Armor_F\Data\camonet_NATO_Green_CO.paa"];

frigid raven
#

I have a RscPicture and want to give assign it a picture path through dialog logic. I actually only found ways to set images by setText. Is this the proper way even for a RscPicture Dialog?

winter rose
#

I think so yes

signal pulsar
#
if(_vehObj isKindOf "Air") then {
};
#

is this how i would call all air vehicles?

still forum
#

should work yeah

signal pulsar
#

want to add a universal thing for all air vehicles to add flares

#

im too lazy to go through spawn em all and see which come with flares by default.

#

but poeple want flares so

#

llike does anyone know if the pawnee or LB has flares by default?

unborn ether
#

@signal pulsar You can add any weapon to your vehicle by using addWeaponTurret so basically a bus can have flares.

#

Also AFAIR addWeapon does the same with vehicles.

signal pulsar
#

well yeah i knew that part i just hd questions about the first part

#
    _vehObj removeWeaponTurret    ["M134_minigun",[-1]];๏ปฟ
    _vehObj removeMagazinesTurret ["5000Rnd_762x51_Belt",[-1]];```
#

something like that

#

and adding

#

@unborn ether one thing u might be able to answer is would flares still be considered a turret?

unborn ether
#

Turret by meanings of this game is basically vehicle "hands". Driver has a turret, that turret might have 2-3 guns in it. This mainly seen when tank commander can switch between HMG and countermeasures, same as helicopters.

signal pulsar
#

im lost that made no sense.

unborn ether
#

If it makes no sense - ยฏ_(ใƒ„)_/ยฏ
Ask anyone else then.

#

@frigid raven ctrlSetText will set a picture for RscPicture controls.

frigid raven
#

Yea just found out thanks dude

signal pulsar
#

i guess i should say your wording

#

gave me aids

#

but i think i understood

#

properly

carmine abyss
#

How would I define functions that all have the ability to call on eachother? I have 3 functions listed in my init.sqf If i try to call function1 which has a call for function2 i get a script error saying it function2 undefined variable. I thought functions were read and kept in memory?

still forum
#

first define them all before you call the first one

#

func1 = {call func2};
call func1; //func2 is undefined
func2 = {}; //define func2 now.

Obviously not gonna work like that.

#

Also you should be using CfgFunctions

carmine abyss
#

i have sqf function1 = {call function2}; function2 = {call function1}; function3 = {call function1}; [] call function1;

still forum
#

that will work like you wrote it

#

function2 is a variable. That will be resolved once the code in function1 is executing

carmine abyss
#

hmm well its not working. must be another problem then.

languid tundra
#

What about the circular dependency?

still forum
#

oh. yeah. That will crash your game ^^

#

But that's probably just for example pseudocode's sake ๐Ÿ˜„

#

btw "recursion" is what that's called

languid tundra
#

Yeah, I knew I got the wrong term, but forgot how it's called ๐Ÿ˜„

carmine abyss
#

when i try to [] call function1; i get undefined variable in expression function1;

still forum
#

no idea what weird thing you are doing there

#

functions are variables. They are stored in missionNamespace.
If you define them before using them, they will be defined, unless something else thought it's funny to just set them to nil after they were defined

languid tundra
#

The original code would probably help more here. Could be even a misspelling or whatever.

#

For a conceptual point of view it looks fine except for the recursion.

carmine abyss
#

ok i'll check the code again. probably some dumb mistake

#

found it. missing one } and wasnt getting my a script error, so everything below it was getting defined.

languid tundra
#

Oh well, back when I didn't use validators, these kind of undetected errors drove me crazy ๐Ÿ˜„

frigid raven
#

I want to have my button be invisible. No hovering or selection color. I tried the following

   class mod_Login_Profile_3_Overlay: RscButton
   {
       idc = 1230;
       x = 0.685589 * safezoneW + safezoneX;
       y = 0.224877 * safezoneH + safezoneY;
       w = 0.159813 * safezoneW;
       h = 0.385172 * safezoneH;
       colorBackground[] = {0,0,0,0,1}; // and  {0,0,0,0,0}
       colorBackground2[] = {0,0,0,0,1}; // and {0,0,0,0,0}
   };

But it still keeps being black when selecting and blinking black when hovering. And white when idle/unfocused. I thought the last data of the array would be the alpha value - but it does not seem to be functional being 0 or 1

languid tundra
#

It's RGBA, thus only expects 4 elements.

#

Also would check the values in the in-game config viewer to verify that they are set correctly.

proven crystal
#

is there a way to give AI units in player groups the Unit patch of their leader?

#

i mean the arma unit patch

frigid raven
#

@languid tundra thx buddy not it works fine

frigid raven
#

Again with the Dialog stuff. Driving me crazy. Following this https://community.bistudio.com/wiki/DialogControls-Buttons I set colorBackgroundActive to being invisible. Still when hovering over the button it is blinking whitish. Any further ideas? Was something added here but not documented? I found animTextureOver = "\My_addonpath\my_button_over_ca.paa"; but this only accepts a path to a image I assume

   class Mod_Login_Profile_3_Overlay: RscButtonMenu
   {
       idc = 1230;
       x = 0.685589 * safezoneW + safezoneX;
       y = 0.224877 * safezoneH + safezoneY;
       w = 0.159813 * safezoneW;
       h = 0.385172 * safezoneH;
       colorBackgroundActive[] = {0,0,0,0};
       color[] = {0,0,0,0};
       color2[] = {0,0,0,0};
       colorBackground[] = {0,0,0,0};
       colorBackground2[] = {0,0,0,0};
   };

As you can see I tried every option already

copper raven
#

colorFocused is perhaps what youโ€™re looking for?

frigid raven
#

nah did not helped either

#

thx anyway - did not knew bout that one

brave jungle
#

Have you tried going to no image?

#

What about colorActive

#

or blinkingPeriod

#

perhaps set that to 99999999

#

wrong control

#

try colorFocused

#

Try adding a style too?

#

Hope it helps ๐Ÿคท ๐Ÿ˜„

frigid raven
#

What u mean by a style?

brave jungle
#

You could give type = "CT_ACTIVETEXT"; a try and then use what I crossed out

#

I meant type


#

@lucid junco Make sure the workshop page has an image, otherwise you wont see it ๐Ÿ˜„

lucid junco
#

yes, already found out ๐Ÿ˜„ lol

#

all working now ๐Ÿ˜ƒ

brave jungle
#

Good to hear ๐Ÿ˜„

meager granite
#

I wonder how do you make unit do "Scan horizon" action through script?

austere granite
#

probably a doWatch/lookAt loop with positions and/or an object that you would move

#

i use something like ```sqf
// -- Look at a couple different positions
[{
(_this select 0) params ["_unit", "_count"];

private _position = _unit getPos [random 100 + 50, random 360];
_unit doWatch objNull;
_unit doWatch _position;
_unit lookAt _position;

_count = _count - 1;
if (_count <= 0) then {
    [(_this select 1)] call CFUNC(removePerFrameHandler);
    (group _unit) setVariable [QSVAR(TaskTimeout), nil];
    _unit removeWeapon __CLASS;
    _unit doWatch objNull;
    _unit lookAt objNull;
} else {
    _args set [1, _count];
};

}, 5, [_unit, 3], true] call CFUNC(addPerFrameHandler);

meager granite
#

I was looking for that AI action specifically, if its accessible for player it should be somehow accessible from script

meager granite
#

Looks like its not possible

brave jungle
#

There a good way of working out if an element of an array is [x,y,z] or an object?

#

using BIS_fnc_taskDestination

#

returns [x,y,z], or [object,precision]

still forum
#

_isObject = (_array select 0) isEqualType objNull

brave jungle
#

Cheers

frigid raven
#

I have some data that can/should be extended/configured by a mod user. I would create a userconfig.hpp in the mod-root path and include this file in the specific .sqf script. Is this a good approach? The only problem I see is when this userconfig.hpp file is missing the mod won't run because it can not resolve the #include

still forum
#

if the file doesn't exist the mod will crash your game

#

plus people need to manually set the filePatchingEnabled parameter which also requires filePatching to be allowed on the server else they cannot play on any server

brave jungle
#

Getting an error:
_pos = _taskPositions |#| select _i; Error select Type Number, expected Array

_taskPos = _x call BIS_fnc_taskDestination;

_taskPositions =[];
_taskPositions = _taskPositions pushback _taskPos;

for "_i" from 1 to _TaskTotal step 1 do
{
    _finalPos = [];
    _pos = _taskPositions select _i;
    /* check position type - [x,y,z], or [object,precision] */
    _isObject = _pos isEqualType objNull;
    If (_isObject isEqualTo True) then {
        //getPos and convert to [x,y,z]
        _NewPos = getPos _pos;
        _finalPos = _finalPos pushback _newPos;
    } else {
        //leave pos as it is and add to final array
        _finalPos = _finalPos pushback _pos;
    };
frigid raven
#

@still forum any idea for a solution? I already use editor modules for small configurations. But I am left with a configuration of an array of weapon config names and have not found a way to make this happen in the editor anyhow

#

_taskPositions pushback _taskPos; without the reassignment is what you want I think

brave jungle
#

i'll give it a go

frigid raven
#

gl ๐Ÿ˜‰

brave jungle
#

๐Ÿ˜„

#

Think it's worked, it's got further so I guess so ๐Ÿ˜„

#

ty

frigid raven
#

np

#

One thing: _taskPositions =[]; You are always reassigning an empty array to _taskPositions. Therefore the pushback is rather useless since it will always be only the one value you assign to the array.

You could just use _taskPos instead of _pos therefore. You know what I mean?

brave jungle
#

I just threw it in there without looking, just so it was there when I compressed it all

frigid raven
#

ah ok then nvm what I said

brave jungle
#

I can't work out what i'm doing here tho xD

#

Append or pushback for adding arrays?

#

Need to combine to one array for later use

#

Example final:
[[1,1,1],[2,2,2],[3,3,3]]

still forum
#

@brave jungle _taskPositions = _taskPositions pushback _taskPos; pushBack returns the index of the new element. Which is a number

#

@frigid raven easiest way would be to use CBA settings

#

@brave jungle If (_isObject isEqualTo True) then { That line is nonsense. comparing to true is the same as just doing nothing
if (_isObject) then { is the same as what you are doing

#

append appends the content of an array. pushBack appends a value

#

You should really use the private keyword instead of private array

brave jungle
#

So i'm probs wanting append instead aren't I

still forum
#

I don't know. Still reading the code

#

why are you using for _i from to step loop... If you already have the taskPositions array that you could just iterate through?

#

Also your isEqualType check there will never work

brave jungle
#

It threw an error

#

can't remember what error it was tho

still forum
#
{
    private _pos = if ((_x select 0) isEqualType objNull) then {
        //getPos and convert to [x,y,z]
        getPos (_x select 0)
    } else {
        //leave pos as it is and add to final array
        _x
    };

    //setup custom mission using final data
    _newMission = [
        _pos, 
        {systemChat format ["%1, you can't use this feature!",name ((_this # 9) # 0)]},
        _taskTitles select _forEachIndex,
        _taskDescriptions select _forEachIndex,
        "Task State: " + _taskStates select _forEachIndex,
        "",
        0,
        [player]
    ];
    _missionData pushback _newMission;
} forEach _taskPositions;
#

You never even use finalPos besides that one value that you just pushed into it

#

You are using an array, and storing all positions, although you only need a single one every time. Why?

brave jungle
#

I just wanted to centralize it into one array to begin with, but I can see that was just making this more difficult and didn't make much sense

#

short: idk

still forum
#

Also why the seperate arrays for _taskStates and _taskPositions and such. They are only used to generate the missionData later on. Why not retrieve that stuff directly where you generate the missionData? Makes the code like 3x smaller

brave jungle
#

same reason as above

still forum
#
{
    private _taskInfo = _x call BIS_fnc_taskDescription; //return ["description", "title", "marker"]
    private _taskPos = _x call BIS_fnc_taskDestination; //return  [x,y,z], or [object,precision]
    private _taskState = _x call BIS_fnc_taskState;
 
    private _taskDescription = _taskInfo select 0; //Isolate Description
    private _taskTitle = _taskInfo select 1; //Isolate Title


    //If taskPos is a object, resolve it to a position.
    if ((_taskPos select 0) isEqualType objNull) then {
        //getPos and convert to [x,y,z]
        _taskPos =  getPos (_taskPos select 0);
    };

    //setup custom mission using final data
    _newMission = [
        _taskPos, 
        {systemChat format ["%1, you can't use this feature!",name ((_this # 9) # 0)]},
        _taskTitle,
        _taskDescription,
        "Task State: " + _taskState,
        "",
        0,
        [player]
    ];
    _missionData pushback _newMission;
} forEach _allTasks;

Here. Now you can get rid of all these temp arrays like taskTitles taskDescriptions taskPositions taskStates

brave jungle
#

Thank you ๐Ÿ˜ƒ

#

Much smaller ๐Ÿ˜„

still forum
#

btw _pictureMap is undefined. You probably meant _loadingPicture?

brave jungle
#

just fixed that error yeah

still forum
brave jungle
#

yeah ๐Ÿ˜…

frigid raven
#

๐Ÿ˜

brave jungle
#

Well that looks goofy :c

still forum
#

Correct

#

You are setting the _time variable in a lower scope, and it goes out of scope and is gone

#

Change
if ( (_sunEval <= 6) or (_sunEval >=21) ) then { _time = 1; } else { _time = 0; };
to
private _time = [0, 1] select ((_sunEval <= 6) or (_sunEval >=21));

brave jungle
#

ty ๐Ÿ˜„

still forum
#

yes. many of such

#

Wow.. Don't say yes to that guy, you'll get a friend request and PM spam

brave jungle
#

xD

ruby breach
#

Best part is he doesn't even specify what sort of framework

still forum
#

yeah. That's why I answered truthfully

delicate lotus
#

what is the best way to remove a random element from an array?
This?

_array = _array - [selectRandom _array];
ruby breach
#

deleteAt

still forum
#

_array deleteAt (floor random count _array)

#

probably that

delicate lotus
#

wow. Now I feel stupid for not having found deleteAt in my first search ๐Ÿคฆ

#

thanks for the help ^^

still forum
#

@open vigil ^
Yeah.. It's only 4 now as you deleted most of them :u

winter rose
#

@still forum he's โœ”แต›แต‰สณแถฆแถ แถฆแต‰แตˆ you know โ˜๏ธ

brave jungle
#

xD

winter rose
#

@placid smelt but seriously, no insults. I warn you before an admin comes by and kick/ban you for that (edit is an option)

tough abyss
#

Is this the place to ask for help with scripts? Im looking for an improved autopilot to help with jet formation flight so settings like heading, altittute, speed, etc.

proven crystal
#

sounds ambitious... formation flight

#

i think youd have to keep all three axis in algnment and speed

languid tundra
#

It definitely is. The most control you would have by designing the flight trajectory yourself, which requires quite some math and scripting. The command I would recommend is setVelocityTransformation.

proven crystal
#

i already have issues getting rockets pointing in the right direction. so for the moment they just come down at 90 degrees

#

i think the best ill be able to do is a 45degree angle for incloming rockets. that sort of makes the math easy... simlar distance and altitude from where its supposed to hit

#

but calculationg the directions from one point to some random other coordinate is probably part of quantum physics

languid tundra
#

You are not working on a scale where quantum physics is relevant ๐Ÿ˜‚

proven crystal
#

and in a rocket i wouldt even have to account for rolling

#

it appears to be similarly far away. quantum physics and calculating pitch/roll/yaw correctly

brave jungle
#

nice

#

xD

proven crystal
#

it would be very nice to have a functin tha at elast can set pitch and general direction

#

whats up with my typing today

#

worse than usual

winter rose
#

@proven crystal setVectorDirAndUp?

proven crystal
#

well yea thats the function probably but not intuitive. its where quantum physics begins

#

also there are several cosinusses and sinusses involved

#

thats where i begin to consider it high science

languid tundra
#

I modelled flight trajectories for the Achilles CAS module. If you want to get vectDir and vectUp from dir, pitch & bank, have a look at Achilles_fnc_vectDirUpFromDirPitchBank.

winter rose
#

@proven crystal me too, me tooโ€ฆ

proven crystal
#

uh that fucntion looks very useful indeed

languid tundra
#

I mean if there is a real interest in such a function, I could port it to CBA, such that Achilles is not required.

proven crystal
#

but it wont gve me the required pitch between two 3d positions does it?

#

i think having some functions t calculate flight in handy ways might be appreciated by some (me)

#

although i wouldnt do much with it. just angeling rocket artillery ^^

#

but flight formations do sound nice to have if someone can figure it out

#

but i think even small sync issues might result in flawed flight paths.

languid tundra
#

Not if you ensure that orientation of all jets are updated in the same frame.

#

unscheduled should do that for you

proven crystal
#

just saying that it sounds sensitive to small issues. id like to see formations. even if its just for show

languid tundra
#

Although I've seen ppl doing it with the easier route via attachTo ๐Ÿ˜„

brave jungle
#

If I were to add a multikey bind for an action, am I right in thinking it's just a check for both keys or is there a separate system for that?

proven crystal
#

huh never tought of that. attach planes to each other with the right offset should do indeed ^^

still forum
#

@brave jungle both keys combined should be

brave jungle
#

Cool

proven crystal
#

@languid tundra i use

private _y = 0; 
private _p = -90; 
private _r = 0; 
private _vector = [ 
    [ sin _y * cos _p,cos _y * cos _p,sin _p], 
    [ [ sin _r,-sin _p,cos _r * cos _p], -_y] call BIS_fnc_rotateVector2D 
];
#

which produces a vector for setVectorDirAndUp

#

i dont know how it does it, but it does it well

#

so atm, i let stuff point 90 degrees down, but what i cant seem to figure out would be how to calculate the required angeles to hit a target position from a launch position

#

if i use a distance = altitude, that will allow me a 45 degree angle for a rocket i guess, but id like some variation and who knows what else it might be useful for

#

i guess yaw and pitch from-to should be somehow possible. and for roll, just maybe use same roll as target....

#

or leave as it comes when spawned... shouldnt matter for rockets at least

languid tundra
#

I would work with dir and pitch. Dir is constant and is the direction where the target is. Pitch can be determined from a model trajectory that is interpolated between the two points.

brave jungle
#

with CBA_Settings_fnc_init is it always _value? just making sure

still forum
#

_value? where?

proven crystal
#

well yea something to calculate the pitch would be enough for a my purposes

brave jungle
#

The example:

[
    "Commy_ViewDistance", // Internal setting name, should always contain a tag! This will be the global variable which takes the value of the setting.
    "SLIDER", // setting type
    "View Distance", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
    "My Mission Settings", // Pretty name of the category where the setting can be found. Can be stringtable entry.
    [200, 15000, 5000, 0], // data for this setting: [min, max, default, number of shown trailing decimals]
    nil, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
    {  
        params ["_value"];
        setViewDistance _value;
    } // function that will be executed once on mission start and every time the setting is changed.
] call CBA_Settings_fnc_init;```
proven crystal
#

its probably simple geometry but as soon as cosinus comes to play im out ^^

still forum
#

but you use params to pull the arguments out and give them a name

proven crystal
#

although i rellay looked into it but i cant seem to make it work

brave jungle
#

oh right

#

hahahaha

#

mb

#

xD

languid tundra
#

@proven crystal
You can PM if you want. Would like to help with a trajectory ๐Ÿ˜‰

proven crystal
#

roger im just looking for the piece of code where i tried

tame lion
#

is there a way to get/set what a missle is locked onto once it is fired?

frigid raven
#

I have a editor module which accepts an array as configuration option. The value might look like this ["arifle_MXC_F",1,"MXC F","This weapon is pretty cool"]. There are some problems with that.
In my module init function I want to parse this STRING to an ARRAY. There am using parseSimpleArray. This command however is very senstive in with its input data. My above mentioned array string is not allowed to have any whitespaces.
I was not yet able to find any trimWhitespaces function coming from BIS and there asking if anybody knows how to approach this the best? Is there another way to parse an array out of a string OR a whitespace trimming functions?

tame lion
#

my suggestion: replace all your " " with ":" or "_". Then use splitstring/joinstring once you need to break down that array into the string elements

#

if I'm understanding what you are trying to do properly

tough abyss
#

I encountered error zero divisor on my script...
nul = [this,"LIMITED","SAFE","wp_1"] execVM "scripts\randomvehicle.sqf";

private ["_unit", "_wpspeed", "_wpbehaviour", "_wp1marker", "_wp2marker", "_wp2type"];

if (!isserver) exitwith {};

_unit         = _this select 0;

_wpspeed     = _this select 1;
_wpbehaviour = _this select 2;
_wp1marker     = _this select 3;
_wp2marker     = _this select 4;
_wp2type     = _this select 5;
/*
 error at #here
_wp2type     = _this #select 5;
*/

_wp1active = true;
_wp2active = true;

//disable if no waypoints
if (isnil ("_wp1marker")) then {_wp1active = false};
if (isnil ("_wp2marker")) then {_wp2active = false};

//placeholders
if (isnil ("_wp2type")) then {_wp2type = "MOVE"};

_rnd = 0;
_wp1 = 0;
_wp2 = 0;
_gr = 0;

//placeholders for vehicle
_vehicletype = "C_Hatchback_01_F";

//vehicles
_rnd_vehicletype = [
"C_Hatchback_01_F", 
"C_SUV_01_F"
];

_vehicletype = _rnd_vehicletype select (floor (random(count _rnd_vehicletype)));

_targetpos = getpos _unit;
_dir = getdir _unit;

_civvehicle = createvehicle [_vehicletype,[(_targetpos select 0), (_targetpos select 1), 0.15],[],5,"none"];
_civvehicle setdir _dir;

_unit assignasdriver _civvehicle;
[_unit] ordergetin true;

_gr = group _unit;

if (_wp1active) then {
    _rnd = (floor(random 9000));
    _wp1 = _rnd;
    _wp1 = _gr addwaypoint [getmarkerpos _wp1marker,0];
    _wp1 setwaypointtype "MOVE";
    _wp1 setwaypointspeed _wpspeed;
    _wp1 setwaypointbehaviour _wpbehaviour;
};

if (_wp2active) then{
    _wp2 = _rnd + 1;
    _wp2 = _gr addwaypoint [getmarkerpos _wp2marker,0];
    _wp2 setwaypointtype _wp2type;
    _wp2 setwaypointspeed "UNCHANGED";
    _wp2 setwaypointbehaviour "UNCHANGED";
};
#

did someone know how to fix?

still forum
#

_this select 5; you are trying to get the 6th element.. But you are only passing 4...

ruby breach
#

^

#

Also, params

frigid raven
#

@tame lion I want to leave a little error buffer for users typing the array ["arifle_MXC_F",1,"MXC F","This weapon is pretty cool"] so they do not strictly keep it whitespace free.

ruby breach
#

And then you can scrap the crap like ```sqf
//disable if no waypoints
if (isnil ("_wp1marker")) then {_wp1active = false};
if (isnil ("_wp2marker")) then {_wp2active = false};

still forum
#

maybe just call compile then? @frigid raven that sounds like a sensible usecase for it.
Though that will execute any script that's pasted in there

tough abyss
#

thankyou guys I'll try fix em

slim oyster
#

Is there an eventhandler for clothing changes? eg. When a player changes their helmet or uniform. Thanks

ruby breach
#

There are take/put EVHs, but not one for clothingChanged

frigid raven
#

@still forum wow that doesn't sound that nice ^^

still forum
#

@slim oyster do you have CBA?

slim oyster
#

Yes, is there an extended EH?

still forum
#

No

#

But a playerEH

slim oyster
#

Ah perfect based on UI change, so I can do my checks then, that will save tons of performance. Cheers!

languid tundra
frigid raven
#

I am good with call compile for now tbh ๐Ÿ˜›

#

thx anyway!

tough abyss
#

I CAN'T UNDERSTAND params ๐Ÿ˜ญ
I want to run this, on single script. both waypoint settings.
nul = [this,"LIMITED","SAFE","wp_1"] execVM "scripts\randomvehicle.sqf"; nul = [this,"LIMITED","SAFE","wp_1","wp_2","MOVE"] execVM "scripts\randomvehicle.sqf";

ps. I did my self.๐Ÿ˜ but not smart.
nul = [this,"LIMITED","SAFE",["wp_1","wp_2","MOVE"]] execVM "scripts\randomvehicle.sqf";
or
nul = [this,"LIMITED","SAFE",["wp_1"]] execVM "scripts\randomvehicle.sqf";

//~~~~~~
_unit         = _this select 0;

_wpspeed     = _this select 1;
_wpbehaviour = _this select 2;
_wpmarkers     = _this select 3;
if (count _wpmarkers >= 0) then {};
if (count _wpmarkers >= 1) then {
_wp1marker = _wpmarkers select 0;
};
if (count _wpmarkers >= 2) then {
_wp2marker = _wpmarkers select 1;
};
if (count _wpmarkers >= 3) then {
_wp2type = _wpmarkers select 2;
};
//........
frigid raven
#

https://community.bistudio.com/wiki/lbAdd
Is there a way to have lbAdd a value for display and one for an id? Because I can give it a item name but in my logic I need a config name of the item but that would look ugly in the dialog menu itself as list box selection

peak plover
#
<ctrl> setVariable
#

or ```sqf
lbSetData

#

might be easier

frigid raven
#

yea found it out with lbSetData

#

lifesaver thingie

#

otherwise I would've hacked the sh** outta my scripts

astral dawn
#

breaking news Although arrays are passed by reference, we can't assign an array element to its reference :/

languid tundra
#

What do you mean? Any particular example?

astral dawn
#
_a = [1, 2];
_a set [1, _a];
languid tundra
#

This works, but I see what you mean

_a = [1, 2];
_a set [1, +_a];
#

What you essentially do is an infinite recursion, not sure why you would want to do such a thing ๐Ÿ˜„

astral dawn
#

Yes I know, but I assumed that I can treat arrays as pointers to arrays without restrictions

#

There is an array, and it has inside it a pointer to another array, who cares even if it's the same array,right? Except that str _array might eat all the memory...

languid tundra
#

It's funny that when I tried your case in Python, it actually works. Also looks funny:

>>> a=[1,2]
>>> a[1]=a
>>> a
[1, [...]]

>>> a[1][0]
1
>>> a[1][1]
[1, [...]]
#

I see the behaviour as intended. You either allow such an infinite recursion or you don't. SQF obviously doesn't.

still forum
#

you can put an array into itself, crashes the game

#

No idea why it wouldn't work in your test, but it's definitely possible with pushBack

hollow lantern
#

whats an efficient way to check a whole map for game logics? I know that the side sideLogic exisist but this also includes modules

still forum
#

just filter out the modules?

hollow lantern