#arma3_scripting
1 messages ยท Page 441 of 1
PositionAGL uses the next solid walkable face below as ground level
meaning 100m is not 100m above terrain. But 100m above the next box below it
ahh I c
god damn you saved my ass xD it works immediately
thank you thank you
Im trying to give geometry to a 2km long spaceship lol
by filling it with 50m cubes
Please use simple objects instead of vehicles
?
muuuuch cheaper and more FPS friendly
_box = "TIOW_geo_box_50m" createVehicle (getPosASL _ship);
-> _box = createSimpleObject ["TIOW_geo_box_50m", getPosASL _ship]
2km spaceship without simple objects, dat lag
https://community.bistudio.com/wiki/File:SimpleObject_PerformanceChart.png You don't disable simulation. Meaning this graph the blue bar for house
I feel like such a newb when I talk with you guys ๐
thanks again
compared to the dark green bar with simple objects
will simpleobjects still have geometry?
Not much. But if you compare the carx simulated vs simple you'll see that it's worth it ^^
yes
They have geometry, collision and textures
no gravity and no physx
It pays off the most for cars and other vehicles that are just standing around to look nice.
smarter every day
Advertising not allowed! ๐
hehe
700+ vehicles vs 700+ simple objects, that will be noticeable fps boost even with those cubes ๐
How big is a cube if I may ask?
Cylinder is asking how big is a cube, i love #arma3_scripting
one of my cubes I guess he meant ^^
TIOW_geo_box_50m โ yeah ^^
Ye, ye, just the situation itself ๐
๐
๐ ๐
PositionAGL uses the next solid walkable face below as ground level
No, you described AGLS. AGL is just the terrain level being z=0 over land, and the waves being z=0 (and fluctuating with time) over sea.
What is a common reason for remoteExec returning only an empty string, when i try to return a populated array?
_localVar = [_unit] remoteExec ["mld_fnc_checkData",2];
//returns only:""
``` Where in mld_fnc_checkData, i have used systemChat on the exact same array to be returned, and i get the result i want
remoteExec returns the JIP id. If you don't use the JIP flag as argument, that is always an empty string. RE does not support return values of functions. You'll have to find a different way to do that.
mld_fnc_checkData: ```sqf
//at the end
systemChat str _returnValue;
_returnValue;
oh
that's a pain : \
thanks for the help anyway.
I have two functions (mld_fnc_sendVariablesToClient, and mld_fnc_sendVariablesToServer) that will do this for me anyway, so it is all good.
We had this discussion before. Twice. Too bad I didn't save the code snippet on how to do that. Damn connection.
"We had this discussion before." me and you, or "we" as in the scripting channel?
Me and this channel. I don't remember people, I'm super bad with names and the internet only amplifies that.
haha yeah, fair enough
All i have is a function that will accept a var name and a var value as parameters that is executed on client or server depending on which machine needs the variables, then a switch do structure to determine which var to pass .
It works well so far, but it would be slower than if remoteExec could return vars
I think it essentially boiles down to:
commy_reData = nil;
{
missionNamespace setVariable ["commy_reData", time, remoteExecutedOwner];
} remoteExec ["BIS_fnc_call", 2];
waitUntil {!isNil "commy_reData"};
Which requires the dumb schedler. Alternatively some callback functions, but that is more stuff to write.
yeah ok, seems a bit more efficent than my method
// Server (fn_serverFunction.sqf)
params [
'_foo'
];
if !(isRemoteExecuted) exitWith {};
if (remoteExecutedOwner isEqualTo 0) exitWith {}; // Not valid RE owner
private _return = _foo + "bar";
[[_return],{
params [
'_foobar'
];
systemChat _foobar;
}] remoteExec ['spawn',remoteExecutedOwner];
// Execution
["foo"] remoteExec ['serverFunction',2];
Where systemChat is just an example of whatever you want
I hate "foobar" so much.
better than fubar code!
maybe snafu is better... ๐ค
Gesundheit.
vielen dank, mein freund ๐
O_O hides
๐
โ ๐ถ
high-five! ๐ค
why is it even called foobar
because barfoo was too offensive
...
Because it sounds funny and catchy, and so it caught on. In reality it's stupid, and stupid things are stupid and should therefore be avoided.
imo slang should be avoided as soon as you need "readability" or just make things with "single constant and clear meaning" in all scenarios for everyone...
like math... "2 + 2 is 4 minus 1 dats free quick mafs" ๐
imagine sqf on ัzech vytvoลitVozidlo < createVehicle
what better to use
BIS_fnc_addStackedEventHandler or addMissionEventHandler for executing a script on the server , when a player connects.
addMissionEventHandler seems like the simpler thing, though stacked can pass arguments if you need that for whatever reason.
im trying to exec a function to client from the server, when the player has connected fully.
is there a way of using waitUntil here ?
Define "connected fully".
has been assigned a unit.
initPlayerLocal.sqf, no remoteExec needed for that.
im just trying to keep all my stuff serverside xD
Define "serverside".
serverSide pbo's/
So a mod and not a mission?
serverSide mod yes.
PlayerConnected mission eventhandler added in preInit.
Lega_GangManagement_PlayerConnected = addMissionEventHandler ['PlayerConnected',{diag_log format ["[Lega Gang Managment] [Player Connected] [%1]",_this]}];
is what I have working so far , in postInit on server, just trying to work out a way of waiting untill the player is an object, or has disconnected before Continuing.
Guess you could RE a loop that checks for !isNull player and then RE's a callback on the server.
no filtering name __SERVER__ ?
?
The RE'd script could use !hasInterface exitWith to handle that.
Here, let me help you:
//preInit
commy_fnc_playerConnectedCallback = {
params ["_unit"];
diag_log ["player connected", _unit];
};
addMissionEventHandler ["PlayerConnected", {
params ["_id", "_uid", "_name", "_jip", "_owner"];
{
if (!hasInterface) exitWith {};
waitUntil {!isNull player};
[player] remoteExec ["commy_fnc_playerConnectedCallback", 2];
} remoteExec ["BIS_fnc_call", _owner];
}];
ty โค
^ didnt get the actual purpose of that ๐
Basically make shift initPlayerServer.sqf for addons.
why not use remoteExecCall in that case?
๐ค Because waitUntil?!
does BIS_fnc_call send code to scheduler?
scheduled:
remoteExec ["BIS_fnc_call"]
unscheduled:
remoteExecCall ["BIS_fnc_call"]
remoteExec ["call"]
remoteExecCall ["call"]
interesting
"Interesting", but not in the good way.
Hi, does anyone know if there's a limit to the size of an array that can be stored in a profileNamespace?
1e7 elements.
1x10^7?
Yes.
ok, that's weird.
I am making a playerDatabase system that stores all player data and it all stores in one big multi dimensional array, but when i diag_log it, it will only have half of the array, the rest is cut off. i thought that this might the cause of my problem
the array is no where near that big thoug
the cause of your problem is the idea...
Why's that?
Probably a limit of diag_log. You should instead iterate through the array and print each element in a new line.
That sounds like a good idea, i shall try
Yeah that worked. Cool, my array is working so far ๐
According to the wiki, diag_log is up to 1044 chars.
@lone glade I understand what you mean about having 1 database stored locally in their profilenamespace, i might change it so all elements are stored seperately locally and then are just backed up into a signle database on the server's profileNamespace. Do you think this is more effecient?
No, that's worse.
anytime your change something in profileNamespace the file is written to
yeah i know, but i need to be able to store things persistantly
use a database then, don't save to profileNamespace
inidb / mysql
but from what i've heard, using extDB as an addon is a pain
anytime your change something in profileNamespace the file is written to
Yeah. I suspect you could copy the array before modifying it and then store it at once. Never tested if that actually makes a diff though.
i wanted to do this a temporary solution until i get my head arround the whole external database stuff
Moldie , its pretty easy, there is some documentation in the source of extdb that gives your examples on how to initilize it.
yeah thanks, im looking now
just didn't want to change too much in my mission was all
oh wow, that's good, they have functions already?
you just send it the data, and get the server to put it into the db
no these are examples
thanks for the help, i will definitely consider using extDb3 instead
Although im fairly sure i might has some more questions later on with respect to this ๐
if you need a hand just hit me up xD
ok thanks
Because waitUntil?! but why do that on client instead of server?
Because the client knows what player is.
Oh, well server can also know that.
No, player is null on the server.
No, i meant objectFromNetId will tell if that owner you get from EH is handling a null object
Or im wrong?
I don't follow.
I mean doesn't that will say that connected client already having a body?
This may be too smart for me.
ah just wondering about it, nvm.
I have a hunch about how that'd work, but where would you get the netid from?
Just assume owner:0 and hope for the best?
Do you guys know if is possible to turn on buildings lights and how? or i do have to place the light on my own?
is there a way to delete one part from a string?
i.e. "apples_and_oranges" - "ranges" = "apples_and_o"
depends, do you know the part that needs to be? if so, you can use select
what do you mean by needs to be?
See Alternative Syntax 3
https://community.bistudio.com/wiki/select
basically im trying to parse a variety of different strings that will all have the same ending characters
and remove said ending characters
you can select "from here to here" but not "string" - "theseSpecificCharacters"
you can use toArray and toString too
if the ending characters you want to remove are always of the same length, you can definitely use select ๐
hmm dont think select will work since the strings are of varying lengths
you can get string length and work your way with it
ah i see what you mean
figure out the length of the string then subtract the number of characters that equal the length of that shared substring
then use select
_length = count myString;
_myText = myString select [0, _length - 3];
for example
will try it out thanks
๐ good luck
_vehicle isKindOf "Tank"
is this expensive enough to cache it with setVar on the vehicle?
what does the console benchmarker say?
(I would say not worth it, unless you call it thousands/second)
it would be done constantly every 0.1s or so for all vehicles during the complete lifetime of any mission
while we're on the topic, is a while loop that runs every 10 seconds that parses a bunch of strings too expensive for performance?
(sry to hijack your question kju ๐ )
@tropic summit depends on the amount of strings, and also depends on what you do with it ๐ it's a vague situation, but since it's every 10s (and it happens on the server I guess?) it should be alright
happens on the client and its 8 or so strings and swapping uniforms once
@velvet merlin ... I'd say meh but if performance is really of the essence, go for it
@tropic summit no probz
ok cool
@winter rose worked perfectly man, thanks a ton
welcome!
I'm wanting to create a mine field composition. So I tried making one in VR and then ran BIS_fnc_objectsGrabber. It returns no objects... Anyone got any ideas why?
which params with BIS_fnc_objectsGrabber ?
[ screenToWorld [0.5,0.5], 50, true] call BIS_fnc_objectsGrabber
If I place a sandbag wall as well and run same code, it returns the sandbag wall
(pointing at the ground I guess)
well then maybe mines aren't processed by the command itself
Maybe it doesn't work for mines which are CfgAmmo.
daayyum.
plan was that this minefield layout (mixed AP, AT) would then be spawned on a road.
Any ideas
Well, write youself an alternative to BIS_fnc_objectsGrabber. Shouldn't be hard.
hmm. maybe not for you. But I'm having a go.
@velvet merlin it would be done constantly every 0.1s or so for all vehicles during the complete lifetime of any mission Yes worth to cache.
ty
You sure, Dedmen? I'd say it depends what else it does. _vehicle isKindOf "blah" is a string, a variable, and one binary command. How would caching cut that down?
I'd say getVariable is faster than the config lookup
does this work?
_isTank = _vehicle getVariable ["LIB_isTank",_vehicle setVariable ["LIB_isTank",_vehicle isKindOf "Tank"]; _vehicle isKindOf "Tank"];```
Usually not worth it. But every 0.1 seconds for every vehicle on the map... worth it
Uh...
No
syntax error
k
and you are calling isKindOf three times in that. Then setting it to a variable and immediately getting it back out
that's kinda dumb
so this?
_isTank = _vehicle getVariable "LIB_isTank";
if (isNil "_isTank") then
{
_vehicle setVariable ["LIB_isTank",_vehicle isKindOf "Tank"];
_isTank = _vehicle isKindOf "Tank";
};```
or just do init EH on class Tank do the setVar in the first place..
initEH yeah
it's not gonna change anyway
If you want to improve runtime performance. adding a isNil check that runs at runtime and is always but the first time false. Is a waste
kk
It's a waste, because now you have 2 commands instead of one.
Silly question: why would the value of isKindOf "Tank" change? I mean I know that in say, Arma 2 certain types of vehicles when destroyed were replaced by a wreck of different classname. But that was also a different vehicle, so it would not help anyway.
It's a waste, because now you have 2 commands instead of one. 4 commands*
I know building is replaced into ruined class when it was destroyed.
How to detect the building, where mission's object is placed, is destroyed ?
!alive (nearestObjects [_object, ["House"], 3] select 0) ? where _object is the mission object.
Well define "destroyed" slightly damaged. Severely damaged. Pile of dust?
you can probably check the buildings damage
if it is totally destroyed, pile of dust, then how to?
Wouldnโt it be a Ruin?
I'd like to know the building is ruined or not.
Anyone know of a script that will kick out every variable that is going into namespace and log it into a file? I don't want to re-invent the wheel. I've been looking but don't see much. I'm trying to determine which variables are being saved in namespace for debugging. I'm trying to help a dying mod and new to Arma3 scripting, came from other languages. Looking to replace his system of saving to namespace to inidb or something similar as progress in his mission tends to corrupt with multiple players going in and out of the mission
Hopefully that made sense, if not I can explain further. But my first mission is to determine what variables are being saved
allVariables <namespace>
gives you all variable names in namespace. Then getVariable each of them and print them somewehere
do keep in mind that variables set to nil still show up there
for "_i" from 0 to 100 do { _namespace setVariable [str _i, nil] }; count allVariables _namespace > +100
How to detect the building, where mission's object is placed, is destroyed ?
0 spawn {
private _building = "Land_Cargo_Tower_V1_F" createvehicle (player modelToWorld [0,50,0]);
_building spawn {
waitUntil {
sleep 1;
!alive _this
};
hint "Building was destroyed!!!";
["endDefault"] call bis_fnc_endMission;
};
sleep 5;
_building setDamage 1;
};
``` try it in debug console ^
> I'd like to know the building is ruined or not.
```sqf
systemChat str (nearestObjects [player, ["Ruins"], 100] select 0);
```destroy it and check with ^
if you placed your building in editor, just name it and use `!alive <yourBuildingName>`
@quasi rover
_object = this;
_light = "#lightpoint" createVehicleLocal getPosATL _object;
_light setLightBrightness 1.0;
_light setLightAmbient [1.0, 1.0, 1.0];
_light setLightColor [0.1, 0.1, 0.1];
_light lightAttachObject [_object, [0,0,0]];
Is there a way to make the light gave only one direction? like downward?
So other option for the same effect?
spawn a lamp post
the problem is that this is inside of a Building, in that case the altis airport, it is strange to have a lamp post in the middle of it
Make an invisible floodlight thatโs pointed down
I think if you setObjectTextureGlobal to remove its textures youโll be left with a floating light
the floodlight i found is only off, is there another one you are talking about?
Did you try it at night?
the floodlight doesn't turn on, for what I know
Perhaps putting this switchLight โONโ in init?
I know there are floodlights that work
"Land_PortableLight_double_F" yes
also one of runway lights maybe
("Land_PortableLight_single_F" too, obviously)
type in search box "light", look in > airport lights ? (hope that right name for it)
PortableHelipadLight_01_white_F? that one blinks
Silly question: why would the value of isKindOf "Tank" change?
It can never change.
is there a way to reset the knowsAbout?
@astral tendon Check the wiki page, I think there is a link to the command in See Also
none of they do something about the knowsAbout besides raise it.
forgetTarget ?
forgetTarget
k
that either
you are doing something wrong maybe...
0 spawn {
player reveal [cursorObject,4];
hint str (player knowsAbout cursorObject); //--- 4
systemChat str (player targetKnowledge cursorObject); //--- [true,true,5.243,-2.14748e+006,EAST,0.0250684,[7952.04,3512.67,6.3146]]
sleep 5;
player forgetTarget cursorObject;
hint str (player knowsAbout cursorObject); //--- 0
systemChat str (player targetKnowledge cursorObject); //--- [false,false,-2.14748e+006,-2.14748e+006,UNKNOWN,0.0250684,[7952,3512.66,6.32282]]
};
``` this ^ https://gyazo.com/5d9754e9b9ef8967ddcc2b0c7d01846f
Hey ๐ I want to query the mods that are installed on a arma 3 server but i cant get it working :/
What exactly isn't working?
the response for mod is null
Ask in #arma3_tools they might know more about that
That's not SQF ๐
ok i try it there ๐
@little eagle just tested what you helped me with last night, ty , turned out, I didnt need to remoteExec back to the server xD
@meager heart thanks, I'll give it a try. ๐
is there an object/variable for an empty array such that
_array = [1] + [] + [1];
would return
[1,[],1]
instead of
[1,1]
[1] + [[]] + [1]
+ [] merges the contents from the array i beleive.
too simple <face palm> thanks @little eagle
im trying to set my server up so that players never get killed and are force respawned. can someone help me understand why this isn't working. i dont want to make them invincible, just need to be revived when they take too much damage.
player removeAllEventHandlers "HandleDamage";
player addEventHandler [ "HandleDamage", {
private _unit = _this select 0;
private _dmg = _this select 2;
private _damage = damage _unit + _dmg;
if (_damage >= 0.8) then
{
_unit setDamage 0.8;
_dmg = 0;
};
_dmg
}];
Because what you call _dmg already is the previous damage plus the currently received damage. At the end you just return _dmg so all you do before is meaningless.
Furthermore HandleDamage is garbage. You better stop working on this and/or think about a different solution.
ok thx
Whatโs wrong with HandleDamage?
It's a shit half assed feature that only works half of the time.
Does it not work with explosions or vehicle crashes?
What are you asking this for?
In case I ever consider using it
Don't if you can avoid it.
Itโs a pretty unique feature
Seems to work for us on our mission just fine as a serverside EH
You said you'd consider using it, now you said you're already using it. ยฏ_(ใ)_/ยฏ
I didnโt write it into the mission. :/
Don't look into it. The bugs it causes better stay hidden.
Hey, where can I find those square parachutes that were added in tacops for cargo stuff?
I'm trying to get a greenfor AI to shoot another greenfor AI. I can get the assasin to raise his weapon to look like he's attempting to acquire a target but won't fire. Here is what I have so far in a script that I'm calling via trigger: for "_i" from 1 to 600 do {
group HIT1 reveal [Nwosu,4];
HIT1 doTarget Nwosu;
aaa = waitUntil {(HIT1 aimedAtTarget [Nwosu]>0) or ({alive _x} count units group HIT1 == 0)};
bbb = HIT1 fireAtTarget [Nwosu];
sleep 15; };
HIT1 is the "Hitman" and Nwosu is the VIP or target he is attempting to kill.
any ideas on getting this guy to be a stone cold killer?
Nwosu addRating (- rating Nwosu - 2000);
ah, does he not want to shoot him because he's on the same side?
Yes.
What a loyal fellow
Technically the victim is an enemy, so all other indep units will shoot too.
invisible targets also can help
The script I used originated with an invisible target meant to get the AI to suppress an area. I just swapped the name of the invisible helipad to the name of the guy I needed shot.
Does fireatTarget not work?
afaik vehicles only ^
@lone glade, yeah, I've only seen them in tac ops art attached to crates, but I imagine they are vehicle chutes.
@half moth doFire?
dofire instead of dotarget?
Still talking about this?? AI don't fire on friendlies and no command changes that...
doTarget and forceWeaponFire?
Words, what do they mean.
๐
Hm?
Exactly my reaction.
doFire does work.
unit1 doFire player;
units group player doFire player; // array version
and, to quote Richard Dawkins... https://www.youtube.com/watch?v=rj3rAJUVrGQ&t=20s
I would like to review my previous statement: it works, but it works well only when the player is the target ๐ it's AI racism!
AI don't fire on friendlies and no command changes that...
AI do fire on a friendly player ^^
also, I think back in OFP I used a doTarget/fire to make it work, as the gun was pointed toward the victim already
but it was not an AI willingly shooting, I give you that
But why all this work when you could just do addRating like I suggested already?
I think it was to avoid other units to shoot the guy, I don't remember the why
but addRating, yup, is often what I go with
0 spawn {
private _group = createGroup west;
private _position = player modelToWorld [0,15,0];
private _killer = _group createUnit ["B_Soldier_F", _position, [], 0, "NONE"];
private _victim = _group createUnit ["B_pilot_F", _position, [],10, "NONE"];
_killer dowatch _victim;
_killer setUnitPos "MIDDLE"; //--- just for more tacticool
sleep 5; //--- just for more drama
_victim addRating - 5000;
};
``` try it in console ^
or maybe a join east group, I don't remember if this works
[unit1] join createGroup east works
btw for extra reliability _killer doTarget _victim; < after rating... ๐ค
Hm?
Exactly my reaction.
funny that, this conversation still going somewhere... JEDMario, commy ๐
Exactly my reaction.
btw is there rating values limit ?
player addRating 999999; hint str (rating player); //--- 999999
player addRating 1000000; hint str (rating player) //--- 1e+006
Any number on a computer has a limit.
There're only so many particles in the universe.
Under the evening moon... i see, you like hokku
we can call you senpai or poo sensei, if you like ๐
anybody know if this is fixed?
https://img.c0kkie.de/c0kkie_31-03-2018_02-26-44.png
cuz we have sometimes a problem like this
call {.... <stuff>.... if (x) exitWith {true};} just do something like that
wrap your code in a call
Hi @empty harbor how are u today?
I want to ask you a question...
is it possible to unlock the obfuscated pbo file?
I know it's not normally possible
but can you open it?
@digital plover do your research. Stuffs out there that can ๐
Not gonna post or dm you links though
@digital plover Keep private matters in private chat. If you want to talk to mikero directly then do so. But this has no place in #arma3_scripting at all.
Oke i understandf
Donโt be the dumbass that asks someone how to crack their own security that they sell
@digital plover ^ as been told this is #arma3_scripting. But in short, any Mikero pbo obfuscation is currently unlockable, sorry Mikero.
@unborn ether i added you.
Yeah, unless itโs the paid one
The free one just says itโs obfuscated
But itโs entirely artificial
Like saying a door is locked without actually locking it
Keeps out noobs though
it actually keeps out many thieves too, who are only interested in low hanging fruit. if they have any work to do at all, they move on to the next victim instead.
but all above comments on this subject are correct.
Itโs silly once you realize it, though. But I guess free =/= effective. First and only one Iโve cracked was a BECTI mission. Heh, and now Iโm a dev for that mission.
@digital plover I'm anyways not going to compromise Mikero stuff mate, just stated that's unlockable.
If you ask how to protect something for yourself - ok
Anyone know what the className is for the laser that is emitted by the IR Laser Pointer? I'm looking for the laser, not the laser emitter. Tried looking thru the Config, and specifically the IR Laser Pointer for info, but couldn't find anything.
Small question but: How does Saving and Loading for Single Player Scenarios work in a scripting view? Does it save the current state of the scripts or something like that?
Serializes all mission and object namespaces variables and scheduled scripts.
All display events and variables are lost though.
ah okay
Hi I'm new to this. How can I add more Enemy AI spawns?
Copy paste the same message to every channel. That will make people respond surely.
No.
@atomic otter an answer will be provided if you delete your other same messages, as crossposting is not allowed by the #rules. But here is the proper channel, yes.
@winter rose Done. Sorry
can u guys check this eleteMarker "bob";
sleep 1;
task1a setTaskState "Succeeded";
["TaskSucceeded", ["Bob Killed"] ]call bis_fnc_showNotification;
*deleteMarker "bob";
sleep 1;
task1a setTaskState "Succeeded";
["TaskSucceeded", ["Bob Killed"] ]call bis_fnc_showNotification;
Whats with the random * before deleteMarker?
@warm gorge the star was just cus the first time I pasted the code it was a bit messed up
anyways do u see any prolems
Well whats going wrong? Are you getting any script errors?
wrong syntax for the setTaskState ^
also try this https://community.bistudio.com/wiki/BIS_fnc_taskSetState
and if you are using bis_fnc_showNotification for task states, that function will fix it ^
Hi. Can someone help me how to spawn more AI's?
@atomic otter That also counts as spam.....
You want to spawn more AI's. Here: https://community.bistudio.com/wiki/createUnit
Thanks
All your messages in this Discord server were either spam or saying sorry for spamming, or spam again, or "Thanks"
That's quite an achivement
hey im really simply trying to execute a script through a trigger, for on acctivation I got this:
execVM date_and_time_thing_bob.sqf
Yeah.
missing quotes
https://community.bistudio.com/wiki/execVM There. Read that
I wish we had a bot that we could query to post wiki links
can u tell me whats wrong wit this
["Objective: Kill Target", str (date select 04) + "/" + str (date select 01) + "/" + str (date select 2) + " " + str (date select 3) + "0"] spawn BIS_fnc_infoText;
so I did: execVM "date_and_time_thing_bob.sqf";
and it says "type script, expected nothing"
so i assumed there was something wrong with the script
If I will increase DMS_MaxBanditMissions will it increase the Enemy AI amount spawn?
nah, it's because execVM returns the script handle
@atomic otter I have no idea what that is. If it's about a Mod then ask the mod author
BAD BOT slaps
Okay
so how do I fix it (sorry im new at this)
You can't
execVM returns script handle. That's what it does. You can't change that
what are you trying to do exactly?
so im trying to display a date with a title using this script ["Objective: Kill Target", str (date select 04) + "/" + str (date select 01) + "/" + str (date select 2) + " " + str (date select 3) + "0"] spawn BIS_fnc_infoText;
so that the script in an sqf file named "date_and_time_thing_bob" and when I try to execute it via trigger using this on activation: execVM "date_and_time_thing_bob.sqf"; It says "type script, expected nothing"
Only for me huehue
I didn't type that.
we now have a bot running here?
no
what is it then?
It's (โฉ๏ฝ-ยด)โโโ๏พ.*๏ฝฅ๏ฝก๏พ
yeah. That could do it.
Or just CTRL+SHIFT+I and plug some JS into console to add a eventhandler
so indeed a userjs
Dedmen hacked the discord.
btw thx dedmen it works now๐ ๐
Is there any better way to check a string for non-unicode characters other than looping the string through an array of pre-defined "allowed" characters?
I have an idea on how to do that.
turn it to array of numbers
What is a non-unicode char anyway?
number has to be >0x20 and < 0x7F
ok
That will check if it's a ascii character
nope
not fully true @still forum
https://www.techonthenet.com/ascii/chart.php
0xA for new-line
and usually 0xD for carriage return also need to be included
and the tabs
and 0x20 itself is space
private _chars = toArray _string;
private _isPureASCII = selectMax _chars <= 0x7F && selectMin _chars => 0x20;
This?
Yeah, true.
private _chars = toArray _string - [0x20, 0x0D];
private _isPureASCII = selectMax _chars <= 0x7F && selectMin _chars => 0x20;
I guess you can ignore the characters between LF and space
This then.
0x09 - 0x0B should be checked for too
then all characters are covered
and 0xA for LF
Can't we just say anything below 0x80 ?
0x09 - 0x0B --> 0x09, 0x0A, 0x0B
For simplicity I mean.
theoretically, yes
I'm not sure how toArray displays unicode characters
nobody would ever be able to type the control characters anyways
I'm not sure how toArray displays unicode characters
Good point.
whether it does 0xAA,0xBB or 0xBBAA
check it then ๐
if it does the second then yeah sure.
if it does the first, then i need to adjust my sqf-vm
Pretty sure
toArray "ร" was a two element array.
I'll launch Arma in about half an hour. If no one checked till then I will ๐
but generally Arma doesn't know unicode
it just handles arrays of bytes
so most likely toArray will print seperate bytes
Does that mean rip my idea?
if it uses arrays, yes
Dunno how else you'd check for non ascii then.
but then one just could check like this:
{ _x isEqualType 0 } count toArray "stringtocheck"```
though ... that would not cover actual "non-unicode" characters like รค
((that is part of the language table extension and would be placed somewhere below 255))
what?
toArray returns array of numbers
so isEqualType wouldn't work. Or am I missing something
did i missunderstood something?
toArray a# would not return [123, [123, 123]]?
no problem existed*
now i just need to implement selectMin and selectMax
afterwards that snipped can be run on my sqf-vm โค
Still don't get it. Does my thingy work or no?
yay
#define IS_PURE_ASCII(string) (selectMax toArray (string) < 0x80)
MACROS!
Find something better.
though ... still faster then count etc.
than*
mimimi
2-1 victory!
Hi there,
quick qestion, why does this not work: if ((_veh getVariable ["TF47_core_Vehicle_Tracker","true"])== true) then ?
Thanks for the help on the unicode character check, appreciate it
@shell carbon == is not supporting bool as input type
either do not use == at all there or use isEqualTo
private _chars = toArray _string - [0x20, 0x0D];
private _isPureASCII = selectMax _chars <= 0x7F && selectMin _chars => 0x20;```
`selectMin _chars => 0x20;`
`=>` is not valid
@little eagle draw with 2-2
if i createMarker with existing marker name will it fail?
๐ค
well it won't create a second marker with same name
markers are just strings in a map iirc
thus that would do ... nothing i would guess?
no
old marker will stay
but not accesible through its name anymore
it will create a second marker with the same name
Yeah, => may not be correct syntax, but it's way cuter than >=. Happy > Unhappy 3:2
: if i createMarker with existing marker name will it fail?
@unborn ether Yes, it will fail silently.
Hello, Does anyone know if it is possible to activate a trigger via explosion. (I want a player UAV to fire at some rocks wich cant be destroyed)
It kind of is. Depends on what explodes tbh.
I don't think triggers react to projectlies, so if you able to operate this rock, use Hit EVH
You can add a Fired EH to the UAV. If the weapon was the weapon you want them to use, then spawn a loop that keeps track of it. When it gets destroyed, check the distance from the last known position to the rocks it was supposed to to target, and run your code if the distance is small enough.
Well i made a cave. and i want somone to mark those caves with a laser. then an other player will fire at it with a UAV.and then the cave needs to colapse, but the cave cant doe that. so i used a trigger to just change the hight of some rocks
You will not be wanting triggers for this.
Sounds to me like you could place an invisible dummy object near the cave, and add a Explosion eventhandler to that.
Yeah, that works.
Triggered when a vehicle or unit is damaged by a nearby explosion.
Though
I guess that would fire for grenades too.
Its better to use HandleDamage or Hit
nope
Yeah, think so too.
do those work on rocks?
No.
well, there you go
We weren't talking about putting it on rocks
I really hate a waitUntil for this. If it's for MP and all that, the scheduler will probably break it.
nope what, HandleDamage already has a projectile and its source. Most work done.
It's good enough for detecting an explosion.
ok ยฏ_(ใ)_/ยฏ
Still, I'm torn. Probably fired eventhandler.
or, you know, put an IED or some explodey lookin' thing in the middle of the case and add an action to detonate it
Anyways tracking a bullet onEachFrame is not better than HandleDamage
laser target would also work^
They should really add some sort of explosion trigger. It wouldn't even need any engine changes. Just a dummy object with some init scripts.
It's made with like 5 lines of code, but why reinvent the same thing over and over?
Well, they have the Explosion EH
Not a trigger.
It's also pretty shit, as it reports nothing and you can't even change or measure the distance.
Then I guess youโre just stuck with HandleDamage.
What is the scripted name of the parachutes used in this script? https://www.youtube.com/watch?v=TRWm-zcnrsU
is there something like knowsAbout but for objects without a side?
for example empty vehicles
Nevermind. I think it's called parachute 02.
I read through the link. It confused me because it said %_parachute_02_F which I didn't recognize as a class name.
% is B O or I I guess.
factions...
B O and I stand for the side, not the faction :=)
xD
1:0
_class = format [
"%1_parachute_02_F",
toString [(toArray faction _this) select 0]
];
1:1
The options that are available when you open up an object in the editor... where are those defined? I'm trying to reverse engineer how the cargo benches are hidden in the RHS CH-47
disregard
_heli animateSource ["hide_cargo",1,1];
Thank you
How to check if marker is local to PC not global?
hello can someone tell me why this sleep is not working?
disableUserInput true;
uiSleep 30;
disableUserInput false;```
@native siren You probably can't suspend code here.
@unborn ether you can try allMapMarkers
@meager heart This returns both of them local and global.
Any smart tip how to block https://community.bistudio.com/wiki/ArmA:_Cheats#ENDMISSION ?
I have a solution right now but it's quite brutal
@native siren If you are going thru disableUserInput you are fine, since its the only way.
Yep what I wanted to do is to block and then unblock after 30 sec but for some reason sleep is not working and forcing people to restart is a little bit too much especially as shift and num - are quite common keys used ingame.
check if isnil your marker on another client(s)/server, maybe... @unborn ether
@meager heart Ow thats awful, well seems like just gonna check on server or find another way.
๐คท
Hello guys. Can someone tell me why this doesn't work?
sleep 15;
Oh and guys. This also doesn't work. I've tried literally everything but I can't get it to work
7
try 5
@still forum That was about my question?
kinda
No reason to be passive-aggressive. I know that is not too much to work with and I don't demand answers I just thought maybe there is some deal with disableUserInput as I still don't know many things. That is basically the whole code I'm running after clicking shitf + num -. If it's something wrong with my mission that's fine as well I'm always grateful for any help even if someone will tell me that it should work and the problem is somewhere else.
passive-aggressive (50/50) = neutral
@native siren no problem at all, though the uiSleep thing may need some context for a better diagnostic. are you using it in a specific place, in a trigger maybe?
(findDisplay 46) displayAddEventHandler ["KeyDown", "_this call life_fnc_keyHandler"];```
Than inside keyHander I have a case
This works just fine
```sqf
case 74: {
if (_shift) then {
[] call SOCK_fnc_updateRequest;
disableUserInput true;
CutText ["Cheat detected.", "BLACK FADED"];
};
};
This doesn't. Black screen but player can move as normal
case 74: {
if (_shift) then {
[] call SOCK_fnc_updateRequest;
disableUserInput true;
CutText ["Cheat detected.", "BLACK FADED"];
sleep 30;
disableUserInput false;
};
};
you can't "sleep" in an eventHandler; use spawn inside to do so
_this spawn life_fnc_keyHandler;
I would say
(findDisplay 46) displayAddEventHandler["KeyDown",
{
0 spawn
{
//scheduled
};
}];
Thank you always learning something new ๐
you're welcome
Are there functions for calculating the time spent on the server?
don't know of any
@still forum try parseNumber(str 7) might help
and clicking execute multiple times gives some faith.
for that display event handlers,way is it 46?
@umbral oyster will have to use onPlayerConnected and onPlayerDisconnected
@Namenai#3053 findDisplay 46 is a mission display.
A bit of unlikely question about #define macroses. How that comes that macroses fail to proceed on something like position or format inside its syntax?
for "_i" from 0 to _rounds do { //--- 5 = how many rounds you want fired
_center = markerPos _target; //--- central point around which the mortar rounds will hit
_radius = 150; //--- random radius from the center
_pos = [ (_center select 0) - _radius + (2 * random _radius), (_center select 1) - _radius + (2 * random _radius), 0 ];
_mortar commandArtilleryFire [ _pos, getArtilleryAmmo [_mortar] select 0, 1 ];
sleep 3; // -- delay between rounds
}; ```
Why am I not seeing the expected behavoir from this?
I expec this function to be called, given a mortar, a number of rounds, and a target marker.
Then fire that number of rounds, with random scatter in the radius.
Am I missing something?
Just using it on a mk6 mortar, manned of course by a single ai.
It should be from 1 to _rounds, otherwise it will fire one more round.
_rounds = 3: 0,1,2,3 -> 4 rounds.
Then also your formula for generating a random point in a circle is fucked. It's heavily biased towards the center of the circle.
I am also pretty sure that there was a case sensitivity bug with commandArtilleryFire and/or getArtilleryAmmo.
Hmm
Thanks man.
Lastly, I am having trouble.
I have a marker in the editor
marker1
when I call this function
[mrt1. 3, marker1] call O_fnc_Arty
it tells me marker1 is undefined.
I am calling this in init.sqf
marker1 DOES existing on the map.
???
Markers are references as strings. If you name your marker marker1, then you have to refer to it in scripts as "marker1".
AHH
Damn, thanks man.
Dunno how I forgot that.
What do you recomend for the pos thing?
I could bring in SHK pos
or us some mission framework with some funcs for me.
Yeah, this is because they're not entities (OBJECT type), so they don't have vehicle variable names.
What do you recomend for the pos thing?
private _position = _center getPos [_radius * sqrt random 1, random 360];
Why would you want that?
This explains the need for the square root:
https://stackoverflow.com/questions/5837572/generate-a-random-point-within-a-circle-uniformly
To make the arty always seem to land near but not ON the marker / player.
Thanks for the SO link.
I was about to ask.
You could probably derivate a formula to generate a point in a ring.
I bet if I google I can find one.
A minimum distance where no shot will land.
It's likely a common task.
Yeah.
In graph plotting.
Thanks for the help, let me see If I can get this working now and get back to you.
Lastly, I really hate while loops.
I wanted a way to spread the time of arty out.
hint "SENDING";
[mrt1, 4, "mrk1"] call ORMP_fnc_fireArty;
sleep 1;
[mrt2, 4, "mrk1"] call ORMP_fnc_fireArty;
sleep 3;
}```
Current method
in the init
mortar 1 fires, waits, then two, waits, etc until empty.
Can't be in the init, as init is an event, and events are unscheduled, and sleep is a suspension command, and suspension is not allowed in unscheduled environment.
Yeah, that's no longer the init then.
Okay.
Glad you told me that haha.
I don't often put things in the init, but was doing it to just test it
del
Damn your fast.
Am I using params incorrectly?
params [["_mortar", objNull, [objNull]], ["_rounds", 1, [Number]], ["_target", "", [String]]];
a mortar unit, a number, and a marker (string)
I get....
[Number] should be [0] and [String] should be [""]
Examples, not the type names. objNull is an example of OBJECT type.
Ye, I think I made a mistake on that last formula though. Doesn't look right to me anymore.
Seems to be working.
Let's check the interwebs...
What part do you think is broken?
Distribution.
private _position = _center getPos [sqrt (random 1 * (_radiusOuter^2 - _radiusInner^2) + _radiusInner^2), random 360];
This looks better.
To the power of two instead?
Yeah, because you have to do the sqrt later.
It does.
Otherwise _radiusInner isn't actually the inner radius of the results.
This one should work.
(I may be wrong) why not _innerRadius + random (_outerRadius - _InnerRadius)?
Oh, more biased towards outer, missed that
I am going to put you in the function header commy2
Is that the best name to credit you with?
Lou, that forumla would be biased towards the middle. The area of a circle is increasing with the radius by the power of two. Therefore you need to put the (linear) random function into a square root.
yup, indeed - my wrongness ^^
Is that the best name to credit you with?
Yeah, that is my internet name, lol.
lol
Well, I didn't know if you used a diffrent name for arma units or whatever
private _position = _center getPos [sqrt (random 1 * _radius^2), random 360];
Nah, commy2 is my Arma name too https://github.com/commy2
That for one that does not avoid the center right?
I am making a safe version and a danger version.
I am like, 70% sure I am wrong.
CAuse the random 1 will always be 1.
Yeah, your last formula works for a circle without center. Alternatively you could also just set _radiusInner to 0.
Yup. And if you would've wanted to optimize your last formula and didn't care about the inner radious, you could've written:
private _position = _center getPos [_radius * sqrt random 1, random 360];
instead of:
private _position = _center getPos [sqrt (random 1 * _radius^2), random 360];
because that means one less ^2 / square operation.
sqrt(a*xยฒ)
<=>
x*sqrt(a)
after all ๐
params [["_mortar", objNull, [objNull]], ["_rounds", 1, [0]], ["_target", "", [""]], ["_danger", false, [true]]];
private _radiusInner = 25;
if (_danger) then {
_radiusInner = 0;
};
private _radiusInner = 25; //--- set safe radius from the center
private _radiusOuter = _radiusInner + 75; //--- set DANGER radius from the center
private _center = markerPos _target; //--- central point around which the mortar rounds will hit
private _position = 0;
for "_i" from 1 to _rounds do { //--- 5 = how many rounds you want fired
_position = _center getPos [sqrt (random 1 * (_radiusOuter^2 - _radiusInner^2) + _radiusInner^2), random 360];
_mortar commandArtilleryFire [ _position, getArtilleryAmmo [_mortar] select 0, 1 ];
sleep 3; // -- delay between rounds
};
I just made it one function.
With a bool to switch danger on an off.
I am hard setting the radius cause this one is made to simulate the "spread" of the m88's
So they don't seem pin point.
Thoughts?
Oh, you have private _radiusInner = 25; twice. I think the second one should be deleted.
Otherwise _danger being true is always overwritten again.
this does not seens to work in MP, if the unit already have goggles it will keep their original or wont add any at all even if it does not have it, it works only in sp even with removeGoggles
It defaults to false, but you overwrite the variable in the next line, Jay.
private _radiusInner = 25;
if (_danger) then {
_radiusInner = 0;
};
private _radiusInner = 25;
@astral tendon Never had a problem with addGoggles. What are you trying to do?
I created the unit, then use removeGoggles, then addGoggles, it works in SP but in MP the unit use its default goggles or dont use none at all.
What unit?
C_man_p_fugitive_F_euro
What's your script?
To add a better context
SpawnUnitSuspectHeavy = {_Objectpos = getPosATL _this;
Sleep random 3;
"C_man_p_fugitive_F_euro" createUnit [getPosATL _this, Opfour, "
this execVM 'AiTargeting.sqf';
this execVM 'moral.sqf';
this setPos _Objectpos;
removeGoggles this;
[this] join grpNull;
lockIdentity this;
this call SuspectHeavy;
if (random 5 > 1) then {
this call selectrandom [GiveRifle,GiveSMG];
} else {this call selectrandom [GiveMachineGun]};
"];
};
SuspectHeavy = {
comment "Exported from Arsenal by Roque_THE_GAMER";
comment "Remove existing items";
removeAllWeapons _this;
removeAllItems _this;
removeAllAssignedItems _this;
removeUniform _this;
removeVest _this;
removeBackpack _this;
removeHeadgear _this;
removeGoggles _this;
comment "Add containers";
_this forceAddUniform "U_BG_Guerrilla_6_1";
_this addVest selectrandom ["V_TacVest_khk","V_TacVest_camo","V_PlateCarrier2_rgr_noflag_F"];
_this addHeadgear selectrandom ["H_PASGT_basic_olive_F","H_CrewHelmetHeli_B","H_Watchcap_camo",""];
_this addGoggles "G_Balaclava_blk";
comment "Add weapons";
comment "Add items";
_this linkItem "ItemWatch";
};
GiveRifle ={
[_this, selectrandom ["arifle_SPAR_01_blk_F","arifle_AKM_F", "arifle_AKS_F","srifle_DMR_06_olive_F"], 2, 0] call BIS_fnc_addWeapon;
};
GiveSMG ={
[_this, selectrandom ["SMG_05_F","hgun_PDW2000_F"], 2, 0] call BIS_fnc_addWeapon;
};
GivePistol ={
[_this, selectrandom ["hgun_ACPC2_F","hgun_Pistol_01_F","hgun_Rook40_F","hgun_Pistol_heavy_02_F"], 2, 0] call BIS_fnc_addWeapon;
};
GiveMachineGun ={
[_this, selectrandom ["arifle_SPAR_02_blk_F","LMG_03_F"], 2, 0] call BIS_fnc_addWeapon;
};
on the other file
jesus fucking christ...
_5Spawns = [(selectrandom _ArrowsBlue),(selectrandom _ArrowsBlue),(selectrandom _ArrowsBlue),(selectrandom _ArrowsBlue),(selectrandom _ArrowsBlue)];
_10Spawns = [(selectrandom _ArrowsBlue),(selectrandom _ArrowsBlue),(selectrandom _ArrowsBlue),(selectrandom _ArrowsBlue),(selectrandom _ArrowsBlue),(selectrandom _ArrowsBlue),(selectrandom _ArrowsBlue),(selectrandom _ArrowsBlue),(selectrandom _ArrowsBlue),(selectrandom _ArrowsBlue)];
if(LevelDifficulty == 3) then {
{_x spawn SpawnUnitSuspectHeavy
} forEach _10Spawns;
{_x spawn SpawnUnitCivConstructionWorker
} forEach _5Spawns;
};
All seens to work, just the goggles are the problem in MP
"C_man_p_fugitive_F_euro" createUnit [getPosATL _this, Opfour, "
this execVM 'AiTargeting.sqf';
this execVM 'moral.sqf';
this setPos _Objectpos;
removeGoggles this;
[this] join grpNull;
lockIdentity this;
this call SuspectHeavy;
if (random 5 > 1) then {
this call selectrandom [GiveRifle,GiveSMG];
} else {this call selectrandom [GiveMachineGun]};
"];
};
This is the problem. Don't use the init box of createUnit.
It does not work in MP?
It does not work in MP?
Just don't use this createUnit syntax. Why do I have to explain everything.
Maybe to know how things works? Maybe...
createUnit has two syntaxes. The one you use is shit. Therefore they made the newer one.
The init box code of yours is executed before the units init event. The goggles of indep soldiers and civilians are randomized by script in this game.
class EventHandlers: EventHandlers //inherits 0 parameters from bin\config.bin/CfgVehicles/All/EventHandlers, sources - ["A3_Characters_F"]
{
init = "if (local (_this select 0)) then {[(_this select 0), [], nil] call BIS_fnc_unitHeadgear;};";
};
Therefore, all your changes from the init script are overwritten by the init event. Note that this init box is not the same as the one from the editor.
Note that the init script's code of your command is transfered to all other machines and executed on all machines. A total mess in MP.
Most inventory commands have undefined behavior when executed on remote machines. E.g. addWeapon. Not sure how it is for A3 commands like addGoggles, but I don't trust it either.
And the global functions you use are only locally defined, so this becomes very unpredictable as behavior depends on what machines executed this code first.
probably he have troubles with randomization also, commy2
Use the other syntax of createUnit, drop those global variable functions. That'll fix all your issues and the ones you haven't encountered yet.
So doing something like this
SpawnUnitSuspectHeavy = {_Objectpos = getPosATL _this;
Sleep random 3;
_unit = "C_man_p_fugitive_F_euro" createUnit [getPosATL _this, Opfour, ""];
_unit execVM 'AiTargeting.sqf';
_unit execVM 'moral.sqf';
_unit setPos _Objectpos;
removeGoggles _unit;
[_unit] join grpNull;
lockIdentity _unit;
_unit call SuspectHeavy;
if (random 5 > 1) then {
_unit call selectrandom [GiveRifle,GiveSMG];
} else {_unit call selectrandom [GiveMachineGun]};
};
It will work or it will have the same isue?
Missing =.
fixed
No, will not work either.
group createUnit [type, position, markers, placement, special]
You're using:
type createUnit [position, group, init, skill, rank]
And that is:
Return Value:
Nothing - NOTE: THIS SYNTAX RETURNS NO UNIT REFERENCE!
SpawnUnitSuspectHeavy = {_Objectpos = getPosATL _this;
Sleep random 3;
_unit = group Opfour createUnit ["B_RangeMaster_F", getPosATL _this, [], 0, "FORM"];
_unit execVM 'AiTargeting.sqf';
_unit execVM 'moral.sqf';
_unit setPos _Objectpos;
removeGoggles _unit;
[_unit] join grpNull;
lockIdentity _unit;
_unit call SuspectHeavy;
if (random 5 > 1) then {
_unit call selectrandom [GiveRifle,GiveSMG];
} else {_unit call selectrandom [GiveMachineGun]};
};
on side note, Opfour is a unit placed in the editor
if the unit already have goggles it will keep their original or wont add any at all
it works in SP but in MP the unit use its default goggles or dont use none at all.
_unit setVariable ["BIS_enableRandomization",false];
maybe...
No, I wrote what has to be done already.
GiveMachineGun ={
[_this, selectrandom ["arifle_SPAR_02_blk_F","LMG_03_F"], 2, 0] call BIS_fnc_addWeapon;
};
_unit call selectrandom [GiveMachineGun]
``` ๐ค
k
Yeah, it works.
ยฏ_(ใ)_/ยฏ
lol
Can config paths be transmitted using publicVariable / remoteExec?
why would that data type be special?
? Same reason you can't compare bools using ==. Also https://community.bistudio.com/wiki/publicVariable does not list it.
remoteExec
Yes.
publicVariable
I'm not sure, maybe.
dude
Not being listed doesn't mean it doesn't work. But again, not sure.
alganthe, you cannot transfer STRUCTURED TEXT with pvar.
hm.... true
And if you use setVar public and RE it complains about TEXT having bad serialization in RPT.
Only one way to find out: try.
Bonus points for editing the wiki afterwards.
I'm not really sure what I'm asking here... how can I check if an object has inherited a base class or is a type of a base class? Specifically, I'm trying to detect when an object is an RHS CH47... they all inherit from RHS_CH_47F
isKindOf
@austere granite from what I've seen in the wiki, that's for cfg vehicle types like isKindOf "Tank"
ey all inherit from RHS_CH_47F
that would just help me identify it has as a helicopter wouldn't it?
isKindOf "RHS_CH_47F" ?
_object isKindOf "blakjklfsadjfkadsjfdsaklfjsd_F"
isKindOF "Helicopter" or typeOf "RHS_CH_47F"
Ok, that fits what I was thinking with isKindOf
also isKindOf "Air"
as far as typeOf goes, does that account for all CH-47s that inherit from RHS_CH_47F?
like RHS_CH_47F_Light is that still a typeOf RHS_CH_47F?
typeOf requires and Object, not a string
I get an error when I use typeOf "RHS_CH_47F"
Yeah, that's what I was referencing
do you see there is example ?
yes
typeOf "RHS_CH_47F" is different than typeOf vehicle player
vehicle player is an object, "RHS_CH_47F" isn't
regardless I think I've found something passable
lol
if (typeOf vehicle player == "RHS_CH_47F") then {hint "wow... player is in CH 47..."};
What are you trying to show me by copying and pasting the example that we're both already looking at in the wiki?'
Styles2304 - Today at 20:27
typeOf requires and Object, not a string
I get an error when I use typeOf "RHS_CH_47F"
lol yes, and it does
sooo give it an object
Yeah, I understand how it works now but I wasn't sure how to make it work initially and the advice was given was : typeOf "RHS_CH_47F" so I'm sure you can see the confusion
typeOf "RHS_CH_47F" is definitely wrong. Whoever gave you this has no idea.
@meager heart booo! points finger
Maybe you meant
typeOf _vehicle == "RHS_CH_47F"
kinda
question:
Styles2304 - Today at 20:15
isKindOf "RHS_CH_47F" ?
answer:
sldt1ck - Today at 20:25
isKindOF "Helicopter" or typeOf "RHS_CH_47F"
What do I need to do to make setTaskState work?
seems like it doesn't do anything.
_nil = []spawn {
_checkSabotage = true;
while {_checkSabotage} do
{
_target = TargetAmmo getVariable "sabotaged";
_target1 = TargetAmmo_1 getVariable "sabotaged";
_target2 = TargetAmmo_2 getVariable "sabotaged";
_target3 = TargetAmmo_3 getVariable "sabotaged";
if(_target == 1 and _target1 == 1 and _target2 == 1 and _target3 == 1) then
{
SabotageTask setTaskState "Succeeded";
_checkSabotage = false;
sleep 5;
};
};
};
Jesus
ggwp
[] spawn {
waitUntil {
sleep 5;
TargetAmmo getVariable ["sabotaged", 0] == 1 &&
TargetAmmo_1 getVariable ["sabotaged", 0] == 1 &&
TargetAmmo_2 getVariable ["sabotaged", 0] == 1 &&
TargetAmmo_3 getVariable ["sabotaged", 0] == 1
};
SabotageTask setTaskState "Succeeded";
};
how frequently does waituntil check?
I don't want to use a trigger because it's 0.5s
This one checks every 5 to infinitely many seconds, because the sleep 5.
Not really. The condition is after the sleep. The sleep is in the loop.
I don't really care about the sleep I just don't want it going full speed checking over and over.
You mean check every frame?
yeah, don't want that.
Oh, "don't".
Well, instead of a loop, do the check on the scripts that set "sabotaged" instead.
Then you'll never have to check.
Just worrying about synchronization across the server.
the scripts set a global variable, but they don't propagate instantly,
so like if 2 people do different ones at the same time it might miss it.
True. This is why you run stuff like that on the server.
_task = ["SabotageTask", "Succeeded",true] spawn BIS_fnc_taskSetState;
worked, normal setTaskState didn't. I guess I wasn't able to get the right handle for the task.
They're being set by a holdAction, so I'm not sure about localization and synchronizing of that stuff.
spawn reports a SCRIPT handle, not a TASK.
yeah, the task was just a module I dropped.
https://community.bistudio.com/wiki/BIS_fnc_taskSetState
uses spawn in the example instead of call
You just wrote _task = .
just copied example from wiki
also more reliable way, BIS_fnc_taskSetState with RE... like ["taskID","state"] remoteExec ["BIS_fnc_taskSetState"];
The wiki is dumb again.
that's assuming the check loop is only on the server right?
imo best way to check/change tasks states is on server...
Agreed.
Cool, it seems to be working locally now, thanks for the help. I'll have to test it on a dedicated server.
awesome, works on dedicated server.
@little eagle can you please provide some article link about CBA_Settings_fnc_init
article link??
@little eagle link to a page to look whats that and how it works
https://github.com/CBATeam/CBA_A3/blob/master/addons/settings/fnc_init.sqf
The functions header I guess.
thanks
am I able to do line breaks with format?
oh wait I can probably just have the "<br/>" as a variable and parsetext the format
or you can use:
https://community.bistudio.com/wiki/formatText
you can also use https://community.bistudio.com/wiki/endl
one is structured text, the second one a normal string
Is there a way to get what caliber a rifle fires?
nope
My only thought is get magazine name and just match it to a case
_possMags = getArray(configFile >> "CfgWeapons" >> _weapClass >> "magazines");
that will give you an array of magazines that can be used in a weapon
_ammoClass = getText(configFile >> "CfgMagazines" >> _magClass >> "ammo");
.... that's the magazines it uses not the caliber of the bullets in said magazines, which you can't get
that will give you the class of the ammo specifically
which, again, isn't the size of the bore of the primary muzzle.
from there you can get armas version of caliber which is how much it can penetrate
_caliber = getNumber(configFile >> "CfgAmmo" >> _ammoClass >> "caliber");
Also is there a max character count or array element count? Cause I have some arrays that need 1800+ elements?
array limit is 9 999 999, diag_log and log have char limits tho
So if I have a variable set to an array with 1800 elements, 40,000 characters it should be fine? As long as I dont try to output it with log
i'm fairly sure array char count limit is so high you'll never reach it unless you do it intentionally
and that point the game would be a goddamn slideshow
Soolie, the caliber entry in CfgAmmo is a multiplyer in the bullet penetration formula. It has nothing to do with the irl caliber. Ammo piercing ammunition has a like tentimes higher caliber, even though the ammonution is the same caliber / for the same weapon.
There is no caliber in A3 outside of flavour texts.
ik which i why i said "depends what youre using it for" if he just wanted to print the caliber name, or organize weapons by power for a ui
The guy asked for the caliber, not a config entry with the same name that isn't actually a caliber.
I know that it is exciting to say "yes, I have the right solution for you!", but very often the truth is, that there is no solution, that something doesn't work or doesn't exist and is impossible.
For example: "Is there a way to get what caliber a rifle fires?"
Answer: No.
yes you can print the caliber name from the description in the magazine cfg
That's not what you answered though, and it requires the flavour texts to be consistent.
I don't even know if they're consistent in A3 vanilla, and certainly they aren't with ACE or BWA3, so you should've at least asked if they were using mods or not.
"Caliber only exists in flavour texts in A3". That should've been the answer then.
well im glad youre here to sort it for me, ill run all future responses past you first
Is there's some limit to profile file size?
your game not being able to load it ๐
Your hard drive.
so Arma doesn't flush it?
Then I'd be gone. That would defeat the purpose.
If you want to save trash data in there, then you need to clean it up yourself if that's what you're asking.
Well, I've found some scamming on profileNamespace where it makes your arma dead, it just can't load anymore.
This is why you don't join random servers or install shitty mods I suppose.
you don't join random servers
life servers are respectable commy, how dare you
huehuehuehue
Well that's pretty simple to send that scam per-person via console. Some admin just made that for i think you are cheating, now get it. Retardness.
Yes, this game is for milsim servers and closed communities. Don't join random servers :~P
Ah, was not me anyways. This is just ridiculous.
Seems like the admin was just as much of a dick then.
exactly
i think a mission fucked my profileNS as well, it had a persistent XP thing going on and when i reached close to max i lost all my custom UI, addon keybinds, saved arsenal presets, plus the XP i accumulated.
does that sound like profilenamespace corruption?
that's a profile reset
and if the profileNS can get corrupted so easily how do i backup and restore mine?\
Well, was it corrupted or did someone execute malicious code?
i dont know how to figure that out
You can't.
thats y i want to back up & restore
I never had the game wipe the profile for me since they fixed the bug where it always did that when the game crashed while starting.
Yeah, backups will help.
When i lastly tried to backup my profile it just was resetting all the time, when I restored it back.
which one is my profile folder?
...\Documents\Arma 3 - Other Profiles\<myname>
or
...\Documents\Arma 3\
When i lastly tried to backup my profile it just was resetting all the time, when I restored it back.
Maybe that's what the mission / server you were joining did.
Backing up the profile definitely works.
is the profilenamespace in myname.vars.Arma3Profile file?
Arma 3 has the main profile, Other Profiles has... the other profiles, jay.
I think so, yes, jay.
so i can just backup restore that single file? or safe to just backup entire folder?
It's a backup. Just backup the whole folder to be backed up.
I honestly don't know.
if you want to backup your keybinds too save the whole folder
ok thanks guys
drawIcon3D renders through objects.
drawLine3d does not.
Anyone have any ideas how to get around this because I cant think of any
?
for what purpose?
You could, instead of drawing a 3d line, draw a 2d line on the screen.
Is there a way to disable the ability to knock a certain object over while keeping its addAction?
like life server do with their infostands (Im not creating a life server, dont worry XD)
How are you disabling knocking them over that would make user actions not possible in the first place?
disableSimulationGlobal
And that disables user actions?
well, I know that a long time ago I used that on certain objects with an addAction and they lost said addAction...
But I guess that maybe changed to today? Gonna test it
I'm not sure, because there's a lot of things idk. I just assumed you tested this beforehand, but you didn't.
\(O_O)/L