#arma3_scripting
1 messages · Page 601 of 1
well its like when i use attachTo for the helicopter, and i move the vehicle i attached the heli to, it like flickers between invis and not, and its only when i was using this heli
can you show your code
pastebin?
@unkempt sorrel https://sqfbin.com please
…not touching that even with a 10m pole
anyone can direct me to a good IR strobe script without using ace?
wait.... the problem is "use a helicopter for hide object", but the script doesn't include anything related to hiding an object 
@vernal dust You wanting them to be dynamic or simply attached outright?
i just want them to be in the action menu to just put on and off
also for the ai if possible
@outer fjord
i found one script but its outdated
You have to add your own AddAction though.
Also, I'm not sure if they switched it recently, but can't you lock onto IR strobes? Won't AI drop bombs on them?
there are both IR strobes and IR markers iirc? unless it was an A2 distinction
Just don't have a VLS system on auto-pilot and you should be fine 😄
BRRRT intensifies
Can someone help me with that I just can not fix it I have tried to put in some things and so and I just won't work https://cdn.discordapp.com/attachments/721693503301615659/727593229762953226/unknown.png
There is a image of what it says
sure
intro.sqf line 3
any =
[
[
["Welcome to the *** Training Server","align = 'left' size = '1' font='PuristaBold'"],
["","<br/>"],
["We hope that you'l Enjoy your stay!","align = 'left' size = '1' font='PuristaBold'"],
["","<br/>"],
["Made by: AmerikanSn1p3r","align = 'left' size = '0.8' font='PuristaBold'"],
["","<br/>"],
]
]
spawn BIS_fnc_typeText2;
that is the main script
use codeblocks
is the anything before it?
there's some whitespace character there
or some character that isnt UTF-8
put three tildes before your code and three after your code when putting it in discord
makes every character the same size for easier reading
you copied some character into your code that isnt utf-8
Okay thanks, il try to see if it works
[
[
["Welcome to the *** Training Server","align = 'left' size = '1' font='PuristaBold'"],
["","<br/>"],
["We hope that you'l Enjoy your stay!","align = 'left' size = '1' font='PuristaBold'"],
["","<br/>"],
["Made by: AmerikanSn1p3r","align = 'left' size = '0.8' font='PuristaBold'"],
["","<br/>"],
]
]
spawn BIS_fnc_typeText2;
try to write it out
so this is what it would look like
the code
@short fossil can we have the file?
would have to have the file to confirm the incorrect character
but im pretty sure that's what it's complaining baout
Cant post the file somehow
- at the end of the array (after the last unnecessary br) there's a comma too much
- are you sure you don't have some weird character in the hidden name?
@short fossil just dm it to me
Okay
- at the end of the array (after the last unnecessary br) there's a comma too much
- are you sure you don't have some weird character in the hidden name?
no I don't have a weird character, it is on purpose
and can/will cause issues
can I do a if () then {} else {} exitwith {} statement?
or would it have to be a if () then {} else { exitwith {} } statement
that would make no sense?
do this instead:
if (!x) exitWith {};
// rest```
in coding, you usually want to get the "bastard" cases out quickly
e.g
private int divide(int a, int b) {
if (b == 0) {
return 0;
};
if (b < 0) {
b = -b;
}
return a/b;
}
i can make variables lines of code right?
?
yes
private _condition = alive player;
private _effect = { player setDamage 1 };
if _condition then _effect;
ill do that then. can save me some lines
In the beginning: Don't mind the amount of lines (or how the code looks like). Just make it work first, then think about optimization later.
Just get the hang of it first, before you make it too hard for yourself from the beginning.
@fair drum
- Make it work
- Make it readable
- Optimise then
- Rewrite everything because it's outdated
i cant even...
which reminds me of XKCD's flowchart…
https://xkcd.com/844/
{ _x setPos [getPos thisTrigger] } forEach allPlayers !(in thisList);
im trying to teleport all players that aren't in a trigger's area, can someone help me format this?
wait:
{ if !(_x in thisList) then {_x setPos [getPos thisTrigger]} } forEach allPlayers;
still doesn't work but seems closer
{} foreach (allPlayers - thisList);
that too
make sure to avoid teleporting zeus
and avoid HC
something like private _headlessClients = entities "HeadlessClient_F"; private _humanPlayers = allPlayers - _headlessClients;
the mission uses neither of those so should be fine
thanks, i appreciate it!
oh, god damnit
when are we getting 1.99?
@still forum any idea when we can get access to 1.99 script-goodies?
on release
2.00*
even numbers are for release,
odd ones for development branch
Arma 3 v2 = Arma 6 confirmed
(as for the when… I for one have absolutely no idea. I wish in the next month, but I would guess (at least?) two.)
but why are the selection positions for doors in different places?
like sometimes it's at the bottom of the hinge-side
and sometimes at the bottom of the handle-side
it's really inconvenient
since im trying to allign an offset with the handle
I would say, quite surprisingly you may find, unless you have a hunch about interesting events surrounding such aspects of life and conversations, that my answer on this very particular matter is: dunno
fair enough
i'll try to find a rule in it
so i can perform some sort of logic to get the correct offset
and it always seems to be one or the other
REALLY?!
now it's at the top handle corner
XD
i give up
the action is going on the center of the door
wait, but now i need to calculate that somehow

ok, i have made a conclusion
Distance from the floor maybe?
the door-selections position seems to be entirely dependent on what the model-technician had on their pizza last friday
can do that because 2nd story doors
doors aren't in set elevations in arma 3
i wish they were
floor, not ground
floor is not a selection
i cant get where the floor is
well, maybe lineintersect, but that'¨s too heavy
the door-selections position seems to be entirely dependent on what the model-technician had on their pizza last friday I have thought the same on doors and other things too
can we get animation-points of selections?
so i can determine where the hinge-point is
I don't think so no
god damn alternative syntax comes in 2.00
😠
i cant use the LOD name
so i can only get the selectionNames from the res lod
what you could do is detect with lineIntersect once per door and store the "up/middle/down" door selection status with e.g setVariable
and iterate that on every single door on every single building on the map

i mean, you could
on the nearestBuilding maybe
but the memory and time
yeah, but then it becomes too heavy
im thinking of using cursorobject
that too
or cursortarget
You can even remove variables when leaving
compile a list of door positions for a building when the player hovers over the building for the first time?
then set a trigger on the building and remove the variables when the player leaves the building
or make a dictionary based on building types 😄
Lou...
therea re selections for door-handles...
can you pass me the hammer?
not for the enoch buildings, though

maybe this is a dayz-devs only thing
nope
malden buildings share the same idiocracy
and handle positions are always 0,0,0 in the model for some reason
memory has acis
axis*
i might need to switch to dev branch
@still forum any idea when we can get access to 1.99 script-goodies?
@ebon citrus
Yep.
to get those sweet lods
I'm quite sure the commands you're talking about aren't even on dev-branch yet
damn, memory points dont rotate with the model

res is great, but it's not consistent
memory is consistent, but doesnt rotate with the model
maybe i can calculate the position of the handle offset if i know the memory trigger positionb
yes, because the trigger is always the center of the door
rather
if i use the axis
i can determine the direction too
since the axis are the hinges of the door in memory, i can determine where the handle should be
delightfully devilish, Seymour
now i need to determine the rotation of the door
trigger position is a good start, but i cant be sure which way the door opens
door of a kind always hinge the same way
yeah, no, i cant use the hinge, since some doors and especially gates hinge different
i wish the handle-selection would exist
it is an animation source, can't we have the position from this?
you tell me
also, not all doors have handles
i might just scope out the offsets manually
really tedious, but eh
i'll write a script that gives me the offsets in mode-space from shooting at the handle

no, but that still doesnt help
because i just need to know which way the door turns and how much
this would be so simple if the position of the door was always at the handle-edge
animate them all on mission start ^^
yeah, and then get start and end positions
for the doors
wont be as smooth as i'd want to, but meh
beggars cant be choosers
i'll need to write a thing that records all the doors and then a parser to parse the information
and i need to manually go and shoot each door
but im lazy
so i shall keep on looking for a smarter way
you could have a hardcoded list, but it would prevent mod buildings compatibility
can i use animationSourcePhase on building doors?
seems like i can
yeah, ive got this
So after a break I decided to revisit the suicide bomber disguise script I was struggling with. I think I may have figured it out.
in initPlayerLocal.sqf I have:
//Add action for disguise script
player addAction [
"Disguise",
"disguise.sqf",
6
]
which points to disguise.sqf which is this:
https://pastebin.com/k7fLfd4B
which points to detected.sqf which is this:
https://pastebin.com/AvvG6CKD
basically instead of trying to hassle with having it all be one waitUntil loop that has to "re-get" the variable of the unit after the player dies when it is all run serverside, I have simply just added an action which should keep everything local as all of these scripts are run correct?
is there a command to get the animation source names of a model?
doesnt work
i mean, it gives the animation names
but those are not the correct ones
it gives two arrays
animationNames gives the classnames in AnimationSources
CfgVehicles >> etc
i see
on another hand, this wont help me get the rotation in the world i need
damn
what are you trying to do?
get the rotation of a door in world-degrees

so that i can compute the location of the handle on the door in world-coordinates
and do note, enoch buildings dont have handle-selections
you can (partially) use animation state? 0..1?
door* animation state
you could try https://community.bistudio.com/wiki/animationSourcePhase (see example 2)
hmm… sure about that?
100%
(okido)
object is building, since doors are not standalone objects (afaik)
so?
the command returns a value between 0 and 1
1 being full animation
for a normal door, about 90 degrees
this works on vehicle turrets because their rotational full animation is 360 degrees
and their axis is the vehicle
so converting 0...1 to degrees returns the turrets relative direction to the vehicle
because the turret's 0 is always facing forwards
but a door's 0 is NOT always facing forwards
and if you know the direction of the object you can calculate the degrees in-world
you cant for a house
because you would have to know the direction the door faces
not the direction the house faces
if i had the direction the door faces, this would already be solved
hmmm
i might jsut give up pursuing the idea
if bohemia could just be consistent with their doors
Well, that data SHOULD be available, otherwise the game also doesn't know how and where to turn a door ;)
Question is; where is this data stored, and afaik is this in the model itself (part of model.cfg)
it's available to the engine, not us
unfortunately
and this whole issue because BI cant be consistent

BI is consistent, because it isn't available to any models
not that
the selection positions arent consistent
the selection position of a door could be any corner of the door
depending on god knows what
hardcoded list it is then?
but even that's a bad solution
anyway to clear an active hint? don't want it to be there the full 30 seconds or whatever it is
hintSilent ""
Hug it
im attaching an object to the door selections
and using that objects world position

welp, that doesnt work
oh yeah
i cant attach to selection
_house = nearestBuilding getMarkerPos "mrkBldg1";
{
if (_x find "door" >= 0 and _x find "handle" < 0) then {
_inModelPosition = _house selectionPosition _x;
_myPos = getPosATL (_house modelToWorld _inModelPosition);
};
} forEach selectionNames _house;
something like this?
yes, i've done this
the issue is that the coodrinates that selectionPosition returns for doors are not consistent
so i cant use them to figure out where the handle would be
i could use the trigger memory point
because that's always at the center of the doorway
but i would preferably like to have the position follow the door
which it would do, if the door's position would always be at the bottom edge of the handle-side
but that's the issue
the door selection's position could be any one of the corners of the door
well, if it has a "handle" you can use that, otherwise just center of mass
handle is not consistent to all models
what is center of mass?
how can i get it?
i mean, i know what center of mass is
it's the center of the object (in this case door)
but how would i determine it from a single point
so the "door" location is a corner, and not the center of the door?
yep
it's one of the corners
which one? it's random
apparently it could be the vertice that was binarized first
or something along those lines
@winter rose is it possible to see how commands function or are they engine-side?
commands are engine, functions are in PBO's
yep
thought so
so it's in BI's hands
do you think someone would look into fixing this if i ask nicely?
making the command consistent with the outer edge of the door
you can always create a ticket in the Feedback Tracker, but I doubt it will be fixed since it doesn't break anything
Not a chance, I believe it would imply changing the models
and it will most likely require to rebuild all building models instead of some code
or have the function work differently
Having new commands, however…
it wouldn't require rebuilding models
they have the p3d data engine-side
theyre somehow pulling this data
welp, for the time being, i must work with what i have
i can get the prompt on the center of the door, but which side it will be on is up to BI
hmmm... how about https://community.bistudio.com/wiki/selectionPosition ?
exactly what i have been using
yes
i've gone through all the applicable lods
and i am actually using the memory-lod to get the height
do you think someone at BI would throw me a bone engine-side if i did all the work to have an application where this would have to work?
Not before ARMA 4 probably...
And are you looking at ARMA 3 buildings or ARMA 2 ported ones...
all buildings
they have the same inconsistency
arma 2 ported, arma 3 vanilla, enoch
Yep... should have seen what they did with doors in DZSA 0.61... half had 1 as the open state, half had 0

im being a little bit entitled, though
i guess i should just feel happy with what i have
But it would be nice that when/if ARMA 4 happens that they are consistant with this (and also allow you to easily access the door id for a building so that you can have persistent locked doors through a restart, i.e. having global, unique identifiers for doors)
At least the cup ones should have the same namings (as A3)
Didn't they English everything in Enoch?
No idea since when, but the stuff i have seen was just english (at least for buildings*)
hence the reason why i updated the houses in CUP, a couple years ago 😄
Consistency etc
@restive leaf doors have unique names
well, the door selections do
i dont think youre allowed to make non-unique doors in the model
No... but without going to each door and running a script for every unique building model you have no clue what that door is called... And then working out how to store that in a persistent database so it stays locked through a restart of the server... Well, I had better things to do that were more important
the door is called "door_1", "door_2"...etc.
and the variable is bis_disabled_[selection name]
i mean, i can do this for you, if you really need it?
you can get all the selections with selectionNames
do remember, doors that have 2 rotating bodies, are called door_[x]a...b
but you can lock both doors with door_[x]
so just edit out the extra characters for locking
I know about locking... But yeah, if you give me something to store in a DB and be able to be lockpicked then great
Yeah...
sure thing, boss
LOL. Cool. I can do the storing in a DB thing
in what way would you like it? get variables for all buildings or save when locked/unlocked?
So long as I have info that can be reapplied on server start
Save when locked... update when unlocked
alrighty
sooo, redoing all the life-stuff 🤔
still better than ripping it from other ripped frameworks 
(housing systems in Life use that stuff for at least 5-6yrs 😛 )
I mean, the basic mechanic is the same.
but not ripping anyone
Of course it can lock individual doors 😂
it CAN
but it doesnt
or have i understood something wrong?
anyways, one would expect originality when writing script
and promote it, infact
especially a veteran
Re-inventing the wheel
or writing your own code
Re-inventing the wheel.
sometimes reverse-engineering someone else's work takes longer than doing it from scratch
It's a 5min Job, tho^^
ok?
Store the locked doors in a var, lock doors with the bis function
done.
There is no magic in it
ok, anything else?
until you run into the issue, that some objects will stay unlocked, even when you set it *to locked.
Since they are not loaded on the client, so on the init you run into the issue -> setVariable is beeing set on a nullObject
Then you think about alternatives.
whats the command to get the set of names of weapons of a vehicle?
No @jade abyss Not at all... 🤮
so if I want to get the variable of a independent UAV that a player starts with on their back, so I can disable the vision modes, would I use something like,
_indieUAV = missionNamespace getVariable "I_UAV_01_F"?
@fair drum have you defined a variable with setVariable in the missionnamespace woth that name?
negative, still learning these getVariable related commands. am I able to set a variable on a packed uav that is on the back of a unit? since its not an object I can really click on in the editor to see that variable box
setVariable getVariable aren't for set/get config vars
what direction should I head then if I want to find the mission assigned variable of a unit that pops into existence such as a player unpacking a UAV?
@fair drum what
Unpacking a UAV counts as assembling a weapon.
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#WeaponAssembled
thx ampersand
idk how to describe it I guess. like if you place a unit and don't give it a variable in the editor, doesn't the game just create its own variable for that object?
Yes
But it's not accessible through the missionnamespace
And to confirm
The UAV does not exist on the players back
It's just a backpack with a convenient model
The uav gets created when you assemble it
kk, thx ampersand for the point to where I needed to go
if (!isNil "UAV_Operator") then {
UAV_Operator addEventHandler ["weaponAssembled", {
params ["_unit", "_staticWeapon"];
_staticWeapon disableTIEquipment true;
}]
};
works perfectly
only for the one he assembles though
thanks that sound playing on one person worked perfectly 👍
But that's not how regular “connect” action works?
no
I mean, not in vanilla game setting
no, you use remoteControl on an AI unit in the UAV
the mod "sspcm" gives you access to the virtual vehicle garage. If you spawn a vehicle, and enter it, then change it to a uav, you are effectively inside the uav
so yea, it is possible, but not recommended
…I somehow doubt that this is what Hypoxic wants to do 😋
yea
would be funny tho, just imagine in real life.
So guys, i just found this neat drone here, lemme control it real quick
gets sucked into the drone
doesn't beat the bouncy mortar!
where does code get executed when you do it in zeus?
is it possible to run a lineIntersectsSurfaces check and completely disregard certain kindOf types without being limited to the two 'ignore' options?
just grab all. then filter manually after
@still forum i'm not sure how to do that without running multiple checks - lineIntersectsSurfaces only returns the first surface intersect - unless I'm using it wrong which I guess is the case
haha yeah i get confused by that - it's like the command is lineIntersectsSurfacE
https://github.com/michail-nikolaev/task-force-arma-3-radio/blob/master/addons/core/functions/fnc_objectInterception.sqf#L37
definitely returns multiple
here I filter out local and remoteParent, and player
can just do isKindOf check as you get the object that intersects
i run this ```sqf
_ins = lineIntersectsSurfaces [
AGLToASL positionCameraToWorld [0,0,0],
AGLToASL positionCameraToWorld [0,0,1000],
player,
objNull,
true,
1,
"GEOM",
"NONE"
];
hintSilent str (count _ins);
Well yes
that will only return one
https://community.bistudio.com/wiki/lineIntersectsSurfaces check the parameters you are giving
Is it possible to check for an item in a players inventory then remove it and execute an SQF?
yes
I know the removing and checking is possible but I have no clue how I would execute the sqf in it on removal
There's no event to execute sqf on removal, but you just can execute sqf in the same scope of removal
@bronze temple
which "removal"? do you want to remove the object by script, or are you waiting for the player to throw/drop it?
use InventoryOpened and InventoryClosed EH's and check for difference?
removeitem;
execVM "yourscript.sqf"
};```Note this won't work, just a mockup
Essentially it is you clicking a dialog option to get healed by a doctor(ace medical) and it removes the currency items from your inventory which in this case is a bag of caps
With ACE you can use the internal events
can you not use || in string conditions? Or is it just a hold action meme?
strange because "missionNamespace getVariable ['playerDropping', true]" by itself works but as soon as I try something like "missionNamespace getVariable ['playerDropping', true] || !alive heli1D" it doesn't. This is in the conditionShow param
Maybe because there's no heli1D?
there is, but still should show when the trigger for the variable to turn true fires. The heli is supposed to get to the LZ and then the variable playerDropping turns true in the trigger but in the small chance that the heli pilot is killed before it reaches de LZ I want the action to show or the player can't drop. So it works if there's 1 condition but as soon as there's an alternate condition it never shows even if the variable returns true.
it doesn't
How? Errors?
the conditionShow param
Assume forholdActionAdd?
No errors are shown, and yes it's holdActionAdd
No errors are shown so it's working properly.
"missionNamespace getVariable ['playerDropping', true] || alive heli1D"```Assume this is something for you?
it is for a SP mission I'm doing for myself yeah
it's strange because adding conditions with && works too
if i define a function in the config.cpp in the class "zb_wl", does the function then gets called via zb_wl_fnc_myFunction?
Yes
aight
although TAG_fnc_subGroup_function is preferred
true true
is there a way to translate the clientOwner to the unit?
BIS_fnc_getUnitByUid by UID,
otherwise ```sqf
private _allPlayers = call BIS_fnc_listPlayers;
private _index = _allPlayers findIf { owner _x == _theOwnerId };
if (_index < 0) then { objNull } else { _allPlayers select _index };
only if you have the UID, which is not the same as owner ID
i see, but the code you sent is for the clientOwner id, right?
yes
euh, the code seems to be wrong
i suspect that the problem is that the function isnt called/spawned
you need to provide a _theOwnerId
call* BIS_fnc_listPlayers
then maybe you don't have a client with id 4
it is the clientOwner id, right? because that is the id i have right now
yes, i m not the server
i m currently running the server via tadst
wait, so i have to execute this code on the server?
yes
working on it
the reason clientOwner exists is to get your own owner id without being able to get others (from a client's perspective)
yea, i already figured, as you cant use it with any parameters
wonder why owner only works on server 🤔
if only i could rely on my friends to test stuff
naaaaaaaahhhhh they prefer playing koth over helping me progressing with the server
it seems to find all the players under my clientOwner id
2020/07/01, 20:37:30 [civ_1,civ_2]
2020/07/01, 20:37:30 "-------------------------------------------------------"
{
_theOwnerId = remoteExecutedOwner;
private _allPlayers = call BIS_fnc_listPlayers;
private _index = _allPlayers findIf { owner _x == _theOwnerId };
if (_index < 0) then { objNull } else { _allPlayers select _index };
diag_log _allPlayers select _index;
diag_log "-------------------------------------------------------";
}remoteExec["call", 2];
this is how i found that
🤔
thats not how that works
if (_index < 0) then { objNull } else { _allPlayers select _index }; useless line that does nothing
select _index; useless thing that tries to select from a nil, won't work
How do I use the number a player entered into an RscEdit
Like if they type 1 in an RscEdit and hit BUY, how do I check that they typed 1
got it to work @winter rose
{
_theOwnerId = remoteExecutedOwner;
private _allPlayers = call BIS_fnc_listPlayers;
private _index = _allPlayers findIf { owner _x == _theOwnerId };
diag_log (_allPlayers select _index);
diag_log "-------------------------------------------------------";
}remoteExec["call", 2];
i forgot the () around the first diag_log line

@copper needle look at ctrlText and parseNumber
Hey guys
If I wanna make a kick down door script
How do would I go about
“Getting” the door in front of player
So play animation before kicking down door
And then it would open the door
I would say:
- get the door and make sure it is locked
- add an action with
addActionto the door - action runs a script with animation, unlock the door and animate it open
You can get the position from the memory lod too
Alright , thank you very much for the guide , I will search for a function about getting door
You can get the position from the memory lod too
@ebon citrus could you elaborate please ?
Models have lods
You can get specific selections from those lods
Then the the position of that selection
And then translate it to world-space
Here's an example which locks/opens doors (with a fake key), but can be modified to your needs: https://forums.bohemia.net/forums/topic/215428-addaction-in-building-doors/
The trigger of a door is usually at the center of the door always at the same height
Oh ok I see alright thanks so much for the help
Hi everyone!
I try to delete diary record from basic "diary" subject and i can't do that.
private _task = player createDiaryRecord ["diary", ["Test", "Test"]];
player removeDiaryRecord ["diary", _task];
And my test record stays in my diary.
What am i do wrong?
Upd. fix variable.
Tried "Test" instead of _task @lost copper?
Use string name of record? No, not like that.
But:
_task = player createDiaryRecord ["diary", ["Test", "Test"]];
hint str(_task);
This returns test, without quotes.
So i try to:
player removeDiaryRecord ["diary", test];
// and also
player removeDiaryRecord ["diary", "test"];
with no success.
I will try to your variant later after work, @winter rose. Thanks for help.
hello, so i have this script and i want to make the ai completely disabled with it, can anyone help out
@surreal epoch pastebin
idk how to do that, what do i use
Pastebin, just google it
ok tgis is weird, what about it?
You paste text in it
And then share the link
As for your question
Use this to disable portion of an AI
i dont know how to implement it on the code, since i am not very familiar with scripting in arma i dont know where i would be doing stuff wrong
i know i am supposed to use disableAI, but idk where and how to put it in the code
i still need help on where and how i would put it in the script

In the script, ofcourse
@surreal epoch if you want someone to write the script for you, then just ask
But you'll need to do that in #creators_recruiting
its more than just writing it down for this instance, i would like to learn how to put stuff like this or at least know how i would be butchering it, i learned that if i put down _this it is related to the object, when i put _this disableAI ''all'' it does exactly what i want but when i try to put it in the SQF it does not do anything
so what i did with it was just puting _this disableAI ''all'' or disableAI ''all'' but it didnt do nothing, even taking dostop off and switching it for disableAI ''all'' didnt do anything
and idk where to start or where i can find a video to help me with it
i dont think this is a common questions so i cannot find any videos about it, also i dont want to recruit someone to ask someone to do it for me since i dont have anything to offer
And how do you execute the script?
its on the sqf wich is activated from addaction
That's why it won't work, _this could be anything but in addAction it's an array not an object. I'm not reading the context so IDK what are you trying to do though
sorry, what i am trying to do is spawn casualties so the medics can medic them in the training without having to get a third player to shoot
everything works as intended, i have tested multiple times but due to the mods that i use the ai will patch itself even without items, so as a fix for that i thought about taking the ai away from the npc thus using disebleAI
...In ACE environment?
yes
Then IDK. I don't use ACE
well, it is an ACE environment but i just want to add the command line disableAI to the npc that spawns, the question does not necessarily has stuff to do with ACE
sorry if the script wasnt clear the problem that i have is within this command line https://pastebin.com/6M4YJiVL
i am
Dont just come in and ask "write script fir me". Do that in #creators_recruiting
Where is that script executed?
there is an object that has the addAction function that calls in this sqf
What is passed in the call?
Also "this" doesnt exist in the context youre tryint to use it in
i am sorry, i dont understand your question
You can pretty much only use "this" in 3den editor object init field
oh, thank you
this addAction["Create Patient","Scripts\creatept.sqf"];
the code works as intended, at least the one i posted
issue is that idk how to properly implement disableAI within the SQF
i only know trough eden
what i am trying to do is add disableAI to the script
is it possible to change the music that plays when a mission ends? It seems like something thats hardcoded
hey guys
can anyone help me out in vc
through screenshare? its regarding a door script
@tough abyss why dont you post it and have us look at it?
@surreal epoch try to do it and then ask when you fail
it's important to try before you ask for help, otherwise you learn nothing
ok here so
I want to use it in a multiplayer environment, therefore I have a temporary add action client side only
the script is not even going to the action itself
I have tried many versions of this
looked at other things but can't seem to get it to work
?
can you post the addaction?
ummm...
couple of things
playAnimation doesnt exist
"kick" is not defined
right Ik that
and i dont think that's how you use that function
sorry forgot to mention
that whole line
I have this
player switchmove "AwopPercMstpSgthWrflDnon_End1";
player addAction ["Knockdown Door", "knockdown.sqf"];
thats in the init^
I just put everything in one file
singleplayer mission
ok so I found out that
private _door = [objNull, 0]; does nothing useful
init.sqf
you can use "this" in init.sqf
so either youre not saying the truth, or the sky has fallen
oh wait
this is my description
sorry
author = "J";
onLoadName = "Knockdown Door";
onLoadMission = "Knockdown Door Script";
loadScreen = "";
class Header
{
gameType = RPG; // Game type
minPlayers = 1; // minimum number of players the mission supports
maxPlayers = 10; // maximum number of players the mission supports
};
i think i was seeing things
all good
yeah I thought this was gonna be a simple script
so the action is added
your next problem is with the animation
can you post the script youre using now?
well the animation doesn't run because the script before that somehow breaks
how does it break?
ok so heres the whole file with all the versions I have used
can you post the script and give the error message?
ok I will use the script from the paste
Ill be using this
its also not going to the hint when the door is unlocked
i dont think works [_door] call BIS_fnc_DoorOpen;
not sure thought
there is no documentation on that
yh im skeptical on that
I looked at other scripts
people use "animate"
yeah the only error message is ;
missing ;
so I guess the issue lies somewhere else
then you do this _door getVariable [format ["bis_disabled_%1", _door], 0];
that wont work
you cant getvariable from an array
you need to get the door to open it
yeah but I want to check the lock state too and I found that to check it
this code is weird on so many levels i dont know what the bguy who wrote it was trying to accomplish
well I wrote it by myself but that particular line
I took from if you google
sushi breaching script
Idk how he got it to work he got so many more lines and files
first of all, you want to get the building
that way you can get the variable state of the specific door from it
so, again: there is no "door" object
the doors you see are part of the building model
so cursorTarget isKindOf "door" won't work
oh ok I see
and _door is an array
so nearestObject
you cant use "getVariable" on an array
first of all, what is it that you want to do, exactly?
explain the concept
i see that you want to unlock a door by kicking
yeah
but what is the application idea
like genuinely that
like how would you perform this action
either by a gui or just the add action
explain what the player would do
they would either call the UI and select the option "kick down door"
or for milsim
add action but
I had an idea
to have the add action only be "seeable" if in vicinity of a door but thats a different story
then add the action to the door itself?
I just want this to work first
is this a specific door or every door in general?
here : I want something like this :
maybe some addon implementation in the future too but for now just get the script working
why not use this one then?
they haven't released it I think and I want to make a simple one
idk I don't wanna just paste tbh
erm...
still, again, question. Do you want this to be general or just for a specific door?
oh boy...
like any door
how much scripting experience do you have?
the player looks at
well thats the thing its sqf I know c++ and stuff
its just sqf is different
ok, then it wont be hard
i recommend you get yourself familiarized with sqf first
now getting back in it
making general addons isnt really easy
well I know the fundamentals of it but ye
youre missing some basic stuff
so making for any door must be an addon then?
not really
but preferably
so what i recommend you do
add an eventhandler on the player to check for keypresses
when a specific key/combination is performed execute the script
the script gets the object you are looking at
if it's a type of house, it gets all the door-selections for that house
then it gets the closest door to the player
checks if it's locked and then unlocks the door and does all the rest of the job
additionally, you can add a distance check
yeah have it dependable on the direction they are facing
do you even read what im writing?
yes I am but I was researching and saw someone suggested that
I just thought it would be useful idk
i just told you what to do
yeah, I know thank you I just thought that be a useful contribution but I guess not 😛
you can get the object the player is looking at with cursorObject or cursorTarget
yeah just realized...
right
aah makes sense now to what the person helping me on the forum post said
regarding selections
private _door = 1; // First door
but that is not universal
but makes sense now thank you
oh
there is no documentation on that
lies 👀
yeah, just did
when a specific key/combination is performed execute the script
@ebon citrus
the script gets the object you are looking at
@ebon citrus that shouldn't be too hard
I'm assuming it will be for any door
what you stated as it is an event handler so it will just get cursortarget and use script
its like event handler for fall damage
so people universally don't take fall damage everyone on the map for instance
but in this case it would be MP event handler right
make sure you understand the difference between "cursorTarget" and "cursorObject"
getCursorObjectParams might be better for you
so the selections
?
Return Value:
Array - [cursorObject, selections, distance]
so the middle thing im confused about
do I use what you sent
selectionnames?
?
you can use selectionnames to get selection
hold on, im launching a test mission
trying to understand the command
do you know how commands work in arma 3?
wait im stupid nvm
i just read again what it does on the wiki
my bad runnin on not much sleep lol
sry bout that
makes sense now
yeah, you want getCursorObjectParams
that's really useful command actually
im going to use that
@ebon citrus I presume the eventhandler makes it easier than having just a function that can be called from when pressing a button on a UI?
yeah, well because you can have it bound to a key
but is that the only difference
apart from having the action on the user? yeah
with a little smart use of the condition field, you can make the action appear nicely when youre looking at doors
yeah that's exactly what I want
yeah, have fun
😄
i recxommend you take a look here: https://community.bistudio.com/wiki/addAction
ok, will do, thanks
is there a way to denote the ground as an object?
say for ignoreObj2 for https://community.bistudio.com/wiki/lineIntersectsSurfaces
lineIntersects?
not applicable
what is the use case?
oh, yeah sorry. It's for getting the specific position the player is looking at
so im using lineIntersectsSurfaces for this
because it has a return that holds the position
so if the player looks at a hill, you want it to go through?
i want it to be discarded
screenToWorld [0.5,0.5];
``` 😄
only problem is that height is always 0
so it's always only the surface of the ground
I really don't get what you want
if you want "where the player looks at" but not the terrain ground, use lineIntersects?
lineIntersects doesnt return the position
Returns objects
Not a position
It's not a huge inconvenience
I can get around it easily
I was just asking
Can i use the terrain as an object to ignore
https://community.bistudio.com/wiki/BIS_fnc_getIntersectionsUnderCursor maybe. otherwise, workaround with a terrain check yep 🤷♂️
Can i use the terrain as an object to ignore
nope, can't do - terrain is not an Object
image attached below:
@winter rose is this a bug?
https://i.imgur.com/FTGzUdK.png
happens with some world-objects, most notably gates
I guess yes no, because https://community.bistudio.com/wiki/BIS_fnc_objectType has specific format string, not based on classnames
so feedback report?
should i make one?
or do you think it wont be fixed?
ah, i see
no I meant "I guess it's normal", my bad
what should i use instead of "house" for gates?
dunno 🙃 check the config and their parents, I suppose they have one in common

i was expecting i could summon you to solve this issue

Sorry for the bother and thanks for the help
i've worked up something to solve my issue with the door offsets
to get rid of the action-menu in arma 3
for good
part of project Exposure
Tried "Test" instead of _task @lost copper?
@winter rose, sorry for ping. I am return to a question about deleting diary records. Your solution don't work. Error expect.
Error Type string, expected Diary record
ok, im getting a "cannot load letter_f_1.paa."-error on this line:
drawIcon3D ["letter_f_1", [1,1,1,1], ASLToAGL (_ins select 0 select 0), 1, 1, 45, "Open door", 1, 0.05, "TahomaB"];, despite the texture being in my mission's root folder. Any bets?
and yes it's in .paa format and converted properly
forgot ".paa" ?
this specific image worked somewhere before?
hold on, i'll try to use it on a user-texture
yep
it works on everything else just fine
even setTexture
but drawIcon3D doesnt like it
not really a scripting question, but any idea why my P-drive isnt mounting
i hit "mount p-drive" in arma3 tools and it runs the prompt and quickly hides it and nothing happens
try accessing the "mount P-drive" tool from the directory (and run it from cmd so you see the eventual error message), else reinstalling the tools?
ok, it works when i run workdrive.exe just like that
but not if i run it from the arma3tools
🤷♂️
workdrive /Mount C:\path\to\fDir ?
nope, just ran it
oh btw:
what is the difference between Draw3D and EachFrame Mission Event Handlers?
Draw3D is on each -drawing- frame, while
EachFrame is each simulation frame?
i assume draw3d requires focus?
draw3d is only present on the client aswell
wont run on server/HC
each frame and draw 3d run at different times during the frame, one on scripts simulation one on ui draw simulation, you can test which one runs first
nothing to do with "simulation" vs "visual" frame?
Draw3D also doesn't run when your map is open
https://community.bistudio.com/wiki/parseNumber is returning a scalar, why?
ok, so "scalar" is just another name for "number"
nowhere on this page is Scalar mentioned though?
also, another problem
[_house, _doorIndex, 1] call BIS_fnc_DoorOpen;
doesnt work, even though _doorIndex is a number, and it errors out on expecting a string
but if i replace _doorIndex with a hard number, it works
a.k.a. variables dont work in BIS_fnc_DoorOpen... because magic
private _doorIndex = 1;
private _house = cursorObject;
systemChat typeName(_doorIndex);
[_house, _doorIndex, 1] call BIS_fnc_DoorOpen;```
try it out
"Error type number, expected string"
but switching it out for a number, instead of a variable with a number makes it work
never mind, now it doesnt
@umbral nimbus There are several EH's which handle inventory/gear items, or the unit itself, which you can use to trigger your script:
- Init
- Respawn
- InventoryClosed
- aresenalClosed
- Put
- Take
On each of those EH's you can run a simple script which checks if the unit has the item, and if yes, execute additional code.
https://community.bistudio.com/wiki/BIS_fnc_doorOpen
Object, String, String, String, Number
*armagic*
[_building, 5, 1] call BIS_fnc_Door;
that's your example, Lou
and it works
and sometimes it doesnt
with the same parameters
switching out some aprameters and running the code fresh seems to make it work for a moment
@exotic flax there's also:
https://github.com/CBATeam/CBA_A3/wiki/Player-Events "loadout" EH if you're running CBA and want to track players only.
that's your example, Lou
[_house, "door_1_rot", nil, nil, 0.25] call BIS_fnc_doorOpen;
```is my example @ebon citrus
you are mixing door and doorOpen
oooh
i see
but doorOpen works with those parameters too
no, wait it doesnt
ok, that's my issue
👀
so Door is a better one for me here
the difference between Door and DoorOpen is that DoorOpen allows you to define which parts animate
Door animates all the necessary parts for you
im just having a stroke again
dont mind me
always great when people self-therapy and solve the problem while talking to others 
We're happy to help you 😉
the problem is that i lost my glasses some weeks ago and im blind as a bat without them
batgirl was a redhead indeed
Did you try looking on top of your head? 😉 Been there, done that 👓 👀 🦆
yeah, i bet they wouldve falled off some time ago
im rpetty sure i left them on a park-bench
Going to repost it here
hello guys
I know the scripting command for it...
But now I want to make it a feature of an object:
I want someone who has object X in his inventory to 'ReportRemoteTargets'
as with the scripting command setVehicleReportRemoteTargets.
Anyone has an idea how to do that?
MP compatible
for players primairily
nothing to do with "simulation" vs "visual" frame? @winter rose you mean future vs visual? That is for moving objects, future predicts object position based on speed and direction, visual just takes from where it is dunno if related to draw, which is for ui
How do I do a absent placement for a number? Like "" for a string or objnull for an object?
@unique sundial yeah I don't have a clear view of what is "2D drawing frame", "3D drawing frame", "simulation frame"
Like, in 60 drawing frames the simulation could only be updated 20 times, all that I don't know
Everything is working okay. Now how can I make this more efficient and cleaned up? https://pastebin.com/G3P3E5zQ
How do I fix me being stuck in a animation even tho I am doing player switchMove "something"; and then after that trying to reset it with player switchMove "";
switchMove "" should reset the player though - is it a special animation you are using before that?
little something i've been working on today. Video attached below:
https://streamable.com/z2apfr
what map is that?
Enoch (Livonia)
ah. is that worth picking up on the current sale?
Project Exposure will be developed for Livonia
not much content for it
that's why i decided to make something for it
@tough abyss video attached: https://streamable.com/8gadkt
damn looks nice, universal to any door?
also does the kickdoor do anything? Or is it WIP?
