#arma3_scripting
1 messages Ā· Page 343 of 1
Lol
But if you go two out of bounds, it errors.
Doesn't sound consistent š
It's not, but it has been like that since forever.
I mean well, it is, but its kind of stupid
I see, param is your favorite scripting command lol
It's the solution to everything*
*not actually everything
I claim that this is the best command by name https://community.bistudio.com/wiki/getShotParents
There must have been someone at BI thinking "Pun intended hoh"
I'd name it getProjectileParents at worst
I wish setShotParents was usable (worked outside of the server)
It only works on the server. So for server spawned projectiles... But you can't change fired projectiles reliably, because they might hit before you can remote exec this command to the server.
And bullets are local to each client, which is I think why it completely fails for those.
So essentially, use this command for called in artillery strikes and nothing else.
Disappointment of 2016 this command.
I was about to say, I don't think theres anything apart from projectiles that fly for a long time where this makes sense
I think we tried to use it for mines, but there was a problem with those too...
@little eagle Thanks for that, I'll give it a try! Might I ask what the origin part of that was for?
The center of the radius you want to search. Can be object or position
It is safe to assume that the instigator in case of a player kill is always the actual other unit that killed him?
No, step on the grenade you dropped.
Wait, so it's LITERALLY only an object, if someone pulled a trigger?
Ah, so player would work. Thank you.
I am confused
No, it's the same as firer, except if the firer was a vehicle. Then it's the gunner of the weapon of the vehicle
@little eagle mines are the biggest bitches i've worked with so far...
Can't attach variables to CfgAmmo : (
one of the best examples of a extremly bad implementation
Okay, this is giving me an error, but I feel it's because of my own stupidity and redundency vDestroyedVehicle = (getPos player nearestObjects [player, ["Car","Tank","Plane","Helicopter"], 50] param [0, objNull]);
nearestObjects is a unary command.
You put something on the left side of a unary command -> error
player nearestObjects [player
Yeah, that's why I said redundency.
So, would vDestroyedVehicle = nearestObje.... work?
Yes.
On how you use this command.
Don't be confused about the similar names. Doesn't mean the syntax is anything like...
Killer kills with gunshot from vehicle with own weapon -> instigator
Killer kills via roadkill -> ?
Killer kills with gunshot -> instigator
Killer kills with grenade -> ?
firer ... vehicle that owned the weapon
instigator ... person that fired the weapon
For roadkills, instigator and firer are both the driver iirc (instigator is null?)
firer = vehicle instigator
instigator = gunner firer (but only if a weapon on the main turret was used)
I'm sorry if this was an annoying question, but these names never really made sense to me
They don't make sense.
I personally would have expected firer to be the actual unit firing
firer ... vehicle that owned the weapon
instigator ... person that fired the weapon
^ these are the definitions. Don't worry about what the names imply.
did something in RV ever make sense?
If this is related to event handlers the names make sense?
Firer - vehicle that "fires" the event handler
Instigator - person who instigated the event handler to be fired
Hm well it kind of does, I would have expected such parameter to be named similar to "TriggerUnit" or something
Or triggerObject
Might make more sense if you know czech.
^^ This is true, might be a slight translation issue.
So instigator is finally the great solution to finding a killer that killed someone via a nade
Which is great
I found it pretty hard to accurately find the instigator prior to this parameter
Haha are you trying to find a why to shame people that forget G isn't gear any more?
( ͔° ĶŹ ͔°)
The instigator can be determined by using the weapon and then iterating through all weapons of the vehicle, thereby finding the turrent and then getting the turretUnit of the turret and vehicle.
The requirement for this is, that the vehicle does not use multiple turrets with the same weapon class. But that is extremely unlikely because the weapon muzzle effects are defined in the weapons class.
So unless you have two weapons that use the same muzzle, you will have unique weapon classes on all turrets
Example is that bluefor transport heli with the two gatling guns.
They are exactly the same, but one inherits from the other to switch the muzzle name for the firing effect.
It's not that hard, but clumsy and now no longer needed
Given an object how would I go by creating another object at the exact same position, rotation etc. as the old object?
Currently using setPos, setVectorUp, and setDir and that order but that does not place the new object at the exact position of the old one
Instead resulting in the new object being placed several meters away from the old one
setPosASL setVectorDirAndUp
That does not do it
New object has the correct rotation and stuff, but is in a wrong position, 2.5 meters away from the original
_new = "Land_i_House_Small_02_V2_F" createVehicle getPosASL _target;
_new setVectorDirAndUp [vectorDir _target, vectorUp _target];
you are not setPos'ing
setPos after createVehicle gets closer, but still 30cm off the original
For me setPosASL has always been exact..
which direction are you 30cm off in? height?
Possibly setPos again after the rotation business
or only do it after
Height is spot on, x,y is off by 25cm
yea that might be caused by changing the normalvector, iirc the position family of commands work off of the contact surface which would move if you change the normal vector
so create, setvectordirandup, setposasl
Noticed a few weapon camo selection changes made in the dev changelog, how do you actually apply this?
I assume with setObjectTexture/Global but havent tried it before
Is the structuredText for cutText actually working this patch?
cutText ["<t color='#ff0000' size='5'>RED ALERT!</t><br/>***********", "PLAIN", -1, true, true];
tried that and no text
@warm gorge theyre just weapon variants like the MX, MX black and MX green
Weapons cant be targeted with texturing commands
Ah I see, so would that mean that this 'Added: Camo selections to all weapons which were missing them' would meann that all the variants would be put in for all weapons then?
Cause I nkow that there are a few missing variants
It generally means weapons can be retextured with a mod
E.g. if an object doesnt have a hiddenSelections it cant be retextured
So what do the hiddenSelections of weapons mean? For example, I just opened up a config of the Mk-18, and it has 2 hidden selections
Nevermind I understand now
You can make a mod where you can change the texture via config instead of having to change the model. If anyone was wondering.
Any reason why this wouldn't work as a condition statement?
(assignedVehicleRole player select 1) != 0
It returns this - https://gyazo.com/25053e32adef8b7ce64c00e00eda81b2
why != 0?
Doesnt look like it returns any numbers.
!= [] might work
Fixed it, second value of array is another array.
What did you change?
(assignedVehicleRole player select 1 select 0) != 0
That still doesnt make sense. Doesnt return any objects unless you are counting them
turret path
Oooohh...
It might return
["Driver"] - Assigned as driver
Why wouldn't it just return nil instead of 0
Becuase ["cargo",[0]] signifies the first FFV slot, normal cargo positions are all returned as ["cargo"]
Ohh...so they are cargo positions.
Special ones - you can't access them using the getCargoIndex command hence the above workaround.
Interesting. I will keep that on the back burner then. Neat workaround
Cheers, thanks for the help. Things become clearer when you discuss.
Indeed.
Turns out that doesn't work anyway - can't use as a condition as if you are in any other slot except the FFV ones you get no result which seems to default to false. I wish BI hadn't used Cargo again for FFV.
What are you doing?
It's a condition for an action in the new vans - making them show up when in certain positions in the van. I need the action not to show when the player is in a specific FFV slot.
FFS i could swear getCargoIndex didn't work for FFV slots.
alternative
My bad - thanks.
It does iirc. If not use the alternative.
Yea it does, cheers. Commy to the resuce as always š
private _allPylons = "true" configClasses (configFile >> "CfgVehicles" >> typeOf _plane >> "Components" >> "TransportPylonsComponent" >> "pylons") apply {configName _x};
Would this also work? ```SQF
{
(vehicle player) setAmmoOnPylon [_x, 10000];
} forEach [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
for the first ten, yeah
What's the max amount of pylons on a vehicle?
for "_x" from 0 to (count (configFile >> "CfgVehicles" >> typeOf _plane >> "Components" >> "TransportPylonsComponent" >> "pylons") - 1) do {
};
Thanks.
oops
edited
This is all under the condition that you can't inherit and add new ones in one class. Which is how it works for turrets.
Of course it needs an object. setAmmoOnPylon does too and each plane has a different amount of pylons.
Each class of plane.
Does anyone know how to create the effect used in the laws of war campaign to start a memory? To be more clear i mean the "bubble effect" around some objects
Open the mission and find out?
that's possible? i going to do that. i thought the files are encrypted until official release
Dougemm made a tool @warm spade
Dont mention illegal tools on here
@hasty violet thats exactly what i searched for, thank you.
Yes, they are not.
Yes.
Well, no
allMissionObjects "WeaponHolder" + allMissionObjects "WeaponHolderSimulated"
@tough abyss this ^ is what you need
They are different classes not inheriting from another
allMissionObjects does pick them up though.
["WeaponHolderSimulated","ThingX","Thing","All"]
["WeaponHolder", "ReammoBox","Strategic","Building","Static","All"]
@indigo snow the tool itself is not illegal...
Hey could someone teach me how to mod Arma 3 please?
look at other people's mods and see how they did it
I tried there is nothing I can use in them
what do you want to make?
Its a bug from starship troopers called Tiger,
do you have the model already?
Yes and the textures
you made them?
a friend
š±
?
Yes there are many things you can compare. Configuration? Structure?
the main problem I am having is with the animations, they need to be a specific file, but you need a model config and this other file that I have no clue how to do them
That is something you can learn from other mods
Any mods with models have a model.cfg
And any of them that have animations have the rtm configurations
If anything else go to #arma3_model. And #arma3_animation
not a lot of people do it, but there are a few
If youre polite about it, Mondkalb might be able to give you some pointers
should I PM him?
ok thanks
_var = [blu001,"saved_variable",nil] call seed_fnc_getVarsTarget;
I made a script that checks for saved varaibles and it allows for default value, but if I use NIL
It seems to throw an error...
How bad is this in terms of functions like this?
explicit nil values are really only allowed in scheduled, iirc
ideally youd just not provide a third entry in your array
Should I worry about fixing that, or is it fine to leave stuff like this up to the user (can't use nil)
Wel i mean it throws an error :P
I'm just contemplating, wether this would be real issue or a overthinking issue
Overthinking
Thanks ā¤
Hmm, who was doing the new inventory?
/*--------------------------------------------------------------------------------------------------
Author: Jiri Wainar
Description:
Returns array with classname of the plain weapon (without attachments), followed by classnames of all its attachments.
Example:
["arifle_mx_f","optic_aco","acc_pointer_ir"] = "arifle_mx_aco_pointer_f" call BIS_fnc_weaponComponents;
Remarks:
* Classnames returned are converted all to lowercase.
--------------------------------------------------------------------------------------------------*/
BIS_fnc_weaponComponents
@peak plover this was added in dev?
Im on stable, just found it in the functions
Oohh..i was going to say, thought i had seen that before. Wasn't sure.
Date on it is 26 april
I keep not finding action menu
I want to move it to the left ( can't edit in in-game hud editor )
Build the mission in a way in which it can be saved
Yes there are many ways
Best to use server profile or db i guess.
How do I clear my debug console? accidentally put a code into check and it is bad:D
@peak plover its stored in some profile. just switch profiles
or figure out wher ein the profile
anyone know why GetInMan EH (when spawned on player) works in SP but when i try MP it doesnt?
nvm
locality issue
:<
@cptnnick#7051 explicit nil values are really only allowed in scheduled, iirc unscheduled*
@peak plover _var = [blu001,"saved_variable",nil] call seed_fnc_getVarsTarget; isn't that just OBJECT getVariable ARRAY?
@peak plover I guess it's saved in a variable in profileNamespace ĀÆ_(ć)_/ĀÆ
You mean retrieve it via script? yes
They are just variables in uiNamespace
*profileNamespace
(profilenamespace getVariable ['IGUI_TEXT_RGB_R',0])
(profilenamespace getVariable ['IGUI_TEXT_RGB_G',0])
(profilenamespace getVariable ['IGUI_TEXT_RGB_B',0])
is the textcolor for example
You can use nil in scheduled and unscheduled.
What you can't do in scheduled environment is:
- use a undefined variable / a variable with value
nil(same thing) - assign CONTROL or DISPLAY to a variable including
_this,_xetc. indirectly by usingcall,spawn,forEachetc. (ARRAY holding CONTROL, DISPLAY are fine) unless you usedisableSerialization;first, which is not possible when using the indirect methodspawn.
Is there a way to find a pylon's max ammo capacity?
Sure.
@still forum
it's overly complicated
// Code begins
params ["_target",["_requested",nil],["_expected",nil]];
// Set ownername for request variable
private _ownerName = "";
private _owner = "";
// If we are on a server it's going to be server
if (isServer) then {
_ownerName = "server";
} else {
// If we are not a server, get player name instead
_ownerName = name player;
};
// Create variable which will be used to send the information to us :)
private _requestVar = format ["seedVarsRequest_%1_%2",_ownerName,ceil random 10000];
// Delete the variable from everyone to make sure it's not used
missionNamespace setVariable [_requestVar,nil,true];
// remoteExec the getVarsSend on target
[[_requestVar],[_requested,_expected]] remoteExec ["seed_fnc_getVarsReturn",_target];
// Wait for response
waitUntil {
private _checkVar = missionNamespace getVariable [_requestVar,nil];
!isNil {_checkVar}
};
// Get the result
private _result = missionNamespace getVariable [_requestVar];
systemChat str _result;
// Delete the variable from network
missionNamespace setVariable [_requestVar,nil,true];
// finish with the result
_result
It's used to grab a varaible from profile namespace of remote clients
// Code begins
lol
Anyone agrees with me that you should put an empty line before the code blocks / comments?
Too.. few.. comment consistency
I will forget about this in a few months, I need to be able to fix it even in 6 months
missionNamespace getVariable [_requestVar,nil];
š¤
// If we are on a server it's going to be server
if (isServer) then {
_ownerName = "server";
} else {
// If we are not a server, get player name instead
_ownerName = name player;
};
These comments both apply to the the same thing.. setting _ownerName. Why is one inside the if scope and one outside? Shouldn't both be inside and indented?
default value of nil doesn't make any sense because nil is already default
Alright, tanks for the feedback, I must admit, new to comments
Instead of having a receive variable and waiting for response. The client could just remoteExec the response back and execute your code that way.. Because this way. If the client doesn't answer your waitUntil loops indefinetly
params ["_target", "_requested", "_expected"];
// Set ownername for request variable
private _ownerName = "server";
// If we are not a server, get player name instead
if (!isServer) then {
_ownerName = name player;
};
// Create variable which will be used to send the information to us :)
private _requestVar = format ["seedVarsRequest_%1_%2", _ownerName, ceil random 10000];
// Delete the variable from everyone to make sure it's not used
missionNamespace setVariable [_requestVar, nil, true];
// remoteExec the getVarsSend on target
[[_requestVar], [_requested, _expected]] remoteExec ["seed_fnc_getVarsReturn", _target];
// Wait for response
waitUntil {
!isNil {missionNamespace getVariable _requestVar};
};
private _result = missionNamespace getVariable _requestVar;
systemChat str _result;
// Delete the variable from network
missionNamespace setVariable [_requestVar, nil, true];
_result
Hmm, so a fallback to whenever something goes wrong so loop is exited
Does this look better?
How about
// Wait for response
private _result = nil; //Does this work? Is the variable still privated to here although nil?
waitUntil {
!isNil {_result = missionNamespace getVariable _requestVar};
};
systemChat str _result;
Yeah. This should be safe. Forgot about scheduled risks.
Well, the syntax is a bit wrong
// Wait for response
private "_result";
waitUntil {
_result = missionNamespace getVariable _requestVar;
!isNil "_result"
};
systemChat str _result;
Oh yeah.. š That's a bit cleaner.
Yours will loop forever.
Yeah^^
_result = 1;
private "_result";
isNil "_result" // false
_result = 1;
private _result = nil;
isNil "_result" // true
Still not needed if you don't use the variable in the same script though.
_result = 1;
call {
private "_result";
isNil "_result" // true
}
There is no initialization in SQF. private sets the variables home scope.
What is in _result on your first example?
Nothing.
But nothing should be true on isNil shouldn't it?
private _result = nil; == private "_result";_result = nil;
I was just pointing out a small difference between private STRING and private var = nil;.
The waitUntil should have a timeout.
@little eagle: can I get a clue?
True, I guess if it does not recieve it's data in a second, it's not coming
Pylon ammo?
Or just take my solution of the client just remoteExec'ing back. Then you don't even need a waitUntil and don't have to worry about timeouts
Yes.
This function is to be used in other scripts. I
Thanks.
I'd have to wait somewhere, why not here
PylonRack_7Rnd_Rocket_04_HE_F
And that is seven rounds.
Was this what you needed?
Sorta.
@peak plover oops.. forgot that you return the result š
Those are just magazines. You can get the ammo count like with any other magazine.
getNumber (configfile >> "CfgMagazines" >> _pylonMag >> "count")
My only hope is that this won't cause traffic when used on client that is the owner of _target
Anyway great many thanks for the pointers and the lesson on comments
You could just add a check if he is the owner. Just to be extra safe
I was thinking ```SQF
_pylon = getText (configfile >> "CfgVehicles" >> "B_Plane_CAS_01_dynamicLoadout_F" >> "Components" >> "TransportPylonsComponent" >> "Pylons" >> "Pylons9" >> "attachment");
_splitPylon = pylon splitString "";
_cfgRndCount = _splitPylon select 1;
_rndCountArr = _cfgRndCount splitString "R";
_rndCount = _rndCountArr select 0;
@tough abyss There is no guarantee that the classname contains the number of rounds
Ahh bollocks!
use commy's method. it works
^ generally good advice.
Ok.
You could just add a check if he is the owner. Just to be extra safe
Wouldn't that require server since owner does not work on clients?
owner does not work on clients?
if (local _target) exitWith {missionNamespace getVariable _requestVar}
Yes, owner does not work on dedicated clients
Ohh, ok. I always figured some form of local exists in remoteExec, but never hurts to be srue
can #include use a macro?
no
š¤¦
#includes are resolved at preprocess. Macros are resolved at preprocess
Includes come first tho. as otherwise it wouldn't know how to resolve the macros that were defined in included files
ughh... What's the difference of using cfgFunctions and preProcessFileLineNumbers
Whats the difference between an apple and a horse?
Can I use #include in cfgFunctions?
#define and MACROS too
..
you can use preprocessor commands.
#include and #define are both preprocessor commands
There is no place where only one of them works
If its a textfile you can use preprocessor commands
Maybe thats a good generalization
If I use #include inside a #include, it does not compute
it does. CBA and ACE do that in every function
or broken path...
broken path probably
depends where your file that #include's is
So I can use it in plugins\seed\ later
..\seed\
So pretty much use .. to go back and that's it?
you can
Instead of headaching yourself you could also just read https://community.bistudio.com/wiki/PreProcessor_Commands
I've done that, I just always thought that "plugins\settings" was going to be the right path
Something I still can't understand
#define PLUGIN_PATHFILE(var2) plugins\##PLUGIN\files\##var2
How on earth does this return a string?
Does that mean I should not do it?
best practice ⢠would be to wrap that in a QUOTE() macro
but arma can interpret
class A {
text = sometext:
};
text as a string
sure
it does not process ## if I do that...
#define QPLUGIN_PATHFILE(var2) QUOTE(PLUGIN_PATHFILE(var2))
you can only use # (quote) on a completed macro iirc
think its a left-to-right reading thing
Ohh, I'm starting to get it now thanks
Any reason this wouldn't work as a condition?
!((this getCargoIndex player) in [0,3,4])
trigger. obviously
but in a trigger this is not a vehicle where a player could sit in
Might be a waypoint, then this is the groupleader
Sorry not a trigger - it's in the condition statement for Class userActions.
class open_driver_door: door_action {
userActionID = 53;
displayName = "Open Driver Door";
available = 1;
condition = "(this animationPhase 'Door_LF' == 0) && ((player distance2D (this modelToWorld [-1,2.2,-1])) < 2) && (!((this getCargoIndex player) in [0,3,4]))";
statement = "this animateDoor ['Door_LF', 1,false];";
};```
Mhm, looks syntactically correct. Do you get an error or does the condition not activate when you add that to the condition?
No error but doesn't seem to activate when true.
Does it work without that bit but with the rest? Does it activate in other seats? If you check it in the debug menu with this substituted for the vehicle, does it return true?
Yep returns true with the debug and works fine without it.
I think it might be the diag config merge. Let me rebuild the whole pbo and see if that fixes it.
Mmmaybe.
Yep that seemed to fix it. Weird.
the actions might be compiled wierd that they dont update with a merge
Yea that seems the most likely explanation.
Hey guys, is there any chance to fix the distancesounds for sirens on Police or Medics ( vehicels )... since maldren its bugged, anyone know? or any hotfix o_o
dynasound?
sirens?
soundfiles for siren or horn
The problem is to change the sound so you can hear it from far away.
its like 60meters and then it just disappear for everyone
Is there a way to read JSON data into game? I'm using extdb for SQL but looking at a new project that would use Firebase as a backend so need to be able to read JSON data.
write your own Extension or use Intercept
you could also enable filePatching and write the data to a textfile and read it using.. readFile? Dunno what the script command is called
loadFile, preprocessFile and preprocessFileLineNumbers
are u intending to use firebase to store "map/player/vehicle" data?
Firebase will serve the web side of the app and also serve as the DB. @brazen sparrow yes essentially - it's a PMC based gamemode/ server where you can create a crew/ company and accept jobs, buy new equipment etc
Web interface to allow gear purchases and contract acceptance. Vehicle setups etc.
I know somone else doing a similar thing, great idea...
@grand berry Sneak previews anytime soon? š
I wish - i'm in concept phase right now. Might just do the full UI mockup first.
Awesome
hey, I made a picture, converted it to PAA (using the correct tools yes) and I got it on my mission, put it in a dialog.hpp file, included it and set style to 2096, and put the picture in text="" but when I run cutRSC to load it, it is just a black square, no picture at all, any ideas?
Is the path correct?
should be, the paa is in my "data" folder so path is text="data\PZH.paa";
Hello guys, what is the most efficient system to display images on an object in game. Directly create a new PBO with the concerned image OR simply apply a texture in the init of the object in the mission.sqm. Thanks.
@compact maple depends on if you are making a mod or a mission. If you are making a mission that doesn't require a mod dependency then don't make a mod for it
@subtle ore Its actually for a life server. So there is already a lot of thing in the mission, my question is, whats the better way between using init or pbos
Unless you are placing this texture on a custom model there shouldn't be any performance difference at.all
Its actually on a big sign (id like to place pub on it)
anyone happen to have on hand what the IDD/IDC for the Zeus map control is?
Also whether there are any eventhandlers/scripted events whenever it gets shown/hidden
@austere granite to find a display : findDisplay yourIDC returns a boolean. Look in the config viewer for the zues rsc stuff. Should be all the way towards the bottom
Not a boolean
It returns the display
!isNull findDisplay 12 will check to see if main player map is open
He asked what the IDC is so he can access it. And you are telling him how to find a display using it's IDC. Completly didn't answer the question
@still forum i answered in part. Read the question again.
nvm
There you go
and there's no "real" event handler, so using a scripted one to check if isNill
was just hoping for a proper one
isNull*
yea all good
you can insert one into the config if you can go mod
^
yea too lazy for that right now, it's purely for debugging purposes anyway so doesn't need to be clean
Or try out the Map eventhandler and check in there
All good, thanks anyway
Are the map and the zeus map different displays or are they considered to be the same? Zeus map shows clickable entities overlaying the map
Different ones
Gotcha
Also the map never actually closes
So if you have (ctrl)addEventHandlers on the map, they will stay if you open and close tha map
Gotta check if Zeus has similar behaviour, but I'm expecting a no
Interesting, thanks for that. Didn't lnow that tid bit.
What language do you use for arma 3 scripting
sqf
its specific to arma
Any way to remove turret on Marshall/Marid/Gorgon?
Yes, there are special animations to hide them
Pseudocode would be this animate ["hideTurret",1,true]
Youd have to look up the animation name in config
That should do it, thanks.
And the second question: Is there any way to make Gunner seat not crewable?
or delete the ammo.
You can lock the turret with lockTurret, remove the magazines in the turret and remove the weapons in the turret
is it possible to select the player object from the server?
I'm trying to handle connections to the server - > Reload positions, etc. Except that I am not sure I can use setPos without having the player object.
Whats the reason drawTriangle isn't in stable yet?
I felt slightly retarded when I read "dev 1.73" and I expected it to be in 1.74 š
lol i thought drawTriangles was like primatives or something
@misty gulch https://github.com/intercept/intercept If you prefer that. Doesn't work with Arma's Anti-cheat though. I don't know what you wanna script for
i am trying to make script to open the side doors for the vans in the upcomong dlc on an altis life server
so far i have
private [ "_state" ];
_state = ( _this select 0 ) doorPhase "door_source_3ā;
if ( _state == 0 ) then {
( _this select 0 ) animateDoor ["Door_source_3ā, 1, false];
} else {
( _this select 0 ) animateDoor ["Door_source_3ā, 0, false];
};
}; ```
will i have to define it in class Actions and call to a function?
im very new to coding/scripting so just trying my best š
If you want to have it in a config for all Van's then yes.
also
private [ "_state" ];
_state = ( _this select 0 ) doorPhase "door_source_3ā;
can be replaced by
private _state = ( _this select 0 ) doorPhase "door_source_3ā;
on the vans their is source 3 and 4 will i have to do seperate functions for side door and rear door?
yes. Except if you always want to operate both with one action
makes sense, tyvm for your help @still forum
You can make one function and just pass the source name to the function as parameter
@little eagle SQF getNumber (configfile >> "CfgMagazines" >> _pylonMag >> "count") _pylonMag is classname, not "pylonN", right?
No.
Then?
PylonRack_7Rnd_Rocket_04_HE_F e.g.
Ah, ok.
The ammo doesn't depend on the pylon slot, it depends on the pylons magazine.
It looks stupid but I think it might work ```SQF
_vehicle = vehicle player;
if (_vehicle isKindOf "Plane") then {
for "_i" from 0 to (count (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "pylons") - 1) do {
_vehicle setAmmoOnPylon [_i, getNumber (configfile >> "CfgMagazines" >> getText (configfile >> "CfgVehicles" >> typeOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons" >> ("Pylons" + str _i) >> "attachment") >> "count")];
};
};
squint maybe..
private _vehicle = cameraOn;
if (_vehicle isKindOf "Plane") then {
private _allPylons = "true" configClasses (configfile >> "CfgVehicles" >> typeOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons");
{
private _ammo = getNumber (configfile >> "CfgMagazines" >> getText (_x >> "attachment") >> "count");
_vehicle setAmmoOnPylon [_forEachIndex, _ammo];
} forEach _allPylons;
};
But it worked š¦
I really doubt pylons have to be named "PylonsX"
They're named pylonsN in the config.
("Pylons" + str _i)
Well yeah, "Pylons" + "1" = "Pylons1".
But as far as I can tell, the name could be anything. And my code doesn't care about the name. It just deals with CONFIG not classnames
idk if the position in the array corresponds with the index in setAmmoOnPylon though.
There is a priority entry too.
_vehicle = vehicle player;
if (_vehicle isKindOf "Plane") then {
{
private _ammo = getNumber (configfile >> "CfgMagazines" >> _x >> "count");
_vehicle setAmmoOnPylon [_forEachIndex, _ammo];
} forEach getPylonMagazines _vehicle;
};
this?
Hmm, I guess. Thank you.
Instead of _forEachIndex you can use _x I think.
The wiki says it works with names and indices.
Eh, no. Those are the mags.
Anyone know how FPS friendly the draw commands (eg drawIcon) are with the Draw event handler for maps?
If you only do it by using https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#Map
Only run it when map is open
i don't think you can cause fps drops on the map...
You can cause fps drops everywhere... Question just is "does it matter?"
Exactly ^
*I don't think FPS matters on the map...
Other than the bug on zeus when you zoom in and game freezes
Yeah fair enough, just read somewhere on the wiki to be careful with using the draw commands. But considering Draw only runs when the map is opened, shouldnt be too bad
@little eagle: your code doesn't work as expected, the amount of ammo doesn't correspond to the max capacity.
Running the code in a Wipeout with the default loadout results in - 8 Falchions, 3 Shriekers HE, 8 Macers, 6 GBU-12s and 1 Shrieker AP.
Actual loadout is - 2, 7, 6, 4, 7.
Yes.
["PylonRack_1Rnd_Missile_AA_04_F","PylonRack_7Rnd_Rocket_04_HE_F","PylonRack_3Rnd_Missile_AGM_02_F","PylonMissile_1Rnd_Bomb_04_F","PylonMissile_1Rnd_Bomb_04_F","PylonMissile_1Rnd_Bomb_04_F","PylonMissile_1Rnd_Bomb_04_F","PylonRack_3Rnd_Missile_AGM_02_F","PylonRack_7Rnd_Rocket_04_AP_F","PylonRack_1Rnd_Missile_AA_04_F"]
1,7,3,1,1,1,1,3,7,1
Well the aircraft ends up with 0 Falchions on the left side, and 8 on the other š
Hmm, I wonder why that is.
getNumber (configfile >> "CfgMagazines" >> "PylonRack_1Rnd_Missile_AA_04_F" >> "count")
1
getNumber (configfile >> "CfgMagazines" >> "PylonRack_7Rnd_Rocket_04_HE_F" >> "count")
7
those work as expected
lol, the pylons indices are 1-10 and not 0-9
š¤¦
Yeah they start at 1 in the config.
That is not how you count with computers.
Yep, arrays start at 0.
Well Lua starts with 1
And everything else for that matter.
As array index
@tough abyss: Lua, among other languages.
The goal is to rearm it the same as would be as default?
Yes.
cameraOn setVehicleAmmo 1;
As if we're doing ```SQF
{
_vehicle setAmmo [_x, 1000000];
};
Uh, so setVehicleAmmo works, but setAmmo doesn't?
Interesting.
setAmmo always only worked with the main turrets weapons, so nothing new.
Heh, I made it a one liner.
C-Tab?
Dunno, I mean the debug console in Arma
cameraOn is essentially the short hand for vehicle player.
But is it faster š¤
Probably, since it's one command less. Not that it matters all that much.
(Darn it, I can't react with šµ š¦ š· š ° š²)
The image is scaled wrongly if the new panels used for pip (vanilla)
I wield the power to add reaction faces.
I don't have dev build
#define IDD_CUSTOM_ARCADE 25
Would this be it?
#define IDD_CUSTOMINFO_FEEDDRIVER 316
ahha
Why not
#include "\a3\ui_f\hpp\defineResinclDesign.inc"
and then use whatever is in the config?
Gotcha now!
With great power comes great responsability.
cameraOn is faster. Because with vehicle player the engine first looks up the player entry in the world and then goes into it to find the vehicle.
cameraOn is a variable right next to player. Very fast to lookup
Dedmen you didn't click the poop.
Aww.
a variable right next to the player
Underrated.
[1,2,3,4,5,6,7,8,9,10] apply {[_x, cameraOn AmmoOnPylon _x]}
[[1,1],[2,7],[3,3],[4,1],[5,1],[6,1],[7,1],[8,3],[9,7],[10,1]]
{
private _ammo = getNumber (configfile >> "CfgMagazines" >> _x >> "count");
cameraOn setAmmoOnPylon [_forEachIndex + 1, _ammo];
} forEach getPylonMagazines cameraOn;
So this should workk too^
afterwards:
[[1,1],[2,7],[3,3],[4,1],[5,1],[6,1],[7,1],[8,3],[9,7],[10,1]]
lgtm
Is it a map?
it's the pip camera
Hmm.
disableSerialization;
_display = findDisplay 46;
_control = (_display displayCtrl 102);
systemchat str _display ;
systemchat str _control ;
_xnorm = safezoneX;
_ynorm = safezonY;
_wnorm = safezoneW/40;
_hnorm = safezone/25;
_pos = ctrlPosition _control;
_pos params ["_x","_y","_w","_h"];
_pos = [
(_x),
(_y),
(6*_wnorm),
(4*_wnorm)
];
_control ctrlSetPosition _pos;
_control ctrlCommit 0
two typo with safezone
Well still does not change anything
Are you sure this is the right control? because the mine display id is not 46.
alldisplays does not show that one and this display is the only one that found the correct control
Try:
private _display = uiNamespace getVariable "RscCustomInfoMineDetect";
Yeah. findDisplay and allDisplays don't work with displays. Only dialogs.
ā¤
Btw do you also know of any way of moving/removing the control that is the addaction pop up in the middle?
default : http://i.imgur.com/NWKX2BR.jpg
Also why did they not make this configurable through custom layouts
is it possible to display a video upon a interface? like lets say i make a tablet and i want the background to be a video?
The tanoa expansion added some functions for that, iirc
@rocky marsh Possible since Arma2. Atleast Videos overlayed over the HUD. On objects is also possible since Arma 3 atleast
But dunno how to on objects. on HUD BIS_fnc_playVideo
Anyone know if there is a way to increase the view distance on PiP renders? By default it seems the view distance fog starts at 1000m.
I don't think so. I would also like to have shadows in pip render š
So im looking for some insite on some scripting. Had an old Arma 2 dayz server and did some scripting on there but it looks like a lot has changed. Wanting to get an Arma 3 exile server and looking for some help figuring everything out on whats best to use and stuff these days. Would love someone to DM me that has some insite/advice and some knowledge on what there doing. Please and thank you in advance.
Did you try the arma 3 exile discord/forums?
Meh looking for a more personal approach. Info from someone that has a server running, or someone that helps with getting servers setup. Looked on some forums last night and the only people to respond arent great with english and want to charge monies for scripting and setup fees. unless they are just trying to scam me. not sure.
A lot of exile servers might operate on a donater / vip basis. That's why it's expected from those communities...
The communities make money, why shouldn't the people helping them get a cut of the action?
Had an old Arma 2 dayz server and did some scripting on there but it looks like a lot has changed Uhm.. No.. Not really
hmmmm. well i guess ill have to do some research then. Thanks i guess.
I'll get you started with the most imporant thing:
https://community.bistudio.com/wiki/param
š
i kind of expect a note from @little eagle on the param page š¤
Look what I found https://gist.github.com/commy2/46d26d9cff33fafec70e181d45a1ffb3
:eyes:
There probably was one, back when
[0,1,2] param [-1,-1] // 0
They wrecked my markdown formatting on Gist.
Shame about KK leaving but that "parting gift" is pretty damn awesome... now to get TFAR and ACRE working across two servers.
His script would work really well with the new Escapade I have in mind.. Screwing everyone.. Thanks KK.
TFAR across two servers is not really a problem
that said exploit just now
It did. I googled for "Other word for exploit" Because people take that word so negativly
Haha very true
Sadly I only remember the stuff about KK that he has messed up recently..
Ok fair enough, his tutorials and site amongst other stuff helped me a lot when I first started playing around in arma.
Shame to see him go, but i can understand why plus he been at this for long time.
Nice workaround to transfer clients to another server.
Only exploitable if people can remote exec code on clients etc and get past scripts.txt etc.
But at the point your server is screwed anyways
Good run, KK.
The Idea to transfer people from one server to the other is very old. And I would have done it the same way as him. I thought about that years ago in A2... But found it too much hassle to go through all the UI stuff. And I know a couple other Scripters that had the same Idea but were too lazy to go through that hassle.
I only found KK's ridiculously weird tutorials useful. Mainly the "Whoās Placing/Deleting Markers?" thingy. If you look at the code your first thought is "What crazy mind came up with this?!"
KK invested a lot of time and patience into Arma that's for sure
Yea i was thinking that - might be worth just asking him for a FTP copy?
archive.org somehow doesn't wanna save š® ends up in an endless reload loop
After all his edits to the wiki and his commitment to the community, he deserves to have his contens put up on the community. subdomain in his own directory
@lavish ocean looks over to you
I think I've got a copy of the site just waiting for it to finish.
Eh it's wordpress, would be best to get a copy of the site from him.
back to the dark ages š
š
I will atleast add new commands from time to time. Which bad explanations and crappy grammar
I don't trust Dedmen, before I realize it I run malicious code on my PC when trying to run a sample for something like drawTriangle
( ͔° ĶŹ ͔°)
Ouh.. Nice Idea :3
Hm, would actually be a good idea to have code to output what things are not in the wiki yet but which are ingame
I think you're doing it by hand atm Dedmen?
Yeah.. Theoretically Intercept could do that automatically though
But I'm to lazy to code that up. I rather do it by hand the few times.
With Intercept we also have a server that always tests Intercept on latest dev-branch. That could also automatically detect and add new commands to BIKI if we really wanted to. Thanks for the idea.
_this resize 0;
š¤
set's _this to empty by modifying the reference. _this = [] would not modify the reference.
But I still don't see the reason
Got a full copy of the site - needs some work to make all pages accessible but that can be done later.
dev-heaven is big. And most repositories are probably password protected
They still have it. If you want your repository back you can contact them
Many links I've found googling have been broken, is all
Fully archived KK site - let me know if anything seems broken.
https://kk.kestrelstudios.co.uk
@grand berry good work!
Does setUnitTrait (e.g. medic, engineer) carry over on respawn or should I re-apply all traits on respawn?
it's end of an era @velvet merlin @still forum @tough abyss yet at last with neat parting gift ...
May he rest well in #end_of_life_arma
inb4 serverclusters
Is the server profile persistant over restart?
yes
mind if I post my issue here?
just do so
if (isServer) then {
addMissionEventHandler["HandleDisconnect",{profileNamespace setVariable[_uid,[(position _unit),(getDammage _unit),(getFatigue _unit),(getStamina _unit),(_unit getUnitTrait "Medic"),(_unit getTrait "Engineer"),(getAllOwnedMines _unit)],false];}];
onPlayerConnected {
{
if(getPlayerUID _x isEqualTo _uid) exitWith {
_player = _x;
_x setPos ((profileNamespace getVariable _uid) select 0);
_x setDamage ((profileNamespace getVariable _uid) select 1);
_x setFatigue ((profileNamespace getVariable _uid) select 2);
_x setStamina ((profileNamespace getVariable _uid) select 3);
if((profileNamespace getVariable _uid) select 4) then {_x setUnitTrait["Medic",true];};
if((profileNamespace getVariable _uid) select 5) then {_x setUnitTrait["Engineer",true];
{_player addOwnedMine _x;} forEach (profileNamespace getVariable _uid select 6);
};
} forEach allPlayers;
};
};
issue is on restart. Everything works whilst in game
saveProfileNamespace; after setVariable
but this is blocking, so better do that with timeouts or something
Okay, letme try this out.
and idk what this offers you over restart: getAllOwnedMines _unit
you cant recover them after restart if you save them this way
I'm not sure why it wouldn't. HandleDisconnect - > Find player info - > Store it in variable with player's uid as string - > Add them back after connect
you can't recover detonation
Like Touch of Bomb and such
objects are not the same after restart
It wouldn't be saving to the object
it's literally just reapplying the values. Which don't pertain to one object or another.
mines = objects
thus after restart they are not there anymore, or if recreated, dont have the same serialization
hey, a probably dumb* question, but what exactly does it mean when this happens```sqf
_hintThis = _array select 2;
hint str _hintThis; // hints: any
then get the nearest object of that type afterrestart (if the mines are recreated)
ok, so when you try to hint a nil or undefined var, it will say "any" then, correct?
yeah
sometimes stuff like <NULL> can happen too I think
yeh
not too sure tho
god damn them undefined vars
kk
anyone know how to check if the pilot of a vehicle has any control over guns (not manual fires)
@tough abyss (gunner _veh == player) && (!isManualFire _veh)
let me check š
Oh wait. Pilot? Pilot never has control unless it's manual fire.
@vague hull No go my friend.
if (isServer) then {
addMissionEventHandler["HandleDisconnect",{profileNamespace setVariable[_uid,[(position _unit),(getDammage _unit),(getFatigue _unit),(getStamina _unit),(_unit getUnitTrait "Medic"),(_unit getTrait "Engineer"),(getAllOwnedMines _unit)],false]; saveProfileNamespace;}];
onPlayerConnected {
{
if(getPlayerUID _x isEqualTo _uid) exitWith {
_player = _x;
_x setPos ((profileNamespace getVariable _uid) select 0);
_x setDamage ((profileNamespace getVariable _uid) select 1);
_x setFatigue ((profileNamespace getVariable _uid) select 2);
_x setStamina ((profileNamespace getVariable _uid) select 3);
if((profileNamespace getVariable _uid) select 4) then {_x setUnitTrait["Medic",true];};
if((profileNamespace getVariable _uid) select 5) then {_x setUnitTrait["Engineer",true];
};
} forEach allPlayers;
};
};
@subtle ore helis like pawnee
saveProfileNamespace is not needed anymore afaik.
Game automatically saves on exit. But might not if it crashes I gues
looks like the pilot remains a pilot and gunner doesn't return the pilot when in the pilots seat @tough abyss
@still forum So what's up then? Can't seem to find what's wrong.
are _uid and so on really magic vars?
Don't use onPlayerConnected use addMissionEventHandler
Okay.
are you really sure _uid is not nil?
Something is really wrong
if (isServer) then {
addMissionEventHandler["HandleDisconnect",{profileNamespace setVariable[_uid,[(position _unit),(getDammage _unit),(getFatigue _unit),(getStamina _unit),(_unit getUnitTrait "Medic"),(_unit getTrait "Engineer"),(getAllOwnedMines _unit)],false]; saveProfileNamespace;}];
onPlayerConnected {
{
if(getPlayerUID _x isEqualTo _uid) exitWith {
_player = _x;
_x setPos ((profileNamespace getVariable _uid) select 0);
_x setDamage ((profileNamespace getVariable _uid) select 1);
_x setFatigue ((profileNamespace getVariable _uid) select 2);
_x setStamina ((profileNamespace getVariable _uid) select 3);
if((profileNamespace getVariable _uid) select 4) then {_x setUnitTrait["Medic",true];};
if((profileNamespace getVariable _uid) select 5) then {_x setUnitTrait["Engineer",true];};
} forEach allPlayers;
};
};
the closing bracket of your exitWith is the one from the forEach
_unit getTrait "Engineer" is wrong as you can see in the syntax highlighting
should be getUnitTrait yep
it's called getUnitTrait like you already did correctly
this cannot work. This is full of errors
Okay, walk this through with me there then.
why do you _player = _x; if you never ever use _player anywhere?
put (profileNamespace getVariable _uid) in a variable
Because originally it was a piece to add owned mines to the variable back after connect
then params it
Alrighty
if (isServer) then {
addMissionEventHandler["HandleDisconnect",{profileNamespace setVariable[_uid,[(position _unit),(getDammage _unit),(getFatigue _unit),(getStamina _unit),(_unit getUnitTrait "Medic"),(_unit getUnitTrait "Engineer"),(getAllOwnedMines _unit)],false]; saveProfileNamespace;}];
onPlayerConnected {
{
if(getPlayerUID _x isEqualTo _uid) exitWith {
private _variable = (profileNamespace getVariable _uid);
_x setPos (_variable select 0);
_x setDamage (_variable select 1);
_x setFatigue (_variable select 2);
_x setStamina (_variable select 3);
if(_variable select 4) then {_x setUnitTrait["Medic",true];};
if(_variable select 5) then {_x setUnitTrait["Engineer",true];};
};
} forEach allPlayers;
};
};
That is atleast syntactically correct
I was going to add that private lol
that private doesn't matter
because there is no upper scope
it is actually useless here
Correct.
_x setUnitTrait["Medic",_variable select 4];
_x setUnitTrait["Engineer",_variable select 5];
the ifs are not needed
Noted.
if (true) then {true} didn't even see that
didnt see the missing bracket ĀÆ_(ć)_/ĀÆ we all got our strengths
in HandleDisconnect _unit and _uid are undefined
tought so too, thats why I asked wether they are magic vars as in some other eventhandlers
The code will receive a number of special variables: ?
Why is it different in the eh?
I understand that
My question is now regarding the onPlayerConnected eh
the ones added with addMissionEventhandler gets the parameters passed in _this
if (isServer) then {
addMissionEventHandler["HandleDisconnect",{
params ["_unit", "", "_uid"];
profileNamespace setVariable[_uid,[
(position _unit),
(getDammage _unit),
(getFatigue _unit),
(getStamina _unit),
(_unit getUnitTrait "Medic"),
(_unit getUnitTrait "Engineer"),
(getAllOwnedMines _unit)
]];
}];
addMissionEventHandler["PlayerConnected", {
params ["","_uid"];
{
if(getPlayerUID _x isEqualTo _uid) exitWith {
private _variable = (profileNamespace getVariable _uid);
_x setPos (_variable select 0);
_x setDamage (_variable select 1);
_x setFatigue (_variable select 2);
_x setStamina (_variable select 3);
_x setUnitTrait["Medic",_variable select 4];
_x setUnitTrait["Engineer",_variable select 5];
};
} forEach allPlayers;
}]
};
]
,false];
saveProfileNamespace;```
remove the false, you cant broadcast the profilenamespace
Posted this in a different channel but here might work just as well
[6:57 PM] Byakko: So I am having some issues with this now that I am getting around to it
[6:57 PM] Byakko: 3 guys at an objective
[6:57 PM] Byakko: name them guy1, guy2, guy3 for example
[6:58 PM] Byakko: place a trigger and edit the settings for it
[6:58 PM] Byakko: what should be the syntax for if guy1, guy2, guy3 die to put as a text message "Guys eliminated" that everyone sees
š
Neat copy paste. fluff off
rude
Hm?
welcome to #arma3_scripting
Anyways, Thanks @vague hull and @still forum For the help!
Trying to work a trigger so that when a group of enemies is killed a chat message pops up saying the objective is cleared. Units named guy1, guy2, guy3 for the sake of argument.
Upon death of all three I want a message such as Dedmen eats bananas with the skin on to pop up in global chat. Worked at following one tutorial online but for some reason using the same syntax is not giving me any results and error messages at that.
Well, despite the changes. It still doesn't seem to work upon restart.
diag_log ĀÆ\_(ć)_/ĀÆ
:/
hahaha
ĀÆ_(ć)_/ĀÆ
AGH! Freaking SQF! Missing a semicolon at the player connected EH
time to start using some IDE
could add a speaker icon next to the name or just change font colours
what i do wrong {_x animate ["terc",1];} forEach ["igrp1_1","igrp1_2","igrp1_3","igrp1_4","igrp1_5","igrp1_6"]; i get every time "Error Generic Error in expression"
animate needs an object and not a string.
thanks
@long hatch You don't only get a "Generic Error in expression" Check the full error report. It first says you what's wrong. Then where. Then prints "Generic Error in expression" for some reason
and it will tell you that it got a string but expected an object
iirc only nil errors something just mysteriously keep it at Generic Error.
animate throws very weird error messages
Nah, count expects bool.
animate returns "nothing"-nil, but nil animate reports vanilla-nil.
count only accepts vanilla-nil or bool, but freaks out for flavored-nils and nothing-nil
The wiki says to use animateSource, could that potentially fix the weird behaviour?
No.
Hm
It's a general thing with all SQF commands.
As a player in charge of an AI group, there are a ton of useful commands. Can you script the AI to utilize these commands alone?
Like, "2 - Watch - North."
Interesting! I use these commands, but didn't realize they were related in this way. So, I can leverage these same commands to have a group leader issue them conditionally?
no, but you can emulate the effects of those commands by script
Hmm... good enough... maybe. How do we force AI to speak lines?
anyone here know if you can create ControlsGroup controls, dynamically ? as I have to do something like
class MessageList: Lega_Phone_RscControlsGroup
{
idc = 9999;
colorDisabled[] = {0,0,0,0};
x = 0.432969 * safezoneW + safezoneX;
y = 0.3856 * safezoneH + safezoneY;
w = 0.14 * safezoneW;
h = 0.2772 * safezoneH;
colorBackground[] = {0,0,0,0};
class Controls {
class Lega_Phone_BackgroundControl1 : Lega_Phone_RscText {
idc = 673;
sizeEx = 0.020;
text = "";
w = 0.12 * safezoneW;
h = 0.2772 * safezoneH;
colorDisabled[] = {0,0,0,0};
colorBackground[] = {0,0,0,0};
};
class Lega_Phone_MessageControl1 : Lega_Phone_RscStructuredText {
idc = 672;
sizeEx = 0.020;
text = "";
w = 0.12 * safezoneW;
h = 0.2772 * safezoneH;
colorDisabled[] = {0,0,0,0};
colorBackground[] = {0,0,0,0};
};
class Lega_Phone_BackgroundControl2 : Lega_Phone_BackgroundControl1{
idc = 683;
};
class Lega_Phone_MessageControl2 : Lega_Phone_MessageControl1{
idc = 682;
};
class Lega_Phone_BackgroundControl3 : Lega_Phone_BackgroundControl1{
idc = 693;
};
};
};
``` to get mine to work.
@ivory vector https://community.bistudio.com/wiki/ctrlCreate
Has anyone here used control type 46 (the menu type that was added with eden) successfully?
Trying to use it in a display and it seems to just be invisible
Yeah ctrlCreate doesnt work for my application, and I would be using it in a forEach, and it just overwrites the last one,.
Why would ctrlCreate not work?
control groups != controls ?
A controls group is a type of control
display ctrlCreate ["RscControlsGroup", idd]
then it wouldnt work in the listbox.
RscListBox
So you blame the system for not working like you expect it to?
Not entirely sure what I'm looking at, is one broken?
Oh the overlap on the bottom message I guess
Seems like you're specifying an incorrect y coordinate for that control
But still plain PITA
Backgroundidc = 673;
Textidc = 673;
for($i = 2; $i < xyz; $i ++;){
class LegaPhoneBackgroundControl[$i] : Lega_Phone_BackgroundControl1{
idc = Backgroundidc + 10;
};
class Lega_Phone_MessageControl[$i] : Lega_Phone_MessageControl1{
idc = Textidc + 10;
};
};
is there a way I can do something like that to autocreate the config ?
No. Also #arma3_config @ivory vector
Does anyone know whether scheduled scripts run in their own CPU threads or not?
Is there a proper, technical reason why they don't @still forum?
Because they can't
Or is it just the old "because BI" again? š
RV engine wasn't made for Multithreading
On Linux the SQF engine might theoretically be able to multithread read-only operations. Still doing testing on that
So the engine architechture makes it hard?
Ie. it's too much work for them to make it threaded instead of running everything in the same thread
Yes.
The whole engine wasn't made to be multithreaded. Changing that would require rewriting most of it
I see
Hi guys. If I need to use a global object to share variables across machines, what simpleObject should I use? E.,g. CBA uses createSimpleObject ["CBA_NamespaceDummy",...] without CBA, which dummy show I use?
youre aware of the existence of publicVariable?
e.g. is there a need for a separate namespace?
Use some building
in general it doesn't really matter
Place it out of view distance and stop caring ^^
im suprised Static has a public scope tbh
It doesn't probably
that's why CBA has a subclass
But maybe it still works? ĀÆ_(ć)_/ĀÆ
nah its a base class
@indigo snow two reasons: 1. encapsulation of data in the same object. 2. avoid cluttering the missionNamespace
nah its a base class Which is what I said?
thanks @still forum. Good idea went to check out the config files
e.g. you won't be able to spawn it if its just a mission
Building is a good one. Scope 1, no model and very cheap simulation
Hey guys, question: does Headless Client recognizes as server in CfgRemoteExec?
Back to making mistakes trying to learn code. Trying to set it so that an objective can be either to steal or blow up an enemy vehicle. Would an easiest way be to set a trigger with an enormous radius and upon the vehicle leaving that area it qualifies as stolen at that point?
And then program objective completion as an OR for either destroyed or outside of the radius of the trigger placed?
Is it possible to give a seperated Gangs/Groups acces to there own Crate? like a box they can fill there own stuff inside and other gangs/players cant?
@opaque jungle If you set the trigger synced to the vehicle and have it active when the vehicle leaves the area, then name the vehicle (e.g. myVehicle) just set the trigger condition to this || !alive myVehicle
It might actually be grouping the trigger to the vehicle that allows you to set that, not syncing it
Then just set the trigger onActivation to run the code for objective completion
@tranquil nymph I tested it with !alive vehiclename OR !(vehiclename in thisList) and it seems to work
http://i.imgur.com/NWfyqIu.jpg
Thanks for everyone who helped a while ago
Finally managed to clean up the tiny loading bars and fix the name /author
@hollow niche using a inventoryopenend EH?
Yes
In combiantion with https://community.bistudio.com/wiki/Arma_3_Actions#Gear Maybe?
Where can voice line class names be found?
CfgVoice, CfgVoiceTypes
They are referenced in directories, not files though.
Every file would be overkill I guess.
how would i remoteExec [0] spawn life_fnc_setKing; to cursorObject? tried [0] remoteExec ["life_fnc_setKing",cursorObject]; but no luck
Hey guys, I am getting a reserved variable in expression error. This is when I amtrying to make a public variable which has a PVAR evh attached. Any ideas why?
one of your variables might have the same name as a command
which word in the script does the error point to?
It doesn't say what variable is reserved
the error will point at a word in the script in the error message
in the RPT its marked with |#|
the error message in your RPT would be of more help
Ye that's what I mean
either way, that error is definitely trying to use a command as variable name
Can anyone help me implement showAANArticle? I think im using the params wrong. Here is the documentation https://pastebin.com/eWVLbih1
I have replaced everything with my own paa and text but it doesnt work as shown š¦
just making sure youre on the dev branch?
Yep
also what errors is arma showing?
I have other functions on dev branch working also. This one is the only one giving me problems
one moment
So when I use it there is no actual errors, it just doesnt work š¤
Im doing something wrong I think
just making sure youre in 3den / have showScriptErrors enabled? check your error RPT file? Try executing it from the debug menu?
a good way to check if the game even tries to run something is to add a diag_log or systemChat just before it
Hey, is there anyone here that knows if it at all possible to move camera while in dialog, as in holding alt and looking around?
I know you can move around, but not enabling freelook
Hi guys, I have a script that counts the driven distance. I want to increase a variable by one, every 100 meters driven. How would I go about that?
have a variable that tracks the distance, if its over 100, reset and increment the counter
or any other similar structure
So just an additional variable for the distance thats only used to be reset
thanks!
id personally save the current position and use that to check the distance against but either works
myvar = myvar + value
if (myvar > 100) then {myvar = myvar + increase;};
@simple solstice
id personally not name the two the same š
dont forget to reset the distance variable back to 0, too, or update the 100 to 200
Can anyone help me set up a simple script? Im trying to set up a timer that can be stopped from a trigger/action
yeah, i got it just needed the idea
if the score is always 1/100th of the distance you could simply divide and round down, too, but it's probably not?
it isnt
When a unit respawns it's name for example my_player_01 is instantly transferred to the new unit from old one?
style = ST_CENTER + ST_VCENTER;
class Attributes {
font = "RobotoCondensed";
color = "#ff0000";
align = "center";
valign = "middle";
shadow = true;
shadowColor = "#ffffff";
size = "1";
};
It's not centered...
How do I center this structured text?
is the control taking up the full size of the thing you want to center it in?
Yes, I have background enabled for this control and it's showing the text on the top algined middle horizontally, but not vertically.
not sure sorry, don't think i've tried to vertically center something
The Issue I'm having
--------------------------------------------
| LOL!
|
|
|
-------------------------------------------
--------------------------------------------
| LOL! LOL! LOL! LOL!LOL!LOL!LOL!
| LOL!LOL!LOL!
|
|
-------------------------------------------
I want it to be
--------------------------------------------
|
|
|
| LOL!
|
|
|
-------------------------------------------
you could do it manually with https://community.bistudio.com/wiki/ctrlTextHeight
(with script)
but yeah not sure how to make ST_VCENTER work
That's not going to work because text is dynamic
I can't do count _text as well because it's different size for all clients...
I'll try with ctrlTextHeight and see if I can just adjust the control instead
either would work with dynamic text i think?
If I use that example, it will always be exact same height misalgined from the top. This means bigger texts will be alinged to bottom instead
hmm u sure?
i think it's just adding a line to the top to use as 'padding'
oh nvm... he means manually set the size to adjust i guess
@peak plover thanks! i will try it š
Yeah the padding line is a BLOCK that blocks š
ctrlTextHeight works wonders 'tho
Thanks @vapid frigate
np
should make it official ... i got too much time ...
my current tiny project: https://media.discordapp.net/attachments/327214464497614850/349035081278554125/unknown.png?width=900&height=474
that is pretty much all the tiny SQF emulator can do for now ...
but it is only 5h old
š®
maybe will make it to a full emulator ... more or less a requirement for another project
and some other ones too
next thing on the list is variables
Damn, isn't that like building everything from scratch?
also thinking from educational side
never created a stack based language before
so ... it has benefits
i ... think
but yes
all is done from scratch
the stack itself is no problem btw.
the parsing of the commands is
What if you end up accidentally making whole arma from scratch?
impossible as i do not plan to add a rendering part
just dummy end points for those
eg. draw3d would have a dummy endpoint
doing just nothing
in the end you could then just load your SQF files into the emulator, that is providing you a simple interface to trigger various events etc.
thats how i would imagine the whole thing in the end
but now, all it can do is + - * / and diag_log to console
and it is not very good in understanding what you want š doing 1+2 will break it currently as the parse function requires space separation for "tokens"
Very cool
I wonder if it's hard to move from SQF to like C or sth to do simple exec...
if you only ever did sqf ... yes
A little bit of python, but mostly SQF...
if it ever works to the extend, that most things work, i might create a bot for the discord
AI pilots enter helicopter, engineon script turns it over. A load and a hold waypoint follow right on it, on a helipad, with a trigger that clears when the fireteam gets in.
Instead, the pilots get in and immediately climb to 20m or so.
Bluh. I know im missing something.
So you can use the bot to parse stuff and it will throw a return ? woah
@manic sigil
I think ```
If you order get in to a helicopter that is landed. The helicopter sometimes takes off
If that's the case, just workaround by setting fuel to 0 until it's allowed to takeoff
But i want the engine running, the whole scenario is a quick reaction force getting called up :/
How about disableAI or enableSimulation false for pilot
Hrm... im already futzing with locking the chopper, locking the pilot in place is just a step to the left. Imma try it.
Testing looks good, didnt know if i should use enablesimulation or -global so i did both.
global is used only on the server, does it for ALL clients
Normal one is used anywhere and only does it to the machine that executes the command
You want to do that one on whatever you host your ai on OR just use global
Yeah, global and local is one of many of my coding weaknesses >_< thanks tho, seems ive got a handle on my helicopter controls.
setVariable ["var",value,true]; // global var
Does that trigger publicVariable eventhandler
It should. Probably does.
is there a object always owned by server that I can use as refference for remoteExec
you want to execute code on server?
Yes
You know that you don't have to pass an object to remoteExec do you?
Yes