#arma3_scripting
1 messages ยท Page 364 of 1
just added the } apply buildList; in the end without much thinking
forgetting that it is the other way around for apply
its a one time thing right besides the trigger?
@tough abyss What is your goal
Generate IEDs on roadways across the entire map
go through all your markers and randomly create ieds on those roads?
Yes
debug i think, yeah no need for unscheduled.
Well currently the implementation is using square markers...
This is that Phronk guys code.
It's fucked.
Maybe I should scrap the marker system too.
But that is going to generate one big frigging array.
It already generates a massive array.
2124 elements to be exact.
Might have to divide it into smaller pieces.
Wait.
Hmm.
tag_getRoads = {
private _mapSize = worldSize / 2;
private _allRoads = [_mapSize, _mapSize, 0] nearRoads worldSize;
// Return
_allRoads
};
What does worldSize actually do?
So KM from the origin point [0,0,0]; ?
I mean, its probably the same unit that all the other distance commands return
^
tag_getRoads = {
private _mapSize = worldSize / 2;
private _allRoads = [_mapSize, _mapSize, 0] nearRoads worldSize;
// Return
_allRoads
};
tag_generateIEDs = {
params [
["_roads", [] , [[]]]
];
private _generatedMines = [];
private _iedTypes = ["IEDLandBig_F","IEDLandSmall_F","IEDUrbanBig_F","IEDUrbanSmall_F"];
private _trashTypes = ["Land_Garbage_square3_F","Land_Garbage_square5_F","Land_Garbage_line_F"];
private _iedRadius = 8;
private _chance = 0.95;
{
if ((random 1) >= _chance) then {
private _road = _x;
private _roadCenterPosition = getPos _road;
// Create mine
private _mine = createMine [selectRandom _iedTypes, _roadCenterPosition, [], _iedRadius];
_mine setDir (random 360);
// Create junk
private _junk = createVehicle [selectRandom _trashTypes, _roadCenterPosition, [], 0, "CAN_COLLIDE"];
_junk setDir (random 360);
_generatedMines pushBack _mine;
};
} forEach _roads;
// Return
_generatedMines
};
private _allRoads = call tag_getRoads;
private _allMinesGenerated = [_allRoads] call tag_generateIEDs;
whops
Now the real question is; do you reallllyyyyy need to be generating IEDs/Junk for ALL roads? Or can you be smarter about it and generate them as needed?
@tough abyss something along those lines
i dont know what nearroads internally does so it might lag out a bit, but since you run it only once anyway
however if thats for mp, the amount of mines might blow things
private _mapSize = worldSize / 2;
private _allRoads = [_mapSize, _mapSize, 0] nearRoads worldSize;
for "_i" from 0 to NUMBER_OF_IEDS_TO_CREATE do {
_mkr = createMarker ["",getPosATL(selectRandom _allRoads)];
_mkr setMarkerShape "ICON";
_mkr setMarkerType "mil_dot";
_mkr setMarkerBrush "Solid";
_mkr setMarkerAlpha 1;
_mkr setMarkerColor "ColorEast";
};
Creates 1 marker...
what is NUMBER_OF_IEDS_TO_CREATE
30
#define NUMBER_OF_IEDS_TO_CREATE 30 //Number of IEDs per marker, defined in iedMkr [Default: 5]
#define DETONATE_IED_WITH_WEAPONS true //Can the IED be killed with weapons? [Default: false] TRUE = Yes | FALSE = Can only be disarmed
#define DEBUG_MARKERS true //Show IED markers on map? [Default: false]
//!!DO NOT EDIT BELOW!!
iedBlast = ["Bo_Mk82","Rocket_03_HE_F","M_Mo_82mm_AT_LG","Bo_GBU12_LGB","Bo_GBU12_LGB_MI10","HelicopterExploSmall"];
iedList = ["IEDLandBig_F","IEDLandSmall_F","IEDUrbanBig_F","IEDUrbanSmall_F"];
iedAmmo = ["IEDUrbanSmall_Remote_Ammo","IEDLandSmall_Remote_Ammo","IEDUrbanBig_Remote_Ammo","IEDLandBig_Remote_Ammo"];
iedJunk = ["Land_Garbage_square3_F","Land_Garbage_square5_F","Land_Garbage_line_F"];
private _mapSize = worldSize / 2;
private _allRoads = [_mapSize, _mapSize, 0] nearRoads worldSize;
for "_i" from 0 to NUMBER_OF_IEDS_TO_CREATE do {
_mkr = createMarker ["",getPosATL(selectRandom _allRoads)];
_mkr setMarkerShape "ICON";
_mkr setMarkerType "mil_dot";
_mkr setMarkerBrush "Solid";
_mkr setMarkerAlpha 1;
_mkr setMarkerColor "ColorEast";
};
Being run in scheduled environment
just do
Use the _i var
ah right derp.
format ["ied_marker%1", _i]
Yeah
Can't say how many times I've worked with other peoples code
and spent hours trying to debug it.
Code inits perfectly.
next stage.
thats why i always write stuff myself if i need it
otherwise you run into issues and noone likes reading through other peoples code to understand it and fix an issue ^^
{
if ((random 1) >= _chance) then {
private _road = _x;
private _roadCenterPosition = getPos _road;
// Create mine
private _mine = createMine [selectRandom _iedTypes, _roadCenterPosition, [], _iedRadius];
_mine setDir (random 360);
// Create junk
private _junk = createVehicle [selectRandom _trashTypes, _roadCenterPosition, [], 0, "CAN_COLLIDE"];
_junk setDir (random 360);
_generatedMines pushBack _mine;
};
} forEach _roads;
So much better.
Finished
mines take a while to initialize thought.
Not if you find bushes to hide them in ๐
SelectBestPlaces.
hiding them in bushes next to the road.
Thats what I've done in Zeus missions
Generating large piles of rubbish hmm it's feasible.
private ["_testPlaces","_getRoads"];
_testPlaces = [];
_getRoads = [] call tag_getRoads;
for "_k" from 0 to NUMBER_OF_IEDS_TO_CREATE do {
{
_testPlaces = [_getRoads] call tag_findPlaces;
systemChat format ["_testPlace %1",_testPlaces];
/*
_mkr = createMarker [format ["OTHER_%1",_k],(_x select 0)];
_mkr setMarkerShape "ICON";
_mkr setMarkerType "mil_dot";
_mkr setMarkerBrush "Solid";
_mkr setMarkerAlpha 1;
_mkr setMarkerColor "ColorEast";
*/
} forEach _testPlaces;
};
... a few hours late, but I do have to sleep sometimes...
Why does this refuse to run?
tag_findPlaces = {
params [
["_getRoads", [] , [[]]]
];
_testPlaces = selectBestPlaces [getPosATL(selectRandom _getRoads), 500, "forest+meadow+trees", 0.9, 10];
systemChat format ["_testPlace %1",_testPlaces];
_testPlaces;
};
Complains _testPlaces is undefined...
How?
I run the code in game it isn't undefined but right at mission start it is...
This is unbelivably frustrating...
ForEach should just work...
Something so rudimentry should just work
This has got to be a timing issue it can't be anything else.
Hazzar
We have solution
It's working now.
Now lets see if it hides stuff in bushes
Debugging in A3 is pain...
Oh yeah this works really well
It's now hiding the stuff in grass and bushes
https://pastebin.com/5zCmKVtk any idea why that won't work? i want to to detect the currentweapon from a list.
returns string not array
the returned string being the weapon in the units hands, not just any weapon the unit has on them
_unitCurrentWeapon = [primaryWeapon player,secondaryWeapon player,handgunWeapon player];``` is what you might be after?
Is there a good way to convert 2D space to 3D space?
by using extrapolation with an existing object?
nvm worked it out
Wow this script works too well
Yeah this is disturbingly good.
Note to self
Don't shoot IEDs...
@tough abyss It officially works
Like it works really well.
Hides IEDs in the bushes just off the road and everything.
count allPlayers; the most efficient way to get current server population?
don't know a better way
seems like arma would have the variables hardcoded and you would be able to call them.
What is with the rpt file randomly stopping working?
is there someone brave enough to test if setTerrainBlendPars , setClutterColoringCoef & setClutterColoringInterpolation works in stable in public diag.exe?
@tulip cloud there's playersNumber but it wants a side and includes AI if enabled. note that HC is included in allPlayers
. I think they changed this ^
. that's good to know, thanks commy
. interesting
[this,"STAND_U1-3","ASIS"] call BIS_fnc_ambientAnim;
Its saying that its not reconized, but i copy and paste from the function view
1-3 is 3 different ones i think? "STAND_U1", "STAND_U2", "STAND_U3"
so i am supouse to remove the "-" thing?
now that is working
how about this one
[this,"BRIEFING_POINT_LEFT","ASIS"] call BIS_fnc_ambientAnim;
he is actually not pointing at anything
seems fine, make sure the unit is not in some other animation before. not sure how that is handled, maybe you need to terminate it first.
list of parameters can be found here: https://community.bistudio.com/wiki/BIS_fnc_ambientAnim
well, thanks anyway
also i would like to share this code i did
[this,(selectRandom ["STAND_U1","STAND_U2","STAND_U3"]),"ASIS"] call BIS_fnc_ambientAnim;
this is a code that make a unit have one of those 3 animations
it resets after restart
really fun thing to explore
Why are troll messages always deleted... I'm reading up on two people talking to a invisible being.. https://github.com/dedmen
@rotund cypress There are constants in Arma. Here: 1 that's a constant.
@vague hull some scripting commands to tweak islands. If they are not present on diag.exe I might ask to bring it to public light
there are few more commands that could be useful
@still forum that is most certainly not his Github.
alright, will test that on devbranch if thats ok?
I found it... didn't look at that github page yet because my firefox crashes when I open it
Ye, but it's not his.
Now it's mine
does setSkill only run where unit is local? wiki doesn't seem to say anything about its locallity
In devbranch diag, all 3 dont show up
@still forum Hobby Programmer mainly focused around the game Armed Assault "Armed assault", wtf is that shit lol
Well...that one is up for debate. Oviously not here ๐
Has anyone got an example of adding a button to the pause menu or screen?
CBA does that for Addon Options @grand berry
Yea, trying to do it without CBA for now.
Well. That and onPauseScript in the description.ext
I meant looking at their files to see how they added it ;p
Ohh yea fair enough haha
Don't think you will be able to do it with just scripts.
In config is fine it's in an addon... just realised Im in scripting channel not conifg.
๐
@grand berry keepo
It's more than config too.
So you can't add a button like ACE's settings button via a script/function/config combination?
That you can do easily. RHS does it.
The CBA ones are more integrated into the actual sub menu etc.
Ah yea sorry my bad description then. First move into displays/ UI so no idea what I'm doing yet.
This adds the button: https://github.com/acemod/ACE3/blob/master/addons/optionsmenu/gui/pauseMenu.hpp#L2-L106
Second half of the script is the main menu additions. No idea why it's in that component.
Great, that was just what I was looking for. I started looking in the UI and main folders, guess i missed this one.
how to turn on showing id in new editor ??
map id's are deprecated I think.
Because they change with every update to the map or something like that.
there is a command to know if a unit have the forceFollowRoad active?
i want to put it in watch
Doesn't look like a command is there; but I wonder if it sets a variable on the unit like BIS_fnc_ambientAnim does. You could dump allVariables on the unit and see if something is set.
[this,"REPAIR_VEH_KNEEL","ASIS"] call BIS_fnc_ambientAnimCombat;
this is saying that there is no animation like that in the list
it works if i put BIS_fnc_ambientAnim
but how i cancel it?
or better say, stop that animation?
i find one
fixguy call BIS_fnc_ambientAnim__terminate;
BIS_fnc_ambientAnimCombat doesn't have the same animation sets as BIS_fnc_ambientAnim.
Does the simul weather scripting commands still work?
afaik yes
There was a thread 3 years ago about it. There was some confusion regarding the layers. But it appears when setting the layers it takes a number
anything that i put on a init overrides other commands?
like _soldier1 disableAI "AUTOTARGET"; but there is also a "Disable autoraget" check box
which one will be accepted?
Whichever script is executed last is the one to overtake existing values
same for bars?
It's sort of like a grocery list
Disable Autotarget check box? you mean from eden editor / 3den enhanced? Commands in the init will override that stuff, always.
@subtle ore - eggs don't usually override the bacon, but ok.
In fact, nothing overrides the bacon.
@tough abyss Hey now :(
I like me some good eggs and bacon. No need to make it any more or less
Same ๐
i tink was a mistake bild my mission with 3den enhanced
some times i restarted my game and then i am going to acdentaly edit with the 3den enhanced off
then i loost allot of configurations
that take me a week to figure it out
@astral tendon Honestly, if you were doing something quick that would take like a day tops then maybe use 3d eden enhanced. Otherwise, not a good idea in my opinion
Better to have your hands in it all and understand what is where and why it's happening
do you know of any way to copy content from arma (e.g. copyToClipboard) in MP without an extension like initDB? copyToClipboard is SP only.
diag_log everything to RPT?
Or admin debug ? For the quickest of testing?
why does extension not work?
For simply copyToClipboard? Over extending yourself there
Best way is to use use a logging extension, afew of them outthere
I have a string in arma that I want to share accross all clients so that they can save it to a file.
open a UI dialog so they can CTRL+C.. Not sure if that works in MP... but could? I guess
Now that, an extension you could just have the client write a file autonatically
UI Dialog approach, is prob the best method. Since BE will randomly block extensions at tmes
If the string is just for another mission, consider using profilename to save a variable.
the string is the (persistent part of the) mission. ๐
@still forum what a fantastic idea... Will try that strait away
Might be that CTRL+C is also disabled.
I remember looking at that but don't remember exactly
I really doubt that.
Any way of deciphering which rtm animations in the CfgMoves entries will work on units? Seems as though some of them just reset the queue and stop playing anything. (switchMove & playMove)
:+1:
the command "crew" retuns values even if there is dead crew membres
is there a version that does not return dead ones or if returs true or false if there is crew?
@astral tendon or you know. Don't be lazy.
{
If(alive _x) then {
};
} forEach (crew coolHelo)
I... actually dont know
Slap your code between the if statement brackets
Put that in a script or spawn it
Then to take a step further, convert it to a function. Return the alive units and call the function
if ((!alive driver testcar) AND (!alive gunner testcar)) then (testcar setDamage 1)
this one works for me
but thanks for the help Midnight
{alive _x} count crew vehicle == 0
something like that would be easier
Your version will never take into account more than the driver and gunner
is supouse to be like this: {alive _x} count crew testcar == 0
?
it only give me false
btw, @still forum and @subtle ore, the dialog trick works as long as the string does not contain \r\n
wtf ๐
either if i change to !alive
specifically, if you Ctrl+C from a C_EDIT that contains \r\n, it copies correctly. But if you Ctrl+V it back and ctrlText it, the \r\n are converted to spaces.
arma also should know rich text editor controls if i remember correclty
@thick sage you just switched carriage return and line feed ๐ CR comes first
yes, that, thanks!
if ({!alive _x} count crew testcar == 0) then (testcar setDamage 1)
the car still blow up if the crew still alive
i did something wrong?
Maybe there is no crew.
But you would want to compress that data anyway right? so leave out all whitespaces
@astral tendon did you test in debug console?
yes
maybe missing brackets?
omg
when does that code run? init box?
๐คฆ
why dont you use SQFlint?? That appears immediately as an error. I can no longer code without it because I just expect it to find these for me
LAZY
@still forum, I gave readability over compression, so I kept the spaces. ๐
(probably until now, where utility trumps readability)
This doesn't error though.
if ({!alive _x} count crew testcar == 0) then {testcar setDamage 1}
lgtm
now this one works
But still. This means that the car explodes when there's no crew inside. Idk if that is what is needed.
Shoot the driver through the glass, boom!
i need this because some vehicles when the driver dies the car still runs
and gets on the road and the AI dont figure it out how to get out of the way
There are alternatives to blowing it up...
like set speed to 0
but i also need the car to move
Shh. Everyone loves explosions.
๐
๐ฅ
/\ also that ๐
:boom: :fire:
Scripting with Michael Bay.
๐
Does anyone know if enableDynamicSimulation is a local or global locality command?
@zenith totem likely global and local. Since the system i presume would have to see if the player is waking the simulation
hah ... wanted to send you a link to the wiki but ... it rly isnt stated there
in case you ever find out @zenith totem
add it to the wiki please
run on server, cry if you're also using a hc
Well it seems like you can run it locally and on the server though
Wouldn't see why not
possible to spawn a script with its name instead of function?
Do you mean a file? ExecVM?
works the same way as spawn then?
Sure
when i put a image on a board it does not apears to other clients, only to me (host), and there is a error saying that could not find picture
Image is in mission folder?
yes
any idea?
Yeah because you've got the wrong path to the image
Or the image isn't in the correct format
Ie .paa , .jpg . not sure if .png is applicable
is in .paa
Now the IEDs initiallize correctly now.
Works pretty well now.
Now the triggers won't fire.
And I am not sure why.
is revealMine JIP and does it continue to reavel to AI units spawned after command used if ran on server?
Well this code is run from the init.sqf
via execVM
So enclose it in the if (isServer) then {} ?
_trig setTriggerStatements [
"{
vehicle _x in thisList && speed vehicle _x > 4;
} count playableUnits > 0",
"
{
systemChat format ['_x is _iedTypes %1',_x];
if (_x in _iedTypes) then {
[_x] call tag_detonateIED;
};
} forEach nearestObjects [thisTrigger,[],10];",
"deleteVehicle thisTrigger"];
what, oh your IED script? I'm not talking about that. I've done my own IED script almost done..
Does putting spaces between code make a trigger stop working?
shouldn't
So what would be preventing the trigger from firing?
where is trigger local to?
depends what your aiming for really. systemChat is local to the machine that executed it
This is currently running on a "listen server"
thats a local hosted server right? server is on same machine as your player?
trigger can be on server but things like sytemchat need to be remote executed if intended to work in MP.
either way will work. youll need to make funtions and or eventhandlers on the respective machines. Good to have anyway if you inteand to make missions as this command is commoly used in MP
So I can do either way?
Okay.
initPlayerLocal.sqf
or initPlayerServer.sqf
or if (isServer) then {} etc?
from init.sqf ?
@cloud thunder For your script did you decide to use triggers too?
Can local variables be used in a trigger?
Also what is the syntax for triggers?
The string part I can't work out.
yes, i did use triggers on server. for the statements Local vars can only be used when created in the statements.
"{
vehicle _x in thisList && speed vehicle _x > 4;
} count playableUnits > 0;"
Is that valid in a trigger?
I believe so
Odd then why is this not firing....
maybe remove ; after 4. Its not needed there
its a condition. I'm using "{vehicle _x in thisList} count playableUnits > 0"
and I take it "hint 'Activated';" doesn't work either?
in fact you should delete ; at end too
So what happens when you have multiple statements ?
How does the engine determine the beginning and end?
Give me an example of how to use multiple statements
I'll need this for later, it doesn't matter if I am on the server and client?
Does it?
From the "Host Button"
?
_actCond="((RedHot <= Max_Act_Gzones) && {{vehicle _x in thisList && isplayer _x && ((getPosATL _x) select 2) < 10} count playableunits > 0})";
so right now I have this in the condition
this;
this in the onAct
"hint 'Activated'";
this in the onDeact
" hint 'Activated' " ;
?
What should be the min mid max value be if I want it to go from 1 second to 10 seconds?
rly should not be coding ... 4 commits for a blindly simple macro ...
it happens
1,5,10
probably not unless you are commiting code to something like github atm and you have a stalker.
I don't know but I'm working on mine atm . you might want to use this one instead/
I'd rather understand why it won't fire...
Other than this the entire code works as it should
It searches nearby roads finds a bush
and hides IEDS in them.
facedesk
In EDEN editor
It applies the string code to the actual data.
facedesk
gah.... neeed moar beer
I can work out how the string is applied opening the mission.sqm I think
may you tell me what would be needed for ya guys until you can use my sqf-vm (@signal peak) ? (help__ <STRING> can be used to test capabilities)
name="Some_trig";
condition="call{this;}";
onActivation="call{hint ""Activated"";}";
onDeactivation="call{hint ""Activated"";}";
Thats how EDEN interprets it.
facedesk
looks ok to me
This wasn't working
need to read the whole convo though
_trig setTriggerStatements [
"this;",
"
{
systemChat format ['_x is _iedTypes %1',_x];
if (_x in _iedTypes) then {
[_x] call tag_detonateIED;
};
} forEach nearestObjects [thisTrigger,[],10];",
"deleteVehicle thisTrigger"];
can you give me a TL;DR?
Basically my trigger wasn't working.
I didn't realise you don't put 'string'
around the EDEN versions
Then I simply need my code to fire in the _localTrigger
Thats it.
making IED go boom
by setting damage 1;
can you provide whole creation SQF code?
at best on pastebin to not clutter
mor beter: hastebin
gimme few mins
cannot solve this riddle in my head
beer has taken over that part
and makes a party in there
bad beer ...
just found what i will do trhe rest of the night
playin arma
besides deactivation, those triggers work for me
Done for now. Try this one. https://pastebin.com/F8rXpKnK might give you ideas at least if you don't like it..
what was the problem?
I use SelectBestPlaces
combined with "forest + medows + trees"
Hides them very well.
Makes the script very smart.
Near impossible to spot them
Makes every NEED a mine detector
Spot the IED:
Makes the guys in the missions to be very careful.
This is the initialization process @cloud thunder
I hate to kind of hack a solution around the 2D position returned.
Fortunately createVehicle uses getPosATL ?
So setting it to 0 snapped them to the ground.
@tough abyss i'm getting error on first line
Of which?
First line oh yeah the code hasn't been error hardened
running in debug console
It hits 89 and occasionally finds an unknown entry.
Because SelectBestPlaces returned a any any.
It's screwy like that.
Don't need this by the way.
We use ACE3
[thisTrigger] remoteExec ['JIG_IED_FX', _irP, false];
Appreciate your code.
I'll refine this more later.
But selectBestPlaces
Is probably one of the coolest A3 commands
Along with IsFlatAndEmpty.
๐
https://gist.github.com/X39/f51ef0790221adf8671588967c26b029 in case youre bored
and want to see those triggers
i need to make my mission a SP and MP on workshop
but i can only upload two versions of it or i can just put one for the two versions?
ofcouse, is MP and SP ready
you can publish it once for both SP and MP...
What the proper way of getting a global variable defined in one sqf in another?
I have a global variable that I make public to send to client
myGlobalVariable = count allPlayers;
publicVariable "myGlobalVariable";
another sqf
_aPrivateVar = myGlobalVariable * 10;
I get the error that myGlobalVariable is undefined.
missionNamespace setVariable ["tro","lolol"]; Is this the proper way of doing it?
Fix the race condition.
If you try to read the variable before you set it.. then it ofcause won't work.
Also it does not magically instantly transfer to all clients
@tulip cloud missionNamespace setVariable ["tro","lolol",true];
It will be transfered to all clients then
thats identical to myGlobalVariable = count allPlayers; publicVariable "myGlobalVariable";
the issue is his timing, as commy said
Race Conditions ah right.
It's good practice to set a variable to something if it's going to be PV'd
Even if it's some pointless value like true or false
what before you need it, isnt that what the default value in getvariable is for?
or does it broadcast faster after the first time or something?
do both methods have a race condition? I'm confused on what exactly is causing the problem so I can identify now and in the future.
ur trying to use the variable before it has been broadcast. publicvariable isnt instant
is missionNamespace the same issue?
missionNamespace setVariable ["tro","lolol",true];
its the same deal yea, not instant
Is there a way to test the performance or something so I can add a sleep or something to avoid the problem? What is the best practice in this situation? (In my actual code I don't actually have them back to back like this.)
tro = true;
PublivVariable "tro";
is the same as
MissionNameSpace setVariable ["tro",true,true];
All global not public variables exist in GLOBAL variables any variable thats not prefixed with an underscore
GLOBAL = true;
_LOCAL = true;
I understand the variable scopes.
PV's must be initialized.
Otherwise you get wrong results.
tro = assign me a value
then missionNameSpace set it's variable and global it.
or give it a default value when you fetch it
What i best practice? putting variables into the missionNameSpace or setting a Global variable to Public?
its the same thing
exactly
Public variables are added to the missoinNameSpace and are handled the exact same way? Why make 2 ways to do the same thing?
always good to do that
getVariable setVariable doesn't work with PVEH's
They're are linked to PV's being sent and recieved.
because ArmA always has at least 2 different ways of doing stuff
PublicVariable will respond to a PVEH
setVariable will not.
Errr
Let me test that.
Not absolutely sure thats the case.
^ dis is correct
@tulip cloud
"What i best practice? putting variables into the missionNameSpace or setting a Global variable to Public?"
myGlobalVariable = count allPlayers;
publicVariable "myGlobalVariable";
and
missionNamespace setVariable ["tro","lolol"];
are both missionNamespace.
You can also use waitUntil till the variable is not nil anymore. If that's applicable for you
setVar with public flag or set var and publicVariable doesn't make a difference in the backend. It's just that one command does both things. and the other does them seperatly
missionNameSpace is a lot cleaner looking I think I'll use that.
missionNameSpace setVariable ["tro",120,true]
tro = tro + 10;
client
missionNameSpace getVariable ["tro",true];
client receives: 130
seperatly ofcause being slower
no.. client definetly does not
a variable is only sent to other clients if you tell it to.
there are no "public variables" that self replicate
^
Namespace setVariable Array
Object setVariable Array
Group setVariable Array
Team_Member setVariable Array
Task setVariable Array
Location setVariable Array
Control setVariable Array (since Arma 3 v1.55.133553)
Display setVariable Array (since Arma 3 v1.55.133553)
instead of just true you can use client ids
You can specify the name space. As being another neat thing about setVariable.
:u
I have never seen that being used anywhere
you can also use publicVariableClient.
To send only to specific clients
player setVariable Unique player var.
well yes
Thats pretty neat, never knew it could do that
^
Are you sure that is not broken? I have literally never seen that being used anywhere
Unless you want a PVEH
I'm currently using publicVariables and I use it like this:
myPublicVar = 25;
publicVariable "myPublicVar";
Then on the client I just do
diag_log myPublicVar;
and it outputs: 25
People might not know how to use it.
there are a lot of things that none or very few people use
oh, yeh
https://community.bistudio.com/wiki?title=setVariable&diff=103718&oldid=98864 okey it's relativly fresh apprently
rarely need that
for "_i" from 0 to 50 step 2 do { Some cool stuff };
I can think of quite a few uses such as accessing the 2nd element in an array of even number of array elements
every step
is there documentation on step or is it new?
lol
Some people even use it with step 0 to replace while loops
used to all results coming up first for wiki on google.
Yeah I agree
back to setVariable. Is this a third method to declare a variable?
(in missionNameSpace.)
Third? What is the second?
Another command not commonly used
Mostly by GUI people
Good if you need to dump everything in a new line using \n
I use parseText quite a bit.
formats information nicely when you got a lot of variables you are monitoring
parseText is the most used command used in conjunction with structured text
The more you know
SQS yuck
SQS is my city
@tulip cloud What do you mean is it a 3rd method
It looks like some ancient 1990 language
Dedmen its 1:36am here...lol ignore the comment ๐
"It's SQF compatible" "In SQS scripts only" ?
You will crash the game if you try to define a label in preprocessed SQF using #
yup
I haven't, I'll try that out!
diag_log parseText format ['_x is _iedTypes %1 \n',_x];
diag_log parseText format ['_iedAmmo was in _x %1 \n',(_x in iedAmmo)];
Refuses to dump in a new line in the rpt...
?
Am I doing it wrong?
lol that isn't how you use diag_log
He edited his post, said daig_log before
Which one dumps using new line?
Wiki page says that it expects XML syntax
I dunno,
I would just do
{
diag_log format ["_x is _iedTypes %1",_x]
}foreach _iedTypes;
or whatever exactly he is trying to send to the log.
that is equally as correct as the parseText one
never experienced that. What do you to cause that?
I notice that nothing is logged if arma isn't doing anything except waiting for something from server.
That would make sense.. How would it log anything if it doesn't do anything
systemChat format ["_trig %1",_trig];
Thats mostly all thats being dumped
It literally stops working
I tab out back to the main menu and it stays not working
Your Arma is freezing?
Nope
Understood it as windows tells you "Arma stopped working"
Dedmen the way GeekGuy884 wrote his diag_log was about 3x slower than how I had it written.
I've got a lot of data to manage
It's for my IED script that is smart enough to hide them in bushes
If you truly think arma is stopping then create a simple while sleep 5 diag_log "Ping"; and you'll know if it is trully stopping
So I needed to see the positional data, due to it being 2D
I had to convert it to some bastarized 3D version
by dropping a 0 in to make it 3D
create map markers?
so createMine would work
Yeah it does that too
It's also to see if any triggers fail to be created.
There is also a script command to give you the height of terrain at a specific XY coord
Oh?
Well the hack using 0 seems to work alright.
Just the normal alignment isn't right.
Won't rotate it on a Z and X Y to align it with the terrain will it?
are you looking for slope? to set object on angle?
https://community.bistudio.com/wiki/selectBestPlaces <-- another ancient but still awesome command that is widely underused
wish they would give it some new parameters
I use it.
Thats what I am using for generating my IEDs
I use it to hide them in bushes, trees, and grass
๐
makes them very hard to make out.
I don't have the perfect solution . but I would do something like place the IED then have it check the terrain z height to the 4 corners of the object and calculate the slope and then calculate the right xyz angle for the object. Would slow down the generation process a bit but would do the job dirty.
^
nice
hey does your script also generate boobytrapped corpses ?
looks like would be 10x faster to do..lol
I can make it do that yes.
do it ๐
That or getShotParents
Neat script command that one.
sounds interesting
Lets see how useless it really is.
Oh wow.
It is kind of useless...
@tame portal
Actually it's not!
[["rain",0],["night",0],["wind",0.161588],...]
They're the same expressions SelectBestPlaces uses
Interesting.
Oh wow.
My IED script now works....
๐ฎ
yep they definitely now work
addMissionEventHandler ["EntityKilled",
{
params ["_killed", "_killer", "_instigator"];
if ((side _killed isEqualTo west) && { (floor random 10) isEqualTo 0 }) then {
_mine = "APERSMine_Range_Ammo" createVehicle position _killed;
_mine attachTo ["_killed",[0,0,0],"Pelvis"];
_killed setVariable ["mine",_mine,true];
_killed addEventHandler["ContainerOpened", {
params["_container","_user"];
(_container getVariable "mine") setDamage 1;
}];
};
}];
no idea if that works, give it a try ^^
and it may need some adjustments
but it should add a 10% chance on any west soldier who dies to boobytrap his corpse with an attached apers mine
which (if i remember it correctly) should not trigger by walking over it when it is attached
so instead it gets triggered by looting him
The data downloading stuff from endgame, is there a easy method to implement such stuff in your own mission is it hard?
hmm I don't really remember it but there are several ways to do that
one of the easiest beeing a trigger with a timeout
I mean with the gui stuff and such
yeh well my memory sucks xD
but there are a shitload of ways how you could display download-progress
drawIcon3d for example
if you feel like making some icons for it
you could probably also look into the pbo and see how they did it or just come up with something else
but I don't think there is a specific function for it, or I haven't seen it yet
end game simple objective modules are a thing in eden, is that what ur after? (i havent played endgame or used the modules so idk)
I dont think the endgame modules work in a non endgame enviroment
also im not really a fan of all those modules
guys, i need to make a trigger to detect if is a MP or SP game.
its a verry especific situation
//condition
isMultiplayer;
//on activation
hint "multiplayer";
Nice! thanks
np
is there a way to give the medic skills to a player if he have the medickit?
i want he to revive faster if he have the kit
yes
there is revive system in 3den, check everything there, i think you have option to make it faster if they have kit
its says that if i put it to revive only if it have a medic kit
but i dont want to limitate that
i just what to make it verry slow
why not give the skill to all players
it is only useful when they have a medikit anyway
so it doesnt really require a script I'd say
because i want all players to revive, but if you have a medic kit i want you to do faster
normal player will take a minute, medics 3 seconds
i have this condition
'Medikit' in (items player + assignedItems player)
what is the reverse to this? if he does not have
it actually can
the trigger did worked
so how i reverse this?
'Medikit' in (items player + assignedItems player)
!( 'Medikit' in (items player + assignedItems player))
nice, that did worked
now i made two triggers, one that give the medic Trait if he have the medikit and another that if he dont have he got the Trait removed
It can't. You cannot put Medikit into assignedItems
it works because they are in items player
i may run into problems with this?
well.. performance
though items player is the worse part here. It can contain thousands of items with a big and full backpack
if i am the host i will not feel it?
it's all about code optimization
i did not get any lag even by put and remove the item
you could throw any command that returns an array
and it would still work
but why would you want to do that
i want players to revie faster if they have a medickit
yeah so remove the + part
but i dont want to restrict anywone to revive
the reverse of true is !true
Nu uh. You haven't disproven Dialetheism yet!
why have it in there lmao
just remove?
yes..
well, generic error
@astral tendon if it's in a trigger every player will have that code execute
well, thats how it is supouse to be right?
show the code you are getting "generic error" with
original : 'Medikit' in (items player + assignedItems player)
optimally you would only check once when the player applies a medikit. instead of checking everytime
new: 'Medikit' in (items player assignedItems player)
XD
Wow.. genius
this is beyond me
yeah so remove the + part
you just need to have items player
we said that assigneditems isn't needed because a medkit cannot be assigned
why do I even bother eh
yell, now it is working
'Medikit' in (items player)
if you guys says its better, who i am to say otherwise.
use logic. read wiki. read more.
itl let people find ur content by the selected tags
so i'm assigning these three event handlers to a player consecutively
f_ehIndex_dynamicViewDistance_0 = player addEventHandler ['GetInMan', 'f_eh_setViewDistance_onGetIn.sqf'];
f_ehIndex_dynamicViewDistance_1 = player addEventHandler ['GetOutMan', 'f_eh_setViewDistance_onGetOut.sqf'];
f_ehIndex_dynamicViewDistance_2 = player addEventHandler ['SeatSwitchedMan', 'f_eh_setViewDistance_onSeatChange.sqf'];```
However, the handler ID for all of them is 0. is that supposed to happen? From what i understood from the wiki, each EH should get its own ID
they all do work, however
it is correct
each EH has it's own ID
The ID consists of type and the number
so you have GetInMan0 GetOutMan0 and SeatSwitchedMan0
EH's are ordered by when they were created
First one is always 0
then 1
then 2
and so on.
The ID consists of type and the number
Aha, interesting. When I querried f_ehIndex_dynamicViewDistance_0 etc they all returned 0, hence i got confused
thanks for clarifying that
You also have to provide the type of the EH when you remove it again. Arma has a seperate array for each type. Which is why you have multiple eventhandlers at index 0
i see. cool, then everything is fine ๐
thanks again
BTW, another "quick" question, would anyone know the locality of setSkill?
Wiki doesn't mention it
I see. I was told that it's global when run on server?
no.
well... Skill is really only important for the computer that controls the AI. Which means local
Global as in you can see them yes, but you use setSkill is ^
CreateUnit is global
So if you setSkill on a unit
getSkill probably still replicates and returns correct results
Okay. Yeah was wondering what happens when some AI are on headless client and some on dedicated server
if you are concerned about that
setGroupOwner.
Assume local unless proven otherwise.. and if proven.. add it to biki
Is an easy way to transfer AI
If you can https://community.bistudio.com/wiki/setSkill on a server AI from a client.
and you receive the value you've set from a different client via https://community.bistudio.com/wiki/skill then you can be sure it's global
yeah, that makes sense. cheers!
(and easier than what i was thinking of - setting skill from HC and reading it back via my client ๐ )
yeah could do that too
Btw I prefer diag_log ["name of logged line", value]
far quicker to write
getskill is not a command, however skill is a getter, but skillFinal will return closer to what actual skill is since it accounts for the coefficiant of difficulty settings. Don't know why people have been reporting skills broken since LoW, but from my tests its working as it should. Maybe the broken issue of skill setting might be by editor only wich I cannot comment on. Skill issued by scipt however are fine.
do you guys know a way to set the AI rate of fire?
Don't they fire as fast as the weapon can?
Ai can have different firemodes in weapons that are hidden from player
^
no idea how to use those
https://community.bistudio.com/wiki/doSuppressiveFire <-- also useful
if that is what ure after
https://github.com/ussrlongbow/rwt_cron/blob/master/longbow/cron/functions/fn_cronJobRun.sqf#L48 Wow.. We have a real genious here
apparently has no idea that getVariable exists.. And apparently knows that setVariable exists... but forgets that it exists a couple lines later
CBA waitAndExecute does the same kinda thing btw
I think i could design a device to torture dedmen with electric shocks and the first thing he would do is point out bad code in its control software.
he's posted a couple of.. strange things before if I remember correctly
What if it turns out I like electric shocks? But your's are too weak because of bad code?
gotta keep those batteries charged, right ?
you guys are silly. i suck at coding, i would never rely on it to torture people.
1- you can write in a oriented object way
makes you think ๐ค
It makes everything better automatically.
Dedmen, you should check out ca. 2015 CBA_A3.
you mean before you joined?
Many sleepless nights went into it, yes.
Why would you ever want to waste time trying to write SQF in an OO way? So much effort, so little gain.
We appreciate your sacrifice, @little eagle.
dedmen you spelled genius wrong
If you want OOP.. Just do it.. Intercept.. Intercept-Python. I even think Intercept-Lua can OOP
Who is sweating so much?
Now you're trying to trick me
Why would you ever want to waste time trying to write SQF in an OO way?
Because it's objectively better. Now clap.
๐
surely trying to write SQF OO style would involve spamming set/getVariable everywhere
that kinda starts to look crazy after a while
#define
I don't want OOP, it seems like a terrible thing to do in a scripting language.
Especially one where it wasn't ever intended to be slightly OO in the first place.
:slow_clap: @little eagle
terrible like that ? https://gist.github.com/zgmrvn/c536fa307f7d077d0d71fd97dc37eaf5
if (isServer) then {
_this setVariable ["arsenalInit", {
๐
Tabs ๐คข
triggered? ^^
arsenalInit is actually a method that create a crate and addAction (globally) on it
it doesn't actually open arsenal
@little eagle tabmasterrace
Yeah, I'm not gonna put functions in a setVariable/getVariable construct. Waste of effort. Little gain.
The beauty of scripting languages is that you don't need to do all the BS setup that OO requires. If I want to do OO, I'll do it during my day job.
what we basically do in arma is playing with objects
it makes sens to me to try to handle them as programming objects
True; if it helps with the mental model, then its a positive.
that was an experiment, i could even "bind" it to custom config to perform inheritance using config inheritance
@slender halo ๐ โฆ you're treating sqf files as classes, which is fine, but it feels weird you're adding methods based on context (server/client) instead of using inheritance
sadly sqf does not really comes with native oop, so all the oop we can try, it will stay hacky as hell
wried as fuck, i agree, but hey, it's sqf ^^
word ๐
and it will look hacky as hellโฆ which is my main gripe with SQF . Somewhere inside the ugly skin there's a beautiful small functional language that'sโฆ well beyond repair. But still. ^^
^^
well, with EnScript we will get OOP , it seems. ยฏ_(ใ)_/ยฏ
Isn't EnScript a DayZ thing? Haven't heard that phrase in a longgg while
yes. but it's arguably also the thing that's going to power Arma4
๐ speculation
You mean Arma 1
Unarma
#InterceptAllTheThings
Release it.
Intercept? We are already prepping for SW release
"SW"?
Steam wurstshop
how is this going to work on workshop
@still forum just convince stack/overffl0 to spend every second he has on the pythonintercept thing and then ill try using it ๐
@simple solstice Why wouldn't it? It's a normal addon with extension
Intercept-Python is currently waiting on one addition to core. The guy writing that is away till 4.10. I'm expecting it to pick up some pace after that's done
@still forum I guess.. but it just sounds weird to release such a thing on SW
We will need very quick updates in case something breaks. SW is just the best way to get the update out quickly to everyone
I hate SW.. But.. It's the best solution for this
SW is absolutely amazing, never has issues and it's very easy to find things on it with it's amazing filters and tagging system
/s
I don't think people that would use Intercept would get it from Workshop rather than GitHub
That's a good argument
But that's only true for the beginning. For people that only use it in closed groups(that don't already use SW for mods) or only serverside
Well yeah, that's true.
having it on workshop is convenient
and the visibility it offers might help to get it more known
I hope to see it picked up by someone.
Releasing a full game mode based on Intercept, or atleast in some way.
we will try and use intercept-python, although i barely know it
You won't need to know the backend. I hope
we have a mode where logic is alredy written in python https://github.com/overfl0/Pythia and then the idea is to convert the SQF part of it to that as well
@still forum why am I thinking that Intercept is going to be used for a Life server as one of the first implementations
sqf just passes unit positions and with the return it updates some markers
Life rework extra-new low FPS high lag + INTERCEPT v3.2a Cheesecake
Life servers don't have thaaat much serverside only code I'd say.
Though they will probably use it in connection with their Database quite soon
Networking stuff
hm... Intercept-Network would indeed be useful for LIfers...
But Intercept won't get a Battleye whitelist at first anyway.. So there won't be much clientside stuff in the beginning
I'm quite sure Lifer's won't be the first. There are already Servers using Intercept.
Can intercept be run server side whilst the client is left without a dependency?
yes.
After that you can release TFAR 1.0
๐ฅ
Intercept can run server only like any serversided script. You can compare to extDB
Sweet! Change of plans here then, that's good news.
@Adanteh#0761 what's wrong with SW though?
i mean, can you think of a feasible way to improve it?
Yes
Fix tagging system, allow fancier filters and better searching
make better overview pages
Version control.
Good one
these are all wishlist features though. as it stands SW is miles ahead of any other solution
No shitty long ass paths with hex folder names...
allow controlling what mod you are actually updating
The whole steam client not sucking ass.
you can only ever do full workshop updates, instead of updating only a single one
Anyone remember six updater?
Imagine something like that. as tightly integrated as Steam workshop.
SW is shit and will never improve, because there is no competition.
Yea i sometimes still have nightmares about it
i'd rather stick with 99.99% uptime and maxed out speeds rather than switch to something else
you can't really argue with steam's infrastructure for free
yep that's good. but it's not perfect
six was a pile of shit anyway, that's not a good role model for anything
and there's serious room for improvement
Steam branching mechanism is awful too
if you're talking about bad clients then six wins every time, their UI design was totally fucked lol
Agreed, but that doesn't make Steam any less shit.
meh....valve moves slowly, but the products they have are at least solid. people use SW cos it's objectively the best solution
Agreed. Six UI design was ugly.. But.. Being able to setup repos. Selecting which version you want each Mod to be on. I hope I remember six updater correctly.
Btw specifically not talking about playWithSix.. that really was a pile of garbage
uptime and reliability is above all else for this kind of thing imo, and valve have that nailed down
i'd pick this over the armaholic/six days 100% of the time
look at how armaholic's trying to make things work......badly
Is playWithSix still active? I thought they lost funding?
As I said.. Remember Six updater as tightly integrated as Steam workshop. As many distributed servers. Uptime.
In addition version control and better server tools.
I think they are somewhat there
yeah six died
I have recently seen "Your Mod is no available for download with playWithSix" in BIF
Speaking of Intercept, so how are you supposed to use it with BE? I assume that host dll is cleared, but how does it work with clients
it was such a weird platform/company/whatever - just an updater for mods but they tried to have this super professional corporate front to it all ๐
does BE not check them when you load them in?