#arma3_scripting
1 messages ยท Page 280 of 1
It needs me to rerun it each time.
I'll fire up Arma I guess
Ah man, thanks for your help but it's 5:15 and I'm gonna hit the sack.
If you find out anything please let me know.
Are you trying this with zeus or something?
CfgMarkerColors I think
Yeah, only CfgMarkerColors
if I use this addEventHandler ["Hit", {sniper = true}] in MP the value of "sniper" is local only to the player who hit the target correct?
Locality of global variable is local to the code that executed it.
Or environment e.g if a player ran that.
It's "GLOBAL" to that players machine
if you use _sniper = true;
it's local to both that script, and the client it runs on.
if the variable is public it is known to everyone including the server.
ok so what I'm trying to do is make it so if a player wants to take a sniper rifle, they have to "make the shot" first. Otherwise when they leave the triggered area the rifle is taken away.
So you're saying if one person makes the shot the variable sniper becomes true for everyone
If it's public yes.
if it's not.
It's local globally to that client
As in any code that runs on the client
Which is that "Individual" machine
It's global.
There is 3 localities in arma 3.
Local
Which is _local to a script
Global which is global to a client or whoever executed the code
and there is public
code or variables that are known to everyone.
Use the player namespace
You might want to use https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Fired instead
player addEventHandler ["Hit", {
params ["_playerObj"];
_playerObject setVariable ["hasSniper",true,false];
}];
^ Should work
Ok so my trigger condition is
'player hasWeapon "rhs_weap_m40a5_d" && !(player in thislist) && !sniper;
so if the player leaves the trigger and hasn't made the shot the weapon is taken away
The trigger isn't set to server only so sniper should be true only on the players machine? Which would mean if someone else grabs the rifle and leaves the building they will lose it?
All you want to happen is for the player to lose the sniper if he has taken the shot and left the building?
Or any players to lose the sniper, when leaving the building, if somone has taken the shot
If they haven't made the shot they lose it. Basically I'm trying to stop every man and his dog from grabbing the sniper rifle.
So we don't end up with a squad of snipers ๐
Only the player who opens fire first with the sniper will be able to leave the building with the sniper? Everyone else who tries to leave with the building with a sniper will lose it?
No, anyone who makes the shot can take it
Hitting the target 700m away. It's not a restriction as such because everyone can do it, it's just to make the players jump through some hoops if they want a sniper rifle
Who likes screwed groups missions?
Error in expression <_drawArr set [2, _obj call _posCode] };
drawIcon3D _drawArr;
} forEach drawPlaye>
Over and over in my console
Thanks shitty AU server
facepalm
People not checking someones dead before using certain commands
WARNING: Function 'name' - Transparent is dead
name(onDeadplayer) == WARNING: Function 'name' - Transparent is dead
who wants to help me dev a tonao life server?
@tough abyss Why? Why do you wish to develop a tonao life server?
@peak plover $$$
That's a bad reason to do anything. How about "Who wants me to help dev bleach into arma, so I can just drink it whenever someone brings up life servers?" instead?
@peak plover people in my country want it badly, also i dont make money out of it, im just doing it for our arma 3 community
Well, why are you making it then? People in your country want food and healthcare, does this mean you will have to provide them with it?
@peak plover are you the nigel from 2017mod?
I enjoy playing arma, so I make missions for arma. Spend hours on scripts, because it's fun. Don't bother making a tonao life server if you wouldn't enjoy making it. There are plenty of life assets available for life servers and roleplaying on armaholic and the bohemia forums. No I'm not from any mod. I'm just a script junkie.
@tough abyss what country is that btw?
@thin pine South Africa
Well...debates about life servers tend to be expansive around here. So all I'll say is that developing a life server, assuming from scratch, is very time consuming, hosting one is expensive. On top of that, life servers have a very bad reputation among many 'arma veterans'. Finding a decent scripter around here who's just willing to set it all up for you is going to be very difficult
Just as friendly advies, I wouldn't get your hopes up
@tough abyss more that the command should just return name of the dead unit anyway.
@halcyon crypt the one you mean is called: @barren fable
ah yes ๐
@little eagle No, I was just spawning the tank with me in it in the editor.
curiosity, is it better to use FSM for like AI Behavior during combat. So lets say event Hit or FiredNearby occurs
And I task the ai to call for support by nearby friendlies in radius of 800 in that event handler.
They get tasked to attack (CBA_FNC_TASK_ATTACK)
When there's no enemies left or enemy left the area they go back to their original patrol route.
Or what do yous say?
I think they're compileFinal'd either way.
Can I used exitWith in a PFH to skip this loop and get into the next one reel quick ?
yes
@wispy patio I can't get TurnIn or TurnOut to fire either. Looks like it's broken.
That makes me sad ๐ฆ
Same. Maybe try on dev branch?
I actually had to switch back from dev branch yesterday because when I loaded it with mods it crashed on startup. No idea what was causing that.
marc_book confirms that the config version doesn't work either
1.66 both
Which is sad, because Eagle :/
Yeah the Eagle sounds pretty cool.
I'll probably write a polling loop in the meantime until they fix it.
So you are saying that it's broken on dev too?
No, I'm saying I couldn't even get my dev branch to launch but that is probably an issue on my side.
OK. ironie isn't online, but my best guess is that he's on dev and it's fixed / correctly implemented there
wiki says 1.66
And addEventHandler does report a correct incrementing index
otherwise it would report -1 if the event handler name wasn't recognized
We had that for ages with GetIn/OutMan too, so just returning a valid index doesn't mean it's implemented
@thin pine Very true statement. I don't run a life server but I enjoy them and develop for them, primarily because that's what I enjoy in ArmA. But because I do actually care about my rep I try to make all my stuff from scratch. It's AMAZING how fast life developers accuse of script threft. I haven't even released all my content and it's apparently already stolen, even though I have spent over 100 hours putting it together
To be fair though, life communities are stupid. Noone can cooperate or be friendly with each other. Life Developers tend to never help others which is really a surprise I have found... People ask me for help and I'm not even that experienced, but noone else helps them, it's really a shame, especially when you compare it to the cooperation on this discord
๐
BoGuu is a nice guy.
Life devs are just not friendly with each other because they are competing businesses. Money changes everything
Are anybody here interested in helping me out with a scripting problem? I'm having trouble with one of my init scripts. It's not working as expected when in multiplayer games. In single player it works just fine.
I will pay by the hour if someone would like to help me out over teamviewer
@cerulean whale
To be fair though, life communities are stupid. Noone can cooperate or be friendly with each other.
Everyone is special!!!!1111oneoneone
Life Developers tend to never help others which is really a surprise I have found...
Hi (btw.: I made my whole stuff public on Github - But yeah, about 90% are selfish bast***s)
People ask me for help and I'm not even that experienced, but noone else helps them, it's really a shame, especially when you compare it to the cooperation on this discord
Welcome to the World of LIFE
No teamviewer. Put your init line on pastebin. I can look at it
the walking sequence is not really commented out, its just looks like it in pastebin
the walking animations dont work at all in multiplayer. I did try to see how gmwo does it in his wap mod
I tried to replicate his method
but then offcouse the legs wont move. dont understand why it works in his mod at all
you need to show "walking_sequence.inc.sqf" too
what youve posted so far doesnt actually do anything. whats in "start_walking" and "stop_walking"? If it works in SP, but not on hosted MP, its a locality issue.
yeah thats what I've been thinking
@jade abyss Yup
the problem lies within these lines somehow
the comments is what I dont understand from the WAP mod
when your a client in a multiplayer game, he doesn't activate the animations from the client side
but I just dont get how he gets them to move at all
animations themselves are global so you dont need to do it on all clients
even if the variable activating them is private
?
and I dont want all the mech to move their legs when I move the ones on the one Im in
if i use the animate command to animate one object from one client, all clients would see that animation
the way it gets activated on the client itself doesnt matter to the other clients
so the command is sent to the server, and the server sends it out to all clients?
makes sense
but its not working ๐ฎ
this code should work then, but the legs only move on the server machine
if(isMultiplayer)then {
if(isServer) then {
#include "walking_sequence.inc.sqf";
} else {
//something that is not walking animations
//activating sounds on different distances
};
} else {
#include "walking_sequence.inc.sqf";
};
kk
I don't get this script, select sqf next time you upload. There is not context to this. So it's hard to understand
init_walk.sqf
walking_sequence.inc.sqf
start_walking.inc.sqf
stop_walking.inc.sqf
die_anim.inc.sqf
playsound_walk.inc.sqf
oh god sorry... I still chose c++ highlighting
and now I've reached my limit T-T
its still readable
might be that #include fails on your server
did you allow .sqf as allowed file types?
Hey, I'm using the inventoryOpened EVH and I've trying to get it to return the classname of the item when I double click on it. However lbData [IDC,INDEX] (taken from EVH _this) just returns "". How would I get it to return the classname?
@wispy patio ironie says he's on 1.67 dev
yeah @indigo snow I am
allowedLoadFileExtensions[] = {"hpp","sqs","sqf","fsm","cpp","paa","txt","xml","inc","ext","sqm","ods","fxy","lip","csv","kb","bik","bikb","html","htm","biedi"}; // only allow files with those extensions to be loaded via loadFile command (since Arma 3 v1.19.124216)
Instead of animate -> animateSource
And combine one Anim into 1 SourceAnim
might be better practice, but would that be a reason for it working in SP but not on MP?
Could be
No wait
animate should be broadcasted
Are you sure, the others load the same model/same File?
yeah its done the same way in the WAP mod. its works there
oh yeah. Im actually just running a local dedicated server that I joined myself
and Im using the exact same mod on both
but I first discovered the problem when a friend joined my game
I installed the local server for troubleshooting
Check the bottom
It is recommended that animateSource command is used instead of animate whenever is possible, as it is more efficient and optimised for MP```
oh, mkay. I'll try that. I'll switch them
better practice, yea, but it shouldnt stop it from working in MP vs SP surely?
Never seen it before :D
Anyway: AnimateSource gives you a way better option to play with Anims, since you can trigger 4-5-6-7-8-xxxx Animations at once, in one anim.
Just the startingtimes suspend
yeah but I like that the new multiplier option has come to the animate function
so that I can override animPeriod
erm... wasn't there something for Source also?
hmm, can't find it. Maybe i mixed those two
ah @nocturne basalt arma might interpret the file extension as .inc.sqf and not .sqf
maybe
oh
nah
I remember having a file named Name.BK.sqf, still worked as usual
Other than checking if this is actually even executing on the server with some kind of debug message, I cant see any obvious (locality) mistakes
here is something interesting. When I switched 'animate' with animateSource, I got the problem even in SP
did you change the animation names? animateSource uses a different input
you feed the name of a class in the animationSources, not in the animations class in the model.cfg
Hey, I'm using the inventoryOpened EVH and I've trying to get it to return the classname of the item when I double click on it. However lbData [IDC,INDEX] (taken from EVH _this) just returns "". How would I get it to return the classname?
ah, I forgot the 3rd boolean parameter
No! I didnt. I still have the multiplier present
it should be a valid parameter
_destroid animateSource ["L_leg_1_Z_Rot",0,_sm];
_destroid animateSource ["Body_Y_upward",1,_sm];
A little detail on it now, I tried a different system but want to see why this isn't working, when I do [_this select 0, _this select 1], it returns [No Control, 0]. Even though a control is defined
But then when I just put the ctrlName in _this select 0, it just returns an empty string when I go for lbData
You cannot return the class name of the item in the inventory ui
You can only return the display name and the picture
I use this logic to store the name + picture combination of all items/weapons/magazines in config on a pseudo namespace to retrieve a classname
But it's obviously not perfect as two items with the same display name and picture are essentially indistinguishable. It was enough for what I was doing though.
Well at the moment I have an issue with it even giving me the display
I add into the EVH ```SQF
test = findDisplay 602;
and return ```SQF
No Display
@indigo snow I have actually been using the class names from AnimationSources all along (even when using animate) but it worked
then i have no other clue than checking if the script is even running on your server via some debug messages
I'll do some digging. Thanks for your help so far
๐
I'm actually using the same animation names. the ones in model.cfg = the one in AnimationSources
thats why Animate has worked so far
@little eagle
commy2 - Today at 8:41 PM
You cannot return the class name of the item in the inventory ui
You can only return the display name and the picture```
You mean inside the Inventory LB? Then: Your answer is wrong. It just works with Magazines.
If so then I never noticed that. But I don't think that alone is enough for what they want.
But yay. Now I can distinguish between Handgrenade and HandgrenadeStone
We had that a few days ago
Makes no sense, same as: You can not remove a single item from a Vehicle ๐
yeah. imagine all these actions being sqf commands and the whole menu being sqf
but nope
all hidden in C++ land : /
To manipulate it and to have useful sqf functions
You can manipulate it
yeah, not in a way I want
means?
True
So I got an array with 6 arrays in it. I want to change the third array's first value and missionnamespace setvariable it.
I can only thing of : get the full array, remove from main array, change it, and add to the main array agian
(_array select 2) set [0,newValue]
will change the value in place inside the array
will modify the original array
Like if your array is a MissionNamespace variable that will also be directly updated.
But you have to manually publicVariable if you want to do that
main_array = [[group1,[true,false,false]1],[group2,[true,false,false],[group3,[true,false,false]];
main_array select 1 set [0,true];
Is that correct?
main_array select 1 -> [group2,[true,false,false]]
so no
main_array select 1 select 1 set [0,true];
((main_array select 1) select 1)-> [true,false,false]
yes
use parenthesis to be on the safe side
So this will automatically update the main array stored in the missionamespace?
yep
@peak plover
If you write a more complex Array, make it more readable for yourself.
main_array =
[
[
group1, //main_array select 0 select 0
[ //main_array select 0 select 1
true, //main_array select 0 select 1 select 0
false, //main_array select 0 select 1 select 1
false //main_array select 0 select 1 select 2
]
],
[group2,[true,false,false], //main_array select 1
[group3,[true,false,false] //main_array select 2
];
Or just don't create horrible arrays like this.
I thought this might be a problem since I got the the array by using [main_array] call fn_bigscript. then _this
โ
_this would then be [main_array]
to get to main_array you would have to do _this select 0 again
I used to have group setvariable instead of every array entry
this is wrong
Why do you need the 2nd Array anyway? ( [true,false,false] )
It's basically aah
is what you want
goes to bed and let's commy handle the rest
let's start over at line 1
Lets start with: What are you trying to achieve.
Ai script, it used to be I used group setVariable to attach all the knowlage the script will need for every group
I'm trying to change that, because I'm now using deleteunit rather than enablesimulationglobal to cache the units
So instead of setvariable I must now have an array with all the variables for each group that are all added into a single array that is used to store information. This would also allow for saving into profile namespace for persistance
profile Namespace +persistance = urgs
Urgs!
Urgs!
Urgs
it means that they're disgusted with that method of persistence ๐
urgs = eww, no, don't do that, disgusting.
I read those 4 lines, but still have no idea what you're trying to do
Alternatives ?
Oh btw. Same here
T-That doesn't help
stop pasting images of scripts
I tried explaingin it
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
github gists with syntax hghlighting!!
does that define_units ?
Can we all agree that this is how you NOT do SQF?
erm, I do. commy
Anyway, what does that do and what is that Array needed for?!
Where do you wanna use that in those pictures?
PICTURES
P I C T U R E S
it's telling me 1000 words
stop being patronizing and help the dude
Including .sqf can be useful
I'm trying to help, but I dunno where to start.
Depends how you like to do things. Lots of people use it to make something seem modular
Is it that bad? :S
@dusk sage Thats what Functions are for
It looks pretty bad tbqh.
2nd thing is: P I C T U R E S
Of course, but CfgFunctions won't include the file in another ๐
I've seen it used for map stuff from Xcam
No need to include files, when you can make a function for it ๐
I use include to add the arrays of untis
But what would you implement? Still confused.
It stops you needing to use a function, it gets pre processed into the one
Inline for SQF
okayyyyyyyyy
nigel: same - I'm processing my array data with an external tool 1 step before I build the pbo, so it just gets included when I build
I've done it and I regret it.
SQF is not meant for inlining
I leave that to C++ compiler
lol
Some people include .cpp in C++
Idk
Take the first line as example
if !(typeName _pos == "ARRAY") then {_pos = [_pos, _pos]};
What the is that?
What the is that?
Means that I can have either a single logic for the unit to spawn in and patrol in. Or I can have 2 logics so the unit spawns around first and moves to patrol around the 2nd
I don't get it. Why is it named _pos?
I don't want to shit on it, but it's pretty hard to understand when _pos is an array of two objects
Or at least sometimes it is
You'd think _pos is a position
like [x,y,z]
or at least [x,y]
Or... _pos as in the logic used for position
๐
Consider me confused.
What is fnc_findLandPos
The plot thickens
getPos _pos ๐ค
Hey atleast it's not as bad as some people. I've seen people take pictures of their code with their phone
no clue if xJenny99x is @peak plover though ^^
Yeah, updated one 'tho
I'm still not over getPos _pos
That should error
expected: object, encountered: array
or something like that
https://github.com/xJenny99x/The-most-beautiful-REPO/blob/master/free_dosh.py hmmmm not sure if @peak plover deserves help after seeing that ๐
Solution:
Ctrl+A
Del
Restart from scratch.
What's a better way of doing something with the same functionality?
@little eagle the getPos function will return the position of an object.
Long time since I worked with scripts in ArmA 3
writing it on your own.
sudo rm -r ./
not sure if trollanswer or...
It's a puzzle. Glad you sovled it
@eager minnow But it errors when you use it on a position.
getPos _pos
That doesn't look right
getPos [1,2,3];
But _pos is the logic used for positioning
like asking your Doc for a Doc. Doesn't make sense.
@little eagle the function expects for example a unit object or an item
Logic as in module?
The Bohemia Wiki is also always a nice place to search for functions: https://community.bistudio.com/wiki/getPos
Bear in mind the 2017.01.14 version of this script works, no script errors. All I am trying to do is change from _it setVariable ["aiMaster_patrol",[_pos select 1,_distP,_patrol,_out]] to an array. Because groups run into a limit of 144 and I want to delete the groups if the units are cached.
But getPos on a positon doesn't work
Anything can be used
Why not name it _logic ?
I'm bad with names...
or _object ?
Yes because it doesn't expect a position, it expects an object of which u want the position of. For example you want to know what the position of a unit is on the map then you'll get is with getPosition _myUnity
@eager minnow Pls perform a rightClick on my or commy2's name. Then go to "role". Rest assured: We mostly know what we are talking about ๐
_obj = [0,0,0]; _pos = player; _pos setPos _obj; ๐
I'm a 9/10 SQF guy according to a random Slovenian.
I have trouble remembering them, and I never intended to share this script. I'll surely tidy it up. Do not worry. A rewrite is in progress currently hence my interest in the arrays
@little eagle 5/7
Why 7 ?
google it^^
I don't mind sharing. Just don't think anyone would want a script this specific.
@jade abyss yeah thanks didn't look at it just trying to help ๐ As I also said it has been some time since I did work with the ArmA 3 scripts (SQF). I am just firmiliar with programming languages in general.
perfect score
Blue/Orange/Green = Those guys know their shit. @eager minnow (mostly)
I'm white...feelsbadman
Alright ๐
Yep Commy
How to meme 101
There is more, where he fks him up ๐
Not applicable to any other scenario, bro
5/7 = Best note ever. Like: "The Dark Night" XD
Needs better variable names. And more functions and less includes.
do you still need halp @peak plover?
That would probably get rid of all problems
if ( isNil "_oldStance" || typeName _oldStance == "BOOL") then {
this line is broken
if _oldStance really is undefined
Then the second evaluation will error out
@little eagle Do you happen to know how I can select from an event handler array inside an the event handler?
I thought I could do it with _this.
Like so:
TurnOut = "if ((_this select 1) == commander (_this select 0)) then {(_this select 0) execvm '\uk_mbt\functions\Commander_Turnout.sqf'};";
The if doesn't work though because the script also runs when I turnout as driver.
Are you on dev now?
Yeah.
Cool, Seems to work there then I guess.
At least the script runs now. Still can't figure it out completely :p
Here is what I'd do:
leave the config level ASAP
TurnOut = "_this call Rik_fnc_handleTurnOut";
And then use CfgFunctions to define Rik_fnc_handleTurnOut
or however you tag your functions
That is much easier to do than to edit shitty one liner strings where you have to escape each quote mark just to have mikeros tools replace all true with ones and all that junk.
As for _this select N
I'd use params to define all passed variables.
Wait
So in the eventhandler what is "_this" actually?
The passed values
It's an array with info about what happened
vehicle: Object - The vehicle the event handler is assigned to
unit: Object - The unit performing the Turn Out action
turret: Array - Turret path
So
first line be:
params ["_vehicle", "_unit", "_turretPath"];
And then you can use these variables
kill it with fire
Hmm I see.
params explodes the passed _this array into it's elements
That is a million times more readable than (_this select 1) == commander (_this select 0)
Because now you write:
_unit == commander _vehicle
Yeah. Good question. Does turnOut run on all machines or only on the drivers machine?
There is no doc about it. I guess it runs on all machines.
private _maxRange = 10000;
...
while{ not(isNull ( (uiNamespace getVariable "rhs_spo15_ctrl") displayCtrl 8655)) }do{
private _targets = _v nearEntities [["AIR","TANK","CAR"],_maxRange];
_targets = _targets - [_v];
TurnOut saving performance hardly matters though. You turn out like ten times in a two hour mission...
RHS scripting ๐ ๐ซ
yeah i used Air
probably worse in real scenario
if( (_d>5 AND _d < 20) )then{_h pushback "12";};
if( (_d>20 AND _d < 40) )then{_h pushback "3";};
...
and so on for 360 range
could've used math
does _h pushback "12" exist twice in that collection of if() checks?
4 times
// function to calculate direction to target
_calcSide = {
params["_d"];
private _o = [];
if( (_d>355 OR _d < 25) )then{_o pushback "rwr_lights_10RS";};
if( (_d>15 AND _d < 45) )then{_o pushback "rwr_lights_30RS";};
if( (_d>35 AND _d < 85) )then{_o pushback "rwr_lights_50RS";};
if( (_d>65 AND _d < 105) )then{_o pushback "rwr_lights_90RS";};
if( (_d>95 AND _d < 195) )then{_o pushback "rwr_lights_RS";};
if( (_d>165 AND _d < 270) )then{_o pushback "rwr_lights_LS";};
if( (_d>260 AND _d < 295) )then{_o pushback "rwr_lights_90LS";};
if( (_d>290 AND _d < 315) )then{_o pushback "rwr_lights_50LS";};
if( (_d>310 AND _d < 345) )then{_o pushback "rwr_lights_30LS";};
if( (_d>335 OR _d < 5) )then{_o pushback "rwr_lights_10LS";};
_o
};
At least it doesn't tank FPS
I better shut up about it. Stones and glasshouses.
https://git.koffeinflummi.de/bwmod-team/bwa3-public/blob/master/bwa3_tiger/functions/fn_onDrawMFD.sqf
Public repository of the BWMod (Sanitized code and issue tracker) --- รffentliches Repo der BWMod (Gefilterter Quelltext und Bugtracker)
It's old.
Or at least the original was. This one is like a year old and a copy paste from whatever the Leo has.
{_threats = _threats - [_x];_threats append _x}forEach _threats;
threatception
wait what?
I guess they don't know about reverse
It's a nice touch 'tho. Having the helicopter tell you, that you are about to recive a missile is great.
lol
Wouldn't it be pushBack if they want to reverse the array instead of append? ๐ค
True
Also, you're absolutely not supposed to modify the array size while iterating though it.
Undefined behaviour
Nah
true. Right. No problem then.
still tho
{_threats = _threats - [_x];_threats append _x}forEach _threats;
^nuke that
actually it doesn't reverses it
basically threats is array of arrays
so it kinda unfolds it into single array
Why the - [_x] part then
Reasons.
just make a new one with a different variable name
private _newArray = [];
{
_newArray append _x;
} forEach _threats;
_threats = _newArray;
there
A million times nicer
And prolly faster
definitely faster
Maybe that had a reason for only wanting to use the one variable
But the other one looks more fancy
Basically the whole script is a mess and destroys FPS too
Makes even less sense BoGuu ๐
๐
Only use one variable to save performance : S
oh myy
Looking forward to >144 groups
Great. More than 144 groups. Make Arma even slower than it already is. ๐
Doesn't Arma 3 has much higher limit already?
On dev it has apparently
The low frame rate is another layer of added artificial difficulty. It's a feature.
Just 288, I thought they would virtually get rid of the limit
64 bit won't increase the FPS. Believing that is insanity.
No idea why there is limit in first place, doubt it has something to do with preallocation
probably fool proof limit
Well. 288 can be 576 if you use resistance as well
They probably rolled handful of dice
!roll D256
Refresh rate 144, Group limit 144, coincidence?
"refresh rate" ?
It's what I call my arrays which don't seem to have any other more compelling or fitting names. /jk
They foresaw 144hz monitors back in 98 so they can simulate group each frame for perfect performance /s
144Hz monitor and the game runs at 15 FPS. GG
Actually I just figured how group limit is calculated
GroupSquad * GroupPlatoon * GroupCompany
number of config entries in each
basically it is limited by possible group name combinations
4 * 4 * 9
144
#Rigged
Nevermind I think I'm wrong, GroupCompany has more than 9 entries
*czech
Don't the russians have 3 squads in a platoon ? Atleast the motorized infantry should have 3, as far as I remeember about the 2002 setup
the limit for groups exists because of performance reasons, groups surprisingly eat resources too
There a way to animate locally?
Hey, I changed colour in an RscEdit but it is giving me a black outline. https://gyazo.com/95eeec2267ef767323688418576a7aa6 I have changed colorBorder to invisible but that didn't fix it
Anyone got an idea
?
shadow = 0
I did colorShadow as well, I set it to invisible
@tough abyss https://community.bistudio.com/wiki/switchMove
I meant animate command, local version of it
Ok is there a specific hit even handler for the moving targets? I've got hits registering fine on the static targets but nothing from the moving ones?!?
@indigo snow @jade abyss I got the animation somewhat working when in multiplayer, but it seems like the server is having trouble sending out animation information to the clients. Here you see how its supposed to work(in editor), then how it works when joining a server
Anybody know what could cause this? Even the death animation isnt activatied at all, and It takes alot more bullets to kill the vehicle. Its like the server is having a hard time receivind data from the client and vice versa
and this is a local dedicated server. my ping is 5-6
it seems to hang in the extreme positions, maybe check the logic for animating? I think i remember it was based off of the animation phase.
I meant the checks for animation phase, are there cases where if the state is on a boundary none of the conditions will return true?
hm no dont think so. Shouldnt they also have problems in SP then?
its just something I noticed in the video
ok
the conditions are quite simple actually
if (_destroid animationphase "m_L_groin_X_forward" == 0) then {
if (_destroid animationphase "m_L_groin_X_forward" == 1) then {
if (_destroid animationphase "m_L_groin_X_forward" <= 0.9999) then {
and you saw the legs suddently started moving after I exited the vehicle. They should only move when the speed is > 5
I wish I didnt need arma installed to do some programming and test if it works ugh
is there any possiblity to refresh dialogs used in a mission without restarting arma?
requires arma3_diag.exe though
or just dev branch, not sure
another option is to build the dialog programmatically then you just have to restart the mission
I guess you could write an export script that turns it in a config based dialog for release
thanks for the hints. it seems diag exe is needed as far as i read. i think currently it is faster to restart arma but this will be helpful for bigger projects.
@nocturne basalt Execute the Anims Local on the Owner, not from the Server. This should solve some of your Probs
Question if anyone knows, so I am using eventhandler with CBA to run a function when hit. Now if I add units in zeus or through a spawning script.. What is best way to add these eventhandler to those new units (I know in spawn script, I can just use the addeventhandler but I want a general check, than keep modifying scripts to fit).
@little eagle would know I guess, sorry for pinging you ^^
Can you show what you're doing atm?
anyone know how the box-drawing and selection part of 3den/zeus is done? script or hardcoded?
Hi Commy, I am just right now running a eventhandler for HIT on all AI units that have been spawned through mission editor. This is now done with ArmA 3 default one and not CBA.
WHat I want to do basically is to run this on every new AI unit created: _x ["hit", fn_findNearby] call CBA_fnc_addEventHandler;
I can do a CBA_fnc_addPerFrameHandler check but I think thats a bit overkill
_x ["hit", { _this call fn_findNearby}] call CBA_fnc_addEventHandler;
["CAManBase", "hit", {systemChat str _this}, nil, nil, true] call CBA_fnc_addClassEventHandler;
I assumed that was the case and inside my function findNearby I just have to do a check if unit that was hit is a player, if it is then exit
else find nearby ai units and run taskAttack
on shooter last known pos
Idk, CBA_fnc_addClassEventHandler is basically addEventHandler, but for classes instead of objects.
Sounds like that is what you need
Yeah, I looked at it
but was unsure if this was the case.
Perfecto, happy as it is
basically just implementing dynamic ai to react when friendlies are getting attacked
Can't use upsmon has it has moer than what I really need
Will diag_mergeConfigFile appears on stable branch?
@jade abyss ok Ill try. Will people see others legs moving then? or just their own?
hay i got a problen with somthink i dont no i have it righton in my SQF for a random load out that is set that works i buy some new stuff from a store i made in game sync data and i see it save's it on the databace but when i relog it duz not load the saved data can any 1 help thanks
No @safe forum
@nocturne basalt animate/animateSource is Global, so everyone.
@little eagle Thanks
@jade abyss som just like this? if (!isServer) animate ?
then what if my pc is the host? then everybody else will animate but me?
the script command itself has global effect, so a isServer check won't stop it from executing there
Again:
GLOBAL
Means: Syncronized over the Net
Short: Just execute the Animations on the CLIENT. No isServer checks or whatever (no clue why you even started with that oO)
+Also do yourself a favor and check the Biki, what effects the Commands have that you use (G = Global (everyone gets an Update) | L = Local (nobody, except where the command is executed gehts an update))
ok thanks I try
I have been using _local variables all the time btw
poasenbraew tb t
nah.. someones else. Not in the mood right now^^
@little eagle I don't want to^^
@rancid ruin i tried searching for you but couldn't find it. However if you want to script it try this http://killzonekid.com/arma-3-bounding-box-utility/
_myVar is a local variable inside a script
myVar is a global variable, which means it exists on missionNamespace and can be accessed from all other scripts (in the same namespace)
you also have locality, in short local. if you own an object, say the actual player object, that means that object is local to you. player is also different on every machine
if you're the driver of a car, that car is local to you
so then we have SQF commands, where some requires the argument to the command to be local. a good example would be setFuel command. if you're the driver of the car, the car is local to you. so that command will work fine. this is what AL (arguments local) means in the scripting wiki. next to AL there's EG (effects global) which means that if the argument to setFuel is local, the effect of that command (fuel) is global. hence it is broadcasted
hope that helps
myVar can also be a Variable, wich is NOT replicated/transmitted over the net (e.g. in the missionNameSpace).
@thin pine I meant box drawing with the mouse for object selection, e.g RTS games/editors
Global variable is a shitty name considering they are local to one machine usually by default.
I mean, I understand the concept is from other languages, but that doesn't mean it's not shit.
Yep
Hey, is there a silent way (No Dialogs show ) to kick someone back to the lobby?
endMission should do that
anyone knows what PAA actually stands for?
maybe the P stands for portable like it does in png
Could well be something in Czech though
portable network graphics is a crazy name for a file extension when you think about it
surely portable and network make each other obsolete
I'm guessing the PA in PAC and PAA stand for the same thing
second A is alpha i think
probably picture, BI like that word
this makes your life easier yeah?
commy happy? What is this
It doesn't make my life easier, it makes my recreational more fun.
Good question. I never tried on map locations
Also, I'm usually a very happy guy tbqh. I just complain so much, because I really like like like the good parts about life.
probably works for all, no reason not to
as locations are 100% local anyway
Yep you can delete map locations
labels still show
locations are 100% local, not synced in any way anywhere
I have an interesting question. Is it possible, via scripting in the editor, to get a list of mods a player has installed, and output that to the side chat when they join a game for debugging purposes?
private _mods = "true" configClasses (configFile >> "CfgMods") apply {configName _x};
Can you be sure every mod will have a CfgMods though?
why not CfgPatches?
CfgPatches is a huge list
CfgPatches is more like a PBO list and CfgMods is a mod list
insert my last 2 sentences
You don't have to participate in the conversation if you don't care at all.
as boring as ever
Thoughts?
private _vanillaMods = ["curator", "dlcbundle", "expansion", "heli", "kart", "mark"];
private _modList = (configSourceModList (configFile >> "CfgPatches")) select {
!(toLower _x in _vanillaMods)
};
configSourceModList only reports stuff that has a CfgMods entry, no?
Oh, I'm not sure. It returns me
["@CUP_Terrains_Complete_RC","@CBA_A3"]
That's definitively not the entry in CfgMods for CUP Terrains, but it could be it requires a CfgMods entry and then returns the folder name
I'll remove the CfgMods and try again
Maybe it's also using the mod.cpp
The thing is that these @ folders break if you put all PBOs in one folder as a mod pack.
also, btw
private _vanillaMods = ["curator", "dlcbundle", "expansion", "heli", "kart", "mark"];
private _modList = configSourceModList (configFile >> "CfgPatches") - _vanillaMods;
^ this should be faster
Yeah that's better. I was worried about case sensitivity for some reason, which makes me wonder if - ARRAY is case sensitive
I think the full proof method is CfgPatches, but that returns a lot more than you probably want
It's annoying to work with, yeah
assuming that this was on an init script on a playable soldier: this sidechat ("I am connecting with " + configSourceModList (configFile >> "CfgPatches")) (not completely accurate but I'm looking to get in the ballpark here.
If you don't want to check every PBO, your method seems best.
No, whisker
That would report the local mods every time, not the mods of the connected client
cause configSourceModList is executed on the local machine
ok, that little tidbit I didn't know.
First of all don't use the init box for this, but initPlayerLocal.sqf
And then generate the addon list there
I'm mainly asking out of curiousity, if it's possible to get a list a mods that a player connected with. From there a scripter can do with it as they wish, from just noting it in the log to a boot for not having the approved mods installed.
so sideChat executed locally on the player's machine does not broadcast to everyone?
No, but you can broadcast using remoteExec
I'm at work right now so my ability to look up the functions is a little limited right now. working off of memory.
"<chat message>" remoteExec ["systemChat"];
Reminds me a little of windows RPC calls there...
It sucks, but remoteExec is an easy quick work around for commands with local effects like chat commands
ok, that really reminds me of RPC because it sucks too. ๐ noted.
hmmm... ( configSourceModList (configFile >> "CfgPatches") ) remoteExec ["processPlayerModList"] (and now to define processPlayerModList on the server....)
try to use some variables instead of making it a shitty one liner no one can comprehend.
systemChat already is a command usable by remoteExec
Sorry, it's a habit from my days of working with perl... some of those 'optimized' perl scripts can be truly nasty to work with.
no need to define a function
There is no need to optimize a script this little that only happens once for every player at the mission start
systemChat is good for debugging purposes, but ultimately I think the solution I would like to reach for, is where the server manages what mods are allowed and if one has a mod on that list that is not allowed (a hack mod for example)... they're given das boot.
is it possible and if so how would i start with making all Vehicles stop taking dmg after being fully red (not exploding) ๐
I rather not have that list of allowed mods be sent to the client to be processed though, as it opens that list up to being altered.
Makes sense of what I'm reaching for @little eagle ? Even if it's a little beyond my reach right now, I don't get better if I don't set some difficult goals now and then.
Why not turn signature check on?
thanks @rancid ruin
@woeful void You could do that with ```
activatedAddons
No
It's possible, but I think the goal here is not to verify if a mod has been hacked, but flat out allow or deny only the mods that mission maker wants in.
CfgPatches is more reliable. activatedAddons is a piece of shit and doesn't even list everything under certain circumstances.
so even if it's legit.. if say a gaming group dislikes X mods from steam, don't allow a player to connect with it.
For some reason I thought activatedAddons only gave the "activated" or addons in use in that mission at that moment
ye, and just chuck mod names in an array
why kick someone for running a mod you don't like when you could just enable signature checking?
It can be bypassed
somegroups have funny ideas about what mods are 'realistic' and which ones aren't... and play accordingly.
I doubt any serious realistic gaming group would allow the stargate mod, for example. ๐
but nobody would load the stargate mod and try to connect to a milsim server
i don't understand the issue
the issue is to restrict what mods can be used on a map as per the mission maker's requirements. This coul dbe for various reasons, from ensuring everyone has the right mods in the right order so there's no rude surprises, to keeping unknown mods from creeping in and hacking a server, bringing it down for everyone (which happened to me on a public server last night... I didn't like getting strapped to a jdam and dropped on the airfield where we were mustering.)
some of those requirements could be for set pieces too. A mission based around 2016 shouldn't have assets and equipment from 2035.
So, are you saying "don't tell the client what mods the server needs, but rather let anyone join and only filter those with mods you choose?"
Hackers have found a way around that. I don't know how.
activateAddons
I imagine, while a server says it needs x,y,z... it doesn't have the ability to tell that client, "-don't- use any other mods"... I can be wrong though.
I'll have to give that a try @willow pike.
I am asking because I've seen a bit of traffic where "unscrupulous monetising server operators" don't want to admit what mods they are running.
Ah, I can see that concern.. no I'm addressing the opposite of that problem, where the client is the one running mods they shouldn't and want to hide.
added some other info to the gist.
I hope I'm making sense here @open vigil
Hackers can also very easilly find their way around something that relies on CfgPatches
Sad but true.
Best way is bisigns... Which can be circumvented.. but thats the best you have
Just have no CfgPatches in their Mod... Or just name it the same as another Mod that is allowed
I suppose the only real way to lock it down is to have a map specify the mods and the signatures of each mod.. and if their list and the client's list don't match, denied.
white list approach there... blacklist would be only of limited use since mods change so much and there's a lot of them out there already
anyhows, you all gave me some things to try and think about, so thank you very much. I'll have something to play with over the weekend now.
are you running battleye?
BE and SignatureCheck should be the best
any third party cheat detection (and I mean third party as in a separate process from the game itself), can be and has been bypassed quite often. it's pretty clear with any FPS based game you see on the net now... rainbow six, counter strike, the works... there's a ton of videos on hackers in those games, and they're rarely caught before they had a chance to ruin a game.
I'm looking at more preventative measures, not reactive.
again, this all is really just a difficult challenge I set for myself so I can get better at scripting for arma 3. It does have potential benefits for others but the real purpose is to push what I know.
You won't get them with PBO or mod checks.
That was true with old Battleye.. But it changed quite a lot last year.. And if you are handling such cheaters that can circumvent battleye you have no chance anyway
I figured.. but since the goal is to learn the scripting a lot better, it's the best solution I could think of without going outside of scripting.
Do something less futile if you want a scripting project.
the point is I don't care if it's futile, as long as it teaches me what I'm looking to learn. Then it hasn't been...
You don't get better by always sticking to the tried and true. then you are only learning by rote, not by true understanding.
You sound motivated.
been hacking on computers since I was 16 and I'm 40 now... the only thing that's slowed me down has been age.
I doubt I'm going to lose that motivation any time soon.
working for naval intelligence, took me from a rank 0 in perl to a master in only a month. the easiest way for me to learn is to just throw me into the deep end and see if I sink or swim.
With SQF you always drown in the end, lmao.
but at least it'll be fun in the attempt. ๐
Personally, one of my more fun goals is if someone joins a server with the name "M Jackson", they end up moonwalking everywhere. ๐
no idea how I'm going to do that yet but still sounds fun.
Anyhows, thank you for the information ya'll.
Talking about SQF, her my zombie brain in SQF: https://forums.bistudio.com/topic/193884-brpvp-english-server-and-client-files/?do=findComment&comment=3142842
you know what I want to see.... ๐
Zombies manning a tank...
the worst gunnery, the worst driving, evar.....
I have a problem with the Mirujana on my server you cant plant seeds for it anyone know how to fix it?
mirujana
probably my there sucks for at english but you know what i mean weed canabis? you cant plant it
๐ฟs
that's one of the greatest sentences i've ever seen
sorry im a bit tiered
keep it up, you're doing good
Anyone there can help
you should probably try some A3Life support channels
@rancid ruin no need to be like that. We have enough of that here already.
What @halcyon crypt said.
Where do i find that then?
Dont think theres much active Life server people here.
ยฏ_(ใ)_/ยฏ
Dammit
would be nice to know where to send people for Life related stuff though
do you know what script it is cronnax?
If its your server you must have got the life server stuff from somewhere?
cos people might be able to help if you show them the script
but just saying you can't plant marinanja doesn't give people the full picture
As said not many active.
I dont know what script i should find the variable in for it
Where did you get the server files? theres no documentation with them?
you need to either a) wait for the developer to fix it or b) learn some mission making and sqf
it's probably in a file called weed.sqf or something
I will see if i can fint the script
have a look
Hey, is there a scripting command to create an item at the position of the player (at their feet)?
get position using modelToWorld then create a groundWeaponHolder i think
I know that, I'm just thinking of what command would create an object on the ground?
object: createvehicle or createsimpleobject
item you can pick up: groundweaponholder
groundWeaponHolder
there's groundWeaponHolderSimulated or something too but i was never sure what that does
@halcyon crypt
For vanilla life framework stuff
discord.gg/P7rKv
I have a problem with the Mirujana on my server you cant plant seeds for it anyone know how to fix it?
probably my there sucks for at english but you know what i mean weed canabis? you cant plant it
plz fix me Mirujana commy1 ๐ฆ
Guys. I like a laugh like anyone else, but dont you think your jokes are becoming a bit stale?
What jokes ๐ ?
all this mocking other people.
It's not stale if they keep delivering ... Miruhanas
I respect your mad scripting knowledge @little eagle but really that shit just ain't that funny.
Just smoke some mirujana and relax, it's all good
Idk man. It kinda is.
It's late, aye?
It is.
stopp
!!!!!
..., in the name of love
@young current I mean the day people stop stealing someone elses code and asking for help with it... ๐
Things could be still said and done in civilized way.
You guys need a blint
And that's your job?
@tough abyss why no script in english? ๐
@MrSanchez#5319 i will update it to english someday.
Ok I thought I had this but I don't
I have an array with 10 items, and I want to take 3 unique items from that array and put them into another array
What's the easiest way to do that??
Don't put them in that array and make them extra.
How do you mean?
Put those 3 Uniqe items in a special Array, not in the other
(since i have no clue whats inside that array, i have to guess)
Oh sorry I didn't explain properly, I need to select 3 random and unique items for the other array.
Basically I have 10 possible locations for spawning IED's and I want to spawn an IED in 3 of those locations randomly and repeatably (it's for squad training)
SO I have 1 array with the 10 locations and was going to put 3 of those locations into another array and them spawn the IED using select 0 select 1 etc and typing this out has made me realise how convoluted I'm making it haha
I've basically got 10 invisible "helpers" that I'm going to select
So I should be able to just select the helper out of the array and createvehicle position <helper>
I assume, I'm terrible at scripting
If so, then a simple
{
if(_x in ["LocationName1","LocationName2"])then
{
_NewArrWithUniqueLocs pushback _x
};
}forEach LocationArray```
something like that.
might be easier than using find etc
Yeah ok, thanks man I'll give it a try ๐
(As i said, i can't remember if they have names or not)
Before you use that, make a simple run:
{
systemchat str _x;
}forEach LocationArray
Just to see, what _x will give you
ok sweet
Hey, I am using a "Fired" eventHandler, the issue is that in the 7th Aspect of the array (where it tells you hit-target), it is returning ```SQF
<NULL-object>
[B Alpha 1-1:1 (Ben Harris),"Pickaxe","Pickaxe","Single","Pickaxe_Swing_Ammo","Pickaxe_Swing",<NULL-object>,B Alpha 1-1:1 (Ben Harris)]
Maybe projectile gets deleted right away (or not even created?)
@dusk sage how about a non expiring invite that "we" can use to direct people there? ๐
anyone used setvehiclecargo for anything yet?
once i define a vehicle should i be able to just use" _vehicle setVehicleCargo B_Quadbike_01_F;" to spawn a quadbike in there?
Syntax:
vehicle setVehicleCargo cargo
Parameters:
vehicle: Object
cargo: Object
B_Quadbike_01_F is a classname, so it would be "B_Quadbike_01_F", but the command expects two OBJECT and not a STRING
ok so how do you define it as an object then
define it as an object
That is not how it works. You just spawn a quadbike, store that object reference in a variable and then use that for the command
createVehicle spawns a vehicle and reports the object reference
It's a two step process is what I'm saying
- create quadbike
- load quadbike into vehicle X
ah ok
ok that made much more sense and i now have it working thanks
You're welcome. I always try to make sense of things.
ikr ยฏ_(ใ)_/ยฏ
Can someone tell me how to correctly call this: https://community.bistudio.com/wiki/BIS_fnc_moduleProjectile
from a script?
this: https://github.com/Wolfenswan/ws_fnc/blob/master/effects/fn_createOrdnance.sqf does not seem to work anymore
that function doesn't seem to exist anymore
nvm
you'll have to tell us what's wrong though
_pos = getpos player;
_class = "R_230mm_HE";
_dummy = "LaserTargetCBase" createVehicle _pos;
_dummy enableSimulation false; _dummy hideObject true;
_dummy setVariable ["type",_class];
[_dummy,nil,true] call BIS_fnc_moduleProjectile;
[_dummy] spawn {
sleep 10;
deleteVehicle (_this select 0);
};
that is how I called it.
you can't suspend in unscheduled and BIS_fnc_moduleProjectile relies on suspending
so use spawn instead of call
If that is the problem, then it should complain about it in the RPT file. Script error.
it does, check the gist
googling the error would've pointed you to the same answer though ๐
Suspending not allowed in this context
was just looking for the end of the error and not in the middle.. ๐ Yea sometimes it can be as easy as that.
Always fix these error from top to bottom.
Otherwise you end up trying to fix non errors that only exist because of the real problem.
yea..
https://discordapp.com/invite/0jFDY3VsGIwgd7Ih @halcyon crypt , my bad
A way to delete a particlesource and its effects:{deleteVehicle _x;} forEach (_ps nearObjects 0);
Where _ps is the particle source created with createVehicle: "#particlesource" createVehicle getPosATL player;
Yep, but if you need _forEachIndex -> forEach =}
I just started using param, and it's awesome, so much better than select and saves me a line or two when using the defualt value
But param is faster
for example if you know whats in there, everytime etc.
param faster than select? Nah
Could let a diag run? oO
yes
_a = [0,1];
_b = _a param[0];
and
_a = [0,1];
_b = _a select 0;
and
_a = [0,1];
_b = _a param[0, 0, [0]];
Yeah, param is 0.053 ms faster getting 10 floats from an array
hmm... nah
Okay, again: Whats faster by how many ms?
Yeah, selectis 0.053 ms faster getting 10 floats from an array
Was about to say. Wouldn't make much sense, that a simple select would be slower then a param with a check etc ๐
Thats why i meant: param is overkill sometimes.
ty, @dusk sage now we can send those people away ๐
You also have to remember that params makes the variables private. So it's more reasonable to compare things like
params ["_a", "_b"];
and
private _a = _this select 0;
private _b = _this select 1;
The only time _this select beats out params is for one variable, otherwise it's slower
true dat
When you have one variable just use _this instead
Never understand why people send single argument into function as array, for their own internal functions
readability?
params handles both. Array and single element.
param is nicer than select if you're not sure about out of bounds, -1 (after find) or for default values.
also
param [0]
should still be faster than
_this select 0
about params. if there's only one argument and it's an array. it gets confused unless you put that argument in an array too. is that right? or did i miss a feature?
postion for example
[_this] params ["_myArray"];
can get around that issue most of the time
ye that's what i do
For anything else that is not an array itself and if it's just one element, then I pass it without array. All my functions use params so I don't have to worry about bwc.
player call _fnc_
Hey does anyone know the IDC for the inventory? I thought it was 602 but that doesn't seem to work
hm. unless they cahnged it, it should be 602
i always google this post, if i can't remember it https://forums.bistudio.com/topic/151006-interaction-with-inventory-items/?do=findComment&comment=2393573
((findDisplay 602) displayCtrl 619) ctrlSetEventHandler ["LBDblClick", "_this call fnc_useItem; test = _this;"];
test is ```
[No Control, 1]
@tough abyss Please stop
@lavish ocean
no, you test the code from that post first ;P
as in, it doesn't find the control. and when I try to do SQF test = findDisplay 602; it returns ```SQF
No Display
therefore meaning it isn't finding it?
while inventory is open?
Yes
that is executed in an inventoryOpened eVH
fnc_inventoryOpened = {
params["_unit", "_crate"];
handle = false;
test = findDisplay 602;
};
Just tested that
still got ```SQF
No Display
isn't null for me. maybe it's how you debug it
every script I do is appearing No Display
i dunno what to say ben harris. i think it's your method. i can jsut tell you that i can debug it just fine.