#arma3_scripting
1 messages ยท Page 339 of 1
a certain uniqueness however is reached through adding together as many informations as possible
requires an extension though
@nova belfry do you mean Steam ID -> GUID (rcon reports)?
yes
pretty much every commonly used language ๐
@brazen sparrow I have a script to bans my player, and convert uid in guid)
command on ban addban
guid -> steam id is abit more complicated and needs a few gig of storage ๐
u need to generate all possible guid and store them
rainbow table it
@brazen sparrow shame it crap language ๐
@tough abyss No, you can't.
That's good. That way you know it's true.
Am I too tired or why doesnt _numbervar get passed to the PFH in this code : https://pastebin.com/YJfEc7rk ?
mainly the quotes around it
also youd still need to define it inside your code, you can't just start using it
take a peek at their wiki page, https://dev.withsix.com/docs/cba/files/common/fnc_addPerFrameHandler-sqf.html
thats a pfh, im using a pfh object
L13
["_side","_amount","_radius","_delay","_pos","_numbervar"],//Arguments
should be:
[_side,_amount,_radius,_delay,_pos,_numbervar],//Arguments
No point in passing a bunch of generic strings.
Then you read this parameters with this line:
(_this getVariable "params") params ["_side","_amount","_radius","_delay","_pos","_numbervar"];
In the code-block(s)
Aha, i was trying something along the lines of that yesterday night but failed miserably, thanks for the pointers @little eagle ๐
Why are you using this one anyway. Imo it's ugly as hell.
Just a experiment since im bored and want to try something diffrent
Does anyone know why targets won't popup globally in hosted and dedicated servers?
Is there any script command with both local arguments and effects or is every command with local effects combined with global arguments (like I assume)?
Nvm, found a command that kills my theory lol
There are and they have the obvious problem that they cannot influence remote objects.
This one for example (in A3 at least), which is why it's a pointless command now.
That's exactly what I was thinking @little eagle
Ie. how to broadcast changes with a command with both local arguments and effects
@brazen sparrow But can you use remoteExec with commands that have both local arguments and effects?
"local arguments", i think this is confusing u
u run a command with arguments
they have to be "defined locally"
when the docs refer to local arguments, they are referring to when an object is local to where the script is running
like a car
Yes
u can target RE calls based on were the object is local too
look at the remoteExec(Call) docs
think its the 3rd/4th param
But doesn't the command having both local arguments and effects create a kind of deadlock situation that renders the command useless for MP environments?
Assuming that I want other clients to see the effect as well
best way is to try it out
setup a server locally
stuff spawned via code running on the server = object not local to you
No, remoteExec on a command that required local arguments and has local effects does not help.
Those commands are essentially unusable.
Outside of SP.
nope
Yes they are.
ok
i accept your concession.
if something is createVehicleLocal you are correct, the ref to the object would make no sense on other clients
I don't know what this means. createVehicleLocal has local effects, but there are no arguments that could be considered local or global.
You're thinking of commands that have global effects, but require local arguments (or no arguments that have locality, e.g. no objects) OR
commands that have local effects, but work on remote objects (or don't have any arguments that have locality).
Commands that require local arguments and only have local effects are unusable in MP. In Arma 3 this is true for addWeaponCargo and some others.
By unusable I mean that they will not be synched and therefore behave weird (cargo only appearing on the machine that owns the cargo box for example).
@tender fossil mentions addWeaponCargo being pointless but using remoteExec can run the code were it is needed
[_targetVehicle, ["M16", 5]] remoteExecCall ["addWeaponCargo", _targetVehicle];
but that has a global argument
well u wouldnt create a vehicle in MP with createVehicleLocal, that is just mad
Yep, _targetVehicle is only local to one machine. On every machine that not owns _targetVehicle, the command will have no effect.
That has nothing to do with createVehicleLocal.
createvehicle locality != command argument locality
All Objects are only ever local to one machine.
E.g. the driver for vehicles.
Or the server for AI groups.
Its the principle behind headless clients
its this "local arguments" thing
u mean variables that are only "visible" on a single client?
Yes, you don't seem to grasp the concept.
No we don't.
We mean objects. Objects are not variables.
Tanks, ammo boxes, player avatar etc.
ofc
https://community.bistudio.com/wiki/assignedTeam will only give you a value if the unit is local to your client. But that doesnt mean the unit doesnt exist for other clients
Every object needs to belong to a client, and for example your players unit is local to your client, and AI generally the server
the original question was: "how to broadcast changes with a command with both local arguments and effects"
Technically some objects can exist on every machine. Like bullets. But those can also be considered as N objects, N being the number of connected machines.
and the answer is: you cant
^
the command wont work on the clients where the argument isnt local
flat out no result
Fortunately there are very few of these commands.
That's what I was thinking
you can broadcast it and youll just get no results on many clients and a result on a single client
what command are u talking about
addWeaponCargo
(^global argument)
Note that that is not addWeaponCargoGlobal.
cptnick, read the comment on the wiki.
In A3, the argument is local.
ah i concede the point then
actually i seem to remember that not being true for A3, did it change in an update or do i misremember?
This one didn't exist in A2 and therefore never worked outside of SP.
e.g. the magic ammo boxes
Might've been different in Alpha/Beta when it was still more similar to the A2 system.
In A2 you could have local inventories with cargo boxes.
Using exactly these commands.
yea thatll be it then
No longer supported.
A suggestion: make a quiz that covers the most important aspects of Arma scripting and all the scripting commands
A quiz?
Yeah
What do you get when you win?
With SQF, you don't win.
Hey, anyone know how you would run a script that regeared AI as they spawned, assuming you already had the regearing script and used it for other applications?
It would serve as kind of MOOC
Specifically, I'm trying to regear units as they spawn in the Combat Patrol game mode.
CBA Init XEH would suit you pretty well
I think I like @tender fossil's idea for SQF quizzes.
@indigo snow, haha, used it before. Came with its own headaches. I need a vanilla solution, even if it isn't elegant.
Long as it works and doesn't throw errors.
neverending while loop that checks all units and sets a variable to those already handled ยฏ_(ใ)_/ยฏ
but you actually really want the CBA thing
can be done pretty fast @tender fossil
only problem will be: who is going to write down the questions (and answers)?
I started my journey into programming with MOOC and really liked the approach with interactive teaching method @queen cargo
so you want rather challenges instead of quizzes?
Why not, I just thought quiz would be easier to implement
as that would be done in web most likely, would require an interpreter for SQF in javascript
thats why
๐
Yeah, that's why I was thinking of quiz like system ๐
if the answers are only text based, then that can be written down fairly quick
Yes
I was thinking of iterating through the scripting commands and then having general questions about scripting in modules (eg. multiplayer -> locality, keeping clients in sync, remote execution etc)
"Which is faster:"
On the other hand, a series of small missions where you have to solve problems, why not
<@&105622502444711936>, is there any way to hook into the Combat Patrol init in order to change the gear of the units that are spawned with it or what side they are? Is there a way at all? Is it documented?
Ugh! That's good, but I can't use mods for this project.
directly pinging the devs is kinda rude
@indigo snow, noted.
@indigo snow unless its to bother them to add the #arma3_scripting-banter channel
What does that mean, @tough abyss?
queue commy and x39
mhhh?
You're buying this time Cloud. Better get a good match this time
Hello I just started SQF. I'm trying to use extdb3 and I copied the @timber cypressdb3 folder into my root arma folder including the dll, but when I do "extDB3" callExtension, I get 17:04:38 CallExtension 'extDB3' could not be found
It means that the extDB3 could not be found
Thanks, I could figure that one out. I'm using TADST and I see extdb3 in the mod parameter when loading the server.
You might be better off asking in the server channels, this channel really is for scripting itself
Well some aspects of extDB do require scripted elements but mainly db and server
Not finding the dll however...
Not saying people here cant help, but more people with answers over there I guess
Nope
Well first mistake is putting extdb3 into your root arma folder, as it should be used on the server instead
Well couldn't you load it client for testing?
Sure
@lilac coral make sure your conf.ini is setup to talk to your database correctly and not just using the defaults.
Would anyone know how the init in the Combat Patrol module works, or maybe how I could figure out how it works?
the arma3server.exe is in here too so im assuming @extDB3 belongs here
and yes I filled in the config, but I don't have a passoword on my test db so i set Password =
with a space after the equals, not sure if that matters.
can't find any good documentation on this sqf stuff ๐
initServer.sqf
_db = "extDB3" callExtension "9:ADD_DATABASE:cynlife";
_query = "extDB3" callExtension "0:RAW:SELECT * FROM `cyn_a3__users`";
_row = ((_query select 1) select 0);
_name = _row select 2;
diag_log _name;
Torndeco's Wiki should have everything you need. You can also look at some of the other gamemodes out there that use extdb3 for some general hints.
He does have some sqf* example files there.
oh wait nvm i figured it out
is there a way to disable an AI driver trying to avoid infantry when using setDriveOnPath? commands works perfect but i'd like the AI to drive on the path no matter what
is init.sqf run by the server, client, or both?
any handy way of removing all PP effects?
I have no idea what I'm doing ยฏ_(ใ)_/ยฏ
"extDB3" callExtension "9:ADD_DATABASE:cynlife";
"extDB3" callExtension "9:ADD_DATABASE_PROTOCOL:cynlife:SQL:SQL";
_query = "extDB3" callExtension "0:SQL:SELECT * FROM cyn_a3__users";
"[0,""Error Unknown Protocol""]"
@peak plover: no, param [0] is faster.
Id there a command to open a mission in Eden editor?
For the startup params
Something like "-init=open3DENEditor["missionName"];"
@lilac coral Not really a #arma3_scripting question afaik. I think you're far better off looking in Life forums. As you are asking very specific questions that have mostly been answered there already and that very few people here know the answer to.
im getting alot of these in my rpt regardless of mode SP/MP/DS:
Warning Message: 'aggregateReflectors/' is not a class ('scope' accessed)
Warning Message: 'ladders/' is not a class ('scope' accessed)
does these mean something is trying to inherit from scope = 0? or classname reference doesnt exist in cfg?
No, but you might be trying to access these config entries like a class.
class class1 {
entry1 = 1;
class class2 {
scope = 2;
};
};
configFile >> "class1" >> "entry1" >> "scope"
This should result in the same error afaik.
Warning Message: 'entry1/' is not a class ('scope' accessed)
so its an issue with the way someone made cfg class structure?
im not too sharp with the cfg stuff does scope mean:
scope = 0 // cannot be inherited or initialized
scope = 1 // can be inherited only
scope 2 // can be both
Maybe. These happen not necessarily by script, but also, for example, when you add config entries instead of classes to CfgVehicles and similar.
Don't think too hard about scope. This can happen with every entry.
when you say config entries instead of classes is it something like
cfgWeapons {
cfgAmmo {};
}
?
Those are two classes.
An entry is a string, number or array
aggregateReflectors is supposed to be an array, so I think it's a script error.
Same for ladders.
ok thanks, guess ill have to isolate and retest
Then what did you change last before the pop-up happen?
no way to suppress popups right?
Yes there is. By fixing the problem.
i say suppess not fix because its probably not my mod thats doing it, im gonna try a clean run
@still forum does extDB3 not have to do with scripting?
You're still better of contacting the mod author. If someone has a very specific question about ACE, they get sent to their Slack.
this discord should have its own CBA and ACE chans
Why?!? CBA and ACE already have their own forms of discussion
And Slack > discord
false
dis > slack
true
in a addaction conditional you have _this and _target. when i add an action to player and want to get variables from said player
_this and _target should be the same right?
now when the player enters a vehicle and i try to _target getVar, im not getting the correct values (not exist) but _this gets valid values even when player is inside vehicle
If you add an action to the local player, then _this and _target will always be that player. Never a vehicle.
thats the thing ive tested it multiple times, if player is on foot _this and _target work as intended, but once player enters a vehicle in any seat _target then kinda performs like (vehicle player)
player addAction ["test", {}, [], 0, false, false, "", "systemChat str [typeOf _this, typeOf _target]; true"];
testing ...
here is my addaction
player addaction ["<t color='#7396ff'>RDF OPTICAL:</t> VIS",
{
_myPlayer = (_this select 0);
_rdfCam = _myPlayer getVariable "DW_MY_RDF_CAM_OBJECT";
if ( isObjectHidden _rdfCam ) then {
_rdfCam hideObjectGlobal false; _rdfCam hideObject false;
}
else {
_rdfCam hideObjectGlobal true; _rdfCam hideObject true;
};
},
"args",
-400,
false,
false,
"",
"(alive _this) and (_this getVariable [""DW_UTIL_RDF_MENU"", 1] == 1)",
5,
false,
""
];
my getVar doesnt work inside a vehicle
when you use _target instead of _this
You're right. _target becomes the vehicle.
is that intended or bug?
could just use player instead of _this or _target ๐
i heard you should avoid using player in action conditionals (locality)
Special variables passed to the script code are _target (object to which action is attached to) and _this (caller/executing person).
so then what about the cfg useractions? global ?
Apparently an action becomes attached to the vehicle when a player with action enters it.
Wacky logic as usual.
thanks BIS! both addaction and cfg useraction have its pitfalls
Arma is a giant pitfall.
is arma 3 change anything about dropped weapon ?
look like the weapon disappear when delete corpse
Yes, the ground weapon holders of weapons are deleted when the unit they originated from is deleted.
Which is sad, because that was a decent work around to creating ground weapon holders containing a weapon with any attachments and ammo in their magazines.
would've been*
from new update isn't it ?
It has been like this for a long time. I can't remember if it was a patch or not.
At least since Zeus was introduced I guess
what
so anyway to verify that the weapon from who ? anything
i'm trying to give the weapon back if no one haven't took it
Soldier A has rifle B
Soldier A dies
Rifle B drops as a ground weapon holder next to the corpse of A
A is deleted
If this all happens, then (the ground weapon holder of) B is deleted as well.
Use closeDisplay
I just realised that if I use createDialog on the map, it will not allow me to use the map until I close the dialog
Ok, that's what I need
displays hold dialogs and controls
ok, that works really nice thanks
What works really nice?
createDisplay. I can use the map and use my new button splendily
Splendid โข
Ah yep btw when you said the map didnt work, was it like locked and you couldnt move it around? Because I have a teleport script which is opened from an admin menu which calls openMap and I have that issue, cant seem to work it out
Yeah well thats what I figured from what we just said, however even when I closeDialog before it it doesnt work
clicking on the map doesnt make it go into focus?
@little eagle so there is no way to get the weaponholder object that created from Soldier A right ?
i know people use nearestObjects but it can be intersect with other Soldier. sad indeed
What do you mean by "get"?
find out which weaponholder is associated with which corpse
Don't think there is for sure, but this should be enough, no?
nearestObject [_corpse, "GroundWeaponHolder"];
nearestObject [_corpse, "WeaponHolderSimulated"];
It's one of these depending on what class they use. Not sure.
guess hes concerned for the case when two dudes die on top of each other but yea thats tough luck
maybe BI was nice and set some hidden variables but Id guess its engineland territory
Yeah, but there is nothing better that I am aware of.
๐ข
you might be able to cheat it yourself to some extent. replicate the creating of the weaponholder and move the weapon into it with a killed event handler and set a variable so you know which is what. Itll still be non perfect (e.g. if players drop other weapons or items in the holder or drop the weapon on the ground later when they decide against taking it).
but there are no hard links you can use in this case
that might be the reason why the holder aren't provide by event
during the event the unit still has the weapon in his inventory, or so id expect
@peak plover: pretty sure you can close any dialog by pressing Esc.
any way to remove the map icon of an object? (hideobjectglobal still shows the units map icon)
You can't, they're baked into the .wrp
Oh wait
You mean the difficulty helper icon?
Dont think you can remove those individually
just the regular unit a unit displays on the map, like darter for example has the quadcopter icon
Theyre a difficulty setting, I almost always have them off I guess. If its your script, try moving them away before hiding them. Maybe resetting everyones knowledge of it could work too
so i could just do reveal 0? (hidden unit cannot be moved to edge of map, must be near player units, at lower diff they can see the icon)
Play on a harder difficulty
Anyone have any issues with uavs created for diff factions with ```_vehicleObject = [[0,0,1000], 0," B_T_UAV_03_F", resistance] call BIS_fnc_spawnVehicle;
createVehicleCrew _vehicleObject;
main issue is that drones wont follow commands
createVehcrew uses the default unit strings in the cfg so wouldnt a B_uav always spawn west crew?
i think you would need the I_uav class for it to be resistance?
The createVehicleCrew will take from a config entry iirc
Create it for the resistance side i guess
Well its to allow different factions to use different UAVS
But typical crew will be defined as regular blufor ai brains for the vehicle
that allows me to use it however the drone doesnt follow orders
But createVehicleCrew will create a bluefor AI unit for the bluefor drone.
Because that is what the crew is.
you would have to manually create units from the desired faction then move them inside
createUnit and then moveInDriver
yep thanks ๐
I_UAV_AI_F iirc
something like that
But then I still don't know if that allows indep to control a blufor drone class.
It's probably side locked anyway.
wouldnt the vehicle side be determined by its crew?
if empty then its side civillian
We are talking about drones. Who knows.
Drones don't follow the same logic as these SQF commands, side etc.
Not necessarily at least.
another question about drones, how do you toggle the laser designator of a remote desig
once you do the fire command laser will be perma on? how do you then turn it off?
Never played with it
Might be something in here https://community.bistudio.com/wiki/Arma_3_Actions
guess i could just remove the laser then give it back
yes the commands now work when i used creteUnit
createVehicleCrew creates the units defined at configfile >> "CfgVehicles" >> "B_T_UAV_03_F" >> "crew" so by using that command you just kinda turned him back into blufor
Anyone know how to leverage the init event handler?
put something in there and it will be executed at init
you cant use it in a mission by virtue of the fact you have to supply the unit to the addEventHandler command
I told you use the CBA one ๐
I gotcha. I just wish there was a way to access the init of the units spawned with the combat patrol module. The combat patrol module itself has an init field. I wonder if that's able to be leveraged the way that the inits of those units spawned by it would be. Probably not, but it makes me wonder hardcore.
Anyone knows if there's a way to change a variable dynamically in a config class ?
I'm talking about mission included ones
@indigo snow, drats! Thanks!
__EVAL maybe.. that's kinda dynamic @jovial nebula
would anybody be interested in a tiny tool that can PreProcess files?
in need of creating such a tool for testing purpose and might publish it if somebody needs
(Me)
So no way for doing it externally?
depends on what you mean with dynamically really
you can use __EVAL to change them when the mission gets selected, once
configs are designed to be static actually
so ...
everything that is needed to be actual "dynamic" --> changing during mission; should be done using SQF based variables
@queen cargo Just grab the GCC preprocessor as a binary and use that...
Oh yeah that's without any doubts a better solution..
But , just for knowing, let's take this as an example
class MyClassUnderConfigFile {
class MyClass{
class MySubClass {
MyVar1= 50;
MyVar2= 10;
};
};
};
@still forum i know there are other solutions, just asking
as when somebody would have had interest in such a tiny tool, i would put it in a separate project instead of dumping it in the end
This for example is written in an included hpp file,is it possible to overwrite MyVar2 ?
no @jovial nebula
Okay, thx both ๐
only with a separate config
as this is missionconfig, even that is no option
Good to know
Hey, anyone able to tell me how to set a trigger to spawn a logic entity when a player gets within 100m? i want to spawn Thirsk Fog (TH_FOG3) when my unit enters a base - thanks in advance!
its a logic entity we have in one of our mods that spawns fog locally rather than over the whole map, helps things run slicker
Interesting!
just use createObject to create the thing in the trigger activation field
can you give an example @indigo snow i'm really new to this stuff, sorry
0 = "TH_FOG3" createVehicle getPos thisTrigger < Put that in the trigger activation field
cool ty
that would spawn the frog then not local but global
you probably want createVehicleLocal instead
still would wish there was a createUnitLocal ...
sorry, that didn't work, couldn't get anything to trigger, used the following settings:
type: none
Activation: BLUEFOR
Activation type: Present
in Condition box: This
in On Activation: 0 = "TH_FOG3" createVehicle getPos thisTrigger
Nothing else set
are you sure that classname is correct, then?
when i hover over it says Fog Strenght 3 and underneath TH_FOG3 (strenght is mispelled on the module)
i've tried with both names, doesn't work
so VR blocks don't work with setobjectTexture? could've sworn they did at some point
or am i messing it up?
@badbenson#0154 afaik any object works with setObjectTexture.
nah. needs model.cfg and model itself set up right
i just wanna make it invisible but keep collision
Ah, gotcha. Thanks for that, I'll remember that for future reference.
well what you describe would be definately desired. but don't get me started on lack of standards in BIS models. it would be so useful if every model would be set up to be used with that command
Ok, 10 minutes later and counting 3 hours
Can someone help me with this
16:29:05 Mission 3SWInsurgencyV6.Altis: Missing 'description.ext::Header'
I think this is what's preventing me from loading my mission on a server
hey, does anyone know what functions I could use to keep civilian units in the passenger seats of a vehicle occupied by OPFOR? setcaptive doesn't seem to do the trick :x
lockCargo only locks the seat from getting IN, not out.
hey guys, i have a question regarding the "setDriveOnPath" command, how do i record the path im making? as i tried using the path i made with unit capture/unit play but that doesnt seem to work.
it takes an array of positions, so it should be pretty easy to do
what i'd do is add your start point to an array, then move along the path you want to record and add your current position once it's >15m or so away from the last position
@badbenson#0154 VR blocks 100% work with setObjectTexture. I experimented around with projecting a UAV camera onto it.
I dunno about making it seethrough though. You could try with a different material.
hm yea. maybe the material. ended up doing something else. the idea was to disable collision to units that could get close to the car that uses setDriveOnPath to keep the vehicle from doing avoidance behavior. worked great but i had to find a way to still have collision when you walk against the vehicle. so i wanted to attach an invis VR block. ended up jsut using a clone fo the vehicle itself. made more sense anyways.
Could an array contain too much stuff? I am using diag_log to print an array and the string just cuts off at some point.
you can only diag_log so much stuff
iterate through the array and log them one by one
diag_log has a limit yes.
There is no real Array limit. Atleast not one you would hit.
That's what I just did I was just being a complete dumbass. Thanks my dudes.
From Arma 3 v1.55.133789 arrays are limited to maximum of 9,999,999 (sometimes 10,000,000) elements
I have a problem I just can't understand. I'm trying to send messages to a player. To locate said player I'm using a string of numbers which I find by cycling through the playableUnits and checking for the variable "cell_number" which is public. When the player joins after me, it works. When they join before me, it doesn't. I thought it was a JIP issue and the variable was just not set on my client, but when checking for the variable using the console and the command "cursorTarget getVariable "cell_number"" it returns the correct value. When trying to send a message to the number my script runs and outputs my diag lines to the RPT saying it found civ_2 with the exact number I inputted, but somehow fails just like if it couldn't find the unit attached to the variable.
It might be that your script executes before JIP is done and so it doesn't know the variable yet. If it still doesn't work after you checked that the variable is available.. dunno
I've just checked, the variable is set on the guy in front of me. I even tried setting it through the console and tried again. Every time it can't seem to find the unit attached to it. The problem is it actually finds it and tells me exactly which unit matched the number in my RPT.
The client RPT.
Does the Debug see stuff the rest of my client can't see?
Does the Debug console somehow see what the server sees instead of what my client sees?
So.. Your script can't find the Unit. But it finds the Unit and logs it to RPT?.. I don't really understand..
Exactly, I don't understand either.
[_msg,name player,0] remoteExecCall ["TON_fnc_clientMessage",>
10:35:15 Error position: <remoteExecCall ["TON_fnc_clientMessage",>
10:35:15 Error Type Any, expected Number, Side, Object, Group, String
10:35:15 "Using civ_2, found number: 64621"
10:35:15 "Using civ_1, found number: 44664"
10:35:15 Error in expression <layableUnits;
_msg is a set string
Any is because I don't have a check for if it doesn't find the unit.
Using ... blah blah is the diag output.
Inputted number is 64621
it is calling remoteExec before it found the number? Or are you just diag_logging after that?
diag_log after
TON_fnc_cell_textmsg =
compileFinal "
private [""_msg"",""_to""];
ctrlShow[3015,false];
_msg = ""MATCH!"";
_num = ctrlText 3004;
_length = count (toArray(_msg));
if (_length > 400) exitWith {hint localize ""STR_CELLMSG_LIMITEXCEEDED"";ctrlShow[3015,true];};
if (_msg isEqualTo """") exitWith {hint localize ""STR_CELLMSG_EnterMSG"";ctrlShow[3015,true];};
_to = {
diag_log format [""Using %1, found number: %2 compare to %3"", _x, _x getVariable ""cell_number"", _num];
if ((_x getVariable ""cell_number"") isEqualTo _num) then { _x };
} forEach playableUnits;
[_msg,name player,0] remoteExecCall [""TON_fnc_clientMessage"",_to];
[] call life_fnc_cellphone;
hint format [localize ""STR_CELLMSG_ToPerson"",name _to,_msg];
ctrlShow[3015,true];
";
Right now _msg is static to "MATCH!"
Actually
I'm diag_logging before
I might be missing something really stupid. Something I do quite often.
So it errors on one message. And on a completly different message it works
Yes
so it apparently doesn't find the number of the first message
Right now the guy that joined before me can message me, but I can't message him.
If I join before him, I can message him, he can't message me.
But somehow the client can still compare the variable (it finds it) but completely fails it.
like 2 = 2 --> no
private ["_msg","_to"];
ctrlShow[3015,false];
_msg = "MATCH!";
_num = ctrlText 3004;
_length = count (toArray(_msg));
if (_length > 400) exitWith {hint localize "STR_CELLMSG_LIMITEXCEEDED";ctrlShow[3015,true];};
if (_msg isEqualTo "") exitWith {hint localize "STR_CELLMSG_EnterMSG";ctrlShow[3015,true];};
_to = {
diag_log format ["Using %1, found number: %2 compare to %3", _x, _x getVariable "cell_number", _num];
if ((_x getVariable "cell_number") isEqualTo _num) then { _x };
} forEach playableUnits;
[_msg,name player,0] remoteExecCall ["TON_fnc_clientMessage",_to];
[] call life_fnc_cellphone;
hint format [localize "STR_CELLMSG_ToPerson",name _to,_msg];
ctrlShow[3015,true];
your _to is the value returned by the forEach?
yes
forEach doesn't return anything
your code is confusing
Most of this is written by however made it first, I just changed the variables.
whoever*
you can use count to get the length of a string. You don't need toArray
I didn't write that
ยฏ_(ใ)_/ยฏ
hi guys. I just attached an object to my vehicle, but its orientation is -180. whats the easiest way of rotating it around? I tried both vectorDir and setDir
either setVectorDir or setVectorDirAndUp will do the job and provide a relative rotation to the attached to object
so if I get the dir of my vehicle like this
_dirVector = vectorDir _vehicle;
and set it on my attached object like this
_object setVectorDir [_dirVector]
would that work?
hm no.. It wont
setVector ofc requires 3 params
do I set the vector before of after I attached it?
after
@nocturne basalt Use
_attachedObject setDir 180;
@little eagle I tried that but my attachedObject is always stuck in the same position... weird
Ofc. it will be in the same position. But rotated 180ยฐ.
Yeah thats what I meant. It's always -180
Did you setDir 0 or setDir 180?
I tried both, but I may have set it before I attached it.. I will give this a go tomorrow. Thanks so far guys. Have a good night
Or day
You have to use setDir after attaching it.
Ok I will let you know if it worked
And you have to use 180, not 0. No idea why you say it's -180 every time. How did you determine that??
Well it's the other way around. I didn't have the value
Weird that stuff are rotated 180 by default when attached
It's very likely not -180, but the models simply are oriented differently.
This model is the same orientation that my vehicle has
By default, the objects are attached 0ยฐ relative to the attachedTo object.
Strange
IIrc some objects have a config entry to modify the models orientation when placed in the editor. That might be ignored by attachTo. ... or I'm thinking of a different game again.
Oh... It's config is really simple
Dont know were it should say it's rotated
class House_F;
class VR_Shape_base_F: House_F
{
class AnimationSources;
author="$STR_A3_Bohemia_Interactive";
mapSize=1;
_generalMacro="VR_Shape_base_F";
scope=0;
scopeCurator=0;
displayName="$STR_A3_CfgVehicles_VR_Shape_base_F0";
model="\A3\Weapons_F\empty.p3d";
DLC="Mark";
vehicleClass="Structures_VR";
editorCategory="EdCat_VRObjects";
editorSubcategory="EdSubcat_Blocks";
destrType="DestructNo";
};
class Sentinel_legs: VR_Shape_base_F
{
author="Battlestad";
scope=2;
scopeCurator=2;
displayName="Sentinel_legs";
model = "\WHwalkers\Sentinel\model\sentinel_legs.p3d";
DLC="Mark";
icon="iconObject_1x1";
}
Thats it
Could be inherited.
Could anyone point me towards that UI thing that kinda fuctions like a listbox, but has control groups instead?
They were doing that a while ago, but i can't find it for the life of me
He means this one: https://community.bistudio.com/wiki/DialogControls-Tree
treeview has like nothing to do with a listbox Oo
maybe the fact that tree view can be build using listboxes
not in arma
but in "normal" ui stuff
Ah, I was thinking of control table or whatever it's called. Can't find it on the wiki.
I've been looking for an easier way to do this, but couldn't find one. I can't believe this is the optimal way to do it:
_numbers = ["0","1","2","3","4","5","6","7","8","9"];
_num = ctrlText 3006;
_name = ctrlText 3007;
for [{_i = 0}, {_i < (count _num)}, {_i = _i + 1}] do {
if !(_x in _numbers) exitWith { diag_log format["BAD CHAR IN NUM! %1",_x] };
};
for [{_i = 0}, {_i < (count _name)}, {_i = _i + 1}] do {
if (_x in _numbers) exitWith { diag_log format["BAD CHAR IN NAME! %1",_x] };
};
I just want to check for specific chars in my string.
@tardy yacht I'd iterate through the string to check and see whether the current character can be found via "find" in the array of whitelisted characters, if it can't, it prints the appropriate message
toArray your string. Use count to find non-conforming characters and check if returned count > 0
What is your for loop doing there? you are not using _i anywhere. And where is your _x coming from?
Yeah that's just me doing random shit again.
{_x < (whatever ascii thingy 0 is) || _x > (whatever ascii thingy 9 is)} count toArray _num > 0
I didn't actually run this exact code, I just threw those in to make sure people understood what I was trying to do.
Forgot to proof read.
Or to think.
Ok so when I toArray a string all its chars are turned into ASCII or just the numbers?
into the numbers corresponding to the char
Don't know how that acts with UTF-8 though
I think I got the basic gist of it, but I can't understand your line. Could you please explain it to me?
Turned into what I need, it'd look something like this:
{_x > 47 && _x < 58} count toArray _num > 0
But what in heck does that do
it goes through all the characters in the string and counts all characters that are not between "0" and "9" and if that count is > 0 meaning atleast one character is not in that range it returns true
i suppose you just want to check if the value is numeric, for altis life, there is a function for it isNumber
private["_valid","_value","_compare"];
_value = _this select 0;
_valid = ["0","1","2","3","4","5","6","7","8","9"];
_array = [_value] call
{
private["_in","_i","_arr","_out"];
_in=_this select 0;
_arr = toArray(_in);
_out=[];
for "_i" from 0 to (count _arr)-1 do {
_out=_out+[toString([_arr select _i])];
};
_out
};
_return = true;
{
if(_x in _valid) then
{}
else
{
_return = false;
};
} foreach _array;
_return;
@tardy yacht
Dedmen's thing worked just fine and seems to have a very fast execution time. I think I'll stick with it.
But thanks for letting me know that function exists, might come it useful in other situations.
@vivid quartz My first, second and third thought when I look at that code: "WTF"
You have built a nice Rube-Goldberg machine there to do a very simple task
Wait.. for altis life, there is a function for it isNumber You copied that.. From Life?
I think that's Altis Life's way of doing it.
๐คฆ
yeah, it was weird for me, because he didnt use isNumber function already, as he was editing altis life
maybe hes editing something else idk
Listen to Dedmen and you'll be alright
Is Life's code that bad?
spaghetti code
Look at that code that @vivid quartz posted.
and thats being rude to spaghetti code
Yeah I got that part. That's extreme.
That code is horribly outdated and is violating at least a dozen points on the "Code optimization" wiki page
The thing is, I'm learning how to script as I go. Most of what I got is by reading through some of Altis Life's files. If you're telling me the thing is garbage that means I ain't learned shit.
That code is taking your string. Splitting it to an array. Then taking each element of the array using the worst possible loop. turning it into a String again and appending it to an array using the worst possible append method. And then it does basically the check that you already had before.
You still learn to code. Syntax and stuff. But yeah. Altis life is not the best to learn off of.
Just ask here if you have any questions. If you provide example code you will get screamed at about how bad it is. But people will tell you how to fix it.
I'd suggest reading https://community.bistudio.com/wiki/Code_Optimisation
I knew people hated it, but I didn't know it was that bad.
I don't know if all Life code is thaaat bad. I'd guess newer stuff is better. But I don't see much Life code
Yeah I've started reading some bits of this page whenever Google would throw it at me.
Life code has improved a lot recently
Yeah they're re-writting a lot of stuff.
Thanks to BoGuu and a few others, but there's still lots of old crap which hasn't been changed
What confuses me is how sometimes it does something one way, but the next file does the exact same thing in a completely different way to achieve the exact same outcome.
Often left me blindly picking both ways to do it.
between
Oh I can edit on Discord
Forgot that one.
Possibly because tonic made one way, then someone else did a different way but nobody decided to delete the worse one
Some of the bigger servers probably re-wrote the thing already anyways.
There's like 10 versions of life mods
Less then you think @tardy yacht
Most big servers just keep updating to latest patch of Altis Life
A lot of it isn't even open source, becaus money is invloved, it seems to me like a rotting bucked of cancer
Of course there's lots of versions, Altis Life itself is on 5.0
And Altis Life is totally open source, so you can't say much vs them guys
Seriously? I'd think stuff like Olympus, Asylum and GTA would've re-written it by now.
In the world of 3.x they'dve not stood a chance
As it was horrific
And it was like putting a bandage on a 10m wound
What he means is there are lots of other life mods. I came across a couple dozen different alterations when looking for specific snippets online.
But with 5.0, the new stuff BoGuu and friends have done, have made it so everything works better, as well as easier to customize yourself
money + modding = ๐ฉ
One of them looked particularly promising but they had a weird system to "let you in" on their code. Had to let'em see how good a coder you are to not "ruin their image" or some bullshit like that.
@tardy yacht are you sure
{_x > 47 && _x < 58} count toArray _num > 0
works? I think that is always true if the string has atleast one number.
{_x < 47 || _x > 58} count toArray _num > 0
This will return true if there is atleast one non-number which is what you needed right?
You should better test that in Debug console before putting that in your final code
Also you gotta remember @tardy yacht, wouldn't you rather be a lazy arse, do no work to optimise the framework, then get donations, either way you'll achieve the same goal ^_^
I've checked both and yours does it faster. Doesn't need to go through second check if first is true @still forum
mine is faster yeah. But is it correct though?
Maybe my brain is weird.. In my brains script evaluator that doesn't work.. What am I doing wrong ^^
Gave it different strings of numbers sometimes throwing in a letter or two and it caught'em easy
Basically anything that's out of bounds on ascii is be-bye
I must be doing something wrong then.. Probably didn't get enough sleep ยฏ_(ใ)_/ยฏ
Yeah I've asked some weird shit on here while I lacked sleep.
Most of which you fixed.
Or commy made me feel weak with his one-liner game.
Hmm. You could maybe abuse the parseNumber command too
parseNumber won't work with telephone number sized numbers. Because float precision will take a dive at some point
my method works for unlimited long numbers
My tel numbers are 5 digits long anyways.
3 per player, all 3 start with the same digit and then 4 random digits.
parseNumber would work in that case. Not sure if it is much faster if you convert the string to a number and then convert it back and then do a string comparison to check if it's still the same to see if it's a number
my code translated into C would be veeeery close to the optimum. So I'd guess in SQF it's also quite good.
I'm also checking against numbers in a string of text for the contact's name though.
A contact's name can be somewhere between 4 to 25 chars.
_return = true;
{
if(_x in _valid) then
{}
else
{
_return = false;
};
} foreach _array;
_return;
^ this is very creative.
Needs more empty blocks
I wonder who came up with if (blah) then {} else {blub};
Put the whole thing into {}
@little eagle alot of people don't know how to change the condition to only match the else case
So they just put in {} else {
How do you write code and not know about the simplest of all operators?
๐๐ฟ
@little eagle copy pasting
Yes, but someone must've come up with this in the first place.
Actually who knows what's happening in their heads lol
I guess someone who doesn't really know how to code gave this advise to someone else and it eventually spread
Certified scripters
anyone know of a way to list active event handlers on an object? I want to remove duplicates. I could just loop through and remove any with index >0 but wanted to debug what is being created first.
there is also removeAllEventHandlers
I know of a way. But not possible with SQF
Not possible. You should avoid adding duplicates in the first place.
yea, it wasn't intended but i think it's happening, i'll dig further why, thanks
anyone got any clue what might add like 1700 empty lines to a precompiled function? It happens somewhere in the included script_component.hpp but I can't find anything weird ๐ฆ
You just answered yourself @halcyon crypt
@sand pivot You could add this guard:
if (isNil {_object getVariable "MyTag_hasEH"}) then {
_object setVariable ["MyTag_hasEH", true];
_object addEventHandler [...];
};
a precompiled function
#defines and other preprocessor commands are taken out of the code.. and empty lines are left
so you #include a file with a lot of empty lines and you wonder why there are empty lines
ha, that's what i was writing just now, thanks for beating me to the puch @little eagle you are the man!
Alternatively to just true, you could store the eventhandler id. In case it is something you want to remove later.
@still forum so CfgFunctions is basically fucked? :/
yup, that is where i was leaning, storing the id
๐
@halcyon crypt How is that related to CfgFunctions? Every precompiled function with a big #include and macros in it has a lot of empty lines
you can just remove all the empty lines from your includes
if you want to get rid of them
thing is we're including CBA .hpps (e.g. #include <\x\cba\addons\main\script_macros.hpp>)
wouldn't all mods using CBA have that same issue then?
they all have the issue. yes.
so error line numbers are always "wrong".. damn ๐ข
no
error line numbers refer to the source before preprocessing
except if you have comments before your #include
we were talking about that a few days ago weren't we?
yes
preprocessFile or preprocessFileLineNumbers? Are you just using CfgFunctions?
just CfgFunctions
Can you PM me the output of preprocessFileLineNumbers "yourfile.sqf" ?
i have a old script
[[0],"life_fnc_beast",_unit,false] call life_fnc_MP;
im trying to change to remoteExec
[0]remoteExec["life_fnc_beast",_unit];
is that how its done?
looks correctish to me
if i was going to test tthis on me would this work
[0]remoteExec["life_fnc_beast",player];
one way to find out
i try it but didnt work so was seeing if that how it should be done
Depends on what life_fnc_MP is.
this script is for altis life if that helps
ok just want to see if i could get a quick fix! thanks!
It's probably something like BIS_fnc_MP.
Yeah BIS_fnc_MP achieves the same thing as life_fnc_MP
Use remoteExec instead.
@tough abyss That is exactly what we were talking about.
:thumbsup:
I'm not able to check it but,is there a CfgWeapons >> Items class ?
Are there any application differences between
_array = [];
_array pushBack life_hunger;
_array pushBack life_thirst;
_array pushBack (damage player);
_packet pushBack _array;
AND
_packet pushBack [life_hunger,life_thirst,(damage player)];
Execution time is split in half on the single statement line.
And from what I gather the outcome is exactly the same.
No difference
You had me confused before that edit.
Didnt see the packet bit
So you're telling me I could just change all of the client to server packet sending stuff in Life and basically cut the resources needed for it in half?
I just checked, every single file uses the first snippet I posted.
Well, everything related to sending an array of info to the server that is.
I mean its the same so go for it
Hello, for some reason this isn't working :
[format["<t color='#FFFFFF' size = '1' shadow='1' align='center' font='PuristaBold'>Winner is %1</t>",(Best_player)],-1,-1,8,2,0,3088] spawn bis_fnc_dynamicText;
Based on my initServer.sqf :
DM_End = false;
while { !DM_End } do {
{
_Pscore=score _x;
_last= _x getVariable["score_last",0];
if (_Pscore != _last) then {
_x setVariable["score_changed",1];
};
_x setVariable["score_last",_Pscore];
Best_player = name _x;
} forEach allPlayers;
sleep 1;
};
Can someone help ?
what isn't working?
is there a scripting command to remote control a bird? The following doesn't appear to work.
_bird = "Kestrel_Random_F" createVehicle [POS]
player remoteControl _bird;
I'm more questioning how you think [pos] is working?
Did you try to switchCamera?
just did, no dice
switchCamera works for me, but it will not move
i must have done switchCamera wrong
Not used the command enough to help too much, seems like the choice of object doesn't help though
_bird switchCamera "internal"
yup, that works
@indigo snow Are you really saying
[life_hunger,life_thirst,(damage player)] is equal to [[life_hunger,life_thirst,(damage player)]] ?!
wtf
In the end it gets pushed to a second var
Life code....
/shrug
@tough abyss no, i tried taking control via scripting and via curator but it doesn't get added to zeus via ACE nor ARES "add Objects to Zeus" modules
error Bad vehicle type Kestrel_Random_F
Its probably not advanced enough to be controllable
missing lots of config structure and whatever it all needs
yea, that's what i'm thinking, it probably can only be controlled via scripting
yes, that is where it is
i'll give that a shot, hopefully the mem points don't cause issues. we'll see
and i'll need to figure out the model.cfg unless there is a way to extract that?
the class to inherit that is
@sand pivot The text with the name of the player is not displaying in MP
Hi, how can i disable the load function when i have a arsenal in my mission. Added custom arsenal and i dont want the players to load there own saved loaout, wil break my mission and player will abuse it.
@little eagle setDir -180 worked after attach. Guess I was a little tired when I tried this last night..
thanks
Why -180 and not 180?
does getDir return the direction in a compass bearing direction or rotation in degrees?
Sure.
setDir 180 is almost never actually 180.
Uhm, yes it is?
๐คท
like what else? a slight offset because of terrain gradient?
@little eagle have no idea ^^
hey, is there a way to log the handle parameters of these server eventhandlers? https://community.bistudio.com/wiki/ArmA:_Server_Side_Scripting
diag_log doesnt seem to work inside them, im getting syntax errors
It's as awkward as writing setDir 540
Error in expression <diag_log _this; kick (_this select 0);>
Error position: <_this; kick (_this select 0);>
Error Missing ;
so there is no way to know what is inside the params?
yes
Do you want to know what params are available?
id really need to debug what is inside those params. it seems like onHackedData kicks for createsimpleobjects
Yeah.. Can't tell you that. I might be able to check what params you get. But not the values you actually have
I mean the wiki gives the handler parameters
lul. My browser was moved offscreen so I didn't see that.
user id, file name
Can't really do much with these when you can only use the kick command in there.
if might work
ye, thats why i want to know what is causing the kicks, so i can make a if expetion for those cases
nope.
users, ban,kick, numberOfFiles, lock, checkFile, checkExe
that are literally all script commands available
because it seems like that as soon as the server spawns in a few objects with createsimpleobjet using models from the mission file, onHackedData starts kicking people
No if, then, else, Dedmen?
Well then it's pointless to pass the file names in the first place, no? I guess you can use checkFile whatever that does.
global vars?
But in a private namespace only accessible in serverside scripts
So only local vars or is this an inaccessable namespace?
checkFile takes a fileIndex. not a fileName
it is a namespace like any other. You just can't access it via SQF command
k
so what would you suggest what i should to now to fix my problem?
should i just disable onHackedData?
Wow.. OnHackedData receives the filename. Which you literally can't do anything with. checkFile wants a fileID not a name.
might be bad
yes
What's a file id anyway?
index in some file table probably
So it's a float?
number.. yeah
for when you have negative entries in the list.
well, i mean select seems to work inside the eventhandlers, so i dont really see why if wouldnt
checkFile just queues a check. Doesn't return anything and you have no way of receiving the result
Because eventhandlers are normal SQF and server side scripting is not?
Eventhandlers are SQF like any other script
kick is definitely not a SQF command.
@little eagle setDir 180 worked also.. same result
"server side sqf" is different from "forest and maddow sqf" then.
@nocturne basalt Of course. That is how circles work.
They go around and around forever.
@still forum no i didnt mean sqf eventhandlers
oh...
onUnsignedData = "kick (_this select 0);";
now im getting session lost
for no reason
wtf
20:48:33 Reading mission ...
20:48:36 Mission read.
20:48:46 Game started.
20:49:40 Player Adi Frost disconnected.
20:49:40 BattlEye Server: Player #0 Adi Frost disconnected
Mission file: BountyHunters (__cur_mp)
Mission world: Malden
Mission directory: mpmissions\__cur_mp.Malden\
Land_NetFence_02_m_gate_v1_closed_F: Door_1_locked_rot - unknown animation source door_1_locked_source
c:\w\stable\futura\lib\network\networkserver.cpp NetworkServer::OnClientStateChanged:NOT IMPLEMENTED - briefing!
Attempt to override final function - bis_fnc_storeparamsvalues_data
"======================================================"
"server init started..."
"======================================================"
Performance warning: Very large search for 224112 (>250 m)
Strange convex component202 in a3\structures_f\households\house_small01\d_house_small_01_v1_f.p3d:geometryView
Strange convex component203 in a3\structures_f\households\house_small01\d_house_small_01_v1_f.p3d:geometryView
Performance warning: Search for 28e52c8c100# 224112: ttowerbig_2_f.p3d was very large (1675 m)
CallExtension loaded: real_date (E:\SteamLibrary\steamapps\common\Arma 3 Server\@bountyhunters_server\real_date_x64.dll) [x๏ฟฝg๏ฟฝ]
Trying to execute a disabled command 'addaction' (2 args)
Scripting function 'bis_fnc_execvm' is not allowed to be remotely executed
Mission id: cf64003040c75bd8b68eaa21dc76c93a9151b20d
CallExtension loaded: inidbi2 (E:\SteamLibrary\steamapps\common\Arma 3 Server\@inidbi2\inidbi2_x64.dll) []
client:
20:48:34 Starting mission:
20:48:34 Mission file: BountyHunters (__CUR_MP)
20:48:34 Mission world: Malden
20:48:34 Mission directory: mpmissions\__CUR_MP.Malden\
20:48:45 Scripting function 'bis_fnc_execvm' is not allowed to be remotely executed
20:48:46 Mission id: cf64003040c75bd8b68eaa21dc76c93a9151b20d
now the server closes connection to the client for no apparent reason
the cause is createsimpleobject, as soon as the server spawns in models with createsimpleobject. clients get disconnects
has anybody experienced with createsimpleobject an idea why this is happening?
declare it once in an upper scope
private _a
[] call {
_a = 4
};
// _a is 4
well it equals [1] but yea
dont even need to give it a value iirc
scrub it down, empy most if not all code, and start re-adding until you get the problem
because the above example I posted works
@little eagle lol. yeah thats true ๐
I can use [4] execVM "showDamage.sqf";to pass arguments. Are there any other characters instead of [] I can use to do this?
Or else: How can I pass an arguent in here: ["SCOTS Training Ground", "Emergency_yelp", ["YELP Sirene"], { _handler = ['2'] execVM "Siren.sqf" }, "",[DIK_F, [false, true, false]]] call cba_fnc_addKeybind;
because [] doesn't work here
AH, [] arent just "characters", it's a single ARRAY-type variable
I know this isn't a "life" scripting Discord, but does anyone know if I can just create a new table using Heidi and then use it? I've added a table and now when I try updating stuff it doesn't work. It works when inserting, when selecting, but update doesn't work. I have tried manually inputting the query in Heidi (I am temporarily using the same MySQL user for the game and Heidi, same grants) and it works just fine.
Not related to life, but yes
If your INSERTs/SELECTs are working, then UPDATE will work
Ultimately you're doing something wrong
(check extDB logs)
Is parseSimpleArray meant to work with string arrays which use the ` symbol for encapsulation?
No it doesn't. Pretty sure that is in biki
Hello, for some reason this isn't working in MP :
[format["<t color='#FFFFFF' size = '1' shadow='1' align='center' font='PuristaBold'>Winner is %1</t>",(Best_player)],-1,-1,8,2,0,3088] spawn bis_fnc_dynamicText;
Based on my initServer.sqf :
DM_End = false;
while { !DM_End } do {
{
_Pscore=score _x;
_last= _x getVariable["score_last",0];
if (_Pscore != _last) then {
_x setVariable["score_changed",1];
};
_x setVariable["score_last",_Pscore];
Best_player = name _x;
} forEach allPlayers;
sleep 1;
};
Can someone help ?
How is it not working?
I'd try making my variables public. (setVariable ["VAR",value,true])
The last parameter is a boolean that broadcasts the value or not.
@tardy yacht Wont this spam the bandwidth ?
It will, but just to check out if it works that way. If it does, then you can find which ones actually need to be broadcast. That is, if the problem is related to this.
Or wouldn't it be because you're calling the dynamic text thing on the server and never actually calling it from the client?
@tardy yacht If I display the msg with my timer (ingame every second) it works in MP and SP.
But the msg is displayed with the outro ... let me see how I launch my outro...
@tardy yacht Outro.sqf is launched by a Trigger with condition : (TimeP<10000 and ((time >= TimeP) or (TimeEnd >= TimeP))) or (score player >= DM_Max_Score)
@tardy yacht on Activation : DM_End=true; TimeEnd=time; publicVariable "TimeEnd"; Null = [] execVM "Outro.sqf"
@quartz coyote if youre running that code on dedi, player is null everytime on dedi
I'm gonna be honest and tell you I don't know what I'm doing. Now that you know that, is the trigger server side?
@copper raven Ah ! So how can I adapt my script ... ?
@copper raven in wich way ?
i still don't get the point of this code, best _player will always be the last guy in array of allPlayers
@copper raven I'm looking for the best player of the match, the one with the biggest score
Why doesnt deleteVehicle work with dead bodies?
It does
@warm gorge in PvP I use this to clear the battleground :
_body = _this select 0;
sleep 20;
deleteVehicle _body;
Weird, just tried running deleteVehicle on allDeadMen and it did absolutely nothing
@quartz coyote there is probably better way to do this, but this works for me
//initPlayerLocal.sqf
fn_sendmsg= {
[format["<t color='#FFFFFF' size = '1' shadow='1' align='center' font='PuristaBold'>Winner is %1</t>",(_this)],-1,-1,8,2,0,3088] spawn bis_fnc_dynamicText;
};
fn_getName={
_name=call{
_as=[];
_an=[];
{
_as pushBack score _x;
_an pushBack name _x;
}forEach playableUnits;
_s=selectMax _as;
_i=_as find _s;
_name=_an select _i;
_name;
};
if(_name == name player) then {
_name remoteExec ["fn_sendmsg",-2];
};
};
//initServer.sqf
dm_end=false;
waitUntil {dm_end};
[] remoteExec ["fn_getName",-2];
@copper raven Ok found why the message was not displaying :
My dynamictext ID was 3088 but it was the same as an other dynamic text with same ID displayed a few seconds before... stupid of me...
I'll take a look at your script and see if it worked !
do we happen to have something like substring or do we have to go the splitString / joinString route?
nvm ๐
CBA_fnc_substr and CBA_fnc_substring ๐
@halcyon crypt
"Fish frog cheese fromage" select [5, 4] // "frog"
Yup.
the CBA functions use the same method though
Yes, they were rewritten to do so when this syntax was added to the game.
Previously they were different and complicated enough to warrant a function. Now they are legacy.
Hasnt that always been there pretty much? @little eagle
Being able to select likethat
No.
When did that syntax get released?
string select [start, length] (since ["Arma 3","Arma3",127,126674,"Development"])
Sure.
Same as being able to select via booleans, conditions etc
select BOOL has been in A2, so that is way older.
Oh rly
Yes. It's probably as old as SQF.
Heheh alright
OFP 1.0
OFP lmao
Actually that means that it predates SQF and could be used in those SQS files already. xD
So I wanna track where the missiles from a grad launcher land. Best way to go about this minimally? You can't set variables on the projectile, nor does its explosion trigger any event handlers.
When it stops moving? Lol
I wonder if the deleted eventhandler works. Probably not.
a spawned while loop is typically very far off because of the speed
it didnt
maybe attach a created logic unit to the missile?
You can't attach to CfgAmmo
dammit
Check the position every half a second and if the position has changed then it is still moving?
Is this mod or mission?
ideally mission but im willing to sneak some stuff in if it helps
How will the position be off? Check it faster then.
Give the missile an empty particle effect with a script.
for the explosion effect?
beforeDestroyScript
The particle effect would be set up to trigger on explosion of the missile and last one frame to then fire this script.
aight ill look into that then, thanks for the tip
has anyone got any experience trying to override lmb ? I have tried kk method and works on ground, but in chopper lmb seems to take a different action? trying to call a function while disable the vanilla function of key.
you could just flat out remove the weapons the pilot has available I guess
that would defeat the purpose of the lock on for pilot script we working on ๐ฆ
im sorry my dude
with regards to the earlier grad script, thought of this:
[{
systemChat str({ _x inArea tr_target_1 } count allMissionObjects "#explosion");
},0,[]] call CBA_fnc_addPerFrameHandler;
need to test that one in MP though.
is there any way to damage buildings in a radius around the player?
Yes. Lots.
Drop a bomb on the player.
spawn a kart and setDamage 1 the kart
I think they fixed karts having the tank explosion.
then i want my money back!
Karts had Tank explosion ?!
Why did nobody tell me. So much fun I missed
im actually more impressed that you missed that
I enjoyed that.
Was quite hilarious ramming a kart into a MRAP and then taking out everything around you
great tool when the explosives had run out
UI event handlers don't stack, correct?
no as in they don't stack or no as in I'm not correct? ๐
unsure now
it doesn't return any index for the EH so my best guess is that it doesn't stack
yea just tested it, doesnt stack
ah sec
we talking inGameUISetEventHandler or ctrlAddEventHandler?
the ctrl one should stack
ctrlSetEventHandler but now that you mention ctrlAddEventHandler I know where things went wrong ๐
๐ learned something new too ๐
thanks ๐
anyone know how make sure tfar radios are encrypted ie opfor and blue for wont hear each other
did you try the modules?
@rain sonnet I just answered your question and then noticed that you double posted. I hate double posters so I deleted my answer. Have fun solving it without my help
I asked earlier, but noone said much, does anyone know how to properly override the fire button (manual) as a pilot in a chopper. It doesnt seem to respond to "default action" , like in kk's example. any help would be greatly appreciated
As in "you the pilot, want to fire the gunners weapon"?
You can't.
Hi everyone o7 I'm kinda stuck on creating a rope when neither object is a vehicle. I think I'm missing something, I've asked Duda in the meanwhile, as it seems he seems to know the ropes (pun intended).
Anyone willing to help out? The final goal would be to connect 2 chairs or similar objects with a rope.
You could try attaching a UAV with attachTo to the chair and hide the UAV using hideObjectGlobal
Plus allowDamage false to make it not take splash damage.
Thanks for taking the time ๐ I have already searched discord and couple of forums/mods and had found out that the UAV was the smallest vehicle and most people use it for workarounds...
The problem is that for some reason the cord turns rigid whenever I attach the UAV to another object.
I'm not yet hiding or disabling damage as I didn't yet think that was necessary if the base functionality isn't there... might that in some way affect the rope?
https://www.youtube.com/watch?v=tKekfT7ZYb4
The poles seem to be attached by rope, making me think this is possible. Am I perhaps wrong thinking this?
okay I was wrong I think, some post in there talks about cable models or something I believe.
Maybe those are configured as vehicles. This is why I don't like video demonstrations. They never show what's wrong with what is being shown.
Well, that's the thing, I'm willing to just write another config and make the 2 objects into 2 non-drive-able cars if I have to. I just want to attach some ropes ๐ฆ
Hell, my last resort was to exactly do that, make the smallest vehicle possible in arma, like a tiny ball and use that as an anchorpoint.
Idk, I hate those ropes. Along with everything else that comes with PhysX. More headache than it does good.
the ropes, when reskinned, offer loads of possibilities. What I am trying to achieve is turn them into powerwires.
I'm nearly there, but am stuck on this final and crucial step.
[LINK REMOVED]
^the TRS slot is defined in the memory LOD and I'm trying to attach to that.
There's no major reason why I'm trying this, I also made a chess set just to see if it was possible...
I don't think you can use different models or textures for ropes. There is only one rope class and the classname is hard-coded.
Well I'm pretty sure, after some digging. [LINK REMOVED]
Again, I also hate pictures, because they never show what's wrong.
If you do change the model via mod, all other ropes will look like this.
You can only ever have one rope model.
No man ๐ I'm switching nearby rope models to use a different texture set.
Credit goes entirely to: https://forums.bistudio.com/forums/topic/202414-replace-default-rope-model/
Willing to share my working ones if you wanna see for yourself.
I'm telling you, all I need t know is how can one attach a rope to something lmao
Ah, you added hiddenSelectionTextures to it (and modified the model to allow this first?)
Hang on, I'll send the screens.
I don't need screens. I understand what is said in the thread.
It's a pretty cool work-around.
No problem: might still help someone in the future. http://prntscr.com/g4z3vi
So yeah
here I am, not even 1h for the first part, now 1 day+ on the last frikking detail
There is no need to repack data_f. Could've just used a custom path for the new model, but w/e.
yeah it's what I did
the other guy doesn't get it though.
The chopper mod guy does
(bad with names)
So just to get back on track, what does an object need to be able to get attached by rope?
Cuz that's what I'm saying, I'll make a driving Speaker if I have to. I will. attach. this cable.
^bump
seems like it doesn't require anything special
it just uses the model center as it's initial attach point and you can offset from there
@halcyon crypt the problem is when creating a rope, one of the attached objects needs to be a vehicle. Like a driving one, hence why everyone points into the 'use UAV ' or 'use a kart' direction.
but in this case, both objects are just simple objects, ThingX class iirc.
Someone willing to help on this subject? Because people are saying it should possible, but I can't attach 2 cans with a rope... ๐ฆ
can1 = "Land_Can_V3_F" createVehicle (position player); can2 = "Land_Can_V3_F" createVehicle (position player); theRope = ropeCreate [can1,[0,0,0],can2,[0,0,0],20];
Doesn't work...
Hello !
For some reason, this is not displaying the lines 2 and 3 of the message
[format["<t color='#004399' size = '1' shadow='1' align='center' font='PuristaBold'>BLUE</t> <t color='#FFFFFF'>Team Wins<br>Score : %1<br>Touch : %2</t>",(WScore),(westtouch)],-1,-1,15,2,0,4001] spawn bis_fnc_dynamicText;};
<br/>
@indigo snow I tried with <br /> and it didn't work so it is <br/> you say ?
im not sure if dynamic text allows structured text from the top of my head but i am totally sure the tag is <br/>
@indigo snow i'll try and update in a second
private _msg = getPos player call BIS_fnc_locationDescription;
_msg = _msg + format ['<br/>%1/%2/%3', date select 0, date select 1, date select 2];
_msg = _msg + format ['<br/>%1', [dayTime, 'HH:MM'] call BIS_fnc_timeToString];
[
_msg,
[safezoneX + safezoneW - 0.8,0.50],
[safezoneY + safezoneH - 0.8,0.8],
5,
0.5
] spawn BIS_fnc_dynamicText;```
is a working example
@indigo snow Thank you !
@indigo snow Works perfectly like this !!
[format["<t color='#004399' size = '1' shadow='1' align='center' font='PuristaBold'>BLUE</t> <t color='#FFFFFF'>Team Wins<br/>Score : %1<br/>Touch : %2</t>",(WScore),(westtouch)],-1,-1,15,2,0,4001] spawn bis_fnc_dynamicText;};
Bump: Anyone knows a workaround for ropes attaching to 2 non-driveable objects? http://prntscr.com/g515og
When attaching one end to a car, ropes always work, but ThingX to ThingX doesn't.
yes like when pilot take manual contol of weap system. we have developed a lock on for pilot system, but we need over ride mouse while we have a target lock sorta deal
?
im looking for a mouse over ride for the fire function in heli. while pilot and manual fire, the button doesnt seem to be default action, even in a2 it is, im thinking maybe jets update mess with things. there must be a new action for fire
@little eagle and why not? this is wierd, the override we try worked in a2 but not a3
Why? Because you can only overwrite DefaultAction and that doesn't work when using manual fire.
There is not more to it.
there must be something other than default action bound to lmb while in this condition. as i said, works fine in a2, but there is a difference in a3, we wanted to overwrite and use lmb, which does seem impossible, we would be fine with just cancel mouse, and use default action, as it goes to enter and space. we want to try to make script stuipd proof so if there is a lock, the player cant mistakenly pull trigger and think they will get a hit.
there must be something other than default action bound to lmb while in this condition.
No, there must not be.
as i said, works fine in a2, but there is a difference in a3
That doesn't mean anything. They are different games / versions.
Here is a list with all input actions: https://community.bistudio.com/wiki/inputAction/actions
Only very few of these can be blocked with addAction.
If you can't block firing the weapon when using manual fire using DefaultAction, then you cannot block firing when using manual fire.
It is as simple as that.
it even works on foot just not in chopper
Feel free to try all of these, but I don't see it working.
it even works on foot just not in chopper
That too, doesn't mean anything.
Shame inGameUISetEventHandler only works with prevaction, action and nextaction i guess
There should be a proper command to disable weapons and not a dirty work around that only sometimes sorta kinda works.