#arma3_scripting
1 messages ยท Page 503 of 1
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
I'm looking to integrate support modules into Warlords @peak plover
aah
Whereโs private keyword at ๐ฆ
It should show up in the mission on the right hand side nor on the 0-8 action.
But it doesn't...
Here's the mission, but updated: https://github.com/AxeriusNetwork/EC-Public/tree/master/EpsilonWarlords.Altis Note that it still doesn't work. However all the information is pasted through and no errors popping up. File reference: https://github.com/AxeriusNetwork/EC-Public/blob/master/EpsilonWarlords.Altis/CORE/fn_supportBuy.sqf
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.
@slow elbow the format function has this limit. Are you sure that what you see is the copyToClipboard limit instead of format limit?
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
@lament grotto PM me the file
@lament grotto it's usually due to an additional }
Yeah, I just cant find the damned thing
that is stuff, that SQF-VM also should be able to find with ease ๐ค
or ... not Oo
though ... fixed now
@drowsy axle sorry for delay, how doesnโt it work exactly? Do the system chats show what you expect
//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?
Thanks for the help, as usual @still forum .
That first link is old code check out: https://github.com/AxeriusNetwork/EC-Public/commit/a91a74664f42757bd38bc5cf702a36f93f1d3dc5
Sorted that out: ```sqf
params ["_caller","_cost","_support"];
systemChat format["%1",_caller];
systemChat format["%1",_cost];
systemChat format["%1",_support];```
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
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.
why format there?
private _text = format["Transport Created!"]; that format is useless. you are not formatting anything there
https://github.com/AxeriusNetwork/EC-Public/blob/master/EpsilonWarlords.Altis/CORE/fn_supportBuy.sqf#L215 that variable there seems also useless
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
https://github.com/AxeriusNetwork/EC-Public/blob/master/EpsilonWarlords.Altis/CORE/fn_supportBuy.sqf#L201 trick for that.
setVariable _x as _x is already an array of two elements. You don't need to unpack and repack it
Okay.
So what exactly doesn't seem to work in that code?
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.
have you tried adding systemChat's like.. before line 44 and after line 44. And after line 47. And before 59 ?
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.
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";
Post your code
Syntax is
array execVM string or code
Don't know why you have "init" there
hmm
ok, in that case I have to look for how switches are evaluated
_execution = _this; but params [["_dist",50,[1]],["_center",player,[objNull]]];
so
_execution = [500,initCenter]
because a simple "<casename>" usually worked :/
_execution = _this
_this is the array of params not a string
Your third parameter "init" isn't getting passed for obvious reasons
I am not that great at scripting so its not that obvious to me :/
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
};
};
You see how 500 and initCenter are passed to execVM? Those are where your passed values go
Dusin has the idea
lol
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
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
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
that means u need it every time functions is called. So use the first variant
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
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
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
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 .
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
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?
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
alright, thanks man
Is there a limit to the amount of memory arma 3 uses now? I know it was effectively 4GB before the 64 bit update
Don't think so. Only use maxMem launch param for limiting memory
Otherwise, engine uses as much as possible
Thanks again for your help guys, worked great
:+1:
If I wanted to get an array of all Anti-Air on the map, would I use "map listObjects type" ?
Anyone have a way of converting an array of class names into an array of Display names?
_classes apply {getText(configFile >> "CfgVehicles" >> _x >> "displayName")}
@high marsh Syntax is array execVM string or code no it's not. https://community.bistudio.com/wiki/execVM
It's ANY execVM STRING
Awesome ty
any scripters on right now i can DM need help with a issue
You can ask here? What is your issue @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
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?
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
But if you put it here, all of the smart people can see and help ๐
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^
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
https://community.bistudio.com/wiki/cutRsc did you read that?
Display a resource defined in RscTitles
"Display a resource defined in RscTitles"
class RscTitles {
class GoA_Logo {...};
};
its intro
What does missionConfigFile >> "RscTitles" >> "intro" return in debug console?
@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. ๐ค
@still forum Correct. Thanks for correcting me.
@broken thistle did you message people in here for help?
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
Quick question in regards to allPlayers
{
if (_x alive) then {
_justPlayersAlive pushBack _x;
};
} forEach (allPlayers - entities "HeadlessClient_F");
Will this code properly put all alive players into the _justPlayersAlive array
Ah cheers man
It might.. But why so complicated
Also I hate so many of those commands are looking for params on one side compared to the other
Select
_alivePlayers = allPlayers select {isPlayer _x && isAlive _x}
do you even need to filter out the HC? HC's are in allPlayers?
Because it's going to be evaluating in a context where I need to verify if the client is not headless
They are
if isPlayer returns true for them you want to remove them in my code too
Or add a isKindOf to the condition
the isKindOf would look for "HeadlessClient_F" correct?
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.
This is being made into a function which will be called as needed
So in it's implementation I'll be fine.
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.
configFile >> "CfgWeapons" >> "WeaponClass" >> "Entry"
yeah basically what i was looking for ty.
hc are in all players
Also I think the support (airstrike) module is also in allplayers
@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];
Well yeah
>> _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
Well yeah
Well maybe
lol
@still forum sqf _useAddonn = getNumber(missionConfigFile >> "CfgSGFramework" >> "CfgExileAutoMessages" >> "useAutoMessages");
hows that look?
is that like correct format?
nice, figured it out. Thanks @still forum , your'e really coming around.
Is it weird that while I was in the shower I was thinking of how I could make monopoly a thing in arma??
No
Totaly normal
@brave jungle link??
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.
Could be related to https://feedback.bistudio.com/T134636.
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?
@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
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.
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"]
Heโs talking about modules.
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
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.
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
Did you try the module that he mentioned? There is also a guy on feedback tracker with same issue.
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
@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...
@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
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
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
Btw with this thing https://visualstudio.microsoft.com/de/services/live-share/ people that code with VS Code can share their code session live and allow others to view/edit their code live. This may be useful for helping in #arma3_scripting. Giving helpers the ability to directly look at your code.
Here is a example of me sharing stuff with myself between VS Code and Visual studio
https://s.sqf.ovh/Code_2018-12-07_11-14-45.png Both users can edit and see where their cursor is.
advanced pair programming.
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
thanks
I'm live sharing some armake dev in anyone wants to try out.
https://insiders.liveshare.vsengsaas.visualstudio.com/join?02DEAE707ED9F9F5486AF9E1DBE6A4FF5A3A
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
Nice it even supports audio calls and chat.
But only in VS Code. The Visual Studio one doesn't support that yet
Ahh, I can choose who to follow
@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.
That's not a new bug
It is. The old bug was that you got duplicate event handlers.
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
Gonna check MP
Yes, you are right, the module function indeed gets triggered. That complicates matters.
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];
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?
Yeah, I couldn't find anything that doesn't require loops of some sort.
no such thing as intelligence here ๐
_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
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.
It's still the same loops that you thought about using, but inside the engine and thus faster
Thanks! I'll make sure to test it out when I get the chance!
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
_arr arrayIntersect _arr1 -> ["banana"]
so that works too. Dunno which method is faster
๐ค
wtf.
I had in my brain that this doesn't work
I was rereading the question several times thinking I missed something that makes arrayIntersect not applicable here lol
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 ๐
Yeah, I'm tracking. I wasn't thinking about count the whole time..
hey guys. Dont you know why during the night i have NV turned on automatically when i use camera? its future or bug? ๐
future
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]}];
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.
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?
_array = ["test1","test2","test3","test4"];
{
_x = "classname" createVehicle pos;
} foreach _array;
???
The syntax is wrong, that's what it is.
the logic behind this too, why do you define _x in a forEach codeblock?
@languid tundra take a look at setVehicleVarName command
Is that command still a thing? I don't think I've used it anymore.
It is. But not sure if moldisocks wants that command. He asked about setVariable
Nvm, I confused it with setVehicleInit
Do scripting commands get r3moved?
Not even setdammage got removed
@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.
compile format is almost always wrong
in this case too
we told you what you should be doing
"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).
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
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
You are setting 1600 variables? Are you gonna use all of them in some part of the code? ๐
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.
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?
you shoudnt delete from array that you are iterating on.
Well, I know but it's besides the point. Even if I do something like this
} forEach (+_mags);
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.
if you delete while iterating. You'll skip the next element.
Thus every second element if you try to delete each
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
_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]
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
Use an armed one, attachTo a bunch of rocket tubes, and use addWeaponTurret and addMagazineTurret
The wiki pages for those commands give examples. Have a look there first.
allright
How to make an driver AI look a certain position with head (Dowatch/lookat not working)
@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 :/
Try
_ifrit addWeaponTurret ["rockets_Skyfire", [0]];
_ifrit addMagazineTurret ["14Rnd_80mm_rockets",[0]];
[0] is the turretPath for the gunner.
If you're just running it in the debug console while in the vehicle, you should replace _ifrit with vehicle player
ah ok
_ifrit is just an appropriately-named variable
If you use [-1] then the rockets will just shoot straight forward.
@digital hollow vehicle player addWeaponTurret ["rockets_Skyfire", [0]];
vehicle player addMagazineTurret ["14Rnd_80mm_rockets",[0]]; ?
Yeah.
doesnt work buddy
Does the weapon show up in the gunner seat?
nope
there is only an hmg
oh wait
actually yes it works @digital hollow thanx โค
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.
@digital hollow allright thanks for your information
Have fun >=D
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 ?
You can experiment, but it won't be nearly as simple.
hmm allright because when im in a unarmed one the bullet just disappears ๐
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?
what is your definition of "a file" ?
a script?`
yes selectRandom is a thing. and scripts can play sounds
Is there a way I can make some of my player slots whielisted
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
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
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.
Not sure if you can disable collision between soldiers at all
disableCollisionWith is for physx afaik
yeah they are. usually
well you can just loop through allUnits twice and disable collision for all of them
can you point me how to do that pls? im without idea for this ๐
{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
thanks much!
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
?
how do you mean? custom ending?
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
_whitelisted = [uidhere];
if(getPlayerUID player in _whitelisted) then {
if((typeOf player) == "classname") then {
endMission "end1";
};
};
@glad timber see endmission's wiki page, use BIS_fnc_endMission instead โ and you can use whatever name is defined in CfgDebriefing
(iirc)
or what do you mean with character class
thats what I ment, but I can remove endmission and add some other condition. Also thanks for the help
Is ArmaDebugEngine working in the new arma version?
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?
yes
you can get it from the intercept github page under releases. there is a hotfix for 1.86
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. ๐ค
Does manually dumping it with ade_dumpCallstack work?
If you type it in debug console and press F1 does it recognize the command?
no and no ๐ฆ
๐ค oof
I just went to bed. I'll try to fix it tomorrow. Remind me in case I forget
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
Oh... I think the certificates were running out last month. That might be the problem.
Need to resign with new cert
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?
selectPlayer them and double check?
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
just remove the pistol
how have I not thought of that....
god damnit, I blame lack of sleep
cheers, let's try this
yup, that does the trick
Vanilla weapons or mod weapons?
mod
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....
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
Yeah Dedmen you are right, changing system date makes ArmaDebugEngine work again
๐
I'm curious, what part of software has this system date lock?
@astral dawn try these dlls. They should work without time change
https://github.com/dedmen/ArmaDebugEngine/releases/tag/dev1
only the dll's not the zip archive
I think it doesn't work even if I change date
Hopefully I can just change date, launch game, then change it back
I'll make a real fix then
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
ugh.. 32bit build doesn't work. Can't be bothered with that now ^^ x64 has to be enuff
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?
yeah seems like - i'll take a look. But calling the function manually isn't really a fix.
@astral dawn done https://github.com/dedmen/ArmaDebugEngine/releases
I somehow had a broken certificate ยฏ_(ใ)_/ยฏ
\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?
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
Works as usual! Now I can safely make numerous SQF errors, thanks!
Now on workshop too https://steamcommunity.com/workshop/filedetails/?id=1585582292
It needs to have intercept loaded separately doesn't it?
is included
Nice. What exactly is "can also do much more things." :P
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
Oh, yeah the extension I wanted to look at ๐
sqfvm could do that too though ... one needs to implement the endpoints ๐คท
Is there a way i can make a phone system in a life script ? like to call someone ?
But i can't hook sqfvm into existing framework. Easily.
It's possible to script things using scripts if that's what you're trying to ask.. yes.
Mobile phone extension for TFAR ๐ค
I must be the the millionth person to think of it though
Maybe you should become a professional ideas guy
@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.
@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
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
Obviously not
But I doubt that doing that with intercept is a good idea ๐คทโโ๏ธ
Intercept is just used to debug the SQF scripts
SQF VM can't debug scripts while they are running in production though, which is the point
Technically, intercept should neither be able to unless you no longer Pause the Exekution of arma
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
Is it possible to "remove" declared publicVariable?
I thought so too.
yeah that's right, set it to nil
may I ask how publicVariable "pubVar" is set to nil?
pubvar = nil;
publicVariable "pubvar";
I thought of using this: missionNamespace setVariable [name, value, public]
With public flag
and what is with jip players?
well, got me beginner into a sticky situation: which one to use ๐ค
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.
I'm pretty sure both approaches are equivalent
yeah
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
me? cba and ace
just use ACE_Player then
does getPilotCameraPosition gove me the camerapos of where i am maybe?
That's a variable that auto updates when remote controlling units
@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.
Yes, I agree. It has troubled me a lot too and it probably plagues many more mods and missions.
create feedback tracker item about it and throw it at bi devs ๐
You are better of fixing it yourself than waiting for them to fix it at some point ๐
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
Probably should be mentioned in createUnit, since modules placed in Eden or in Zeus are not affected.
I'll add a comment
Does ace_clipboard do what I think it does? (allow you to copyToClipboard while not being in editor/host environment?)
yes
Does init for modules run on the next frame after creating unit?
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
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?
fuck me
Only if you shave ๐
apparently at some point I replaced the CIWS and didn't re-apply the variable name
๐๐ป
@peak plover
I'm not entirely sure. When you set the variables in the vehicle init line, you are on the safe side, but, for instance, my earlier suggested solution for Zeus suffers from a race condition on dedicated servers. https://discordapp.com/channels/105462288051380224/105462984087728128/520611886673428491
just use the ACE set cuffed command thing
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?
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.
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
magazinesAllTurrets?
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
cba has a compatible magazines function
but magazines, not ammotypes
but that's easy to do just a configlookup
Well you can put everything into a single line
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?
_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.
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.
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?
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
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");
When _pictureMap == "" it doesn't grab the correct cfgWorld image, i.e the terrain picture, this case stratis, https://community.bistudio.com/wiki/File:A3_loading_mission.jpg
Instead, it's either black or the loading screen, arma 3 Apex splash screen
do diag_log _picturemap
I tried that last night, it was showing "
*str _picturemap
yeah
then put a diag_log into both of trhe picturemap ifs
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.
This is what pictureMap does atm: https://cdn.discordapp.com/attachments/353125833185165312/521280207307407360/unknown.png
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";
};
without the style, it will skew to fit. I'd like it to do what the default loading screen does, where it loads the terrain in the background and it's zoomed, but I don't where to start, like https://community.bistudio.com/wiki/File:A3_loading_mission.jpg
guys, do i need to add ace actions on clients like normal addaction? or is it a smarter function?
yea but that doesnt really say if i would have to add the actions locally on each client, does it?
it does that for you
how nice of it
i think i got it figured out otherwise. just wanted to check on the locality thing
what does that mean?
the effect of the script is local, so the player that executes it
the arguments you use are global
Want an example?
always helpful.
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
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
I'm not sure
but could be that they yre added one after the other and so only the next player would see issues?
I would presume it is for identification, like how Task IDs work
for scripting purposes
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
one of bugtracker threads.. https://feedback.bistudio.com/T76640
am now seeing a function parameter and a script parameter which is new
@slim verge
Local server: Isnil Paramsarray: false
Dedi server as client: Isnil Paramsarray: true
Just tested it for you.
k thx
Is this the right chat to ask for custom module functions and how they work?
It's somewhat of a feature @slim verge
@peak plover Yea I have more than just medic
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.
you can't
i can't figure out how to google search it otherwise i would have already done so
ah, I figured it was probably a config entry
If you wanna find out how, you could just look into a AIO config
to find the entries
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?
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.
i tryied both ways separately and without succes
and im sure i did not define it both ways at once...... really dont know lol
does it work if you publish it?
dont know... will try
just for sure in which format i should fill the box in eden ? just simple text right?
What do you mean by simple text
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.....
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
is possible to use jpg for overview pic?
im using jpg for loadingscreen and its work.
ok ill use png
path to the picture? pic.png or /pic.png? ๐
just pic.png
ok
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]
class ScenarioData
{
author="Prababicka";
overviewText="Prdel";
overViewPicture="over.png";
onLoadMission="prdel";
loadScreen="loadscr.png";
};
where is the problem
from mission.sqm
now it says cannot load both png
Check aspect ratio
"cannot load loadscr.png."
why is that last dot in error message?
use A3 tools and ImageToPAA
yea will try
end of error message
edit it in paint
resize to 1024 x 512
then use image to paa
but why even tittle of missiondont show up
convert and apply
This while in preview of mission file?
Is it in preview in the editor
it shown when i was trying to go mission from scenerios, not in editor
and in the editor it says?
I'd suggest using description.ext
and then doing it all there
But i've never had this issue
it was first what ive tried ๐
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
@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. ๐
@steady egret You can script it, no ready solution (unless you search on forums\armaholic but unlikely you'll find exactly what you need)
@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
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?
[_vehicle, "color"] call BIS_fnc_initVehicle;
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"];
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?
I think so yes
should work yeah
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?
@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.
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?
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.
im lost that made no sense.
If it makes no sense - ยฏ_(ใ)_/ยฏ
Ask anyone else then.
@frigid raven ctrlSetText will set a picture for RscPicture controls.
Yea just found out thanks dude
i guess i should say your wording
gave me aids
but i think i understood
properly
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?
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
i have sqf function1 = {call function2}; function2 = {call function1}; function3 = {call function1}; [] call function1;
that will work like you wrote it
function2 is a variable. That will be resolved once the code in function1 is executing
hmm well its not working. must be another problem then.
What about the circular dependency?
oh. yeah. That will crash your game ^^
But that's probably just for example pseudocode's sake ๐
btw "recursion" is what that's called
Yeah, I knew I got the wrong term, but forgot how it's called ๐
when i try to [] call function1; i get undefined variable in expression function1;
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
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.
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.
Oh well, back when I didn't use validators, these kind of undetected errors drove me crazy ๐
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
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.
is there a way to give AI units in player groups the Unit patch of their leader?
i mean the arma unit patch
@languid tundra thx buddy not it works fine
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
This is what it still looks like (blinking slowly): https://imgur.com/a/2rGPgCT
colorFocused is perhaps what youโre looking for?
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 ๐คท ๐
What u mean by a style?
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 ๐
Good to hear ๐
I wonder how do you make unit do "Scan horizon" action through script?
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);
I was looking for that AI action specifically, if its accessible for player it should be somehow accessible from script
Looks like its not possible
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]
_isObject = (_array select 0) isEqualType objNull
Cheers
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
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
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;
};
@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
@brave jungle https://community.bistudio.com/wiki/pushBack
pushback is returning a number. You are assigning that return value to _taskPositions and after that u use select on a number type not an array
_taskPositions pushback _taskPos; without the reassignment is what you want I think
i'll give it a go
gl ๐
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?
my actual code: https://pastebin.com/Zz8rs5uh
I just threw it in there without looking, just so it was there when I compressed it all
ah ok then nvm what I said
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]]
@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
So i'm probs wanting append instead aren't I
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
I sent you what you need to do there: https://discordapp.com/channels/105462288051380224/105462984087728128/522000946214076426 but you just cut-off half of it
{
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?
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
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
same reason as above
{
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
btw _pictureMap is undefined. You probably meant _loadingPicture?
just fixed that error yeah
https://gist.github.com/dedmen/b95fae17ce927da1a91fcb82f6d3901e so much smaller ๐
yeah ๐
๐
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));
ty ๐
yes. many of such
Wow.. Don't say yes to that guy, you'll get a friend request and PM spam
xD
Best part is he doesn't even specify what sort of framework
yeah. That's why I answered truthfully
what is the best way to remove a random element from an array?
This?
_array = _array - [selectRandom _array];
deleteAt
wow. Now I feel stupid for not having found deleteAt in my first search ๐คฆ
thanks for the help ^^
@open vigil ^
Yeah.. It's only 4 now as you deleted most of them :u
@still forum he's โแตแตสณแถฆแถ แถฆแตแต you know โ๏ธ
xD
@placid smelt but seriously, no insults. I warn you before an admin comes by and kick/ban you for that (edit is an option)
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.
sounds ambitious... formation flight
i think youd have to keep all three axis in algnment and speed
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.
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
You are not working on a scale where quantum physics is relevant ๐
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
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
@proven crystal setVectorDirAndUp?
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
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.
@proven crystal me too, me tooโฆ
uh that fucntion looks very useful indeed
I mean if there is a real interest in such a function, I could port it to CBA, such that Achilles is not required.
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.
Not if you ensure that orientation of all jets are updated in the same frame.
unscheduled should do that for you
just saying that it sounds sensitive to small issues. id like to see formations. even if its just for show
Although I've seen ppl doing it with the easier route via attachTo ๐
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?
huh never tought of that. attach planes to each other with the right offset should do indeed ^^
@brave jungle both keys combined should be
Cool
@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
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.
with CBA_Settings_fnc_init is it always _value? just making sure
_value? where?
well yea something to calculate the pitch would be enough for a my purposes
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;```
its probably simple geometry but as soon as cosinus comes to play im out ^^
but you use params to pull the arguments out and give them a name
although i rellay looked into it but i cant seem to make it work
@proven crystal
You can PM if you want. Would like to help with a trajectory ๐
roger im just looking for the piece of code where i tried
is there a way to get/set what a missle is locked onto once it is fired?
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?
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
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?
_this select 5; you are trying to get the 6th element.. But you are only passing 4...
@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.
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};
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
thankyou guys I'll try fix em
Is there an eventhandler for clothing changes? eg. When a player changes their helmet or uniform. Thanks
There are take/put EVHs, but not one for clothingChanged
@still forum wow that doesn't sound that nice ^^
@slim oyster do you have CBA?
Yes, is there an extended EH?
No
But a playerEH
https://github.com/CBATeam/CBA_A3/wiki/Player-Events the loadout one
Ah perfect based on UI change, so I can do my checks then, that will save tons of performance. Cheers!
@frigid raven
I wrote an experimental function that does some pre-processing before using parseSimpleArray. It does not yet remove spaces inside quotes, but it could be easily done by a small change in that script.
https://github.com/ArmaAchilles/Achilles/blob/generalizeLoadSaveGUI/%40AresModAchillesExpansion/addons/modules_f_ares/DevTools/functions/fn_stringToArray.sqf
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;
};
//........
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
yea found it out with lbSetData
lifesaver thingie
otherwise I would've hacked the sh** outta my scripts
breaking news Although arrays are passed by reference, we can't assign an array element to its reference :/
What do you mean? Any particular example?
_a = [1, 2];
_a set [1, _a];
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 ๐
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...
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.
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
whats an efficient way to check a whole map for game logics? I know that the side sideLogic exisist but this also includes modules
just filter out the modules?
do you have an example for that? couldn't find an explanation on the wiki. https://community.bistudio.com/wiki/sideLogic is the article i'm reffering to