#arma3_scripting
1 messages Β· Page 389 of 1
There is no overloading.
hmmm shit i see
alright we heres wat im tryna do
so theres a tank,I want it so that whenever its hit,the turret doesnt get damaged. My current solution is a while loop that runs till the tank dies and constantly fixes the turret(thats obv bad cause well.....while loop).
If your code is short you can also just show it to us. If your code is somewhat correct that's easier to understand. I can read code better than I can read humans
XD aye wait 1 sec
_this addEventHandler ["Dammaged", "zbran",0];
pretty sure
im like wrong
like 1000 diffrent ways
but
what is zbran?
the name of the selection
yeah that's not at all how it works
XD
the second argument is a script that get's called when damage happens
oh shit,okay lemme see then
ahhhhh it works
_this addEventHandler ["HandleDamage",{
(_this select 0) setHitPointDamage ["zbran",0]; //the part that I wana heal,also this prob isnt how u comment XD
(_this select 0) setHitIndex [27,0]; // idk set hit to not hit cause y not?
damage (_this select 0)+((_this select 2)/2) //reduce dmg taken by half cause test reasons
}];
hint "test"; //wow a hint
heres the code if u wanted to see XD
He broke rule where are the threats against him
He is not an arrogant idiot.
Still broke a rule
who what?
Even if Iβm an idiot
You already got your 3rd chance. And now you are fucking up again. I don't think you'll get a 4th one. maybe you do.. If you stop now.
If you just want to provoke so you get banned. You'll get what you want. We have people like you every second day... And they are usually gone after a few hours or minutes
whats going on here?
probably someone being an ass π
The Discord has attracted another of the lowest common denominator who has an extremely hard time functioning around other people in a meaningful way ....or what marceldev said ....LOL
Please just ignore. He'll get banned most likely if he argues once more. So please don't provoke him
if i spawn a missile thats capable of locking on, is there a way to make it travel as if it locked onto something?
no
rip π¦
should i bother making some ridiculous direction change script or would that not be feasible
Depends on how good you are.
what i meant was, would the direction change be faster than a jet and actually work
Do you want to kill the jet no matter what?
Because the problem would not be making the missile track. It would be having the missile be influenced by flares and not turn unrealistically quick etc.
the missile leaves the object distance limit so i just cheated with setdamage
Lame. Wait, I'll write something.
lol not necessary unless you really want to
commy_fnc_fireMissile = {
if (!isNil "commy_missile") exitWith {};
params [
["_origin", objNull, [objNull, []], 3],
["_target", objNull, [objNull]]
];
private _type = "M_Titan_AA";
if (_origin isEqualType objNull) then {
private _size = sizeOf typeOf _origin;
_origin = eyePos _origin;
_origin = _origin vectorAdd ((_origin vectorFromTo getPosWorld _target) vectorMultiply _size);
};
commy_missile = _type createVehicle ASLToAGL _origin;
commy_target = _target;
private _fnc_guide = {
private _missile = commy_missile;
private _target = commy_target;
if (isNull _missile) exitWith {
removeMissionEventHandler ["EachFrame", _thisEventHandler];
commy_missile = nil;
};
private _vdir = getPosWorld _missile vectorFromTo getPosWorld _target;
private _vlat = _vdir vectorCrossProduct [0,0,1];
private _vup = _vlat vectorCrossProduct _vdir;
private _speed = vectorMagnitude velocity _missile;
private _vel = _vdir vectorMultiply _speed;
_missile setVectorDirAndUp [_vdir, _vup];
_missile setVelocity _vel;
};
call _fnc_guide;
addMissionEventHandler ["EachFrame", _fnc_guide];
};
[player, heli1] call commy_fnc_fireMissile;
There. A bit longer than what I wanted, but it works.
very nice
Nothing more fun than blowing up aircraft with missiles.
quick question why do you ASLToAGL when you create the missile
Because createVehicle expects AGL.
And vector math has to be done in a flat topology. Only ASL / World is flat.
Careful with createVehicle though. The other syntax expects ATL for canFloat = 0; and AGL for canFloat = 1; vehicles. This version doesn't have this problem.
disableAI "WEAPONAIM";
Error Foreign error: Unknown enum value: "WEAPONAIM"
i never had isue with this, is just a bug form the last update?
//call line
[[_location], "scripts.sqf"] remoteExec ["execVM", 2];
//getting the param
_location = _this select 0;
using this one in several of my scripts and no problems but on this one script it keep saying the variable _location wasnΒ΄t defined, but i did the _this select 0 like on others scripts i wrote...sometiems it works fine 2 or 3 times in a row and then it doesnΒ΄t and the script just halts... any ideas?
its passing a location and on the other script on using that location to spawn in an object
@astral tendon Yes, they tried adding warning for when you use wrong strings (enums), but they messed up and totally legal stuff throws errors.
Still works though.
@little eagle Thanks for the info.
now i also notice that weapons that i put as props on the ground have no magazine in it, is also a bug?
May be intentional.
if the location is a waypoint you need to use quotes
no, its the AO marker that was selected randomly.. see it works fine on others scripts and this one too for like 2 or 3 in a row sometimes non at all
seens like it already have a magazine in it and i cannot add it
sometitmes its fine sometiems its not and i just cant figure this out why its like that on this one script.. tose ae basically the 2 lines of code
im going to work around it by creating a global obj at that location and then grabbing its Pos from the otehr script but i rather not have to
it pleases me best when i can put as much as possible in the local space
it works not but its with the global obj in the mix
Well, seens like a bug, if you place a firearm on the ground in the editor it apears with out magazine and if you in game place the weapon on the ground it apears with a magazine
and also, the firearm on the ground also already come by default with a magazine in it.
ive got a loadout script and it also doesnt place mags in the weapon
i prefer it that way though since the default mag isnt always what i want
You mean, visualy?
because the magazine is catually inside of the gun already, but it does not show on the model
when you place on the editor
not visually, the weapon is unloaded, you have to load it on mission start
i suppose that makes it not a very good script
but you cant also remove the magazine from the gun, othewise it gets invisible in the editor and in game
not sure what you mean
Place a weapon on the ground in the editor and will have no magazine but if you pick it up from the ground it does already have a magazine.
Yes, and it has nothing to do with the server, Quiksilver. Even happens in SP.
I apply this fix to update PhysX and make them fall. I dub it the "poke" method. https://github.com/acemod/ACE3/blob/master/addons/common/functions/fnc_fixFloating.sqf
It has a bit obscured the allowDamage false part, because of compat with other systems using the command.
But you can go back in time and check the older versions.
addForce would be interesting, but that wasn't available back then.
```Tweaked: Toolkit / Medikit that can be now carried in a vest````
but what vest?
so enable damage, setdamage damage, restore hitpointdamage, disable damage
That's basically it.
Here is where it's used. Target event is essentially remoteExec with the box being the target.
So sad I had to laugh myself ... while crying. Couldn't stop.
Yeah, damage has to be reenabled, otherwise it still floats. It's all really weird and fucked up.
No vest in vanila can hold a medikit, neither one in the mod i am running that also got allot of load.
New mines appear every patch.
Yeah, damage has to be reenabled, otherwise it still floats.
Actually it wouldn't. I'd work without that too, because setDamage does work when damage is disabled including this fix.
Things are even worse. setHit/Index is the thing that doesn't work with disabled damage, so I couldn't restore the original state.
And THE FUCKING WIKI CLAIMED IT DOES WORK.
AND THEN I CORRECTED IT.
AND KK REVERTED IT!!!!
sry
π€
@astral tendon Confirmed, vests can't hold medikits or toolkits
Any way to force a smooth transition into animations where your character is lying on a wall?
Dont wanna go with stock ragdoll
not via arenal, not via script, not via picking up the item...
yup, even in the mod i play have more load than the bag i have, its seens like it mean to not be placed that in the first place, like they lock it
the medickit tough seens more lightweigth
or that is just my impression.
is there a way to detect if the player have a especific mod installed?
isClass (configFile >> "CfgPatches" >> "ACE_Main")
Because KK has been doing a lot of shit and everyone thought "He has to be right! he is KK!" And then everyone copied his shit
That was the moment I decided I didn't like him. I like everyone by default unless they give me reasons to no longer do.
I turned when KK gave anyone debug console access on any server and caused chaos for the BI devs
Nah, that was awesome.
And then he had to "fix" it multiple times because he screwed up again
And then he left BI and Arma.
setDir resets a targets velocity (as a bug i think) maybe you can try that
I can't remember trying setDir, but I sure did try a lot.
Wrong section, my bad
Well if you don't mind the state of the hitpoints being all messed up afterwards you can skip it.
But one of the objects draggable in ACE is a lamp. And setHit is used to turn it on and off.
what are some fancy ways to display text to the whole server?
i dont like hints or cuttext so far
// initCounter.sqf
params ["_display"];
private _control = _display ctrlCreate ["RscText", -1];
_control ctrlSetText "splendid";
_control ctrlSetTextColor [0.1,1.0,0.1,1.0];
_control ctrlSetPosition [
safezoneX + safezoneW - 0.2,
safezoneY + 0.0 * safezoneH,
safezoneW * 0.1,
safezoneH * 0.3
];
_control ctrlCommit 0;
MyMission_Counter = [_control];
//To change the text:
(MyMission_Counter select 0) ctrlSetText "hello world";
This is objectively the easiest way.
_display is the mission display, #46
how do i pass in the mission display?
findDisplay 46 ?
what is MyMission_Counter?
The control.
so its just a variable
Yes, You can name it how you like.
safezoneW and H, you multiply those to get 16x9 ratio?
No? I think dividing safezoneW by safezoneH will give you 4/3 though.
@little eagle
MyMission_Counter = [_control];
//To change the text:
(MyMission_Counter select 0) ctrlSetText "hello world";```
?
What's the question, Dscha? You use the last line by any other script of course.
Okay, i was about to say. Wouldn't have made much sense otherwise
No one wants to recreate the control just to hide the text or show a different one. Just use ctrlSetText.
The amount of indents worries me.
The amount of indents should be inversely proportional to the length of the function.
Big dick, small brain?
@little eagle im getting a serialization error from trying to use the display 46
adding disableSerialization; didnt fix it
Show it.
the script?
Yes.
im too embarassed i suck at this
commy2_fnc_displayText = {
params ["_display","_displayText","_timer"];
//EXAMPLE: [(findDisplay 46),"hello\nworld",5] spawn commy2_fnc_displayText;
private _control = _display ctrlCreate ["RscTextMulti", -1];
_control ctrlSetText "hello world";
_control ctrlSetTextColor [1.0,1.0,1.0,1.0]; //white?
_control ctrlSetPosition [
safezoneX + safezoneW - 0.2,
safezoneY + 0.0 * safezoneH,
safezoneW * 0.1,
safezoneH * 0.3
];
_control ctrlCommit 0;
sleep _timer;
_control ctrlSetText "";
//MyMission_Counter = [_control];
//(MyMission_Counter select 0) ctrlSetText "hello\nworld";
};
_display = (findDisplay 46);
[_display,"hello\nworld",5] spawn commy2_fnc_displayText;
```
The last part. Is this init.sqf?
no
the first part is init the last part is from some other script
oh i should add, i do see hello world in the top right of the screen
Change:
_display = (findDisplay 46);
[_display,"hello\nworld",5] spawn commy2_fnc_displayText;
To:
isNil {
_display = (findDisplay 46);
[_display,"hello\nworld",5] call commy2_fnc_displayText;
};
apparently sleep _timer; isnt working
deleteMarker and deleteVehicle are not deleting map markers, what is wrong?
//init.sqf
commy_Counter = [controlNull];
if (hasInterface) then {
0 spawn {
disableSerialization;
waitUntil {!isNull findDisplay 46};
private _display = findDisplay 46;
private _control = _display ctrlCreate ["RscTextMulti", -1];
_control ctrlSetText "hello world";
_control ctrlSetTextColor [1.0,1.0,1.0,1.0]; //white?
_control ctrlSetPosition [
safezoneX + safezoneW - 0.2,
safezoneY + 0.0 * safezoneH,
safezoneW * 0.1,
safezoneH * 0.3
];
_control ctrlCommit 0;
commy_Counter = [_control];
};
};
Step 1 ^
so a global variable is better than a function in this case?
// any other script
0 spawn {
(commy_Counter select 0) ctrlSetText "COMPUTERCOMPUTERCOMPUTER";
sleep 5;
(commy_Counter select 0) ctrlSetText "";
};
^ Step 2
You can make a function out of step 2.
But the whole part about creating the control should only be done once.
i see
You just reuse the control. This is for MP right? No savegames.
right just for MP
I forgot a command in step 1. : (
fixed.
Also, why did you remove the green. It was a beautiful green. : (
what green?
ctrlSetTextColor
oh, i was gonna use an rgb color picker later
but i figured white would be a good test color
also white and black are the only ones i know
off the top of my head
You remembered R-G-B and that gives away at least three colors.
I have no idea what RscTextMulti is.
its the same as rsctext except you can line break?
Neat.
if you could line break in rsctext then i suppose it doesnt matter
Yeah. Strange to make ANOTHER class for something so basic.
well its working, just gotta figure out how these safezones work now
i dont get it but ill do some testing
Need more UI classes
all with slightly different behaviour
And when we make it so in one ui type you can turn the border off, in the order we won't let you do it!
Oh and the one UI type will have a flashing text when selected (because it's 2003), but the other one can't even support it
Focus on the top left corner, Axle.
Then think about what coordinate the bottom right corner is.
I stared at this for half an hour and then I got it.
what is the center coordinate then commy?
is that... 0.5?
or is it...
((getResolution select 2) * 0.5 * pixelW)
safeZoneX is like -0.18 depending on ratio or whatever
what's a screen measurement unit?
safezonew returns the width of the screen in screen measurement units
Outer is 4/3. Inner is your sceen resolution.
ah, the 'unit' is the red box you see in commies picture
[safeZoneX, safeZoneY] is topleft corner of screen
Yes.
and theyre negative?
[safeZone + (safeZoneW * 0.2), safeZoneY] would be 20% from the left side of your screen at the top
etc
yes but ignore that
and theyre negative?
Yes.
all you need to know
There're left and top of 0,0; so negative.
Yes.
Looks right.
and all i care about is inbetween
now that might come up to like -0.18, 1.23423423, 23493242 3.4142424 1488
?
All you care about is inbetween.
and its all relative values
safeZoneX + (safeZoneW * _inBetween)
if that should be 50% (so middle... then 0.5
if it should be 100% (so right side of screen, then 1)
etc etc
Obviously you also have to subtract the width of your control from the x position if you want to place it on the right side of the screen.
Similar for bottom,
You can use the same script I posted and the debug console to play around with ctrlSetPositon and ctrlCommit 0 to experiment with it.
else you get this
etc
lets say that box is __WIDTH you wanna do (safeZoneX + safeZoneW - __WIDTH)
....
ree
Center:
(safeZoneX + 0.5 * safeZoneW - __WIDTH / 2)
well now i see why RSCTextMulti isnt used
i get the first line but i assume the second line is an entire screen height lower
Maybe the control is not tall enough.
Change it's height.
Usually by making it bigger.
safezoneH * 0.3
->
safezoneH * 0.5
idk
ill give that a try
nice, it works
i tried putting the second part into a function
but it kept erroring out on the sleep part
Scheduled
0 spawn {
(commy_Counter select 0) ctrlSetText "hello\nworld";
sleep 5;
(commy_Counter select 0) ctrlSetText "";
};
i had params for 5 and hello\nworld
commy2_fnc_displayText = {
params ["_displayText","_timer"];
0 spawn {
(commy_Counter select 0) ctrlSetText _displayText;
sleep _timer;
(commy_Counter select 0) ctrlSetText "";
};
};
like so
commy2_fnc_displayText = {
_this spawn {
params ["_displayText","_timer"];
(commy_Counter select 0) ctrlSetText _displayText;
sleep _timer;
(commy_Counter select 0) ctrlSetText "";
};
};
You need to pass the arguments to the scheudled script instance. They lose all locals.
could you explain like im 5, i'm really bad at this
_var = 1;
_var; // 1
call {
_var; // 1
};
0 spawn {
_var; // undefined :(
};
_var = 1;
_var spawn {
_this; // 1 !!!
params ["_var"];
_var; // 1 :)
};
_this in commy2_fnc_displayText is whatever arguments you passed to the function.
oh
1 call {
_this // 1
};
[0,1] call {
params ["_var1", "_var2"];
_var1; // 0
_var2; // 1
_this; // [0,1]
};
Params is essentially the opposite operator of array creation.
[_var1, _var2]
<->
params ["_var1", "_var2"];
this is so much better than cuttext
cant wait to use it
uh oh
this is more of an OCD problem, but when i linebreak, the alignment is left instead of center
AxleVice - Today at 2:46 AM
could you explain like im 5, i'm really bad at this```
π π π π
At least, you are honest π (there are enough there, who won't/can't admit this)
hi im namenai and I have the tendency to use while loops because they are less effiecent and costly
Hello, I have a problem that I've been trying to solve for the last couple hours, need some help with what seems to be a pretty simple command
Anyone willing to help me out?
So
I want to create a trigger that activates when a civilian player walks into it. It gives him an RGO grenade and that's it.
So far, it seems that putting "player addItem "handgrenade";" gives every player a grenade, so how do I specify that ONLY the person who activates the trigger gets the grenade?
Essentially, I'm making a multiplayer mode where it's 1v5 and the five-player side can each pick up exactly one grenade that the enemy player cannot have access to.
@calm sapphire I dont use triggers but I think you need to put something along the lines of "player in thisList" into the condition field of the trigger
However you will need to add a check so that one player doesn't get a grenade twice
@calm sapphire Name your unit somehow... unit_1
Set trigger activation to unit_1 side //--- BLUFOR/OPFOR ect...
Set activation type: Present
Set condition: unit_1 in thisList
On activation put: for "_i" from 1 to * do {unit_1 addItem "handgrenade";}; hint "Bingo"; deleteVehicle thisTrigger; //--- Replace * with number of grenades you need to add for unit_1
If you need only one grenade: unit_1 addItem "handgrenade"; And try google, he knows everything π
handgrenade is add magazine
lemme find it
_unit addmagazines ["HandGrenade", 1];
swap handgrenade for the correct name for rgo
@plucky willow https://community.bistudio.com/wiki/addItem
The item can also be a weapon or a magazine.
my bad
np
Is there any way to workaround the issue of slingloading objects that arent local to you randomly detaching? I've tried setting the object being lifted to local with the event handler, but it doesnt work
Make it local, wait a second, then sling load
I'll give that a go, cheers.
@tough abyss
_var isEqualType (text ""); //Is text
_var isEqualType ""; //Is string
Like this?
That'll work, give it a go
fair enough
Does anybody have a script at hand which adds several uniforms specifically without needing to add them individually to a crate? By several uniforms I mean several different uniforms with different classnames.
Does anybody know how did this guy make IR searchlight?
https://www.youtube.com/watch?v=9ZV5edu4pRI
With the stNVG it's almost needed, and I'm trying to find out how does one do it, but couldn't find anything
Thoughts?
It doesn't look perfect in video ofcourse, but just wondering how did he do it in the first place
Maybe it's possible to make it better
A normal light that get's disabled when you turn of your NV goggles
you can also do that in MP. But not that easy
Thanks lads for help, that was all I needed π
Motivation?
Yeah
how do i get the cargo index?
stop using google and search on the wiki instead
that also is unreliable.
cargo index site:community.bistudio.com
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
CTRL + F -> Cargo
@astral tendon how is the wiki unreliable?
Well sometimes commands are called completely different from what you would expect so googling works better
Not in this case though
Yeah, but if anything else you can just look at the categories
Added: A new ctrlTextWidth script command (used for getting the width of the longest line of text in a given control)
Actually would be great if it returned width of last non-empty line
You already know control width
Actually, returning widths of all lines would've been even better so you can easily get longest or last line if needed
Had a need for such command some years ago to do background for each line
Does anyone know how to make this work - waitUntil {(markerColor "m3000" == "ColorOPFOR")}; I want the script to wait until marker m3000 is red (colourOPFOR)
Looks correct to me
Thanks, I just checked and I had made a typo in the script itself
How embarrassing
habit of spelling it colour and not color
Already noticed that in your message
but the code you posted is correct.
And you should always copy-paste the exact code you are using. else asking for help is useless if you fix your mistake before you post it^^
were i can find a list of vanila hints like the ones in the showcases? i wanna find some related to how to use the mine detector
@astral tendon Config Viewer > CfgHints
@meager heart thanks
[["weapons", "minesweep"]] call BIS_fnc_advHint;
does this needs to be called local?
yes
i have a singleplayer script utilizing playerSide but what works best in multiplayer?
@plucky willow You can try _target call bis_fnc_objectSide
also, for multiplayer, i want to know which player executed the script
player reports the local avatar, Axle.
playerSide also works in MP. It reports the side you picked in the lobby.
interesting
my playerside script works in singleplayer but not multiplayer
ill have to look into it further
nvm the first line gives it away if (!isServer) exitWith {};
gotta remove that
Interesting line concerning this problem^^
yeah i dont usually have locally executed stuff in multiplayer so i overlooked it
@meager granite Still impressed by your koth UI
KoTH isn't for me but I most certainly respect the effort.
i personally prefer realism/milsim, playing with random people isnt for me
@meager heart Consider leaving this server.
Why ? π
KOTH was excellently designed, and it scales well. It's just that, it attracts a lot of simple players
Never use BIS_ functions: https://github.com/acemod/ACE3/pull/5844
Lovely
FlyingVolvo - Today at 1:06 AM
@meager heart Consider leaving this server. I offended somebody... somehow ?
is the effect of setDropInterval global? / Is a particle source even global ?
Particlesources are created with createVehicleLocal. Therefore, setDropInterval will only have local effects.
@half relic Consider considering
Heh
First off, the guy you pictured is a Sikh, second off, your joke wasn't funny, third off, keep that shit out of this discord.
OK π
Is there a reason setvehicleammo 1 didn't work on turrets?
if( isServer) then { Null = [this] spawn { While {true} do { (_this select 0) setVehicleAmmo 1; sleep 30;}; }; };
trying to do this to give some MG42s unliminted ammo.
Works on Flak30/38s doesn't work on the mounted MGs.
setVehicleDefaultAmmo 1;
can some one add a note on the isSpeech that also change were the volume settings is set to the radio an not the effect anymore
also
what is (_this select 0)
the vehicle?
IFA might replace static vehicles
Yeah there is a reason. Sa-Matra talked about that
they swap vehicle classes around with some of their static mechanics (meaning new vehicle and that script won't apply anymore)
Does the new vehicle keep the same variable name?
can i just name them instead?
Or is there a better way to keep refilling their ammo, ACE3 AI don't really know how to use ammo crates.
O.k. naming it, works
if( isServer) then { Null = [this] spawn { While {true} do { mg1 setVehicleAmmo 1; sleep 5;}; }; };
when Mg1 is the vehicle, works.
I just used the This thing so I could copy and paste the unit, and not have rename everything.
So I've changed it to 1 script that just hits them all, since I have to name them anyways.
The alternative was mg42 primaries and carryalls full of Magazines.
Lib_MG42_lafette_deployed
Lib_MG42_lafette_low_deployed
so you want unlimited magazines?
Ideally yeah, unlimited magazines, but I just put a 60s timer on it, so They can't shoot continuously, but might run into a extra long mag every once in a while.
Pretty sure players won't notice either way.
[
"Fired",
{
_mag = _this select 5;
_unit = _this select 0;
if ({_x isEqualTo _mag} count magazines _unit < 2) then
{
_unit addMagazines [_mag, 3];
};
}
]; ```
this one i use for RPG AI guys to have unlimited magazines
it will give 3 magazines once it have none
I'm not familiar with it, but do you think there's an issue to performance if I have like 10, MGs firing at the same time, each triggering this call?
What's the best way to count the number of a specific object in the world.
and _x is a special variable
like if I want to have something happen where there are 5 flags spawned? geist_flag_USA02_f
Because im just starting using scripts, but feel free to do it better.
why not use init.sqf or initPlayerLoca.sqf ?
your experience probably will do it better.
why not just learn better practice?
I mean, you've been told about it before. But you just don
you don't wan't to try?
I mean come on, seriously.
and why should i give you a reason to everything anyway?
Do you have a reason to keep using tirggers and unit inits?
programmers use what they know works.
Yes, but Roque has been shown how to execute scripts before
The reason why i have a problem with it to begin with is because it promotes lazyness and other people follow soon to do the same thing
and we end up with very limited use missions as a result
@kindred lichen sorry someone was being wrong on the internet, so i had to correct him
// -- Keep MG42 full on ammo
[] spawn {
private _allMachineguns = vehicles select { (toLower (typeOf _x)) in ["lib_mg42_lafette_deployed", "lib_mg42_lafette_low_deployed"] };
while { true } do {
{
_x setVehicleAmmoDef 1;
} forEach _allMachineguns;
};
};
Just put this in init.sqf
and you should be good to go
uh fuck
wat, init.sqf needs that/
i haven't used spawn or init.sqf in years.... π
no
init.sqf
or
0 spawn
{
};
i know unit needs it
no. Scripts in mission boxes "need" that (They don't really. I think CBA fixes that. Again just BI being dumb)
I tell you what, i wont give any advice to anywone in this discord, i will let you handle it;
are we good now?
That looks like an infinite loop with no sleep.
Uhhh...what?
// -- Keep MG42 full on ammo
[] spawn {
sleep 3;
private _allMachineguns = vehicles select { (toLower (typeOf _x)) in ["lib_mg42_lafette_deployed", "lib_mg42_lafette_low_deployed"] };
while { true } do {
sleep 30;
{
_x setVehicleAmmoDef 1;
} forEach _allMachineguns;
};
};
100%cpu inc
throws an apple at @Adanteh#0761
throws cookie at Dedmen
also i don't know anymore if vehicles are availble directly in init.sqf
OH
AND ADD isServer in there
fucking hell
yeah, saw that too.
well i'm off to bed i guess π
β€
they're easy things to forget, and don't really affect the script
like i said, never use init.sqf anymore.
It's been so long since I wrote SQF...
also there's probably a base class for the MG42 that you could do isKindOf check on in instead....but it's only on mission start and i'm too lazy to fuck it up, so /care
<advertisement>
Intercept is giving CBA the ability to add keybinds to Joystick keys.
And also add's a SQF command to make your gamepad vibrate.
</advertisement>
So you can bind your TFAR radio keys to Joystick buttons soonβ’
Where can I sell you my soul Dedmen?
You already did so
π±
I should add more "make things vibrate" commands... Would give Arma a new vibe...
Make sure to sell the vibration data though
{
//insert code here
} forEach vehicles;
``` So you know how the code above ^^ wiill loop through all vics,opfor blufor and independent. Is there away to have it just lloop through one side and reduce run time?
if
} forEach (vehicles select { side _x == east })
oryaknow
... just put the if inside the foreach
easier
well
yea
but
i was gona also do it for infantry
and its not that runtime is a issue,id just like to reduce it
also the mod that my unit uses,the star wars one
memory leaks like no fucking tomorrow cause memes
so
Im using a script that fixes the tanks,cause the tanks take one shot and their turrets then point down and gets disabled
so i have a script that fixes that,gives them a gun that works and chages the texture if ppl want. so in reducing the difficulty with the mem leak and im tryna rreduce run time
GG spelling XD
wtb a function that spawns a dummy player client at will for JIP testing.
Doing my own head in trying to figure out how to add the connected player to a zues' edittable objects list.
Lads, i'm trying to list the classnames of groups in "Infantry" "Motorized" etc classes.
I'm trying to achieve this using https://community.bistudio.com/wiki/configClasses or any other method that achieves a similar result in the output.
Only ones that are harder to use.
Harder to use doesn't really fuss me too much. I'm just trying to save some effort in the long run but making things simpler for edits to what faction I use for my mission
rather than manually putting in lists of groups
I'm already using configClasses atm to create some arrays of individual units, but having no luck adjusting it to do the same with groups
configClasses would require the lowest effort to get those units.
Yea it was no stress at all to get the individual ones. But when i've tried adjusting it for cfgGroups not cfgVehicles, i'm getting blank return
_r = "(
{getText (_x >> 'faction') == 'BLU_F'}
)" configClasses (configFile >> "CfgGroups");
systemChat str(_r);
Is even returning a blank atm
private _side = "west";
private _faction = "BLU_F";
private _category = "Infantry";
private _group = "BUS_InfSquad";
private _config = configFile >> "CfgGroups" >> _side >> _faction >> _category >> _group;
private _units = ("true" configClasses _config) apply {getText (_x >> "vehicle")};
systemChat str _units;
Don't use the code string thing of configClasses and configProperties. It only overcomplicates things.
Ah yes see i'm trying to get the "BUS_InfSquad" and whats input is just say the "BLU_F" for example
So all i'd have to change per mission for example is just the Faction used
You want a list of all groups of a faction?
Correct
Just remove >> _group and maybe rename the two _units to _group?
private _side = "west";
private _faction = "BLU_F";
private _category = "Infantry";
private _config = configFile >> "CfgGroups" >> _side >> _faction >> _category;
private _groups = ("true" configClasses _config) apply {getText (_x >> "vehicle")};
systemChat str _groups;
With that it gives me an array of "","","" etc
Do you want the units or the groups?
Group names so I could use it with a function like BIS_fnc_SpawnGroup for example
{getText (_x >> "vehicle")}
to
{configName _x}
for the groups.
Ah yes thats done what I want. Perfection. Appreciate it
tonight?
Guys, I need a code optimization tip.
My mod is using a custom random number generator for vehicle plates, the function is called in every init Eventhanlder (I check inside the func if the vehicle is local) and a config parameter must be in every vehicle (FFAA_numerales[], which determine how number will be generated (color, font etc) where I want generate those numbers.
Would be better if I call this function with postInit = 1; and by doing a foreach AllUnits checking if the parameter exist, and if so, call the above function?
In this way I could remove the Init Eventhandler of every vehicle because in fact it will eventually be called by whoever is calling the PostInit function.
But postInit doesn't catch vehicles that spawn later on
allUnits is overkill since soldiers don't have number plates
Usually
Init is better for this.
π€ Ops, that's true, it doesn't catch the laters
In every way.
Init on ground vehicles. And if the lag is too much just move to scheduled
@still forum Ok I'll remain the same approach then. And will move to scheduled enviroment
Do you have perf problems with it?!
No, just to remove the class Eventhandler parameter π
Everything you suggested would make it worse. The init eventhandler is perfect for this. Why would you want to get rid of class Eventhandlers? Makes no sense to me.
Doesn't matter, I think I was thinking in the bad way, sometimes I want get rid of unnecesary parameters to make a short config file but this isn't the case.
Sounds to me like you're about to go out of your way to make something worse for absolutely no reason or benefit.
Nah, I'll remain it as before. I can apply the "If it ain't broke, don't fix it" π
"If it ain't broke, don't wreck it".
hahaha
"never touch a running system" ?
Yes, don't put your hands between running cogwheels.
would anyone know what this means?
Call extension 'extDB' could not be loaded: %1 is not a valid Win32 application.
Where does this come up?
Probably 64vs32 bit conflict
But would the game report it like this?
its in the rpt logs of tadst
Doesn't belong on this channel I'd say. #arma3_troubleshooting
yeah i didnt know where to put it sorry
i have a question regarding CBA taskpatrol and tasksearcharea
do i understand correctly that the difference is that taskpatrol, fixes the waypoints, while searcharea, randomly generates new waypoints?
Would make sense
also i think one uses MOVE the other is SAD
i am trying to get the searcharea one to work and let the dudes search buildings after the waypoints
apparently i can give the thing a string fo code
for taskpatrol i have an example how that could work.
but that doesnt appear to do the job for seracharea
[_group, _destination, "AWARE", "YELLOW", "FULL", "STAG COLUMN", "this call CBA_fnc_searchNearby", [3,6,9]] call CBA_fnc_taskSearchArea;
in theory that code should be executed on every waypoint....
im not sure if that is actually what it does...
Have you read the function header?
oh crap. searcharea searches buildings automatically
so im basically messing things up
thanks for that hint.
is there a way to stop the generation of new waypoints?
It says "indefinitely", so I don't think so.
But you could always copy paste the function and adjust it.
Just have to replace the script_component include with #include "\x\cba\addons\ai\script_component.hpp", so it finds the right file.
Sounds complicated. Might use takspatrol instead. That works by adding a series of waypoints with cycle. Then i could just delete waypoints to stop them
And if i want less predictable waypoints, i can just run the funktion in a loop for the randomness i think
This is the recursive part that makes it indefinitely: https://github.com/CBATeam/CBA_A3/blob/master/addons/ai/fnc_taskSearchArea.sqf#L74-L77
Yep, saw it. But i think with the patrol function i might get the same effect with less code copying
Not sure though, is it less efficient to have those preset waypoints on the map?
with patrolarea it generates ficΒ΄xed waypints
so for example there would be a waypoint cycle of 7 waypoints for each group
while searcharea would only generate one, and then a new one only if that is completed
certainly nicer to look at from zeus
also i wonder if the algorithm behind searcharea might be more of an issue to use with VCOM
Might be.
ah actually....
i think the thing will interrupt once i add a waypoint in any other way
because then i have a waypoint that doesnt call those statements again
so once VCOM kicks in, the thing will not be generating new searcharea waypoints
or if i add a waypoint as zeus
Im having a bit of a mindblank moment, do variables persist when set to the player object over respawns?
Yes.
There is one potential issue you might be having if you use setVariable on a killed eventhandler.
Alright sweet, thank you. And yeah nah im not doing any in that event handler so should be okay π
i think you have to make sure to add them to player, not playableunit. if im not mistaken i once had an issue with that, but i could be wrong
There's no difference in how you acquired the object.
talking about the killed eventhandler. i have an issue with that. seems to be returning the victim only, not the killer or instigator
ACE?
I had to search it.
holy crap... and they havent fixed that
thats a bit annoying
glad i can at least get the victim...
Have you read the first answer?
but how would i now figure out whether players killed civilians or friendly fire?
private _killer = _deadGuy getVariable ["ace_medical_lastDamageSource", objNull];
There's no way to fix this sadly. Otherwise it would've been fixed years ago.
Hey guys, do you know if there is a way to script scrolling of a controlsgroupctrl?
RscControlsGroup ARE the scrollbars in controls.
Yes, however, you can obviously scroll when hovering over if the contents > than the controlsgroup
Is there a way to script that?
So I can scroll up or down within the control? I.e. call it via script command
Just create a dummy control somewhere deep down?
And do what with it?
Nothing. Then you can scroll for a while.
I don't think you know what I mean.
I want to be able to trigger scrolling (if control is able to scroll) via a scripting command or script
Is that possible?
Ah nice
Never used this, but it sounds like it could be what you're looking after.
This seems to scroll down, but not up π¦
Im trying to make a similar thing as to the default chat, i.e. scroll up or down with page up/down
Not sure how they're doing it
ctrlSetPos and ctrlCommit?
That could work I guess
Just to be clear. ctrlCommit is a dely to animate these things and can be >0
So the control moves X seconds into the position.
You mean the display for it?
Well, more like the functionality, but the display would probably be stored there
Do you know what the display is called?
There are a few template controls, but the display seems to be hardcoded or it's a hardcoded part of another display.
Ah yeah
This is the input edit box etc:
RscDisplayChat
Yeah, I saw that
These are the templates for the output / incoming chat:
RscChatListDefault
RscChatListMission
RscChatListBriefing
RscChatListMap
But the behavior is completely hard coded and they have no classical controls to edit with the API.
Yeah I saw that π¦
Are you making your own custom chat?
Yes
I had some HUD stuff put on the same side as a chat before thinking of chat, so I told myself f*** it lets just remake the chat to have it on the right side
Maybe one can edit the controls ingame should they be available with allControls. Sadly they seem to be structured text (for the multi colors?), so you can't read their displayed text at all.
ah π¦
I think I also tried adding onLoad to them, but nothing happened. I can try again...
Don't worry about it, I got another way π
I always wanted to mess with it, because people occasionally ask how to disable the side chat.
showChat doesn't work for me.
You in MP?
Local hosted MP.
@rotund cypress if (!isDedicated) then {{_x enableChannel false} foreach [0,1,2,3,4,6,7,8,9];
Im not having problems disabling the channels π
You can't disable the side channel, and you can't disable the global channel for the host / admin.
That was the whole point in me looking for alternatives.
Ok sorry need scroll up higher...π
please hold, someone will be happy to help with your Life related scripting problems very soon
(i wasn't talking to myself, some scrub asked a question about life scripting then deleted it)
damn so the searcharea thig has one problem, which is waypoints in the water
figure i need a separate loop to prevent that.... wiki gives me a function to check whether surface is water
is there something to find nearest land?
probably could check whether its water, and in that case move the current waypoint to nearestlocation or so
or are there locatios in the water?
maybe nearestbuilding... instead...
IΒ΄ve set up TADST to test my mission in a dedicated server enviroment(as best as possible) before actually moving it to to a better solution. Im using initServer and (isDedicated) in the scripts to make sure things run where they supposed to run and everytime I spawn for example a radiotower it spawns 2 of them. IΒ΄ve tried to the best of my knowledge to fix this issue, I have looked in many forums to no success. I Β΄ve tried multiple combinations on isDedicated and hasInterface and isServer but it will create two of each everytime. I know im not far from it but how far i donΒ΄t since IΒ΄m a bit lost here. Any help or hint would really help, thank you.
Headless client?
no
IΒ΄m just making sure tasks and spawning objects is correct at this point
tasks are fine, obejcts not so much
ok now it creates only one object, right... but using deleteVehicle _radioTower; does not delete ... maybe i just need to step away from it because how can such a simple command not work
i Β΄ve tried making it global and even publicvariable it but still does not delete
So I have the following code to just show me what parts of a vic has taken dmg, however it doenst work on a helicopter for some reason in a mod but works on a tank from the same mod, any ideas why?
hint format ["%1", (getAllHitPointsDamage (vehicle _this)) ];`
ah! solved it.... while i was testing and all i forgot to comment out the part that was looking for the radiotower ruins since once its destroyed its a new object... in this case i wasnt destroying was just creating and deleting it to check positions and whatnot... solved
the code would get to that part and just hault
anything wrong wih this?
for "_i" from 1 to 60 do {
sleep 30;
_wpindex = currentWaypoint _group;
_wppos = _waypointPosition [_group,_wpindex];
if (surfaceIsWater _wppos) then {
_nearestlocation = nearestLocation [ _wppos, ""];
_wppos = locationPosition _nearestlocation;
[_group, _wpindex] setWaypointPosition [_wppos, 20];
}:
};
i think it somehow breaks the waypoint...
does _waypointPosition only work for editor placed waypoints?
says it under wppos
_waypointPosition doesn't exist
Can't have local variable next to array either.
indeed. blind me i stared at that thing for a while
@Dedmen (β©ο½-Β΄)βββοΎ.*ο½₯qοΎ#0689 that name
It's Kirby.
Could someone help understand what i've done wrong? There's no errors from the -showerrors ingame. ```sqf
mission_1_start = 0;
mission_1_end = 0;
if (mission_1_start == 1) then
{
player globalChat "Mission 1 has Started!";
// Spawn all units and vehicles to spawn in mission.
[200,mission_1] execVM "/SpawnCommand/WEST/INF/inf_squad_1.sqf";
[200,mission_1] execVM "/SpawnCommand/WEST/INF/inf_fireteam_1.sqf";
};
if (mission_1_end == 1) then
{
player globalChat "Mission 1 has Ended!";
// Delete all units and vehicles to spawn in mission.
deleteGroup west_inf_fireteam_1;
deleteGroup west_inf_squad_1;
};
Well that code does nothing.
How do you mean?
Both if's will be false and nothing will happen aside from two variables being set to 0.
Right. I was thinking of using a while command... maybe above (around) the IF 's
In the mission via debug for now
Will be done via triggers ingame
I've done a watch on the debug and the mission_1_start = 0;
mission_1_end = 0; is correct and when I change it via debug it works (obviously)
mission_1_fnc_start = {
player globalChat "Mission 1 has Started!";
// Spawn all units and vehicles to spawn in mission.
if (isServer) then {
[200,mission_1] execVM "/SpawnCommand/WEST/INF/inf_squad_1.sqf";
[200,mission_1] execVM "/SpawnCommand/WEST/INF/inf_fireteam_1.sqf";
};
};
mission_1_fnc_end = {
player globalChat "Mission 1 has Ended!";
// Delete all units and vehicles to spawn in mission.
if (isServer) then {
deleteGroup west_inf_fireteam_1;
deleteGroup west_inf_squad_1;
};
};
init.sqf
setting them as functions?
remoteExec ["mission_1_fnc_start"]
to start
remoteExec ["mission_1_fnc_end"]
to end
That makes way more sense to me personally.
I will test and let you know.
The isServer thing is needed so not every client spawns groups.
Don't want to have multiple copies of groups for every client connected.
Right
so the isServer is just server init.
So it would be best to have it in initserver.sqf?
isServer is true on the server (including SP client) and false on dedicated clients.
So the if statement is only evaluated on one machine.
The server.
So, would this work on the preview editor?
In the editor or in SP you are the server.
Probably the leading slash in "/SpawnCommand/WEST/INF/inf_fireteam_1.sqf"
mission_1_fnc_start = {
player globalChat "Mission 1 has Started!";
// Spawn all units and vehicles to spawn in mission.
if (isServer) then {
[200,|#|mission_1] execVM "SpawnCommand/WEST/INF/inf_squad_1.sqf";
[200,|#|mission_1] execVM "SpawnCommand/WEST/INF/inf_fireteam_1.sqf";
};
};
mission_1_fnc_end = {
player globalChat "Mission 1 has Ended!";
// Delete all units and vehicles to spawn in mission.
if (isServer) then {
deleteGroup west_inf_fireteam_1;
deleteGroup west_inf_squad_1;
};
};
``` that is what it looks like (then saying it's not found.)
(mission_1 is a marker on the map)
The leading slash is generally for the addons folder, and no leading slash is for the mission folder.
Yeah sorted that.
But there are some exceptions.
The player globalChat "Mission 1 has Started!"; works on remoteExec ["mission_1_fnc_start"]
However, no people spawn
// nil = [200,mission_1] execVM "inf_fireteam.sqf";
private ["_rad","_spawn","_marker","_units","_troop"];
_rad = _this select 0;
_spawn = _this select 1;
_marker = [(getMarkerPos _spawn select 0)-_rad*sin(random 359),(getMarkerPos _spawn select 1)-_rad*cos(random 359)];
// EDIT BELOW \\
_units = ["B_Soldier_SL_F","B_Soldier_TL_F","B_Soldier_AT_F","B_medic_F","B_Soldier_M_F"];
west_inf_fireteam_1 = createGroup WEST;
// EDIT ABOVE \\
{
_troop = /* EDIT THIS ->*/ west_inf_fireteam_1 /* <- EDIT THIS*/ createUnit [_x,_marker, [], 0, "NONE"]
} forEach _units ;```
Try executing the function manually.
sin(random 359)
This does look suspiciously wrong to me.
This is in deg, but the command uses radians.
right so asin not sin
_rad*sin(random 359)
``` to ```sqf
sin (random 360 / 360 * 2*pi)```
I think the createUnit line is wrong.
jezus
Nah wait. There're weird comments^^
lol
Should they spawn inside the radius or at the circumference?
inside the radius @little eagle had a brain fart
LOL
But the marker is an "empty" one.
params ["_radius", "_marker"];
private _position = getMarkerPos _marker getPos [_radius * sqrt random 1, random 360];
// vvv edit
private _group = createGroup west;
west_inf_fireteam_1 = _group;
private _units = ["B_Soldier_SL_F","B_Soldier_TL_F","B_Soldier_AT_F","B_medic_F","B_Soldier_M_F"];
// ^^^ edit
{
_group createUnit [_x, _position, [], 0, "NONE"];
} forEach _units;
Untested
Is the path correct?
Strange.
I don't know why it wouldn't work with subfolders.
Hmm
Maybe try saving and loading the mission after you placed the files.
I appreciate you helping as well. very nice .
I'll ttry that
Hang no
on
\ not /
wow im dumb
What was it? Temp mission folder?
SpawnCommand\WEST\INF\inf_squad_1.sqf not SpawnCommand/WEST/INF/inf_squad_1.sqf
I hate this too...
any way to check if an object is being remoteControl'd by a player in sqf
All works now thanks @little eagle was just the fucking \ π¦
Cool.
ah nevermind, i can loop through the curators and check their assigned units
@little eagle Would you mind helping with this, I know scriptDone won't work. However is there a way around this? sqf waitUntil { scriptDone { S1_WYP_1_marker = [(getMarkerPos _spawn select 0)-_rad*sin(random 359),(getMarkerPos _spawn select 1)-_rad*cos(random 359)]; S1_WYP_1 = west_inf_squad_1 addWaypoint [S1_WYP_1_marker, 10, 0]; S1_WYP_1 setWaypointType "MOVE"; } }; Originally: ```sqf
S1_WYP_1_marker = [(getMarkerPos _spawn select 0)-_radsin(random 359),(getMarkerPos _spawn select 1)-_radcos(random 359)];
S1_WYP_1 = west_inf_squad_1 addWaypoint [S1_WYP_1_marker, 10, 0]; S1_WYP_1 setWaypointType "MOVE";
S1_WYP_2_marker = [(getMarkerPos _spawn select 0)-_radsin(random 359),(getMarkerPos _spawn select 1)-_radcos(random 359)];
S1_WYP_2 = west_inf_squad_1 addWaypoint [S1_WYP_2_marker, 10, 1]; S1_WYP_2 setWaypointType "MOVE";
S1_WYP_3_marker = [(getMarkerPos _spawn select 0)-_radsin(random 359),(getMarkerPos _spawn select 1)-_radcos(random 359)];
S1_WYP_3 = west_inf_squad_1 addWaypoint [S1_WYP_3_marker, 10, 2]; S1_WYP_3 setWaypointType "MOVE";
S1_WYP_4_marker = [(getMarkerPos _spawn select 0)-_radsin(random 359),(getMarkerPos _spawn select 1)-_radcos(random 359)];
S1_WYP_4 = west_inf_squad_1 addWaypoint [S1_WYP_4_marker, 10, 3]; S1_WYP_4 setWaypointType "CYCLE";``` The 3 and 4 markers would be the wrong way around. Making the waypoint 3 at [0,0,0]
scriptDone needs a SCRIPT handle, not a CODE block. I think you can just get rid of it and the waitUntil entirely.
The 3 and 4 markers would be the wrong way around. Making the waypoint 3 at [0,0,0]
even though I made the index shown here: https://community.bistudio.com/wiki/addWaypoint to 0 1 2 3
I think you have to start these waypoint indices with 1.
they start at 0 I checked.
Because 0 is already a dummy waypoint that every group has and is positioned where they spawn.
That randomization method very strange though. I think you made it a square where the center is preferred with some kind of e function increasing probability. Euler would be proud.
You. The sine cosine thing.
oh that just basic stuff mate π
Pff, details.
lmao
Don't encourage them
#letsAllInvestInAnInvisibleDiscordGIF
about the \ im wondering now if it will accept ..\myscript.sqf , not that thereΒ΄s a lot of folders but in that case i dont have to edit when reusing scripts
I think the leading slash works if the game does not find the same file under the addons folder in some kind of mod.
No leading slash makes it look only inside the mission folder.
Not here.
a starting \ sometimes makes it go back to base files
@blissful wind Also hides it from knowing where the file is from just the "call"
@blissful wind also if true then you need to have different file names.
\path
^ addon scope, fallback to mission scope
path
^ mission scope
^
this is why i think python is much more clean
no semi colons no need to specify everything the computa does it for you
..\ jumps one back
urgh
and so on
\path
^ addon scope, fallback to mission\campaign config if any
path
^ mission scope
you dont need to specify tha name of the folder
the first \
..
lol
stands ffor it
scripts\myscript to ..\myscript
Wouldn't the ..\ put more work on the system to find the file?
not in python
..\ does not work in SQF.
Only with the #include preprocessor command it does.
SQF not.
yea, i was just wondering from readin back your convo about the \
#include ..\macros.hpp
doesnΒ΄t make much different except when your like "what did i name that folder"
well .. it and donΒ΄t need to go check
usually i just forget ;
X)
SQF doesn't even has relative paths, so there is no reason for ..
@little eagle I've got another one... https://cdn.discordapp.com/attachments/378992137385148435/387030013645684743/unknown.png
The sqf setWaypointType "CYCLE"; doesn't work on other groups past the first one...
Wait nvm
?
F1_WYP_1_marker = getMarkerPos _marker getPos [_radius * sqrt random 1, random 360];
F1_WYP_1 = west_inf_fireteam_1 addWaypoint [F1_WYP_1_marker, 10, 1]; S1_WYP_1 setWaypointType "MOVE";
F1_WYP_2_marker = getMarkerPos _marker getPos [_radius * sqrt random 1, random 360];
F1_WYP_2 = west_inf_fireteam_1 addWaypoint [F1_WYP_2_marker, 10, 2]; S1_WYP_2 setWaypointType "MOVE";
F1_WYP_3_marker = getMarkerPos _marker getPos [_radius * sqrt random 1, random 360];
F1_WYP_3 = west_inf_fireteam_1 addWaypoint [F1_WYP_3_marker, 10, 3]; S1_WYP_3 setWaypointType "MOVE";
F1_WYP_4_marker = getMarkerPos _marker getPos [_radius * sqrt random 1, random 360];
F1_WYP_4 = west_inf_fireteam_1 addWaypoint [F1_WYP_4_marker, 10, 4]; S1_WYP_4 setWaypointType "CYCLE";```
didn't change the S1_WYP_1 setWaypointType "MOVE";
S1_WYP_1
lol
I don't follow.
This: S1_WYP_4 setWaypointType "CYCLE";
Was for all groups
So the default waypoint is move if not set
Hence why the CYCLE didn't show
Does it work now?
How do I put a vehicle in group?
@drowsy axle with crew right ?
bis_fnc_spawnvehicle, if its of any use to you.. select 0 is the vehicle select 1 is the crew
AHH right. I'll have a look at it tomorrow
anyone able to tell me the location/file of the group maker icon (hexagon) as used in the in-game environment? i can't find the damn thing. tia.
nevermind, found it... it's at "a3\ui_f\data\igui\cfg\cursors\select_ca.paa".
I looked for it there, must've missed it
Anyone know of a civilian killed notification script? Seems all I can find via search no longer work and don't see much convo on the subject recently.
@half moth
addMissionEventHandler["EntityKilled",
{
params["_killed","_killer","_instigator","_useEffects"];
if(side _killed isEqualTo civilian) then
{
//your notif code here
};
}];
Thanks for the quick reply!
Yep, no problem.
For a constant server side loop, is there any benefit in rescheduling the loop every now and then rather than just having it run the same one over and over again? Someone once told me that its better to do this but I'm not too sure
rescheduling requires more cpu time than just letting it run
Reschedule it every frame.
Yeah I think ill just stick to letting it run
I prefer commy's answer tho
What does reschedule mean ?
It was a joke.
hello evβone, is there a way to use attachTo on one relative position of an object to a relpos of another object? for instance to make ends match
when declaring a variable to equal something. IE _var = []; is there a way to do this when you don't know what "_var" is? for example, you can, with the pushBack command, combine something like (_var select (_forEachIndex)) pushBack _r) however that is not possible to do (_var select (_forEachIndex) = [];
Assignment in SQF needs an identifier on the left side, not an expression.
But for arrays, maybe this is what you need?
https://community.bistudio.com/wiki/set
Can you think of some work around? At the moment I achieve what I need, however I'm getting an array that is [["things","stuff"]] as I have to define the array already as _array = []; then pushback into it is causing it to add an array
I think I recall having a look at set yesterday evening, not sure what about it wasn't suitable. I'll peek again
Ah yes, I did have a loot at it. It still resulted in the array being [["stuff",'things"]]
private _side = str PMF_EnemySide;
private _faction = PMF_EnemyFaction;
_ArmoredGroups = [];
_InfantryGroups = [];
_MechanizedGroups = [];
_MotorizedGroups = [];
_SpecOpsGroups = [];
_SupportGroups = [];
_categories = ["Armored","Infantry","Mechanized","Motorized","SpecOps","Support"];
_groups = [_ArmoredGroups,_InfantryGroups,_MechanizedGroups,_MotorizedGroups,_SpecOpsGroups,_SupportGroups];
{
_config = configFile >> "CfgGroups" >> _side >> _faction >> (_categories select (_forEachIndex));
_r = ("true" configClasses _config) apply {configName _x};
(_groups select (_forEachIndex)) pushBack _r;
//diag_log (_groups select (_forEachIndex));
} forEach _groups;
[_ArmoredGroups,_InfantryGroups,_MechanizedGroups,_MotorizedGroups,_SpecOpsGroups,_SupportGroups]
Is the full code i'm using
Using part of what you sent me last evening
(_groups select (_forEachIndex)) is just _x.
As we mentioned before
it should be just fine and does exactly what you're telling it to do π€
What's the result, and what is the expected result?
Result is
[["BUS_TankPlatoon","BUS_TankPlatoon_AA","BUS_TankSection","BUS_SPGPlatoon_Scorcher","BUS_SPGSection_Scorcher","BUS_SPGSection_MLRS"]]
I'd like to not have the array nest inside the other
Thats for _armoredGroups
Replace pushBack with append.
π well... thats done it. Damn I looked through every other array modifier
Thanks again
https://cdn.discordapp.com/attachments/278323161882165278/386265790002888704/u9h72hh4k8101.png
I kinda wanna ask one of the vets to upload and pin this because it encompasses most of what goes on.
but that's just my way of asking not asking
Question: I've a control, which text I set with ```SQF
_missionInfo = _dialog displayCtrl 80017;
_missionInfo ctrlSetStructuredText parseText format [
"<t size = '1' font = 'RobotoCondensedBold' color='#ffffff' align = 'left'>
%1 on %2
<br/>
Active SQF: %3
<br/>
Active FSM: %4
<br/>
Pos: %5
<br/>
Time: %6m
<br/>
CursorObj: %7
</t>",
missionName,
worldName,
(diag_activeScripts select 0) + (diag_activeScripts select 1) + (diag_activeScripts select 2),
diag_activeScripts select 3,
getPos player apply {floor _x},
floor ([time / 60, serverTime / 60] select isMultiplayer),
cursorObject
];
The last line, when looking at a given object can look like this `CursorObj: 139011: t_pinusp3s_f.p3d`, but when looking at the sky (at no object), it simply reads `CursorObj:`, rather than `CursorObj: <NULL-object>`. Why?
That's the first time I see code where one line wraps around four.
Better?
I think this may be because <> are html chars that parseText is trying to make sense of.
Could be, any way around that?
_str = str cursorObject;
_str = [_str, ">", ">"] call CBA_fnc_replace;
_str = [_str, "<", "<"] call CBA_fnc_replace;
_str
What is ">"?
If you want to use parseText etc. with arbitrary input, this is what you have to do.
Would it be the same with composeText?
@plucky beacon Very good summary
Thanks, I was hoping Commy would think so too π
I was about to complain that it's a triangle and not a circle. But it said "cycle", not "circle".
You need commy the god's approval
Kind of a shame we can't do reactions here, I'd make some good ARMA emojis
There is no S in the plural. It's just emoji.
π π«
Shoenose?
That's honestly not that bad... Could count as Art
Broken uniform model?
Nah, ragdolls
Switching locality results in either this
Even with all my quircks like delays and waiting until body is fully rested (doesn't jiggle anymore), it gets messed up like this on real server randomly
π€ π«
Is this attachTo?!
Setting position each frame, that's why I need locality change so person dragging can do setPos each frame
It looks smooth for dragging and acceptable for dragged
But its Arma.
So it's using setUnconscious.
No, I wanted to let you drag any dead body (units in revive are actually dead in my missions)
https://www.youtube.com/watch?v=h9nig3NTH1M
This is how it looks when for dragging player
Anyway, its all fucked now, until there is a command to force stop the ragdoll state or these bugs fixed.
That guy looks unhappy
:-3