#arma3_scripting
1 messages Β· Page 255 of 1
@native hemlock Sorry about that, there is some wierd version of Publisher released. (facepalm) I'll poke @icy herald to re-release it with correct files.
@tough abyss thanks, you're the best. Is it correct that it's your birthday? If so, happy birthday as well
this "proper" escaping of str / format...
@Daishiknyte thankyou.
I have made a little script that does something with addAction (scroll wheel menu). Can I do the same thing with keyboard keys?
To call scripts?
yes
Yes
or to perform the same action as in the script (perhaps the same thing really)?
(findDisplay 46) displayAddEventHandler ["KeyDown", "_this call somefunction"];
In some function handle the KeyDown EVH
cool -- how about while holding the key down, one thing, and when key released, another thing?
(findDisplay 46) displayAddEventHandler ["KeyUp", "_this call somefunction2"];```
Its the main display.
oh yes here it is in the docs
Pseudo code for keydown:
params ["_ctrl","_key","_shift","_ctrl","_alt"];
if (_key isEqualTo 19 && {_shift} && {!_ctrl} && {!_alt}) exitWith {
//code
true
};
right
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
π
Is what you need.
put this into line 1:
#include "\a3\editor_f\Data\Scripts\dikCodes.h"
grr
throws ADVANCED THROWING GRENADE
so without the include it would still work, but not be optimized or something?
picks it up and throws it back
throws it at @warped thicket
so without the include it would still work, but not be optimized or something?
it would make the code look horrible
way easier to work with the macro library
yes, this ^
The pseudo code would then become:
params ["_ctrl","_key","_shift","_ctrl","_alt"];
if (_key isEqualTo DIK_R && {_shift} && {!_ctrl} && {!_alt}) exitWith {
//code
true
};
yes I think i get that
As for the boolean, please note:
Returning true in EH code will override default engine handling for keyboard events.
I don't suppose anyone can think of an existing example online of this sort of thing, that I could study
I know one, but it's very ugly, so I won't show it.
resists urge to post the most cancerous keyhandler known to man
hahaha
can I put the #include line in description.ext and write the rest elsewhere?
Google: fn_keyHandler
ok
ok
Just remember what include actually does
It reads in a bunch of stuff that the subsequent script can call by convenient names, among other things, I think
Of which will exist only in the file it is included in π
the line with include get's replaced with the file you are including during preprocessing of the function
gotcha
Layman's copy pasta
I just made that up on the spot. It explains it sufficiently enough for myself
BTW I succeeded in scripting my heli gauges filter for night flying if anyone wants to see it, cheapo solution but works quickly and well, if anyone wants to see it
I want to put it up for public use and consideration, perhaps Armaholic, what's the correct way to do this?
Oh, did I show you all the result of my airstrike script?
It's not a proposal, it's a finished product, it actually does what it says it does
https://www.youtube.com/watch?v=WMICIOwabig
gonna throw this down in here for whoever is curious.
hehehe vauun now you don't have to do any real fighting
[THUMP]
"COORDINATES RECIEVED."
[BOOM]
[THUMP]
I like how chilled the AI are
I just took away all their ammo since the first time I crested the hill I was instantly domed
I don't know why the IR flare is visible in the visible light spectrum, though...
I found something called fn_keyHandler.sqf but I don't have Altis -- if anyone has it and could send it to me that would be nice -- it's in /MPMissions/Altis_Life.Altis/core/functions/
It should be on some GitHub, there are 100's
ok
Check PM
_runs away from @nocturne bluff _
Hey guys got a question about helo's
Is there a way to make them hover at a certain height such as 30m above the ground? I've tried setting flyinhieght and using different waypoints but the helicopter almost always comes in like it should but within the last little bit it pulls aup a lot
lol
pulls up a lot*
Hey guys, im trying to host an Exile Esseker server and im having some trouble with my mission.sqm file does these say anything to any of you:
19:16:54 Warning Message: Cannot load mission
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Side !!!
19:16:55 Side 778989417
and later (in rpt) there is some: No more slot to add connection at 032008 (3258.4,7991.3) a few rows
this happened after i have added headless client logic (then it still loads the mission ) and added Zeus Curator_F module, but the strange thing is if i remove the HC - mission will load with zeus... and if i remove zeus mission will load with HC =
here is my mission . sqm file : http://pastebin.com/CA1MX0Kd
Guys I am not sure if this is the best way to keep track of my tasks in a mission using init.sqf
_missionTasks = [];
_missionTasks = _missionTasks append [[demo1, demo2],"Demolitions"] call GhostFunctions_fnc_Demolitions; // +2 tasks
_missionTasks = _missionTasks append [[hostage1], "Capture pilot"] call GhostFunction_fnc_Hostage; // +1 tasks
//infinite loop array to check all task states are SUCCEEDED
({[_x] call BIS_fnc_taskState == "SUCCEEDED"} count _missionTasks) < 3;
Is there no global variable or helper function in ArmA that knows all tasks?
I feel like I am reinventing the wheel in some parts and just don't realise there is an easier way to do this
I mean, if you look on the Map screen in Tasks you can see all tasks. So if ArmA knows all tasks created, there must be a way to get them all through an accessor function
Looks like I am going to have to create something myself π
testFunc = {
params ["_taskArray"];
ghostTasksGlobal = ghostTasksGlobal append _taskArray;
hint str count ghostTasksGlobal;
};
ghostTasksGlobal = [];
When I call testFunc like so it empties my global variable ghostTasksGlobal
e.g.
[[1,2]] call testFunc;
plenty of options π
ctrl+f in combination with https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3 is winning π
np π
the best way to find commands or functions is to just search these 2 pages, they're pretty complete
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
https://community.bistudio.com/wiki/Category:Arma_3:_Functions
Hmmm doing this hint str count currentTasks teamMember player; returns 0 but there are two assigned tasks in the mission
Same goes with registeredTasks
I'd try BIS_fnc_tasksUnit first since that's probably part of the tasks framework
private _tasks = [player] call BIS_fnc_tasksUnit;
Ok that gives 1 task for the player but there are 2 assigned
try with [side player]
No dice π¦
hmm how are you creating the tasks?
In a compiled addon function I wrote
e.g.
[west,
_demoTask,
[_targetDescription,"Demolition"],
getMarkerPos _demoMarker,
1,
2,
true] call BIS_fnc_taskCreate;
///more code here
[west] call BIS_fnc_tasksUnit; should work but that's probably the same as side player :/
Nope,. try this if you can
[west,["task1"],["test 1","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate;
[west,["task2"],["test 2","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate;
hint str count [west] call BIS_fnc_tasksUnit;
It should be 2 right?
mhm
This is the code inside BIS_fnc_tasksUnit
private ["_target"];
_target = _this param [0,objNull,[objNull]];
_target getvariable ["BIS_fnc_setTaskLocal_tasks",[]];
Yea even this doesn't work
[player,["task1"],["test 1","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate;
[player,["task2"],["test 2","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate;
hint str count registeredTasks teamMember player;
uh, your first variable is supposed to be a side, not 'player'
Yea I tried that further up π
oh
mb
[west,"Task4",["Survive the counterattack.","Survive.","kill"],[16001.016,18176.424,50.773],1,2,true] call BIS_fnc_taskCreate;
Here's a working example from one of my missions
you put brackets around the task variable
Nope, still saying 1 instead of 2
[west,"task1",["test 1","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate;
[west,"task2",["test 2","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate;
hint str count [west] call BIS_fnc_tasksUnit;
Perhaps I found a bug in the game?
no, i don't think your code is right
oh
put brakcets around objNull maybe
[west,"task1",["test 1","Find Cookie","cookiemarker2"],[objNull],1,3,true] call BIS_fnc_taskCreate;
try with https://community.bistudio.com/wiki/simpleTasks, as far as I can tell BIS_fnc_taskCreate calls createSimpleTask in the end to create the actual task
Still 1
is that directed at Vauun, me or both? π
Both π
damn, must be a bug then. Doesn't seem right.
I think I will write my own helper functions and store all my created tasks in a global variable.
Gonna post on BIS forums see what people say
hmm..?
Ok if you dont create any tasks and still execute hint str count [west] call BIS_fnc_tasksUnit;
It still gives the value 1
At least we have consistency now
wait
hint str count ([west] call BIS_fnc_tasksUnit);
try that
it's probably counting [west] instead of the output of the function π
Yay, it works if you use player
Thanks @halcyon crypt again, one question for COOP is player safe to use for all people on a game?
np π
if that scripts runs locally on the players machine then yes
it most likely does since tasks are local
but locality issues are something you'll have to run in to before one can really understand it IMO ^^
but I think player, in this case, is safe
Ok that works great just need to keep iterating through them and checking if they are either Succeeded, failed or completed
damn, now i am getting that stupid publisher bug on my CI server too
was working last night now its bitching about that generic .NET error
Wizard, who I believe is the Publisher's programmer, said this earlier today
@Pennyworth Sorry about that, there is some weird version of Publisher released. (facepalm) I'll poke @Tom_48_97 to re-release it with correct files.
Was your CI server definitely on the latest version of Arma 3 Tools last night?
not sure
it might have updated
bah who knows, im going to bed, and ill fuck with it again in a couple days and see if things have resolved themselves on BI's end
Doesn't look like you can revert to a "legacy" version of Arma 3 Tools either, so looks like we'll have to wait. I'll shoot you a message when they resolve it
that'd be nice, thanks
we're so close to getting very automated releases for ACE, CBA, and sooooon ACRE.
and the build/collect/publish CI stuff is going to be made generic and released under CBA for others to setup their own CI services with github if they want
Yeah that'll be cool, CUP has wanted to do something along those lines but no one has gotten around to setting it all up
@grizzled cliff Could you please create a ticket on Feedback Tracker and describe what happened?
when you are tired of notepad++ and willing human friendly SQF editing in vim
https://www.dropbox.com/s/kcu3o450113lfj3/Screenshot 2016-09-27 15.25.45.png?dl=0
finished a syntax file for vim, which support all commands, BIS and CBA functions
nice, any download location for it yet?
couple of minutes
@vital onyx welcome back! you had holiday from arma?
@velvet merlin almost :)
@round scroll https://github.com/ussrlongbow/vim-sqf
enjoy
post to issues for any problems
this is my very first vimscript
ok, thanks a lot, just replaced my old sqf syntax file with it π
lol
2k+ commands + 1k+ BIS_fnc_ * ~350 CBA_fnc_*
I am just not sure if wildmenu will work for completion
tbh I use sublime/poseidon on windows for sqf, but occasionally this mac is used too, so the vim syntax file comes in handy
yes, I did it, since I spend most of time on macbook
but in Windows I use gvim
tired of NP++
never really got into NP++
simple and good for starters, NP++ was the choice because of ready to use syntax hilight
will post to forum as well
ok, now let's play with completion of all these commands
KK's syntax highlighter for NP++ truly is one of my best tools.
Poseidon all the way
Atom π
I used Zenophon's completion stuff for n++ for the longest time. Atom is nice, but doens't handle larger files well.
It crashes
Well it never really does for me ha
Poseidon crashes on me alot with large RPTs
I've never been able to use atom for rpt's because of their length
Lags hardcore
n++ handles everything you throw at it
I use notepad for large files
Everything else is opened in either VS code or Poseidon
How is vs code? Haven't tried it yet.
Similar idea to Atom, I prefer Atom over VSC, in that category
It's not made to be a simple text editor like N++ is though
Yeah
You mean you can't have your cake and eat it too? π
Isn't VSC written in Java?
Ayayay
Are you driving..?
Sadly no :,(
It doesn't make sense to get a driving license in berlin
You get everywhere faster with public transport
I just wrapped up ~18 hours of driving since Sunday. Can't imagine not having a car. Distinct lack of capable public transport here though.
Anyway, scripting question to stay relevant: Is the list returned by everyContainer always in the order of the bags/vests/uniforms shown in the inventory screen's ground container? I'd look but work...
Well in berlin there's public transport everywhere with intervals of 2-20 minutes and as a student I can ride them in the zones A B and C meaning whole berlin plus great parts outside it
TX-OK-AL. A bit of a hike for a couple wells my company is working on.
@buoyant heath I guess it returns the same order for the same type of objects but doesn't include non existing ones
I'm trying to come up with a reliable way of telling which inventory is being shown in the SOLDIER list (the one next to ground). If it's consistent, then it's not as hard of a problem as I worried about.
You could always just order them regardless of the array
Inventory in the soldier list?
Oh you mean the listbox that represents a container in your inventory
Aye
Well
inventoryOpened takes care of what container you were looking at initially, but tracking which one you opened from the ground list has been a headache
You could always just read which icon is highlighted
How does the icon help?
Uh
Would you mind showing a Screenshot of what you mean?
I think I misunderstood
I'm sure I will come up with a more reliable solution
Fails if there are 2 vests
what's your intent?
Move items to and from inventories as a first step
and why would the list of items have to be in the right order to do that?
Go back to the original question: How do you know which inventory is the one you're interacting with? vehicles, boxes, ground containers are easy enough since they're identified when inventoryOpened fires. But to track which of the backpacks you opened after that... If the list of items stays the same, I can cross reference the everyContainer with the list shown in the inventory screen.
everyContainer returns IDs for the objects inside it maybe (hopefully) the LB item has that same ID attached somewhere. Best bet would be to check what lbData returns when selecting an item in the container list.
at least in A2OA the GUI has a lot of information IIRC. I was able fix the pesky partial magazines in backpack exploit in DayZMod and I think it relied on the GUI big time. Don't think it made it in though.. π¦ https://youtu.be/XCIx-5DcETA
@buoyant heath
Try that, that might give you an idea.
http://pastebin.com/cFvsc5WU
I was really hopeful for a moment that lbData had the id of the container being opened.
The EH does?!
Only if you're opening directly from the ground, not if you're opening it through the inventory screen
Of course
What you want to achieve?
+That was just an example, there are other things for the EH like onMouseButtonClick, onMouseButtonDown etc.
Anyone knows if the sound you get from setUnconscious is engine-side or is there a .fsm somewhere hidden away that plays it?
Can't seem to find it
engine
Perfect implemtation then
That's the revive code, not the setUnconscious command though
true
Vehicle wise you can still fire and drive foward, everything else seems to be fine
half assed
Purely the command that is. Still wish I could disable the switching to animations though
give me a force ragdoll command. thanks
@little eagle not satisfied by KK's work around?
lol no. you ever tried that?
it makes for a good blog post, but it's annoying when it's cited as possible method in another feature request ticket. it's not.
it's not a good way at all
That's what i was trying to use originally for my medical shit. Instead i ended up with my revive system just keep units dead and working that
It works okayish, but the respawning units is not ideal performance wise, so trying to make a proper ragdolled system using setUnconscious now. Still not happy though
arma ultimate moddable game... unless you actually try and make something different.
yes, tried, worked for me
no you didn't
you are wrong, @little eagle
how well does it work inside buildligns?
how well does it work when you're bunched up with other players?
how well does it work when you're sprinting at full speed?
I am more concerned about while dricing in vehicles
as any w/a it should be applied carefully
ye, so its not something that can be used as replacement for ragdoll command
sure, more likely for scripted scenes and when you are sure about consequences
it doesn't even work when just standing there
it does ragdoll you like 5 % of the time
well, indeed KK's script stopped working, but I assure it did some time ago
Well, at least the game ragdolls you if you run into someones backpack...
Anyone is aware how to find with SQF what directory Eden is using for saving scenarios?
Responded to you in #arma3_scenario
Im attempting to script a sliding door that opens two doors simultaneously in opposite directions
can anyone point me to an example or maybe what I'm doing wrong? I can post a pastebin if need be
I present you pen_door, an example that should meet your requirements https://drive.google.com/open?id=0BwA-UohiwA7Cc3VDS2w5d3BzSG8
I made it for someone months ago when they were saying there were issues with sliding doors using the translation animations.
@native hemlock that was me, lol, because I was using a messed up way that would work in previous builds, then BI was like... not anymore, lol
I remember, and the spam you apologized for as well π
lol, yep, I was a bit irritated, well maybe more then just a bit, but what would one expect when the way I was scripting sliding doors worked for 3 years, then all of a sudden no more, lol.
The good old BISeroo
trying it now penny
I love you @native hemlock it works like a charm
definitely that one is going in the tool belt
@tough abyss Bugreport: https://feedback.bistudio.com/T120442
Change note: boobs <-- π
is there a known bug with placing static objects in 3den not using their classes properly?
for example if I place a sandbag in 3den and name it S1
seems like it's no longer (as of 1.64) possible to get the class of a static object?
looks like createSimpleObject object
yeah, or a map object with no related class
but it's an object placed in 3den
do some objects get placed as simple objects automatically or something?
(this is vanilla)
pre-1.64, you could just do typeOf s1 but now you would have to do something like if(typeof s1 == "") then { private _p3d = ((str s1) splitString " " select 1); private _class = "Land_" + (_p3d select [0, (count _p3d)-4]); if(isClass (configFile >> "CfgVehicles" >> _class )) then { _class } else { "" }; } else { typeof s1 }
ah nvm, 'simple object' is ticked by default.. that'll do it
@jade abyss So relieved that the performance issue is a bug in the current version and not the fault of my mission π
@tame portal At least π
π
what's the performance bug?
is it RHS vehicles per chance? we've had a big issue with them with our last few ops
the 'RHS_fnc_GearSound' function seems to run thousands of times and stack up as if the 'engine' event is being fired repetitively.. haven't worked out what triggers it yet though.
What's ASIS equipment level?
@vapid frigate the slow decrease of fps over time until game restart is the one being mentioned by optix
I will slow down my work with Arma 3 whille i wait for new updates.
Right, can anybody help me why i can't set playervariables from a sqf that's run on a action?
checking the value gives 'any' instead of false or right
Yeah, gimme a sec, throwing it in pastebin
or maybe this is enough
// spawn timeout timer
player setVariable ["_VVS_restrictSpawn",false];
player setVariable ["_VVS_restrictTimer",false];
if (player getVariable "_VVS_restrictSpawn" == true) then {hint "Can't spawn yet."; player setVariable ["_VVS_restrictTimer",true]};
while (player getVariable "_VVS_restrictTimer" == true || player getVariable "_VVS_restrictSpawn" == true ) do
exitWith
{
sleep 175;
player setVariable ["_VVS_restrictSpawn",false];
player setVariable ["_VVS_restrictTimer",false];
hint "Vehicle spawn available";
};
it's an attempt to add a timeout to VVS
i.e player can spawn a vehicle only once every set x seconds else it's on cooldown
Yet, checking the variables is always Any, or Nil as you then point out
global vars can't start with an underscore
also you cant do `BOOLVAR == true1
also id recommand using the alternative syntax of getVariable
OBJECT getVariable ["NAME",DEFAULTVALUE];
I.e player getVariable ["myvar_notunderscored",false]; this checks if it is the default value or if it isn't?
technically you can create and use global variables with setVariable/getVariable, but it's very confusing so don't
That's fine with me, just trying to get a simple timout based on if a player spawned it through the box so they dont spawnspam vehicles, hahaha
But the question then still remains, does
if (player getVariable ["VVS_restrictSpawnNotSet",false) then {//dowhatever}
check if it's true or false?
the default is false, set on init of the script/playerinit
This should become true when having spawned a vehicle and enable the timer/sleep
The return of that is a boolean, so yes
so it wont fire when it's set to true later in this case, right?
the return then would be true, which is boolean, so ye
true == true has no meaning for arma
Ah, so i need to turn around my logic
its just syntax, ye
Good day all, I'm having a problem with a EH. I'm adding the HandleDamage event to a ammo box but the code doesn't fire when damage is done on the ammo box.
well then imma go ahead and say theyres something wrong with the EH or the way you add it
or if its in MP, it might be executing in a different place where youre expecting it to
@indigo snow mind if i send you the edited code to see if it makes sense?
player setVariable ["LastSpawnedVeh",diag_tickTime];
do this on the spawn of the vehicle
to complete it in full do a check against that var with current ticktime
_lastSpawn= player getVariable "LastSpawnedVeh";
if ((diag_tickTime - _lastSpawn) < 300) then {
hint "you have not waited the 300 to spawn another vehicle";
}else{
code to call or execVM here;
player setVariable ["LastSpawnedVeh",diag_tickTime];
};
^ @clear tendon
very similar to the suicide limiter I had in place for exile some months ago
@zenith bramble ill pm you hold on
It worked...
if anybody wants a timer function for VVS, hit me up - got it working 100%, thnx there @zenith bramble
I would LOVE to know why this is telling me I'm missing an ] on line 5.
This is going in my init.sqf.
I don't know where that span class="re5"> comes from. That's not in my init.sqf.
nevermind, i got it.
Double decimal at the end.
Ah, shit, thanks
@clear tendon hell yeah man good deal on the working at it to get it working for your situation π
Arma debug commands make me want to die
?why they fun
Heya guys, whats the best way if there is any to go about detecting if a player was killed by a grenade in MP env?
I guess I could use a Fired EH and setVariable containing the "projectile" and check that in the MPKilled EH, bit "hacky" but should work I guess
{
if (side _x == west) then
{
_x unassignItem "NVGoggles";
_x removeItem "NVGoggles";
};
}];
Missing ]
Honestly, I hate arma 3 debug messages.
@tough abyss, first line. The comma , is inside - not outside - of the quotation marks ".
How about that. Thanks, I thought it went on the inside.
Negative. See the examples here https://community.bistudio.com/wiki/addEventHandler
Yeah, I misread it. Now I get to figure out why my code isn't working. Do I need to foreach allunits; with this? I don't think I do, but it's not working
Still no avail. I've tried everything I can think of.
What's your question? How to run that code when the Zeus places a unit on west?
Yes. This is what I've written: ```funhater addEventHandler ["CuratorGroupPlaced",
{
if (side _x == west) then
_this spawn{
sleep 3;
this unlinkItem "NVGoggles";
};
}];```
I was thinking that maybe the script was executing too early, so I put in a sleep.
But that doesn't work either.
Lots of things wrong with that. _x is a reserved variable for things like {} count, {} foreach, and similar commands. You need to look on the right side of the event handler wiki for the arguments for the event handler. CuratorGroupPlaced has the first argument of curator: Object, and the second argument of entity: Group. Also, this wouldn't be defined in this context.
Assuming funhater is the name of the curator object, then this should work;
funhater addEventHandler ["CuratorGroupPlaced",
{
params ["_zeus", "_group"];
if (side _group isEqualTo west) then
{
{
_x unlinkItem "NVGoggles";
} foreach units _group;
};
}];
Let me know if there is anything you'd like me to explain further about that
penny, you are a lifesaver
could you replace isEqualTo with == ?
also, that doesn't look like it's working. is the init.sqf just not the right place to put this? should it be initserver?
oh god i am a huge dummy
this is what happens when you do shit half-sober
i've been using the logged in admin zeus module i place ( i put a normal mission curator one down, and then one that the logged in administrator can access) and
i'm only defining it for the normal mission curator
You could use == instead of isEqualTo, but isEqualTo is fractions of a millisecond faster, and I it really is fractions of a millisecond
You just need to be careful with using isEqualTo with strings, since it is case-sensitive
@native hemlock https://youtu.be/RRvR8Fbm0gA?t=2m36s
an absolute speed demon
oh christ it's still not going
i might just make it so that when the unit dies the NVGs despawn
at this rate it's just easier to remove them from the game entirely
If it's still not going then funhater is probably not the name of the Zeus
nope
i'm looking at the classname in the editor rightn ow
that didn't work either
i'm so drunk and frustrated fuck this for
a few days
if palyers weren't so fucking grabbyhands with NVGs on night ops where i want them using flares i'd be spared the headache
thank you
player unassignItem (hmd player);
player removeItem (hmd player);```
for example
Or for a full strip:
removeBackpackGlobal player;
removeUniform player;
removeVest player;
removeAllWeapons player;
player removeWeaponGlobal (primaryWeapon player);
player removeWeaponGlobal (secondaryWeapon player);
player removeWeaponGlobal (handgunWeapon player);
removeHeadgear player;
removeGoggles player;
player unassignItem (hmd player);
player removeItem (hmd player);```
i just need to look at this when i'm not so tired
*and drunk
i'm frustrated as hell right now tbh
AAAAAAAAAAAAAAAUGH WHY WAS THIS NOT LINKED EARLIER
I'm not sure if it's vehicles only
Don't think so.
Otherwise -> KeyHandler -> Negate the "Turn nvg on" input.
rebind nvg to mouse : )
psst
i'm just genuinely surprised nobody has written this script before
it's a one liner if you're using CBA
["visionMode", {
params ["_unit", "_mode"];
if (_mode == 1) then {
_unit unlinkItem hmd _unit;
};
}] call CBA_fnc_addPlayerEventHandler;
untested, but that should be it
i just throw that in the init.sqf?
yep
@little eagle i love you
thank you so much
oh my god i will treasure this piece of code for the rest of my mission-making days
i'm a dirty man who gives people flares instead of NVGs
Good. Gotta keep the players busy
the only times i ever hand out NVGs are for spec ops.
is there any way i can add exceptions to units with this?
NVGs are too good. To bad they come equipped as default.
the code of the player event handler executes every time your avatar changes to nvg mode
you can add all kinds of exceptions in the function. it's just sqf
just remember that it runs in it's own scope since it's an event handler
so you can't carry over local variables from the init.sqf
right
good night, anyways. i'm not sure as to where to begin adding an exception, but maybe i'll think of something tomorrow
thank you again for the help
Lol! @little eagle someone DM'd me last night about a troll on an entirely different server (while I was in a pub, not amused!)
Hi guys. How can I check if the landing gears are up or down?
I can't get the value this way it seems...
_gearValue = _VF1 animationSourcePhase "Gear";
Question mates
about ListNBox type
anyone else noticed that you are able to select (click and highlight) only first 7 lines? To select others you need to scroll it down
it just means that other lines are obstructed by something that takes selection instead of your list
Since some version of A3 simple controls like static and picture started taking selection when you click on them and can change order and prevent pressing on more important controls if they're under them.
no, there is always some blank lines in the end to access all of them
my listnbox does not overlap with anything else
just
_control = findDisplay 12345 ctrlCreate ["RscListNBox", 123];
_control ctrlSetPosition [safeZoneX,(safeZoneY+safeZoneH*0.15),safeZoneW,(safeZoneH*0.6)];
for "_i" from 1 to 10 do {lnbAddRow [123,["COL1",(str _i),(str random 2)]];};
_control ctrlCommit 0;
Hm, I don't have this problem with my custom lnbs
I guess something is messed up with default definition of RscListNBox?
probably, I create it dynamically with script
you cannot load crates. Only other (compatible) vehicles
I know for a fact that marc_book had to do some things for the BWA3 Eagle to work with this.
Configs and memory points
Never used it, no idea. Sorry.
Maybe it's borked.
once again a 5 minute project blows up into a 3 hour investigation π
business as usual
remember magazineGroups ?
BI made magazines to be configurable in groups, so your Addon A weapon would use group "556Stanag" (or whatever named) and it would be compatible with Addon B's 5.56 magazine from the same group. Currently you have to list all compatible mags in the weapon config, so it's impossible for different addons to support each other.
The addition even appeared in the changelog (1.42 ?)
And we tried to get it to work
We tried
It doesn't work. It's as if the feature doesn't actually exist.
None of the vanilla weapons use it. They don't need to after all. The feature is either broken or no one found how to actually use it. All docs are wrong
Or they forgot about it. No idea how it ended up in the change log though
here! it's total BS and doesn't work
Heya! Can i use images in mission file with drawIcon function?
I believe to have used mission images with drawIcon sucessfully... but now i'm not sure, this is why i ask. I'm a bit confused.
Look at the comments on the wiki page for it. There's a link there that explains how to use them @tough abyss
@austere granite thankyou! The info is in drawIcon3D (http://killzonekid.com/arma-scripting-tutorials-mission-root/).
@tough abyss thanks for looking into that bug! π
General question here. _task = ["task1", "ASSIGNED",true] spawn BIS_fnc_taskSetState take this for example, and how it says spawn instead of something like call. What are the differences?
In between all of them, if there are more.
Ah, thank you!
Are there any other things like spawn or call I should know about?
Oh, well I know about execVM. Thnaks, though!
The link above will give you an insight into (un)scheduled environments
Which is a large part of spawn/call
For even further understanding of how the environments relate to spawn/call:
Calling from an unscheduled environment -> unscheduled
Calling from an scheduled environment -> scheduled
Spawning from an unscheduled environment -> scheduled
Spawning from an scheduled environment -> scheduled
It's also worthwhile to read the remoteExec(call) wiki pages, to see how they handle environments, it's slightly different
Ultimately it boils down to not suspending in an unscheduled environment (and on the way in which you wish to execute your code, re wiki), which given all this info may seem confusing as to when you are, but there is a handy new command (https://community.bistudio.com/wiki/canSuspend)
Interesting.
Is there any difference engine-wise between vehicles and actual playable units that would cause //Marker reset position for Comvic (Respawn helicopter). while { alive ComVic } do { sleep 5; "respawn_1" setMarkerPosLocal position ComVic; }; //Marker reset position for Gregory. while { alive Gregory } do { sleep 5; "GregMark" setMarkerPosLocal position Gregory; }; the first half of this code to work, but not the reset pos for gregory to work?
Because the marker resets fine for comvic, but not for gregory. Gregory is a squad leader.
This is in my initPlayerLocal.
Really trick, you need to paradrop AI from heli with a very specific way (order of commands, that aparrently can be executed in any order, and sleep or not-sleep between commands also count).
Extremely unreliable, since there are many many combinations, only one works, and can stop to work in future updates.
Can't decide if use paradrop or not. Thankyou for listening me!
is there a way to make respawnModules randomized? So if I have 5 respawn modules, the player just hits respawn and it picks one of them?
You would probably have to disable MenuPosition
Which is fine, but without menuposition the player respawns where it initially spawned on mission start.
basically ignoring any of the modules.
I am looking at this ATM to see if it will randomly select a marker w/ a proper name if you use base respawn http://killzonekid.com/arma-scripting-tutorials-respawn-on-marker/
found it
In case a marker is found, there will be further attempt to retrieve all similar named markers in order to select one random marker. For example if there are several markers for side βwestβ, βrespawn_west1β, βrespawn_west_blahblahβ, βrespawn_westiliciousβ, all 3 will be picked up and then one marker will be selected at random.
no problem, I found it at the end of the "BASE" description https://community.bistudio.com/wiki/Arma_3_Respawn#Respawn_Types
I think they should make it more clear on the wiki
what happens when you have multiple markers
Checking it out now. What I'm curious about is the fact that the first link basically says "SIDE" is the last choice before any respawn position
Oh! nevermind the spawn point would be dictated by the squad leader's unit name
so we can stick with side delegations; respawn_west1, 2, 3. testing now
this could not have possibly worker smoother.
wow.
Glad you got it working
partly; I'd like to select an area where a random spawn then occurs. at first glance it looks like i need to figure out how to change body position after death but before respawn so it looks at the closest selected respawn markers.
yeah; so random spawn points within a selected area only. IE, player dies, player selects base to spawn at and player is spawned on one of several points in that area. The issue there is I need to set height of spawn point as well, hence modules and not markers
Ah
looking like I'll have to rebuild the built in function just for that added bit lol
What you can do is enable the MenuPosition feature again, and then have only one module per area. Then you have a script that activates on respawn/spawn that moves the player to a random marker in the area
yup.\
hm. Any idea how I can grab the respawn position variable name on use? Init field for that fires as soon as the mission loads.
this should work?
[player, [missionNamespace, "inv"]] call BIS_fnc_saveInventory;
diag_log str inv;
figured it out. sending the area name on spawn to a function that will then randomly choose where to move the player.
alrighty.. next question;
trying to run this code in a trigger 'on activation' for each player in the area.
player setPos {[roofTop1, "dirt_airField"] call "movePlayer.sqf"];};
what I want it to do is when a player enters the trigger area, teleport them to a different location.
[roofTop1, "dirt_airField"] portion is for a switch case to identify which area the player selected and which area it will teleport them to. With the above code, however.. I'm getting a syntax error (missing π
.. missing a semi colon somewhere. error specifically states
"..., "dirt_airField"] call "movePlayer.sqf"|#|];};
Im using call as I expect to get the xyz pos from the object roofTop1
Is that incorrect?
to add on to that; same syntax error when using execVM
call is used only for "CODE", "moveplayer.sqf" is a STRING
youneed call compile preprocessFileLineNumbers "somescript.sqf"
first script file must be loaded (preprocessFile) - then it will be available as TEXT, then it should be compiled to become CODE
Thanks for the info; I found out I could use compile loadFile but went a different route all together and got the thing working with just execVM and 2 params
Thanks for the info, LongBow and Cptnnick
Sorry about this noob question, but what sort of script so I need to delete zeus editing areas when the object that it is connected to is destroyed or dies, and how can I Russian it with the object?
I know how to order things to remove themselves but I need to know how to tie it to death and have it return
since this is more a scripting than config question I will ask here
will this
{
"Camo",
"left_arm",
"right_arm",
"chest"
};
hiddenSelectionsTextures[] =
{
"\mod\addons\mod_t_uniform_m93\data\mod_uniform_co.paa",
"\mod\addons\mod_decals\data\first_brigade_ca.paa",
"\mod\addons\mod_decals\data\army_ca.paa",
"\mod\addons\mod_decals\data\name_one.paa"
};
class EventHandlers: EventHandlers
{
init = "(_this select 0) setObjectTexture
[
1,
[
""\mod\addons\mod_decals\data\first_brigade_ca.paa"",
""\mod\addons\mod_decals\data\second_brigade_ca.paa"",
""\mod\addons\mod_decals\data\third_brigade_ca.paa"",
""\mod\addons\mod_decals\data\fourth_brigade_ca.paa""
]
select floor random 4
]";
};``` work in soldier config?
I am trying to set arm patches to be random
this might work for one selection but I have no idea how to make it work for multiple ones.. if there is a way please ... and thank you
hiddenSelectionsRandomTextures[] now there is this also but I dont know if this works at all anymore
Why would it be _this select 1?
mh typo should be 0 / fixed
I'm studying Python programming, just starting to learn about OOP ... just curious if anyone has anything to say on this ... how similar to Python is SQF way of dealing with objects, classes, inheritance, etc.?
@vital onyx https://camo.githubusercontent.com/643dc093cc9e06cc9159f4ca29d7c23495d84f6d/687474703a2f2f7075752e73682f6f344563552f356663353734653631612e6a7067 π i worte something like that a long time ago in C#
haha) cool one)
I knew that someone might have such idea earlier)
but I prefer ingame
the issue is that you dont get access to Profile and UI namespace in MP
but I plan to support non-local namespaces as well
if it is enabled in mission - then yes
you can dump variable on a remote client and path over the network
would be slow as hell but should work
anyway filters should be applied
okay, reasonable
giuse? Before you burry me here with chatter can I ask if
{
init = "(_this select 0) setObjectTexture
[
1,
[
""\mod\addons\mod_decals\data\first_brigade_ca.paa"",
""\mod\addons\mod_decals\data\second_brigade_ca.paa"",
""\mod\addons\mod_decals\data\third_brigade_ca.paa"",
""\mod\addons\mod_decals\data\fourth_brigade_ca.paa""
]
select floor random 4
]";
};``` I can use multiple selections here or do I need different approach?
guess no idea eh
I'm not sure if I know what you mean, and you could also use selectRandom
Are you saying you want to set multiple hiddenSelections?
okay here is the deal... I have a uniform that has set some hiddenselections like I described above... one is camo its for general texture and I dont need help with that, other is the left_arm path and then goes right_arm patch and so on... the idea is to make these RANDOM trough init in eventhandlers
in example above I can set hiddenselection from array but just one of them, 0, 1, 2, or 3 ... nn but just ONE
is there a way to set multiples there
aha π
;)
valid at the moment of preprocessing config
ok yeah my method is Dynamic and accuret alle the time
it requires dll
yes
well, my intention - is mostly ingame mission debugging
@native hemlock https://community.bistudio.com/wiki/selectRandom that wont work for what I need it to do
nvm if you dont understand Ill rape my brain until I get it right
@zealous solstice also I guess _EXEC should work also for preprocessFileLineNumbers
so
I don't know why selectRandom wouldn't work, you'd just do
selectRandom [
'\mod\addons\mod_decals\data\first_brigade_ca.paa',
'\mod\addons\mod_decals\data\second_brigade_ca.paa',
'\mod\addons\mod_decals\data\third_brigade_ca.paa',
'\mod\addons\mod_decals\data\fourth_brigade_ca.paa'
]
@zealous solstice yep, u r right, will not compile
yeah that would work but its not answer to my question its a replacement command π
thanks for that anyway
I still don't know what you want to do. Do you want to assign multiple hidden selections, or you want to set one of them randomly?
multiple of them randomly
@zealous solstice anyway profile and ui namespaces are not the case for such tools, if mission author/admin needs smth from this namespace - he should know what he needs
So is hiddenSelection 1 is on the left_arm and 2 is on the right? Do you want both of those hiddenSelections to be the same?
no thats the point I want each to be set from separate array of textures
So you are alright with having the first_brigade on one arm and the third_brigade on the other arm?
no the brigade things goes on right arm
I want to do it this way so I dont have to make separate textures for each brigade
randomize the hiddenselection so each soldier will spawn with different arm patch
from the given array of four textures
woot, just ran my first full CI build of ACRE2
I can do that for one hiddenselection but for more I guess that would require a script and cant be done trough evenhandler like this...
Well if it works for one hiddenSelection it should work for two, I just don't know if you can do multiple lines like that in a config
I know I cant have multiple inits so it has to be done all withing this one
It would be cleaner to just have your own script so in the init you just had _this call Jastreb_randomizePatches or something
its a question of formatting it right I guess but its a bit over my head
yeah that sounds about right
just wanted to know if its possible in the init itself but it seems too complex
for inline scripting in the config
requires a separate script... gotcha.. thanks
Just curious, one author of a well-known Python textbook say that multiple inheritance (at least in Python) is a minefield and should be avoided if possible. Is there such a thing in SQF? inheriting from multiple classes?
@west lantern Knowing Arma I wouldn't be surprized if these will end up different on each client lol
My guess: it will, since its beeing called on the Clients also (OR: the car will constantly change its color/skin, when a player connects π )
Actually current BIS texture randomization is messed up too, ends up different on all clients
Would there be any issues with it only setting the texture where the object is local and using setObjectTextureGlobal?
@meager granite also if you leave the server and rejoin textures will change.
Voip: "Go near the blue Heli!"
It is setObjectTextureGlobal already
The bug with current BIS texture randomization is that it uses "Init" event handler in the vehicle
All vehicles are local during Init execution moment
So script runs for each JIP player
It's like that for ages, never mistrusted it to be a bug.
@meager granite have you played BRPVP?
Never heard of it
By description of it looks to be somewhat similar to Wasteland
- Player stay in game for 10 seconds after disconection of any type.
Planning on having it in Wasteland too to prevent combat logging
Actually had it prototyped even for OA which doesn't have HandleDisconnect
Careful with these huge screenshots in the thread, you'll get infraction for it, there is a rule against posting big images that break forum formatting
@meager granite oh, i will fix that big screenshots.
About 02) there is one trick. If player 2 join the slot that player 1 just disconnected, player 2 will control the player 1 soldier in anti-combatlog state. This is because the soldier object is attached to that slot. To avoid that you need to move the soldier object to another group, this will unattach it from the slot.
Yeah, I am aware
@west lantern
dunno if you figured it out yet, but you have to escape the newlines in configs
init = "(_this select 0) setObjectTexture\
[\
1,\
etc. except for the last line (which you terminate with a semicolon)
Guys I am a bit confused on structuring my scripts take for example this script I made called tasksComplete.sqf
private _taskList = [player] call BIS_fnc_tasksUnit;
private _taskStates = ["failed", "succeeded", "canceled"];
private _tasksComplete = true;
{
params ["_task"];
if !([_task] call BIS_fnc_taskState in _taskStates) then {
_tasksComplete = false;
}
} forEach _taskList;
_tasksComplete
Its contract is just to return true or false
However I was thinking of adding CBA_fnc_addPerFrameHandler and the function would then be its own thread that keeps checking itself, or should I just have one thread handler that then calls this function and does the necesary logic depending on the result?
I am wondering if it is an antipattern to have each script running its own job versus having one controller function that checks all other functions?
If you tried applying this rule https://en.wikipedia.org/wiki/Single_responsibility_principle
Well, you should really be asking yourself this first:
Does it need to run on every frame?
Not every frame, maybe every 15 seconds, so if the player finishes all tasks the mission will end
I made a decision to create a new function called mission_controller.sqf which has a frame handler and checks various states of stuff and ends the mission, seems more sense to have one place were all mission vars are monitored
There will be no need to use an onEachFrame unless you have a large amount of functions in a similar boat
What would you suggest then to do checks every 15 seconds?
Frame handler on a15 second check
probably just add an isNil check to "_actionParams" then i guess?
there's more commands lke that that have no return (Or a return that's formatted differently) when it should be empty
Yeah I agree
I think it was somethign with normally it would return a nested array, but if nothing is found it would just return [] instead
like you'd mostly use it with { } (count (thatCommand select 0)); but then first you need to add a check that it's actually the nested command π¦
Yep, seems like bad design if it doesn't return an empty array tbh
Any idea what causes this error?
Error position: <== true) then
This is my code
[{
if (GhostFunctions_fnc_missionTasksCompleted == true) then {
"end1" call BIS_fnc_endMission;
}
}, 15, []] call CBA_fnc_addPerFrameHandler;
you don't compare to true
if (GhostFunctions_fnc_missionTasksCompleted) then {
but probably seeing that looks like a function if (call GhostFunctions_fnc_missionTasksCompleted) then {
anyway.... the real questions is, if that's the only reaosn you're constnatly doing that check, why not make that function end the misssion itself?
Any idea if you can parameterize ticket count in the mission setup? I know I can do time of day for example, but if i want to be able to select on the fly "MenuPosition" or "Tickets", how would you pass that and return the need for a ticket amount?
Hmm getting this now
Error position: <if (GhostFunctions_fnc_missionTasksCompl> 15:49:03 Error if: Type code, expected Bool
Adanteh already explained to solution to that one for you
@tough abyss you need to change if (GhostFunctions_fnc_missionTasksCompleted) to if(CALL GhostFunctions_fnc_missionTasksCompleted)
the addition of call expects a return from the code it's executing. Basically the error says its running a bit of code as if it isn't expected to return something, but placed in an if()do block.
Ok thnks
yet? having some issues where it returns nothing (undefined var) if a bad ID # is given
@tough abyss
this is my go to work around for shit like this:
[player actionParams 0] param [0, <whatever your default value should be>]
hmm. I found #include "\a3\functions_f\params\paramrespawntickets.hpp" but apparently that only allows me to set min and max for the whole server, not side specific. Where can I find source info on .hpp's like this? I'm wondering what other #define's I can use. There are only 3 listed on https://community.bistudio.com/wiki/Arma_3_Mission_Parameters
I can open the file and take a peak at it for you at what you actually can overwrite via define
nope
#ifndef TICKETS_MIN
#define TICKETS_MIN 100
#endif
#ifndef TICKETS_MAX
#define TICKETS_MAX 1100
#endif
#ifndef TICKETS_DEFAULT
#define TICKETS_DEFAULT -1
#endif
these three. nothing more
Hey thanks for that @little eagle . One more question; can you declare respawntemplates in the init.sqf? For example;
if (_BluForTicketCount != -1) then { respawnTemplatesWest[] = {"MenuPosition", "Tickets"}; [west, _BluForTicketCount] call BIS_fnc_respawnTickets; } else { respawnTemplatesWest[] = {"MenuPosition"}; };
where _BluForTicketCount is declared in paramsArray
Reason I ask is I'm getting a missing ; error in that section.
you cant do that, no
any idea how I would parameterize respawn types then?
Or is that not a thing
templates, not types.
Is it possible to remove a specific units ability to aim down site? Ie for a reporter who is discoraged from picking up a weapon because he wouldn't know how to use it
Make him shoot from the hip?
is there any good way to make an enemy AI run exactly after/follow a player/ another AI?
Im currently running doMove in a loop but it seems kinda bugged when the unit to follow or runafter is inside a house and the other unit isnt (or vise versa)
@tough abyss yes, I want to script it so he is forced to
The bug with current BIS texture randomization is that it uses "Init" event handler in the vehicle
All vehicles are local during Init execution moment
So script runs for each JIP player
For a moment I had a glimpse of hope and then @meager granite reminds me ITS ARMA π
@little eagle thanks for that I completely forgot but I worked out a solution with a function call in init rather than putting it all in the config
any way to delay it and make it run after the spawn trough EH? I assume that rules out Init
Hey everyone, Is there a way to use structured text in a list box?
@rocky cairn make him careless?
Its a player, id like to prevent the player from aiming down his site
@rocky cairn
there is no command to force or to switch a camera mode, so no
Yeah there's no switchCamera
You could try waiting until cameraView == "GUNNER" and then switchCamera or player action ["weaponOnBack",player].
doesn't work. weaponOnBack lowers the weapon, but the avatar immediately raises it again, because there is no GUNNER mode for the lowered weapon
you cannot get out of GUNNER mode
even this puts you back in GUNNER mode:
0 spawn {_w = primaryWeapon player;
player removeWeapon _w;
sleep 1;
player addWeapon _w;
player selectWeapon _w}
oh, I see. bummer.
well. I have one idea, but it's extremely clunky and has many problems
How about making the reporter's bullets go all over the place if he shoots from optics? π
Or the view goes black as he closes his eyes when shooting?
Add a huge sway with setCustomAimCoef.
nope doesn't even work
If it slightly helps towards your issue you can always use a Fired EH and delete the bullet, its not quite what it seems like you're after but they won't be able to shoot anyone/thing π
or you give him this action:
player addAction ["", {systemChat "commy was here"}, [], 1.5, false, false, "DefaultAction", "cameraView == 'GUNNER'"];
unit won't be able to shoot in GUNNER mode
Any one was able to activate the new revive? I put the vars on description.ext and.. don't work. I pass away directily, with no incapacitated state (using basic revive).
working fine on my servers
This is the official revive from BI, some mods create their own revive mechanic and may be they will not change it to BI deafult one.
And it's what i'm doing, creating my own... until someone help me here with the official one π
Can anybody point me in the right direction for recreating the radar system here: https://youtu.be/GQKrKJNFw5c?t=1m21s
If someone know, will save me some time: When i use "player setVariable ["myVar",100,true]" on the player "respawn" Event Handler, the "myVar" is set on the dead body also? Thankyou.
I've got a question about bis_fnc_liveFeed if anyone has any experience with it. I'm looking to create a feed of one player's view and broadcast it to a television or laptop using setTexture or something similar. I believe this function may allow me to do that, but the wiki article doesn't provide any sort of helpful feedback. Thanks in advance!
This "if (condition1 && {condition2} && {condition3}) then {..." can in any situation be slowest than "if (condition1 && condition2 && condition3) then {..."? Thankyou in advace!
If all conditionN are trivial, or if condition1 (or 1 and 2) is true most of the time.
@little eagle thankyou!
Finished my Revive system. π
Hope i can do a video about it soon.
^ lol he meant using the End Game/ Campaign revive
anyone seeing issues with slingloading since 1.64? Or perhaps 1.62? Certain boxes can't be slingloaded anymore for some reason.
@tough abyss i tried to use oficial revive many times, no win. I changed to use my own and will use that for now. just limitation is that AI dont shot incapacitated players.
I needed to choose between 1 - have fake death animation, or 2 - AI dont shot incapacitated players.
they don't do that with the End Game version either
@tough abyss me and me tested it with 2 computers. Not so extensiiiively, yes, but i will try to break it the most as soon as i can.
Players is set to civialian side and AI can't be bothered with them anymore
setCaptive true
Hey, when I use lbData it removes all , from the String does anybody know why and how to work around?
Google short circuit evaluation @tough abyss
Apply Kirchoff's Voltage and Current Law.
Or did you mean another circuit evaluation?
not sure if "trolling" buuuttt https://en.wikipedia.org/wiki/Short-circuit_evaluation
@shut trail do you mean like
"test, string, separated, with, commas"
becomes
"test string separated with commas"
I've not seen this, I do store arrays in lbData by converting them to string and if it were to remove the commas it'd break the array (when converting back to array with call compile)
anyone know how to scritpt pop up targets to come back up and to be scored?
I'm pretty sure there's already pop-up targets that flip up and down
So you'd just need to add an event handler for when it's hit
well yeah theres pop up targets but im trying to set up a range where my guys can shoot the targets and once there done i can hit a button and theyll all flip back up
Is there any advantage in using netIds instead of directly passing objects?
@dusk sage i will look at that. Remember that from many years ago.
@vague hull I would say less stuff to broadcast
@dusk sage looked at @halcyon crypt link. I'm using it now because of comodity in some situations, and a bit because of performance... but's sounds a strange thing to me, the WIKI says "The use of short-circuit operators has been criticized as problematic". I think it can make us lazy since it solve some situations of bad code. For example, i don't like to have to check if a variable is defined before using it, this thing can make it more connom than water.
@jade abyss ok thx :) I thought so yet couldnt find some official statement
When a unit die the weapon it was holding goes to the ground. How can i access this weapon by script?
"primaryWeapon _unit;" dont work.
Considering the weapon on ground is primary.
@tough abyss I think you need to search for nearby weapon holder on the ground
@mint frost thanks. Strange is that the weapon get deleted if you delete the unit, so this weaponHolder must be tied to the unit.
Okay didn't know that - maybe there is a other way
create an MPKilled event handler, in the code do a nearestObjects check for GroundWeaponHolder.
or if you are using a database that keeps track of player info and stats, just pull the primary weapon from that data
This is a somewhat scripting based-ish question, but does it matter in which order you load things from init.sqf?
sometimes i have the feeling things do not load when set in a particular order...
Hey guys, short question (no access to arma atm to test), i need to check if the client has a addon activated.
fox_suicide_bomber_fnc_remote_sound = {
_object = _this select 0;
_sound = _this select 1;
if( isClass (configFile >> "CfgPatches" >> "fox_suicide_bomber") )then{
_object say3D _sound;
}else{
["<t color='#FF0000'>Man:", "Allahu Akbar"] call BIS_fnc_showSubtitle;
};
publicVariable "fox_suicide_bomber_fnc_remote_sound";
[_bomber,"suicide_bomber"] remoteExec["fox_suicide_bomber_fnc_remote_sound", owner _x];
is this method valid ?
probably not. owner only works on the server machine
just use _x. Also I'm not sure if remoteExec works if you pubVar the function in the same frame.
i loop trough a array with player object; from wiki
On server machine, returns the ID of the client where the object is local. Otherwise returns 0. For use on clients clientOwner command is available. To find out the owner of a Group, use groupOwner.
in 2h when im home i can test it.
just use _x. remoteExec can take objects
or even better
use the array you are iterating through. remoteExec can take arrays of objects
what you really want to do is to define fox_suicide_bomber_fnc_remote_sound in the init.sqf and not send it over the network during the mission
also, might be my OCD, but please replace
_object = _this select 0;
_sound = _this select 1;
with:
params ["_object", "_sound"];
it's 2016
many sacrifices where made for this syntax
my aim is to add support for non addon user,
Example:
Server, addon installed
Guy A, addon installed
Guy B, no addon
The suicider addon runs on the server, now i want to check server sided if the players have the addon active if available, say3d ...., else bis_subtitle...., this is why i need the send the code over the network
but don't do that in the middle of the mission. especially not x times while iterating through an array. everyone will notice the civilian trying to blow itself up by the red chain and desynch...
anybody who has a clue how to set-up sector's /w respawnpoints in combo /w alivemod?
@mint frost @zenith bramble thanks.
If i move a dead body, his weapon lying on the ground moved too?
no
but if you delete the corpse the weapon will be deleted to for whatever reason
I will move the body to [0,0,0] and delete it after 1 minute
Added: A new entities script command (with native filtering support)
Fixed: Crash when using the keyImage script command with a negative value
Fixed: Dropped equipment could become unobtainable in some cases
Added: Support for an optional parameter (include crew or not) for the entities script command
anyone tried the new entities stuff yet?
nope but sounds good
@kju thi is a mod?
How i put an AI unit in a B_static_AA_F static turret? moveInDriver?
So, is there a fix for the non working revive? Straight to respawn instead of incapacitated. Seems to be a bug from last update
@clear tendon What exactly are you trying to accomplish? Could be fairly difficult. We also have our own Discord channel that is probably more suited for this type of stuff if you want to ask us directly.
@JayS_NL of course it matters in which order you load things. Functions and variables must always be declared before usage which is why such declarations should always go at the beginning of the init.
@willow basin i understand, i'm just wondering if there's an order to which you exec multiple scripts.
@snow pecan the gest of the idea would be to check if a sector is captured by blu or opfor, if it's captured (saying say on the map) give the player the option to spawn into that zone, close to the action.
_corpse setPosASL [0,0,0]; not works allways. Why?
The corpse move in some clients and not in anothers.
And one time the corpse neck gone to 1 meter
and it not moved
Where are you putting that command
Corpse is in a client
I exec the command on server
May be we can't move it because its gone ragdoll.
^
setPosLocal
i assume it's in an event handler, so you should put the event handler in your initPlayerLocal
dont use [0,0,0]
diag.exe warns about positions too close to it
use [-10000,-10000,0]
Thanks for the help.
@velvet merlin what's wrong with diag.exe and [0,0,0]. Any useful reading about this?
the engine can have problems with that position, so its best to avoid it
btw, recently CCIP was introduced for planes and helis - anyone has a knowledge how to get CCIP data with script? eg get xyz of estimated impact position?
kju: is 10,000 recommended value, or doesnt it matter once it goes away from zero?
away from zero and the size of created object of course.
10k is arbitrary, yet far enough away
roger, I'll change all my scripts using zero from now on then. thanks for the tip π
in OFP that position was very problematic; i think BI fixed most issues by now, yet AI stuff and some rare/very specific stuff still may cause issues
it's not [0,0,0]. setPos on ragdolls is wonky
probably thinks the ragdoll was moved on some remote machines and the interpolation magic throws it back at it's original position
an someone throw me an example of creating a unique variable for a building on the map?
im having a brain fart
really wish we could use parameeters with addMissionEventHandler
What do you mean?
eagledude4, a variable that maps to a building, or a building that maps to a variable?
Thank you for elaborating more kju, I regularly use [0,0,0] for namespaces and such and I have had no problems.
@little eagle if you are having problems with positioning ragdolls, just make sure its done locally, and try utilizing it in unscheduled environment with enableSimulation false commands
for instance, _obj enableSimulation false; _obj setPos _pos; _obj enableSimulation true; _obj setPos _pos; Should work guaranteed, because second setpos will be interpolated correctly and broadcasted.
cool method
We use createVehicle almost exclusively on [0,0,0] and then use setPosASL. The searching-for-a-free-space part of that command is hideously slow, even with the CAN_COLLIDE flag.
Btw, commy2, if this method does not work, post up bug repo. Nobody should take hacks too far
I revived a player 20 times and don't had the problem on the two clients. Just moving the body to [-10000,-10000,0] (ATL), no other changes. Will keep checking.
yeah. it might also work with -10k, because the ragdolls are so far away that the interpolated movement becomes "invisible".
@little eagle, i continued testing and it had happens 2 times. http://imgur.com/RM02hJC
lol (funny pic)
i will try the other solution
Yeah. Exactly the problem on the picture. Nice to know that there is a solution. Someone should put it on the wiki
I'm dealing with "mechanics" now. Player have life of 1, disabled player have life of 0.5. A sniper shot in the head can "kill the player 4 times" so he dies. Even one shot of a Medium Machine Gun kills directlly. SMG need some shots on the disabled player to kill. (for disabled body i consider only general damage, that is damage on part ""). But i'm increasing the disabled player life to 1. Thanks for watching.
I have been searching for quite a while now, but is there a reliable way to force a unit without weapons to sprint?
I cant tag swinging.meatball on cel.
@little eagle the problem still happens. I'm using meatball code with [0,0,0].
@little eagle does this affect units too or only vehicles?
spawning at [0,0,0] ? idk, but it does search for empty postions for units too. Someone should test
the problem still happens. I'm using meatball code with [0,0,0].
figures. was too good to be true. Ragdolls suck
hey guys, got a quick question; arma says i fucked up with my brackets there: _res = createVehicle ["CargoNet_01_box_F", (position [(getPos _obj select 0)+20,(getPos _obj select 1),(getPos _obj select 2)]); , [], 15, "NONE"];
but where
whats the best framework to generate a road network these days?
in terms of what?
to dynamically scan a terrain, create the road network to give AI waypoints dynamically to drive around (cars/trucks)
Depends, I would go for an dynamical approach if the performance allows it.. otherwise scan with connectedTo on call, however Idk if there is something premade for this already
@little eagle Sorry man, welcome to netcoding
@little eagle i did a test, i used "_corpse setPos ((getPos _corpse) vectorAdd [-50,-50,0]);" or in other words, moved it some meters away, and the problem happens allways! (i suspect you already expected that considering your comments on -10000)
Anyone know what is the farest away distance i can setPos things?
With [-10000,-10000,0] the problem happens 1 time in more than 20 deaths.
anyone able to lend a hand to a mate of mine, hes got an idea for a gamemode but he cant do it himself
@velvet merlin do you have any examples of such frameworks? I have not heard of them
Hello,does anyone know if waypoints are actually executed server side?
You mean the waypoint condition and activation codes?
@vital onyx check https://forums.bistudio.com/topic/191515-ai-driving-feedback-topic/page-13#entry3101904
Page 13 of 13 - AI Driving - Feedback topic - posted in ARMA 3 - DEVELOPMENT BRANCH: I am confused. Latest changelog: Fixed: Using disableAI PATH and MOVE would not work correctly for vehicles driven by players (https://feedback.bistudio.com/T120346) The ticket says Since 1.64 update, wheeled vehicles cannot move when _veh disableAI MOVE is defined for vehicle. Isnt this exactly what should happen? I mean, if I disableAI MOVE -- why would I want t...
Is there anyway to force a flush of the JIP queue in multiplayer?
@random estuary I don't think so, unless there's a command to fetch the id's
You could always save the id's somewhere if you create a jip remoteExec and then just use them
Can i do that: "BRPVP_disabledSounds = BRPVP_disabledSounds apply {...};"
yes
is there any reason a custom extension (.dll) won't load from the mod/addon folder but it will work in the root of the Arma directory?
@austere granite thanks!
BRPVP revive script: https://www.youtube.com/watch?v=Jc2k2pVpsNI&feature=youtu.be
units actually die, and then you just respawn in same spot with gear copy right?
Yes
No "hack" or anything overcomplicated.
Still can polish it like make the unit revive in a better position and not standing.
But having some problem to make the unit revive in the position i want.
When the unit is far away from a client, this client does not record this unit animation state. So when the unit magically appears in front of this client (setPos) strange things happens.
"HandleDamage" continues to record damage after the unit is dead.
@tough abyss have you tried it with setUnitPos?
I got that in my revive too, but the problem is that most commands that include dead units (for markers and so on) are slower
What do you perform on a dead unit?
Dead in this case would mean incapped
But in that sorta revive the unit is dead to the engine.
So if you'd still want to markers for incapped units, you would need to use script commands that include dead units.
@scarlet spoke have tried switchMove and playMove, but it doens matter what you try if the unit is respawning in a distant island and the clients near the body dont record its animation.
When the "reviving" unit get teleported from the spawn island to the dead body its like if its animation is nil
And what if you spawn the unit somewhere remote, then use hideObjectGlobal then setPos and then the respective command to change the units stance?
And afterwards unhiding it of course
@austere granite i have no big problem with that, but i created a variable in player namespace that can be -1 for alive, 0 for incapacitated and waiting destine, 1 for killed, so respawn, and 2 to revive now.
@scarlet spoke i will try that.
Sounds from www.freesounds.org!
Here you can find a sound file with all interesting disabled shouts! π https://www.dropbox.com/s/7pb8pa5ijejspyf/all_disabled.ogg?dl=0
@scarlet spoke your idea about hideobject worked perfectly!!
Haha... Glad that I could help π
A dead unit allways will have a "damage _unit" of 1?
Afaik yes
@grave comet confirmed it is. Also if a dead body get hit the damage reset to zero and start again 0... 0.455... 0.896... 1.123... 1.643... 2.122...
Its not continue from 1 (death).
hello felas.
hey, have any mode to use more than one typeName in this? https://community.bistudio.com/wiki/nearObjects
new release - https://forums.bistudio.com/topic/195346-release-arma-3-custom-chat-commands/
script to execute code by a special chat message
BRPVP Revive is well polished now.
Code & visual.
But its so much work to do another video.... π
Does anyone know what function is called when you open your inventory?
Afaik there is an event handler for this...
is it possible to pass parameter to the code of a addPublicVariableEventHandler?
And even more urgent: Is there a way to remove the EH when It's no longer needed?
Bad news :/
Do you know why you can't remove it?
I mean is there a particular reason for it?
Yeah but remoteExec is slower afaik
That's true... And apparently I don't have the option to choose as publicVariable does not fullfill my needss...
Thanks for the answer
Why is that?
RE is better.
Than ReCall?
Then pubvars EH.
Ah okay... I had in mind that I have read otherwise
@jade abyss why can RECall be delayed and RE can't?
Nah, i mixed it.
RECall is instant, RE CAN have delay
@scarlet spoke
Just like "spawn" (RE) and "call" (RECall)
Sure
That would be a neat trick to have instant execution over network π
If canSuspend returns true in a SQF-Script it's a save indicator that the code is executed in scheduled env isn't it?
Would be something new for me.
Whitelisting, of course it checks, whats in there and what not. Do your Tests with a Server under heavy load, then compare RE(C) with the PVS/PVC stuff.
Before REC? Don't think so.
Its the same talk when people use count for looping over elements.
Sure it might be 0.001% faster
But semantically it still sucks, just like PVEH's.
I don't want to be a bag but i don't use Public Variables for Remote Execution :p
@nocturne bluff also the thing about spaces, the idea that spaces can make your code slowers... not sure if its something noticeable at the end.
Let me gain some performance with my code " if (_run) then {..." => "if(_run)then{..."
Yay!
Erm... can i use switchMove in a dead body?
(80% of the work in my revive now is to preserve the fallen weapon... AAAAA!)
(te current version can duplicate weapon items and refill the weapon magazines)
(so, back to setPos on dead body. What alley i preffer??)
Afaik you can do a nearestObject for a weaponHolder in order to find the weapon of the dead body... You might want to google a little more for this
@tough abyss
Hm okay... never tried it myself. I just remembered that I have read that you can do it like this
Ok, so i find the WeaponHolderSimulated, and now what? I would need to transfer the weapon to another weapon holder (weapon with exactly same items and mag count) so i can delete the body and don't lost the weapon. This "transfer of the weapon" is not possible.
Or i can use a invisible unit to assembly a new weapon (exactly same weapon, items and mag count) and drop it in the new holder with dorpWeapon action (3 seconds action)... too much hack..
I checked the body and the WeaponHolderSimulated with allVariables to try to find something that link the WeaponHolder to the body and try to remove this link, but found nothing.... The body get deleted, the weapon dissapears.