#arma3_scripting
1 messages ยท Page 260 of 1
You can just use the rotation matrix @tough abyss
new stuff
b:OBJECT triggerdynamicsimulation BOOL
b:STRING setdynamicsimulationdistancemult SCALAR
u:cantriggerdynamicsimulation OBJECT
u:dynamicsimulationdistancemult STRING
u:selectmax ARRAY
u:selectmin ARRAY
Mhm, is there a way to point player's camera toward a certain point?
It seems lookAt doesn't work in this case.
I enforced first person view with 'this switchCamera "Gunner";', but I think it's still about the camera...
If you just want direction, you can do this setdir (this getdir target)
And if I want Z axis as well, I need to mess with a cursor target?(
Uh-oh, apparently I need to do a "cut-scene" with cameraEffect and camSetTarget...
@tribal crane so easy with that, dont? http://imgur.com/sPfgDDi
@dusk sage i find matrix to be more complicated, i better understand polar/Spherical coordinates method. But i may also do some aprocimated method since all those are a bit heavy calculation. Just will know after some test.
It would probably be quicker and simpler to make a little equation for the rotation matrix, but whatever you find easier is best ๐
Donnovan: Yeap, that's it.
Converting to spherical in something like this, just shouldn't happen ๐
The rotation matrix for an arbitrary axis is quite big IIRC.
That's odd. I can use switchCamera on a player, but I can't access his camera to manipulate or place a created camera on it's position. >_>
That's not fair! =_=
For creating vehicles, is it possible to have multiplie turrets? and have a turret you can control from a console with also manual control so you can walk up to the gun and use it?
attachto
Oh, is there any preset with local coordinates for attaching camera to character's head as if it's first person camera?
Can't you get the bone/whatever the model joints are? I believe the head is "pilot"
#arma3_model @grand cargo
Well, @grand cargo, the problem here is the fact that I still need to give coordinates in _cam attachTo [_shooter, [0, 0, 0], "Head"];.
Hey, is the pushback command global if i use it in a script ? so i can call my variable from all connected clients ?
i do not know what I'm talking about sorry
@dim owl no pushBack isn't synced between clients
do you know how i can sync it ? ^^
some context would be nice
so i hav a global variable test = []; test pushback [name player]; and i want to pushback my name into it on all connected clients and all clients who join later
I'm sure there's a better way to do whatever you're trying to do but that at least works ๐
or maybe a function and remoteexecute it on anyone ?
it will overwrite test on all the other clients though
i will give it a try
Anyone care about dynamic weather here?
I want to see it done right someday...
@dim owl publicVariable is the most efficient method
@random glen http://www.armaholic.com/page.php?id=30520
That was my weather script
It wasn't formally finished
The newest versions got better code partitioning
But were never released
Newest version had getters and setters
how can i check if a player/ai get a variable and then exit the script ?
my try:
test = [];
unit1 setVariable ["myVar",20,true];
test pushback [unit1]; //unit1 is the var name in editor
test pushback [player];
{
if ((_x getVariable "myVar") isEqualTo 20) exitWith {hint "test test test";};
}foreach test;
i want to use this later for a whole faction check
Does it work? Already? @dim owl
No and i ask me why ? xD
because
test pushBack [player] or test pushBack [unit1]
results in a double nested array
so test = [[player],[unit1]];
then you try looking using for each
which will return the double nested player array
and setVariable only works on objects and certain name spaces
If you wanted to get the index
you do this
test = [];
unit1 setVariable ["myVar",20,true];
test pushback [unit1]; //unit1 is the var name in editor
test pushback [player];
{
if (((_x select 0) getVariable "myVar") isEqualTo 20) exitWith {hint "test test test";};
}foreach test;
okay
```sqf
//Code
```
Apologies @dusk sage
๐
test = [];
unit1 setVariable ["myVar",20,true];
test pushback [unit1]; //unit1 is the var name in editor
test pushback [player];
{
if (((_x select 0) getVariable "myVar") isEqualTo 20) exitWith {hint "test test test";};
}foreach test;
Or for sake of good practice, just get rid of those square brackets ๐
^
syntax error
Liner number?
Also unit1 setVariable ["myVar",20,true];
is setting the variable only for unit1
would also be needed
the unit1 is also it's own name space
it worked thank you very much!
As I said make sure you use setVariable on the player as well
because the (_x select 0) getVariable "myVar";
namespace o.o?
will return nil
Just an object
Many people would tell you it's part of an 'object namespace'
But the object itself is defined in the mission NS
As for actually answering the question, that would boil down to what a name space is, and what it does
I doubt it'll tick the same boxes though ๐
So are the values for objects
actually stored on the objects?
and they can't be accessed by missionNameSpace ?
Named objects can be accessed from the MNS
The variable you set with setVariable is local to your client, unless broadcasted, yeh
ah k
So thats why people use modules
or GameLogics to store states server-side
and use setVariable of them
getDir return ZERO when the player have the direction of axis y?
@tough abyss yes
Unlike real math, for arma Y = cos X = sin
@spark phoenix thankyou.
@spark phoenix this affect the result of atan and acos?
atan 30 in Arma is the same as atan 30 in Math?
OH.. i feel silly.
for sure is....
My transformation from [x,y,z] to spheric cordinates and then to [x,y,z] again is not returning the same values.
What equations are you using in your transformation
If it's not returning as you'd expect, you've probably done something wrong
Arma Azimuth is from y axis. so 0 in Arma is 90 in Math.
But only if you use a function like setDir or getDir
Azimuth is usually taken from north
Which in this case would be your y axis
There is nothing different about it
Think of it as a bearing, if that's any easier to picture
When i get the two angles of spherical coordinates, i sum 360 to it.
Because i need to compare it to other 2 angles.
To see if they are in a near direction.
Azimuth and altitude
Comparing to*
The angles of Spherical coordinates
I find Azimuth and Altitude for objects arround the player
I mean, you're comparing them to 2 other angles
Which are?
The angles calculated for the objects?
and i compare the azimuth and Altitude of one object with the Azimuth and Altitude of other objects
To see if they are in the same or in a near direction.
Why are you using spherical for this?
To this comparison be more easy, i add 360 to all angles
I mean, sure you can, but you could also just utilise the vectors you already have in Cartesian
Adding 360 to the angle won't change anything
It'll still be in the same direction
You is right, i can use acos (_direction1 vectorCos _direction2)
If the result is small, i suppose they are in a near direction.
I'm turning my self in a workaholic... ๐
Need a break.
Thanks for the help. Time to sleep.
Welcome
_texs = [""/tex/tex1.paa"",""/tex/tex2.paa""]; _rndtex = _texs call BIS_fnc_selectRandom; (_this select 0) setObjectTexture [0, _rndtex];
Is there any reason that won't work in an objects init?
I can't figure it out, I have even set up a useraction to do the same thing and for whatever reason it won't work.
I finally decided to have the useraction show a hint containing _ rndtex and it shows "any" instead of a texture path.
Sorry just realized I was in scripting and not in config.
Yeah no A3 doesn't like double quotation marks @crude ibex
Unfortunately it's not python.
@BoGuu#1044 Whats the limit arma 3 can run with AI?
and headless clients, without degradation of the client performance?
I know @tough abyss said it was about 60 maximum
How much can the HC's run without client performance degradation?
Depends on hardware. We once had 250 on the hc and the client fps only dropped down like 10 fps due to there where sometimes 20 units on the screen
The HC fps were lurking somewhere 25 as far as I remember. Yet this doesn't necessarily need to apply to your instance either
Well my I7-5820K with 64 AI caused my FPS to drop a lot
particularly when the AI opened fire @vague hull
Yeah that's all totally normal since you need to calculate alot more stuff. It's always a good idea to kinda limit the AI in one particular area of the mission
Did you play a SP mission?
Because if the host is your own pc it will become one hell of a clusterfuck for the engine..
Try setting up the server, client and hc so that all of them has different resources (cores, priority etc. Pp.
Performance drops with any number of AI, if you turn off vsync you can see frames go down with even small numbers.
The curve starts to sharpen downwards though at about 50.
PM ME your scenario :)
@dusk sage what i'm trying to do is reorganize the 3D icons that overlap one above the other. So for that i need to know if those icons are in the same direction (vectorCos), what means they are overlaping, and then reorganize then in the "celestial sphere" (where the center is the players eye). On the second part, the reorganize part, i still cant go away from spherical coordinates. This reorganize is to make all icons readable.
Is setShotParents on devbranch as stated here https://community.bistudio.com/wiki/setShotParents or its not? Confused here...
My tests done in Alpha suggests 150 and about 35 players. Since then I have evidence that limit should be lower because staying above 40 ticks on the server is important for AI behaviour and I seem to recall at the time we were going off Arma 2 performance which was above 20 and subsequently we determined the AI didn't respond well. I can't see any evidence on our server performance that anything has changed so absolute limits of 150/35 is still what I suggest but you should aim for less.
If any part of the chain, server or HC is below 40 ticks you will see AI degradation, you really do need to maintain 40+ in Arma 3.
@west lantern It's on stable too and it seems to work
Unfortunately it's server only, so very limited when used by clients via remote execution due to network delay (fails very often on short distance shots)
it being tagged "dev" probably means that it's subject to change and you'll be blamed if it's broken or even removed in the next udate
What is the use of that setShotParents?
Hi guys. Could someone point me in the direction of where I can find something on the execution of a script while within an area. What I am trying to achieve is to update a list of areas you can spawn to by moving a marker. The markers are attached to group leaders. When the group decides to split into multiple groups it should pick up the new group leader as well. The script only needs to execute while within the vicinity of the tele-pole. I wanted to use a repeatable trigger but the trigger wont fire continiously while within the area. Any help would be appreciated
What is the use of that setShotParents?
set what killed and handleDamage report as shooter (can be 'gunners' vehicle)/gunner (can only be a person)
horrible command name
ParentOwner, sounds okay
They added a getShotParents, so they added the opposite aswell. Atleast its only a serverside command
both names suck
This is amazing how DoFire is unreliable...
DoFire is Engage command + target reveal
Basically exactly the same thing as when you command AI unit to engage something
So yeah if AI thinks it shouldn't shoot it wouldn't
if AI thinks it shouldn't shoot
OPFOR unit
point blank range
doTargetin place
Hmmm, indeed, why he should open fire in that situation... >_<
hes a pasifist
pacifist
He consistently spares one of four targets. Cute.
@tough abyss yeah yeah, too bad I'm modding standalone and not arma 3 and I've come to realize you have to use double quotes in standalone. That still doesn't explain why it returns "any" but, regardless I have it figured out another way. Thanks for the input.
@little eagle thanks for the heads up, I will pass your note among users.
horrible command name
hah what to say about getShotParents
damn it BI... <Batman cries>
Talking about spherical coordinates, my lecturer was fucking up so hard he switched to Cartesian ๐ค
getShotParents too reminds me of batman
The development team is now fully focusing on a clean sweep of the game. This means that for the next couple of weeks we're solely fixing bugs, focusing on performance and minor, yet long-standing issues, and polishing the game. As a consequence, all of the work is under a lock - only approved and manually selected pieces of data get in the final game and the rest has to wait until the lock is released. The plan is to finish this sweeping period by delivering Update 1.66. Hopefully, after we have results of some first build checks done by our Quality Assurance, we'll be able to publish the Release Candidate by the end of this week.
i guess now is the chance to get the A3 teams attention for long time or important issues
fix tank PhysX
i guess this will take till end of 2017 ๐
Best Arma 3 update! Where do i pay for it?
@crude ibex How are you even modding standalone without a manual?
For how the scripting language is DayZ standalone works?
Wheres the scripting manual for taken on mars?
no clue
Details of EnScript aren't released yet
Take on mars could have been so much more.
Ohhhh
Take on mars scripting language is low overhead
@paper rain Very interesting
Looks very similar to C++ includes OOP too
objects.methodss
It's said to be more like Java/C#. There's a QA with the Enfusion lead on the DayZ youtube channel which answers a little.
And... people are trying to mod DayZ Standalone already?
without actually knowing how the language works?
I think they're just champing at the bit
Also, quick gripe/rant: Why the hell is there no colon after the default case for switch do statements? It took me 5 hours trying to fix my script when all it was was default: https://community.bistudio.com/wiki/switch_do ๐ ๐ข
It's the same syntax as C++
or C I believe.
Also
If you need to use switch just do this
call {
if (cond1) exitWith {//code 1};
if (cond2) exitWith {//code 2};
if (cond3) exitWith {//code 3};
//default code
};
Keeps the speed of if
without using switch do @paper rain
How much of a difference are you seeing when you a run a performance check?
From what I've heard switch is costly in terms of execution
When compared to a scope call then exiting it
even using a lazy execution of switch(true) do {}
Which in my opinion is dirty
No @tough abyss the only difference between SQF and C is the missing : after the default in SQF. I'm a C guy, so that's what threw me for a loop. Also, especially since SQF doesn't have an else-if, switch statements will always be faster because fewer conditions need to be evaluated. Notice how that page stipulates this is only to be used if switch syntax won't work.
@paper rain I am currently learning C the hardway.
Learning how the C <-> ASM conversion works
There's an easy way?
Technically yes and no.
When you learn C <-> ASM
it becomes evne harder.
Reason? I want to be hacker.
The book I have on the subject is.
No this is not a "script kiddy" hackers book either.
Ooo.. I have that book... somewhere. I think it's back at the parent's place.
If you like that book, you should also check out youtube videos of talks from "Defcon"
I need to find me a good C programming book
Hahaha defcon
Oh yeah, seen the owned by owner?
or Pwn'd by owner?
yes
I also like the one where they put a RPi on a drone, fly it over homes and hack WEP passcodes. Also the one on "Bitsquatting"
@paper rain I'm more into the RND "high tech hacker stuff"
E.g Laser-cuttering into a CPU to snoop on RSA keys
Or starving CPU's of power to to weak RSA encryption
weaken*
lol
They did it no joke.
Or
GPU accelerated password cracking
That sort of RND stuff @paper rain
And I effectively live here
and here
Fun
@paper rain Nanotechnology and advanced technologies are the future.
Back to the switch code topic for a second: Unless you're trying to squeeze hundredths of a millisecond gains out of a script, I'm not seeing an appreciable difference.
vs what?
call { if (cond1) exitWith {//code 1}; if (cond2) exitWith {//code 2}; if (cond3) exitWith {//code 3}; //default code };
Why the need to call it D:?
if then will be quickest
as I said, hundredths of a millisecond
@GeekyGuy5401 I'm not sure if that's sarcasm lol. I can tell you though it's a lot like arma 3 but, it has more functionality. If you like modding arma 3 you'll love SA. https://www.youtube.com/watch?v=cgSdh_EmIZ4 if you want to take a look.
On my phone it's being a pain.
@GeekyGuy5401#9206
@tough abyss
Sorry phones being an ass.
I did a comparison between large amounts of exitWiths and switches, but I'm unable to find the spreadsheet at the moment. I think the call is just used in case you didn't want to exit the scope of where the if checks are.
The switch statement should always be faster than the call-exit pattern. I'll test it when I get home. Sure, it may be a tiny amount, but that starts to matter a lot in the context of an onEachFrame
Yeah iirc my testing said the same thing. I'm not sure if that's always been the case, or if a more recent A3 update improved the speed of switches.
@paper rain exactly
IIRC my testing showed switch to be slower also
It's been and still is pretty sloppy, unless something has changed
ever seen code do this?
Do what?
E.g altis life ``` switch(true) do
{
case someCond: { code };
case someCond2: { code };
}; ```
Dirty code.
I have yes
When SQF lets you abuse it this much, it's not that surprising
There is much worse than using a switch true
I mean while {true} isn't inherently bad.
It depends on the context.
Waiting for input is normally an acceptable method.
I'm not sure where your standards come from
I've used switch true to help organize done larger functions.
In a totally dodgy scripting language
If you do.
I just use while {true} do if (some exception) exitWith {};
exitWith is basically break
There is also break for you to use
You mean BreakTo?
Both do different things
To be honest I haven't see much code that uses BreakTo or BreakOut
And it should be used a lot more
all my current work has been trying to integrate them more
To stop exitWith trees appearing
Anything I code in SQF Mr. Taxman ๐
Interesting
Any place I need to exit out of nested scopes
using if (cond) then {breakOut "Loopscope" };
Im not sure what you're looking for ๐
I wouldn't imagine so
It's definitely more readable.
exitWith will break your current scope
Well it's using if(cond) then {} which is the fastest if-then construct
However breakOut can break out of any scopes (current or parent)
So there has to be an overhead there
I thought it only breaks the specific scope?
BreakTo breaks ALL scopes
Breakout breaks a specific scope named from ScopeName "loop" at the beginning of a loop
Interesting breakout can be used as a return statement
and breakOut will break out of all child scopes, including your specified
It's incredibly useful
I.e:
Example 1 is wrong?
scopeName "main";
while {true} do {
scopeName "loop1";
while {true} do {
scopeName "loop2";
if (condition1) then {breakTo "main"}; // Breaks all scopes and return to "main"
if (condition2) then {breakOut "loop2"}; // Breaks scope named "loop2"
sleep 1;
};
sleep 1;
};
the if conditions
What about them?
Jesus christ, please no one ever use breakOut or breakTo ever
Why?
It's essentially a scoped goto. Gotos lead to spaghetti code. Spaghetti code leads to the dark side.
True....
That would purely depend on how you structure your code, though
Still want to know if exitWith is faster than if (condition) then {breakOut "Scope" };
And would (if used correctly), be equivalent to chaining exitWiths
True
Because you can actually
use a single definition
for an entire exitWith
Instead of if (condition) exitWithception {}
Altis Life does this A LOT
{
if () then {
if () exitWith {}
};
if (exit) exitWith {}
} count ...
For checking illegal expressions
and further, is completely disgusting
But is it more disgusting than breakOut?
Yes
What if you are 3 nested scopes in, and have to exit out of the entire script?
Theres your illegal expression checks
if(shit) exitWith
if(moreillegalshit) exitWith {};
There is nothing wrong with that
But couldn't you just
instead of the exitWiths
a single scope definition at the top
if(null _unit) then {breakTo "end"};
?
That way a single check would only need to execute one condition?
I just tested an example with 3 nested scopes, using exitWith gave 0.0075ms across multiple runs, and 0.004ms for breakOut
That way a single check would only need to execute one condition??
Not what I meant
exitWith is breaking out of the parent scope, though
if (isNull _unit) then {BreakOut "end"}; //Dafuq?
if (_unit != player) then {BreakOut "end"}; //Dafuq?
if (life_is_arrested) then {BreakOut "end"}; //Dafuq i'm already arrested
_illegalItems = LIFE_SETTINGS(getArray,"jail_seize_vItems");
scopeName "end";
?
That's not in the code you linked. the life code uses exitWith
I know
I'm giving an example of preventing the Spaghetti code. Name the scope to the end of the script
I'm not seeing why you think using a breakOut would some how make it any better?
that way it will just terminate?
It would be spaghetti code to breakOut to the end of the file
Instead of just breaking out the parent scope
Which it does
if _unit isNull, it'll break entirely out
for example
Oh this is interesting * When "name" is an undefined scope name or "", the script quits current scope. *
Looking more deeply, depending on how scopes are stored, I'm assuming a stack, the SQF engine may have to do an O(n) operation to find the target scope, where exitWith is always O(1)
so if a scope name is "" not defined
it will effectively do the same as exitWIth {} ?
I would imagine it would be an O(n) search
Almost certainly
Or, due to the way scopeName is stored, it is not
Test it?
Going off my previous argument, my best guess is actually "No" as a break will try and find the scope name through all available scopes
But in the case it has to exit more than one scope, it couldn't be
One thing I've learned about the A3 SQF language... assume nothing..
I've been caught several times because of it...
Hmmm... according to Killzonekid three years ago, switches are surprisingly slow
k.
scopeName "main";
if (true) then {
if (true) then {
if (true) then {
if (true) then {
breakOut "main";
};
};
};
};
Has to recursively search each scope?
Is almost 25% faster than
scopeName "main";
if (true) then {
scopeName "main2";
if (true) then {
scopeName "main3";
if (true) then {
scopeName "main4";
if (true) then {
breakOut "main";
};
};
};
};
Could be due to extra code though
hold on
huh, we sure that naming the scopes isn't what takes time?
Not defining the scope as I said
yep, checking
try a breakOut ""
When "name" is an undefined scope name or "", the script quits current scope.
So it seems the time taken with scopeName "xxx" is linear with number
As expected
checking the above minus times now
did a fake switch with exitWith and breakOut, exitWith is 0.000375 ms per loop faster
40000 samples each
_num = 0;
call {
scopeName "fake_switch";
if (_num == 0) then {_num2str = "0"; breakOut "fake_switch"};
if (_num == 1) then {_num2str = "1"; breakOut "fake_switch"};
if (_num == 2) then {_num2str = "2"; breakOut "fake_switch"};
_num2str = "N/A";
};```
Yeah BoGuu
Now try with 3 scopes nested
Do a single if (condition) then {Breakout "" };
compared to a if (condition) exitWith {} ?
_num = 0;
call {
if (_num == 0) exitWith {_num2str = "0"};
if (_num == 1) exitWith {_num2str = "1"};
if (_num == 2) exitWith {_num2str = "2"};
_num2str = "N/A";
};```
if (condition) then {Breakout "" };
Isn't going to do anything
but continue execution
Oh. der sorry.
so... private "_num2str"; _num = 0; call { scopeName "outer"; call { scopeName "inner"; if (_num == 0) then {_num2str = "0"; breakTo "outer"}; if (_num == 1) then {_num2str = "1"; breakTo "outer"}; if (_num == 2) then {_num2str = "2"; breakTo "outer"}; _num2str = "N/A"; };}; work?
Don't nest the scopes
tell us what scopeName "main" If (condition) then {BreakOut "main"};
There is no point in testing that
at all?
the difference* you'll get will be indeterminate
The fluctuations will be bigger than the difference between them
Damn. Still not a fan of exitWith
exitWith is just the same as a return statement
๐
Was for intellectual / curiosity sake.
Well, exitWith will break one scope
Well, it's turning out to be slower and uglier (imo)
returns are more along the breakOut line
Like I said
do a nested example
scopeName "main";
if (true) then {
if (true) then {
if (true) then {
if (true) then {
breakOut "main";
};
};
};
};
with exitWiths
๐
riight
Thats because arma 3 doesn't know how to stop evalulating code after the condition is fals.e
I saw something along those lines on code optimisation page
Ugh, Killzonekid's still right. switch is still slower than the exitWith idiom
It was about how arma 3 continues to evaluate conditions even after they return false
In what scenario does that ever occur?
if (_group knowsAbout vehicle _object > 0 && alive _object && canMove _object && count magazines _object > 0) then {
//custom code
};
You may expect the engine to stop reading the condition after the group has no knowledge about the object but that's false. The engine will continue evaluating the condition until the end even if any of the previous conditions evaluated false.
I did
if (_group knowsAbout vehicle _object > 0 && {alive _object && canMove _object} && {count magazines _object > 0}) then {
//custom code
};
enjoy ๐
oh, just found it
your link went to the bottom of the page
I know sorry
I've no idea why SQF hasn't been made to short circuit by default, and I'm yet to find a use for it
The only uses I could imagine should never be done
It's a standard speedup most languages have.,
Indeed, every C based language atleast
So... in SQF, nesting if-thens can be faster than one condition. ๐คฆ
The latter
C222: How much of a difference? How many statements did you check?
insert something engine related here blah
C222: I don't see a time comparison. Did I overlook it?
Directly interfaces with the engine
But that just exposes the C++ interface
Not the underlaying reason
You'd have to wait for somebody with more internal knowledge to answer that I think
Hi, can you sort numbers in a listbox ?
An in order the rows via numbers?
Im trying to sort my listbox by servertime. So they can choose in a combobox from latest to newest or from newest to latest. Now i want to know how i can do this. Im filling the listbox with a array which includes the servertime.
then sort the array via servertime before adding your relevant data
And how can i do that ?
a quick google search for 'sort arma 3' returns a lot ๐
Thx :D
Lets say i have a combobox and fill it with following: "A -> Z", "Z -> A", "Recent -> Past", "Past -> Recent". How can i sort the listbox which is filled with foreach and a array like this: [["Testname",458,"Testvar"],["Second Testname", 480, "SecondTestVar"]]. (The numbers are the servertime). And how can i sort the listbox by the combobox ?
Yeah. So i would do it like this ?:
_test =[[["Testname, 460],["2nd Testname, 500]], [], {_x select 1},"ASCEND"]call BIS_fnc_sortBy;
You tell me
How can i sort my array from a single element with the sort function ?
myarray = [[123,"test"],[124,"test1"],[125,"test2"]]; myarray sort false?
But how can i sort it by selected element like: myarray select 0 ?
If anyone knows this. I'm trying to make a old school style lightbar, The ones that rotate. I'm trying to figure out how I can do the ground effect so that it rotates with the lights. any ideas?
not very well in armas lighting engine I recon.
to the pFEH believers - why to use it for sth that isnt time critical?
To make sure scripts never interleave.
(Using unscheduled scripts is easier than thinking about what you're doing)
Anyone knows why playSound would kick players out of server?
@tribal crane good point thanks
still for single instance stuff (ie player only) and low frequency, i still cant see the point
Yeah, you should almost never do it.
for example weapon state and magazines is not something that changes fast by any means (aside from scripting manipulation and there probably pFEH may even cause undesired outcome)
Besides, mutual exclusion on a single host won't help when you have a bunch of other hosts with MP.
please stop. cringe
you all have no idea what you're talking about
and you do? You litereally asked how to script
Heaping dose of sarcasm there.
@dusk sage want to know the error i was having with spherical coordinates?
Sure
@dusk sage the formula is in radians...
@velvet merlin
weapon state and magazines is not something that changes fast by any means
and how exactly would you manipulate anything with that without knowing at the time when it happens? knowing that few seconds later is already too late
obvious thing.
The formula can be in radians or degrees, they both represent the same quantity
Just don't get it wrong ๐
can't trow degree in a formula made for radians
*2pi/360 or something
Every term you have relying on either angle, is the same regardless of your choice
instead of 45 degrees i need to use pi/4
sin / cos etc, use degree in Arma
So yeh, sticking with degrees would be more logical for these purposes
The only terms relying on angles are trigonometric functions, it won't matter
The formula i'm using to convert between spherical to cartesian uses radians
where does that say radians?
i use degree: error
i use radians: no error
the test is convert [1,0,0]
result is know
Okay, so which term do you think will change, given using degrees instead?
use atan2 instead of atan
Again, like said above, ARMA uses degrees for its trig functions
it handles 0
You don't need to
The functions in ARMA take degrees, you need to use degrees
What you do on the other side, doesn't matter
as long as you dont use the radian angle to describe circumference all formulas work with both degrees and radians since its a linear conversion
Guys. I really think the issue is dividing by 0
atan2 was made to handle this
specifically
Most likely
ye seems the most likely
just wanted to specify there are no radian vs degree functions if youre just using sine functions
yeah. it's all basic triginometry functions. sin, cos, atan. they all use degrees in Arma
eh
only when the radian angle is used to discribe circumference but then theres no sine or cosine in sight
@warped thicket seconds is obviously way too long. however per frame is a frequency you not always need/no delay at all
oh god excel
You've gone a bit backwards with your definitions
Perhaps drawing a sphere, your coordinate axes, and your vector will help you visualise it
I'm not sure what that snap shows other than that excel uses radians for sine and cosine
It shows he's mixing up what his theta and phi are defined as
I actually think Excel does use radians for whatever reason
it definitively does
I vagualy remember soething like that
and i think i see, boguu
Should just either use pen and paper or directly enter the previous snippet into SQF
SQF is better than Excel for these few lines
this I mean
have you heard about our lord and saviour, MATLAB?
Don't need MatLab for this shit ๐
Overkill. The answer is right in front of him/us
Don't need MatLab for this shit ๐
this
i believe a was talking shit hahaha
No, you just used Excel for whatever reason
Freeware on Windows PCs
Excel has to die if it hasn't already
but in THIS formula, really don't matter if radians or degree...
yes!
but this is not a generic assumption
It is in the case you are relying purely on trig functions, such as this
yes, you just need to use the angle metric the trig functions are made for
"angle metric" sounds wrong to me
i mean degree or radians
well. it's clear which one it is
You should be using radians 99% of the time, but SQF, is well, SQF
in SQF too
I think the only place is in model.cfgs. But everyone just uses "rad 45" etc. there, so it's almost the same
rad converts degrees to radians
deg does the opposite
But you'll almost never need them
certainly not for this
Study this diagram @tough abyss
https://upload.wikimedia.org/wikipedia/commons/4/4f/3D_Spherical.svg
@dusk sage nice, thankyou.
study*, my typing is poor today
private _polar = [x,y,z] call CBA_fnc_vect2Polar;
_polar params ["_r", "_dir", "_elev"];
_elev = _elev + 15;
private _cartesian = [_r, _dir, _elev] call CBA_fnc_polar2vect;
I think that should work
Awesome!
Never used them, but now I remember they exist
@little eagle those 2 functions are old to CBA?
eh
What form do these equations try to achieve
Seems like they are wrong
Nvm, just displaying the elevation instead
Bizarre
?. Not sure if adding 15 to the elev was what he wanted. Can't remember exactly
The CBA_fnc_vect2Polar is returning an elevation, not an inclination, just confused me for a second while reading
I think they mean the same thing
a vector in the form [magnitude, azimuth, elevation].
Your elevation is taken from the plane
The inclination is standardly defined from the z-axis
It would be 90 - elevation
Ultimately will make it easier to work with in ARMA though
yeah. it changes the sign. +15 vs. -15
that's what I meant yes
this was just an example
what i want is reorganize 3D icons that overlap
in a way all of then get readable
for example, if 5 3D icons overlap i will calculate the average direction and create 5 positions -30 -15 0 15 30 above and bellow the average direction to put the 3D icons
or may be -12 -6 0 6 12
radius dont interfer since 3D icons dont have size affected by distance
so in the spherical coordinate of the icon i can use any r > 0
Anyone know how I can make the ground effects for a lightbar rotate constatly. I'm making an old style lightbar the one that rotates. I can't find a way to make it without a giant sqf
Bit of an odd request, is it possible to take the turret of the M4 Scorcher and attach it to the hull of the Kuma via scripts?
no
Damn, that's a shame.
Totally easy question I know: I am using a mod that makes my units start with one rangefinder in uniform and two in backpack (doesn't show in loadout editor). How can I use init field to remove these? I have tried this: removeItemFromUniform "Rangefinder";
Doesn't work
Changing it to: this removeItemFromUniform "Rangefinder"; fixed it, but added earplugs(ace3) and a rangefinder in vest instead
Seems like my mod is adding random stuff, because I gotta have it
SPHERICAL COORDS: The process to find a vector direction and elevation is really simple, just some equilateral triangles!
how can i execute deleteat so it deletes a array on every client, but server ?
Think you're looking for right angle, not equilateral ๐
Broadcast your array across the network @dim owl
how could i do that ? actually i pushback the array global, but server. and how can i delete something global, but server ?
global but server?
i mean on every client but server
Make it into a function
run the function via remoteExec
@dim owl
It would also need to be a global variable
and maybe a publicVariable
missionNameSpace setVariable ["myArray",myArraysValue,true];
then on the clients
You could even use the command directly.
[{ myArrray deletaAt Index }] remoteExec ["call",-2,false];
That will run on every client but the serve
so like
testvar remoteexec [deleteAt, 5, -2];
?
No.
the value in the remoteExec
after the "delete at"
is the targets
You could even use the player object in place of it.
[testVar,5] remoteExec ["deleteAt",-2,false];
or
[testVar,5] remoteExec ["deleteAt",player,false];
ah okay i understand ๐ thank you ๐
with player it will only execute on the player where local
so player might be more favorable.
okay thx
Not sure that remoteExec is going to work
or maybe mp function
Depending on what's going on and how the clients receive the array, you're also looking at a source of desync for JIP
@buoyant heath how to combat Desync with JIP players in this specific scenario ?
im just wondering, because i haven't coded JIP related stuff in ages
i want to create a listbox and a listbox entry foreach array entry. and you can delete a entry of the array by clicking a button and now im not sure about deleting it. thats what i want to do ๐ so should i use mp function or remoteexec ?
Ebay / market system ?
for player trading ?
doesen't matter
I think your Architecture isn't that great in my mind.
but, never mind ...
@buoyant heath I now remember why i didn't have JIP problems, i did everything request based.
I am trying to write a function to return the four corners of a rectangle marker. It works fine... until I ry and adjust for rotation
Does such a function already exsist?
or what's wrong with my current one? https://gist.github.com/C222/a01dda59671dcc0d322fd5b2f401a30b
@paper rain Why the horrible naming?
Couldn't you have commented them?
if you are going to use really short variable names?
I mean you make work for yourself...
Also do you absolutely need the the corners @paper rain
?
I updated the naming, and yes, I want the corners
I'm trying to implement the math detailed here, but it's transforming the points incorrectly
getMarkerCorners = {
private _pos = markerPos _this;
private _size = markerSize _this;
private _dir = markerDir _this;
private _wsin = (_size select 0) * sin (_dir + 90);
private _wcos = (_size select 0) * cos (_dir + 90);
private _hsin = (_size select 1) * sin (_dir);
private _hcos = (_size select 1) * cos (_dir);
[
[(_pos select 0) - _wsin + _hsin, (_pos select 1) - _wcos + _hcos],
[(_pos select 0) + _wsin + _hsin, (_pos select 1) + _wcos + _hcos],
[(_pos select 0) + _wsin - _hsin, (_pos select 1) + _wcos - _hcos],
[(_pos select 0) - _wsin - _hsin, (_pos select 1) - _wcos - _hcos]
]
};
here you go, wrote it just for you
Returns corners in order of: top left, top right, bottom right, bottom left
how can i remoteexec on server only ?
Thank you so much @meager granite
@meager granite Just curious. Why write so many private commands beside the variables? When you could just do: private ["_pos", "_size", "_dir", "_wsin"];
Is there a way to remove all items from uniform?
I believe there Is. But I'm on mobile atm, so I can't write the block of code for you. :(
You need to create a temporary loop or for loop. Then have some conditions to check if they are in the uniform or not.
Ahh well maybe easier to remove all items, then add items to vest and backpack?
How to add more than one item?
"'''removeAllItems this;
this addItemToUniform "ACE_fieldDressing";
this addItemToUniform "ACE_morphine";"
'''removeAllItems this;
this addItemToUniform "ACE_fieldDressing";
this addItemToUniform "ACE_morphine";'''
Hmm. Well if you do that, then you might need to log/store the classnames in an array. But once I get back into ArmA (haven't updated it for 6 months, lol), I might drop a block of code for you. (I hope)
Thanks alot
Oh
Interesting
The addItemToUniform sounds new. (I haven't seen the latest list. Sorry) >.<
@earnest valve in the optimization guide, it points out that the newer-style private method is faster than the old private ["_things"];
Ohhhhhhhh
Cool, so that's good to know. Once I get back into DSS, I'll have a fiddle with some of the new code. :)
How to format as multiline code in discord?
counter = 0;
while {counter < 10} do
{
this addItemToUniform "ACE_fieldDressing";
this addItemToUniform "ACE_morphine";
counter = counter + 1;
}```
This did what I wanted it too
Just gotta add items like this
I know it is possible, but how to have several of these in a file for multiple units, rather than in the init of a unit?
Like placing it in a file inside the mission folder, and using like a variable name instead of this
Like teamLeader for teamleader and marksman
For marksman
Figured this out two
init.sqf
Know this is not huge for you scripters, but this might just be the start of my scripting career
It'd probably work just the same, but a for loop would be the "more correct" structure to do a loop 10 times. https://community.bistudio.com/wiki/for_forspec
And best of luck, everyone starts somewhere.
@earnest valve It's faster to execute for the game and it's easier to maintain, since it contains no redunant information like private ARRAY does
Ok
and it just feels nicer ^^
Init code for making AI ignore unit?
ignore unit? as in ignore the enemies?
probably something like this.
this setBehaviour "CARELESS";
this setCombatMode "BLUE";
Im trying to place a drone, but as my viewdistance (for videocard reasons) can't be that long I don't want the enemys to attack it
Simply pretend it doesnt exist
I tried setCaptive True
They didn't attack it, but I cannot control it with MCC either
@halcyon crypt this made it not move, and somehow taking control of it and using thermal shows no thermal signatures even though there should be some there
that's a problem with mcc then
setCaptive is the only way to make a unit be ignored by the enemies
They have to replace side _unit with side group _unit in their code everywhere. I've been saying this for years
so there is still no way to disable the inventory action/cargo space via scriptiong, right?
see also https://feedback.bistudio.com/T71394
Probably possible to block it using https://community.bistudio.com/wiki/inGameUISetEventHandler
yeah that can be done but still leaves the useraction..
on a fancy loop or whatever
DEV only for now though
hmm it might be in 1.64 but the wiki says DEV (1.63)
also no clue if it works for the inventory action
Pretty sure removeAction does only work with actions that were added by addAction in the first place
^ +1
Can you stop server from updating unit position to clients with enableSimulation false (ie. does the disabled simulation contain position updates)?
No.
@buoyant heath So the server will keep syncing the unit to clients even with enableSimulation false?
Actually, I'm not sure how that'll work out. I forgot enableSimulation is not a global effect.
enableSimulationGlobal
you can also disable it with just enableSimulation if you use it in object's init field
and most simple objects already have it disabled
and there is also a checkbox in Eden ๐
@warped thicket @buoyant heath I'm in Arma 2, so can't use the global version of the command
Working on sophisticated optimization for a resource heavy mission
Looking for someone with skills to collaborate on a Sci-fi Survival project, pm me if you have time and your interested. Forewarning, its a big project.
So I'll ask again: can you stop server from updating unit position to clients with enableSimulation false (ie. does the disabled simulation contain position updates)?
Normally you can't
If you need it to have global entity stay at different positions on different clients I can suggest hacky approach
disabled simulation doesn't stop clients from getting general update packets from server for that entity
by general update I mean whatever is being regularly sent from server - position, orientation, damage, whatever else
"disabled simulation doesn't stop clients from getting general update packets from server for that entity" @meager granite yes, that's exactly what I'm trying to achieve.
Kind of kill all the information flow (under certain conditions) about unit A to unit B and then enable it again when needed.
That sounds very engine-level. I'd be surprised if there were a way to achive it inside of SQF
@paper rain I know it has been done to some extent at least, but don't know how exactly.
I've done it by accident kinda with disableSimulation in client-run code. Not sure it it stops updates though or just didn't display it.
Since that statement's effect scope is local
Sorry, meant enableSimulation
why not use createVehicleLocal for this then?
Anyone that know a bit of ACE can help me?
BRPVP + ACE: injuries are not recorded.
I get damaged, but no injuries recorded.
Can we talk in private?
how would I go about adding a 0 in front of the dayTime minute if below 10 min as well as adding a 0 in front of the sec if below 10 sec
//daytime = 1.66046
_hour = floor daytime;
_minute = floor ((daytime - _hour) * 60);
_second = floor (((((daytime) - (_hour))*60) - _minute)*60);
_time24 = text format ["%1:%2:%3",_hour,_minute,_second];
//_time24 = 1:39:37
the text below that code states that this doesn't add a zero in front of the minute and seconds if they are below 10 min and 10 sec, that there's more scripting that needs to be done to do that
add if (_minute < 10) then { _minute = format ["0%1", _minute] }; just before the _time24 one
thanks Lecks, now one more question if you don't mind
I'm also trying to get the date in a specific format. so if it's 1/1/2017, I'd like to get it to appear as 01 JAN 2017
Right now I have this as a script:
while {true} do {
_locationType = ["NameCity", "NameCityCapital", "NameMarine", "NameVillage"];
_nearestCity = nearestLocation [getPos player, toString(_locationType)];
_hour = floor dayTime;
_minute = floor ((dayTime - _hour) * 60);
_second = floor (((((dayTime) - (_hour)) * 60) - _minute) * 60);
if (_minute < 10) then {_minute = format ["0%1", _minute]};
_time24 = text format ["%1:%2:%3",_hour,_minute,_second];
//hint format ["%1",text(_nearestCity)];
[text(_nearestCity), str(_time24), str(date select 2) + " " + "JAN" + " " + str(date select 0)] call BIS_fnc_infoText;
sleep 300;
};
i guess you want ["JAN", "FEB, "etc] select (_month-1)
not sure how to implement that, but yes I think that's what I'm going for, that command takes out the number for the month and replaces it with abbreviation of the month right?
that will return the text based on the month that 'date' returns, yeah
other than that it's just selecting the stuff out of the array
Is there anyway to tent the screen a spacific color? For instance if I put on goggles "X" it tents the screen green and if I put on goggles "Z" it tents the screen blue?
@crude ibex ace3 does that
@vapid frigate So I guess I'm still lost on where to put that command at, or how to implement it into what I already have.
it's 'tint' btw.. might help looking it up
Haha thanks, was typing and watching a video. Wasn't paying much attention.
i imagine so, but i'm guessing the post processing would be faster
and might look different.. an overlay might remove some detail or something
or not change as well with lighting
i think it's the ColorCorrection PP effect
while {true} do {
_locationType = ["NameCity", "NameCityCapital", "NameMarine", "NameVillage"];
_nearestCity = nearestLocation [getPos player, toString(_locationType)];
_hour = floor dayTime;
_minute = floor ((dayTime - _hour) * 60);
_second = floor (((((dayTime) - (_hour)) * 60) - _minute) * 60);
if (_minute < 10) then {_minute = format ["0%1", _minute]};
_time = text format ["%1:%2:%3", _hour, _minute, _second];
_month = date select 1;
["JAN", "FEB", "March"] select (_month - 1);
[text(_nearestCity), str(_time), str(date select 2) + " " + str(date select 1) + " " + str(date select 0)] call BIS_fnc_infoText;
sleep 300;
};
just change str(date select 1) to _month
k
format is probably easier to read too
format ["%1 %2 %3", date select 2, _month, date select 0]
The overlay would consist of darkening the edges of the screen, particular texture for particular giggles.
zelik: i guess if you want more than a tint then a overlay is probably the way to go
Any idea how to do that?
while {true} do {
_locationType = ["NameCity", "NameCityCapital", "NameMarine", "NameVillage"];
_nearestCity = nearestLocation [getPos player, toString(_locationType)];
_hour = floor dayTime;
_minute = floor ((dayTime - _hour) * 60);
_second = floor (((((dayTime) - (_hour)) * 60) - _minute) * 60);
if (_minute < 10) then {_minute = format ["0%1", _minute]};
if (_second < 10) then {_second = format ["0%1", _second]};
_time = text format ["%1:%2:%3", _hour, _minute, _second];
_month = date select 1;
_date = text format ["%1 %2 %3", date select 2, _month, date select 0];
[text(_nearestCity), str(_time), str(_month)] call BIS_fnc_infoText;
sleep 300;
};
returns: Location, Time, Date, but the date only has 1 for it, the Name of the month and year don't show up
_date
woops
It happens man.
well everything is showing now, but the month is still 1 instead of JAN
just updated this:
_date = text format ["%1 %2 %3", date select 2, ["JAN", "FEB", "March"] select (_month - 1), date select 0];
now JAN shows up, will that work if the mission was set to April?
or would I have to put all the months in?
You have to put all the months in
k, thanks
Final result is this:
_locationType = ["NameCity", "NameCityCapital", "NameMarine", "NameVillage"];
_nearestCity = nearestLocation [getPos player, toString(_locationType)];
_hour = floor dayTime;
_minute = floor ((dayTime - _hour) * 60);
_second = floor (((((dayTime) - (_hour)) * 60) - _minute) * 60);
if (_minute < 10) then {_minute = format ["0%1", _minute]};
if (_second < 10) then {_second = format ["0%1", _second]};
_time = text format ["%1:%2:%3", _hour, _minute, _second];
_month = date select 1;
_date = text format ["%1 %2 %3", date select 2, ["JAN", "FEB", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] select (_month - 1), date select 0];
[text(_nearestCity), str(_time), str(_date)] call BIS_fnc_infoText;
sleep 300;
};
Define a new array, for instance _monthabb = ["jan","feb", etc....] then update
k
updated this:
_date = text format ["%1 %2 %3", date select 2, _monthabb select (_month - 1), date select 0];
@broken forge edited sorry
The reason for the _month -1 is because arrays alway start at 0. So then real month is 1 and the value in the array for Jan is 0. So you catch the month and -1 from it to get 0. Hope that makes sense.
Final result is this:
while {true} do {
_locationType = ["NameCity", "NameCityCapital", "NameMarine", "NameVillage"];
_nearestCity = nearestLocation [getPos player, toString(_locationType)];
_hour = floor dayTime;
_minute = floor ((dayTime - _hour) 60);
_second = floor (((((dayTime) - (_hour)) 60) - _minute) * 60);
if (_minute < 10) then {_minute = format ["0%1", _minute]};
if (_second < 10) then {_second = format ["0%1", _second]};
_time = text format ["%1:%2:%3", _hour, _minute, _second];
_month = date select 1;
_monthabb = ["JAN", "FEB", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
_date = text format ["%1 %2 %3", date select 2, _monthabb select (_month - 1), date select 0];
[text(_nearestCity), str(_time), str(_date)] call BIS_fnc_infoText;
sleep 300;
}; @broken forge
You could also put an unused value at the beginning, like so.
_monthabb = ["N/A","JAN", "FEB", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] and then change this to
_monthabb select (_month)
using events rather than while {true} would probably be better too
Put/Take events
err nvm, was thinking of zelik's problem lol
well I'd like to get the script to only run when the player enters one of the locationTypes listed in the array
Something like this:
_locationType = ["NameCity", "NameCityCapital", "NameMarine", "NameVillage"];
_nearestCity = nearestLocation [getPos player, toString(_locationType)];
_hour = floor dayTime;
_minute = floor ((dayTime - _hour) * 60);
_second = floor (((((dayTime) - (_hour)) * 60) - _minute) * 60);
if (_minute < 10) then {_minute = format ["0%1", _minute]};
if (_second < 10) then {_second = format ["0%1", _second]};
_time = text format ["%1:%2:%3", _hour, _minute, _second];
_month = date select 1;
_monthToYear = ["JAN", "FEB", "MAR", "APR", "MAY", "JUNE", "JULY", "AUG", "SEP", "OCT", "NOV", "DEC"];
_date = text format ["%1 %2 %3", date select 2, _monthToYear select (_month - 1), date select 0];
if (nearestLocation [getPos player, toString(_locationType)];) then {
[text(_nearestCity), str(_time), str(_date)] call BIS_fnc_infoText;
};
I'll have to put a loop in, but it be nice that if the player where to be in one of the locationTypes listed, then call BIS_fnc_infoText, instead of calling BIS_fnc_infoText every 5min
what was the check again for remote control safe player entity check?
@little eagle ty
if i understand it correctly, one has to use this for every instance one uses currently "player", right?
Does anyone know how to disable the sound that gets played during setUnconscious true? Can do mod
@austere granite you can do this, but only with changing configs and not wth SQF
Oh and clearing the array locks up the game, so set volume to 0 like the comment says
that's some weird ass behaviour ๐
what is?
locking up if you remove the sounds
Yeah. Same when using that dummy empty sound file
I think it tries to play a new one when the previous one was finished
and since both methods mean 0 seconds delay, it keeps trying to play a sound
-> look up
{"A3\Sounds_F\dummysound.wss",1,1}
Thanks a lot ๐
is there any info on the dynamic simulation stuff?
can't find much on the biki or the forums
thing is, for the RC the dynamic simulation is an "area of focus" but not much to focus on without info ^^
hmm judging by the changelog for the dev branch it's just the simulation manager but integrated with Eden
Added: Disabled entities and entities with Dynamic Simulation enabled are now visualized (next to an entity's icon)
nah, that sounds like they show which ones are disabled
doesn't sound like it has anything to do with the dymacially disabling stuff
I meant it as in a toggle for dynamic simulation/simulation manager for units
meh, we'll see I guess
Fixed: The GetOutMan Event Handler did not return commanders when it was supposed to
Fixed: The GetOutMan Event Handler would return commanders too often
heh
lol
hey guys, i set a missionnamespace variable in my script but if i want to request the variable from another client it returns []
trying it like this:
(missionNamespace getVariable "myVar") pushback [player, name player, getPlayerUID player, position player, false, date];
before i defined my variable "myVar"
missionNamespace setVariable ["myVar",[]];
from another client - There's your problem
how could i do this for the server so every client has the same array at the end ?
objectName setVariable [name, value, public] You need to use the 3rd parameter to public the variable.
simply using pushBack will alter the pointer but not PV it yea
There's that too
I see there's a note from a couple years back about missionNamespace not working with the public parameter. If that's the case, you should be able to use publicVariable to share the data
In a mission, I have dozens of CIV side units dressed in soldier gear doing patrols on a city, this way players can safely look for stuff around the city. Somewhere down the line i would like all of them to instantly switch to OPFOR (so players are now enemy number one).
is joinsilent (https://community.bistudio.com/wiki/joinSilent) the command im looking for?
because that one changes the group. from my understanding i could switch them all to an OPFOR unit's group, which would turn them into OPFOR, but the thing is i want them all to retain their respective groupings/patrol waypoints.
im trying it now with publicvariable and a global var
for objects that do not have a inventory "weaponsItemsCargo" returns null instead of an empty array, can anybody confirm this?
Test it yourself?
yes it's true
If I use "player" variable in scripts, does it work in MP and dedicated server and applies to all players on the server?
to get around this, just use
[weaponsItemsCargo _this] param [0, []]
If I use "player" variable in scripts, does it work in MP
yes
and dedicated server
it will be a <null object> on non-interface machines (dedic, HC)
and applies to all players on the server?
certainly not. A script only has effects where it is executed, unless the executed command has global effects
player itself has no effects, so you can't tell this
Okey, if I want to detect nearest player (any side) let's say, from trigger zone, what should I use?
the nearest player from a marker?
The purpose is if a player (any) walks into trigger zone, I need to know the distance to him and track him while he is in the zone. There could be several players from different sides.
(I am making wild dogs that will attack everybody except their own group), MP and DEDIC compatible
if a player walks into a trigger, he is by definition the nearest player to the trigger
unless there already is another player in that trigger
The purpose is if a player (any) walks into trigger zone, I need to know the distance to him
This sounds like the distance from the player to... the player ?
Well, no, from a group leader (of wild dogs) to a player
so you want to get the nearest other player from a group leader?
if a player walks into a trigger, he is by definition the nearest player to the trigger
unless there already is another player in that trigger
Then trigger isn't that good, it's better to hard code the minimal distance for detection. Dogs have to go after nearest player if he is in the minimal distance radius.
So here we go, how ti detect this nearest player?
is the lazy evaluation variant of
`(conditionA AND conditionB) OR ( conditionC AND conditionD )
this here:
' ( conditionA AND { conditionB }) OR { conditionC AND {conditionD}}
or did i get it wrong?