#arma3_scripting
1 messages · Page 607 of 1
Yeah I've tried scrolling
Okay interesting
I managed to get it working with a leaflet
So it's perhaps like Dedmen said?
I'd need it to be some small object like a flash drive
Why not a File Document?
Why does it have to be small
@amber lantern you can create small debug sphere, change textures to something transparent, attach usb dongle to it and voila
Do make sure you haven't placed the one that's an inventory item (it will be in the Inventory Items category in the editor)
He said classname is Land_, which will be the vehicle. We already talked about that above
Is it possible to determine how much is intersected between point A and point B somehow?
I'm currently looking at lineIntersectsSurfaces, which only gives the first points that the line intersects surfaces
What I mean is if it is possible to determine how much of a line is submerged in a surface
in meters, percentage, whatever.
Does it give you both entry and exit points?
if the line is fully inside a surface, you'll have no intersections so that wouldn't give you 100%
It doesn't appear to give exit points
there's returnUnique parameter, which I'm unsure how exactly it works
Just read the wiki
returnUnique (Optional): Boolean (added in v1.69.140138) - When false, all intersections in the same object are included not just the 1st one. Default: true
set it to false, and you should get both entry and exit
I'll check
What I mean is if it is possible to determine how much of a line is submerged in a surface
@random loom of course (mathematics wise): https://en.wikipedia.org/wiki/Line–plane_intersection
once you know the intersection point it's trivial to calculate the fraction that's on the other side
and you'll just bound it by the end points
Only problem is that it doesn't return the exit point @still forum
even if you remove the unique?
running with this to check
{
deleteVehicle _x;
} forEach (missionNamespace getVariable ["arrows",[]]);
arrows = [];
_ins = lineIntersectsSurfaces [
AGLToASL positionCameraToWorld [0,0,0],
AGLToASL positionCameraToWorld [0,0,1000],
player,
objNull,
true,
10,
"VIEW",
"FIRE",
false
];
{
private _arrow = "Sign_Arrow_F" createVehicle [0,0,0];
_x params ["_asl","_norm","_obj","_parentObj"];
_arrow setPosASL _asl;
_arrow setVectorUp _norm;
arrows pushBack _arrow;
systemChat str _x;
} forEach _ins;
arrows
But I guess you could just do it once from the front, and once from the back
that's what sh—
Okay so doing further testing
it appears to work for buildings and such
but from what I can tell returnUnique doesn't work for terrain
This is the script I'm currently running with
{
deleteVehicle _x;
} forEach (missionNamespace getVariable ["arrows",[]]);
arrows = [];
_ins = lineIntersectsSurfaces [
AGLToASL positionCameraToWorld [0,0,250],
AGLToASL positionCameraToWorld [0,0,0],
player,
objNull,
true,
-1,
"VIEW",
"FIRE",
false
];
_ins append lineIntersectsSurfaces [
AGLToASL positionCameraToWorld [0,0,0],
AGLToASL positionCameraToWorld [0,0,250],
player,
objNull,
true,
-1,
"VIEW",
"FIRE",
false
];
{
private _arrow = (selectRandom ["Sign_Arrow_Large_F","Sign_Arrow_Large_Green_F","Sign_Arrow_Large_Blue_F","Sign_Arrow_Large_Pink_F","Sign_Arrow_Large_Yellow_F","Sign_Arrow_Large_Cyan_F"]) createVehicle [0,0,0];
_x params ["_asl","_norm","_obj","_parentObj"];
_arrow setPosASL _asl;
_arrow setVectorUp _norm;
arrows pushBack _arrow;
systemChat str _asl;
} forEach _ins;
count _ins
you mean pushBackUnique?
hey guys.
Me again ... still learning ;)
So I try to create an ace-arsenal that has all stats removed.
First of all ... if I understood the word "stat" right in the framework-description I think "stats" are the "menues on the left and right".
So far so good. Now my problem is, that I am not sure where and how to call it.
I tried it in the ini, which is for sure dump.
Then I tried it in the items ini in the editor, which did also not work. But tbh I have no clue where else it would fit.
This is what I did to the items-ini.
[this, true] call ace_arsenal_fnc_initBox;
[this, ["scopeStatL00","scopeStatL01","scopeStatL02","scopeStatL03","scopeStatL04","scopeStatL05","scopeStatL06","scopeStatL07","scopeStatL08","scopeStatL09","scopeStatL10","scopeStatL11","scopeStatL12","scopeStatL13","scopeStatL14","scopeStatR00","scopeStatR01","scopeStatR02","scopeStatR03","scopeStatR04","scopeStatR05","scopeStatR06","scopeStatR07"]] call ace_arsenal_fnc_removeStat;
I am not sure about the "This" in line 2, cause the framework does not say anything about it. But somehow it made sense to me
jea i know. i tried both 😦 (with and without)
the "this"-version is just the last one that i copied before i came here
Quick question, is there issues with moveInCargo? moveInAny works fine but I want the unit to be in the passenger seat, not the driver seat since thats where they go when the vehicle is empty.
params ["_detained"];
_nearestVehs = nearestObjects [_detained,["Car","Helicopter"],8];
if(count _nearestVehs >= 1) then {
_nearestVeh = _nearestVehs select 0;
if(!isNil "_nearestVeh") then {
_typeVeh = typeOf _nearestVeh;
_detained assignAsCargo _nearestVeh;
_detained moveInCargo _nearestVeh;
systemChat format ["Working. Vehicle is: %1",_typeVeh];
};
};
I've seen that moveInCargo has alt syntax but I didn't have luck with that either
never mind, had to remoteExec it 🤦♂️
Im currently attempting to add custom music to an operation I am creating and I have no clue on what im doing and any YouTube tutorials are outdated or I just don't understand. Anyone who could help me out?
probably the best place to start, especially since you're in #arma3_scripting, is https://community.bistudio.com/wiki/playSound3D
@night dew see https://community.bistudio.com/wiki/Description.ext#CfgMusic and playMusic
or https://community.bistudio.com/wiki/playMusic, although that adds a lot of extra stuff (which most likely is explained in the YT tutorials or you don't understand)
i can see why you would go for playSound3D for this, since it's easy and doesnt require configs, but believe me, Dont use it for this... not what it's meant for
instead, do what montana said
CfgMusic isnt all that complicated
and you'll get a lot better results
well, to be fair, if a simple tutorial on YT like https://www.youtube.com/watch?v=_xRHEZLyXeQ doesn't work than I wouldn't bother working with configs...
trial and error is my way to go 🤷♂️
might take a bit longer till results, but it teaches a lot other stuff as well
When using a Radio Alpha trigger, is there any way to know who used Radio Alpha?
I believe in the activation statement you can find the player in thisList (and since only 1 person can trigger it, it should be thisList select 0)
Isn’t thisList for zone triggers only?
well, it contains whatever is triggering the trigger, so I don't see why not
one way to find out 😉
and might be interesting to add the result on the wiki
Hi , I want to make a script that if any player die with currentweapon "arifle_MXC_F" , a box appears with this weapon "hgun_P07_F"
on position player
I have this at the moment
`if (!(alive player) && currentWeapon player isEqualTo "arifle_MXC_F") exitwith {
_cajaes = "Box_NATO_Grenades_F" createVehicle position player;
clearMagazineCargoGlobal _cajaes;
clearItemCargoGlobal _cajaes;
clearWeaponCargoGlobal _cajaes;
_cajaes addItemCargoGlobal ["hgun_P07_F", 2];
sleep 15;
deleteVehicle _cajaes;
};`
is it currently not workin?
no errors?
where are you running it?
Lan (eden editor)
ok so this is end goal a single player thing then
Have I to run it on a dedicated server ?
no. just wondering your intentions. is this for single player? or multiplayer? or multiplayer with JIP?
Multiplayer pvp
mk, and where are you placing this code? initPlayerLocal? the unit's init box? etc etc
Maybe on Init or on InitPlayerLocal
well which are you currently doing?
mk well. if you go to make it a pvp scenario on a dedicated server and you run it through init only, the server has no player as each player is local to the client
ok
secondly, have you tried placing this within a while loop so that it is constantly checking the if condition
I have tried this :
while {sleep 30 } do { [] spawn life_fnc_box;
on eden editor
init.sqf
while you have a good idea, event handlers are really nice as well and it will be easier in the long run ^
@slim oyster What have I to do with this ?
ill type something up
oops forgot one, good catch
that's says
add a ]; to the very end
It doesn't work xd
you need to take out the sleep too since you aren't in a scheduled environment
or start it with [] spawn
or write it in a different file then execVM it into that event handler if you want the sleep
one sec, testing something for you
omg thanks
ok got it working
ok
in your init
addMissionEventHandler ["EntityKilled", {
params ["_unit","_killer"];
[_unit] execVM "yourOtherFileHere.sqf";
}
];
in yourOtherFileHere.sqf
params ["_killed"];
if (_killed == player) then {
private _cajaes = "Box_NATO_Grenades_F" createVehicle position _killed;
clearMagazineCargoGlobal _cajaes;
clearItemCargoGlobal _cajaes;
clearWeaponCargoGlobal _cajaes;
_cajaes addItemCargoGlobal ["hgun_P07_F",2];
sleep 15;
deleteVehicle _cajaes;
};
and here is proof when I made a unit named "bob" and put that as player in the second file.
yup. read up on params as well as what can go in a unscheduled environment and what cannot. also read up on locality
ok and the last thing
I want that if the player have an specific weapon (a pistol like "hgun_P07_F") that's will execute
then add that to the second file under the if condition as well
just like you did before
if ((_killed == player) && (currentWeapon _killed == "arifle_MXC_F")) then {};
but its better to use primaryWeapon and handgunWeapon
since currentWeapon can be circumnavigated by switching to a weapon other than what you have in there.
ok I will try it
If I put if ((_killed == player) && (currentWeapon _killed == "arifle_MXC_F")) then ... it doesn't work but if only I place the other code it works
doesn't work as in error? or doesn't work because you aren't using that rifle
try with primaryWeapon. currentWeapon is really meant for vehicles
probably has to do with how the player is already dead and doesn't actually have a equipped item when dead.
might have to forget the second condition for now and make due. I gotta go to bed so someone else might be able to help you from here
@fair drum correct, the weapon that is dropped on the floor is not equipped by the container(player), but rather simply in another (simulated) weapon holder
and what can I do ?
What is your intention?
My intention is that if the player that I kill have a specific weapon then drop a box with a specific weapon
like a "arifle_MXC_F"
Anyone has tested if AIs attack targets beyond the view distance?
some did iirc, and it's a nope (unless shared data / laser thing)
Do AIs use view distance setting from the machine they're local to?
I believe so.
what do you think about my problem @winter rose ??
I think it is a problem indeed!
I'm talking about Arma 3 not my problems hahahaha
Hey Guys,
sorry if I stress this again. Did anyone ever work with this function? https://ace3mod.com/wiki/framework/arsenal-framework.html#53-removing-stats-via-a-function
I am not sure if I understand the function correctly. When they talk about "stats" they talk about menue-icons correct?
Ok thaks. 🙂 .... already thought I just call the wrong function.
Now the second thing I am not sure about is where I call this cause I dont know if its global or just "local".
Means: I am not sure if i call this in the map-ini or if i call this on the item-ini in the editor
nevertheless .... i tried both and nothing worked
It’ll more than likely be in the objects init
Did you give the object an ACE Arsenal?
yes
And then run the function in that objects init?
yes.
What was the result? Did it just look like nothing happened?
so first i call the "make arsenal function" and then the remove function. Dont have the exact code here tbh
the arsenal worked, but the remove didnt
Hmmm weird
Tbh .... it looks like no one ever used it. At least google etc dont know anything about this function.
Might be that its bugged .... but its more likely that I am doing something wrong
^^
[this, true] call ace_arsenal_fnc_initBox;
[["scopeStatL00","scopeStatL01","scopeStatL02","scopeStatL03","scopeStatL04","scopeStatL05","scopeStatL06","scopeStatL07","scopeStatL08","scopeStatL09","scopeStatL10","scopeStatL11","scopeStatL12","scopeStatL13","scopeStatL14","scopeStatR00","scopeStatR01","scopeStatR02","scopeStatR03","scopeStatR04","scopeStatR05","scopeStatR06","scopeStatR07"]] call ace_arsenal_fnc_removeStat;
1 sec
now better
^^
tbh I have no clue what the "scopeStat" is used for. I exctracted the bpo of the function and it looked as if its not used
seams like the only go for the last 3 letters
😄 .... that was an earlier try
Ah haha
Might well be that it’s a deprecated or bugged function
I’ll give it a test later when I’m back from work if you haven’t figured it out
I am already experimenting since yesterday. So I bet I will not find it.
I would really appreciate your help!
are you trying to get a blacklisted arsenal?
I try to create an Arsenal that only allows to load default loadouts
ah
can you just make an empty arsenal including the loadouts?
or do all items in the loadout have to be available in the arsenal?
So if I understand correctly, you’re just trying to make a box with a predefined set of kits?
As far as I understood it, they all must be available
Yes thats what I try. But I would love to have this fast adaptable, cause we dont have a stable mod-set yet
at least not stable enough
Ah ok well my suggestion is out the window then, was going to suggest having a box using addActions for the kit s
But it’s far less convenient to regularly make changes to
ace is better, easier tohandle
yeah cole.
i once made a modular kit thing with ace addactions but it was to complicated and not very dynamic
@stone totem how about you just make an arsenal that allows all the stuff in the default loadouts?
bc the only way to ONLY allow loadouts but not chnagning them is probably the addaction kit
People would start searching through the arsenal and would waste time
... I know them to good 😦
That’s why I use addAction kit boxes in my milsim haha
No clothes shopping
Just grab the kit, weapons and equipment from the boxes and all good to go
yeah i mean if the addactions could be fine
its just a getUnitLoadout, setunitloadout probably
I personally don’t do it thst way but it might work
Just grab the local user from the _this variable and add items and remove items
that would be the most dynamic way. get a couple AI guys, dress and equip them in the ediotr and have a script that gets all their loadouts and makes them available as addactions
that way you can adjust for every mission easily
kinda like in a clothes shopping store with mannequins lol
Yeah
That’s actually a genius way of doing it
Do you think you’d be able to change it via Zeus arsenal?
Not that I would want to but out of curiosity
hm i guess you could build it so it detects loadout differences and then redo the addactions
OR you have the addaction not store the loadout but get the loadout from the unit at the time of calling
thats probably better
so the addaction just has the varname of its "mannequin" and pulls the loadout upon being executed
Just dynamically get the load out every time yeah, I guess
Would actually be very useful for my units training mission as well
Not only would the load outs be dynamic but also would be good to have the mannequins for equipment overviews
yeah and players could have some kind of decision
also that way you could allow to have generic slots that dont have a designation and inside the mission decide who gets what role + equipment
add a line that checks for the mannequins medic and engineer ability and add/remove that to the player as well
is there some means of parachuting a player
I used this:
but I'm getting some error within the function
_unit = _this select 1;
_unit action ["Eject", vehicle _unit];
[] spawn {sleep 3; [_unit] call BIS_fnc_halo};
HALO feature is already implemented in Arma 3. Using this function will result in incorrect behaviour and animation.
I want the units to keep their backpacks though
_chute = createVehicle ["Steerable_Parachute_F", getPosATL Player,[],0,"NONE"]; // Create parachute
player moveInDriver _chute;```
something like this indeed yes ^
Thanks 😄
Why am I being knocked unconscious when the parachute gets spawned and I get moved into the driver seat?
clipping with anything?
velocity too high?
Alright team, asked this over on the multiplayer channel and crickets so here goes. Can anyone tell me which files are run when a player connects to a dedicated server? I ask because my mission works well - unless someone joins after it has started, replacing an AI teammate - if that happens they are invulnerable until they force respawn. I can't change it through the console by doing "player_x allowDamage true" or even "player_x setDamage 1"
mods?
CUP, NIArms All in one, FHQ Weapons pack. That's it aside from DLC
oh, and CBA_A3
i'll see if i can test run it tonight without any on w/ exception of DLC required to run the mission
It seems related to another bug where if a player leaves and rejoins, although they are still shown in the squad (co-op mission) they are civilians (purple if viewed by zeus)
made me rack my brain on the second one because normally side is determined by group
sounds like a weird script in a mod or the mission 🤔
I agree, that's why i wondered what files are run when a player connects
well, unless you use init fields
AHA!
https://community.bistudio.com/wiki/Event_Scripts
and those are just from the mission
i bet i have some old entries in player inits, Lou, from before i scripted everything
like version .0001 of this mission
i will take a look!
thanks
dem init fields!!
@exotic flax Terminal velocity, yeah
@random loom Negative, chute is set to deploy at 200m above terrain.
Thing is even at terminal velocity, it works as long as I'm above sea...
If I'm above a town or some buildings, I just get knocked
Try setting player position somewhere above the ground
and then move them into the parachute
Ok ... now I think I did not understand something completaly fundamentally ...
_this addaction[_soldierRole,{player setunitLoadout (getunitloadout ARSENAL_SOLDIER1)}];
I try to extract the role from ARSENAL_SOLDIER1 and have this as an interaction entry for my box.
The interaction works, but the menu is empty. Thats why I think I completaly misunderstood the thing with the call of addaction.
Question.
I call
The "" is a String.
If "roleDescription" gives back a String. Why cant I just put my variable in there and go? What am I doing wrong?
roleDescription cursorObject; in a watch field and look at the unit
ok ..... hmmm. let me google to find out what a watch field is ^^
in the debug console
there are 4 entry fields under the console
with the title "watch"
these print out a value returned by the command/script in the field to the field below the watch entry
at a set interval which you can find in the biki and i dont care to google
i have a quick question, does anyone here know a good "Structured text" editor for arma
except for the 7erra one?
ok. Thanks Nica. I will try it from here. Thats the best way for me to learn.
Thanks a lot 🙂
any XML text editor?
Notepad will do the job IMHO
notepad++
yes, arma
euh, where?
if i remember correctly, the GUI editor (Although horrid) has some preview functionality
but arma 3 is well capable of displaying its own structured text type
hm, true
i've jsut used the gui editor before
but you can jsut save your structured text into a variable and have a control display it from that variable and refresh when it changes
well, what i need/want, is a text editor that displays the structured text as it will be shown later in the game itself, and that its scrollable
yea, i know
i know what you want, but the game itself offers this
👍
tge best way to know what the text looks like in-game is to view it in-game. And since arma 3 can refresh your control elements live at any rate you wish, i dont see why you would need anything else
turha mennä merta edemmäs kalaan
Useless to head further than the sea to fish
thanks @ebon citrus . It worked. And it does not have a Roledescription ^^
I did
is the unit playable?
I think it only appears when the unit is played or AI controlled
but i dont have it on playable
ah .... yes no its not 😦
i have a hunch it's voided if the unit is not playable
jea. Need to find something else then
setvariable and getvariable
can be used in init-field, but remember to set the effect to local only if you use it in init
please read https://community.bistudio.com/wiki/roleDescription KK's note
and there it is
ok. gonna find something different. Actully the getVariable is an idea. I will see
need to go pick up my wife.
Thanks for your help people.
I think I am getting better
i think .... 😄
@winter rose Pierre's note is more valid here
but good to know that one aswell
very rarely use the editor though
(yep - read both, thought one)
I increased the dropping altitude - I think that fixed it somehow...
so you were hitting the ground?
can i see what you wrote, just out of curiosity? @slate cypress
I still wasn’t hitting the ground. Something would just knock me unconscious as soon as the chute spawns.
Yeah I’ll post the code in a little bit. I’m afk atm
so apparently BIS_fnc_moduleLightning deletes the thing it targets. Wanted to create a scene where a plane gets hit but instead of blowing up (or nothing happening rather if I have allowDamage to false), it deletes the plane completely
Doesn't seem to act like when a Zeus uses the module itself.
there is a nice storm-script from a guy called "alias". he did a lot with lightning etc. perhaps you can find something there.
you can find it on armaholic and on youtube (with the links in the comments)
i just had the lightning target the pilot which sends the plane careening. it works for what I want
löl 😄 .... good that I am not a pilot in your missions 😄
its AI this time. just for an opening scene
making a "lost" type of mission for my unit with a little twist
ah nice
what I do need though is a command that plays loud enough for people inside of a vehicle to hear it. playSound gets seriously attenuated when they are in first person
and since they are on veteran, I can't use switchCamera to force them into 3rd person for the playSound since it autothrows them back into 1st person
is playSound attenuated though? I thought it was only 3D sources 🤔
ummm let me see if there is a recording from the last op to show you @winter rose
example of playSound while outside of vehicle
https://youtu.be/re6ZH_SR2EU?t=256
example of playSound inside a vehicle
https://youtu.be/re6ZH_SR2EU?t=1200
two different time stamps
@tribal trellis @spark turret
So I tried what you said about the addaction on the arsenal.
The Basic Addaction worked but I wanted to try the smartass-way and tried to automate things.
My idea was that the arsenal basically extracts all the loadouts from all units that I sync on the arsenal.
Thats how my function looks. The call works, etc.
But I think he does not like the ...
```... line
I have the feeling that he simply does not catch the syncroed objects.
But so far I like the idea .... :)
_this = param [0];
private _namesOfUnits = [];
{
_namesOfUnits = name _x;
_this addaction["_namesOfUnits",{player setunitLoadout (getunitloadout _x)}]; //for the record ""_names****" is for testing
} forEach synchronizedObjects _this;
naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah
real keyboard mash moment
Yup I know the feeling
Can't use loops for addActions
what?
{
private _unitName = name _x;
_this addaction[_unitName, { player setunitLoadout (getunitloadout (_this select 0)) }];
} forEach synchronizedObjects _this;
```(or something close)
ta-daaa @stone totem
when this works I gonna marry you
till then, I first want to understand some details ^^
but please let me find this out myself 🙂
ah well, nothing, I can do 🙂
what is this pointing at? _this select 0
First provided parameter
Look up there params passed into addaction. They differ fron normal execVM f.e.
Like it has a caller and target param iirc
_this select 0 = the unit/object holding the action
_this select 1 = the unit that used the action
_this select 2 = action ID
params ["_target", "_caller", "_actionId", "_arguments"];
Ah now i get it. Each mannequin will get an action where you can get its outfit
I think I just need to test it ^^
Keep in mind it has to run local to every client since addactions are local
To be MP compatible
hmmmm. Not sure if this works then. Since now I called my little sqf from an objects ini in the editor
Yeah thats fine
The object init gets executed on every client and the server on missionstart and on every client who joins later
ah ok
Same for init.sqf
good to know
So I just tested the script myself
me to. did not work for me 😦
Neither, I found out why though.
The script given above will basically look for objects synced to a unit, not units synced to an object.
} forEach synchronizedObjects _this;
The line above is where the issue lies. I personally can't see a way around it but maybe there's a function I've yet to use.
😮
How about group them together and run it from a units init with units group _this;
What do you think. Would he check it, if the object I but this in the Ini-Line is actually a unit?
so checking for units linked to a unit?
What do you think. Would he check it, if the object I but this in the Ini-Line is actually a unit?
@stone totem
I dont understand a single thing
welcome to my world
thats basically how my live is since I started working myself into scripting ^^
Lol
lmao
So how I understood it, the problem is that the item I put my code in, is an object and no unit
but the sychronizedObjects checks for synced objects that are synced to a unit .... at least how I understood it
you know what. I will simple try it
simply
"This command only returns the synchronized objects when used on intelligent objects such as units or logic objects. All other objects returns an empty array."
So maybe try and use a unit or game logic to run the code from
Whats wrong?
1 sec
I syced to units on a third unit. he offers me a menue with the loadout from the 2 units. but when i select he gives me the loadout from nr3
I think I know where the failure is. Just need to find out how to fix it. 🙂 .... But the most important steps are done
THANKS GUYS! ❤️
and girls may be ... who knows
I know whats wrong
You code adds all actions to one central selector mannequin but gets the loadout of the unit its attached to =》 the selector mannequin
So you can either pass the other units names into the addaction and get their loadouts or add 1 action to every mannequin instead
So yeah it the "this select 0"
that is why I had "getunitloadout _x" in there. But he does not like that
Yeah the addactions code is run outside your script so it doesnt knlw any variables yiu have defined there
You have to tell the addaction which variables to keep for later use.
so i need to pass _x into another variable every cycle?
a little like unitName
I will just try
Thats not the issue. The variables name doesnt matter
oh yea i understand
But the addaction has a field where it takes in variables which it should store:
arguments:Anything - (Optional, default nil) arguments to pass to the script (will be _this select 3 inside the script). If Array is used as an argument for example, its first element reference would be _this select 3 select 0```
So you can put _x there, the addaction will storw the value of x for later use and then you can call/use that with _this select 3 which in yourcase will be _x => the units var name
so _this select 3 is basically just a reference on _x when calling the function?
_this is an array that holds the valued the addaction gives it. Position 0 in the array is the object the action is attached to, pos 1 the unit that uses/calld the action and pos 3 is the values you gave to the action in the "arguments" part
so _this select 3 is basically just a reference on _x when calling the function?
@stone totem
Yes but keep in mind it has the value that _x had at the moment of the actions creation. It does not change when _x is changed
Like, it kinda copies your homework, so if you change yiur own homework again, the copy is not changed.
OK ... I got it. But wtf. ^^
Yeah i know it gets complicated fast if you dig to deep
I already said to my wife .... I learned many programming-languages in my life. But this one is by far the worst ..... ^^
Lmao
Its actually kinda cool to have an environment where you can just input some code and get immediate results to look at.
But as soon as you want to do more than like spawn a flare, it becomes a shootshow
i wish arma 3 had pointers you could pass as arguments
SQF is undoubtedly one of the stinkiest languages out there
ok ok ok ... sorry I did not want to start something here ^^
haha
I still hope they go to c# or sth for arma 4
but seriously @spark turret thanks for your very detailed explanation
Please
Anyway. Good night and thanks again for all your help 🙂
Hey all. Trying to make a radio play music. I'm using this (which does not work at all). ```sqf
playSound3D ["a3\missions_f\data\sounds\radio_track_03.ogg", Radio1, true, (getPosATL Radio1), 5, 1, 100];
i have it in the onActivation field of a trigger (any player present)
I am not sure, but have you tried "\a3\?
I hadn't, but just did. It doesn't seem to make a difference, game throws no errors.
of course, I want to know so I am firing the game 😄
Help me Lou, you're my only hope
are you sure the trigger triggers?
Help me Lou, you're my only hope
Star Wars intensifies
works in Eden for me
...wut
I can't stress it enough, but read the wiki 😁
and in general, when you want to debug something try to boil it down to the simplest - no MP, no "mission scripts", no nothing - a test.VR mission that does only what you want to do
I found even with the ASL pos adding params to playSound made it very quiet
Hey im just getting into scripting for my missions, I am planing to create a simple script that rotates a light cone object using the setDir command. Is there anyone with an idea on how to loop this command? Also since im new I dont really know how to call said script, could someone give me some pointers?
you could loop it with e.g while
something like that maybesqf myObject spawn { while { sleep 0.01; true } do { _this setDir (getDir _this + 0.1); }; };
yeah i was constructing something like that, cheers mate, will give it a try
And how would i go about calling the script? I have written basicly what you gave me in "light.sqf" in the mission file
nvm figured it out, cheers mate!
REDACTED my pleasure! 👍
haha this is gonna be dope af
how would you go about terminating this script? do i have to add another param that is checked along with sleep? that way i can change the value of the second param and the script stops
private _scriptHandle = myObject execVM "light.sqf";
sleep 60;
terminate _scripHandle;
just out of curiosity what does the "private" do?
alright, will read that. also terminating does not seem to work?
first i run
private _light = lamp6 execVM "light.sqf";
then i run
terminate _light;
but it does not terminate
ah yes, but where do you run this?
now im just trying it in the debug console
Ah, yes
This is the "private" thing - the variable only exists on the first execution (because 1 execution = 1 scope)
If you want to get it across scopes, use a global variable.
From private _script = to script =
allright, cheers, will try
how do I spawn a vehicle from the init field of a player unit in an mp scenario and have it register properly for other players
I have multiple player controlled units doing this and everything I've tried either doesn't spawn the vehicles, spawns multiple vehicles for each player or only spawns the vehicle for each client
@dusky drift
if (isServer) then { createVehicle stuff };
```because init fields are _baaad_, and are run for every network machine
aight I'll try that
Hi ! Does anyone know how assignItem works behind the scene ? It seems to work for everything except primary, secondary and handgun weapons
@void badge
Assigns existing item from inventory (uniform, vest, backpack) to a correct slot. If the slot is occupied by another item, it gets replaced.
weapons are not items
use addWeapon to assign weapons
remember that binoculars are weapons
and HMD are items when in containers
just use linkItem
i noticed an error in my script aswell... well, not an error, just inconsistency
i lost some hairs to do with the HMD, binocular and item slots
ended up making NCA_fnc_itemType to differentiate HMD and BINOCULARs into their own itemtype
Add weapon does not assign a weapon
it creates one
I'm trying to assign items from inventory to their slot
Instead of removing the item and creating a new one i'd like to assign it to its slot
As arma does when equipping a weapon from player inventory
erm...
yeah...
delete it from the inventory and add it to the unit
that's a way that would work but you have to handle weapons details such as ammo count
yes?
it's all in there
make your own assign weapon function or explore the depths of the uncompiled scripts
i opted for the former one
I was working on the first one but I was wondering if a simpler method was not possible
what are you making? if i may ask
an inventory display
an alternate inventory?
yes
i happen to dable in that:
(video linked below)
https://streamable.com/0st5kc
indeed, looks nice and clear
how did you handle the transfer of item from inventory to their slot ?
feel free to ask when you start to get into the problems
the way we discussed above ?
yep
delete it from container and assign to unit
also, not all the things in arma 3 biki related to inventory work
some just... dont work
oh, you didn't work on the inventory to slot part of the inventory
oh non yes you did my bad
from container to inventory slot, you mean?
not used to arma 2 inventory style
it's ok
i meant an "equip" action
there's a humble 104 KB of sqf that went into this
from inventory to slot
yeah, you can do that
from backpack to inventory
works the same as container to inventory
since backpacks are essentially just containers parented to the player
atleast that's how the engine views them
most likely something carried over from arma 2
same deal with clothes
vests
this one is also golden:
https://community.bistudio.com/wiki/everyContainer
also useful:
https://community.bistudio.com/wiki/everyBackpack
although, if youre making an inventory overhaul, like i did, you WILL have to go through every single one of the inventory commands at some point
and get a thorough understanding of the guts of the inventory
it's a fun ride with many slopes and turns
yes i'm already deep into it ahah, coming asking here was the last resort to get informations about BI inventory functions
I'll use assignItem function when possible otherwise gonna use the delete/add method.
I still would be interested in taking a look at the uncompiled code there may be about the inventory
linkItem is also a good one
Yes but it creates the item, I need a function to handle already present items
assignItem working for weapons would have been ideal
not convinced removing/adding is how BI handles its inventory actions
these all work with assignItem: [<Map>, <Compass>, <Watch>, <Radio>, <GPS>, <NVG>, <Binoculars>].
indeed
but i feel like the reason for assignitem not working with weapons is the same reason you will have fun with it
BI dev looked at the weapons and said "dear lord, this is complicated, i shant do this"
and left the script as "MVP"
that's all just my funny talk
i made a script that handles moving and removing items, assigning them and so on
you pass it the container, target and item class(array or string) (any specifics, if it has attachments)
It means we may find the dirty add/remove method in BI inventory ahah
the add-remove is essentially what it all boils down to
you dont "move" things in the computer world... well, you usually dont
you copy and remove
yes but engines can handle such transaction a certain way
yes, but in the end it always boils down to moving data from one variable to another
which means the data is removed from one and added to another
not arguing at all, just trying to make it sound a bit more reasonable
yes sure it's reasonable
that's why i myself didnt really like the assignItem command
it's inconsistent
i'd rather deal with all data in a consistent manner
less exceptions
still looking for juicy functions that avoid having to write code that need to handle edge cases
oh, boy
believe me
it wont be the edge case
have you dwelled into dropping and taking items, magazines and weapons from containers?
welp, you'll find that assignItem IS the edge-case
yeah I reworked this part but got rid off the arma "container" part. I use variables to simulate contents. It allows multiple inventory in an object, such as a glovebox/trunk on a vehicle
setvariable?
ahah
i just distrust setVariable
im not sure of the performance impact of having large variables having to be synced across network for JIP
Grez, any idea?
yes that's always to take into consideration when broadcasting variables
I was just wondering how bad server performance would be when using set/getVariable on large scale
i mean, containers are synced somehow globally aswell
but im not sure if this is done in more efficient manner than setvariable
I stocking inventory item in format [ [ 'item_1_class', 'item_2_class', ... ], [ 'item_1_count', 'item_2_count', ... ] ] to avoid large inventory payload
default items player arma format can be large
could be
but items are probably updated one by one
not the whole inventory
setVariable needs to update the WHOLE variable
across the network
setVariable already has an interesting note:
The variable space of the object is local to each client and by default changes are not broadcast.
Since Arma 2: If the public parameter for supported types is true, the value will be synchronized also for a JIP player.
you want to brodcast changes across networks
unless you have some subscriber-status system
you can also specify a owner id to share it
yes
prolly the "best" way is to have the access points available in configs (client-side) and run a simple function to ask the server for the contents (so storage remains on the server, including updates).
and sync changes only to server and subscribed clients?
clients who open the inventory subscribe to it
Nica, seems we're thinking the same 😉
store data server-side and reguest on inven tory open?
that's a method I used when data is not accessed very often
it's the method i use for my project
when you open an inventory, you subscribe to any updates to that inventory
any updates to that inventory on server-side are sent to you
subscription happens at the same time as you request the inventory contents
when you close the inventory, the subscription is nulled
Oh
this way you dont have to send countless player inventory and stats data across an already saturated network
I have a mutex on inventories so players can't open them at the same time. I only update the inventory when inventory is closed
what if a player disconnects when an inventory is open?
ahah let's go into the tricky part
i know exactly what youre doing
when doing modification I save the current inventory state in the player profile
1 point accessed 100 times:
setVariable/getVariable: broadcast 100 times, to all players- "serverAccess": broadcast 100 times, 1 time per player
100 points accessed 1 time:
setVariable/getVariable: broadcast 100 times, to all players- "serverAccess": broadcast 100 times, 1 time per player
So in both cases, serverAccess is better 🤷♂️
Not to mention "security", especially in a PvP environment
facepunch did the same with rust in early days
simple point, dont
there's a reason they dont do it anymore
and log server with inventory when connecting
exploitation prone? Very
yes who cares
also, what if you edit a vehicle?
who wants to create a log for himselft i mean
will that vehicle's inventory remain locked?
yes
yes
I open a vehicle's inventory and take some items from it, then i disconnect when the inventory is open
variable is player guid so inventory wont be lock if player disconnect in it. You can check if guid is connected when opening the menu
the item-changes are not updated to server on the vehicle, what happens?
you've duplicated stuff
ahah
tsk tsk tsk tsk tsk
but I mean owner would still have a notification
sure
unless you've cleared you trace but who knows where to look
i dont mean to say your way is wrong or it couldnt be patched
it's a valid way of doing it
maybe not all convenient, but it works
just...
dont get discouraged
there is a lot to arma 3 that you have to do in a weird way
but it's all doable
take it from me
i made arma 2 inventory in arma 3 from the ground up
For single player it could work, it would just create a a huge file on the computer.
For MP it's the worst thing to do to let clients handle important stuff like that.
handle what ?
handle trusted data
"inventory"
"health"
etc.
Grez has a point, but it's only one point
inventories, scores, currency, etc.
having to remote call on the server on each inventory action would have been horrible in my opinion
it just takes a bit more work to make it work, but will prevent a lot of extra work afterwards after people complain about "hackers"
Grez, i hope you respect their way too
we're here to advice, not to discourage
i will note that it's not secure
but this is arma
nothing is secure
🤷♂️
again, depends on how you script it... which most people can't do correctly 🤷♂️
if someone has enough dedication, they will get through every single barrier you set
yeah, but i feel like this is a first time for him
Indeed
first things first, get something working
i made 3 different iterations to my inventory until i was happy with it
each one from the start
learning a little bit more on each try
Have to trust BE and filters
in god we trust, others we monitor
Ahah
Even god is monitored
I'm always happy to help a compadre(buddy) tackling the guts of arma 3 inventory
move to object, scroll mouse wheel down, click "open inventory" 🤣
Although believe me, there are worse quirks in Arma 3 ;)
For example the loadout system; for which there are 2 ways to do it, which both are (semi-)required and not 100% compatible... Making sure you need to do the same stuff at least twice to make it work...
make an engine function
it doesnt work
someone reports it not working
intended behaviour

more
otherwise it will break other stuff
that aswell
"we cant fix it because it would break things that depend on it being broken"
"it is too late to fix this"
I am having trouble removing an addAction after use, via hideOnUse Boolean. Action still remains after use…?```sqf
/* your code */
intel1 = false; this addAction ["<t color='#00FF00'>Search Body", {intel1 = true}, nil, -10, true, true, "", "", 5, true];
hideOnUse will just hide the option when selected, but won't remove the action completely.
2 things you can do are:
- set the condition (param 8) to check if intel1 is false
- remove the action completely with something like this in the script part (param 2)
{ intel = true; (_this select 0) removeAction (_this select 2) }
Thank you for the detailed response! I used your 2nd recommendation and works perfectly.
Hi guys I made this small code to make my dialog have a loading screen which spins but I’m not sure how to make it loop around so it actually spins instead of just staying still. Can someone please help me make it so it loops and spins? I am very new to sqf so all help will be very much appreciated! with uiNamespace do { display = findDisplay 999210; ctrl = _display ctrlCreate ["RscPictureKeepAspect", -1]; ctrl ctrlSetPosition [0.43875,0.46777778,0.2,0.279999]; ctrl ctrlSetText "A3\Missions_F_Exp\data\Img\lobby\ui_campaign_lobby_background_tablet_radial_left_ca.paa"; ctrl ctrlCommit 0; angle = 0; onEachFrame { with uiNamespace do { if (angle > 359) then {angle = 0}; ctrl ctrlSetAngle [angle, 0.5, 0.5]; angle = angle + 3; }; }; };
I'm not very familiar with UI stuff, but I have the feeling the the namespace stuff is not needed at all and the onEachFrame might be a bit too much and a simple while {} do {} with a short sleep would do perfectly fine as well
anyone here know anything about DMS for exile and why it might fail (defent mission system)
Hey, I'm looking to setup a 2d polygon triangulation script to draw custom shapes on the map, I'm already working on one at the moment however I was wondering if anyone may already have something that may achieve this or any experience any models that could share some knowledge on it?
hey i'm trying to get the Hold Action add to work, i've pretty much just copied the example but I still can't get it to run, anything looking glaringly wrong here?
[_DataPad,"Download Intel","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa","_this distance _target < 3","_caller distance _target < 3",{},{},{},{},[],5,0,true,false] remoteExec ["BIS_fnc_holdActionAdd", 0, _DataPad];
Any error?
hang on i was just trying
this addAction ["Download Intel",{[this, player,1,part1 = true];}]; and it sure didn't like that either. i'll go back and run the other one
uh yeah 3, none in eden but all when the game starts.
was playing around with stuff trying to fix it but no dice, that's why i tried the other one
ok yeah 2 of the 3 errors where ace, but the one that wasn't was
'...get <3",{}.{}.{},{},[],5,0,true,false] |#|remoteExec ["BIS_fnc_holdActionAdd", 0, ...'
Error Type Any, expected string, bool, object, group
Tried removing the empty brackets and leaving the ","s but that's not it either, i'll keep having a play around
was sticking this all in the object's init
https://www.youtube.com/watch?v=SOfmrAk-k1c
Found this though so i'll try that once i get some more time to muck around with it
However, still wondering, how would i change a bool in an addAction/holdActionAdd code? "part1 = true" doesn't seem to work like it does when using trigger "on activation"
[
_myLaptop, // Object the action is attached to
"Hack Laptop", // Title of the action
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Idle icon shown on screen
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Progress icon shown on screen
"_this distance _target < 3", // Condition for the action to be shown
"_caller distance _target < 3", // Condition for the action to progress
{}, // Code executed when action starts
{}, // Code executed on every progress tick
{ _this call MY_fnc_hackingCompleted }, // Code executed on completion
{}, // Code executed on interrupted
[], // Arguments passed to the scripts as _this select 3
12, // Action duration [s]
0, // Priority
true, // Remove on completion
false // Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", 0, _myLaptop]; // MP compatible implementation
This is a working remoteExec example.
See https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd for more information
@torpid quartz
yeah that's what i was using to make mine, that YT video had another method where you put it in a SQF so i'll try it again there.
Hey um I have a question I don't know if this is the right place to ask, but how do you make AI talk while hearing what they are saying with their voice?
You mean lip movement?
That can be turned on and off. But sounds are a dumb system, iirc there is no way to tell if a sound os still playing so you have to time the lip movement
So it might get a little complicated
ok thank you
You should test if thats a local or global command
Bc setFace is local; so i assume setRandomLip might be too
Do you know the difference between local and global?
I recently got into learning how to script so it may be confusing for me, but I'll eventually figure it out.
you have say, that will use soundFile+lipFile by itself.
otherwise and for more complex but rewarding setup, there is the Conversations system
The Konversation system is not rewardning at all
It took me so long to figure out, it would have been faster to make my own convo system
and now you know it, you can use it easily
as everything, you can either learn or do it the hard way. There are good reasons they created it
No. We hates it
You hate it huehuehue
In singleplayer all objects are local correct?
@tough abyss
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting and https://community.bistudio.com/wiki/Code_Best_Practices for Arma Scripting
https://community.bistudio.com/wiki/Conversations for the Conversation system
I demand that on the new engine, the sound and convo system are to be reviewed by me. To ensure its fool proof and intuitive
In singleplayer all objects are local correct?
yes, correct.
for MP scripting, see https://community.bistudio.com/wiki/Multiplayer_Scripting
@tough abyss ↑
BI devs are not gods, they make things their iwn way and sometimes your thought process doesnt match theirs. Especially in programming this is evident. What might seem inuintitive to you, is actually pretty reasonable to them. Also there are just honest mistakes and inconsistency left by demand for legacy support
No idea this goes #arma3_scripting or somewhere else though... What determines the direction of a ladder? I know (configFile >> "CfgVehicles" >> typeOf _house >> "ladders") have ladder data, but there's no direction data it seems. How do I get direction of it?
It might have some mempoints
This too
Check the lods for triggers and selections
With the next patch, we should be getting some more fun related to that
Other than that I appreciate the help.
There's nothing I can see. Tried selectionNames "memory" to a solar tower which has 3 ladders, but everything I got is: ["ladder_1_start","ladder_1_end","ladder_2_start","ladder_2_end","ladder_3_start","ladder_3_end","door_1_axis","door_1_trigger","light_1_pos","light_2_pos","light_3_pos","light_4_pos","dam_1_effects"]
Fair point, but let me see something. I think something useful came to my mind
And didn't worked
I'm also trying to make a unit where he is a hostage including using the animations "Acts_ExecutionVictim_Loop" to show he is tied up and "Acts_ExecutionVictim_Unbow" for when you untie him. Any examples?
switchMove and playMoveNow
Thanks
@warm hedge
Seems to me like you missed something
Ladder 1 start, ladder 1 end
Ladder 2 start, ladder 2 end
?
These are OBVIOUSLY the starts and ends of the ladders
They are
So draw a line from one to another and you have a ladder
I thought they don't determining the direction, but I was wrong
Yes, the direction is the vector direction form the start to the end
As #arma3_model responded so
no, no, no, and no.
What are you talking about?
not the line direction, more like the ladder's orientation
the "ladder facing", if you prefer @ebon citrus
So what is the model's direction
I wish you could get a rotation of a memory point, but they dont have that
Did you find a conclusive answer?
And worked well
I guess the player is positioned on the ladder through some algorithm that gets a point on the ladder from above. Like projecting from the top of the bounding box, if that makes sense
A 2d bounding box... so a plane?
If you view the ladder plane from so that the slope starts from the left bottom ( of a x-y coordinate spaxe) and goes to the right top, then it would be pretty simple to do a function that determines where on that ladder the player should be positioned. This way you also save data on the rotation of the ladder... and effort. Not sure if intentional or not, but it's clever
Might yoink
When using a trigger which is synced to a "set task state" module, does it matter whether the trigger "server only" box is checked or not?
The condition is simply "is there a driver, if yes, return true"
there is no activation code, simply relies on sync
I'm wondering whether "server only" only applies to activation code or if it applies to syncs also
I could not tell; it would be more #arma3_editor-related, hoping there are experts there
Server only will execute the code only on the server
Hm also evaluate only on server iirc
So to avoid being triggered for each player
again, #arma3_editor for triggers/modules matters
Why doesn’t the errors in this game tells you nothing
Such as generic expression error
because if it told you nothing, you would not know the issue (beware of the double negative)
sometimes, the game cannot figure it out
I wish the game provided variable dump by default
Why doesn’t the errors in this game tells you nothing
It is underdesigned :/
Your best option is to use lots of logging
Hint and diag log
Also usually the game tells pretty percisely where tze error is
Just not why
just generic error should never be printed
it should always ALSO print the actual error.
if it doesn't its a bug. I have a ticket where the ingame error overlay doesn't state the correct reason for some warning type
there is a difference between scheduled and non-scheduled too no?
generic error prints when you make a generic error
usually syntax issues or scheduled command such as sleep in unscheduled environment
to my experience, Arma 3 gives a lot more useful error information than some C compilers
Syntax is good, runtime is terrible. Like this value is nil. Ok, there might be 100 reasons why it can be nil 🤷
Would it be terribly hard to add stack dump on error to base game? Lots of people would find it useful.
Would it be terribly hard to add stack dump on error to base game? Lots of people would find it useful.
it would not, afaik it's planned if Dedmen will have time
Why it was not added in the first place by earlier devs, 
Dedmen might 👀
Hello everyone, I am working with a COS script, and I was wondering if there is a way to only give the ''hint'' to the person triggering the action
Something like this, but I don't like the ''hint'' there
_unit addAction ["TEXT", {hint "TEXT"}];
hint effect is local, so it by default does that.
(what is COS btw?)
oh
Hey everyone.
I remember that there was a mod released that helped give an overview of all the character animations. Anybody recall the name/link?
…the in-game anim viewer?
Would it be terribly hard to add stack dump on error to base game?
no, we already have that as internal diag command.
Not sure if we'll release in public build, or just profiling/dev branch
release, with a -showStackTrace param?
I wanted to just integrate with showScriptError
Not sure yet, that's why I only made internal POC for now
noice
…the in-game anim viewer?
@winter rose
Thanks, but I'm not referring to that.
The Splendid animation viewer is a bit flawed. Eg: I used the various drop-down menus to select a standing, unarmed, walking animation. The result was a prefixed "AmovPerc...". However this list ignored a much better animation that I had found in another mission, "Hubspectator_walk".
So the question is maybe where I can find a complete list 😅
all the animations exist in there; most likely listed under Cutscenes
(but to answer the question, I don't know that mod)
(it's there indeed, no animation is forgotten) 🙂
so im very very new to arma 3 scripting and scripting in general, im working on a lock 1st person script and ive gotten everything work except for when youre in the passenger seat, is there a variable im missing , i cant seem to find it the currently script i have rn is "//1stperson
addMissionEventHandler ["Draw3D", {call {
if (cameraOn == player ) exitWith {player switchCamera "Internal"};
if (vehicle player != player) exitWith {player switchCamera "gunner"};
if (cameraOn == _vehicle && cameraView == "External") exitWith
{player switchCamera "internal";
};
}}];"
@tribal trellis @spark turret @winter rose I made the arsenal script. It works.
But I bet I will end up in a special section of hell, just reserverd for people like me ....
I hardcoded the addarsenals ... no loops
Anyway: Just wanted to thank you guys for your help. Would not have get it done without you. ❤️
No problem, sorry we couldn't find an efficient solution
it works now 🙂
Oh lol I misread
and thats what counts
Either way np
Any particular reason you hardcoded the addactions?
@vestal estuary In the last if you use _vehicle, that variable is undefined in the Event Handler function's scope.
The truth is I needed to get finished cause it looks like the mission will be this Saturday. 😆
ah gotcha im also running into that gunners are locked in the gunner cam in heli and what not, and cant switch between 1st and gunner cam
But it's not completely hard-coded. It still extracts up to ten loadouts and even detects how many are synced.
I'm not very familiar with UI stuff, but I have the feeling the the namespace stuff is not needed at all and the
onEachFramemight be a bit too much and a simplewhile {} do {}with a short sleep would do perfectly fine as well
@exotic flax But this small code is working fine it is displaying the loading image but I want it to loop around so it actually looks like its loading. I'm just not sure how to make it loop...
show what you have?
i'm not getting the problem
ah, i found it
"angle" is a bad name for a global variable
but uhhh, what's wrong with it?
also, dont use oneachframe for that
something might override it
@ebon citrus I am trying to create a loading screen like this (https://youtu.be/uyPYtgU2LGo) but I'm not sure how do actually make it load in circles. You get what I mean?
I'll show u what i have
damn my game crashed 1 sec
There you go
Thats what I have
I'm trying to achieve https://youtu.be/uyPYtgU2LGo
also, dont use oneachframe for that
@ebon citrus What would I use how would I do the script then?
_ctrl = _display ctrlCreate ["RscPictureKeepAspect", -1];
_ctrl ctrlSetPosition [0.43875,0.46777778,0.2,0.279999];
_ctrl ctrlSetText "A3\Missions_F_Exp\data\Img\lobby\ui_campaign_lobby_background_tablet_radial_left_ca.paa";
_ctrl ctrlCommit 0;
_angle = 0;
while {true} do
{
if (angle > 359) then {angle = 0};
ctrl ctrlSetAngle [angle, 0.5, 0.5];
angle = angle + 3;
};```
Maybe like this I will test now
@tough abyss where is this code running?
where is it called from and how?
also, as i've been let to know, the best replacement for onEachFrame is missionEventHandler for frame or draw
@tough abyss your problem is here:
_display = findDisplay 999210;
_ctrl = _display ctrlCreate ["RscPictureKeepAspect", -1]; <---------------------- "_ctrl is a local variable"
_ctrl ctrlSetPosition [0.43875,0.46777778,0.2,0.279999];
_ctrl ctrlSetText "A3\Missions_F_Exp\data\Img\lobby\ui_campaign_lobby_background_tablet_radial_left_ca.paa";
_ctrl ctrlCommit 0;
_angle = 0;
while {true} do
{
if (angle > 359) then {angle = 0};
ctrl ctrlSetAngle [angle, 0.5, 0.5]; <---------------------------- "ctrl is a global variable and doesnt exist?"
angle = angle + 3;
};```
same with "_angle" and "angle"
i recommend you take a look over here:
https://community.bistudio.com/wiki/Variables#Scopes
i'm not giving you "right answers" because i want you to read that article
there's a lot more you need to ingest from it, by the looks of things
dont get demotivated though
nothing wrong with not knowing but still trying
youre doing good
👍
Thanks so much. I will read the article for sure
also, enable script errors, if you dont already have
Trying to figure out to make a task where you download intel from a laptop.
check BIS_fnc_holdActionAdd, which is used in official missions as well
I will take time to read this, thanks!
How do I create the backpack right where player is?
This one puts it several meters nearby somewhere :(
thebag1 = createVehicle ["B_FieldPack_khk", player, [], 0, "CAN_COLLIDE"];
...and I can't setPosWorld it afterwards too
I'm not sure if I remember correctly but I think it might be creating the ground holder with the backpack.
Try to create the GH first and then add backpack as it's cargo.
_weaponHolder = "WeaponHolderSimulated" createVehicle [0,0,0];
Not sure if this one can hold backpacks.
or use the prop version of the backpack (when it exists)
Thanks, I can create it now, but how do I get the actual backpack object from it so I can put some items inside?
If I add items to holder, they are put on the ground next to the backpack
no, they are put into the weaponholder
@astral dawn https://community.bistudio.com/wiki/everyBackpack
this si what youre looking for
_container = "groundweaponholder" createVehicle getPos player;
_container addBackpackCargoGlobal ["B_Carryall_ocamo",1];
_backpack = firstBackpack _container;
_backpack addItemCargoGlobal "FirstAidKit";
just has some proxies to display items in it
_container = "groundweaponholder" createVehicle getPos player;
_container addBackpackCargoGlobal ["B_Carryall_ocamo",1];
_backpack = firstBackpack _container;
_backpack addItemCargoGlobal "FirstAidKit";
yes that's my current code, thanks
👍
@ebon citrus Thank you SO ducking much I finally got it working 🥳 😂
After so long I got it to work thx for linking those articles
So my tiny brain is trying to script and I'm getting an issue that I know is soooooo basic but my lack of syntax knowledge in sqf leave me powerless.
So here is what I have on an object init on the mission:
this addAction ["Skip 1 hour",{[[1],"scripts\skipTime.sqf"] emoteExec ["execVM",2];}];
this addAction ["Skip 5 hour",{[[5],"scripts\skipTime.sqf"] emoteExec ["execVM",2];}];```
and here is what I have in scripts\skipTime.sqf
```sqf
_timeToSkip = "_timeParam";
skipTime _timeToSkip;
The point of my script would be to allow users to skip time via an addaction but I need it server-sided to sync it to everyone
anyone able to spot the issue?
emoteExec?
typo in the copy pasta... remoteExec of course
emoteExec?
sends an emote to every client, since arma 4.0.3.1 xD
script is launched but dosn't do anything and poops an error on the skipTime _timeToSkip; line. I'm guessing the _timeToSkip variable isn't passed correctly
and second, remoteExec requires a function name, not a script
@tough abyss dont worry, we all were there once. Take this and use it with care in the future when you feel like you need to use it:
🔨
Yeah, you want to replace the _timeToSkip line with
params ["_timeToSkip"]
and so that line means 'turn so and so param into so and so variable' or 'accept so and so param as a thing'?
So, normally when a function is called in Arma, either via 'call', 'spawn' or 'execVM', the arguments (your [1] and [5]) are automagically put into the _this variable.
and so would params ["_var1", "_var2"] would that give me 2 vars or 1 arrays of 2 cells?
2 seperate variables, with the names _var1 and _var2
params takes the _this variable, and if it's an array, loads each element of that array into the local variables you specify.
that acctualy makes sence 🤔 thanks guys
so let me fiddle a bit more with the script ^^
so correct me if I'm wrong but my sqf just needs to be
params ["_timeToSkip"]
skipTime _timeToSkip;```
and then I need to mess with the object init right?
Yeah, that should sort the issue you were having. That and the typo are the only two things I can see stopping that working after a quick read.
👌
also, that's gendered speech, please use "l33t programmer xXcodeSlayerXx" in the future 
Is there a trick to building an array of editor placed objects? I have put down like 150+ markers for spawn locations, and I want them in an array to randomly select 1, but I don't really want to type
markers = [marker_0,marker_1,marker_2 ....... etc
is there a trick to declare like all of them like markers = [marker_0:marker_150];
@kindred lichen iterate through all markers?
and add the ones with a specific identifier to your array
_markerNumber = floor( random (COUNT spawnGuardMarks));
I'm using invisible objects, not true markers
Yeah, I made a CSV, in excel and just pasted it
missionObject with a specific type
and iterate by the variable name
sec
something i used a while back for a quick and dirty scalable method of adding more range-targets whenever:
NAC_targets_300m = [];
NAC_targets_ring = [];
NAC_targets_ring_handle = false;
{
switch ((str _x) splitString "_" select 2) do {
case "300m" : {
NAC_targets_300m pushBack _x;
_x enableSimulation false;
if isServer then {
_x addEventHandler ["Hit", {
params ["_unit", "_source", "_damage", "_instigator"];
_unit animate["terc", 1];
}];
};
};
case "ring" : {
NAC_targets_ring pushBack _x;
_x enableSimulation false;
if isServer then {
_x addEventHandler ["Hit", {
params ["_unit", "_source", "_damage", "_instigator"];
_unit animate["terc", 1];
}];
};
};
};
}forEach allMissionObjects "TargetBootcampHumanSimple_F" ;```
not foolproof, for sure
but does the job
the point is that you have some identifier in the variable-name to pick your stuff out
allMissionObjects "TargetBootcampHumanSimple_F" helps the script to ignore all objects not a specific type
works as long as your object is unique. I was thinking more along the lines of
_marker = MissionNamespace getVariable "guard_marke_"+i;
then adding it to the array





