#arma3_scripting
1 messages · Page 321 of 1
try typing that part out manually
i am so rusty with sqf though, hopefully someone less rusty will lay some eyes on it
I replaced "==" with "isEqualTo"
same Error tho, it works, and randomizes and shows different animations but I still get the error.
Talking to each other, different animations but: http://i.imgur.com/O9mc5Po.jpg
afaik isEqualTo is marginally faster than == but functionally no different
wait are you doing !isEqualTo ? because that won't work
to wait until something is false you need to do !(condition which is true) i believe
No I'm not doing that
alex_fnc_animatron = {
sleep 0.1;
params ["_unit", "_animations", "_randomize"];
if (_randomize) then {
while {true} do {
_animation = selectRandom _animations;
_unit playMove _animation;
waitUntil {
animationState _unit isEqualTo _animation;
};
}
} else {
{
_unit playMove _x;
waitUntil {
animationState _unit == _x;
};
} forEach _animations;
};
};
learned a thing or two from https://ace3mod.com/wiki/development/arma-3-scheduler-and-our-practices.html - now I'm on a project to use these cba functions to move everything into unscheduled.
the player init box in editor runs locally right?
i think it runs each time a player connects
isEqualTo is functionally different to ==
differences are here https://community.bistudio.com/wiki/isEqualTo
@royal coral to fix that error, just use more brackets (animationState _unit) isEqualTo _animation;
but yeah, you probably do want to wait until it's not equal
otherwise it'll just be spamming playMove every frame
ah thought they were the same
It can compare Arrays, Scripts and Booleans (alive player isEqualTo true)
== can't compare arrays?
and what does it mean by comparing Scripts? comparing something wrapped in {}?
yeah == can't compare arrays
yeah not sure about scripts.. guess it compares compiled scripts
(not really sure why it'd be useful.. maybe to check if one's blank or something)
SCRIPT refers to the script handles reported by spawn and execVM.
Also iirc == cannot compare CODE (e.g. {true}) either, unless you stringify it first.
str {true} == str {true}
ah ok that makes more sense
Is there any command to apply custom rank configurations? Cant seem to be able to apply anything but the default ones. Keeps reverting to private
If I activate a function inside a file from a unit, is "this" inside the file still the unit?
And how can I check if a variable is of a certain type, say "this" needs to be a unit and not a trigger?
It needs to be passed to the script somehow. And you can use the param/params command for making sure its a unit such as like params [["_unit", objNull, [objNull]]];
whatever you pass in to the script (whatever's before spawn/execvm/call) will be _this in the script
which you can then pull apart with params as shadowranger said if you want
Are the Animations sqf ["Acts_JetsCrewaidF_runB_m", "Acts_JetsCrewaidLCrouch_in_m", "Acts_JetsCrewaidFCrouchThumbup_in_m", "Acts_JetsCrewaidFCrouchThumbup_loop_m", "Acts_JetsCrewaidFCrouchThumbup_out_m"] working for anyone?
or are those Actions and therefore executed with playAction instead of playMove?
there is logs, and you should also enable -showScriptErrors while scripting to show them on screen
logs are in %appdatalocal%\arma 3
Is that the little black box that sometimes appears?
I already activated that then
@delicate lotus exactly what i was looking for, thank you very much!
Some animations just don't work with playMove/PlayAction @icy mauve
Nothing you can do
oh too bad, kay then
+Could be, that those are some of them
I think they where added with the Jets DLC as those are only jet-animations but okay then
¯_(ツ)_/¯
I'll just leave that out then and focus more on the content of the mission.
Do a test: Add another Anim
player playmove "AwopPercMstpSgthWrflDnon_throw2"; <-- for example that one
@subtle ore No, the available ranks are hard coded and you cannot add new ones by modifying CfgRanks.
CfgRanks for example has GENERAL, but that enum is unused by the game. Only the other 7 ranks (class 0 .. class 6) are used and also "" I guess.
i might sound a little noobish here, but how can i display full number? instead of decimals and stuff? this is what i mean http://prntscr.com/fenoce i dont want this
use toFixed
thanks @still forum
What is this in red one on Eden editor? http://imgur.com/11YX3ER
disabled sim
thx, FurtherV🙂
how can i check if there is a player 3 meters away from ATM? i tried this:
_return= false;
_atm= (_this select 0);
_checkList= getPos _atm nearEntities [["Man"],4];
hint str(_checkList);
_check= _checkList select 0;
if (isNil "_check") then {
_return=false;
}
else
{
_return=true;
};
_return
``` doesnt seem to work tho
_atm addAction ["Access ATM", "ATM\ATMaction.sqf",{}, 0,false,false,"","[_atm] call sh_fn_ATM"];
nearby objects in 3m?
then check if atm is in it?
or just add the action to the atm?
if i add the action into atm, then you can access it just by pointing at it from big ranges
thats not what i want, i want a player to get close first
@delicate lotus ima try your idea
you can set a range in add action
private _atm = (_this select 0);
private _checkList = (getPos _atm) nearEntities [["Man"],4];
hint str(_checkList);
(count _checkList > 0)
why don't you just add the action to the ATM and set the interaction distance to 3 meters?
because i dont want opfor guys to access it
than add a condition to the action
ill see what i can do , one sec
"side player == opfor"
also _atm addAction ["Access ATM", "ATM\ATMaction.sqf",{}, 0,false,false,"","[_atm] call sh_fn_ATM"];
that "[_atm] call sh_fn_ATM" _atm is a undefined variable
also you don't need to pass it inside a array just to take it back out again. just pass it directly
its defined in file above, anyways i found the fix:
_player= (_this select 0);
_return=false;
_checkList= nearestObjects [getPos _player, [], 4];
_checks= [];
{
_checkName= (str _x) splitString "_";
_checks pushBack _checkName;
}forEach _checkList;
{
if ("Land_Atm_02_F" in _checkList) then
{
_return=true;
};
}forEach _checks;
_return;
misscopied smth, edited
too much code for the problem
meh, i got it working , and its ok for me, thanks for help tho.
Anyone know any issues with attachTo? Specifically when using it to attach players to other players. Im having an issue where the attached player will ocasionally glitch to position [0,0,0] on the map. For the attached player, they can see themselves in the correct position, but for other people and the person their attached to, their at [0,0,0]. Even more strange, sometimes other players can see them attached correctly, but the person their attached to cant. Very weird behavior. It seems like some sort of locality issue, but I really don't know.
why do you want to attach players to other players
dragging and carrying comes to mind
Escorting system for restrained/cuffed players
Not really no
tried attaching them to a helper object and manipulating that?
Nah was considerin that
@copper raven What the hell is your code doing?
You are checking the same condition potentially hundreds of times with always the same result.
And no.. _atm is not defined in the addAction condition. Local variables don't carry over like that.
But your code is for Life right? So.. I guess it's complying with Life coding standards...
Still
{
if ("Land_Atm_02_F" in _checkList) then
{
_return=true;
};
}forEach _checks;
That if statement always returns the same. Why are you executing that for every element in _checks?
setting a variable to true dozens of times doesn't make it any more true
And why are you passing _player in an array if you're gonna take it out again right away anyway?
And I thought you wanted it only to be available to not opfor people? Your code does nothing like that
All your code does you can do by just setting addAction's radius parameter to 4
idk iam not script god, i got it working, not gonna go anymore deep into it
I just told you hot to make it better and how horrible your script is. And you just ignore the advice?
iam not ignoring you , iknow its potato way that i have done it, if it causes problems later on , i will take your advice then
iam too lazy to rework it in a proper way rn
Change atm addAction ["Access ATM", "ATM\ATMaction.sqf",{}, 0,false,false,"","[_atm] call sh_fn_ATM"]; to atm addAction ["Access ATM", "ATM\ATMaction.sqf",{}, 0,false,false,"","true",4];
5 seconds
i dont want this
¯_(ツ)_/¯
You come here asking for advice. People give you advice. You ignore it and just fiddle on your own which creates horrible code. And then you say "I don't want any advice. this works"
FurtherV ( ͡° ͜ʖ ͡°) gave me the advice that i needed, and it worked out
no point of making out other statements which i dont need
aannndddd next one on the list
He told you to add a condition to check the side of the player. Which you completly ignored
sshhh Dedmen, not worth it 😄
yes pls, end of story
Insanity
Hi, is there a way of preventing popup targets from popping up after being shot?
nopop=true;
I put it in init.sqf?
you ask them to do not
Just spawn a AI MG gunner with unlimited Ammo and tell them to fire on the target everytime it tries to pop back up
The last question makes no sense.
okay lets make a real question here,
What is a efficent, fast and good working way to check how many units are in a marker area?
Sorry but what exactly makes your question more real than mine?
He said "nopop=true;" I have no idea what to do with it. If I had, I wouldn't ask
I already figured it out, thanks for whatever
xDD
This is the scripting channel though. What do you think we do with code? We execute it.
Boolean 🙄
Reading it out load won't convince the game not to make the targets pop up.
@delicate lotus
I propose:
{_x inArea _marker} count allUnits
"Hey arma, stop you and your popup bullshit 😃 "
I see everyone is a bit salty again today? 😁
Alternatively:
count (allUnits inAreaArray _marker)
This could be faster, but I never used the command, so no idea if my understanding of it is correct.
It avoids the loop.
yeah that could be really faster
I hope so 😃
yeah I do to
inArea is a nice function to have as command.
yes it is
@halcyon crypt
I blame the heat.
I have a big fan and lots of water
I have one window to open and lot's of empty water bottles. 😦
steal*
rip grammar
doStop commy2;
lol
@vivid quartz Regarding the playMusic issue. I have tested it to start the playMusic as server. Unfortunately JIP wont work there :/
@warm thorn what? No jip with playMusic?
I have tested it - nope
Fack
playMusic has an alternate syntax to set the starting point of the sound file, so if you're smart, JIP should be no problem.
Is there a way to get the trigger-zone visible? (this blue zone)
Triggers are visible in the editor and invisible ingame.
Put a marker over it
how do i change the icon when i use BIS_fnc_setTask ?
@little eagle hey now. I want to be smart too 🙃
Everyone does, but it's not granted, it's earned.
gives @subtle ore a 🍪
@little eagle joke being a wannabe is uhealthy
@still forum thanks, is it oatmeal rasian?
No. Chocolate chip
Shiet :(
Good taste.
@little eagle not visible on map - like the 3d blue zone ingame 😄
I don't think you can. I'm not aware of a way to take that editor functionality into the ingame / preview mode without adding models etc.
Might wanna poke around in the 3den pbo to see if theres a p3d in there
then it would be a scalable p3d? i doubt
no i imagine wall segments
youd have to position them by script but thats fairly trivial if they exist
I don't think they are a model. I think they're drawing these things procedurally and I don't think the method is accessible to us.
Can someone confirm/clarify something for me: is it just me or does setGusts have no effect on the wind at all?
Been messing with it and can't detect any impact on the environment
@tough abyss OHHHHHHHHHHHHHHHH SHHHHIIIIT
okay thank you man
Trying to make my own wind gusts system wasn't a waste after all
18:12:02 Error position: <_grpIconColor set [0,(_grpIconColor sele>
18:12:02 Error Undefined variable in expression: _grpiconcolor
18:12:02 File A3\modules_f\marta\data\scripts\fnc_effect.sqf, line 35
been getting a few of these lately
How do i check if player is the owner of some object?
_veh= _type createVehicleLocal _pos;
_playerObject=player;
_veh setOwner (owner _playerObject);
i use this to set owner, but how do i check if player is owner of veh?
owner _veh == owner _playerObject
???
Yeah that. lol
There is not much point in setting the owner of an object created on presumably the players machine (presumed because the usage of _playerObject=player;, because the object will be local to the machine that created it already.
And then there is the point that the owner and setOwner commands only work when executed on the servers machine. And player is null on a dedicated server
So there are so fundamental problems with these 3 lines.
Unless I'm overlooking something...
Also you cannot even set the owner of an object that only exists on your machine.
Yeah... looks like back to the drawing board for this one.
@little eagle oh boy , i will have to do some stuff here to get it fixed then, since i dont test this mission on dedicated server but player host, i dont encounter those problems, but i will soon, thanks for tips/explainments. 😄
Well it's trivial in SP editor. owner and setOwner don't do anything there and createVehicleLocal is basically identical to createVehicle
yea gonna rewrite some stuff
Depending on what you're trying to do, it would still work. But the whole code could be boiled down to line 1 and it would do the same thing: create an object only on the machine where the code was executed on.
No one else could see it.
I forgot who gave this to me but I continue getting errors for no reason:
waitUntil {
(animationState _unit) |#|!= _animation;
};```
And what is the error?
"general exception in expression"
Full Code in init.sqf:
alex_fnc_animatron = {
params ["_unit", "_animations", "_randomize"];
if (_randomize) then {
while {true} do {
_animation = selectRandom _animations;
_unit playMove _animation;
waitUntil {
(animationState _unit) != _animation;
};
};
} else {
{
_unit playMove _x;
waitUntil {
(animationState _unit) != _x;
};
} forEach _animations;
};
};
nvm I'm stupid
what the hell is |#|!= ? 🤔
|#| marks the error
doesn't ring a bell at all ¯_(ツ)_/¯
-showScriptErros
ah gotcha. Had to find a screenshot though. ^^
@jade abyss Erros 🤔
🤔 ?
🤔 <- thinking emote
? < question mark
Where the f do you come from?
0_o
Hiding in the bushes.
sneakyy
Like usual
:thinking:
Don't do that infront of a kindergarten, might end bad.
😂 Okay, back to doing stuff =}
:monkey:
:squirrel:
I cant see the squirrel @still forum :(
is there any way to see how the action command works?
e.g. if i wanted to see how exactly the rearm or repair actions are implemented?
because they seem broken in MP
i thought they were only a problem with tanks, but turns out it's all vehicles
basically, i have something like this:
_veh = VehCSAT_AH1;
[_veh,["rearm", ammoBox]] remoteExec ["action"]```
and it refuses to work with more than one player in the helicopter.
no matter what i try as targets
and this is true of ammo trucks, etc in general - more than one player means no action appears on the scroll wheel menu
action has nothing to do with stuff on scroll wheel menu
@still forum don't the scroll wheel menu entries like eject, rearm, repair, etc "call"/use actions?
(i'm not saying that an action magically appears on the action menu btw)
but anyway, that's irrelevant in some ways - does anyone have a clue about making the repair/rearm/refuel actions work with multiple people crewing a vehicle?
20:04:43 Remote entity want to supply: VehCSAT_AH1
that's the message that appears if i'm gunner and someone else is driver.
if i'm driver i don't get that message
doesn't resupply either way
Anyone know how to use the BIS_fnc_findSafePos to find a position, but not near a certain object? (for example Exile_Flagpole) ?
So far I got this, which is working, but it might spawn around the Exile_flagpole...
_positiontest = [[4992.81,8005.06,0.00143814],300,10000,0,0,0.35,0] call BIS_fnc_findSafePos;
don't the scroll wheel menu entries like eject, rearm, repair, etc "call"/use actions?
No, they are different, but I'm sure both action and what is hardcoded and in CfgActions point to the same basic engine functionalities.
so then those functionalities are broken, i guess...(not as if i hadn't made a bug report a few months ago)
FWIW when i executed that code locally it worked for me but not the gunner, and when i accidentally executed it globally it worked for both of us, but there was a period of a a minute or two for which it would keep resuplying us.
how do you get coloured text?
Does anyone have an idea of why (uiNamespace getVariable "RscMiniMap") displayCtrl 101 returns 00000000002FF7E00?
Basically want to get the GPS ctrl so I can add Draw eventhandler to it...
The above ID is what is referred in RscMiniMap.sqf in ArmA 3 default GPS
when I add displayNull to it, it says no ctrl
But not sure why it's not getting the ctrl
typeName does not return anything @still forum
typeName ((uiNamespace getVariable "RscMiniMap") displayCtrl 101)
Doesn't return anything in watch fields
So most likely ""
try [typeName ((uiNamespace getVariable "RscMiniMap") displayCtrl 101)]
String
In escape menu the MiniMap is not shown right?
diag_log [typeName ((uiNamespace getVariable "RscMiniMap") displayCtrl 101)]; = string
so RscMiniMap is probably nil
It does not show in RscDisplayInterrupt no
Yeah. So the minimap display is not there. So you can't get it's control
Could it maybe be after Jets DLC update 🤔
try
[] spawn {sleep 5; systemChat str [typeName ((uiNamespace getVariable "RscMiniMap") displayCtrl 101)];}
Then go ingame and wait
5 seconds and nothing is showing
Or wait
Had chat disabled
Its string
Same as when I used diag_log
I see new ones such as RscCustomInfoCrew, RscCutomInfoMiniMap etc etc
Yep
New one is RscCustomInfoMiniMap
Begs the question why bohemia dont delete their old code
Does that need to be changed somewhere on the wiki?
I've not seen any coverage on it anywhere on the wiki
kk
Btw is the updated CfgVehicles wiki page by you?
aah
Okey
So still doesnt work
Now it says no display
((uiNamespace getVariable "RscCustomInfoMiniMap") displayCtrl 13301)
Its really hard to know as well, since RscCustomInfoMiniMap.sqf has no code in it
Wait..
Ye, not working
(uiNamespace getVariable "RscCustomInfoMiniMap")
Is not even giving me any display
@rotund cypress Congrats. You found the DISPLAY typed nil .
However uiNamespace getVariable "RscCustomInfoSlingLoad" shows display
CONTROL*
What?
I know that lol
So if you feed it the command nil, it will report a nil with CONTROL type
Oki
That is how SQF is done. Value and type of a variable are independent, so you can have a nil for every type.
type being SCALAR, BOOL etc.
Ok so uiNamespace getVariable "RscCustomInfoSlingLoad" and uiNamespace getVariable "RscCustomInfoCrew" is returning displays but not RscCustomInfoMiniMap
Ye ok
uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull]
to avoid nil
But it would still mean that the display and the control are null
Yes I know 😃
Not every display can be retrieved with this method.
They have to use BIS_fnc_initDisplay or define the variable manually in a different way.
And not every display has a onLoad script
Well this is calling an empty onLoad script RscCustomInfoMiniMap
class RscCustomInfoMiniMap {
idd = 311;
scriptName = "RscCustomInfoMiniMap";
scriptPath = "IGUI";
onLoad = "[""onLoad"",_this,""RscCustomInfoMiniMap"",'IGUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')";
onUnload = "[""onUnload"",_this,""RscCustomInfoMiniMap"",'IGUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')";
This one does though, so no idea why it's not working.
yep
And in that initDisplay script it registers the display in uiNamespace
Soo
And it's quite weird that it shows the infocrew and infoslindload even thought those are not open
Ergo the display doesn't exist.
Maybe handled by engine?
Maybe it's a different display.
Don't think so
It would be a first.
Everything else is a dialog in config
But it would be majorly stupid if you can not modify it
RscCustomInfoSlingLoad is also empty
But it still returns display
And when I use createDialog "RscCustomInfoMiniMap" it works
Well, then you created the display and it didn't exist before. No surprise. That pretty much confirms what I said.
Gesundheit.
sorry
Haha
😛
But the RscCustomInfoMiniMap should be created when I open the miniMap
Or the GPS
There could be a different display / control that does the job than you're looking at.
Is there a keyhandler or something I could look at in the fileS?
Uhm.
But it would be most logical
Logic only can tell you if an expression is valid. Not if it's true.
🙃
getting all variables in uiNamespace does not work either for some reason
Okey apparently i can with parsingNamespace
Yes, some... have decided that allVariables is a security risk in MP
What are you trying to do? Drawing on the GPS works if you use RscCustomInfoMiniMap
It won't work with ui and mission namespace.
@native hemlock not returning any display
Not returning any display when running?
private _miniMapDisp = uiNamespace getVariable "RscCustomInfoMiniMap";
uiNamespace getVariable "RscCustomInfoMiniMap"; == no display
This is 1.70?
That's bizarre...
private _miniMapDisp = uiNamespace getVariable "RscCustomInfoMiniMap";
private _ctrl = _miniMapDisp displayCtrl 101;
_ctrl ctrlAddEventHandler ["Draw", {
_this select 0 drawIcon [
"iconStaticMG",
[1,0,0,1],
getPos player,
24,
24,
getDir player,
"Player Vehicle",
1,
0.03,
"TahomaB",
"right"
]
}];
That draws an icon correctly on the mini map for me
Have you modified that config class?
Yes I tested the code I pasted above just before I sent it.
Is there any reason: init="call{this addAction [""Gun Store"", {_null = [] call GunStore_Open}];}"; would only be executing on one player that selects it? As in when me and a friend were testing it out, I could scroll wheel and open it, but he could not. Any idea's? The code itself is all local.
That is straight from a units init field(from within the sqm file)
For one of my friends it works as well, so its really weird that it isnt for me
Okey after restart it works lol
Interesting, could you have accidentally used setVariable instead of getVariable, and set it to be displayNull?
It was nil, not null
Thats a big possibility, however I did not remember ever using setVariable during the time the game was open
That was RscMiniMap @little eagle
IIRC RscCustomInfoMiniMap was always null
Maybe you used createDisplay, which overwrote the variable with a new display and then closed it by pressing ESC...
I used createDialog, but yes also a possibility
Something along those lines.
Is there anyone who know of any "recommended" safezone macros?
is there any way to use handle disconnect whilst setting a profile namepsace variable without it being assigned to that player slot specifically? I've been having a weird issue that only saves the variable for that player slot only, I was led to believe it was saved in the player's profilenamespace exclusively. Here is my code: https://pastebin.com/Ncp40sUH
and then this is used at mission start: https://pastebin.com/BG8Ua8tq
having some issues with a script if anyone can help
basically in the init i have a script that generates a random location to populate with enemy vehicles
i have a task created to destroy those vehicles
but the way to succeed the task is via a trigger that i create over the random location
the trigger is supposed to detect when all vehicles in the AO are destroyed
but for some reason the trigger keeps activating even though the condition is not properly met
when i test via the debug console
it seems that it is unable to find the vehicle that is generated in the AO
despite it being there and visually being there
if i preplace a trigger and a vehicle/s with the same activation condition it seems to work
if (isServer) then
{
while {true} do
{
sleep 5;
if (waveClear) then {
_side = selectRandom ["opfor","indfor"];
_loc = [waveNum,_side] call spawnGround;
_taskName = "mission" + format ["%1", waveNum];
_taskDescription = "CAS Mission " + format ["%1", waveNum];
[west,_taskName,["Destroy all vehicles in the area",_taskDescription,"ao"],_loc,true,2,true,"destroy",false] call BIS_fnc_taskCreate;
[_taskName,"ASSIGNED",true] call BIS_fnc_taskSetState;
_trg = createTrigger ["EmptyDetector",_loc];
_trg setTriggerType "NONE";
_trg setTriggerType "NONE";
_trg setTriggerArea [200,200,0,false];
_trg setTriggerActivation ["ANY","PRESENT",false];
_statement1 = "((count (thisList select {alive _x && (_x isKindOf "+"Tank"+" || _x isKindOf "+"Car"+")})) isEqualTo 0);";
_statement2 = "if (isServer) then {_handler = ["+_taskName+",thisTrigger] execVM 'scripts\missionComplete.sqf';};";
_trg setTriggerStatements [_statement1,_statement2, ""];
waveClear = false;
}
}
}
if anyone has any idea please let me know
also it seems my trigger isn't getting the passed _taskName for some reason
in the _statement2 and setTriggerStatements part
there is no way to add playable units on the run right?
any shortcut functions to determine the direction of a runway?
when spawning my vehicle with crew, is it possible to let some of the crew positions stay empty by default?
Using createVehicleCrew?
thanks I'll read about it and do some testing
It was a question, because with that command you can only create the whole crew. No idea what other method you would be using atm if it's not createVehicleCrew.
ok
ok 😐
hi, i'm wondering if there's a way for the camera to track a character and follow him, so that for example, if he runs forward, the camera moves so that the distance from him to the camera stays the same
Considering there is a spectator mode that does exactly that I'd say yes.
okay, thanks 🙂
Im trying to create dialog right now but I dont know where I can get a defines.hpp from.
Anyone here has a defines.hpp to share with me? ^^
I'll PM you one
_check = _this select 1; //true or false
if (_check) then {
_spawn = ... ;
} else {
_spawn = ... ;
};
... _spawn... ;
why the last _spawn is undefiend variable? so private delaration in the first line is needed to use _spawn? 😬
yes, local variables cant be declared from a lower scope, only higher ones
Thanx cptnnick. 😅
there is a trick you could use if you wanted though.
private _spawn = if (_check) then {
[0,0,0]
} else {
[999,999,999]
};
Don't do that if you don't understand it. Both expressions are evaluated and if they have side effects your code is broken.
how can I get the current weapon if It's not connected to a turret?
currentWeapon seems to just work on turrets....
in a vehicle i'm pretty sure all weapons are connected to turrets (in the config)
hm, I have missilepods on the wings of a plane and no turret specified
weapons[]={"rockets_Skyfire"};
magazines[]={"38Rnd_80mm_rockets"};
it's not inside any turret
I have used currentWeaponTurret on a tank with a turret, and it works fine. Does not work here (since I dont have a turret?)
that might help you get the turret paths
I managed to get it just by using this:
_w = _this select 1;
_w is selected weapon. hmm didnt even need to use one of those curretWeapon functions
does someone have a solid way to have a script run at a reduced,. but fixed framerate (independant of the game framerate?)
CBA onEachFrame with delay != 0
_v = _this select 0;
_w = _this select 1;
_count = _v ammo _w;
hintSilent str _count;
_w returns "rockets_Skyfire", but _count is always 0....
this should be right, right?
I'm using magazines[]={"38Rnd_80mm_rockets"};
I keep getting "general exception in expression" on various "==" comparisons completely unrelated to the context. Does this appear if I try to compare apples with peas unrelated object?
Also my script doesn't even run anymore lol
I used _unit setVariable ["continue", true, true]; and try to retrieve amd check it with (_unit getVariable continue) isEqualTo true
So I can later cancel the while-loop by using <unitname> setVariable ["continue", false];
You have to use Quotes
(_unit getVariable "continue") isEqualTo true
around the var -> continue
so I guess setVariable sets a string of a private array bound to the unit (like PHP does everything) right?
idk how it works behind the screens, but you use a string is variable.
params ["_waveNum","_enemySide"];
...
...
if (_enemySide isEqualTo "opfor") then
{
It works again but canceling does not.
do you run it on a dedicated machine?
because when setting it true you set the public flag to true, when you set it to false you don't.
i'm calling the function from:
_eSide = selectRandom ["opfor","indfor"];
[waveNum,_eSide] call missionGen;
@spice arch I suggest you to debug it with diag_log
ok i'll give that a try
@distant egret no I don't run it on a dedicated machine.
No.
I am not exactly sure
I have a trigger with this: ```sqf
crewman2 setVariable ["continue", false, true];
crewman2 playAction "WalkF";
systemChat "entered";
k
I get printed "entered" but the previous animation continues.
I'll try with switchMove
wait it's playAction. Why?
It actually worked before when the animations didn't run.
Any errors when running that via the debug console?
Also I think someone said earlier that playAction didn't work properly in Arma3
So switchMove does indeed stop the animation, the unit however does not walk to the desired Waypoint
hey @distant egret
so I tried using diag_log
and the result has be puzzled
so from the init where I initialize the arguments
and then perfrom the call:
_eSide = selectRandom ["opfor","indfor"];
[waveNum,_eSide] call missionGen;
the diag_log returns properly:
[1,"opfor"]
but right after the params of the missionGen.sqf file
the diag_log also throws the error:
Error Undefined variable in expression: _enemyside
the missionGen starting lines look like this
params ["_waveNum","_enemySide"];
_args = [_waveNum,_enemySide];
diag_log _args;
why not use actual sides instead of strings ?
diag_log can log nil in arrays cant it? so thats a kinda wierd error
I hate "general exception in expression", it tells me nothing.
@cedar kindle I could try that, I'll give that a shot but it is very strange to me that the passed value is just lost
@cedar kindle just changed it, same problem except the first diag_log outputs
[1,EAST]
instead
the error really should be somewhere else
diag_log doesnt error when logging a nil value in an array
pastebin!
your error is elsewhere
or youre not in the right file
the error you pasted also doesnt have the S in enemySide capitalized as it is here
there is no _enemyside there either, only _enemySide
look at the capitalized letters
did you copy paste your error or write it out yourself?
copy paste
see the S isnt capitalized
i thought that was just the rpt doing its own capitalization
or lack thereof
scripts\missionGen.sqf, line 68
10:57:55 Error in expression <oc"];
_randLoc = [];
_args = [_waveNum,_enemySide];
diag_log _args;
_mapSize >
10:57:55 Error position: <_enemySide];
diag_log _args;
_mapSize >
10:57:55 Error Undefined variable in expression: _enemyside
oh i pasted the wrong section of the rpt, its a recurring error becuase of the loop in the init
the section for the diag_log is here
Error in expression <oc"];
_randLoc = [];
_args = [_waveNum,_enemySide];
diag_log _args;
_mapSize >
10:57:55 Error position: <_enemySide];
diag_log _args;
_mapSize >
10:57:55 Error Undefined variable in expression: _enemyside
10:57:55 scripts\missionGen.sqf, line 15
10:57:55 "TEST LINE"
cant figure it out, sorry.
it's all good thanks for trying m8!
my guess right now is that it has something to do with the fact that its a loop-ed call in the init
and maybe the machine like having a race condition because i didnt do a wait till null or something
Error Undefined variable in expression can only have one reason.
You execute the code in scheduled environment and tried to access a variable that is undefined.
_enemyside was nil and you used _enemyside
oh shit i forgot scheduled did care about that
ok hmm
thanks commy, i think the problem stems from the fact that i have a missionComplete.sqf being called from a trigger
race condition
with regards to scheduled vs unscheduled
scheduled basically means that the script has a 3ms limited run time before it gets paused for the next one
and unscheduled the script just keeps running?
are there any other differences besides that?
You cannot use suspension commands in unscheduled environment. (sleep, uiSleep, waitUntil).
canSuspend reports true in scheduled environment and false in unscheduled environment.
Scheduled code has serialization and it is enabled by default and can be disabled using disableSerialization.
When serialization is enabled, you cannot store DISPLAY and CONTROL values in variables directly.
oh, another question, can spawn/execVM cause race conditions within the scheduled envrionment?
You can indirectly by using arrays...
spawn and execVM do start pseudo threads, so using those presupposes the scheduled environment. No idea what you exactly mean by that question.
like say i have 3 execVM calls
the first two write to a variable X
the first says x=1
the second says x=2
and put those writes into an inf loop
the thrid execVM has an infinite loop that reads x and hints or outputs it
will the output randomly be 1/2?
I'd say yes. You at least have no guarantee which one x will be.
ah k, sorry to interrupt your previous explanation
Because the code can be suspended after every command obviously.
I was done explaining. That is all the differences I can think of.
No where. It's just basically saving a copy of all running scheduled scripts when saving a game. And then resuming the scripts when loading it.
And if you disable the serialization, the script will be gone when loading a save.
There is no real reason why you can't use CONTROL and DISPLAY inside variables in that environment by default. It's just that controls and displays don't survive when closing the game, so I guess this annoying error is to prevent you from borking up save games.
Which everyone does anyway.
Bad design. Too bad I was still in elementary in 1997 when this stuff was coded...
well we can only hope some of this stuff will be updated for arma 4/enfusion
Is there a way to compile a String containing a Function with Macros to code ?
No, you can only preprocess from files, not strings.
BI couldn't allow that. Because then you could just crash the game for everyone
You can do that regardless.
@jade abyss OBE is obfuscated? Really? Wanted to find out how you do the window breaking and now I have to deobfuscate that pbo first?
intersect
is there anyway to dark the images when using setobjecttexture. they are coming in many shades lighter on vehicles
i've tried images and rgba color selector
lift off, we have lift off ... https://youtu.be/Ebp8-MUwRbI
😁
hey guys
back for another round of why is my variable undefined
error code:
16:05:50 Error in expression <dLoc, -1, objNull];
guardArray pushBack _gp1;
guardArray pushBack _gp2;
_randLo>
16:05:50 Error position: <_gp1;
guardArray pushBack _gp2;
_randLo>
16:05:50 Error Undefined variable in expression: _gp1
my code in the script:
_gp1 = createGuardedPoint [east, _randLoc, -1, objNull];
_gp2 = createGuardedPoint [resistance, _randLoc, -1, objNull];
guardArray pushBack _gp1;
guardArray pushBack _gp2;
check the line before where you define _gp1 😃
hmm this is what i have before it
_trg = createTrigger ["EmptyDetector",_randLoc];
_trg setTriggerType "NONE";
_trg setTriggerType "NONE";
_trg setTriggerArea [200,200,0,false];
_trg setTriggerTimeout [3,7,5,false];
_trg setTriggerActivation ["ANY","PRESENT",false];
_trg setTriggerStatements ["(count (thisList select {alive _x && _x iskindOf ""LandVehicle""}) isEqualTo 0)",
"waveClear = true; publicVariable ""waveClear""; waveNum = waveNum+1; publicVariable ""waveNum""; ",
""];
waveClear = false;
publicVariable "waveClear";
trg = _trg;
_gp1 = createGuardedPoint [east, _randLoc, -1, objNull];
_gp2 = createGuardedPoint [resistance, _randLoc, -1, objNull];
guardArray pushBack _gp1;
guardArray pushBack _gp2;
guardArray is a public variable defind in the init.sqf
_randLoc is something that is position generated in this script earlier
hm
i guess i can do a workaround
via create trigger
and then setTriggerType
but its odd
the documentation for setTriggerType says - use createdGuardedPoint instead
createGuardedPoint seems completely unrelated to triggers
only uses the GUARD waypoint
am i misreading the documentation? it seems to imply that a guarded point is a trigger with the "guarded by" type
and the guard waypoint is for the unit/group
If I wanted a client to ask another client to execute a script, without it having to interact with the server, what would be the best way to do it? Is this even possible without CBA?
For example, an infantry client tells a tank-gunner client to spawn a marker at a position.
Would the best way be to use clientOwner to store client(s), send this data to each player on mission start, then simply use that number to remoteExec? (https://community.bistudio.com/wiki/clientOwner)
Anyone in here would like some freelance work scripting a few gas grenades for me?
@frank mesa #creators_recruiting
@tough abyss remoteExec
you can pass player objects into there
for example driver (vehicle player)
You can? So if I name a unit bob_1, I can use bob_1 to remoteExec?
👍
If so, the wiki needs to be updated. "Object - the function will be executed only where unit is local"
That makes things significantly simpler though. Thanks guys. Wow, I was about to write a whole headache of minimal package sharing
a player is only local for the player
AI can be local at many places. But a human occupied unit is ... almost always local to the human
I figured a unit variable would be local to the server. Good to know, though, that answers a lot of other potential questions.
How do I go about applying hidden textures to stuff like weapons? Some weapons have hidden selections but im not sure how to apply them. Would I just access the associated config value and setObjectTexture with that?
You cant
if it has hidden selections, you can with a mod (but not script)
just need to overwrite hiddenSelectionsTextures[] =
@vapid frigate Hmm okay, thought it might be possibly in vanilla but all good
speed ?
How do I send the client's unit to the server? 'player' is always local, so attempting to send that to the server has the server just refer to itself.
Ex., the client remoteExecs a function that asks the server to move the client's unit
Send the player object as an argument
I do, but on whichever machine the code is executed, 'player' is replaced with that machine. I want to send the actual client's unit as a variable
Maybe I gave a poor example
player remoteExec ["hint", 0]; This being 'requested' to be ran by the client.
ex, I'd want that hint to say the client's name. Instead it says the host's name, as it's being executed on the host,, so player == host
too little arguments if you want to hint the client's name
How would I send the client's name?
just like if you were to grab a name in any other context. (name player)
[(name player)] remoteExec["hint",player,false];
Oh, duh. Then I can just use the name to refer to the client's unit.
doubt that works, going to try it now. one sec
It does, just ran it
what? (name player) or [(name player)] remoteExec["hint",player,false]; ?
[name player] remoteExec ["hint", player];
make sure to disable jip
Just debug consoling to make it sure it works atm.
well unless this is just on a need to know basis
Thanks, can't believe I didn't think to send the name.
Yep.
Anyone know how to go from spectator camera to zeus? I'm trying to make it so that our dead admins can switch into the zeus interface. I've tried just calling openCuratorInterface, but that just crashes the game.
Ah, that solution won't work @subtle ore . It's the unit itself I'm trying to send, and while I can send their name in singleplayer (if I name the unit "bob" in editor, itll send bob), in multiplayer it sends their profile name, which I cannot use to find the unit.
if you use the player command as an argument it should send the object variable, not the player command itself, so that should resolve
When using remoteExec, that doesn't work.
If a client executes (say via addAction):
player remoteExec ["fnc_killMe", 0];
player is local to whoever is actually executing the script. So since the server is running fnc_killMe, player == server, not the client that sent the request.
Whats wrong with this? ```sqf
(group crewman2) setCurrentWaypoint 1;
you need to pass it the group at the end.
(group crewman2) setCurrentWAypoint [(group crewman2), 1];
@icy mauve *
So I need to set it twice?
Evidently so.
So I am able to set unit a the waypoint 1 from unit b?
I'm not sure what you mean
I have Unit A in Group A, and Unit B in Group B. And if I want to I could send Unit A to the Waypoint of Unit B right?
I mean, I'm not trying to do that, just wondering.
I don't know, you'd have to test that, but it looks like that might be possible.
My Snippet unfortunately doesn't work anymore.
I have a very weird issue
bomb addEventHandler ["hit", "call bomb_fnc_bombHit"];```
this just doesn't do anything anymore, calling the function per debug console works just fine
How could I get an object out of a string such as '983c100# 1121956: i_house_big_02_v1_f.p3d'? call compile doesnt seem to work
Solved my issue @indigo snow @subtle ore incase you want to know.
Storing "player" as a value stores the unit, not the locality. So
_client = player;
_client remoteExec ["hint", 0];
displays "Bob" (client unit's editor name)
Weird that I couldn't find this issue online anywhere, figured this would be a pretty commonly used MP scripting issue
How could I get an object out of a string such as '983c100# 1121956: i_house_big_02_v1_f.p3d'? call compile doesnt seem to work
Can't
somehow it seems that eventhandlers are broken
my eventhandler just doesn't get called anymore at all
eventhandlers aren't broken, if its not getting called there is something wrong with your code
yeah the issue was somewhere else, hit wasn't firing because I was firing a 9mm gun at a water tank
I have a different issue though
I use setVehiclePosition iterating over all entities at the start of my mission
but it's only sporadically working
all AI units will be teleported with that, but every player just gets teleported to the position of their vehicle and starts outside of it
even so setVehiclePosition seems only to trigger after the mission has been started from the briefing
the issue is only present on dedicated servers, not on self hosted ones
@ionic hemlock hit doesn't fire for really small objects, or similar
Figured that out already
post code for your tp script
idgi what you mean with "the position of their vehicles and outside of it"
what do you expect to happen?
I expect all units to be around the point I set via setVehiclePosition and not next to their vehicles they are assigned to
Generally the issue is that it doesn't work for ai units during briefing, only afterwards everyone gets teleported (or not)
// move all vehicles
{
_x allowDamage false;
if(side _x == west) then {
_x setVehiclePosition [[(bluStartLoc select 0)+(([1,-1] select ((_forEachIndex+1) % 2))*(1+(3*_forEachIndex))), (bluStartLoc select 1), (bluStartLoc select 2)], [], 0, "NONE"];
};
if(side _x == east) then {
_x setVehiclePosition [[(opfStartLoc select 0)+(([1,-1] select ((_forEachIndex+1) % 2))*(1+(3*_forEachIndex))), (opfStartLoc select 1), (opfStartLoc select 2)], [], 0, "NONE"];
};
_x allowDamage true;
} foreach vehicles;
// move all AI units
{
_position = [0,0,0];
_x allowDamage false;
if(side _x == east || _x == opfor_scientist) then {
_position = [(opfStartLoc select 0) + random 5, (opfStartLoc select 1) + 10 + random 5, (opfStartLoc select 2) + random 5];
} else {
_position = [(bluStartLoc select 0) + random 5, (bluStartLoc select 1) + random 5, (bluStartLoc select 2) + random 5];
};
if (_x == opfor_scientist || _x == blufor_scientist) then {
_x setVariable ["scientist", true, true];
};
_x setVariable ["orgPos", getPos _x, true];
_x setVehiclePosition [_position, [], 0, "NONE"];
[_x, [_position, [], 0, "NONE"]] remoteExec ["setVehiclePosition", _x, false];
_x disableAI "MOVE";
_x allowDamage true;
} foreach entities [["CAManBase"], [], true, false];```
I ran into the issue that it doesn't work consistently and that it doesn't work on AI slotted units during briefing
iirc none of my units that is not a player is getting moved during briefing, I use setVehiclePosition for other entities during PostInit as well
debugging-wise I saw them teleported once the briefing was over
the same script works just fine when I am the hosting server, this postInit script is running on the server only
your script will error out if opfor/blufor scientist slots aren't taken
those variables will be nil
disregard that
use _x == missionNamespace getVariable ["opfor_scientist", objNull]
the remoteExec is not needed
that might be
it was for testing purposes
the script logs no errors into the rpt and I don't see any on screen running it
this runs where ?
on a dedicated server
again, the main issue is that the units are not getting teleported before/during the briefing
speaking mostly of AI slotted units
@cedar kindle http://imgur.com/a/BKGgd
that's like my main issue
is there any way to work with simlinks? So to say my scripts are on a different location then my mission. Just local for testing and such
this is actual a good question, But i suggest you to leave it in the mission folder itself you only will get mad about a diffrent location than the mission folder.
Should work.
@gray thistle ah nope 😄 Thats the thing I not want to do. But I'll guess it will work if I just clone the stuff over Github and do my edits on my original mission. I just don't want to have several versions of a file somewhere on my SSD. Just one file I need to edit and everything else is on the same version
alltough the solution is not the best because I need to sync everytime I made a change
i see ^^
anyone know whether the BIF supports inline code? Like single backtick vs triple backticks
I tried it once with a simlink and a sample sqf file but mr. 3DEN was like nope, sqf not found
but it works with Mods 😄
like A3 Dev: mklink /D "F:\SteamLibrary\steamapps\common\Arma 3 [development]\@VM" "F:\SteamLibrary\steamapps\common\Arma 3\"
Why not do the same with the unpacked MissionFolder?!
Then... you did something terribly wrong
hmmmm okay I try it again
sometimes i just amaze myself... i am getting things done like syncing databases with a third party tool but i am thinking about how to get an addaction for players permanent (after death)<.<
like an action on a dead body?
na more like an add action after respawn thinking about the eventhandler respawn
ah
Somewhere a player should be abel to save for their selfs 😄
yeah just re-add it during whatever is being ran on respawn ^^
will take its time i juste learned yet about remoteexeccall
i think the object persistance would be easier to do than the player persistance with all the local and server stuff ^^
mklink /D is for directories not files
hey guys
been poking around with the new jets
it seems that the data link stuff is all config based
so I have ran into a problem where if I turn on the data link via the editor
if the vehicle respawns
it loses that setting
i cannot seem to find any scripting commands that allow me to turn the data link stuff back on
is there any way for me to modify the config for the respawned vehicle?
oh wait nvm
i am just bad at searching the scripting commands
for reference if anyone else needs it
@gray thistle CBA_fnc_addPlayerAction
Is BIS_fnc_manageCuratorAddons local or global?
it doesn't seem to work for clients on dedicated server when called from the initServer.sqf
RemoteExec with JIP to true? @nocturne iron
Never used that function but RE might be what you're loking for
I'll give it a look
Also
["sg_singleclick_west","MapSingleClick",{vblue_z_lastCamJump = _this select 1;publicVariable "vblue_z_lastCamJump";hint "thx"}] call BIS_fnc_addStackedEventHandler;
``` any clue why this isn't hinting 'thx; when I click on the map?
it's being called from initPlayerLocal.sqf if that helps
don't think you need a stacked event handler for that? try addMissionEventHandler ["MapSingleClick", {vblue_z_lastCamJump = _this select 1;publicVariable "vblue_z_lastCamJump";hint "thx"}]
Can someone point out what I've done wrong here
It's supposed to kick you out of a chopper if you're not wearing the right gear. I get the hint, but it doesn't eject me?
_veh addEventHandler [ "GetIn", {
_unit = _this select 2;
If ( uniform _unit != "U_B_HeliPilotCoveralls" || headgear _unit != "H_PilotHelmetHeli_B" ) exitwith {
_unit action ["Eject", vehicle _unit];
Hint "You need your flight gear to fly.";
};
}];```
@vapid frigate thanks, that worked
@leaden summit have you tried moveOut?
I haven't, I didn't see that in the action list on the wiki. I'll give it a shot
Yeah pretty sure I've tried getout
would player still work in MP ?
well if hint works only for the player, I think player should work. but I may be wrong.
Cool, moveOut works just fine thanks. Strange that the eject action didn't though.
maybe because action is local and moveOut is global?
More than likely. Usually when I've messed something up 95% of the time it's a locality issue
@nocturne iron I like defines.hpp you send me but its not a total complete one ._. . Do you know where I can get a complete one? Or does anybody know?
what classes in particular are you looking for?
you could also de-pbo'ing something like warfare
actually I might send that through to you
Yesterday I made a working dialog. Now I started a project using a dialog and I cant get it to work
It always tells me resource not found.
while I have this in my description.ext:
#include defines.hpp
#include weaponshop/gui.hpp
and this in the gui.hpp:
class weaponshop_dialog
{
idd = 5000;
movingEnable = false;
enableSimulation = true;
class controlsBackground {
class background: RscText
{
idc = 1000;
text = "";
x = 0.3425 * safezoneW + safezoneX;
y = 0.318 * safezoneH + safezoneY;
w = 0.301875 * safezoneW;
h = 0.28 * safezoneH;
colorText[] = {0,0,0,1};
colorBackground[] = {0,0,0,1};
colorActive[] = {0,0,0,1};
};
};
class controls {
class list: RscCombo
{
idc = 2100;
text = "List";
x = 0.381875 * safezoneW + safezoneX;
y = 0.332 * safezoneH + safezoneY;
w = 0.18375 * safezoneW;
h = 0.028 * safezoneH;
colorText[] = {1,1,1,1};
colorBackground[] = {0,0,0.25,1};
colorActive[] = {0,0,0,1};
};
class buy: RscButtonMenu
{
idc = 2400;
text = "Buy";
x = 0.585312 * safezoneW + safezoneX;
y = 0.332 * safezoneH + safezoneY;
w = 0.0525 * safezoneW;
h = 0.07 * safezoneH;
colorText[] = {1,1,1,1};
colorBackground[] = {0,0.25,0,1};
colorActive[] = {0,0,0,1};
};
class cancel: RscButtonMenuCancel
{
x = 0.585312 * safezoneW + safezoneX;
y = 0.43 * safezoneH + safezoneY;
w = 0.0525 * safezoneW;
h = 0.07 * safezoneH;
colorText[] = {1,1,1,1};
colorBackground[] = {0.25,0,0,1};
colorActive[] = {0,0,0,1};
};
};
};
@delicate lotus can you paste the script you use to open it
?
(or the line)
should just be
createDialog "weaponshop_dialog";```
yeah but nothing happens
and In editor it tells me after going back from the preview that preprocessor failed file not found or empty
Î think I found out what I did wrong
maybe
yeah I forgot some ""
okay now I have another issue
how can I get the icon of a weapon to be used in a dialog?
I know how to get the displayName
but not the icon
okay nevermind
I found a wonderful online config browser which showd me the way to the picture
now I have another issue
the picture which I get is kinda to small
How could one remove the "activate mine" from the commanding menu? Ever since last arma patch when you drop a slammine, and scroll over it, you'd get that option.. :\
For the life of me I can't figure out how to stop a certain Animation and make the AI move to a god damn waypoint.
_unit switchMove "" should kill whatever animation the unit is in
@halcyon crypt it does, but I can't make the Unit walk to the Waypoint.
In the Wiki for "addWaypoint" it says:
In game versions prior to Arma 3 v1.22: If you add a waypoint to your group and then want them to start moving to that waypoint, make sure to call setWaypointType "MOVE" on your waypoint.
Does it maybe still apply although said otherwise? I tried creating a waypoint and "setCurrentWaypoint" and "addWaypoint". But the Unit never moves.
no clue to be honest
seems more like that you somehow disable unit movement all together
Oh my fucking god, yes I did.
It says "disableAI Move" in the init
I am probably the stupid person on this planet.
Yep.
When I wrote the above question I thought like "damn, asking the real questions on my way to my pro-scripting-carreer" lmao
Still doesn't go to the damn Waypoint.
it.... may.... be...
So he walked somewhere, but I don't think his goal is the Waypoint
he just stopped randomly
it finally works
Oh really? Barely and of the Briefing Animations work.
["Acts_HUBABriefing", "HubBriefing_lookAround1", "HubBriefing_lookAround2", "HubBriefing_loop", "HubBriefing_pointLeft", "HubBriefing_scratch", "HubBriefing_talkAround", "HubBriefing_think"]
@delicate lotus make sure your text size isn't being multiplied by anything in the default class
GUI editor outputs text size about 40x too large and text boxes can appear missing because of that
the ai group ownership tool is coming along. you can individually push each ai group to be controlled by a desired client or headless client. or press a button that evenly distributes the ai to all clients. even got a button that shows you server fps. testing with 200 ai spawned on the server and myself as a client, server fps goes from 20-25 up to 45-50 when I hit the distribute button. I guess it's because the server and client run on seperate threads/cpus.
@tough abyss this is a project you are working on?
yeah. I'll add a thing here and there every once in a while
That's pretty cool
Would the setHit command be an accurate way of determining how much damage to a certain body part would kill the player? Im trying to confirm how much damage to certain parts (ie, head, face_hub, body etc) actuallyy kills the player, as im reading some people say for some parts its 0.9, whereas ive also seen it as 1 or above.
I feel like Arma has 1001 various functions to do all kinds of stuff but nothing I want is working properly.
- I need an Animation for a Ground Crew to tell a Helicopter to take off, didn't find one yet.
- I need a player to play a Briefing Animation (animations don't work)
- I need a player to play "Acts_TerminalOpen" to the Player opens the Terminal and....
- I need to make a UAV (RHS: AFRF) to become a BluFor one.
I have no idea how to do any of those and nothing works.
I can't even use "animationNames" to find out which Animation possibly opens the Terminal or which animation to use animate.
I don't even get where "diag_log" puts stuff, the Wiki just doesn't tell.
RPT
Wiki just doesn't tell. WTF dude? Dumps the argument's value to the report file. and report file is a link that tells you everything about it
Link report_file: Location: See "Crash_Files" => Crash Files: Visit: "%userprofile%\AppData\Local\Arma 3" Nothing there that contains anything useful. Only File dated today ends more than 2 hours ago where I had a crash during startup. @still forum
do you launch arma with -noLogs ?
@still forum Nope, logs are enabled.
there should be an rpt file in there
very rare for it to have 10 mins without something in there for me
If you have -noLogs then there indeed might be no rpt in there. But otherwise there is always one
its not there if you specify a profile folder, then its most likly there
Does anyone have a script for waypoints to have transport planes drop AI paratroopers, and the another script for a second waypoint to despawn the plane? I am looking to have a AI c47 drop AI paratroopers in a mission I am making (ifa3 lite)
@vague hull Where exactly would it be?
copyToClipboard doesn't help as well.
...
What is wrong with this?
anims = animationNames player;
diag_log anims;```
I get exactly nothing.
Or in it's other version:
anims = animationNames player;
copyToClipboard (toString anims);```
Neither do I get anything when replacing player with dataterm, a Data-Terminal
animationnames command is for vehicle animations not man animations
to string takes an array of numbers. not an array of strings
have you found the 'animations' button under the debug console?
that's the easiest place i know of to find human anims
(not that it's particularly easy still)
@young current might have worked anyways, I need the animation for an Object as well.
nvm
@nocturne iron well the problem is that the picture is too small. Text has perfect size thou
Can anyone advise if enableDynamicSimulation has to be executed globally or if just server is sufficient?
I'm gonna guess that dynamic simulation runs on the server anyway
so server should be sufficient
https://community.bistudio.com/wiki/Arma_3_Dynamic_Simulation#Script_commands
Each client have it's own dynamic simulation manager, all script commands do affect the local simulation manager.
there you go
not just server 😛
or is it
wtf
weird docs
testing it is then... XD
could anyone explain me why fullCrew [cursorObject, "", true]; returns a driver on static weapons
i mean it would be kinda nice if that command would return the actual seats. I know that's asking for a lot
is there a way to trigger a action on the press of a key ?
yeah, keydown event handler
k
@delicate lotus either retrurn the id of your wanted key, or use : https://community.bistudio.com/wiki/DIK_KeyCodes
@cobalt vine i remember one of the blues saying enableDynamicSimulation only had to be executed once
looked through my post history, cant seem to find it
Once as in on one client/server? Or once as in once and then don't execute again. My application is a more dynamic version of the dynamic simulation with LOS checks
http://imgur.com/a/iLhBK , this is what is retruned by the command side on a param passed unit, I have no idea what the hell is going on with this one
^ disregard above, it was a remote unit.
Is there a way to count how many players are assigned to a shared Task (from the 2016 task overhaul system)?
Addtionally, would would arguably be more effecient performance wise: sending 10~ string variables with a remoteExec, or sending 10 separate remoteExec requests?
1 remoteExec
this is the ai balancer I've worked on some https://puu.sh/wcUPO/ba88e877b9.jpg
@tough abyss nice, cant wait till you release it?
distributes AI ownership among clients and server, i believe
i've found the same thing (even zeus-placed units can slow things down if we don't send them to the server or HC).. but uploads on home connections are slow here in australia
@vapid frigate off topic, but are there any other aussie films like Chopper? i tried romper stomper and it was awful
lol
i can sorta barely remember the chopper movie.. there's lots of australian movies, but i don't watch a lot of movies in general. i don't think there's many people like chopper reid though
man it's one of the best films ever, absolute classic. straya needs to step up and make more films in that vein
Any idea why adding weapons to a vehicle, for example in my case a Caesar plane through '_vehicle addWeapon "M134_minigun"' no longer shows the ammo display in the top right? Since last update? Not sure if theres a way to fix this
Anyone able to send me an example of stepping through a for loop inside a while loop, assuming that's possible? Trying to do so, but running into situation where the for loop always ends early, then the script starts the while loop again
depends what you want to do.. if your loop is ending early maybe you're using (for example) _i for both loops
simplest example is ```SQF
while {true} do {
for "_i" from 0 to _count-1 do {
};
};
Hey, im trying to figure out what the syntax is for adding an action to a GUI button. From what i understand he wiki says that is should be like this action = "this spawn mld_fnc_spawnPlayer;"; But this didn't work. How would you go about spawning a command from button press?
What would be the best way to stop people from closing a dialog by pressing esc, but still allow them to open the pause menu?
Not rly possible, afaik.
You can disable specific Buttons in a particular Display, but thats it.
@limpid pewter The most viable workaround to that issue would be through the use of a loop and waitUntil and just re-opening the dialog.
yeah seen that done on spectator dialogs.. sorta situation dependent though
@warm gorge Yeah, i have tried something similar, i had an event handler for the dialog, that would re create the menu when the dialog was closed by pressing esc. noEsc =(findDisplay 12034) displayAddEventHandler ["Destroy", { hint "Please Don't Press the ESC Key"; sleep (0.5); call mld_fnc_createSpawnMenu; }];
if you just want to prevent pressing it you can add a onkeyup event handler and return false if the key is ESC
but it can be annoying not being able to get to the pause menu
@vapid frigate Yeah i want to avoid that
@limpid pewter you could do what you have with a bit bigger sleep and then pressing ESC twice would open the menu
Is there any way to connect a OPFOR (Russian Pchela from RHS) to a BLUFOR UAV Terminal?
I think I found an error in the wiki but since I'm quite new to this, I maybe want to verify it.
I used: sqf _drone = [[14214, 16288, 0.1], 233, "rhs_pchela1t_vvs", "west"] call BIS_fnc_spawnVehicle;
and it resulted in: http://i.imgur.com/uC6H05W.jpg
Replacing "west" with "group player" (or similar) fixed this.
can you post the code that defines the param's variables
maybe you haven't selected the right index from array?
just a thought
There are no variables in the params.
oohhh nvm, i should have read that it was a bis function
Is it working properly at all?
Because the selected Vehicle doesn't spawn at the location. I don't know where it spawns at all.
if you don't know wether it spawns at all just write into debugg systemChat str(_drone); as a testing thing (remeber that _drone is a local var)
It does, since I selected my own group, I get 2 new people in my group where it says "inside drone" for both.
However, I don't know where any of them are as well.
where the drones are? or the players?
Both
just do a system chat again and but say systemChat str([getPos player, getPos drone]);
or something
but as to your orignial question "Is there any way to connect a OPFOR (Russian Pchela from RHS) to a BLUFOR UAV Terminal". Im not sure, but you could create a script that would switch player to drones camera view, then a script that adds a bunch of display 46 event handlers that would each trigger some code that would control various thing about the drone (pos, velocity, dir, etc..).
This is very clunky, but i might work 😛 idk
display 46 keydown EHs i meant to say, so that when the player keydowns the usual flight control buttons it would control the attributes of the drone
Before: http://i.imgur.com/cFYEUh3.jpg
After: http://i.imgur.com/FPLA1OE.jpg
The script replaces the drone.
before and after the original code you posted?_drone = [[14214, 16288, 0.1], 233, "rhs_pchela1t_vvs", "west"] call BIS_fnc_spawnVehicle;
is that what you meant by before and after?
No. That is only a part of the code.
This is the complete part sqf deleteVehicle ru_drone_old; _drone = [[14214, 16288, 0.1], 233, "rhs_pchela1t_vvs", group _unit] call BIS_fnc_spawnVehicle; _newdrone = _drone select 0; _unit connectTerminalToUAV _newdrone; systemChat str([getPos player, getPos _newdrone]);
k
so are you still trying to find how it spawns? or are you trying to find out why you can't connect to it?
how = where * sorry
okay, adding the chat message and the UAV Feed, it spawns in a height of 50m and crashing ~4 seconds after spawning.
_unit is at the moment it's own group as it's a test unit.
But in the scenario it will be the person using an action in the action-menu.
But why does it spawn in a height of 50 meters instead of the given 0 or 1?
yeah idk aye, you has see it to spawn at 0.1 m yeah?
maybe the Postition format is not AGLS for this function idk
Yes, that was one of the tests
no real need to use the bis function, you could just use createVehicle
at this point i woul suggest some serious trial and error XD
what lecks said
but not unless it doesn't fit your scenario
@vapid frigate I need to set the SIde as I'm trying to spawn a OPFOR Drone.
_newDrone = "rhs_pchela1t_vvs" createVehicle [14214, 16288, 0.1];
only groups have sides, and only units have groups
well vehicles do have sides.. but it's in their configs which you can't edit with script
But I need to grant a BLUFOR-UAV-Operator access to the OPFOR-Drone
edit the configs sounds like the way to go
no idea about that tho.
ok, wait 1 sec will get wiki link
And it would be awesome to enable the drone being blufor via script, not initially.
does that 'connectTerminalToUAV' work?
if it doesn't, i imagine it won't really be possible
It doesn't work no, but I may have found another option, lemme check.
if you find it impossible how bout my previous shitty solutioons "but as to your orignial question "Is there any way to connect a OPFOR (Russian Pchela from RHS) to a BLUFOR UAV Terminal". Im not sure, but you could create a script that would switch player to drones camera view, then a script that adds a bunch of display 46 event handlers that would each trigger some code that would control various thing about the drone (pos, velocity, dir, etc..).
This is very clunky, but i might work 😛 idk
display 46 keydown EHs i meant to say, so that when the player keydowns the usual flight control buttons it would control the attributes of the drone" haha
actually can you just give them the other terminal?
give the unit an opfor terminal
that won't workl
it will check the side of that unit, if you give CSAT terminal to NATO unit will not work
atleast last time i tried
Okay "moveInDriver" doesn't work either, too bad.
when you go up to that drone there's an option to 'hack UAV'
which lets you take it over
@icy mauve lol no that won't work haha
@vapid frigate ahhh maybe there is a function/command to do that in a script
I don't want the "Hack UAV" thing. I want fancy animations and stuff.
quick google search: https://www.youtube.com/watch?v=HCaTHv-qNTM
player setUnitTrait ["UAVHacker",true];
yeah maybe you could do it all behind the scenes by using a command, or selecting that action from the action menu( again behind the scenes)
UAVHacker true enables the unit to hack uavs, but it doesn't hack the uav itself so you have to do it again.
wait wait wait
k
lol ok
Yeah sorry man, i don't have a solution atm. im intrested in the issue tho, i will probably do some more reasearch tommorow.
if i add two addActions to initPlayerLocal.sqf it should show right? Debug console seems to run (show my actions just fine) but execVM decides not to work
show code
player addAction ["Move", {[cursorObject] spawn MoveMent;}, nil, 6, false, false, "", "true"];
MoveMent one of your functions?
add it to what execvm? you shouldn't need to execVM anything for addactions in initPlayerLocal.sqf