#arma3_scripting
1 messages ยท Page 234 of 1
heh true
Woah, Take on Helicoptors was released 27OCT11?
I honestly thank TKOH for making me a good ArmA pilot
I have some walls, around 12 of them and i would like the ability to have the walls dissappear and reappear at the push of a button. So i gave them all names and added an 2 addactions to a button, one for dissappearing the walls and one for reappearing it. they would call "wallsaway.sqf: and "wallscome.sqf"
this is what walls away would have: wall1 setVectorUp [0,0,-10];
wall2 setVectorUp [0,0,-10];
wall3 setVectorUp [0,0,-10];
wall4 setVectorUp [0,0,-10];
wall5 setVectorUp [0,0,-10];
wall6 setVectorUp [0,0,-10];
wall7 setVectorUp [0,0,-10];
wall8 setVectorUp [0,0,-10];
wall9 setVectorUp [0,0,-10];
wall10 setVectorUp [0,0,-10];
wall11 setVectorUp [0,0,-10];
wall12 setVectorUp [0,0,-10];
and then vice versa for wallscome.sqf
my question is, is this gonna work? :p Am i missing a step, like putting those wall objects into some sort of group so that i just setVectorUp that group instead of the walls individually?
oh didnt know that command. so wallscome.sqf would be:
wall1 hideObjectGlobal true;
wall2 hideObjectGlobal true;
wall3 hideObjectGlobal true;
wall4 hideObjectGlobal true;
@torn jungle
params ["_open"]
_walls = [wall2,wall3,...];
{
_x hideObjectGlobal _open;
} foreach _walls;
[true] execVM "walls.sqf" to open
false to close
copying this over from Config Editing
not sure if this would be the right place to put this. HCPookie's Camo Nets don't show up in the Virtual Arsenal, and I'd like to add a CFGPatches or whatever to get them to show up. Anyone know how to do that?
heck, I'd be fine just being able to place down the box in Zeus
@lone glade @tough abyss At last check the VBS trio used their own version of SQF (including VBS-exclusive scripting commands) while DayZ SA's Enfusion is supposed to have (had) a code merge with the engine from Take on Mars (TKOM)
DayZ is using some kind of C-like scripting language.
Which based on interviews/Q&A came from TKOM
Does arma allow $ in identifier names?
i thought dayz used java
noone uses java
it's me or the Z axis on modelToWorld , modelToWorldVisual , worldToModel and worldToModelVisual are utterly fucked ?
it seems to be the case with nearly all buildings for me.
Double checked the position format? (i.e. AGL, ASL, etc)
The conversion from model to AGL and vice versa is broken
seems to always use something around 0 for Z, even If I use -70 or 90
for me _unit modelToWorldVisual (_unit selectionPosition "pilot") works fine
i'm using a house model offset to place a cache, I obtain the pos by doing
copyToClipboard format ["%1", (testHouse worldToModel (getPos cursorObject))]
and placing by doing
_box = (selectRandom ["Box_FIA_Wps_F", "Box_FIA_Ammo_F", "Box_FIA_Support_F"]) createVehicle (_building modelToWorldVisual [0.537109,2.24023,-2.90897]);
note that the third value doesn't matter, be it -7 or 1 it doesn't matter, the position barely move.
@lone glade have you tried creating it somewhere and then moving it to its desired position? I had similar issues with it during the Alpha.
same issue, I only got it working for one building
alganthe: Pretty sure createVehicle will create it on the ground (or nearest surface). I think you'd have to do a setpos after that.
I tried creating it a 0,0,0 then moving it, same result.
the third parameter would make a difference with setPos though?
thing is, I need to have the proper offset from the model.
so i'm still going to use modelToWorldVisual or modelToWorld for the position
is it over land or sea?
land.
https://github.com/alganthe/Co-ops-an-arma3-vanilla-mission/blob/dev_altis/functions%2Fside missions%2FcachesSM.sqf the file in question, the positions are in an other file.
it works fine, but I'm forced to use the first floor, can't use the second floor of any house.
(except one type)
testpos = testhouse worldToModel (getposATL player);
player setpos (testhouse modelToWorld testpos);
that seems to work even though it doesn't match the docs
I'll give it a check tomorrow ๐
it's sort of impossible for it to work properly when providing an AGL, because the height will be 0 nomatter what floor you're on.
unless you're doing ridiculous magic there's no way to get that pos.
any way of detecting all vehicles spawned by zeus, including jets, helis?
and so that it's not the `
CuratorObjectPlaced
` event handler since it catches ammo boxes as well
Oh, yea. Seems it's what i was looking for, thanks.
someone used moveToCargo lately?
has no effect for me (using it for player)
https://community.bistudio.com/wiki/Arma_3_Actions#MoveToCargo
can u send me your code for comparision (just the line with the command)
i tried:
player action ["moveInCargo", vehicle player];
while sittin in slammer as driver
it might be a problem that i am already inside the vehicle which i pass as an argument
yes
you need to be out of vehicle
player moveInCargo [_vehicle,_i];
uiSleep _sleeptimer;
_positionArray pushBack (_vehicle call _fnc_get_pos);
player setPos [100,120,0];
uiSleep _sleeptimer;
ok so i just do moveOut player before
cargo positions nice
thanks for your help
not sure if i can link anything in here, it's hastebin code, i can't figure out why this view distance switch key won't work. http://hastebin.com/ejajatatof.vbs
have you set a variable called 'setViewDistance' on them?
hold on
okay, this is the latest version, but now it's giving me an error "invalid switch block" http://hastebin.com/eturatawov.vbs
uhh idk
i just set my view distance to 500 and put that inner switch in the debug console
and it increased by 500 each time i ran it
that's the whole SQF?
you need a switch around that case 15:
or to get rid of the case 15:
how are you calling it? as an event handler?
it will give zero divisor because of the select lines at the start
_key = _this select 1;
but _this == []
uhh
[objnull, 15, true, true, true] execVM "viewDist.sqf";
that should stop that error because then _this == [objnull, 15, true, true, true]
so it can select 1,2,3 and 4
it looks like the script is meant to be in an event handler
well
it's meant to go in a keyhandler file that's already defined everything but i didn't want to setviewdistance in that file
hmm
undefined variable in mf_notify_client;
means it can't find that function
so could i uhh setViewDistance 1000; ["NEAR View Distance (1000m)", 5] hintSilent "Ear Plugs 90%";
something like that
but ofc calling for vd
or defining it i mean.
well that syntax is wrong, but you could do something like a hint there
hmm
i would do it like this: http://hastebin.com/ekirivubir.hs
then from your key handler script, you can just call [-500] execvm "viewdist.sqf";
or [500] execvm "viewDist.sqf"
yes i put uhh
so i put http://hastebin.com/liricokane.avrasm in my keyhandler, it worked, but kept reverting back to 500 vd every time
and if i dont setViewDistance 500; it does nothing
you using ace3?
with that switch, if the viewdistance doesn't start at one of those numbers, it won't do anything
like i think default view distance is 1600
ah
so you might need just setViewDistance 500; in your init script
but not in this script
hmm
setViewDistance 1000; in init.sqf, http://hastebin.com/wodekuwimi.cs
doesn't work.
eh i give up lol case (_key == 2): //Key "1"
{
setViewDistance 1000;
["NEAR View Distance (1000m)", 5] call mf_notify_client;
};
case (_key == 3): //Key "2"
{
setViewDistance 1500;
["MEDIUM View Distance (1500m)", 5] call mf_notify_client;
};
case (_key == 4): //Key "3"
{
setViewDistance 2000;
["FAR View Distance (2000m)", 5] call mf_notify_client;
};
question, if i set the respawndelay in the description.ext to -1 does that prevent respawn?
like in a basic mission?
if you set it to 1e10 they'll respawn after 317 years
ah k thanks Lecks
does anyone know how to create some sort of autorun hotkey?
script wise for all players
Hey I'm having trouble finding this if anyone knows it. Basically I'm looking for the command that BI uses to respawn playable units. I've been digging through their BIS_fnc's in the respawn templates but none of them seem to use any code to actually respawn a unit.
Lev have you checked the wiki? https://community.bistudio.com/wiki/Arma_3_Respawn
@lucid anchor Yep, been through that doc and went through the cfgRespawn configs that it mentions as well. Basically it lets you configure the respawn properties but doesn't have a command like respawnPlayer (args).
Pretty sure its hardcoded.
@spice arch yep but what's stopping you from killing the guy?
but you can get the same effect but just createing the unit and selectplayer into it
@nocturne bluff selectplayer doesn't transfer your name to the new unit afaik, and I'm pretty sure there's some other downsides to using that
:D
I think the name is fine in A3 btw.
Maybe in single-player.. I can't remember Tbh
I remember being fine in MP.
Just ACE nametags dosent catch it, but i think thats because they cache the name somewhere.
@spice arch alternatively, set https://community.bistudio.com/wiki/setPlayerRespawnTime to 0 locally, kill the unit, remove the corpse and voila you have an instant respawn. The only downside is the killed msg in chat on low difficulties
Thanks guys. I was able to approximate the behavior I was looking for by using respawn = "BASE" and then writing a custom template to mess around with the respawn timers.
You can turn of the kill messages in the server difficulty settings.
Hi, I wrote 2 functions to delete all cargo from vehicles. 1 for zeus spawned objects and the second for all editor placed objects. First one is working, but the second one not - could someone take a look at it?
{ if((_x isKindOf "landVehicle") or (_x isKindOf "Air") or (_x isKindOf "Ship")) then { clearWeaponCargo _x; clearMagazineCargo _x; clearItemCargo _x; clearBackpackCargo _x; }; }; forEach allUnits;
what is the other?
_vehicle = _this select 0;
if((_vehicle isKindOf "landVehicle") or (_vehicle isKindOf "Air") or (_vehicle isKindOf "Ship")) then
{
clearWeaponCargo _vehicle;
clearMagazineCargo _vehicle;
clearItemCargo _vehicle;
clearBackpackCargo _vehicle;
};
this one works without any problem with eventhandler attached to zeus curatorObjectPlaced
Perfect time to facepalm.
actualy not - visual bug
if you copy paste it, they are there
checked with the function file as well "_" is there
Oh, I keep making those small mistakes i cant see. Fixed it - cargo items are still not being deleted
also, where is this ran?
separate function, called in init.sqf
run it in initServer (or else shit will get deleted non stop when players JIP) when it start working
also landVehicle include CAManBase
yea, im testing it localy so far
and also use the global variants for the clear commands
did some testing on our server with the function for zeus, seemed to work properly, aka units were not stripped from gear
๐
okay, maybe im calling the function in a wrong way, simply put call bwi_fnc_clearcargoeditor
nope, but allUnits works only for infantry.
oh, so here's the problem
use vehicles
works now, beautiful. Much appreciated
One more question. The function to clear cargo from zeus spawned vehicles needs to be run from the zeus' module init like this: this addEventHandler ["CuratorObjectPlaced", {[_this select 1] call BWI_fnc_ClearCargoZeus}];
Is there a way to do this to init.sqf, so that we don't have to run trough all the templates we have and add this line to every zeus module we have?
replace this by the module var name
they are not named, thats the problem
This returns all curator logic units, not the units assigned to the logic.
this return the name (not var) of the curators no?
this -> logic
Since i assume its the module init there.
{ applycode} foreach allcurators;
should work fine
oh wait I was confusing allCurators by an other command
Oh, nice. That works. I created a new function out of that, to be called in init.sqf.
Yes, im just testing it in the editor so far.
doesn't matter, put it in initServer.sqf
what about onplayerrespawn.sqf?
In case zeus dies? Or i dont have to, since its attached to the module not the player?
Aight, sounds clear to me. Thanks again. I learned a lot today, like always when I ask over here. Love the work you do guys here.
adding it in initPlayerLocal will add it every time someone joins
thus why it's REALLY a bad idea to do so.
just add it in initServer and it'll run fine, and it won't be added non stop.
......... what don't you get in it add the event to the logic not the player ?
not only that but you remove all curatorPinged EHs ......
I made something that kills players after 5 pings within 15 seconds
after the 4th they get a hintC warning, at the fifth they die
nope, they have to click on the warning, thus they really want to die if they spam
oh I just noticed I didn't added my tag to those setVars.
@lone glade is your tag derp?
ofc
๐
here we go, derpyfied
how can i replace stamina/fatigue bar (the one which decrease when running)? i would like to set it vertically and change color default as blue
@blazing trench altis life yes?
@still forge yep
Hey guys, does anyone happen to know an ASL-based FlyInHeight either in vanilla or CBA? A friend is trying to figure out a way to direct an AI to fly in a straight line in order to support a paradrop. FlyInHeight is based off of AGL, so it's dipping and diving all over the place. Even setting the waypoints at a height and leaving the AI to figure it out results in the AI diving straight into the ground, he claims. I'm not able to test it myself at the moment, but I know there has to be a way. Any suggestions?
Yea, I would love to get an answer on this myself. The VBS flyInHeight has a bool in the params that switches it to ASL mode. I would love to see that implemented as part of the scripting commands and functions overhaul initiative.
Nnnevermind, apparently he didn't leave enough room for the plane to climb so it was freaking out. It's apparently flat enough that the terrain doesn't impact it much. ASL would still be nice, though.
ANyone around who can help me out with a function I have thats failing?
It claims I am missing a ; so I am sure that's the issue, I just don't know where..
Can anyone tell me what .hpp and .h files are typically used for and what a typical file structure for those look like?
For arma, both are just used as files to #include. There's not really a standard structure for them.
Sometimes they're used to move common #defines to another file so they can be included from multiple other files
Sometimes they're used to split up configs into smaller files
the extension doesn't really matter.. i think .h and .hpp are just borrowed from C/CPP header files (which are the most common thing to include)
im using altis life, how can i replace stamina/fatigue bar (the one which decrease when running)? i would like to set it vertically and change color default as blue
Thanks again Lecks!
@jovial heath There's a new command "FlyInHeightASL". I haven't checked, but it might be in the next stable update in a week or two.
anyone know how to quickly load up a dialog for checking the locations like this? http://hastebin.com/vucajofigi.tex
Looks like a custom dialog/menu, not something for checking locations
yes it is, id like to be able to edit the x and y locations without having to reload my whole mission to see actual locations?
Location usually means map locations.
You could use ctrlSetPosition in a script and add a temporary button to run it. Or add it in the onbuttonclicks.
no support here about altis mod guys? :/
@blazing trench as nobody plays altis here ... kind of no
however ... to answer your question: the fatigue bar is most likely provided by native arma and not reimplemented --> you cannot do this without a mod
or: you can do this without a mod if the UI element has a UUID (still ... you might need a mod depending on a lot of things you would have to investingate)
hope i could help
@queen cargo ok thanks, yeah that helps me enough because im starting with modding in a3
@trim trout Did you fix it?
@split coral where did you find info on the "FlyInHeightASL" command?
does anyone know if/when sendAUMessage will ever be implimented, or is there a mod thats impliments somthing similar? i cant find any solid info on it ๐ฆ https://community.bistudio.com/wiki/sendAUMessage
will let you connect to a server from within another server
bouncing between servers similar to the bungee system for MC
you mean like server instances?
does other things too but thats what i want
ys so you could have 2 servers 2 diff maps and "fast travel" between them
for example get on a boat in altis and travel to statis
but the command is totaly dead
apparently was never added
Yep, tried to make it work about a year ago, gave up since nothing worked.
i mean it looks like it is implemented...
yea so all that functionality is for is some never really implemented autoupdater for arma
it doesn't do anything with servers
i mean game servers
so yalls wrongs ๐
@split coral Is it on the dev branch? If so, man, what timing.
@blazing zodiac @jovial heath It's on the dev branch and the release candidate.
heli1 flyInHeightASL [200, 100, 400]
parameters are [height careless/safe/aware, height combat, height stealth]
yeh @jade abyss it just simply is not there, ive tried tracking the system but cant find anything ๐ญ
Yep
"small" testing http://puu.sh/nS6P6/af9c6951a8.jpg
@split coral Sweet, thanks so much!
can we get self referencing arrays for SQF @lavish ocean ?
eg arr = [[]]; (arr select 0) set [0, arr];
what we need the most atm is a working +=
not rly @lone glade ... that is litterally the least we need
_i = _i + 12345125125125 works totally fine too
not that nice
still it works
+= would be quite with a overhead also
say what? so you're telling me that native cross compatibility for ammo between multiple mods isn't a big thing?
you mean the config thingy?
yeeep.
youre in #arma3_scripting ... not in #arma3_config ... note it if you mean config stuff
a config version of + is what I want.
wasnt there such an operator already introduced?
it's borked
no
BIS says it works as they intended but it's borked.
its just the arma variant
(ofc)
just like == is not what you would expect in SQF ๐
SQF doesn't care of what other languages do, SQF is pants on head.
thats why i develop OOS @lone glade ... no more inadequate behaviour
then you have intercept, that goes around SQF because fuck it.
eeeeeh, I know for missions, for dependencies it's just a .dll
And why SQF is supposedly going out the window in Enfusion... whether or not one likes the replacement (the C++ like Enforce Script)
arma4 isn't coming anytime soon.
As Bi_Raptor declared earlier, I remember ("Guys, let me assure you - we're not even remotely thinking of something that could be described as Arma 4. Arma 3 is here to stay for quite some time, with continuous support." https://forums.bistudio.com/topic/186770-arma-4-upgrade/ )
Well obviously, lol. I mean, the developers already have enough on their plate working on a VR game and the APEX expansion. Not only that, unlike ArmA 2, the game can be easily updated and improved on thanks to Steam's updating system.
Idk why people are already demanding an ArmA 4. Maybe perhaps they are trying to say "We want APEX graphics now" or something, lol.
people want deep changes in the system, those that are simply not viable to do in Arma 3, like replace SQF, that's the main reason I'd say
I am not counting those who are just complaining without arguments btw
or those who don't understand why we need some changes
(pls more missionEH and less addstackedEH)
createNamespace #HYPE
use the cba workaround, locations as namespaces ๐
Tbh, I love working with .sqf code.
:x but i need the engine part of createNamespace ._.
we all do.
locations as namespaces is the best solution for now (and i am not saying that out of bias for me writing that wrapper)
i literally tested every other method of doing hash maps
course the absolute best solution is intercept ๐ then you can use whatever hash mapping implementation that you want
@nocturne bluff It's not vaporware
Then where is it D:
@nocturne bluff Right here
On my computer
Actually, my bot on my Discord server uses my analysis engine to provide feedback on posted SQF code
So I guess, that's a small preview "release"
๐
Is there a way to retrieve the full folder path of a loaded mod?
I think the closest thing is the FILE preprocessor command
err seems I can't type it here.. https://community.bistudio.com/wiki/PreProcessor_Commands#FILE
anyone know how to call it so the chemlight shows for all players when i attach it to myself using http://hastebin.com/miyoginazu.avrasm
#lightpoints are local. their effects are local. So create the lightpoint on everyone's computer and set the attributes on everyone's computer. There's many ways to do that, one being remoteExecCall
You could put all the _light stuff in an inline function with two parameters, _chemColour and _obj
sounds confusing
It is, but it's a vital part of scripting anything for multiplayer
Yep, welcome to locality.
lol i tried using #lightpoints and remoteExecCall and filed lol, crashed my system ๐
then you must've done it wrooooooooooooooong ๐
ya think? lol
does anyone know if ctrlCreate actually works with 3D objects?
What's the recommended course of action when adding server settings into a mod? I prefer it if the client doesnt need to copy userconfig or so.
Hello I'm having trouble getting ACE3 and Infistar to play nicely together, but nothing I've done works. The problem I'm having is the ACE3 Menu's (Medical Menu, ect.) dissapearing after popping up, I've tested it with Infistar not loaded and it works perfectly. I've tried disabling most of the Anti-Hacks settings and this problem still persists. Any help would be greatly appreciated.
Not really the right place to ask Kyou, might wanna try the ACE3 slack
Anybody have a good way to return the closest door to you?
Hey, anyone has a way to syncrhonize animals between all the players on the server ? Like not spawning animals via the editor, but via a script. The goal for this is hunting, and rabbits and such appears to not be syncrhonized for everyone.
@prime valve you first need to remove them from terrain config or disable their simulation (not sure that is possible by script). Than you just spawn them like normal units (createunit or createagent). They will than be global.
Well, actually then don't move..
You need to call the ai fsm
Or write your own behaviour script
Checkout the ambient animal module
Okay thanks, will try this out !
Animals dont respond like normal to movement commands, they just rotate on the spot. Animal movement is caused by the idle animation randomly selecting idle/run/walk animation.
The walk/run animation is what causes animal to move forward.
So basically you need to call playMoveNow to force animal to move & loop it.
Well I figured out a way I can get the closest door to a player but now I need a way to create multiple of the same object in a for loop but still be able to have the objects named. My current problem is since the objects are being created and then moved into position using _helperObj as the name it's moving them all to the same spot (the last position in the loop) or possibly only creating one. Any help here would be fantastic, it seems like something simple I'm overlooking.
Question: Is there a way to disable ragdolls in ArmA 3? All I've been able to find thus far is "improving them".
Hello!
Q: Is it possible to open the browser or steam overlay to a page from the game? There are some vanilla buttons that do that, but I can't find how they do it.
or is impossible due security reasons?
It is possible.
Numerous games do so.
You are trying to have the ability to open a certain URL path, from the game itself, such as clicking on a "Buy" button or such, yes?
@split coral
Yes, exactly. Any idea how it's done?
Well. I do know there are numerous protocols that are usable.
An example can be something like...
Yeah, but with Arma 3 scripting? ๐
For arma 3, I don't know.
๐
But in general, steam://url/CommunityFilePage/112030991 would be an example.
Can someone help me with an issue I'm having with setvariable? http://pastebin.com/raw/vKngZ8kD
The marker is created fine, so the _uid variable can't be the issue, but when i try to get the variable from the client, its nil. My third param is true, so it should be global. The script is ran server side.
https://community.bistudio.com/wiki/openYoutubeVideo @split coral there is another command.. im searching
or maybe not.. thought there was a command to do that but.. seems like there isnt
@agile pumice how far is the client from the house?
when too far away houses get unloaded with that all variables on them (Atleast i heard that when someone wanted to hide a house)
Youtube doesn't quite cut it though. I know of htmlLoad also, but I was looking for a proper browser opening solution.
I've looked at the vanilla configs and gui scripts, but it looks like they're hard coded. Or i'm just blind.
how about htmlLoad with an href in it?
yeah... i think you cant open links with script commands.. but if you have an href in a structured text on a UI element.. and you click that link it opens in browser
not overlay tho
yeah, I think you're right.
right infront of it, using cursorTarget, and cursorTarget is returning the house
so while you are setVariabling you are right there and cant read the variable?
then i have no idea... :x
Odd question maybe, is there a way to detect if a unit has gear assigned via Arsenal when a scenario is made with 3DEN?
how hard would it be to make a dog that follows you?
so I can make him sniff for IEDs?
I have no idea I never wrote a script lol
it would be nice if I have a dog that follows me or that i can order to sit down
i think they'll follow you if you add them to your group
or atleast they used to I think
im a dog
they no exist
but why are there dogs running around my communities base then? O.o
might be related, but my rpt is being spammed with: Update of nonlocal object 2:4684 called
okay so, interesting turn of events, when I made sure the map files were exactly the same on both the server and my client, the setvariable/getvariable issue went away
When is 1.57 expected to release?
gotcha, when's that expected?
It's been in public testing for a week now, so probably releases next week.
Does anyone know of a way to add an action to an invisible object?
Add action to player and do your own check whether action is visible or not
That was the work around I had but there would be many of them ~100. I'd imagine that many while loops would start to be bad for performance or are the actions added with addAction already while loops themselves?
From the wiki page on addAction: "[The] condition is evaluated on each frame in non-scheduled environment"
Is there already a function, that checks if a player is inside of a bouningbox?
nvm, wrote my own
Hi
@jade abyss https://community.bistudio.com/wiki/inArea
hmm, gonna take a look at it.
If you aren't on DEV you'll want BIS_fnc_inTrigger by the way.
Can you create a link in game that opens in Steam ingame browser?
Hey guys. What can cause player spawning as seagull? (player -> objnull). It's not the group number limit that's checked.
In what ways did you check the group number limit? count allGroups when the issue was happening?
Indeed
47 is far from the limit as far as I know
Seems to be tied to specific slots
Yeah the limit is 144 per side, is it a slot that someone disconnected from and later someone else joined?
I've never encountered it personally but I'm assuming is that the player tries to take control of that unit but they can't so they are assigned to spectator
having a handleDisconnect EH set up which deletes the body
can that f-up stuff?
yet again, the playable slot doesn't disappear
we had problems like players disconnecting and the unit becoming AI, so I added the handleDisconnect EH
Yeah I think this issue is in the realm of that
I think in theory in the vanilla game if a player disconnected an AI would take control and the player would be able to reconnect and take off where the AI left off, but I could be wrong
Do you have disabledAI = 1; in your description.ext?
And what respawn template are you using?
yes, it is disabled, that's why I was surprised when this happened in our previous version
{
Removeallweapons _body;
deleteVehicle _body;
//If it's in a vehicle
if !(vehicle _body == _body) then
{
[vehicle _body,_body] remoteexec ["deleteVehicleCrew",vehicle _body];
};
//killing the "body" as a last resort - as they might stuck in vehicle alive
if (alive _body) then
{
_body setdamage 1;
};
};
false```
this is the handleDisconnect eh code
Yeah I've seen the ghost AI walking around before from a previous player, in some cases they swam kilometers to try and regroup from debug islands
oh yeah, player's unit being stuck in a vehicle -> that happened as well ๐ฆ
anyways... gonna try to remove this and see if this still happens
I would think with disabledAI it couldn't, but I've seen first hand the AI taking control
Yes, the mysteries of Arma 3
Try and see if you can narrow down the way the player disconnects before the slot is bugged, kicked, hit disconnect button, game crash, etc
Maybe under some weird condition their body isn't getting cleaned up and then that slot is unusable because they are dead, but I don't know why the respawn template wouldn't take care of that and give them a new unit
Hey! I copied a script which runs on the whole side (OPFOR in this case) yet I need to make an exception for 4 characters (2 groups) how do I do that? this particular script basicly spawns a parachute for each player and moves the players into them. This is the script: http://pastebin.com/dyjytQN2
@opal helm This page is no longer available. It has either expired, been removed by its creator, or removed by one of the Pastebin staff.
....compile?
ah
had a huge brainfart, enough for today. Was sitting here for 10min, trying to find out the % -.-
or (_string splitString '"') joinString ""
compile was the right one.
I wonder why createVehicleLocal never had the alternative array syntax that its global counterpart createVehicle has. :/ The CAN_COLLIDE parameter would've been nice
I have a variable assigned to an object. I can call the variable locally, but I can't seem to be able to pull it when I move everything to the server. Object variables are public, no?
setvariable has a parameter to automatically publish the variable over the server
@winged thistle
Just like @still forum said:
https://community.bistudio.com/wiki/setVariable
Example 2:
_myTruck setVariable ["myLocalVariable", ["321", _var], true/false]; (report global or not)
Yes
I even read that yesterday and it didn't register at all...
I've been looking for something like that. Sweet!
๐
๐
The mission I'm writing is gonna be tits.
i always use this https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3 ^^ but its not much different
btw @winged thistle not everyone likes tits
T.I.T.S. = This is the shit
Yeah, its the same, just with the possibity to check, whats in the Dev Branch^^
Ah, I'll use that if I ever start using the Dev Branch ๐
I always dev against dev branch, test against release.
But often in my projects release cycles pace Arma release cycles pretty closely.
Can me help anyone, please. I would open gates by using key "O" for Cops, Medics and specific PlayerIDยดs
The script sahows
{
if (!_shift && !_alt && !_ctrlKey && playerSide in [west,independent]) then {
[] call life_fnc_opener;
};
};
What is to change?
without knowing _shift, _alt, _ctrlKey and life_fnc_opener, everything looks fine
He needs to define it to Button O
thanks
Anyone figure out the new EDEN menus yet?
any clue how i could dynamically create one with ctrlCreate?
or rather, how to make the menu work
and what commands like what menuAdd, etc take as params
are you talking about adding a new attribute or a new item to the menu bar on top?
a new item where
@jade abyss & @still forum ty that fixed my issue.
item is not eden terminology
you cant add attributes dynamically btw
needs to be an addon
For some reason assumed the object namespace would be global by default
Never assume with Arma. Check.
i want to add them to my custom menu, not related to eden
ok, thanks. i'll check if i have better luck tomorrow :)
Yes, it does. Both fog and overcast do. Set the time to midnight, put a heavy overcast(but not heavy enough that it rains) and set a large amount of fog. Place down Enemy AI with out Night Vision. They won't be able to see you until you're relatively close. Do the same thing with no overcast and no fog, and they'll be able to see you from farther away. Now, do the exact same thing with heavy fog, heavy rain, and a heavy overcast. The AI won't be able to see you until you are pretty much right on top of them. And due to the Rain, they won't be able to hear you until you are close too.
I know this for a fact because I use Zeus and Dynamic Weather to create stealth missions. I have night vision and the enemy AI have no night vision and sometimes no flashlights either. I can see them from far enough away to kill them without them knowing that I'm there.
Is there a scripting command to write a txt file to disc other than using the diag_log command or do I have to write my own C++ extension? e.g. http://killzonekid.com/arma-extension-make_file-dll-v1-0/
Ok thanks. I will give it a try.
@tough abyss Thank you!
@humble badge if you want to write and read files as a database, use something like extDB2
Thanks but I am exporting script and config data to a file.
Anybody knows how to use the Posters module? Not even sure what does it do (placing posters? ๐ )
Nvm, got it working ๐
working with dialog 3D objects is about the most frustrating thing ive ever had to do in Arma
first off the coordinate space is insane, its x,y,z but x and z are screen coordinates (as in within the bounds of the safeZones), but y is in meters from the screen.
so here is the really confusing part, 1 meter is not one meter when translated from world space to screen space, to model dialog 3d space
its a function of the UI size and I have no idea what it is.
so maybe then y isn't actually meters from the screen, but some entirely made up unit
anyway, @biminions if you could do me a huge favor and add a ctrlModelAnimate, ctrlModelSelectionPosition, and ctrlModelAnimationPhase command I'd be forever indebted because writing my own animation system, while fun (and animating things isn't the hard part), it is an exercise in total frustration.
I'm looking for a way to replace every instance of "\" in a string and replace it with "\\"
thinking of splitting and joining strings but finding all the indexes is giving me a headache
see if I can figure out killzone kid's regex dll's
test = "omg/123" splitString "/";
test2= test joinString "//";
No need for a blocking callExtension
I'm working with a dynamic string with any number of backslashes
the splitstring/joinstring method I initially mentioned wont work in that case, so I'm using killzone kid's regex_replace dll
can I get a hand with the math for my progress bar script? http://pastebin.com/raw/wWkZ4kkE
trying to work out the math for _cpRate and the sleep
In what amount do you want the percentage to increase between sleeps? And is _seconds the total time you want the progress bar to last?
If I assume you want to increase the bar by 1% at a time you would want _cpRate = _seconds / 100 and no matter the length of time you would add 0.01 to the _cP between each sleep
1%, corrected: _cP = _cP + 0.01;
and yes seconds is the total time for the progress bar to last
Then that should work
tried http://pastebin.com/raw/cP185din in debug, feels a bit longer than 5 seconds
You could diag_tickTIme before and after to see how long it is
It could also be slowed down if you have a lot of scripts running since it's using sleep vs uiSleep
its close enough I guess, im not gonna fuss with milliseconds
It's pretty simple math
ill be using uisleep though
You want 100 intervals so 5/100 = 0.05, so every 0.05 seconds you want to add 1
The only thing I don't like about that is the lack of a sleep
For however long the bar is there you are setting its position multiple times a frame
True ๐
(Sorry, very new to scripting) Is this a good place to start for a total beginner? https://forums.bistudio.com/topic/145056-arma-3-scripting-tutorial-for-noobs/
I've never seen this forum post but it looks decent, I think the best list of commands you can find is from Killzone Kid's website (http://killzonekid.com/arma-2-arma-3-scripting-commands-list/) as it usually has the most up to date commands as well as commands from Arma 2 and OFP (they still work). So you can ctrl + F search for a command and it'll lead you to the wiki which will have a description of the command, syntax, paramters, return values, and sometimes examples and notes. Killzone Kid's website also has some miscellaneous tutorials but some of the information is dated.
@native hemlock Awesome, thank you so much ๐
when I see this in a script, e.g. (driver this) setBehaviour..., is "this" referring to the object name?
e.g. if I name a Huron huron_01, should I then write (driver huron_01)...?
thats correct
trying to script a heli to transport some crates form one place to another, but very early days scripting for me
@agile pumice awesome, thank you!
although I wouldnt call it "name"
variable name sure
cool, thank you ๐
you'll see "this" and "_this" in different contexts
if i understand correctly, one is global and the other local?
'this' is generally used in init/trigger scripts in the editor
_this is what you pass to a script
well you dont pass _this to a script, lecks
yeh, it's what's been passed in to a script
"this call myfunction", inside myfunction, what your passing becomes _this
If you do
[player,"string"] execVM "somescript.sqf";
Inside somescript.sqf, you would access those passed variables by doing
_player = _this select 0; // player
_string = _this select 1; // "string"```
yeah, except select 1 for string
Ahh, I think I understand a bit better
"params ["_player","_string"]" is a better alternative to spyder's code
instead of doing _this select 1; though, you'll usually see people use BIS_fnc_param in old scripts or 'params' in new scripts
well yeah, many many different alternatives
_this select 0 is just simpler for beginners imo
i wouldnt say its simpler
From the perspective of trying to read the wiki page, for someone new to scripting it is easer to comprehend instead of picking apart the optional parameters
But yes, once you know what you're doing -> params > select
best to know both anyway so you can understand other scripts
i have a lot to learn by the looks of it (:
C and C#, a little Obj C and Cocoa
But all as a hobby
Hard to find a lot of time to dedicate unfortunately ):
you'll probably pick it up pretty quick
I hope so! (:
I will bash away at this idea until I understand better
Thanks for your help guys
you basically just have these types: https://community.bistudio.com/wiki/typeName
and arrays that can contain any combination of them (so that's what people usually use as objects)
Ahh I see
๐
is there a way to check the age of a unit? e.g. if x unit is y minutes old, spawn z object?
after you spawn the object
define a variable _startTime = time;
then compare time to _startTime later. if (time - _startTime > y time) then {spawn z object};
or something like that ๐
You can use the setVariable and getVariable commands to store information to a unit/object and retrieve it later as well
So when the unit is created
that would be the better way
_initTime = time;
_unit setVariable ["creationTime",_initTime]; // [key,value]```
Then when you need to retrieve that information in another script, pass the unit (or have a global variable to reference it) to the script
And retrieve it inside the script using _initTime = _unit getVariable "creationTime" // reference key from above;
Thank you very much!
you can use sleep 60; to just pause a script for a minute too, but from my understanding it's best to not have too many scripts sleeping at a time
Ahh, also useful, thanks!
and it only works if scripts have been spawned or execvmed (in which case they run in their own thread)
doesn't work if they're called
that's an SQF thread, not a native one mind you
Is it a good idea to use waitUntil if I want to only do something when a unit is within a certain distance of another unit/object?
E.g. wait until playerPos is within x distance of y object, if true spawn abc?
Ahh, I see, thank you!
Can I ask what you mean by break out method?
Great, thank you ๐
my script waits for my player to take a box, and if 60 seconds elapse and he hasn't itll break out and fail the mission
if your having difficulty understanding it I can rewrite it simpler
I'll see if I can implement something and will take you up on that if I don't get it ๐ Thanks again!
np
i could have used time or diag_tickTime instead of the incremental DeliveryMission_WaitTime but oh well
3-4 years, but i never had any fundemental programming skills beforehand, so I'm still a noob
i had some basic skills from some java projects, bare bone basic knowledge
Awesome, thank you ๐
Half the vets in here probably think im retarded.
I've done almost nothing, but thinking about what I could do with the editor makes me want to dedicate a lot of time to learning
Haha
im still using the wiki a lot though
Does the distance command return in metres?
Yes
Awesome, thank you
Does this make sense at all?
_heliPos = getPos huron_01;
_distanceToHeli = pilot_01 distance huron_01;
_moveCheck = if (_distanceToHeli >50) then [{pilot_01 doMove (position _heliPos);} else {pilot_01 setBehaviour "CARELESS"}];```
Without the misplaced ;, I think
any reason your defining _moveCheck, and simply not running the conditions? Usually when you have if conditions in a variable, its to return a value
Not for any good reason ๐
So I can just run the if statement without defining anything there?
yes
Awesome!
me too (: i was just copying some syntax from here https://community.bistudio.com/wiki/if i will remove them
if (_distanceToHeli >50) then {pilot_01 doMove (position _heliPos)} else {pilot_01 setBehaviour "CARELESS"};
awesome, thank you so much
can i call this from a units init field?
or would it be better to do so from the init file?
you can stick it in the init field, sure
great, thank you!
try not putting massive chunks of code in the init lines though
especially if its repetitive code
if i wanted to call this from a file instead, is it possible to simple reference the file name in the init field?
[myUnit] execVM "myscript.sqf"
either in the unit's init box or init.sqf in the mission directory
great! going to try it now, thanks again! ๐
any code in the mission sqm will run before the init.sqf
ahh, good to know
if you want to run the same code on multiple units
a forEach loop would be used
{[_x] execVM "myscript.sqf"} forEach [unit1,unit2,unit3,unit4] in the init.sqf
if your going to be running myscript.sqf frequently, best to define it as a function and call it if you dont do any sleeping or waiting or while loops
time related stuff needs to be spawned
I see!
Will copy all this down, thank you!
Do functions that rely on checking the distance between two objects, etc., eat up a lot of resources?
Will do!
as for the resources question, i can imagine if you have a lot of simultaneous checks
to refer back to my if statements in variable definitions, heres two ways:
_variable = if (true) then {1} else {0};
example 2:
_variable = switch (true) do {
case (some condition 1): {
1
};
case (some condition 2): {
0
};
};```
I read switch blocks are better for performance, but not worth the time setting up if your only going to need if/else
instead of redefining _variable for every condition
very interesting, thank you (:
is there any way to make the error log message larger? i feel i will be running into these a lot
not sure
but the error is also logged to your RPT file
C:\Users\Jordan\AppData\Local\Arma 3
its located in there
np
I will have to do some troubleshooting
Anyway, thank you for your help, really appreciate it!
any time
๐
Sorry for noob question: is it possible to use an && operator in an if statement?
Here's what I'm trying to do
_pilotPos = position pilot_01;
_heliPos = position huron_01;
_distanceToHeli = pilot_01 distance huron_01;
if (_distanceToHeli >5) then {_pilot move (_heliPos)} && {_pilot forcewalk true} else {_pilot setBehaviour "CARELESS"};```
I tried wrapping move and forcewalk in () and [] but had no luck
Here's the error I get: Error &&: Type code, expected Bool
Hm, managed to get it working by putting it inside the move curlies, but still get an undefined variable error ๐ฎ
Oh, never mind me, I'm retarded ๐
Do any of you recommend a certain app to script in?
@ivory nova for the last two years I've been using notepad++ with the Java syntax
Thank you! I'll give that a try then
you can also try Atom with its' language support package
There's sqf syntax for notepad++ too: https://forums.bistudio.com/topic/138891-arma-3-notepad-syntax-highlighting/
I'm using Poseidon mostly: https://forums.bistudio.com/topic/155514-poseidon-advanced-text-editor-for-scripts-configs/
Thanks for the recommendations!
Is it possible to have a unit shoot at another unit, but always miss? I wanted to test if an AI will automatically leave "CARELESS" when engaged
Ahh, nice, I will try that now (:
Or if you just want him not to hurt anyone, you could disable damage on the target
you set CARELESS behavior via setBehavior or waypoint's behavior?
via setBehaviour
Does it matter which you use? I always thought they simply won't snap out of CARELESS ever....?
๐ฎ
Groups in careless mode do not switch to a more alert mode if enemies are encountered
Ahh, that answers my question then, thank you ๐
is it possible to say "do nothing" after an if statement fails?
(I'm not 100% sure if it's the same for setBehaviour, it should but it's Arma)
you just ommit else
woah, didn't even think of that
if (condition) then { do_stuff };
great, thank you ๐
Is this the correct syntax to change a sub skill? _enemy = setskill ["aimingAccuracy", 0];?
almost: _enemy setskill ["aimingAccuracy", 0];
perfect, no more errors, thank you ๐
using camelcase is a good practice in sqf so I'd write setSkill
i had _enemy defined as the unit name, but guess it got borked
will do that from now on, thank you
unit name as in the 'name' field in units atributes?
yep
you can't use local variables there (ones starting with _)
named a unit enemy_01 in game, then _enemy = enemy_01
alrighty, thank you ๐
named a unit enemy_01 in game, then _enemy = enemy_01
that works
i only went there when i saw other errors, but i probably just made some dumb syntax errors somewhere that i didn't notice ๐
TIL even a man with no accuracy can fall back on grenades, lol
hm
I have a unit doing this if (_distanceToPlayer <100) then {(_pilot move (_heliPos)) && (_pilot forcewalk true)}; but suddenly stopped walking with his gun down
is this just arma being arma? is there a way to force them to be relaxed but still able to respond when engaged?
Oh
"Safe" does the trick ๐
@vagrant kite Atom is real nice
๐
BTW. if you want more than 1 command inside a block of code, use ; between them instead of &&
e.g.
{_pilot move _heliPos; _pilot forcewalk true}
or multiline:
_pilot move _heliPos;
_pilot forcewalk true;
}```
oh, great idea!
will do that now!
Is there a way to resume a previous behaviour or function if a unit hasn't been engaged for a certain amount of time?
a unit will break out of a routine to engage an enemy when set to "safe"; possible to have them wait x seconds/minutes in alert state, then resume whatever it was they were doing?
I belive they go back to AWARE state after some time without contact. If you want to make sure they do use sth like:
sleep 60; //wait 60sec
_this setBehaviour "AWARE"; //change unit behaviour
};```
thanks! lemme try this out
Having trouble getting a unit to spawn, is anyone able to tell me what I'm doing wrong here?
"B_Helipilot_F" createUnit [getMarkerPos "heli_spawn_marker_01", "Delta", "newUnit = heli_pilot_02", 0.6, "CAPTAIN"];
I believe the class name for the pilot unit is B_Helipilot_F, try it with the underscores
group is not a group name ("Delta") but a variable of type group; one that you create by createGroup command, or (if you want unit to join existing group) taken from the other unit: group _unit
also doesn't work with underscores ๐ฆ
oh! okay, i will try that
thanks for the explanation ๐
Perfect, works now, thank you!
๐
What would be the way to get building floor with lineIntersectsSurfaces ?
I went through GEOM, VIEW, FIRE lods and found position is always ~20 cm under the building floor
Walls and ceilings are intersected properly though
Test code that I used:
onEachFrame {
_cam1 = positionCameraToWorld [0,0,0];
if(!surfaceIsWater _cam1) then {_cam1 = ATLtoASL _cam1;};
_cam2 = positionCameraToWorld [0,0,5];
if(!surfaceIsWater _cam2) then {_cam2 = ATLtoASL _cam2;};
_pos = lineIntersectsSurfaces [_cam1, _cam2, player, objNull, true, 1, "GEOM"];
_pos = (if(count _pos == 0) then {nil} else {_pos select 0 select 0});
hintSilent format ["%1", ASLtoATL _pos];
if(!isNil "_pos") then {
intersectobj = createVehicle ["Sign_Sphere10cm_F", ASLtoATL _pos, [], 0, "CAN_COLLIDE"];
intersectobj setPosASL _pos;
deleteVehicle intersectobj;
};
};
Am I using wrong LOD? FIRE and VIEW give even worse results
I think it's an issue with some building models. I have almost exactly the same script, and it doesn't work on some vanilla buildings. On most it does.
having issues using callExtension on a dedicated server, works fine when ran on the client. To be specific its killzonekid's regex_replace .dll
@meager granite can you not use the roadway lod?
From the wiki:
Since Arma v1.51.131920 it is possible to indicate primary and secondary LOD to look for intersection. Available options are:
"FIRE"
"VIEW"
"GEOM"
"IFIRE" - ("I" stands for Indirect, almost the same as FIRE)
"NONE"
Roadway would be ideal but not an option. In most cases the view, fire and geometry would be at the same position for floors below you
What about the callExtension isn't working? And is it a dedicated server run from your computer or remote?
remote
its just not returning the same way as it does on my client
returning a blank string
ran it through my debug box and it worked
Any framework requirements? Like .net
I run extdb on the server so I can't imagine this particular dll has a different requriement
as far as I know it used c++ libraries
and i'm confident that the redist packs are installed
yeah, multiple copies of the c++ redists
@meager granite Possible solution to your problem if I'm understanding it correctly. The parameter for positionCameraToWorld uses [x,z,y] so I think you'd want to do
_cam2 = positionCameraToWorld [0,5,0]; instead of _cam2 = positionCameraToWorld [0,0,5];
Doing that I am always getting a value for the array with the exception of some awkward staircase positions
@agile pumice
I was thinking he might have been using .net framework since he did a tutorial with it but that's not the case with the regex it looks like
Do you have the dlls in your root folder and you're running them as a mod?
I know for extDB you can put it in a mod folder and then use the -mod parameter, and then you can put it in the same directory as the arma3server.exe and then you don't have to use -mod.
I'm off to bed though, good luck
had it in a mod folder that was already running, goodnight. When i tested the dll on my end it was in the arma3 root so ill try the same for the server
That must have been it, its working
extDB2, just requires vc2015 x86 and you need to put the tbbmalloc.dll in your arma3 root directory.
Besides that you can have the extension in your arma3 root directory or an addon directory
@native hemlock [0,0,5] is there to get position in front of the camera, [0,5,0] would be above it in camera's model space
Can I somehow forbid a unit to be able to open a door while other units still can? (Not every door on the map but on specific buildings)
Please someone help me with UI, I'm literraly gonna kill myself. I'm trying to re-do the main menu interface, and I configured all my buttons. For some reason, no buttons appear except for the "Exit" one. It was made with the same way as the others, but somehow, the other buttons just doesn't apepar.
i just rediscoverd the pre and post Build events in VS ๐
do you know any envent Handler that is triggered between the moment when a unit take damage, and the moment when it dies ?
or something that is triggered when a unit take a shot but with allowDamage False ?
handleDamage handles the damage
and thus whether a unit will die from it
its return value is the damage taken
I'm trying to put weapons that can't be picked up in the editor, is that possible?
tried this enableSimulation false; clearWeaponCargo this; clearMagazineCargo this, but the thing disappears completely
just enableSimulation false didnt work
do I need to pass _vMags, _uMags, and _bMags as params to _handleMags for this to work:? http://pastebin.com/raw/bFmkkddP
I know I would if I were to spawn the function, I was just curious to know if I needed to if I wanted to call it
Ok I've got a kind of ace3 specific question. I'm putting players into spectator mode when I respawn them, then allowing on a second respawn for them to come back from spectator mode. When they're coming back the drawn dots/names above unit's heads from the spectator mode persist and I'm not sure how to get rid of them
I'm a bit of an amateur here, so I'd really appreciate any pointers in the right direction. I think ACE is drawing the dots in fnc_handleIcons.sqf, but I'm having trouble unraveling what they've done
[false] call ace_spectator_fnc_setSpectator isn't working? How exactly are you putting players into spectator mode and how are you trying to get them out?
I basically have them alternate 1,0 to spawn as spectator or spawn normally
on respawn normal, I have
[false] call ace_spectator_fnc_setSpectator;
[player, false] call ace_spectator_fnc_stageSpectator;
they do respawn normally but they icons they had when in spectator persist
fairly sure you are supposed to do stageSpectator before setSpectator
to guarantee it
What's the best way to determine whether an item should be assigned or simply added?
If you use assignItem on an item that's not assigned (aka not a radio, map, whatever) then it just simply disappears, so i need to make sure that command is only used for that. Prefer to not use hardcoded class names obviously
Also is there a list of what each cfgWeapons >> _randomClass >> itemInfo >> type actually does?
Figured it out. This seems to work fully. For anayoen wondering:
#define ASSIGNED_ITEM_TYPE 131072
for "_i" from 1 to (_x select 1) do {
if (isClass(configFile >> "CfgWeapons" >> (_x select 0))) then {
// -- Get the type of item -- //
if (isClass(configFile >> "CfgWeapons" >> (_x select 0) >> "WeaponSlotsInfo")) then {
_unit addWeapon (_x select 0);
} else {
_unit addItem (_x select 0);
if ((getNumber(configFile >> "CfgWeapons" >> (_x select 0) >> "type")) == ASSIGNED_ITEM_TYPE) then {
_unit assignItem (_x select 0);
};
};
} else {
_unit addMagazine (_x select 0);
};
};
@warped thicket oh damn, is that all? I'll feel really dumb if that's it
I am not sure, I am not too familiar with the spectator system, but I remember silentspike (author of it) telling me that
Nope, that didn't work. The icons were still there on respawn
Can someone direct me to a topic / tutorial on how to do custom crates for dedicated? Whatever I try it lags the server or crashes arma. A2 scripts dont work no more.
locality works exactly the same as always
if (isServer) then { /* addMagazineCargoGlobal etc */ };
is it possible to get the normal/direction of an intersection point?
I don't think so.. maybe you could do 3 intersections and calculate their normal
assuming you mean the normal of the surface you intersected with
lineIntersectsSurfaces returns surface normal, [1,-4.37114e-008,-1.19209e-008]. Is this in the format vectorDir?
ah, works
_graffiti setVectorDir _dir;
_graffiti setDir ((getDir _graffiti) + 180);
anyone know why my lbcursel returns 17 for every selection in the listbox? I only have 3 options currently set in the box
Im currently adding a new set of database variables for a mission to check (extdb) and I am getting the following error: https://i.gyazo.com/0a13e8803d84f9361db35b4f98e53111.jpg from this scrip: http://pastebin.com/zHGguxwM I am sort of newer to scripting so can anyone explain what to do to fix it? http://pastebin.com/zHGguxwM
without all the macro's its hard to say but intuitively it would seem that _this select 8is an array and not a bool or string
It is a default Altis script all I did was add CONST(life_copsiulevel, parseNumber(SEL(_this,8)));
CONST(life_copsrulevel, parseNumber(SEL(_this,9)));
and then the CONST(life_copsiulevel, 0);
CONST(life_copsrulevel, 0); to other sides not cops
check what _this select 8 actually is
it seems to be an array but it needs to be a number or boolean
which line you seeing this on
I assume its reffering to the 8 in CONST(life_copsiulevel, parseNumber(SEL(_this,8)));
SEL(_this,8) turns into _this select 8 selecting the 9 entry in the _this array
whatever is there is an array instead of a number or boolean
Hey ! Got a problem... It seems when a player disconnects, all his dead bodies disappears, wtf ? Explaining : You die, respawn, then you disconnect, and your body from when you died disappears, is it intended ?
If yes, any idea for a workaround ?
Nervermind, personnal corpse removal forgotten function, I'm dumb ๐
Does anyone know where the scriptiing commands are for the Eden context men (And top bar dropdown menus)? I've seen them before but can't find them anymore ๐ฆ
Nvm, they're in here: https://community.bistudio.com/wiki/All_Arma_Commands_Pages just not under Arma 3 commands page because all of them don't have any info yet ๐ฆ
Normally they are, but I'm hoping with these commands you can add/remove stuff to dialog controls with that type
It looks like just a normal set of commands for a certain control type and a very useful type at that. Much along the lines of lbAdd, lbSetData and so on, but in this case for the context menu stuff.
I meant the context menus
Because i didn't see any script commands when i took a quick peak a week ago
in 3Den they're config based and handled by engine
https://community.bistudio.com/wiki/All_Arma_Commands_Pages i mean on this page the stuff like MenuAdd, menuAction, menuChecked and so on.
Got some plans to make a scripted thing out of it using that control type, but I'll look at it when i can actually start the game ๐
They were originally posted in a dev branch changelog related to Eden iirc
Ok sorry not used them , only the config eden menus.
Does 3DEN not support inserting area markers on the map or am I just not seeing it?
Can't find RECTANGLE or ELLIPSE
click the other icon , on the right side
is anyone able to tell me why many developers seem to use z\addons\my_addon or similar for their addon directory structure, instead of for example my\addon
looks like it's x for cba, z for ace, just wondering why it is, is it just something someone did at some point years ago and it stuck for no good reason
seen it elsewhere too
Hey guys, how can I get the pitch from an object poining to another one? It's more like a math question actually, so please try not to answer it with "use math" ๐ ๐ Basically I want to set a camera to point towards a position, and I'm kind of stuck here, because I hate vectors and stuff. edit: trigonometry, not vectors
vectors are great
They are indeed, I just don't like working with them, because I cannot think with vectors ๐
if you want the angle of pitch from a to b you don't need vectors though
just trigonometry
Good to know, thanks
Thanks. It was a long time ago. ๐
Does anyone know how to remove all of a specific object at mission start?
{ deleteVehicle _x; nil } count (allMissionObjects "whatever you want")
In postInit or later
Does anyone know of a way to use a respawn type other than BASE or GROUP that stops the mission slots from disappearing after a unit's death? I was thinking I could trick the lobby into thinking the slot still existed by somehow manipulating the lifeState value as I believe that is what determines what shows in the lobby if not running in BASE or GROUP mode.
You could add a handle damage event handler, check if damage is fatal, send player to spectator screen, cancel the damage and cache the ai the player controlled until he left and someone rejoined. This won't work for anything that does setdamage like the manual kill button though
Your best bet is to just use one of the actual types that allows respawn and prevent the player from respawning by eg a spectator camera
@spare crest You can try to recreate player unit on their join
Basically copy player's unit as soon as player == player, selectPlayer new unit, delete old lobby-assigned unit
If I understand correctly what you want
Anyone familiar with displayaddeventhandler? I think it may be bugged.
[] spawn { (finddisplay 46) displayRemoveAllEventHandlers "KeyDown"; keyDown2 = findDisplay 46) displayAddEventHandler ["KeyDown", "true;"]; };
to my knowledge this code is fine. The wiki states that "Returning true in EH code will override default engine handling for keyboard events."
however the engine is still handling ALL of the keyboard events..
(I also tried it without the removealleventhandlers part, that was just to make sure it wasn't a different eventhandler friggin me over)
Can anyone confirm my code should work? If so I'll report it on the forums
derp...missing ( bracket...im retrying
Nvm it works..ima keep the messages here to emphasize how important it is to thoroughly re-read your code ^^
applaus
Any info on the state of remoteExec atm? does whitelisting works again ?
For those that wonder, yes whitelisting works now, just tested on my dedi.
however the wiki is wrong, remoteExec still return an empty string even when denied
12:51:06 Scripting command 'setdamage' is not allowed to be remotely executed
since i didn't get an anwer before.. is anyone able to tell me why many developers seem to use z\addons\my_addon or similar for their addon directory structure, instead of for example my\addon
symlinks
hows that
ACE3 for example symlink the github folder to the arma3 install and P drive
same for CBA
It's also necessary to keep that structures for the tools used.
i don't see why you couldn't make a symlink with another structure
also what tools are those
python scripts for building a release build / test build.
ah but there's no reason those symlinks and the scripts couldn't have been made to use a different path structureยด?
there's probably a different reason but I don't know it.
oh found the reason, it's because of cba versionning
then the automation scripts got written, it then kinda became a standard.
at least for ACE3 / CBA afaik
yeah i was just wondering if it was some arma specific thing, but then it wouldn't even really make sense since the vanilla addons are ca\addon or a3\addon
file patching maybe? i never used it but i guess it might require the same path structure as mods i.e. z\addons\my_addon... vs @mod\addons\my_addon.pbo
it's \z\modTag\addons actually
also, anyone knows why BIS_fnc_execVM is called when a client init?
12:50:38 Scripting function 'bis_fnc_execvm' is not allowed to be remotely executed
I really don't want to whitelist it, but I don't use it myself, so it's a default behavior.
just checked the doc, seems like initPlayerServer calls it, i'm not using it, no enabling.
Hello guys,does anyone know the correct parameter to use with nearestTerrainObjects to detect wrecks?
Anyone know how to tell if a vehicle is an APC and not a tank? It looks like most vanilla apc's come back as true for isKindOf "car" but false for isKindOf "apc" or "tank". So I started checking if the vehicleClass was 'armored' but that doesn't seem to work reliably for mod'd content like RHS's m113. Any thoughts?
Eh, I guess the difference between a tank and an apc is one carries soldiers and the other doesn't so ... I'll just check the transportSoldier field and that should be good enough. If there's an easier way, let me know.
Good point Tyler.
@cold quartz: I think some tanks carry troops too?
I think (_classname isKindOf "Wheeled_APC_F") gets most wheeled APCs. The main difference between "Tank" and "Car" seems to be tracks.
Does anyone know of a way to return the closest door to you?
Lecks The M2A1 and M2A1Up both carry troops.
The vanilla blufor tanks does as well
Yea, I figured an APC is a combination of armor and carrying enough troops to count as a 'personnel carrier' being a primary mission so I set the check to isKindOf "tank" and transportSoldier > 6 to eliminate what I saw as the false positives of the m2a1.
But if it's wheels vs tracks, the m113 is a tracked APC and whether it's correct or not, it reports true for isKindOf 'tank' but not 'car'.
Again though, if there's a better way to get >90% of it (meaning vanilla and mods) correct, I'd appreciate suggestions.
@cold quartz to be safe, depending on what you're doing, you could have arrays of things to 'force' into categories in the settings
that way even if it can't be 100%, people can make it work with anything
and check for ((typeof vehicle) in BUS_forceToAPCs)
Yea, I might do that as well...kind of like an override of automatic behaviour.
Thanks!
any1 have a clue why my weapon has it's muzzleflame always visible and not only when I fire with it?
#arma3_model <-- better place
thanks
Is there no way to transfer group ownerships in arma 2? That disapoints me :/
hey all, question about addPublicVariableEventHandler, will that fire when missionNamespace setvariable (global) is used?
I'm guessing no, but thought id double check
It shouldn't do @agile pumice and @tough abyss Is that in response to me?
Roger that ๐
Hey o/
Does anyone know where I can find the full name for smoke grenades?
Non shell type
Oh, I guess they are under shell type, my bad
Is there any way to use attachTo to attach a smoke grenade to a heli and have it activate once called?
attempting to use this SmokeShellBlue attachTo [this,[0,0,0]]; while i'm in a heli via the esc debug console, but not sure if that's going to work
replace this by vehicle player in the debug console.
Thank you! I will try it now
Hm, it didn't seem to work unfortunately, I will keep trying
(the shell need to exist, spawn it then use attachTo ofc)
@ivory nova
_Bomb = "SmokeShellBlue" createVehicle [0,0,0] ;
_Bomb attachTo [(vehicle player),[0,0,0]];
("SmokeShellBlue" createVehicle [0,0,0]) attachTo [(vehicle player),[0,0,0]]; ๐
debug console dont like local vars
press arrow up to edit
+Benefit of doing it with _Bomb = He can delete that thing afterwards.
he can find it using https://community.bistudio.com/wiki/attachedObjects
no need for a local var
("[] spawn{}" just for Console, to use sleep command)
[] spawn{
_Bomb = "SmokeShellBlue" createVehicle [0,0,0] ;
_Bomb attachTo [(vehicle player),[0,0,0]];
sleep 5;
deleteVehicle _Bomb;
};