#arma3_scripting
1 messages · Page 618 of 1
alsosqf if (voted == "false") then { easyDifficulty = easyDifficulty + 1; publicVariable "easyDifficulty"; player removeAction _actionID; voted = "true"; } else { hint "You already voted"; sleep 5; hint ""; player removeAction _actionID; };
just removeAction at the beginning
you could also remove all actions as soon as voted is set to true
y u no bool
i kept getting comparative problems when I had as the addActions show condition "voted == true" and got frustrated so I used a string
oh wait... i could have just done "voted"
im an idiot...
Does anyone know how to set up a teleportation system to different points throughout a map? I'm pretty new to scripting in Eden, and am probably in way over my head, but any and all advice and help would be much appreciated
would you accept if the person could teleport anywhere they want, or only specific points?
Only specific points
do you have ACE?
Yeah
Script function to create teleporter
https://github.com/WolfCorps/gf_scripts/blob/master/addons/gf_scripts/functions/fn_initTeleporter.sqf
Code for PostInit
https://github.com/WolfCorps/gf_scripts/blob/17606974c4d4d55d4c2583f731ee9dcfb9f9d5ef/addons/gf_scripts/functions/fn_postInit.sqf#L14-L39
Every teleporter object can teleport to every other teleporter object.
Put in into of teleporter
[this, "teleporter name"] call GF_fnc_initTeleporter
And all done
@unique sundial Regarding the free camera: Your function "transformVectorDirAndUp" (?) is in fact wrong, because the rotational axis change when the yaw/pitch/roll angles are too far off from the default state (i.e. vectorDir = [0, 1, 0] and vectorUp = [0, 0, 1])
Just fyi, transforming a free camera via rotational matrices given by the rotational/positonal/whatever values given by the Display EH "MouseMoving" is still a bad idea, because of propagation/"accumulation" of very weird rounding erros. E.g. I had very weird rounding errors just doing normed Rotations with vectors, even considering the max. floating point precision, so that's sth a dev could look into. (In know in A2 setVector-Commands are heavily prone to "rounding" erros)
Right, I'm probably being a complete idiot here but for some reason a unit with this in his init ````this disableAI "MOVE";
[this, "PRONE_INJURED_U1", "FULL"] call BIS_fnc_ambientAmin;``` isn't animating and is instead just standing there
don't disable its movement?
If anyone is intersted: Free Camera Movement is best realized by just using a x-y-plane projection of vectorDir to get the yaw (i.e. just use getDir), adding the desired rotational angle and creating a completely new vectorDir disregarding the z-component entirely. Because in free camera movement roll-ing is omitted, you can easily obtain the current pitch value by acos ((vectorDir spectatorCamera) vectorDotProduct [0, 0, 1]) + your desired pitch rotation, omitting the yaw. Then you just transform both vetors with each other and you're finished, see "BIS_fnc_setObjectRotation" for details.
I was worried they'd run off if I didn't
They don't when you use ambient anims
You can even add an event handler to be sure
Removed the part disabling movement AI and they are still just standing there
You should play the move with some delay
(and ideally not use init fields if MP)
this spawn {
sleep 0.1;
[_this, "PRONE_INJURED_U1", "FULL"] call BIS_fnc_ambientAmin;
}
Thanks, I'll try that now
@winter rose Aren't init fields executed only once upon mission start and on the server only? So I don't get the problem with the init fields
nope, they are run for the server and for each and every player connecting
Oh, that's bad!
iiindeed (unless you need it ofc)
So if you do:
if (isServer) then {}
the problem is solved?
yep
sleep 0.1;
[_this, "PRONE_INJURED_U1", "FULL"] call BIS_fnc_ambientAmin;
}```
Didn't work and spat out an error about `BIS_fnc_ambientAmin` being an undefined variable. So I tried removing `this spawn` and that didn't fix it either
Amin -> Anim
@winter rose Another MP question. If I have a unit that has a variable in its local namespace (unit setVariable ["var", var]) and the unit changes locality, I have to recreate the variable right? Or does it get "transferred" upon changing locality?
it does not get transferred, but you can setVariable with the public option:
unit setVariable ["varName", "varValue", true];```
I can't, because the variable changes often
or with the owner id if you know who the locality is transferring to
That would consume a lot of network traffic
I think there's a local event handler
iirc
(there is)
what is this variable, if I may ask?
My AI have several controlling parameters, for example, the path
There are over 100 tho
and you are considering HC now, get it
Some don't change much, some change very frequently
(or player leader)
you could make a function that would make the server "transmit" (remote exec) variables to the machine that asked them
What if the variable is saved on a machine that disconnects?
It gets completely destroyed right?
yes
So I suppose I'd have to "reinitialize" the AI in such situations
yep - or make it so the server always has a copy
Like an occasional update. Good idea
am I able to limit airspeed of an ai piloted plane? I am doing a paradrop and the pilot always max speeds through the DZ leaving half the ai parachutests to land in the forrest beyond
Use this command https://community.bistudio.com/wiki/limitSpeed
It also helps to set allowfleeing 0 for the unit
So they dont run away when theyre getting shot
can i throw that in the init file or do i need to make a seperate file for it?
nvm i got it
I do use the allow fleeing command but my plane likes to dive down and to the left for some reason as it starts the paradrop
what would be the best way to unequip an attached item from someone and have it spawn in the ground container, as if the player were manually doing it?
_wh = createVehicle ["GroundWeaponHolder_Scripted", position player, [], 0, "CAN_COLLIDE"];
player removePrimaryWeaponItem "optic_Hamr";
_wh addItemCargo ["optic_Hamr", 1];
this one works, however the ground container will still remain even if empty
replace "optic_Hamr" with what you want
https://community.bistudio.com/wiki/Arma_3_CfgWeapons_Items
primaryWeaponItems player params ["_silencer", "_laser", "_optics", "_bipod"];
hint "Attachment dropped!";
player removePrimaryWeaponItem _optics;
createVehicle ["GroundWeaponHolder_Scripted", position player, [], 0, "CAN_COLLIDE"] addItemCargo [_optics, 1];
this one removes whatever silencer/laser/optics/bipod the current weapon has, just change the orange _optics to what you need
I've been playing around with that, for some reason if I try and assign the item as a variable it fails
_nvg = hmd player;
_wh = createVehicle ["GroundWeaponHolder_Scripted", position player, [], 0, "CAN_COLLIDE"];
player unnasignItem _nvg;
_wh addItemCargo [_nvg, 1];```
what are you trying to achieve?
box addItemCargo [item, count] syntax for additemcargo
hmd player is not an item
example: supplyBox addItemCargo ["optic_ARCO", 10];
this adds 10 ARCos to the supply box
what are you trying to remove? NVGs or weapon attachments?
Yeah I get that, but I can't hard code the add item since that reduces the scope, hmd player returns the nvg of the player as a string which seems to be the failing part since hard coding the class name works
I was more looking for an alternative to spawning a weapon holder, if that is the best /only option to spawn an object on the ground then I'll just keep debugging
you have a typo
_nvg = hmd player;
_wh = createVehicle ["GroundWeaponHolder_Scripted", position player, [], 0, "CAN_COLLIDE"];
player unassignItem _nvg;
_wh addItemCargo [_nvg, 1];
works for me
and i was wrong about the hmd, yes it does return an item
oops sorry
wait
On my phone so not copy pasting, does it have to be the scripted one?
You have one too! xD
no i just copied back his script, forgot to edit it lmao
there
@jaunty ermine your script works, heres the problem player unnasignItem _nvg;
That's not the part of the script that's broken, on my pc, that's my terrible phone typing
Look at it more like pseudo code
Probs because I can't be assed typing out the whole script by memory on my phone
Was more after if there was any alternatives to the whole spawning a weapon holder and adding it as cargo
what is wrong with that tho
btw you should also delete the nvg thats in the inventory
_nvg = hmd player;
_wh = createVehicle ["GroundWeaponHolder_Scripted", position player, [], 0, "CAN_COLLIDE"];
player unassignItem _nvg;
player removeItem _nvg;
_wh addItemCargo [_nvg, 1];
use this, it works
Cause there is obviously something being lost here
If (! hasInterface) exitwith{} ;
_nvg =hmd player;
player unassignItem _nvg;
If (!( _nvg in (uniformItems player)) && !(_nvg in (vestItems player)) && !(_nvg in (backpackItems player)) ) then {
_wh = createVehicle ["GroundWeaponHolder_Scripted", position player, [], 0, "CAN_COLLIDE"];
_wh addItemCargo [_nvg, 1];
} ;```
Is what I have
If (! hasInterface) then {exitwith{}} ;
👇
If (! hasInterface) exitwith {};
Please excuse any small typos, I am on my phone and the auto formatting is a pain
hmd : Returns class name of currently used Head Mounted Display. Returns an empty string if the slot is empty.
so if the player is not wearing anyhting, it returns an empty string
Look mate, thanks for trying to help but we're just going in circles
nvm that, this works:
If (! hasInterface) exitwith{} ;
_nvg =hmd player;
player unassignItem _nvg;
player removeItem _nvg;
If (!( _nvg in (uniformItems player)) && !(_nvg in (vestItems player)) && !(_nvg in (backpackItems player)) ) then {
_wh = createVehicle ["GroundWeaponHolder_Scripted", position player, [], 0, "CAN_COLLIDE"];
_wh addItemCargo [_nvg, 1];
} ;
unassignitem just moves the nvg to the inventory
Yeah
so condition wasnt triggered
I'm not trying to spawn it unless it's been removed by that function
So of course the condition that is set only to fire if it's not in the inventory isn't firing if it's not removed
would someone be good enough to confirm that www.hostedredmine isn't working for them?
please
can't get at my bug/issue tracker 😦
Error 1001
indeed
mmm thanks mate
hostedredmine were recently acquired by planio, im hoping nothing terrible has happened. I've got 5 years of issue tracking there
Hi, I'm trying to animate the player with player switchMove "InBaseMoves_repairVehiclePne"but nothing happens on command execution. Even in a plain VR mission with the debug console no animation is played.
Any idears what could be wrong? I also tried playMovebut nothing with that cmd anyways.
Oh ok, thats good to know. I was wondering why the anim was playing in the animation viewer but not with the command. Guess in the viewer the unit is an AI.
Thank you for the info 🙂
@digital berry @warm hedge
All animations are compatible with players:
player switchMove "InBaseMoves_repairVehiclePne";
player playMoveNow "InBaseMoves_repairVehiclePne";
Hm, didn't know that workaround. Anyways, even if it could played on player unit, looked worse in FPP
yeah
head direction is always toward the "front" of the model
unless you change it yourself
not pretty
what would be the reverse of objectParent, i.e. to get the children of an object
I don't there is
there isn't any such command afaik
This actually is an idea, but... not ideal
Does not suit the condition
which condition?
as i cant get the original object to check if it's the parent. Actually, im not sure if it IS an object
ah, the weapon proxy in a unit's hand
weapon proxies are "objects" afaik
also, i would personally always steer away from iterating through an unknown number of objects
but they are hidden
mmmh...
you see, im trying to get the weapon object in order to get some memory-points from it
You cant
but it seems i'll need to spawn a copy of the weapon as a simple object and do it that way
The only way is cursorobject
That is also possible
But you can't do anything with the original weapon, obviously, because it has it's own orientation and position
wait... objectParent is checking if an object is inside a another object (and not class parent).
So... get all objects in object?
@exotic flax that's exactly the problem
Im told you CANT get objects inside an object
@little raptor yeah no, not my intention to edit the weapon object, just trying to read data from the model that is not in the config
items _object
Those positions are relative tho
If you can't get the original object, I don't see what you want to do with some relative positions
you just need to figure out relative to what
They are not
but they are
They are relative to the weapon
which is relative to the unit
so the coordinates inherit that parent-child relationship
and you don't have the weapon
i dont need it
a weapon has it's own direction and position
unless it doesnt
in arma it does
you can use weapondirection tho
that can help
but what about its position
i only need the direction of the unit
because the weapon tries to aim to the direction the unit is facing (not the eye-direction)
There is something in arma called aiming dead zone or something
yes yes yes
Your weapon can move freely in your hands without changing direction
what are you trying to do?
but this is all irrelevant for the application
im first trying to figure out if i can do it, before i say what im doing
Because I want to do it
it's a very simple idea, but if someone else can do it already, then i have no motivation to do it
Let me guess. You want to mount something on the weapon?! 🙂
negative
Laser pointer?
nope
🤷♂️ but if we don't know that what you want to do, we can't tell you if it's possible or how to attack the problem... because now I have the feeling you're making it too complicated (for Arma and yourself)
Grez, i know what im doing
and i already have my solution
i dont know why this conversation is going on anymore
yeah
but it seems i'll need to spawn a copy of the weapon as a simple object and do it that way
@ebon citrus
nm
no problem
Do I have to re-add hold actions after respawn just like I have to with normal actions?
hmm is there a way to instantly make helicopter blades stop spinning?
setDamage
@winter rose Damnit, I just wanted to answer _helo setDamage 1; but you were a second faster...
i guess hitpoint damage is more effective
engineOn false is too slow for me. there is an issue with dynamic simulation - if you leave the simulation range while the helicopter engine is still on, you will hear it everywhere. that's why i'm now trying to find ways to make it stop faster.
delete then recreate it
@west grove Yeah set hitpoint damage on the rotors, then repair them
Do you guys happen to know which weapon direction is used when you use:
AI weaponDirection ""
?
It's a valid expression! 😅
I just don't know which weapon is used as defualt by the engine when you give an invalid weapon!
I think maybe it returns wherever the "hands" are pointing!
It's a valid expression! 😅
The "👀" issue is not that, it is more about thedon't ping BI staff#rules 👀 @little raptor 😄
oh
removed
sorry
It was a question that only BI staff knew tho
Coz it's "internal"
You don't happen to know Lou, do you?
Nope, but that's because I am not hired yet
j/k, but a few tests or even 3D drawing could provide answers
good point. I'll do that
@little raptor primary weapon
Thanks
so tagging Dedmen works… *keeps note*
He was in the game, so maybe that's why! 😅
Another question. Do you know why the AI weaponDirection "EGLM" (or any other secondary muzzle) returns [0,0,0]? I mean isn't that technically a "weapon" (because you can selectWeapon it)?
it is considered a muzzle, I suppose
yes, probably, @winter rose
Yeah. Maybe. I thought since you can selectWeapon it it might be a valid weapon
I think this used to work
Maybe I'm wrong
Hello, I am having some troubles with a script
First I am a noob at scripting,
I'm on my first mission and i'm trying to make a trigger to turn TRUE when a player stares at a structure in the landscape..
(should I drop my try for the trigger's script here?)
triggers don't work like that
You can check a loop
waitUntil {
_d = player getRelDir building;
_d < 75 || _d > 285
}
For an FOV of 75 of course
If you want, you can narrow it down further:
waitUntil {
_d = player getRelDir building;
_d < 15 || _d > 345
}
Okay, I will try this then
You should spawn the code
i do some staring stuff in mission, cursorObject works for me
Yes, I have it's name "Land_TTowerBig_2_F"
ah, every mission maker blows that up lol
I need to give a variable name to the building?
something like that yes
I cannot do that, since it is structures on the map by default.
No wait, i'll just remove them and replace them with new ones I can name
you dont need to
once youve found the object you want using nearestterrainobjects
you can assign it a variable
Oh alright
Or even better
Find the object ID
Use
[0,0,0] nearestObject ID
Instead of [0,0,0], use the object's position, otherwise it will take some time for the engine to find the object.
ids can change
the ID is like the think I droped up there ?
yes
the radio tower he wants is a terrainobject
Yep
You get something like this:
b3fbdf7580# 2799081: cementworks_01_brick_f.p3d
ID is:
2799081
with a little scripting trickery, you can even make it work on non terrain objects and non destroyable ones
Okay i'll try this later
@still forum Sorry for pinging you.
So I did some tests on this:
AI weaponDirection ""
and apparently it uses the currentWeapon, not primaryWeapon
Hola once again everybody,
any chance one of you knows a way to find out whether or not the UAV terminal is currently open?
It's for my Immersive Maps mod - I basically need a way to distinguish between a "regular" opening of the map and an opening of the map through the UAV terminal.
Thanks!
@winter rose Also, regarding my last issue with "EGLM", if you do selectWeapon and then use AI weaponDirection "", it works with them too!
@reef walrus I think it's findDisplay 160
ohhhhh didn't think about that, I'm not too used to the whole UI stuff. Thanks a bunch, guys! ❤️
No problem! I liked that mod of yours!
Glad to hear that!
And yeah, all I ever did was a crappy viewdistance dialog and I was close to becoming mad in the process haha
i still use it now @reef walrus
wouldnt be any good without it
oh no... english double negatives... mission is good with it
@little raptor yep, code says current weapon, comment above code says primary weapon
Thanks for confirming! 🙂
How to change direction in an animation
Never tried it but, try setDir while in animation? @onyx sonnet
Don’t quote me on that tho
marshal1 setDir 0;
marshal1 switchMove "Acts_JetsShooterShootingLaunch_in_m";
``` this just turns to the animation direction idk tho
well your setting the direction before playing the animation
@onyx sonnet the animations don't really turn characters in any direction.
But some animations start with the character not facing its initial direction.
Try -180°, you should see that the direction is switched.
the problem with that particular anim is that it includes a 90 turn clockwise
i predict some trial and error testing
I want to create a playable character when a new player connects (with some additional logic) - but I can't find how to create an actual "playable" character. Anyone know of the command/function I seek?
_newplayer ?????????????????????```
i think you want createUnit instead of createVehicle, and then selectPlayer after that.
Yes
oh RIP
yep
tyty
mmm... gonna test it... but.... i think I used selectPlayer correctly?
format["%1 has connected to Project Abaddon...",_name] remoteExec ["systemChat",0];
private _newplayergroup = createGroup civilian;
private _newplayer = createUnit [[worldsize,worldsize/2], _newplayergroup];
setPlayable _newplayer;
[_newplayer] remoteExec ["selectPlayer",_id];
};```
@orchid stone … =
i dont know where im missing that yet, but i assuming it will become very apparent soon.
onPlayerConnected = { no
onPlayerConnected { yes
lmfao
oh ya
i literally just ran back to my computer because i realized what i missed
thanks man
@orchid stone For compatibility reasons, use the stackable version
Am I missing something?
selectPlayer requires a local argument so you would need to set the player as the owner of the unit/create the unit on the player’s game instead of on the server.
got it, adding that too. you guys are super helpful. will post my working code momentarily
(hopefully) lol
it used to change locality by itself, not anymore
Okay, i'm back. I have the ID of the structures I want to be used.
Where am I supposed to print the waitUntil { _d = player getRelDir building; _d < 75 || _d > 285 } ?
wat
i need to think about that script some more. maybe an EH isn't the way to go, or i should do the evaluation differently. my main issue is, that i need at least one slot available for someone to be able to connect (15 mins of googling found no way around it). So I'm thinking, I just make a maintenance procedure to make sure there are ## of playable characters available, and any cleanup or reset takes place when a player connects/disconnects
@orchid stone
the wiki entry to setPlayable states that it "doesn't work as intended"
Maybe the command is just faulty.
Some sort of solution could be to just place a lot of units, disable ai and handle the whole assignment procedure after the player has entered the actual game...?
you cannot setPlayable like e.g "create a server slot" - that's not possible.
but selectPlayer works without that
try creating plenty of playable units and use disableAI = true; in description.ext
@cobalt leaf Did you want to look at the object directly or simply face the object (even if it's not visible)
try creating plenty of playable units and use disableAI = true; in description.ext
Or just disable Simulation
It will be faster (maybe)?
It's an object located 1 click away that the player has to look at
Yes, it is visible. It is a radio tower
mmh what is the difference ?
First means the cursor has to be on the objet, and second is the player's front has to be on the objet ?
If you have something behind your monitor right now, you don't see it but youre facing it
Okay
Tasks is accomplished
So that will do (hopefully)
Yup
Something else,
I would like the script to be only working if the player is zooming (hold RMB)
I've searched and found displayAddEventHandler, do I need to simply look at the code of hold RMB and put this and waitUntil {cursorObject == building} in an () && () ?
hold RMB doesn't necessarily mean zooming in
Even if it's bound to Hold RMB
You can't always zoom in
In this case, players will be on foot
Plus it's a map for beginner friends, so they probably won't rebind keys, i'm not sure this would be a problem here
I recommend you use getObjectFOV instead
Okay
Is there a line that gives what action the player is doing (like walking or shooting) instead of giving the key he is pressing ?
walking: check the current animation being played (animationState)
shooting: event handler
got it
Or you can also check the speed/velocity
Because when the units move they have a non-zero velocity
I'm not actually trying to know if the player is walking, it was just an exemple
Ok. Then velocity is better
I mean, i'm just looking to detect whenever the player is zooming
So, I can check the player's fov for that with the command you gave me
After this I will need to detect if he is checking his compas or if he opened his map, so I'm wondering if I can simply detect whenever he presses a key
Yep, my bad. I thought it was giving the arc the object represents in the player's fov.
There's no such command (afaik)
@cobalt leaf Avoid keys. Use better conditions
compass and map and all stuff like that have some IDD or something that allows you to identify them
okay
Map for example, is visibleMap
compass: visibleCompass
I recommend you try to use event handlers instead of loops if you can.
Okay , waitUntil {cursorObject == building} works and I can do what I want with it, but it keeps showing an error saying :
Error Generic error in expression```
question 1
Where are you running the script?
It has to run in scheduled environment
missionNamespace does not return variables that were made in mid mission? like
missionNamespace getVariable [(str cursorObject), objNull];
returns <NULL-object> for a flag named Flag_7096 that I'm looking at, that flag got its name random generated with
_x setVehicleVarName ("Flag_" + str (floor random 10000));
what's wrong?
Where do I type the spawn command?
Where ever you want
You put the code inside it
[] spawn {
waitUntil {cursorObject == building}
}
@astral tendon
vehicle var name is not the same as getVariable
yes?
you mean, in my trigger's condition? Or into the On Activation?
Is there any way to actually get amount of fuel from a vehicle into it's proper units? Or is it always just a 0-1 format?
0-1 only, for correspondence see the config @outer fjord
Dang, thank you.
@astral tendon
Why do you do it that way anyway?
@astral tendon
vehicle var name is not the same as getVariable
@little raptor I kown, I need to know why is that missionNamespace getVariable [(str cursorObject), objNull]; is returning <NULL-object> instead of the name
Just use cursorObject
Cant, I need to get the variable of a string.
I dont get it. You want a string?
variable
object getVariable ["someVar", var]
save the variable to the object namespace itself
why do you save it to the mission namespace?
and to an object?
yes, and how to get the variable from the string?
Explain what you're trying to do
I think you two are on different things, yeah
ok, step by step
Im trying to GET a variable FROM string because:
1: lbSetData or any sort of command related to dialog does not allow me to store a variable on any control and they are limit to only strings and indexes and what control is being used
2:As a work around I set a random variable in a script to a flag that is placed on the map with NO NAME on the editor
3:the script did what it was supposed to do and the flag got named Flag_7096
4: missionNamespace getVariable [(str cursorObject), objNull] returns <NULL-object> instead of Flag_7096 as its supposed to do and this is one of the way to get a variable from a trying that I saw on the forums
also, cursorObject is returning Flag_7096.
still is a string
I still don't get what you want to do
does not allow me to store a variable on any control
Do you want to store variables on controls?
yes, with onLBSelChanged
control setVariable ["something", var]
Many variable types in Arma have their own namespace:
https://community.bistudio.com/wiki/setVariable
so you can store variables in them
…he dieded of happiness
Update,
I made the script I wanted with your help, about the playing spotting a structure in the distance.
waitUntil {cursorObject == tower} && getObjectFOV player < 0.75
I'm just here for the [] spawn {...} part. I tried putting my code in this, in my trigger's Condition. There are no more errors showing up... but it doesn't seems to work anymore
if it is a trigger condition why not just use the condition without waituntil?
the trigger cant get the result from the spawn anyway
and the waituntil is slightly wrong. both conditions need to be inside it
so just put
cursorObject == tower && getObjectFOV player < 0.75
in the trigger condition
…he dieded of happiness
@winter rose Died of my incompetence, although setVariable does what he said it makes no sense store the variable inside the control since there is just one and not many from the list I had.
okay, trigger working and no more error
geat, then I just need to get the index
Finally got that to work really want to avoid use missionNamespace getVariable next time.
Yep, better to avoid global variables altogether (besides public ones), the less there are the better
Im trying to GET a variable FROM string because:
1: lbSetData or any sort of command related to dialog does not allow me to store a variable on any control and they are limit to only strings and indexes and what control is being used
2:As a work around I set a random variable in a script to a flag that is placed on the map with NO NAME on the editor
3:the script did what it was supposed to do and the flag got named Flag_7096
4: missionNamespace getVariable [(str cursorObject), objNull] returns <NULL-object> instead of Flag_7096 as its supposed to do and this is one of the way to get a variable from a trying that I saw on the forums
@astral tendon
Finally got that to work really want to avoid use missionNamespace getVariable next time.
@astral tendon
Problem was, you were looking at the wrong place for the variable. When you call setVehicleVarName, the variable is not stored in missionnamespace, but on the object's namespace under variable : #vars
so it looks like, if i want a player to spawn in as generic joe schmoe... the best way to do it is to just take care of it in the mission config
i was really hoping i could make this mod, map agnostic, so it could literally initialize itself with a blank map and everything would be taken care of in code
skipLobby = 1;```
make a bunch of blank players like mentioned above
Does anyone know how to make server messages display globally? They display on a timer like they're supposed to... However, the seem to show on the client side rather than the server side (they start when the person connects, as opposed to when the server starts). Am I missing something really simple?
you talking about the motd in the server.cfg?
That's my name too!
And no, I have a separate .sqf file, that's called under the (!isSever) part of my init.sqf
ok, so what part isnt working?
you only want the messages to show when the server first starts?
Yeah. They also don't seem to appear globally. Everyone seems to get them locally, at different times
When I got the first message, my friends didn't get it until about 10-20 mins later
you could call your script under an isServer part instead of !isServer and remoteExec the messages to players. that way they only send when the server starts and everyone receives them at nearly the same time.
My bad. It's under the !isDedicated portion of my init.sqf
But how would I go about your suggestion? I'm quite new to the whole dedicated server portion of things
send what you have so far.
So am using drawLine3D and the line is very thin anyway to make it thicker?
nope, unfortunately
Use multiple drawLine3Ds
I am trying to make a skeleton ESP for an antihack menu to tell when players and leaning back to see through walls us there any alternitives? and I will try that now @warm hedge
yeah I used multiples in the past, it depends what you need it for
Use GUI instead
(you can't batch them so it's also a bit slow)
how would I make a players bones sync with a gui
Lines of codes
Hmmm, this solution to my global messages problems seems to not have worked, rip
I have 2, totally unrelated questions, but would really be intruiged by some answers i might get from the more intelligent people in the community than me.
-
Is there a way to have Opfor not fire on a Bluefor soilder with certain parameters? (If theyre gun is lowered, if they are unarmed?)
-
The F/A-18 Mod, the back seat has signifigant issues with the TGP/Laser working? Is there any kind of fix to this?
IDRK where to ask this, it may not be the right spot, but if someone can direct me to a better place that would be awesome!
Is there a way to detect and find Runways in particular? Im not sure about nearRoads
nearRoads does nothing with it. Check CfgWorlds entries
Not sure if there's a way to check if there's a Dynamic Airport nearby directly
Because the AI always seems to know well about the Runway that is landing/taking off so I was wondering if I can detect it or find positions.
Engine-driven and scripted things are different
[this,"REPAIR_VEH_KNEEL"] call BIS_fnc_ambientAnim; is removing my ai's loudout?
or - it doesnt wear a vest
Change equipmentLevel to "ASIS"
thank you
@astral tendon Airports are defined in cfgWorlds. The runway is defined in the airport config entries as something like ilsTaxiIn ilsTaxiOut IIRC (I'm on my phone rn so can't check)
@karmic spade
setCaptivemakes a unit a temporary "civilian" and no one will fire on them. You can define the conditions yourself and if they are satisfied, usesetCaptive true- Contact the mod developers
How does the Trigger Activation Type "Detected by" work? How do I check whether a certain object or unit has been detected by a given side?
knowsAbout @vague geode
Ok, but at which value will the trigger get activated? Everything >0?
typically > 1
Okay, it's me again
I made to work my scripts to make a player stare at a structure in the landscape , along as open map and compass
Now i'm trying to do like in the Prologue of the game: making a script that returns true when the player places a marker in a zone
So I searched on google and BIS Forum, and I saw that someone was trying to do the same as me : https://forums.bohemia.net/forums/topic/205183-how-to-trigger-players-insert-marker-on-map/
Someone replied with a code that spawns a zone randomly and returns a hint saying whenever the marker placed by the player is in or out of the zone.
I modified it so the zone appears where I want, that works.
Now I'm trying to make the code to return a true instead of an hint, and to place it in a trigger, but I can't find how to make it works...
This is the original code I took from the link :
TAG_fnc_createSelectionMarker = {
_position = player getPos [ random 500, random 360 ];
if !( getMarkerPos "border" isEqualTo [ 0, 0, 0 ] ) then {
deleteMarker "border";
};
_mrk = createMarker [ "border", _position ];
_mrk setMarkerShape "ELLIPSE";
_radius = 50 + floor random 100;
_mrk setMarkerSize [ _radius, _radius ];
_mrk setMarkerBrush "Border";
_mrk setMarkerColor "ColorBlue";
};
TAG_fnc_waitForPlayerInput = {
waitUntil{ !isNull findDisplay 12 };
findDisplay 12 displayCtrl 51 ctrlAddEventHandler [ "MouseButtonDblClick", {
params[ "_mapCtrl", "_button", "_mouseX", "_mouseY" ];
if ( _button isEqualTo 0 ) then {
player setVariable[ "insertPos", _mapCtrl ctrlMapScreenToWorld[ _mouseX, _mouseY ] ];
_nul = [] spawn {
waitUntil{ !isNull findDisplay 54 };
_nul = findDisplay 54 displayAddEventHandler [ "Unload", {
_exitCode = param[ 1 ];
if ( _exitCode isEqualTo 1 ) then {
if ( ( player getVariable "insertPos" ) inArea "border" ) then {
hint "You placed a marker inside the Area";
}else{
hint "You placed a marker outside the Area";
};
};
}];
};
};
}];
};
openMap true;
hint "Place a marker either inside or outside the area shown";
_nul = [] call TAG_fnc_createSelectionMarker;
_nul = [] spawn TAG_fnc_waitForPlayerInput;```
eh... the spoiler isn't working
Why would you wanted to hide your code? 🤔
@cobalt leaf
```sqf
your code starts in a new line.
```
It was pretty big, I wanted to hide it in a spoiler
pastebin might be the better choice for that
It doesn't shrink it into one line
here we go, fixed it
If you put sqf right after ```, it will use the sqf syntax (even better readability)
😉
there
So I tried and modified the second part (the one waiting for the player's double click in the zone) to return a true , but I cannot make it to work
I'm wondering if it is because of a synthax error or something, because i'm not having any error message.
waitUntil{ !isNull findDisplay 12 };
findDisplay 12 displayCtrl 51 ctrlAddEventHandler [ "MouseButtonDblClick", {
params[ "_mapCtrl", "_button", "_mouseX", "_mouseY" ];
if ( _button isEqualTo 0 ) then {
player setVariable[ "insertPos", _mapCtrl ctrlMapScreenToWorld[ _mouseX, _mouseY ] ];
_nul = [] spawn {
waitUntil{ !isNull findDisplay 54 };
_nul = findDisplay 54 displayAddEventHandler [ "Unload", {
_exitCode = param[ 1 ];
if ( _exitCode isEqualTo 1 ) then {
if ( ( player getVariable "insertPos" ) inArea "border" ) then {true;
}
};
}];
};
};
}];```
You just simply return "true", nothing else.
Yes?
It is what i'm trying to do
if ( ( player getVariable "insertPos" ) inArea "border" ) then {true;
}```
Also a hint, for debugging stuff:
systemchat str["Checking _varToCheck: ", _varToCheck];
So you can follow the "way" the script takes easily yourself.
okay
(reason why str[] : If the result would be Nil (any) -> the chat* msg wouldn't show up)
Ehm i'm a bit confused what I should be looking at while
systemchat str["Checking _varToCheck: ", _varToCheck];
is running
This is not really helping me here...
erm, it's an example
Example:
systemchat str["_button isEqualTo 0: ", (_button isEqualTo 0)];
right before:
if ( _button isEqualTo 0 ) then {
and so on
eh so, the weird thing is that
it tells me that it returns true
but my trigger isn't working...
Because you don't do anything in it. You spawn a new Thread, you reach "true". But "true" doesn't do anything.
You have to call a function from there.
It's like i am asking you how many apples you ate today, and you answer me with: "Yes".
What would be the fonction to make the trigger's condition true, then ?
I mean, my code is inside a trigger's condition
Maybe that helps (speaking in windows terms):
call = creating a file inside an existing folder.
spawn = create a new folder, outside of the existing folder. No Links/shortcuts. A clean folder with no knowledge of the main folder. If you pass arguments with spawn, it's like copying that stuff in the new folder.
So you have limitations in there, e.g. not "spawn"-ing stuff.
kinda same is with adding eventhandler. It's also a different "folder". It just doesn't know about the Trigger etc
I don't know how to use []spawn actually, i never used it
I do everything in the game with triggers
uff
probably the easiest solution would be (in your case, without altering the code too much):
Pass the player to the spawn'ed codepart ([player] spawn {) and do in the final then a simple _player setPos with the coordinates
(but in the end, you might want to dig deeper into .sqf functions, so you can create scripts like that without using triggers)
I'm getting real confused here
It is what i'm trying to do
if ( ( player getVariable "insertPos" ) inArea "border" ) then {true; }```
@cobalt leaf well, that won't work...
Either use exitWith or have a variable which you set to true/false and return that at the end of the code
Okay, what should I type with exitWith to make my trigger turns true?
Either use
exitWithor have a variable which you set to true/false and return that at the end of the code
@exotic flax Doesn't work there either, since it's spawned.
what does it means, it's "spawned" ???
Would anyone happen to know what dpp_01_transformer_f is apart of if it is apart of anything at all.
lol
-.-
it's a transformer in Tanoa, trying to pull a list of them from nearestTerrainObjects but can't seem to figure out waht the type name might be.
ah
Went through the usual power stuff, nada.
wait 1
Trying to revive AEG
"Land_dp_transformer_F"
That's for the one in Altis
unless it shares the type
lol
the model is the same but they are co,oured differently
also, the altis one disappeares when damage 1, the other one doesnt
Yeah apparently dpp (tanoa) doesn't really have damage states and stuff, seems to be a.. forgotten object?
yes, exactly
"Land_DPP_01_transformer_F";
@tough abyss sexy config browser to the rescue
its a shame they didnt finish the dpp one up because it's a good infrastructure object that would be a good target for denial of enemy use
Yeah, you can still apply damage to it and stuff funny enough but it doesn't do anything visually if damage is 1, was tracing all the power stuff on Tanoa, they put so much work into the entire infrastructure but then skimmed on finishing touches D:
yup
it can take a handledamage EH, so you can still hideobject it when it takes a Titan to the face
Noted 
Time to make power line repair simulator 2033 
what I do is...because these things usually appear in bunches of 4,9, 12 etc, I allow players to kill any of the bunch to succeed mission. it doesnt seem fair to make them pick out an individual one that is surrounded by other, identical objects
note the dpp has a red top, dp is grey
Well my plan was, there is 14? transformers on the western side power plant, those 14 will control the west part of the main island, for each transformer destroyed, furthest towns/lights from the plant go out, if you end up getting to like idk 10 destroyed transformers then only a distance of 2,500km is powered. Take out the remaining 4 and poof no lights anywhere on mainland except the east part cause it has its own power plant of some sort.
well 2,500m*
looking through my code right now
ok, so dpp doesnt have a ruin model... i remeber that
dpp sinks into ground when destroyed, but leaves no ruin
if you subsequently setdamage 0 it, it pops back up again , good as new
disclaimer code written in september last year and working now to the best of my knowledge 🙂
I have a helicopter "flying" with unit capture, how do I control the landing gear?
(rather old) searches say the vehicle has to be player controlled for it to respond to ... action ["landgearup", ..., but that doesn't really make sense..
@steady terrace You have to call the code every frame for it to work
_heli action ["LandGear", _heli]
This lowers the gear
The AI automatically raise the gear
well that's what I wanted actually, thanks! putting in AI does it
_id = [
player,
'str_a3_wl_custom_request_tactical_strike' call BIS_fnc_localize,
"image\holdaction_transmit_idle_ca.paa",
"image\holdaction_transmit_progress_ca.paa",
"!((missionNamespace getVariable format ['BIS_available_VLS_%1', side group _this]) isEqualTo []) && _this isEqualTo _target && ((_this getVariable 'allowedTacticalStrike') == 1) && !(((laserTarget _this) isEqualTo objNull) || ((laserTarget _target) isEqualTo objNull))",
"!((missionNamespace getVariable format ['BIS_available_VLS_%1', side group _caller]) isEqualTo []) && !((laserTarget _caller) isEqualTo objNull) && (((_caller getVariable 'initialTacticalStrikePosition') distance (laserTarget _target)) < 10)",
{ (_this select 1) setVariable ["initialTacticalStrikePosition", position (laserTarget (_this select 0)),true]; },
{},
{ _bis_hq = (_this select 1) getVariable "bis_hq"; (_this select 1) kbTell [_bis_hq,"BIS_SUPP_cruiseMissile_protocol","TacticalStrike_SupportRequest","SIDE"]; [_this, "cruiseMissileSupport.sqf"] remoteExec ["execVM",2]; },
{ (_this select 1) setVariable ["initialTacticalStrikePosition",[-1,-1,-1],true]; },
[],
5,
1.5,
false,
false,
false
] call BIS_fnc_holdActionAdd;
I am adding a hold action with the code above which when completed executes the script below on the server but for some reason it works perfectly in the 3Ditor but not at all on the server.
The VLS unit is always saying that the target is outside of its firing envelope but it's only supposed to way that when the target is more than 30km away from the target but I tested it on as low as 7km and it still said that.
Does anyone have any idea why?
PS: Please find a link to the code of the cruiseMissileSupport.sqf below.
Does anyone happen to know which function from contact spawns a high pitched noise and make your screen all blurry?
most likely a playsound and a post-process effect?
any way to increase fuel consumption through scripting and not modding?
no, besides frequent setFuel
alright
Heya'll,
I'd like to create some looping ambient noise for a location. Does anyone know how to loop or repeat a PlaySound3D or Say3D ?
if you want ambient noise, a CfgSFX would be more appropriate 🙂
Ahhhhhhh! https://community.bistudio.com/wiki/CfgSFX#Multiplayer ... This is part of Description.ext? Not an addon config?
yep!
params[nil, "_foo"] could someone check what happens here?
Kk
i have
problem
My custom insignians doesnt works
on server
but in editor it works perfect
doesn't sound like a #arma3_scripting issue
although; do you also have the mod with insignias enabled on the server?
Theres many channels idk where to type
What do you mean mod with insignias
im making custom insignias wia description.ext
not mod
if you mean that
should work as well, although in that case the path to the texture is most likely wrong
But its working in editor?
what path did you use?
editor is not server 😉
👆
can you paste the path you used?
||class CfgUnitInsignia
{
class peta
{
displayName = "peta"; // Name displayed in Arsenal
author = "All mighty NeoArmageddon"; // Author displayed in Arsenal
texture = "peta.paa"; // Image path. Not sure this is right, try "\insig\us1.paa" otherweise
textureVehicle = ""; // Does nothing currently, reserved for future use
};
class gremlin
{
displayName = "gremlin"; // Name displayed in Arsenal
author = "All mighty NeoArmageddon"; // Author displayed in Arsenal
texture = "gremlin.paa"; // Image path. Not sure this is right, try "\insig\us1.paa" otherweise
textureVehicle = ""; // Does nothing currently, reserved for future use
}
};||
This is from description.ext
ok so do you have these .paa files in your mission folder?
and are they transferred to the server?
where did you transfer the mission files?
converted them from folder to pbo and uplouaded to mpmissions
how did you make the pbo?
pbo manager
asfafshit
Id save it as pbo from the editor
thats one way to do it
but I hope your modpack does not contain other peoples work
nah
👍
too bad i cant make insignias only for mission
well it should work
but I dont personally trust pboManager
you could try exporting the mission from the editor
well is there option to 'pack' mission folder to pbo in editor?
Export
How would I make something like this happen to every player whenever they are in range of an ATM if (typeOf cursorObject == ["Land_Atm_01_F"] && player distance cursorObject < 5) then { player addAction ["Check Balance", { hint format ["Balance: %1", money] }]; };
add the addAction to the object is probably the best way, and than in the code you get the player who called it
welcome to Advanced Arma Scripting 101 😉
if you have placed the ATM object yourself you can put it in the init field
or have some code in init.sqf (part of mission) to find all ATM machines in the mission, and attach an addAction to each of them
btw... building up a complete L*fe mission/mod without any scripting experience is a bad idea
I am making a raffle system that involves adding and removing money from players so I thought I might as well make it a little fancy. The server that script will be going on already has its own banking system and the code will be remade to work with theirs but I thought Id learn a little more since I am new and need the experience
Definitely not trying a project that big
@copper needle fn_setupActions.sqf
@tough abyss Sorry for the ping, but I actually found something that doesn't seem to work unless I'm doing it wrong. Show names of players on GPS doesn't seem to work.
// BOOL. TRUE to show unit names on the GPS display. Default FALSE. - That one
Guys can you tell me
What is _this for
I saw some scripts have “var1 = _this select 0;”
I try to google it ,but I still don’t get it 😦
[] spawn {
hint str _this; // []
};
[123,456,"hello"] spawn {
hint str _this; // [123,456,"hello"]
private _var = _this select 1; // 456
// better to use params to define variables
params ["_oneTwoThree", "_fourFiveSix", "_hello"];
// check matches
_var == _fourFiveSix; // true
};
If it only has
“var = _this select 0;”
does that mean anything?
it sets var to the value of the first element of what is passed
Oh ok thanks mate 😄
@vague geode too many _this select x in your code, too many indent levels / not enough funnel coding (if incorrectCondition exitWith {}), I cannot read that sorry =\
who uses select anyway...
params ["_object", "_arguments"];
_arguments params ["_arg1", "_arg2", "_arg3"];
params is used
just not the variables defined within it…
@winter rose Is that better? https://sqfbin.com/hujahaqetoxixayuvite
bit better yep 👍
just pasting the link to your message so we don't scroll
https://discordapp.com/channels/105462288051380224/105462984087728128/754788241432903680
or if (_targetPos isEqualTo [-1,-1,-1]) @vague geode ; have you checked that…
_caller getVariable "initialTacticalStrikePosition"
```has it been setVariable public? etc etc
Hello guys, i tried to delete everything inside a trigger using this code, it works on most things including some structures (ancient pillar), however it doesnt work on others (such as altis air control tower), what is the solution to delete these things that cant be deleted?
{{deleteVehicle _x} forEach crew _x;deleteVehicle _x;} forEach thisList;
terrain objects cannot be deleted, only hidden
also, crew should be deleted with deleteVehicleCrew
then the trigger must not "grab" (detect) them
I know it works, but it is not recommended as it leads to memory leaks
ah ok thanks
i tested naming the structures and using deletevehicle with their names and it worked, guess ill have to do that to the ones not detected by trigger
Is there a way to make lights appear even during daytime?
setLightDayLight doesnt seem to work
In what context?
https://community.bistudio.com/wiki/Lightpoint_Tutorial
only for the light itself, not the flare
it might be a bug, according to a dev (not sure)
Trying to setup some paradrop jumplights for a unit that asked me to and im having a hard time having any sort of feedback on the lightpoint during the day
works perfectly during the night
but as soon as a sliver of the sun is up, the light disappears completely
yep, I know :-\
so it's a no-go?
the flare can be made visible during daytiume, though?
i swear to god this used to work back a few patches ago
so it definitely is a bug! let's #arma3_feedback_tracker it then 🙃
because i remember making this orbital strike script where i used the lights
amped up the light to 1000 intensity and it was visible even during the day quite brigthly
Flare can't be shown in daytime. Dedmen says someone “optimized” it, IIRC?
damn
will have to use audible signals, then
during daytime
I'll just add a sound-signal to the light changing and that should do the trick
you can do an ambient light, but no flare right now yep
see the tuto (setLightColor does work)
Doesnt work for me
Flare can't be shown in daytime. Dedmen says someone “optimized” it, IIRC?
I believe it was Reyhard
Doesnt work for me
@ebon citrus set its strength higher?
should be
Try more higher, like ridiculously high so you can test if it works anyway
brightness to 1 does it
intensity does nothing
correction, intensity during daytime does nothing
cheerios!
@winter rose Yes, the variable is set global and the VLS is shooting now but for some reason not at the target...
now that's a different issue than what you listed
The VLS unit is always saying that the target is outside of its firing envelope but it's only supposed to way that when the target is more than 30km away from the target but I tested it on as low as 7km and it still said that.
Yeah, I tried to fix it myself and it seems like one of the changes "fixed" the first issue but a new one arose...
I'm pretty sure it's not possible via config/script, but is there any way to get particles to ignore FOV when they spawn? they're slightly bigger when you hold RMB to zoom, and stay big when you let go
Use drop
drop does make one particle, with exact size
is it possible to pass a private function as a param and use it in a script?
private _variableTestString = "TestString";
_hintFunction = {
params ["_variableTestString"];
hint format ["Testing... (%1)", _variableTestString];
};
[_variableTestString, _hintFunction] spawn {
params ["_variableTestString", "_hintFunction"];
[_variableTestString] call _hintFunction;
};
nvm I can lol
using the method above or did you have extra you figured out? would like to know
Code is a valid data type
@fair drum ran exactly that in debug and it worked fine
Will vehicle respawn or vehicle respawn module work with heli sling crates?
🐮 Perhaps
Ok, so i'm really struggling on finding what's causing the server crash issue on my mission, is it possible for someone to look over the scripts in the mission folder with me. It'd be really helpful to get another set of eyes on it
the server will crash 10+seconds after loading in, and in the crash dump, it says its something about "Unknown module". Seems to be a problem with the mission, it's not a mod issue as i have gone through them all and checked them.
You should transcribe the exact error. It probably mentions which module is unknown.
Okay so I need some help with scripting. I don’t understand how to spawn stuff and how to put in the position of the spawn.
Like imagine I want an AI plane flyby, so I would spawn the plane, and give a waypoint to said plane and then delete the plane after reaching the WP
Or something like having a few members of a squad create their own group and then generate a waypoint for that new group
Okay but what about setting the location of that spawn
Or would it default spawn on the trigger?
you have to define the position yes
there is no "automatic position" besides default [0,0,0] when there is an error somewhere
there are getPos* (getPos/getPosATL/getPosASL etc) commands
And the trigger has its x, y, z in attributes so I could just plug that in
To the script
if you want to, yes
or getPosATL theTrigger (if you named it)
Would it look something like “createVehicle “classname” [X,Y,Z]”
Awesome
I know 😎
I had a problem with this script
I used it just like it says, but it wouldn’t play subsequent animations so I could only play 1
Also “sleep” never has worked whatsoever
not in init fields or triggers yeah
you should enable the -showScriptErrors flag (or Launcher option) to see script issues
Im putting this shower thought up here just for questions.
Im building up a lazer-tag system for a unit that reguested it, and i thought i could make it work a little smarter. In the config, Uniforms are basically vehicles, right? So would it be possible to add an init event script to a uniform, that gets run every time that uniform is initilialized (created) by a unit putting that uniform on?
Without testing i am unsure if this is how Arma 3 works internally, so could someone who has experience say?
Tldr, is the init eventscript of a uniform in cfgvehicles executed every time the uniform is switched to by a unit
My gut feeling is that uniform init is not run when it is put on
Only when a character is in fact created
I would say HG is right indeed
see https://community.bistudio.com/wiki/setObjectTextureGlobal#Examples Example 2 @ebon citrus
Fair enough. Thanks for the headsup
Any eventhandler i could hook into for switching uniforms?
Actually never mind, i dont even need that

How would I get all vehicle classnames so that I can insert them into a listbox?
configClasses
I use the example but it doesn't return anything?
Which?
_configs = "true" configClasses (configFile >> "CfgVehicles");
It says the return value is an array right, so I should use forEach when trying to add each array element to my lb? Such as lbAdd[1500, _x]
but it returns objects, not classnames
OH, so how would I be able to return the classnames?
configName
either do
_configs = ("true" configClasses (configFile >> "CfgVehicles")) apply {configName _x};
or replace your lbAdd[1500, _x] with lbAdd[1500, configName _x]
Ah I see, thank you, but I didn't think this is what it would return. I think what I meant to say was I am trying to get all LandVehicle classnames
use the filter option ("true")
"configName _x isKindOf 'LandVehicle'" configClasses (configFile >> "CfgVehicles")```
Got it now thanks, also got the vehicle to spawn correctly using the listbox which is nice. Problem I have is, it lists literally every classname, is there a way to only filter through vehicles you can spawn? E.g., some of the vehicles in this list do not spawn
scope = 2 should mean "public objects"
"configName _x isKindOf 'LandVehicle'" configClasses (configFile >> "CfgVehicles")
// ↓↓↓
"configName _x isKindOf 'LandVehicle' && getNumber (_x >> 'scope') == 2" configClasses (configFile >> "CfgVehicles")
``` @mortal nacelle
Perfect, thank you
Trying to pull the mission summary from the server so that it can be displayed by a player in a GUI. Any ideas if there is an easier way of going about this?
{"Multiplayer" get3DENMissionAttribute "IntelOverviewText"} remoteExec ["bis_fnc_call",2];
The above doesn't work just fyi.
get the server to call a callback function
client > server > client > display the result
Okay I am not 100% sure how to go about doing that.....
can't you get the info from the local mission?
The information has to be available as it's in the mission pbo somewhere, but I haven't found an easy way to get access to it. The only way in my testing that it works is if the server is the one seeking that information.
Client doesn't have that info, weird
If it does then I haven't been able to find out how to get it.
@rain dirge what does ```sqf
"Multiplayer" get3DENMissionAttribute "IntelOverviewText"
nvm
from get3DENMissionAttribute page,
Attributes are available only within the Eden Editor workspace. You cannot access them in scenario preview or exported scenario!
try the following?```sqf
private _overviewText = getText (missionConfigFile >> "overviewText");
Okay if it is defined in the Mission Attributes in the Editor rather than in the Description.ext?
Could I use addAction like this:player addAction ["Exec the file", "scriptFile.sqf"] but instead of executing a file it executes a function?
more or less
player addAction ["Exec the file", { [] call BIS_fnc_myFunction }];
@rain dirge IDK
if you have access to it, you could include mission.sqm inside description.ext so you can read the attribute
@copper needle ↑ two posts above ↑
Interesting. I am trying to not have to change how a mission is created drastically, as we already have a mission making framework. It is odd to me that something that is available to the server when you select the the mission, wouldn't be available when actually in the mission.
yep, I know of briefingName but I don't remember a command for the overview text
@winter rose Im trying to add that to the init of an object but it just comes back with the function being undefined. Any ideas?
The name of the function I'm trying to call (Function is defined in an sqf file in the mission folder). I didn't expect it to work since I haven't "told" the script where it is. My question really is how to make the script find it
Shouldve been more specific sorry about that
define it in CfgFunctions, otherwise the init order is incorrect / not guaranteed
see https://community.bistudio.com/wiki/Initialization_Order:
Object init fields are called then init.sqf is
(or don't use init fields - at all)
@copper needle ↑
I talked yesterday about a particle graphical issue I'm having, and it was suggested that I try drop instead
It still happens with that, so here's a repro if anyone is interested
Zoom in/out or run around the effect - it breaks sooner if your particles quality is on low
[] spawn {
private _spawnOffset = [[0, 20, 3], -(getDir player)] call BIS_fnc_rotateVector2D;
private _spawnPosition = (getPosASL player) vectorAdd _spawnOffset;
private _obj = "#particlesource" createVehicleLocal (ASLToAGL _spawnPosition);
for "_i" from 0 to 200 do {
drop [
[
"\A3\data_f\ParticleEffects\Universal\Universal",
16, 15, 1, 0
],
"", "Billboard",
1, 3,
[0, 0, 0], [0, 0, 0],
0, 1.0, 0.8, 0.0,
[10],
[
[0, 0, 0, 0],
[0, 0, 0, 0.124],
[0, 0, 0, 0.0186],
[0, 0, 0, 0]
],
[1000],
0.0, 0.0,
"", "", _obj
];
sleep 0.02;
};
deleteVehicle _obj;
};
indeed - therefore it should be considered as engine limitation/system (you can search/make a ticket in the FT if you feel like it)
I can't imagine it'll get fixed (most particle effects are shortlived and not persistent anyway) but I can give it a go
cheers
Spearhead sideChat "We have encountered an enemy unit occupying the bridge, Continuing on foot to objective to avoid alert. Over.";
Why is this not working i keep getting errors
errors such as…?
that's all the code there is?
'call {spearhead |#|sidechat "We have encountered an enemy u...'
Error Generic error in expression
the whole code please, in ```sqf
how do i get my sqf from the mission
The same way you put it in 🤔
I mean, put your code in the channel here; the error most likely doesn't come from sideChat
I used the eden editor to create my mission i never had to or have before put in a sqf or anything
the code, in the trigger, you did put it there, right?
Spearhead sideChat "We have encountered an enemy unit occupying the bridge, Continuing on foot to objective to avoid alert. Over."; is all i put in my trigger
is spearhead defined?
It's the variable name of the player
then IDK, armagic
lou what type of missions do u normally make??
coop for small group, why?
you seem very knowledgeable with arma 3 scripting so thought u would make some advanced missions😁
well thanks, my latest seems to have some minor success
I mostly like proof of concepts, like "could I do that thing?" "yes, it works" "ok, that's it"
" could I do that thing?" yeah me too even tho i have zero clue about scripting i still like it ... or maybe i just like slamming my head on the desk.🙈
Question, why is vehicle player returning this C Alpha 1-1:1 (MSG Williams) and not the vehicle i am inside of?
looks like its returning the vehicle
that's just the vehicles name, it takes your name
oh
is there a way to get the vehicles classname from the vehicle the player is sitting in?
typeOf vehicle player yes @mortal nacelle
ah, thank you!
how can i force flashlights to be on for AI
bob addPrimaryWeaponItem "acc_flashlight";
bob enableGunLights "forceon";
Does anyone know if there is a quick way to check if a player is currently using the curator camera (as opposed to if he is assigned as a curator)?
Even a local check would work in this instance
Does the game consider items dead once in player inventory
Like a rocket launcher
When you pick it up into your inventory the game will consider it dead
So a task to pick up a rocket launcher I can use !alive
Excuse me?
Is there a way to split arrays? For instance: ```sqf
_array = [1,2,3,4,5,6,7,8,9];
//Turns Into
_array1 = [1,2,3];
_array2 = [4,5,6];
_array3 = [7,8,9];
I don't think there's a command or function to do it. Maybe make your own way
Alright thanks
Ah, that actually is an idea
Is there a way to keep the varname of an object after picking it up?
because as far as i can tell it gets reset when an object is picked up
"picked up" = object holder being deleted, sooo not really
everything is an illusion 👀
damn really do be like that sometimes
you can always use "Take" and "Put" EH? @tough abyss
Take to give it the varname again?
items are not real objects
so what do you mean by "object" being "picked up"?
some sort of script to move objects?
the spoon doesn't exist
finding a girlfriend?
Hotel?
Unfunny.
fair enough
but no something being put into your inventory
title of your sextape, both
👀
@tough abyss let's start over: what do you want to do?
yes
find a job
in Arma
youre in the wrong discord, then
find where the editor button is
you can only lose your job (and your soul) here 😄
but no
I want to keep the variable name of an item
when being put into a player's inventory
items dont have variable names
you see, when an item is on the floor, it is actually inside a container, usually called a weaponholder
or ground weapon holder
no, what do you want to do - not how
Items also stack in these containers
so it gets really complicated to track individual items
if your item is a weapon... Give it a special attachment that cant be removed, i guess
if it's some mission-related MacGuffin, then just make a custom item
or do it like i did and make your own item scripts that puts every item in their own weapon holder and then realize it has formidable suction and just bend to arma's will
really do be like that sometimes
whatever youre probably doing doesnt need to be made in such a complicated way
like the scripting guide says: Is your idea necessary?
it has formidable suction
perf killer?
If used caringly, not really. The issue was tracking down and dealing with all the different edge-cases
where is this misconception of objects having "variable names" coming from? i keep seeing it over and over
"objects" as in vehicles and all can have a variable
items to be picked up, no
I believe it is a mix of those two (and from an external point of view, it sounds "stupid" that one can and one cannot)
this is also enhanced by the fact you can put a e.g uniform "object" in Eden, and put a variable on it (actually, on the object holder)
put a variable on it
what, like_object setVariable ["my_v", 42];?
oh, i don't know what an eden object name is...
myUniform = cursorObject;
this is storing a weak reference to an object in the variable myUniform
thinking of it as naming an object is just... wrong...
when you double-click on something, there is a field that allows you to "name" an object by setting a global variable pointing to it
e.gsqf LOU_thePlayer = playeris "naming" the player
(note the quotes)
i see. that must be new in A3 i suppose. but it's still just storing a reference in a variable
thinking of it as naming an object seems backwards and detrimental to understanding how it actually works
well it's declaring its variable, sooo yeah, it's useful
and it was present, even in OFP
It's good for certain things
i use it most for debugging or static objects or holders
but if im writing code for dynamic objects, "name"s are a no go
the point is the idea of an object "having a variable" rather than a variable containing a reference to an object
yeah well, that's a dev POV of course
from a player that creates missions, it's "giving a name to an object" (even though that object can have multiple variables pointing to its instance, yadda yadda)
the "name" makes it easy to reference the object throughout the mission in a more efficient way
the mechanics of it are the same, the difference is in conceptualisation
sure, of course
remember, the best carpenter doesnt use one tool religiously, but all tools efficiently
but the original issue was "can we reference an inventory item by a variable"
and the answer is no
@pliant stream yes, but this is the best and most efficient way to access editor created objects from script
you dont have to know what that object is
you dont have to know where it is
you dont even have to know if it is
as i said, the mechanics of it are exactly the same however you conceptualise it.
(object, string) should do for referring to an item
exactly the same as what?
you have a variable containing a reference to an object
thinking of it as the object "having a name" doesn't change how it works
I believe we are strongly into the domain of cerebral masturbation now
back to the issue - cannot reference an inventory item with a variable.
cannot reference an inventory item with a variable
you could probably make it work
the best way i explain it to people is that "items are not persistent"
when an item is moved to another inventory, the original item is deleted and a new item is created in the target inventory
it wouldn't be entirely impossible to add "names" to items
or some extra data
i havent looked into this too much, though
it would probably require engine side changes
or completely rewriting the inventory or adding to it
if you want to do it in script^
a2 weapons are not objects, magazines are. in a3 both should be objects
the main issue being
- same magazines with different ammo
- same items added - which is the removed one, A or B?
same magazines with different ammo
store the ammo too
same items added - which is the removed one, A or B
does it make a difference?
add names to a list
when you pick up an item, add one of the names to it
also, magazines are not objects
magazines are magazines

code objects, not Arma objects
kinda wouldve helped if the context was made known
since we were talking about arma objects
anyways, couldve, wouldve, shouldve not
arma 3 doesnt need this ability
you know when you have a rebreather and a wetsuit under water, a mask is placed over the units face, is that possible to script on a unit when they are not in the water?
not these ones
ah ok, thanks
You need to make some config if you want
Theres a mod for it if you want it the easy way
Does anyone know if there is a quick way to check if a player is currently using the curator camera (as opposed to if he is assigned as a curator)?
locally yes, but not from a remote machine
(afaik)
@winter rose
Care to elaborate? I guess in extremis one could look into putting something into the 'onload' of RscDisplayCurator and then use that to detect if curator view was activated. AFAIK this will mess up some of the more popular Zeus mods out there so its not ideal.
I thought of something with remoteControl or cameraOn, compare this with player (and think of a case with UAVs)
Use CuratorObjectRegistered EH?