#arma3_scripting
1 messages Β· Page 240 of 1
private _objects = _unit getVariable ["atag_forthis","atag_forthat" []];
yes?
or "atag_forthis, atag_forthat"
ohhh okay
you can add to the array with pushBack, but you have to always synch the variable with setVariable public again
so I can just "thearray" as "thearray"
yes
leave it*
thanks
I'm having issues and it's because I don't understand what's happening here: private _objects = _unit getVariable ["thearray", []];
I understand that you're making _objects local then getting a variable from a Unit, but if I just leave "thearray" as is how does it know which variable to get?
is it getting all variables?
and putting them in to "thearray"?
how does it know which variable to get?
there is only one variable named "thearray"
so do I put the varibles I set in place of "thearray" or leave it like you said before? I don't understand
variables*
"thearray" is the array that contains all those objects you want to delete
[obj1, obj2, ... objN]
private _array = player getVariable ["array", []];
_array pushBack _object;
player setVariable ["array", _array, true];
It's verbose, but that is SQF for you
oh so your example wasn't a copy paste, my apologies, I assumed it worked out of the box so to speak to handle this
alright so im even more lost now
No, you have to think for your self too.
Clearly.
Yea, none of this is working. I'll try it again later.
can someone tell me how I can replicate the arsenal camera?
with a controllable rotation and zoom?
MouseMoving + MouseButtonDown + MouseButtonUp across a control that spans the whole screen
So there isn't a function already that creates it?
Not that im aware of
You should be able to check in the arsenal script
Are there any repo sites aside from github/bitbucket/playwithsix that regularly host arma code that I can look through? Just out of curiosity.
www.giyf.com π
want some code examples ?
That would be nice, alganthe.
lol thanks π
https://github.com/drakelinglabs/projectrealityarma3 one more π surreptitious advertising
thanks ;p
Shameless self plugs are the best plugs
can turn off the rock symbol - player slowdown if climbing on hills ?
Using an example off of the forums, does this look legitimate for saving score data to the client machine?
profileNameSpace setVariable ["nt_score", _score];
saveProfileNamespace;```
That would ideally go in onPlayerRespawn.sqf right? And then this next part in initPlayerLocal
```if (isDedicated) exitWith {};
waitUntil {!(isNull player)};
_score = profileNameSpace getVariable ["nt_score", 0];
player addScore _score;```
Is there anything glaringly wrong with that code?
looks fine
saveProfileNamespace isn't necessary tho, it's done even if you alt F4 anyways
@shadow sail if i know SQL i say you but i dont know this crazy language π i too old to learn SQL
oh saveProfileNamespace is automatic then?
fancy
im aware how dumb it is to store anything client side but since its a coop mission im not too concerned
Thanks for the input, @lone glade
if (BOOL || {BOOL})
hmm profilenamespace doesnt persist after server restart?
right, my bad, forgot the isServer check
hmm
in onPlayerRespawn.qf I have:
if (!isServer) then
{
profileNameSpace setVariable ["nt_score", _score];
};```
and in InitPlayerLocal I have:
```waitUntil {!(isNull player)};
_score = profileNameSpace getVariable ["nt_score", 0];
player addScore _score;```
yet it doesnt seem to work, no RPT errors, no script errors showing
thoughts?
do I need to be putting these elsewhere?
you need to save the profileNamespace
oh I thought it did it automatically, okay
so I just need to add save profileNameSpace;
ah ha
hmm still nothing
if (!isServer) then
{
profileNameSpace setVariable ["nt_score", _score];
saveProfileNamespace;
};
this is on a dedi
with or without that it doesn't seem to work unfortunately
but that's alright
gonna look at Arma2Net since I need to get other forms of persistence up eventually
Thank you all for your help π
give up with extDB?
I managed to get extDB3 up and running, but i know so little about how to interface with it I decided to look at other options, still havent decided
OO-PDW with inidb might be an option
I think extDB3 will be a long term goal
Well, in ideal world I would know how to actually utilize it, that's the part I am stuck on. Every DB or persistence mod seems to require understanding the calls that are native to each mod
I can get it installed but I don't know the first thing about passing a player score to the DB and returning it on server load.
So that might just not be an option for my machine
Yea, that's somewhat of a help.. I still am not sure how to even begin. I'll stare at this stuff some more I guess.
how to remove FOG ?
While already in a mission? https://community.bistudio.com/wiki/setFog
@shadow sail summon @tough abyss
No worries.
Hi guys, I'm working on a safe zone that can be switched on and off by certain playres. For that I have introduced the variable Status, and when it equals one, the safezone is activated. However when it's deactivated by a player, it's only deactivated from that player and no one else. How can I fix this?
Most scripting can be found here https://forums.bistudio.com/topic/190992-creating-a-restricted-area-based-on-player-uid/#entry3028688
@shadow sail extDB2/3 is more aimed low level.
You decide the database scheme & querys to run to store/fetch the data.
extDB just plays dumb and acts a middle person.
If you are completely confused about SQL & Databases..
Check out the following, they are both alot easier to implement
https://forums.bistudio.com/topic/173743-stats-server-and-client-api-with-support-for-sql-and-nosql-databases/
or
https://forums.bistudio.com/topic/186131-inidbi2-save-and-load-data-to-the-server-or-your-local-computer-without-databases/?hl=inidb
Page 1 of 2 - Stats Server and Client API with support for SQL, and NoSQL databases - posted in ARMA 3 - COMMUNITY MADE UTILITIES: What is this ?Β [/HR]It's a stats/persistence system for Linux or Windows Arma 3 dedicated server. The following database/storage systems are supported: MongoDB CouchDB Cassandra MySQL Redis File-System (if you don't have a database)At its core, the stats server exposes a key-value store that has this kind of structure:
{ player1_id : { name: pl...
Page 1 of 6 - iniDBI2 - Save and Load data to the server or your local computer without databases! - posted in ARMA 3 - ADDONS & MODS: COMPLETE: INIDBI2 Lastest Version : 2.05Β by Code34Β Direct Download from DropboxDirect Download from ArmaholicLike to Donate ? Donate with paypalΒ inidbi2 is a rebuild from scratch of inidbi project with C# and SQF++ for windows client/serverΒ Major improvements:New architecture oriented object supportimprove differents methodsprelo...
Thanks π
Hello
I made an addon that contains a file with lots of #define xxx (file path myaddon\macros_include.macro)
and in the mission description.ext I have #include "\myaddon\macros_include.macro"
this works when I am hosting the server and trying the mission
but a dedicated server crashes with "Include file myaddon\macros_include.macro not found."
I did some reasearch and couldn't find the cause
the only solution I found so far is to add a userconfig folder on the dedicated server
and modify the description.ext in the mission #include "\userconfig\myaddon\macros_include.macro"
Anyone has a better solution ? Is the userconfig trick the only solution to include files from addons ?
I would like to avoid having users manually create this folder since I want them to get updates automatically through the Workshop
You cannot include something inside description ext if the mod is only accessible for either the server or the client
as it will be executed on both and one of the two parties will crash
In this case the mod is not being loaded by the server
the mod folder is installed on both server and client
what is strange is that there is no crash when I create hosted server and list the mission
but there is a crash when i connect to dedicated server (that has the mod folder too) and i use #missions
Is the server loading the mod?
i checke the logs it does
21:53:19 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
21:53:19 Zengin | @ZDB_Zengin | false | GAME DIR | 02452a06b59e30067d8c46763f04be9d16a2fef4 | 7fac2533 | D:\docs_big\arma3_ded_serv@ZDB_Zengin
21:53:19 Arma 3 DLC Bundle | dlcbundle | true | NOT FOUND | | |
21:53:19 Arma 3 Marksmen | mark | true | GAME DIR | 8a8bc2a7d7ad8251bcc82f29aea6d3f34ebffb3d | 1c11a244 | D:\docs_big\arma3_ded_serv\mark
21:53:19 Arma 3 Helicopters | heli | true | GAME DIR | 1614a75b4d3cceb5d296ca4101a589fba596aa5e | 9a800f11 | D:\docs_big\arma3_ded_serv\heli
21:53:19 Arma 3 Karts | kart | true | GAME DIR | 41f70c200a668f39e52eedf55e0c6f494aef1903 | c9867676 | D:\docs_big\arma3_ded_serv\kart
21:53:19 Arma 3 Zeus | curator | true | GAME DIR | fb1eec1e78a39cd021a71a293ae4ae1e00c98686 | 44f886e | D:\docs_big\arma3_ded_serv\curator
21:53:19 Arma 3 | A3 | true | NOT FOUND | | |
21:53:19 ==========================================================================================================================================================================================================
the addon is called Zengin
I can send you the mission and addon if you want to check it out
both are less than 3 MB
I just made another test and it looks like the issue comes from indirect include
CRASHES DEDICATED SERVER (indirect include)
- description.ext (#include "macros\toto.ext")
- toto.ext (#include "\myaddon\macros\blabla.ext")
DOES NOT CRASH DEDICATED SERVER (direct include)
- description.ext (#include "\myaddon\macros\blabla.ext")
@stiff juniper: looks like the path to the mod is messed up? D:\docs_big\arma3_ded_serv@ZDB_Zengin
missing a \
found in (773,615).
Client: Remote object 3:0 not found
"ETSERVER: OWNER:<null>:"
"ETSERVER: PLAYER OBJECT:any:"
"ETSERVER: PLAYER CLASS:any:"
"ETSERVER: PLAYER TEAM:any:"
Anyone have any idea why arma is giving me a null 'Owner' id?
who's all around this time a day/night?
o/
where you at in the world stokes?
Murica
east coast?
Yep
I hope you enjoy scripting arma at 3:30 am as much as I do
I would if arma would actually be nice to me
put it in its place :<
You seen the error i got right? lol
i briefly looked over it, have no idea
I could send you some of my code to see if you can work it out lol
im really not your man for owner stuff lol
it's just onPlayerDisconnected, or i should say HandleDisconnect
maybe it cant fetch the data in time
addMissionEventHandler ['HandleDisconnect', { _this call ETServer_OnPlayerDisconnected; }];
_owner = _this select 4;
and its reporting null, eh?
Yep
are you sure the object that's reporting null is you
and not the headless client or something stupid? (I'm taking shots in the dark here)
_owner = _this select 4;
diag_log format ['ETSERVER: OWNER:%1:',_owner];
_player = _owner call ETServer_Utility_GetPlayerObjFromOwner;
diag_log format ['ETSERVER: PLAYER OBJECT:%1:',_player];
_class = _player getVariable ['ETClient_Player_Class', ''];
diag_log format ['ETSERVER: PLAYER CLASS:%1:',_class];
_team = _player getVariable ['ETClient_Player_Team', ''];
diag_log format ['ETSERVER: PLAYER TEAM:%1:',_team];
RPT:
2:09:34 found in (773,615).
2:09:52 Client: Remote object 3:0 not found
2:09:52 "ETSERVER: OWNER:<null>:"
2:09:52 "ETSERVER: PLAYER OBJECT:any:"
2:09:52 "ETSERVER: PLAYER CLASS:any:"
2:09:52 "ETSERVER: PLAYER TEAM:any:"
is this recent behavior?
yep
so you think the update broke it then?
what kind of stuff do you work on?
life type stuff
specifically ?
not really sure how to give specifics
I'm working on terrain object harvesting atm
if that counts
kinda experimenting with diff methods
I had it drop 4 logs when you chop the tree and made you able to carry/load them with ace
specifc would be like, 'code, gui, map, assets, etc..'
little bit of everything really
I'm helping with the australia map
i mostly do code
Im not really a gfx artist or modeller
got somewhat good with manipulating already made objects in object builder
most of my object builder experience has been with buildings and stuff ported from other games
I did some cars back in A2
Havnt had much like with A3
I did most of the work on the Sydney Opera House (aside from actually modelling the thing) but I had to clean up a lot of bad geometry
cool
I'm kinda new to arma scripting, but i can get the job done, it's just errors like what i have there i have no clue... lol
id be stumped too
nothing to be ashamed of
its shit like that that makes me want to quit
If I could trade the time I've put into learning a3 modding (3-4 years) for experience with Unity, I would
That's the only thing that sucks in the monring, is people that know what they are doing isint on π
go to unreal engine π
but blueprints π
anyway, off to bed with me, goodluck with your issue
i fixed it ;P
Tweaked: The addAction commandβs functionality was extended (WIP)
Anybody knows, what's been added?
Hi guys, i'm trying to switch a doorphase on a Land_Garage_V1_F using BIS_fnc_DoorClose
I took the statement from the config viewer but no way to have it working
Anyone has a workaround?
I guess theres no BIS function for 3d text on the fly?
Like having an actual object with text on it
but only the text is visible. hnn
3d marker ?
@tame portal what do you mean exactly ... there is the draw3d mission EH where you simply can render the text then inside
example use to show playernames & ranks:
_x = cursorTarget;
if(isNull _x) exitWith {};
if(_x distance player > 100) exitWith {};
if(side _x == playerSide) then
{
_dst = (cursorTarget distance player);
_size = 1 - (_dst / 100);
_pos = position _x;
_pos set[2, (_pos select 2) + 2.25];
if(_dst < 50) then
{
drawIcon3D [format["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _x], [1,1,1,1], _pos, abs sin (time * 100) * _size, _size, 0, name _x, 0, 0.1 * (_size * 0.5), "PuristaSemibold"];
}
else
{
drawIcon3D [format["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _x], [1,1,1,1], _pos, abs sin (time * 100) * _size, _size, 0, "", 0, 0, "PuristaSemibold"];
};
};
false
}];```
But drawIcon3D cannot be hidden behind an object right?
I basically mean something like this https://youtu.be/gkSBmi2HU_Y?t=1m28s
But I guess its not possible without actually creating an object and giving it a texture
is it possible to create area markers with create3DENEntity? i havent managed to figure it out
thats possible @tame portal ... but not as simple as this lil call
simplest way is creating an object ...
hard way would be creating the objects as UI ...
i recommend you to just forget about that completly π
ooohh mmmyyyy
what happened dscha
ooohhh mmmyyyy happend
he saw today's dev branch changelog I guess π
Wat
I only know that sexy voice "Ohh myy" sound effect
OKAY
Whatever you do
DO NOT ASK DSCHA what "Ohh myy" means
well @tame portal ... you had to check it dont you?
he did.
quick question: is it normal that a dedicated server crashes when a pbo packed mission includes Γ file from an addon (#include "\myaddon\abc.hpp")
and the dedicated server does NOT crash when the same mission is not packed in pbo
?
are there any problems leaving a mission as folder (not packed as pbo) in mpmissions folder on a dedicated server?
maybe you missed the filepatching parameter in the launch paramters of the dedi server. therefore the server can't locate the .hpp outside the pbo and crashes
any idea why "classname hideObject true;" doesn't work in the editor?
it takes the form object hideObject boolean
So using a classname (which for a start is a string, and also not pointing to any object), wont work
ah ok, so how would i hide all objects of the same type?
loop through all map objects with the certain classname
how do i see the object name or do i have to set a name for each when i loop through all objects ?
On the init of the object, use this hideObject true;
or else declare the objects within a variable
for multiplayer, better to use hideObjectGlobal
sorry guys was afk, I want to hide several of the same object
why this dont work:
// The above array was built using the following code snippet called from the mission editor debug console:
/*
_atms = [];
{
if ((str x) find ": atm" != -1) then
{
_pos = _x modelToWorld [0,0,0];
if (surfaceIsWater _pos) then
{
_pos = _pos vectorAdd ((getPosASL _x) vectorDiff (getPosASLW _x));
};
_atms pushBack _pos;
};
} forEach nearestObjects [player, [], 999999];
copyToClipboard str _atms;
*/
after use code atms=... nothing in clipboard
That would be my guess
i use
atms = [];
{
if ((str _x) find ": atm" != -1) then
{
_pos = _x modelToWorld [0,0,0];
if (surfaceIsWater _pos) then
{
_pos = _pos vectorAdd ((getPosASL _x) vectorDiff (getPosASLW _x));
};
_atms pushBack _pos;
};
} forEach nearestObjects [player, [], 999999];
copyToClipboard str _atms;
Isnt it array find "blah" ?
dont work on tanoa who know how to edit this for tanoa ?
Either way use systemchat to output if its found or not so you can see if it works while running
And the code wouldnt change depending on the map, you have nothing that requires a map there?
on altis work but dont work on tanoa
Probably because there is nothing with :atm in the name?
WTF no ATM-s on tanoa
Thats exactly what I said lol
where can I find a list of dik codes to use for keydown/key up handler?
BIS' site isn't bad. I still use the site today (bad habits :P )
thanks
I got tired of looking and wrote a handler to tell me what key i press lol
Also, this is how far I got with trying to rip the arsenal cam:
http://pastebin.com/raw/d6ZSXxuR
http://pastebin.com/raw/HJr1Lerm
http://pastebin.com/raw/bDUzVrWT(edited)
currently not working
i need a script to put an AI into a players group from scroll wheel. How could i do this?
Like a player would be able to walk up and get make him recruitable. Preferabily not using MCC.
have you done addaction before?
Hi eagledude4 o/
this addAction ["Recruit",{[_this select 0] join (group player);},"",0,false,false,"",' alive _target && (group _target) != (group player)'];
the addaction would go in the unit's init
heya stokes
oh awesome
and if i wanted to limit it to a select group of players what would i do
say they were named S1,S2,S3,S4
_x addAction ["Recruit",{[_this select 0] join (group player);},"",0,false,false,"",' alive _target && (group _target) != (group player)'];
https://community.bistudio.com/wiki/forEach refer to the examples
ok cool
take a crack at it and ill tell ya if you did it wrong
this addAction ["Recruit",{[_this select 0] join (group player);},"",0,false,false,"",' alive _target && (group _target) != (group player) && player in [s1,s2,s3,s4,s5]'];
okay thank you. Whats a good resource to learn scripting if you dont mind me asking?
thanks man i apreciate it
hmm, thats script goes in init right? Does not seem to be working.
the foreach loop script would not go in the unit's init
it would go in init.sqf. or alternatively, have this addAction ["Recruit",{[_this select 0] join (group player);},"",0,false,false,"",' alive _target && (group _target) != (group player)']; in each unit's init
ah ok
so how would i assign it to the unit that i wanted recruitable?
So i have like 5 units that i want recruitable and say i only want players s1,s2,s3,s4 to be able to recruit those units.
this addAction ["Recruit",{[_this select 0] join (group player);},"",0,false,false,"",' alive _target && (group _target) != (group player) && player in [s1,s2,s3,s4,s5]'];
np
[ (getPos this select 0) + ((-17.502) * cos (-getDir this) - (-17.920) * sin (-getDir this)), (getPos this select 1) + ((-17.502) * sin (-getDir this) + (-17.920) * cos (-getDir this)), 1 ] hey guys do you know if i have calculated it right? is is a vector from the position of a building pointing at a certain point of the building. it is calculated depending on the roataion of the building
the position i usually get is always a bit of. i got the values from placing a building at [0,0,0] and getting my reference by another object's position places at the desired point.
so building @ [0,0,0] and the position of the reference object @ [-17.502,-17.920,1] ( the vector points to a door is want to attach a useraction to)
orientation = 0Β°
wasn't there a bis_fnc_getVector (or something similar)?
well i need a vector and it has to bo rotated if the orientation of the building is not 0
there is a bis_fnc by kilzonekid but it should look the same
and `[[123,123],getDir this] call Bis_fnc_rotate2D select 0 does not look nice ^^
i do not have a fix memorypoint
so i have nothing to go to.
Okay, another Q: What do you want to achieve?
it is a useraction condition. so if the player is next to a door of a building the condition ios met
the problem is that the dor has no memorypoint
there is no "real" door. it is just texture
it is a closed building. i wanted to do the teleport to roof script someone released on the forum to work without triggers
I currently think about the door script
ah, yeah
modelToWorld
with pre-cached Coords
+distanceCheck
sorta like this
player addAction ["Access ATM",life_fnc_atmMenu,"",0,false,false,"",' _CL = (nearestObjects [player, ["Land_Centrelink"], 20]) select 0; _modelPos = [5.53125,-11.1084,-0.881197]; (life_role == "civ") && (player distance (_CL modelToWorld _modelPos)) < 2 '];
For example
[ (getPos this select 0) + ((-12.385) * cos (-getDir this) - (-17.991) * sin (-getDir this)), (getPos this select 1) + ((-12.385) * sin (-getDir this) + (-17.991) * cos (-getDir this)), 7.4 ] distance getPos player <= 8
this is my actuial condition
this should work with all buildings of this type anywhere and with any rotion
Dscha, is my example what he's looking for?
but i will look into modeltoworld
you can get the modelposition using (getpos building) vectorFromTo (getpos player)
modeltowirld sounds nice. it uses the some mechanics as attachto doesn't it?
combined with cursorObject
yes and no
The array looks almost the same
or wait, yeah.
well something attached to an object rotated with the object
Yep
ok
No need to Dir/Vector/etc
beware modelToWorld is in posAGL
If you use worldToModel from the player + get the modelToWorld from the cursorObject -> nothing to think about π
z will always be 1
No
nope
Since the center of the mtw obj. is always different
Just play around a bit, its pretty easy
ok thx for the tip
- get the WTM.Pos of the Player related to the
cursorObjectMTW - check the Dist
- magic happens
(brain is not rly awake yet, wtm and mtw could be switched :P)
π
Daschar
Land_Centrelink - australian map π
Is it possible to create the name of a variable out of two things (something like this "xyz" , _target = ...)
not sure if you can with private variables, but with namespace variables you can (if i understand correctly)
ie missionNamespace setvariable [format['target%1', "xyz"], ... ];
Yea that works. Thanks!
how can i check if the player is copilot in a vehicle?
oh I have something for that
i always assumed checking for gunner would be ok but apparently it's not
You're fine with CBA functions ?
If you have ACE3 in your mod pack there's a function for that
nuh, it's for cup, CBA is ok but ACE is not π
then gimme a sec for copying the code
private _coPilotTurret = [_vehicle] call {
params [["_vehicle", objNull, [objNull]]];
fullCrew [_vehicle, "turret", true] apply {_x select 3} select {
getNumber ([_vehicle, _x] call CBA_fnc_getTurret >> "isCopilot") == 1
} param [0, []]
};
calling _coPilotTurret will return the turret which is the copilot seat
(ported cba func so I use a different tag for it)
i see
it's weird though that the game doesnt recognize the copilot as gunner π¦
since he technically is a gunner
props to @little eagle for that part of the code:
https://github.com/acemod/ACE3/blob/36205e386493e22c4689f8ceab306e3e015653e0/addons/common/functions/fnc_getTurretCopilot.sqf
copilots are always "turret gunners"
But the gunner command is only about the "primary gunner"
"primary gunners" cannot be copilots
AI Driving - Feedback topic - posted in ARMA 3 - DEVELOPMENT BRANCH: They told me to explain what is new AI driving and how it works. Weve been working on it for many months, in almost complete secrecy (excluding occasional Oukej talking about vacuum cleaners).
It is mandatory to mention, that it is still Work In Progress, has few bugs I know and many which I dont know about yet. Also, currently this new AI driving works only for wheeled vehicles, otherwise known as Cars.
Now let me try to...
you forgot #announcements π
is this going to be in 1.62 @lavish ocean ?
it's not announcement, just for those who want give feedback
ok, thanks
I'm trying to use _assignedItems = assignedItems player; and keep getting an undefined variable. This is part of a modified Quiksilver restrictions.sqf called in init.sqf. I'm not sure why this is happening?
............
Your players obtain their gear via arsenal ?
yea
no VAS right ?
correct
then my restriction system should apply, gimme a sec
https://github.com/alganthe/Co-ops/blob/dev_altis/functions/misc/fn_VA_filter.sqf
https://github.com/alganthe/Co-ops/blob/dev_altis/functions/misc/fn_gearLimitations.sqf
https://github.com/alganthe/Co-ops/blob/dev_altis/initPlayerLocal.sqf#L81
https://github.com/alganthe/Co-ops/blob/dev_altis/defines.hpp#L55
need to enable remoteExec protections and whitelist what you use, keep arsenal blacklisted
Today, I am trying to make a radio trigger that, on activation, will change the loadout of players already in a mission. I tried the simple approach of just having the radio trigger run a loadout.sqf, but it did nothing.
I want a trigger area that will regear players as they enter the trigger zone.
Is there a more effective way to offload ownership to an HC than:
waitUntil {!isNil "HC"};
["HCS_addToHC", "onEachFrame", {
if (isNil "HC") ExitWith{};
_HC = owner "HC"; //"HC" denotes the name of the unit in-game
{
if ((!isPlayer _x)||(!( _x in units group _HC ))) then {
_x setGroupOwner _HC; //adding all units that aren't player or aren't already under HC to HC
};
} forEach allUnits;
}] call BIS_fnc_addStackedEventHandler;```?
That was a script from reddit but anytime a majority of AI on the mission are aware of one unit my server FPS just shits the bed
No RPT errors aside from "Destroy waypoint not linked to a target: Near target acquisition is slow and may even select friendly unit."
arma doesnt like setGroupOwnering AI too much, since it wont switch over stuff like their danger.fsm
best bet will always be to just create those AIs on the HC
ah okay
Is there a fairly easy way to have one group create waypoints, then another group basically copy that same waypiont a few seconds later? I'm trying to create an AI platoon that moves like a real platoon, with fire teams in wedges, squads in column, platoon in column, but without having to mod formations. Preferably, if it could use BIS_fnc_taskPatrol, that'd be awesome. I could have a scripted platoon spawn and conduct a platoon size patrol.
Hi guys,is there a clean way to terminate the whole script and not the current scope?
terminate
Any super scripting Gurus know of a way to make the actual in-game map stream to a settexture? Had an idea to have the map, with all current mission markers and drawn lines displayed on a briefing screen. Is this possible? I've done it before with UAV streams, but never tried a map. Any help, or suggestions appreciated!
Hello Lords! help us please a bit, tell me how to simulate kills player Xkilled by player Z? I heared varinat with create bullet and set owner?!
@tame portal , what about doing it inside the script to be terminated?
@night void Maybe make a simple trigger, name the unit a specific name like "man1" and use setDamage 9;
@night void Unless you are trying to do it in a script, or more complex event
if (X) exitWith {player sideChat "F**k it"};
Oh, you want side chat to pull up Player InsertName killed PlayerNoName?
or smashed by car π
what about create bullet, set owner and throw it to target head?
or make car explode.
i need owner! for count points, traitor side, etc...
not sure on that one. sorry! You'll no doubt have to use set owner
how to make the game thing one player killed another on command?
Damn! Im setting reward on that shit! who solve it i will pay!
how to make the game thing one player killed another on command?
you can't
there is no API for that
If I was setting a waypoing like this:
_wp1A = _Group1A addWaypoint [getpos leader _Group16, 0];
But I wanted the waypoint to be exactly twenty meters west of leader _Group16. How would I do that?
Anyone know of a way to lock ammo boxes? I don't want players to be able to access the inventory of the boxes.
yes
player addEventHandler ["InventoryOpened", {
unit: Object - Object the event handler is assigned to
container: Object - connected container or weaponholder
use setVariable, getVariable on the ammo box
do your checks
and then return true with the event
That will abort / overwrite the box opening
Okay, and what about changing the color of an add action?
this addaction ["Remove All Weapons","removeall.sqf"];
Want to make that blue or something
I know it is, I have done it before
let's see
just cant remmber how hehe
first argument on the right side of addAction:
title:
String - The action name which is displayed in the action menu, may contain XML like syntax. Because of that < and > symbols will be interpreted as opening and closing XML tags. To avoid this use < for < and > for >. The title text can be changed with setUserActionText
there is a way to do it all literally in the init.
this addaction ["Remove All Weapons","removeall.sqf"];
- color ref
"<t color='#00FF00'>Remove All Weapons</t>"
<------ not the best with scripting. How can that be correctly added to the command I am using?
you replace your title with the one with "xml" tags from sniperwolf
yes, but it needs to execute the sqf
this addaction ["<t color='#00FF00'>Remove All Weapons</t>","removeall.sqf"];
^^ Thank you very much for the help guys. Appreciate it
wow, the spoon feeding
Well, this channel is for help from others is it not?
Asked a simple question, got an answer. No need to get snarky
sure, but you could've replaced that title too. I believed in you T_T
π
It's more of a "Give a man a fish / teach a man to fish" kinda thing. π
Understandable. Outside of very simply init lines, I am total noob at scripting. Mission creation, community development, and storyboarding is more my thing. Trying to learn more advanced topics, hence why I sometimes need a push in the right direction, or examples to go off of. Regardless, thank you guys for the help!
yw
Perhaps it wasn't meant to be -- but I can't figure a way that a client-local action can trigger a serverside ExecVM ?
unless I just have a massive waitUntil processing a stack of formatted garbage
pushed over publicVariable*
@lean tiger would this work?
[[],"your.sqf"] remoteExec ["execVM", [0, -2] select isMultiplayer];
(last param is just to make it work single player as well)
if not, could make a function to do it easily enough
does eventhandler "EpeContact" not work on a player unit?
Probably not because players don't use physX
bum crum. ok thanks
Guys does anoyone have a good indenter?
I'm trying to useTm_4 one,but often is crashing
@little eagle DeathlyRage did it in Breaking Point, when u guting enemy. Or any way to simulate roadkill?
@signal flume it looks like php and c++ π she is so far to html π
pardon?
Oh
No, @night void you absolutely CAN NOT set the killer of the killed event handler via SQF
EventHandler ?
what you can do is disable the vanilla message and make one via systemChat yourself
or any some hackz?
"hackz" ?
can i create car, then make player getIn inside it and then smash target, but not mount attacker inside it?
likes roadkill by empty vehicle but with owner (BF4 style)
Sorry, I don't understand you
what is "BF4 style" ?
battle field 4 ?
I thought 3 was the last one
I never played that
not possible in arma anyways, getting out of a moving vehicle is a surefire way to die
Like that mission in GTA 2, where you have to kill that one dude by racing a car over pier?
You jump out just before you let the car fly into the water
mean SENSE!
if was a driver of vehicles in BF nad jumped out from it and then vehicles smash enemy, u got points
sure
but that is not how arma operates
GL detecting in a killed event that you were overrun by a car
how it works in Battle Royale?
they have message Player X smashed Player Y + chat kill message on my native language!
via systemChat
systemChat format [localize "STR_blah_message", name _killed, name _killer];
Ρ ΠΌΠΌ, ΠΎΠΊΠ΅
and how they get info about friendly fire?
its handeling on game side
did u played BR?
thats it π
o!
can i make fake weapon, then give it to hands of ataker, and shoot to target?
i can make it in config
probably not
Oo ?!
you don't actually use the killed event handler for messages like these
it's most likely done some other way
"
//_current = currentWeapon player;
// player addWeapon "MOCAP_FakeWeapon";
// player selectWeapon "MOCAP_FakeWeapon"; player switchMove "";
// player forceWeaponFire ["MOCAP_FakeWeapon", "MOCAP_FakeWeapon"];
// player selectWeapon _current; player switchMove "";
// player removeWeapon "MOCAP_FakeWeapon";
"
If the scripts for BR were open source, I could take a look
I don't think that is the case though
lets try to trick with this way
doesn't look promising to me, but go ahead
but i dunno, how to create invisible weapon π¦
likes ACE/RHS have a fake weapon for "Safe mode"
model = "\A3\Weapons_f\empty";
no, ACE does not use a fake weapon for safe mode
It uses a different , rather convoluted method I developed for AGM back in the day
Otherwise it wouldn't work out of the box with any weapon out there
And I think RHS uses a weapon mode or muzzle without magazine instead of a fake weapon, but I haven't looked at their stuff lately
i need something same, no sense how it works, i just need results π player X killed by player Y, handeled by default game mechanics
@little eagle pm me please, when u find something to test, i have a offer for u π
player X killed by player Y, handeled by default game mechanics
Well you cannot script that
Sorry
shrug. the only way to influence the games behaviour at that level is scripting
What do you want to achieve?
one way what i see its kill target by fake weapon
because nothing you could change in config can make this work
He wants that roadkills with a car are displayed even though the player jumped out of the vehicle a second before
I think
not only roadkill
forget it. Without Scripts not possible.
i just need to simulate player X was killed by player Y, and do it by game mechanics
forget it. Without Scripts not possible.
exactly
no!
a lot of dudes told be Melee and takedowns is impossible in arma! BUT i DID IT!!!
congrats. you seem to know more than we then
and many other things
you probably should help us in that case
one way what i see, its fake weapon
@little eagle thank u very much for ur help, but no sarcasm here please, im really wish to make great things likes melee in arma
Still: He is right. You can't do it without scripts.
*script
yes, but its Weapon and she shooting to target!
and game will do requred things of kill detection
can i aim bullets to required target by script?
now need to know how to make config for fake weapon π¦
What is the easiest way to put a group in "DISMISSED" waypoint behavior for a set time, before forcing them to move on to the next waypoint?
Does anyone know if it's even possible to rotate a player with a script that is triggered by a trigger?
I've tried setDir and setVectorDirAndUp, nothing seems to be working
im very sure it should be possible.... dont know why setDir doesnt work tho
Yeah I've had a look around, and just tried doWatch too
everyone seems to have success with at least one
there must be something that I'm doing wrong
setDir is working oO
does it not work?
No, that was a fact. It is working.
quote: I've tried setDir and setVectorDirAndUp, nothing seems to be working
right, well I'm still lost on why it's not working for me then
I assume, that trigger triggered by a trigger didn't triggered
I thought that too, but I put music to trigger with it, the music came on
OR didn't triggered the right person in the trigger. So the Trigger was triggered, but the Person inside the Trigger isn't triggered.
(Yeah, sounds like i am trolling, but its correct :P)
(i just like the word Trigger atm^^)
_unit setDir 180;
Is what I think that I put in there
the script now
I can't remember as I deleted it to try other things
Server Executed?
playing in single
systemchat str (name _player);
add this below _unit decleration
_unit = _this select 0;
systemchat str (name _player);
_unit setDir 180;
will give that a try, 2 secs
I bet, there comes no msg π
@noble ether
Try this in the Trigger:
(exp Cond)
{systemchat format ["NAME: %1", (name _x)]}forEach thislist;
okay so a little progress
the script is now throwing errors, when it wasn't previously before
this is good
The one i posted?
I tried just _unit = _this select 0; _unit setDir 180;
_unit in line 2 is not recognized
lol wut
...
Try this in the Trigger:
(exp Cond)
{systemchat format ["NAME: %1", (name _x)]}forEach thislist;
sorry for the lack of response, been trying a load of different things
right I got somewhere, but I'm off to bed now, going to try to finish ti tomorrow
thanks for all your help @jade abyss, much appreciated
o7
what is the procedure for requesting a variable from the server box?
Has anyone noticed that fadeRadio seems to effect playMusic? Only fadeMusic should
@noble ether
- it never matters from where the SQF code is executed. triggers, event handlers, init sripts... It's all the same.
The only thing that does matter, is on what machine a command is executed. - you cannot carry over local variables from your script into the scope of your trigger. You have to use
thisListor some other kind global variable when using a trigger. You can define a new set of local variables in the triggers scope though. - setDir is a command that has only local effects. If your trigger only runs on the server, the unit will only be rotated on the server too. Either make the trigger execute on every machine (create the same trigger on every machine) or use the common work around to emulate a global setDir:
Use "_obj setDir getDir _obj;" after the setDir. getObj has global effects in contrast to setDir and the rotation carries over. - setVectorDirAndUp does not and probably will never work with soldiers. Soldiers are always facing upwards in Arma
I can't seem to get my custom difficulty settings to work on my dedicated server.
In server.cfg, I have a mission cycle defined with difficulty = "custom"
I have defined class CustomDifficulty under class DifficultyPresets in my server profile
What am I doing wrong?
Any idea how to resize the cover module via script?
it creates markers, so youd have to delete those markers and re run the function with different parameters
Ohhh
Is there a function to create the module on the fly?
Hm there is a BIS_fnc_moduleCoverMap, might have a look into it later
that function is the function the module calls
Well looks like Im not coming far with that then
@vapid frigate Thanks for the tip Friday with remoteExec
I understand localization, happy there's a function to help me punch through the client-server barrier π
@lean tiger no worries. I think the better way to do what you were talking about is making your .sqf into a function (see https://community.bistudio.com/wiki/Functions_Library_(Arma_3) )
then you can remote exec it directly, instead of remote execcing execvm
hey guys. I got the following code on the init of an object:
while {!isNull (_this select 0)} do {
_dist=player distance (_this select 0);
if (_dist < 6) then {
player setVariable ['tf_sendingDistanceMultiplicator', 4, true];
}
else { player setVariable ['tf_sendingDistanceMultiplicator', 1.0, true];
};
sleep 10;
};
this works pretty good but what i did not think about is if i have two objects of that type. If there's more than one the loops will "overwrite" themselves. I'm a bit at a loss right now how to solve this issue. any ideas?
runing a loop on the player and check if there is a object of the class in the distance?
the loop is on the object itself with an init eventhandler.
yes and why not only have one Loop on the player running? that is way easyer
[{
private _object = (getPos player) nearestObject "AwsomeClassName";
player setVariable ["tf_sendingDistanceMultiplicator", [4, 10] select ((_object distance player) > 6)];
}, 10] call CBA_fnc_addPerframeHandler;
like that?
hm.. I like the idea but unfortunately it doesnt work. The mulitplicator doesn't get reset if you're further away than 6 meters
it does?
to be fair, [a,b] select BOOL isnt a syntax you see often π
π yeah i like it because its so short
hm.. i might be doing sth wrong but this
[{private _object = (getPos player) nearestObject "Land_PaperBox_open_full_F"; player setVariable ["tf_sendingDistanceMultiplicator", [4, 10] select ((_object distance player) > 6)];}, 10] call CBA_fnc_addPerframeHandler;
doesnt work for me
multi stays at 10
oh wait invert it > to a <
ok
its inverted and i think those brackets are too many
getPos player nearestObject "AwsomeClassName";
[<any>, <any>] select <bool> is actually more or less the equivalent of SQF which other langs do with <bool> ? <any> : <any>
ok
but preferably you always should use if in both cases ... in the first one even more due to the fact that this crap just confuses and is inconsistent
thx @zealous solstice
How is ARRAY select BOOL confusing?
pretty clear what it does. You also use it mainly to pick out the value for a variable and that looks shitty with stuff like _var = if ...
sigh ... commy commy commy ...
select is the index access operator of ArmA (more or less ... just like everything else in SQF it is just a command like so many others)
saying that the index access operator is consistent when you allow it to be used with bool ... is simply bollocks
Yes. And false picks index 0 and true picks index 1
and here is why you're in muted trolls X39
we also can start using local instead of private again ...
private _clientID = [0, 2] select isMultiplayer;
was logical and consistent if this is too
shush alganthe
if (isMultiplayer) then
{
_clientID = 0;
}
else
{
_clientID = 2;
};```
alt.
`private _clientID = if(isMultiplayer) then {0} else {2};`
the first should always be prefered
The = iftriggers me
Hmm, i dont think there would be a noticable Perf. Difference.
But, tbh ... I do the same with switch all the time
Still, i agree, looks cleaner
allright that's what i ended up with now
[{
private _object = getPos player nearestObject "tfw_rf3080Object";
if ((_object distance player) < 6) then { player setVariable ['tf_sendingDistanceMultiplicator', 4, true];}
else { player setVariable ['tf_sendingDistanceMultiplicator', 1, true];};
if (isNull _object) exitWith {(_this select 1) call CBA_fnc_removePerFrameHandler;}
}, 10] call CBA_fnc_addPerframeHandler;
what no?
why did you do this
private _object = (getPos player) nearestObject "AwsomeClassName";
player setVariable ["tf_sendingDistanceMultiplicator", [4, 10] select ((_object distance player) > 6)];
}, 10] call CBA_fnc_addPerframeHandler;```
this is enoth
looks like a wall of text
you dont need more
use `
just call the lines that i wrote you in the player init and than you are done
you dont need anything more
doesn't nearest objects already accept objects?
yeas
player nearestObject ... ?
oh waht
then scrath the getPos
no that i dont knnw
yes it take object
@tough abyss only call this in the init from a player that is enoth:
[{
private _object = player nearestObject "tfw_rf3080Object";
player setVariable ["tf_sendingDistanceMultiplicator", [4, 10] select ((_object distance player) > 6)];
}, 10] call CBA_fnc_addPerframeHandler;
```
more you dont need
private ["_object"];
_object = player nearestObject "tfw_rf3080Object";
if (_object distance player > 6) then
{
player setVariable ["tf_sendingDistanceMultiplicator", 4];
}
else
{
player setVariable ["tf_sendingDistanceMultiplicator", 10];
};
}, 10] call CBA_fnc_addPerframeHandler;``` and now you even can understand the code without fully reading everything
Not a fan of puting newlines before these curly brackets
also that PFH isn't self terminating
and make it around 10x larger
I don't think it's supposed to be
just copied and altered what @zealous solstice posted @lone glade
@lone glade the PFH dont need to terminating it self
Anyone have documentation on the 'SEL' command?
or willing to share their knoladge about it
SEL command ???
what SEL? this not look like a command
Never heard of that
that more look like a custom Macro
macro
Yeah, that is a macro
macro
#include "....\script_macros.hpp"
Look in this file #include "..\..\script_macros.hpp"
lol too many cooks, I'll leave it to you guys
#define SEL(ARRAY,INDEX) (ARRAY select INDEX)
I think he can figure it out now haha
ya
there you go
typical macro misuse
better do not start with it @velvet merlin you will receive loads of hate in this channel for such opinions
up to the point where they just will call you moron
dude
but yes, that SEL macro is dumb
It's the same thing, but ordered differently
I guess he really hates the binary commands
x39, select vs if-else for variable assignments is personal preference, no need to be insulted because someone doesn't do it the way you deem it correct
understandable
that guy is just lazy - sel = 3 chars, select = 6
however that makes him also not willing to learn better ways to save typing/time
@warped thicket the select thing is just inconsistent ... nothing else with it
anyway ... i head of to watch football
tbh I always prefer _var = switch (true) do { case (isMultiplier): {2}; case (isMultiplier): {0}; };
@foggy pike did you want to troll?
that is your nitpick with that???
from : https://community.bistudio.com/wiki/Initialization_Order
since when is init.sqf NOT executed in MP?? as far as I remember and I think it is still the case, it should work?
@here guys, what in your opinion is the best way to to restart the currently running mission (eden editor) there is no script command like "restartMission"
serverCommand #restart ?
Reassign?
#restart
^ agreed.. but also yes #restart command would be best
happy i have the channel muted
I guess it's veterans that can use it haha
but yea it should be removed
serverCommand "#restart";
^
Someone inform Dwarden aboot this π
wow... "here" for such a bs question... rly?
I think he is able to use it because he has the member tag
i forgot there was a scripting channel in this discord haha, i literally tabbed out of the arma scripts i'm writing to see what the notification was xD
You just woke up 600 people lol
So much hate for "here" ? :D
Agree'd
^^
^^^
im sorry.
@thorny pagoda It pings fkn everyone...
@high plume you caused public outrage π
@high plume I think the next development from scripting will be how to strip you of using that command
haha π guys sry im awake since yesterday 13 o clock (so around 30hrs), my brain is fried.
I like to compare using the "here"command to whacking a wasp nest with a baseball bat
do enyone know how you add text to youre brefing in arma 3 edditorn?
Yeah but still :D ping doesnt kill you or it does? :D
Couldnt you just use the mission briefing?
@runic spoke yea sur thx
gonna use endMission for now. better than nothing.
im basically editing sound configs, using arma3diag.exe, merging configs and trying to restart mission asap.
but i think im dead for "today"
thx guys. gn8
mega, serverCommand "#restart"; litreally π
@runic spoke it works in eden editor as well? didnt know that. ill try thanks.
uhm, if you are playing the mission yes.
@runic spoke nope. cant put #restart into a radio trigger, also executing locally via dev console does not do anything.
serverCommand "#restart"
Has anyone successfully used any of the road commands or nearestTerrainObjects to get the actual p3d name of a road? All I ever get is the object ID followed by " "
Hmm, let me see if i have all the p3d file locations written down.
@ here be dragons
Well I'm looking more for getting the names and locations of roads for Tanoa p3ds
I don't have Tanoa stuff yet.
so.... I'm a Veteran here ? how strange.
looks like i know what i'm wroking on π
And they are in EBOs so it's not as easy as just looking at it
Nope, they are null objects to it
cursorObject doesn't work for roads or map-baked buildings anyway IIRC
Trees etc seem to work fine on other maps, I personally have yet to test anything on Tanoa
It does work for buildings, jsut not roads
From everything I've seen cursorObject will tell you the p3d of any object, other than clutter or roads
I'll see if i can get them for you once i switch to dev branch
@runic spoke @zealous solstice http://i.imgur.com/72iwEvM.jpg
? π¦
add a nil to the end
@zealous solstice servercommand "#restart" nil; ?
fml
doesnt work.
man i suck at scripting. i cant even get a sript to run from the trigger. jeez.
Triggers run client side i'm pretty sure.
i thought maybe put the commands into a script and run that script from trigger but i cant remember, spawn something... mhmh
nul = servercommand ...
The mission makers chat is probably better for your needs
@indigo snow thanks mate. but mission still does not restart (testing in editor)
youre right, ill go to mission makers. maybe throw in another @ here or something haha
gn8 folks and thank yall.
@high plume don't you dare jk xD
if you suck, it might be time to swallow some documentation ? ( sorry :p )
π funny
wow, wow, just wow. @finite temple
hahaha π the internet.
he word itself is quite inapropriate : semantically, there isn't much link between that and being bad at something random
proof you have a dirty mind π
we all do.
@runic spoke @high plume Triggers will work on server or client IIRC but they're not very well optimized as the condition checks run on each frame
Just checked the biki, triggers have global effect https://community.bistudio.com/wiki/createTrigger
not if you change the last arg
triggers trigger me
welcome to the club
inArea made them less useful
bujl od
@zealous solstice nope more like extremly strict 3DEN editor ...
@indigo snow is correct about it ... BOOL != "Nothing" (aka NIL)
but that topic was already communicated to you via some forum posts ...
I thought trigger checks were every 0.5 seconds, not every frame?
I don't get why you have to return nothing in the init boxes. That just seems annoying.
Maybe someone can write a 3DEN patch , so it automatically applies a nil
or just skip this useless check
All you'd have to do is add a ;nil at the end. ... redundant
as said @little eagle ... extremly strict
but why? what's the point?
Good thing I never use the init box
I can't debug anyway with all those macros
quick question is arma 3's 'and' && and 'or' || when using logic?
nvm just found the wiki
Anyone know how to hide/disable the rsclistbox on the map that shows players etc
I tried but litterally everything can be hidden but the listbox
@noble ether
You can use && || or literally just 'and' or 'or'
|| wasn't working for me for some reason and I couldn't find the wiki page
then as soon as I posted here, I found the wiki page, found out I was right and it worked
this always happens when I code π
haha
If it's easier just use 'and' 'or' 'not' etc
if (IAmAwesome OR not lame) then {
error: Type Array, expected Bool
Does anyone know if it's possible to give a darter a hellfire either by attachto or some other command?
Uh... Asking for a friend
Definitely not trying to make hunter killers
I'm OK with there not being a "visual" weapon on the drone
Would addweapon work for this?
Are dialogs opened with createDialog always blocking input like player movements (W, A, S, D)?
i think you need createDisplay for non blocking
but its been some years since i last used that stuff
@deft zealot what do you have in mind?
in Blitzkrieg i have made a passive interface (display only). or check out the ShackTac Hud thingy
i want something like the inventory display, which closes automatically when you move
but is still interactable
might be wrong here, yet its probably engine functionality
you have to script a monitoring system or event based with animStateChanged or sth similiar
Is it plossible to get rid of [eg spectator](EG Spectator) ui without losing player markers?
derp
come on
its not full markdown @silent terrace
Sadface
just basic formatting
Ah, answer in link i provied, thank you guys! π
is it possible to adjust heli collective controls with scripting?
guys,
i am trying to get an all in one config dump into clipboard using this script: https://forums.bistudio.com/topic/188332-eden-all-in-one-config-dumps/?p=3005357
but it does not finish and i see a scripterror:
http://i.imgur.com/vctrJ3y.jpg
how do you guys make all in one configs?
EDEN All-In-One Config Dumps - posted in ARMA 3 - ADDONS - CONFIGS & SCRIPTING: I generated some all-in-one dumps of the config tree for the new Eden update.
Β
NeoArmageddon, who provided a workaround for a recent breakage in the script to generate these via his MapBuilder FileIO extension (Thanks!), suggested I should post them up;
Β
http://ionwerks.net/...inoneconfigs.7z
Β
There are four dumps;
Β
Vanilla Only:Β arma3-156.134627.aio.cpp
w. CUP Terrains:Β arma3-...
My guess is that you are running so many addons that the number of classes to print exceeds the maximum size of an array.
Which is weird because the array limit is somewhere between 1E6 and 1E7
is it possible to adjust heli collective controls with scripting?
no
I am learning programming, with my first chosen language, Python. Just curious, is arma scripting done in python?
I have a script, but I need it to check if player is in Land Vehicle or boat, link to script http://pastebin.com/vKMrkgmP
farmer, I am just a beginner programmer, could you tell me what language arma uses for scripting?
It seems to be BI's own scripting language?
n/m I think I get it now -- "SQF syntax"
yea I think its sqf, it is called a .sqf
@vagrant cliff but do you know how to make it just check if a player in a land or boat vehicle, it runs on all vehicles which i dont want air vehicles to be spawning fog in the air
@lethal wolf
_vehicle isKindOf "Car"|"Ship"|"Air"
He's asking if ARMA uses Python, did you expect him to answer that?
oh, and how would I put that statement in where? on top of this? " _inVehicle = (vehicle player != player);"
then add the _to vehicle
I dont know much coding, so im new to this
Do you want to exit out the whole script if they are in a heli/plane?
or just not run 'dooFog'?
I don't want it to run dooFog when in heli/plane, but cannot exit
and still sleep for 120?
yes
@dusk sage Yes, it did work, thanks very much π
can someone explain to me how I'm using disableSerialization wrong here?
20:42:06 Warning Message: Variable '_money' does not support serialization. Call 'disableSerialization' in the current script (maybe 'life_fnc_numberText') if you need to use it.
20:42:06 Warning Message: Variable '_bank_text' does not support serialization. Call 'disableSerialization' in the current script (maybe 'life_fnc_numberText') if you need to use it.```
i renamed the variables. _money is now _moneyText, and _bank_text is now _bankText
_money is now _moneyText, and _bank_text is now _bankText
What happens if you try add disableSerialization inside the while scope?
That's what I was thinking of doing, but I wanted it explained to me why Its needed in the loop
"_moneyText ctrlCommit 0; and _bankText ctrlCommit 0;" is outside the loop, so thats why I left the disableserialization outside as well
is there a generic ruleset for knowing when to use disableSerialization? (aside from when you get the error)
When you're using UI data types
Read the wiki https://community.bistudio.com/wiki/disableSerialization
i thought having the one up the top should be enough
the error sounds like it wants disableSerialization in life_fnc_numbertext though
@vapid frigate
Nothing to do with life_fnc_numberText, it's purely passing a scalar to a function
@agile pumice
It would seem to be loop specific
@agile pumice you figure it out?
I was going to tell you that π but since you figured it out.. lol
ya, my buddy likes to tap into scripting sometimes and doesnt always do the best job lol
'my buddy', gotcha, mums the word π
can moms not be friends? lol
when using removeMagazines, And i would like to remove allmagazines, can i just do "this removeMagazines;" without indicating any classname?
because the syntax is supposed to be unitName removeMagazines magazineName
{
player removeMagazine _x
} forEach (magazines player);
If you "_player setVariable ['...', code..];" on the server is the server only able to access that information?
Yes, unless you add a third true argument
Yeah, to globalize it. was just making sure it was only accessable by the server.
Bleh -- this isn't SQF, but for Arma2Net plugin writing -- getting a TargetInvocationException if my function uses "params" for a variable number of arguments
did my due diligence googling, but no luck -- anyone have experience with that?
Not running it in a mission yet, just demoing in the Arma2Net Explorer
Does anybody know
why the hell disableChannels[] isnt working again
disableChannels[]={{0,true,true},{1,true,true},{2,true,true}};
results in all channels being accessible, von and text..
becouse true?
@tame portal, change the trues to false to disable.
didnt work either
tried that before because it was more logical
but in the end nothing worked ^^
works for us. You just broke it π
Well thats interesting I guess :S
Can anyone help me, i have a array of strings, each one is the variable name of one of my objects in the missions, i now need to move these objects from my script but i cant convert the string name so that it uses the object by that name
Well the dirty way would be call compile
Well gimmie the dirty way please π
Well
if your missionfile creates a reference to your eg helicopter
with the name myheli
and your array contains "myheli"
you just do
_heli = call compile "myheli"
Since call compile makes whatever is inside the string into code and executes it
that is slow with compile
and since your mission saved a reference under myheli it will assign the value of myheli to _heli
Better is missionNamespace getVariable
yes
_heli = missionNamespace getVariable ["myheli",objNull];
objNull in that case is just a default value in case your heli doesnt exist for whatever reason
Tried both of those now, not working