#arma3_scripting
1 messages · Page 440 of 1
yes @little eagle i know, there is not mention of if it works in multiplayer, and this is a place for asking about scripting questions.
How does adding items to containers locally even work?
It says Arguments Global, Effects Global top left on the page!
@strange urchin How would it not work?
Global works by adding it. And telling everyone that you added it.
If you just don't tell anyone it will be local only
Does it stay local if someone takes it or places it?
How would someone take something they can't see
If you take it out and put it back. putting it back would use the in-engine "player added item to box" which is global
@strange urchin Did you ever play Arma II ?
I did some
Maybe you got lucky, but a lot of the less "polished" mission and scripts from the community back then had severe MP issues with crates and weapons/magazines.
So I guess it’s only good for ensuring only a particular player can take something
I can't remember the details exactly. But was not uncommon say for people to have a "resupply" script refilling equipment in crates regularly. Problem was they were run at the same interval, but when people JIP'ed their refresh time was different than the servers. So sometimes a crate would look full, except you couldn't grab anything, and when the server had been running a while, they had widely different content from player's perspective.
I don't know how it works nowadays, but if it is still like this, then you the server to also has the item you only want a particular player be able to take.
It is different, from items that are local on the player. When dropping those items they become global (at least they did).
But since BIS made a lot more *Global commands, these problems are mostly gone. Now the problem is duplication instead.
Yeah, I’ve seen that happen when assembling things from vehicles
Just never use those addXCargo commands, instead of the Global variants.
addWeaponWithAttachmentsCargoGlobal 😁
Then there is no problem. The not global variants should be disabled tbh.
Eh, it follows the conventions
I also recall being somewhat similar issue with BIS arsenal export script. It exports a list of commands right? And then you were supposed to dump it into init.sqf or the initiation line of the unit. And then it worked properly in the magical BIS world who knows only SP?
@lone glade found the bug with my profiler
case 0x0: {
returnCode = coreSigned ? security_class::core : security_class::self_signed;
};
case CRYPT_E_NO_REVOCATION_CHECK: ...
->
case 0x0: {
returnCode = coreSigned ? security_class::core : security_class::self_signed;
}break;
case CRYPT_E_NO_REVOCATION_CHECK: ...
Can you see it?
That's how you turn a "all working beautifully" into a "revocation check failed"
well atleast that was one bug. I'll just hope it fixes the profiler.
I could go home in 2 minutes.. Or I'll look into why the profiler doesn't work.. 🤔
take a look at it in 2 mikes, after you will be at home 👌
too late
also I can't properly dev at home
since yesterday only with half broken visual studio and trackpad as mouse
I'm casting a wide net here. i'm trying to develop a script that allows multiple players to control the various positions of a UAV/UGV, namely (driver/gunner). Anyone tacked anything like this? More context about what i've done thus far can be found in the this ticket... https://feedback.bistudio.com/T128006
Perhaps you can remoteControl one of the UAV AI or something
Request: Add a new command that returns if a unit is being remote controlled or better yet, states who is remote controlling said unit. (Preferred)
for the first partisUAVConnectedalso maybe some workaround for the second withgetConnectedUAV
@sand pivot
those return false and null respectively when using remoteControl by itself. My assumption here is they query a variable set by default UAV actions such as UAVTerminalMakeConnection
Yes. Probably the best solution is to use addVariable to keep track of who is controlling the gunner
Store a reference to the player’s object
And in case they disconnect, use isPlayer
right, i thought of that, hard part is if they switch between controlling the gunner/driver, i can't update it without some clever scripting utilizing an event hander. Only EH i've found that event tracks this seat switch action is the mission EH "PlayerViewChanged"
You can intercept when they try to switch from the action menu
Though, I’m not sure about the UAV menu
how can i intercept the base action?
i'll run with that a little thanks. that might allow me to update the variable i set
Be careful about using the display text of the action
If you try to check that, players playing in another language might be able to bypass
You can look at the stringtable arma used and just compare the action’s text to the localized text of whatever switch to gunner is
gocha, yea i know the action name via https://community.bistudio.com/wiki/Arma_3_Actions#SwitchToUAVDriver
Oh, there’s a classname-like thing? That makes it simpler
Just make sure you don’t try to set uieventhandler multiple times
Because they overwrite eachother
roger. this is extremely helpful. thank you!
@lone glade can you test the profiler when you have time? Turns out it was a revocation failure. The revocation list expired on 3rd December and I didn't have auto renew. Shouldn't actually prevent it from working. But maybe it did
Nvm. Scratch the maybe
https://github.com/intercept/intercept/blame/master/src/host/extensions/signing.cpp#L314
A OFFLINE fail would just exit the switch and return the default returnCode. Which is unsigned.
Was fixed on Intercept master branch but I guess that didn't make it into release
My standalone cert tester accepts the cert ¯_(ツ)_/¯
i'll test it later today, I need to get around fixing that case sensitive check, i'll compare findif vs count for that
is there away to make an addaction run another action? For example what I mean is take for example the advanced rappelling mod. Now Im pretty sure that theres no keybinding for it but the way u activate the rappelling is by gonig to a edge and using the action menu. So my idea was to make an addAction that would have a keybinding using the shortvut parameter(i think its #7) which would then in turn run the rappel action
that should help u
`While {
{_x in JNF_GovHeli2} count units group JNF_GovGrp0 > 0;
{_x in JNF_GovHeli2} count units group JNF_GovGrp3 > 0;
{_x in JNF_GovHeli1} count units group JNF_GovGrp1 > 0;
{_x in JNF_GovHeli1} count units group JNF_GovGrp2 > 0;
};
do {
JNF_GovHeli1 setposATL [(getPosATL LandingZone select 0), (getPosATL LandingZone select 1), getPosATL LandingZone select 2];
JNF_GovHeli2 setposATL [(getPosATL LandingZone select 0) + (30), (getPosATL LandingZone select 1) + (30), getPosATL LandingZone select 2];
JNF_GovHeli1 flyinheight 0;
JNF_GovHeli2 flyinheight 0;
};`
Ah. Nice
Can someone please help me with my terrible syntax?
so I need to make it 1 condition?
u dont need a semi colon for the while I believe
While {
{_x in JNF_GovHeli2} count units group JNF_GovGrp0 > 0;
{_x in JNF_GovHeli2} count units group JNF_GovGrp3 > 0;
{_x in JNF_GovHeli1} count units group JNF_GovGrp1 > 0;
{_x in JNF_GovHeli1} count units group JNF_GovGrp2 > 0;
}
``` I believe this is wat dedmen ment
and then u have the rest of ur code
@wary vine it happned to me as well XD
Ahhh I see now, thanks!
been trying to use in the in built debug console in the editor
While
{
{_x in JNF_GovHeli2} count units JNF_GovGrp0 == 0;
//{_x in JNF_GovHeli2} count units JNF_GovGrp3 > 0;
//{_x in JNF_GovHeli1} count units JNF_GovGrp1 > 0;
//{_x in JNF_GovHeli1} count units JNF_GovGrp2 > 0;
sleep 1;
}
do
{
JNF_GovHeli1 flyinheight 0;
JNF_GovHeli2 flyinheight 0;
};
Group JNF_GovHeli1 addWaypoint [[0,150,0],0];
sleep (random 2);
Group JNF_GovHeli2 addWaypoint [[0,150,0],0];
JNF_GovHeli1 flyinheight 150;
sleep (random 4);
JNF_GovHeli2 flyinheight 135;```
So, my intention -
helicopter is on the ground with rotors spinning stationary.
they are full of 4 groups
When everyone is out of both helicopters - i want them to leave, but until then stay on the ground
so it is immediately moving onto the next bit of code
thanks, learning all the time
huh? did I get mentioned in here?
yeah. Spammer. repeated offender. FM removed him
i have a holdaddaction with a long duration, how do you stop the action menu from fading out?
when you will use hold action, do not open scroll menu 😀
do the use actions 1-20 under custom controls have DIK keycodes?
🤔
_cfunctions = ["Lega_Market","Lega_core"];
{
_functionConfig = "true" configClasses(configFile >> "CfgFunctions" >> "Lega_Market_Functions" >> _x);
{
private _function = format ["lega_fnc_%1",configName _x];
publicVariable _function;
}forEach _functionConfig;
} forEach _cfunctions;
``` this is the contents of my serverside pbo, its working to an extent, I am however having issues where I have to log in / out / then in again for some functions to load
Best way of deleting from an array during iteration?
_array set [_forEachIndex, nil];
I mean a specific element.
Odd. Lag.
Msgs not together. Must have crappy phone signal
So I do a forEach on an array. Do some stuff based on that element. Then if condition is correct I want to remove it.
I didn't say it was
Why are you always so...you? 🤔
You're always so aggressive.
Thank you for the help tho.
I'm not very patient at 9PM when I should be sleeping for over an hour
Someone able to help me with some dialog GUI?
your problem is already visible in the highlighted syntax @drowsy axle
Would you be able to point it out to me? @queen cargo
action = "
closeDialog 0;
[
player,
"<t color='#636e72'>-- <t color='#6c5ce7'>Commander Menu: <t color='#e17055'>Choose<t color='#636e72'> --",
player createDialog "CAPCommMenu_dialog";
] call C_fnc_giveAction;";```
guess why you got that weird non-string coloring
unescaped "
lemme repeat: unescaped
There's no ""'s missing
to escape, you have to use double quotas
Right is that on both sides?
and a " in a string HAS TO BE escaped
"" ""
no ...
"i contain a quota " and this is broken" ```
"i am correctly escaped "" and contain a single quota"```
Wouldn't that have two strings and not one whole string?
" is the start of a string
and the end
everything inbetween " and " thus is contained in the string
naturally, a " in the string thus will break the string
to solve this, you escape thje quota
to escape quotas, you use them twice in arma
thus an escaped, single quota is ""
"foo "" bar" --> foo " bar
Ya know what. I'm just going to use addAction instead of my shitty attempt at GUI's
action = "closeDialog 0; [player, ""<t color='#636e72'>-- <t color='#6c5ce7'>Commander Menu: <t color='#e17055'>Choose<t color='#636e72'> --"", player createDialog 'CAPCommMenu_dialog';] call C_fnc_giveAction;";```
as long as your actions code is correct, this wil work
"'you', 'can', 'use', 'single', 'quotes', 'inside', 'double', 'quotes','tho'"
Do single quotes = a string?
yes, but in your case you cannot
because you want to use a string in a string
which means you will have to escape anyways
regardless of which quotas you use
afaik even notepad++ have syntax highlight 🤷
else, it's only notepad 😄
😀
Can I do the following?
fn_addAction:sqf param [_obj,_text,_script]; _obj addAction [_text, {_script}];fn_AddItem:```sqf
param [_classname,_item,_by];
player addItemToBackpack _classname;
hint format ["You have been given: '%1' by: '%2'.",_item,_by];``````sqf
_addAction_giveItem_1 =
[
player,
"<t color='#55efc4'>GRANT: <t color='#2d3436'>Command Access",
["alive_tablet","ALiVE Tablet","AI Commander"] call C_fnc_addItem;
] call C_fnc_addAction;
_removeAction_addAction =
[
player,
"<t color='#d63031'>DENY: <t color='#2d3436'>Command Access",
player removeAction 0;player removeAction 1;
] call C_fnc_addAction;```
you need check wiki for param and params
Have I done something wrong?>
yes
They should be right
check wiki
it should be params, correct?
yep
Sweet. Someone else told me that params are [[, , ,],[, , ,],[, , ,]]. Hence why I used param
I cannot do two calls inside each other 😦
yes someone lol
[
player,
"<t color='#55efc4'>GRANT: <t color='#2d3436'>Command Access",
["alive_tablet","ALiVE Tablet","AI Commander"]|#| call C_fnc_addItem;
] call C_fnc_addAction;```Error at |#| for missiing ]
😢
ArmA makes me sad sometimes
Anyway. I can pass ["alive_tablet","ALiVE Tablet","AI Commander"] call C_fnc_addItem; as a string, and more importantly, out again?
@drowsy axle at least remove ;
well you can _unit call tag_fnc_top call tag_fnc_kek; 🤷
top kek @meager heart
fixed*
New to the group boys. ...and girls. Any of you use GIT for workflow?
@frank vector I do
Okay, that's what i use too. New to Arma3 scripting. It's been a promise
@drowsy axle
[
player,
"<t color='#55efc4'>GRANT: <t color='#2d3436'>Command Access",
["alive_tablet","ALiVE Tablet","AI Commander"] call C_fnc_addItem /* ; */
] call C_fnc_addAction;
lol fail lou
I don't understand @winter rose However, I knew WHICH ; you was talking about.
Performance wise, would it be better to addAction and removeAction when not in use (1second delay between checks) or should i use the condition flag in the addAction
@drowsy axle
remove it, since you want to use the result with C_fnc_addAction
a ; stops the statement and creates another
Ah true. But that doesn't stop the missing ] before call
I could just execVM "fn_addItem.sqf";
oh wait it still needs [] before it shit god damn arma
I could move the function inside the addaction
[
player,
"<t color='#55efc4'>GRANT: <t color='#2d3436'>Command Access",
player addItemToBackpack "alive_tablet";hint "You have been given: 'ALiVE Tablet' by: 'AI Commander'.";
] call C_fnc_addAction;```
sjhitttttttt
still a fucking []
😢
I could just hint the damn things fuuuuuuu arma
finally..
ooor go with intermediate variables if it is too imbricated
a readable code is coder's friend
or sanity's
which ever
Do you mean?```sqf
_script = blah;
[
player,
"<t color='#55efc4'>GRANT: <t color='#2d3436'>Command Access",
_script;
] call C_fnc_addAction;
making a function of a function... lol
C_fnc_callAction
actually THAT wouldn't work... 😦
I give up
did you tried to check wiki, for anything from what you was using in that ^... thingy, Capwell ?
you keep putting this semicolon… your syntax is the first thing that -must- be right, you will hopefully) see the other errors easier
@drowsy axle , would C_fnc_addAction happen to take code as a third parameter?
if so, code is represented between { these thingies }, hence the correction:
[
player,
"<t color='#55efc4'>GRANT:</t> <t color='#2d3436'>Command Access</t>",
{ player addItemToBackpack "alive_tablet" ; hint "You have been given: 'ALiVE Tablet' by: 'AI Commander'."; }
] call C_fnc_addAction;
probably need write that function too 😄
fnc_addAction:```sqf
params [_obj,_text,_script];
_obj addAction [_text, {_script}];
C_fnc_addAction = {
params [
["_unit", objNull, [objNull]],
["_string", "", [""]], //--- what for _string ¯\_(ツ)_/¯
["_code", {}, [{}]]
];
_unit call _code;
};
so code
did you checked wiki for params ?
if yes you know that this is [variableName, defaultValue, expectedDataTypes]...
🙄
:/
@drowsy axle Well thats a strange question, you should read call|spawn|execVM
.......
https://community.bistudio.com/wiki/Category:Scripting_Topics is an excellent starting point really
people need to understand that read the wiki is one thing. Understanding what the wiki means in a certain context isn't always clear.
https://gyazo.com/6351208b2570f0e1b8fd3b838df1684d is this handled by engine ?
i have been looking through the gui scripts , but cant find anything
Bahadur is handled by himself
What are you trying to do?
I was going to make an id system, using the players face
Is: ```sqf
C_fnc_addAction = {
params [
["_unit", objNull, [objNull]],
["_string", "", [""]], //--- what for string ¯_(ツ)/¯
["_code", {}, [{}]]
];
_unit call _code;
};
-- fn_addAction.sqf:
this:```sqf
params [
["_unit", objNull, [objNull]],
["_string", "", [""]], //--- what for _string ¯\_(ツ)_/¯
["_code", {}, [{}]]
];
_unit call _code;```
or:```sqf
params [
["_unit", objNull, [objNull]],
["_string", "", [""]], //--- what for _string ¯\_(ツ)_/¯
["_code", {}, [{}]]
];```
or this:```sqf
C_fnc_addAction = {
params [
["_unit", objNull, [objNull]],
["_string", "", [""]], //--- what for _string ¯\_(ツ)_/¯
["_code", {}, [{}]]
];
_unit call _code;
};
No idea what that has to do with the identity menu.
I want the face part xD
Oh, the rotating face?
yus
it uses RscObject , but I tried duplicating the face into a dialog, nothing happens, and there is nothing within the script that goes with the display that I can see
Most menues are hard coded. Outside 3den.
3den has some scripted menues, but the main menu, settings, etc. is all hard coded.
@wary vine d read up for about 600+ hours...
Idk if, and if idk how.
maybe something in ui_f about that head 🤔
No.
i have looked xD
class objects
{
class Head: RscObject
{
model = "\A3\ui_f\objects\face_preview";
modelWoman = "\A3\ui_f\objects\face_preview";
idc = 109;
type = 80;
x = "35.8 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "6.6 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
z = 0.38;
xBack = 0.75;
yBack = 0.9;
zBack = 0.25;
scale = 0.21;
direction[] = {0,0,1};
up[] = {0,1,0};
faceType = "Man_A3";
selectionLBrow = "lBrow";
selectionMBrow = "mBrow";
selectionRBrow = "rBrow";
selectionLMouth = "lMouth";
selectionMMouth = "mMouth";
selectionRMouth = "rMouth";
selectionEyelid = "eyelids";
selectionLip = "LLip";
boneHead = "head";
boneLEye = "l_eye";
boneREye = "r_eye";
boneLEyelidUp = "eye_upl";
boneREyelidUp = "eye_upr";
boneLEyelidDown = "eye_lwl";
boneREyelidDown = "eye_lwr";
boneLPupil = "l_pupila";
boneRPupil = "r_pupila";
selectionPersonality = "personality";
selectionGlasses = "eyelids";
};
};
only thing I can find.
\A3\ui_f\objects\face_preview seems to be the p3d yes
tried it xD
you could try createSimpleObject to check (I think it werkz)
maybe a createVehicle "Head", I really don't know
glhf
Gunna do a work around.
https://gyazo.com/785e6fcb226a092c6b6589146261a9d5 why the fuck does that freak me out.
@wary vine Play with setMimic to get more freaks for yourself.
Well anyways, that's still better than any Mass Effect Andromeda facial expressions.
@wary vine not sure about the model for head but im doing a rotating obj rn. Here's the rotated code if interested
while {ctrlShown _modelCtrl} do
{
_vectorDirAndUp = ctrlModelDirAndUp _modelCtrl;
_vectorDir = _vectorDirAndUp select 0;
_newVector = [_vectorDir,0.5] call BIS_fnc_rotateVector2D;
_modelCtrl ctrlSetModelDirAndUp [_newVector,(_vectorDirAndUp select 1)];
sleep 0.02;
};
A little advice to use sleep (1/(diag_fps min 60)) as a basis of rotation delay (change values for smoothness) instead of sleep 0.02as its twitching a bit.
the twitching only happens when recording (my processor is shit) but im sure that way is better so ill use it, ty
I'm glad I wasn't here last night. Some people just never learn and refuse to read wiki.
It will always twitch because sleep 1 means sleep 1+ seconds, not sleep 1 second and diag_fps or any other command will not fix it.
what would be the best way to determine whether a given object (can be a building or a vehicle) has physics? I feel like this should be a simple solution, but I can't come up with anything short of detecting whether the position/velocity changed at all, which would be unreliable
actually I could probably use isKindOf, but I'm a little concerned if I use a certain parent class that not all static objects inherit from it
getText (configFile >> "cfgVehicles" >> typeOf _vehicle >> "simulation")
probably?
private _sim = getText (configFile >> "cfgVehicles" >> typeOf _vehicle >> "simulation");
private _hasPhysics = (_sim select [count _sim - 1, 1]) == "x";
that would be that then
perfect, that'll do the trick - thanks!
in other news, for those aware that _obj setPosASL (getPosASL _obj) will move objects around when they are in a slope (which, imo isn't exactly intuitive), I just came up with a workaround
apparently you have to reset the orientation of the object (direction and vectorUp) before moving it around, meaning you can do this:
_obj = cursorTarget;
_vecF = vectorDir _obj;
_vecU = vectorUp _obj;
_obj setVectorUp [0,0,1];
_obj setDir 0;
_pos = getPosASL _obj;
_obj setPosASL _pos;
_obj setVectorDirAndUp [_vecF, _vecU];
which will not move the object
this is useful for mission persistence where you want to save objects that players placed or used (whether it's structures or vehicles) and you need them to spawn in precisely at their previous position
^ oor, or you use posATL instead of ASL
tried that, even _obj setPosATL (getPosATL _obj) moves stuff
anyhow I'll try and implement it into kp_liberation to see if it helps with player built FOBs getting scrambled upon mission restart
does setPosWorld also move stuff?
well, TIL getPosWorld is a thing
what do you mean move, you mean the object get rotated?
I'll give that a shot see if it also affects orientation
no, with getPosATL and getPosASL the object moves in space, usually down the slope that it is placed on
orientation seems to remain unchanged
eeerm... that's normal tho
in hindsight it makes sense, since the position that is fetched with getPosATL/getPosASL moves with the orientation of the object
it didn't make sense until you pointed out that getPosWorld exists
worldPos format was made long after ATL / ASL / AGLS
so yeah, I guess that's another trivial issue sorted out 😛
getPosX just reports a three dimensional array. setPosX is what adjusts the object to the terrain.
it doesnt make sense
_obj setPosASL (getPosASL _obj) shouldnt move it
but when it's pitched/banked it will
sure but the getter and setter should use the same coordinate system
They do.
they do ^
getPos / setPos don't though.
getPos is such a shit command
yeah, that's what I meant - getPosATL/getPosASL seems to fetch a point that is not at 0 height above ground, but rather somewhere in the middle of the bounding box (?), which means when the orientation of the object changes (relative to the ground contact point), there is a lever arm between the two points, meaning the object moves
I could totally draw this on a whiteboard but I can't put it into words
you don't like the AGLS format? huehuehue
i like it less than you like atom
AGLS is worse than ASLW because people use it at least 😄
Cre8or, it's a point of the LandContact LOD. Middle of the object is World.
myeah, I knew I had that wrong, I was just hoping to get the point across
World should've been named ModelCenter.
Real_*_Final2
modelToWorldModelCenter would've made more sense than modelToWorldWorld.
best command ever 😄
hahaha what, that's a thing?
It was supposed to work like setPosWorld does now.
@austere granite Which? That doesn't suck? sure. But I think that returns same as getPosWorld or modelToWorldWorld
modelToWorldWorldVisialWorldWorld 😔
good post
thank you
😢
What gives?
This is the object
For some reason
I can't get the type of this object
I want to re-create this object via script
How do I do it?
Some terrain objects simply don’t have classnames, if that makes sense
How do I re-create it? via createVehicle
That’s why we have things like “ROCK”,”ROAD” when finding terrain objects
I am doing a script
That will save and re-load the AO
I want this fence to be reloaded as well
How do I createVehicle this fence without knowing it's callsname?
So no typeOf cursorObject?
But simple objects don't have damage
How do I create it and maintaing ability to handle damage?
Well if it has no classname - you can't, I don't remember something else that creates it by a modelpath.
damn
Anyways that's strange, since missing classname is kinda a property on terrain-like only objects..
Well, that’s what makes them terrain-only, right?
Still the same vehicles.
Just take a look here https://community.bistudio.com/wiki/Arma_3_Assets
Wud be annoying if it's reloaded and can't be destroyed (simple object)
Wud be slightly less annoying if it's broken the 2nd time I play it
It's an automatic script
I'm not gonna look for a replacement for every single object LMAO 😄
Or even every type
I don't even get what's the cruel plan you are building there 😄
Basically
It's a round based mission
Every round the map resets
So you don't have to reload the mission
So you process and replace the basic map objects?
Start with only mission objects, but I soon realized I need to do map objects as well
I don't do roads or bushes, but mostly everything
Well thats huge work there
not really
I'd be better creating a map with terrain stuff and then make SQM based on your assets chains.
maybe you can try something with objectID 🤔
?
I don't even know how to grab objectID
I'll just save the ones that are not typeOf '' and that'lld have to do... until something better appears like simple objects with damage 😮
you can check it from the editor
simple objects will never be so
No, it's automatic
thats why they are simple
no
😦
😭
😄
nerd
I'm making other cool stuff happen :3
intercept less-simple objects wen
createLessSimpleObjectABitPlease
Man I was hoping there was another command to create shit with p3d, but nah. I guess simple objects are also the only way to use mission specific models
createLessSimpleObjectABitPleaseWorldVisualWorld 😭
Intension of simple objects was to create some background environment, so no one ever touches that, like for cutscenes. This lessens the load on actual mission.
Yeah
Well
They are fine for stuff that are not fences that you can run over
Like rocks
That will never simulate
As been told its just easier to ignore that, either to create own map.
Or in certain gamemodes like dayz-alike-copies that don't neccesarly require you do destroy buildings. So you can have bigger towns etc.
btw is that sahrani map, nigel ?
yes...
or there are the same...
gate Land_plot_zed_drevo1_branka and walls have no classnames 😀
@lone glade https://s.sqf.ovh/Brofiler_2018-03-27_17-03-14.png I'd say that's lookin good. The list bottom left has some problem with _ though.
And I need to find a way to get shorter names. Instead of always displaying the full file path
split \ arraypeek
EZZZZZZZZZ
although that's super confusing, because 500 same function names
I only have the post-preprocess code and filepath of the script function. And I somehow need to get a readable name out of that
If your script has scriptName in it then it'll work. But CBA only does that in debug mode. So I have nothing to hold onto if you run CBA in release mode
https://s.sqf.ovh/Brofiler_2018-03-27_17-21-14.png Good enough for today.
Can also immediately see how much of a certain frame is spent running unscheduled scripts
the big green areas in the framelist on top is CBA_fnc_cachedCall. Quite heavy when it actually has to reload the data.
that looks sexy! 😃
You look sexy
thanks man, so do you ofc 😁
noice!
looks 👌
how can you get the magazine objects from reloaded EH? or how can i get the new/old magazines based on mag ID?
there is no magazine object
Dedmen, you mean ACE_common_fnc_cachedCall?
uh jup
I already know how I'll get better names out of that. So that I don't make such mistakes again
amarite in saying you need true; at the end of a keyhandler ?
No.
o.O
its not working for me.
_display displaySetEventHandler ["KeyDown", format ["_this call %1",_keyPressed]];
_display displaySetEventHandler ["KeyUp", format ["_this call %1",_keyReleased]];
_keyPressed = {
params ["","_dik","_shift","_ctrl"];
if (_dik isEqualTo 42) then {Lega_Plantables_Setup_Shift = true};
if (_dik isEqualTo 29) then {Lega_Plantables_Setup_Ctrl = true};
};
_keyReleased = {
params ["","_shift","_ctrl"];
if (_dik isEqualTo 42) then {Lega_Plantables_Setup_Shift = false};
if (_dik isEqualTo 29) then {Lega_Plantables_Setup_Ctrl = false};
};
Where is this executed from?
You sure _display isn't just null?
I said, are you sure _display isn't null. Not if the display is shown. Use systemChat str to confirm / debug.
Btw., you should just use:
_display displayAddEventHandler ["KeyDown", _keyPressed];
_display displayAddEventHandler ["KeyUp", _keyReleased];
because what you're doing now hurts physically.
that doesnt work for me ?
_display displaySetEventHandler ["KeyDown", _keyP>
18:17:40 Error position: <displaySetEventHandler ["KeyDown", _keyP>
18:17:40 Error Type code, expected String
Also, do the systemChat str thingy, not just try things blindly.
@still forum whoa that's very cool
setObjectTextureGlobal work with r2t ?
yes
yes
effects for all cameras commands are local, why setObjectTextureGlobal for r2t... 🤷
yeah you need the camera on every machine
but as long as you have that. You only need a single setObjectTextureGlobal
what if i use attachto on a local object?
will it still be a local obj?
attachto is global
yes
ok ty👌
im using cfgsounds but changing volume doesnt seemt o do anytihng....
class v2r1
{
name = "v2r1";
sound[] = {music\1.ogg, db - 20, 1.0};
titles[]={};
};
-20, 0, 20, 100 tried it all the same
using a mono 11025 hz 16bit file
Try absolute numbers for the volume, not a string.
sampling rate maybe
Thanks il try tomorrow
https://gyazo.com/91665da1cda597530331c1af170dca66 tidied the dialog up a min
minimalistic, but has what it needed
Is there a way to run a line of code when a condition has changed (ex. player has changed positions)
A player changes position in the map, runs a hint that says "player has moved"
o.O
im confused , like anim Position .. or if a player is x distance away from last position
The latter
while{alive player} do
{
private _pos = getPos player;
if !((getPos player) isEqualTo _pos) then
{
//code
};
};
No
private _pos = getpos player;
for "_i" from 0 to 1 step 0 do {
sleep HOWOFTENYOUWANTTOCHECK;
if ((player distance _pos) >= YOURDISTANCE) then {
_pos = getpos player; // reset _pos
//Run Code.
};
};
something like that maybe.
@subtle ore whats _x in yours mean ?
typo
yours loops with no sleep whilst the player is alive, mine sleeps for x seconds infinitly .
50/50 xD
Bugged, the second private should not be there.
I'm having trouble with a GUI... just starting down this path. When called, it displays the way I would expect but the data doesn't update. Is there something glaringly obvious I'm missing?
RscTitles.hpp
class RscTitles {
class TFR_IP68 {
idd = 230401;
duration = 1e+1000;
fadein = 0;
fadeout = 0;
name = "TFR_IP68";
onLoad = "uiNamespace setVariable ['TFR_IP68_idd', _this select 0]";
controls[] = {
"TFR_IP68_background",
"TFR_IP68_windCur"
};
class TFR_IP68_background: RscPicture
{
idc = 2304011200;
text = "ui\IP68_d.paa";
x = 0.0075786 * safezoneW + safezoneX;
y = 0.534375 * safezoneH + safezoneY;
w = 0.255234 * safezoneW;
h = 0.45375 * safezoneH;
colorText[] = {1,1,1,1};
};
class TFR_IP68_windCur: RscStructuredText
{
idc = 2304011100;
text = ""; //--- ToDo: Localize;
x = 0.0875 * safezoneW + safezoneX;
y = 0.64245 * safezoneH + safezoneY;
w = 0.0464063 * safezoneW;
h = 0.020625 * safezoneH;
colorBackground[] = {0,0,0,0};
};
};
};
And the function that opens it:
disableSerialization;
cutRsc ["TFR_IP68", "PLAIN"];
while { true } do {
_display = uiNamespace getVariable "TFR_IP68_idd";
_windCur = parseNumber ([eyePos ACE_player, true, true, true] call ace_weather_fnc_calculateWindSpeed toFixed 1);
_display displayCtrl 2304011100 ctrlSetStructuredText parseText format ["<t align='center' color='#e0e0e0'>%1</t>", _windCur];
sleep 0.5;
};
The RscTitle shows but the structured text remains empty
1e+1000
This number is way too big.
Snagged it off a forum somewhere... better number in mind for indefinite?
1e9 is like 11 days, so that should be enough.
Likewise with 2304011200. Those are bigger than 1E7 and therefore will probably not be referenced correctly due to rounding errors.
You could just use 10+ for idc. The only reserved numbers are 1 and 2 for OK and Cancel buttons.
I don't really understand the system completely, is there no issue with multiple controls from other mods sharing an IDC?
or is the idd the key here
The idc only have to be unique for the same display. Your display only has two controls.
Ok, I'm with ya now. I thought the IDCs had to be globally unique
The display itself doesn't even need an idd, since you refer to it by variable you set in ui namespace / onLoad.
yeah, that was left over, it should actually be -1
but that makes a lot of sense, I wasn't aware if functioned that way
That's the default, may as well just delete the entry.
Otherwise lgtm.
Yeah, that did it
although, when I removed the line for the idd, it generated an error
Putting it back in at -1 eliminated it
Right. Maybe that's a thing for RscTitles. I never use that.
either way, thank you. I was beating my head against a wall on that one
All numbers are floats in Arma. Anything above ~10 million will break sadly.
good to know
hey what do u guys use to script (other than notepad)
Atom + language-sqf package
thx
Atom breaks under large files though, so don't use it for anything like dumps or rpts lol
Atom for scripting posiden tools for rpt
@vapid drift pretty sure the IDC's are unique to the display so as commy said 10+
what exactly is and rpt
yeah I just got arma and did a bit of the tutorials I mainly got it to learn to script
I need a trigger, the executes once, for each player, that triggers it. Can I not add a evenHandler to do this instead?
The trigger needs to fire when any player leaves it's area, needs to be repeatable.
- PLayer spawns.
- Player leaves trigger area
- PLayers loadout is saved
can anyoen hop in a voice chat real quick wit me to give me an intro to scripting
I would, but I am about to play with my group.
k
Is it possible to reference a model in a config file from another mod? Meaning is it possible to use one of the models from ACE for a custom item without having to inherit the class?
Well I know it's possible but for whatever reason I can't figure it out. Seems like it should be much easier than I'm making it
just set the model directory to the p3d from ACE???
@vapid drift yes.
@modern sand I tried but I don't think I had the path right. Tried several things and always got an error that the p3d wasn't found
what path did you use
Yer
I tried a few:
\ace\ace_atragmx\...
ace\ace_atragmx\...
ace\addons\ace_atragmx\...
several others
those first two should have had an underscore also
You just use the pbo name
tried that as well
\ace_atragmx\data<name>.p3d
can't remember off hand but I tried it
Yer
z\ace\addons\atragmx\...
z?
yes.
I meant I don't doubt you lol of all people, but what's reasoning for that?
Standards back from Arma2. Lots of reasons to do it
easy patchability was the original thing I think
Btw. Next time https://github.com/acemod/ACE3/blob/master/addons/atragmx/%24PBOPREFIX%24 just look ^^
son of a...
If there is a $PBOPREFIX$ then that's the prefix aka file path of everything in that pbo
you can also open the PBO in notepad++ and you'll see the prefix right at the top
well that will simplify some things in the future
Are there any other ways to hide a unit than hideObject? setObjectTextureGlobal doesn't hide all of it (offroad)
If every texture has a hiddenSelection then setObjectTexture can do it
usually that's not the case though
setPos it under ground.
or setPos [0, 0, 10e10] hehe
ono
Is there something specific to do with dialogs and RscTitles to include all of the base classes? The tutorials I was following said that if they were setup in config files they would pull from the game directly?
I'm getting this error now :
No entry 'bin\config.bin/RscTitles/TFR_IP68/TFR_IP68_windCur.type'.
The section it refers to:
class TFR_IP68_windCur: RscStructuredText
{
idc = 1100;
text = ""; //--- ToDo: Localize;
x = 0.0875 * safezoneW + safezoneX;
y = 0.64245 * safezoneH + safezoneY;
w = 0.0464063 * safezoneW;
h = 0.020625 * safezoneH;
colorBackground[] = {0,0,0,0};
shadow = 0;
};
Is this for a mission or addon?
addon
earlier I was making everything in the mission for simple testing, now I'm trying to convert it over
If I setpos underground it's losess it usefulnes
You need to add A3_Ui_F to requiredAddons if you inherit from a base class of A3_Ui_F e.g. RscStructuredText.
damn, alright. I need to just call it a night. I'm skipping simple things
Can you post your config? I have a suspicion of what's wrong.
It's split into multiple pieces... what specifically did you want to see?
RscStructuredText
then maybe that's something else I'm doing wrong? I just reference it the one time class RscStructuredText;
Post it.
I told you man, it's not that simple
#define TEast 0
#define TWest 1
#define TGuerrila 2
#define TCivilian 3
#define TSideUnknown 4
#define TEnemy 5
#define TFriendly 6
#define TLogic 7
#define private 0
#define protected 1
#define public 2
#define ReadAndWrite 0
#define ReadAndCreate 1
#define ReadOnly 2
#define ReadOnlyVerified 3
#define true 1
#define false 0
enum {
DESTRUCTENGINE = 2,
DESTRUCTDEFAULT = 6,
DESTRUCTWRECK = 7,
DESTRUCTTREE = 3,
DESTRUCTTENT = 4,
STABILIZEDINAXISX = 1,
STABILIZEDINAXESXYZ = 4,
STABILIZEDINAXISY = 2,
STABILIZEDINAXESBOTH = 3,
DESTRUCTNO = 0,
STABILIZEDINAXESNONE = 0,
DESTRUCTMAN = 5,
DESTRUCTBUILDING = 1,
};
class CfgPatches {
class TFR_Equipment {
units[] = {
"TFR_Bag_CarryallBlack",
"TFR_HALO_Jumper",
"TFR_HALO_Jumper_Black",
"TFR_HALO_Pilot",
"TFR_IP68",
"TFR_BL500"
};
weapons[] = {
"TFR_Uniform_HAPS",
"TFR_Uniform_HAPS_Black",
"TFR_Vest_HABA",
"TFR_Helmet_HAPH",
"TFR_Item_IP68",
"TFR_Item_BL500"
};
requiredVersion = 0.1;
requiredAddons[] = {
"Extended_EventHandlers",
"A3_Ui_F"
};
};
};
class CfgFunctions {
#include "\tfr_equipment\functions.hpp"
};
class CfgWeapons {
#include "\tfr_equipment\weapons\cfg_includes.hpp"
};
class CfgVehicles {
#include "\tfr_equipment\vehicles\cfg_includes.hpp"
};
class CfgGlasses {
#include "\tfr_equipment\glasses\cfg_includes.hpp"
};
class RscTitles {
#include "\tfr_equipment\RscTitles.hpp"
};
Help me, I don't see RscStructuredText anywhere.
The first part of RscTitles.hpp:
class RscPicture;
class RscStructuredText;
class TFR_IP68 {
idd = 230401;
duration = 1e9;
fadein = 0;
fadeout = 0;
name = "TFR_IP68";
onLoad = "uiNamespace setVariable ['TFR_IP68_idd', _this select 0]";
controls[] = {
"TFR_IP68_background",
"TFR_IP68_windCur",
"TFR_IP68_windMax",
"TFR_IP68_windAvg",
"TFR_IP68_tempCur",
"TFR_IP68_tempMax",
"TFR_IP68_tempAvg",
"TFR_IP68_humCur",
"TFR_IP68_humMax",
"TFR_IP68_humAvg",
"TFR_IP68_barCur",
"TFR_IP68_barMax",
"TFR_IP68_barAvg",
"TFR_IP68_time"
};
class TFR_IP68_background: RscPicture
{
idc = 1200;
text = "";
x = 0.0075786 * safezoneW + safezoneX;
y = 0.534375 * safezoneH + safezoneY;
w = 0.255234 * safezoneW;
h = 0.45375 * safezoneH;
colorText[] = {1,1,1,1};
// ["0.0075786 * safezoneW + safezoneX","0.534375 * safezoneH + safezoneY","0.255234 * safezoneW","0.45375 * safezoneH"]
};
class TFR_IP68_windCur: RscStructuredText
{
idc = 1100;
text = ""; //--- ToDo: Localize;
x = 0.0875 * safezoneW + safezoneX;
y = 0.64245 * safezoneH + safezoneY;
w = 0.0464063 * safezoneW;
h = 0.020625 * safezoneH;
colorBackground[] = {0,0,0,0};
shadow = 0;
};
RscStructured text is not a subclass of RscTitles is it?
RscStructuredText is a root level class. You created a new class RscTitles\RscStructuredText which is different and empty and inherited from that instead and of course it's empty.
// requiredAddons A3_UI_F
class RscStructuredText;
class RscTitles {
class MyDisplay {
class MyControl: RscStructuredText {
};
};
};
Same for RscPictures.
Ah ok, so it needs to be outside
I told you man, it's not that simple ¯_(ツ)_/¯
Well, not really. It's not something that I'd design that way.
But that's how it works.
more errors but that's good enough for tonight. Thanks to both of you guys. Really do appreciate it
Question- on the topic of weapon pylons, is there a way to get what weapon is on what pylon?
And/or the pylon of the missile you'd fire if you left clicked right then and there?
Don't see why not.
@next lily https://community.bistudio.com/wiki/getPylonMagazines and seeAlso links may help you here
Anybody ever had issue with [player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory; it's seems like it doesn't always work for me, i can die 15 times and then randomly I'll spawn as a different soldier.
Does it spawn you with the rifleman loadout of your faction?
Ye it works perfectly fine on launch, it just suddenly after x amount of respawns, spawns as the object it is in eden
I have no idea how to fix this other than making the exact unit myself as an addon or something but I have zero idea how to even do that
it's killed my mission completely lol
Why would you even use that? Just use https://community.bistudio.com/wiki/getUnitLoadout / https://community.bistudio.com/wiki/setUnitLoadout
How does that work commy
Are the examples not enough?
Dunno how to help. I could just repost what's on the wiki, but what's the point?
lol forget it man
sorry for not understanding it... i wish i wasn't so new
but what can you do you know?
What’s probably happening is the loadout is getting saved while you respawn. During respawn, your character probably has the default loadout of their class
is it possible to change the call signs in the lobby for a multiplayer server?
there is the scripted lobby of @little eagle
So I've got this to probably about 80% right now. When I use the action to open it, it opens and toggles the ACE action appropriately but it has a horrible lag spike of about 3-5 seconds before displaying the RscTitle. Then, it doesn't update the data.
When I had this as just a script out of a mission it all functioned fine.
https://pastebin.com/VU5UDGYt
And CBA can also do that. yes
So apparently I'm missing something in this area:
_display displayCtrl 1112 ctrlSetStructuredText parseText format ["<t size='.75' align='center' color='#%1'>%2:%3</t>", _fontColor, _hour, _minute];
sleep 0.1;
I get a Error Generic error in expression but I literally haven't changed anything in this except the item that it checks for
Post the full error from RPT.
maybe, just maybe use parenthesis
Eh, overrated.
lol
The RPT says more than that line. And it is needed to see what to fix.
ok honestly I didn't even know that
and since I'm pretty sure you have pointed out this specific error I've made before... I'm gonna go ahead and not post what it says
lol
if I could buy you a beer for your patience I would though
I wanted to say something snarky about patience and virtue bla bla, but I lost my train of thought somewhere and now idk where I was going with it.
lol
Multiple setVariable public in a sleep 0.1 loop is a bad idea btw.
I'll own the issue, I was calling the function instead of spawning
How would I optimize that then?
Not doing it, or at least increasing the delay.
would it be better to store all of that data in an array so that it's only "set" and "get" once each loop?
You'd still send up to 10 arrays per second per connected player.
hmm, yeah. Well, now that I think about it, every time it exits the loop it erases the data so I really don't even need to store it on the player do I? I mean it's not accessed from anywhere but inside the loop
Well currently you send it to every other connected machine for no apparent reason.
yeah, ok
@lone glade there is no need for paranthesis
tree is perfectly fine:
SQF;0;148;_display displayCtrl 1112 ctrlSetStructuredText parseText format ["<t size='.75' align='center' color='#%1'>%2:%3</t>", _fontColor, _hour, _minute];
NA;0;0;
BINARYEXPRESSION;0;0;
BINARYEXPRESSION;0;0;
VARIABLE;0;8;_display
BINARYOP;9;11;displayCtrl
NUMBER;21;4;1112
BINARYOP;26;21;ctrlSetStructuredText
UNARYEXPRESSION;48;99;
UNARYOP;48;9;parseText
UNARYEXPRESSION;58;89;
UNARYOP;58;6;format
ARRAY;65;82;["<t size='.75' align='center' color='#%1'>%2:%3</t>", _fontColor, _hour, _minute]
STRING;66;52;"<t size='.75' align='center' color='#%1'>%2:%3</t>"
VARIABLE;120;10;_fontColor
VARIABLE;132;5;_hour
VARIABLE;139;7;_minute```
there is no need for paranthesis
woke
in this particular case
in a week:
"wait a second...."
ofc
Don't see why not.
don't forget to close the brackets and quotes ^^
Was AFK
@meager heart yeah, it works fine
Is there a part in particular you're wondering about?
_display displayCtrl 1112 ctrlSetStructuredText parseText format ["<t size='.75' align='center' color='#ff0000' >%1: %2:%3</t>", _fontColor, _hour, _minute];
vs
_display displayCtrl 1112 ctrlSetStructuredText parseText format ["<t size='.75' align='center' color='#%1'>%2:%3</t>", _fontColor, _hour, _minute];
well, in the first one, it would show _fontColor as part of the text
_fontColor could be "ff0000" though.
in the second one, it sets the color to the value of _fontColor
yeah... that is interesting way for me 😀
I modify the color of the text and the background image based on SunOrMoon and currentVisionMode so it looks right
switch (currentVisionMode ACE_player) do {
case 0: {
if (SunOrMoon < 0.2) then { // Night
_fontColor = "6e6e6e";
_bgImage = "IP68_n";
} else { // Day
_fontColor = "e0e0e0";
_bgImage = "IP68_d";
};
};
case 1: {
if (SunOrMoon < 0.2) then { // Night
_fontColor = "1fbd63";
_bgImage = "IP68_nvg";
} else { // Day
_fontColor = "bcbcbc";
_bgImage = "IP68_thrm";
};
};
case 2: {
_fontColor = "bcbcbc";
_bgImage = "IP68_thrm";
};
};
i mean the syntax for the format
You never used format before?
i did, not like that ^
guys how can I do a dialog like this? http://i.imgur.com/VAYOBoJ.jpg How i set the button angle?
It's not format that handles the color. format just creates the string with html syntax for parseText.
parseText is what makes STRUCTURED TEXT out of the html syntax STRING.
Ermen07, you can't.
rgr
i mean, passing variable in to color, never saw that way...
No, buttons are always rectangles and can't be tilted.
It's just normal string manipulation. Nothing unusual about that.
Ermen07 you can't
@little eagle Can't you just use overlapping images with alpha values and check the mouse position?
Yea, that's probably how the thing in the screenshot is done.
If that even is something functional and not just art.
yeah, good point
it would be a pain mapping out the proper mouse positions for each "button"
Eh, just some math.
I don't speak that language
The shapes are simple enough for it to be relatively quick.
Very basic 2d vector math.
I'm a prison guard
Math is indiscriminate. It's the same regardless of your wealth or status.
agreed, but the frequency that it pops up in my daily life is limited to when I'm butchering scripts in Arma
which is plenty enough^
lol ouch
vector math can be done by everyone
The prison can guard itself. That's what the steel bars are for.
math doesn't resolve itself.... wait... wait a second
params [["_pos", [0, 0], [[]]], ["_posSecond", [0, 0], [[]]]];
if (count _posSecond < 3) exitWith { false };
if ((_pos select 0) < (_posSecond select 0)) exitWith { false }; // Left of pos
if ((_pos select 1) < (_posSecond select 1)) exitWith { false }; // Above pos
if ((_pos select 0) > ((_posSecond select 0) + (_posSecond select 2))) exitWith { false }; // Right of pos
if ((_pos select 1) > ((_posSecond select 1) + (_posSecond select 3))) exitWith { false }; // Bottom of pos
true;
First argument is getMousePosition, second argument is ctrlPosition _ctrl
ez
ai intensifies
lol you would be surprised what an un-supervised individual and some dental floss can accomplish on metal bars
use something like ```sqf
params ["_control"];
private _controlPos = ctrlPosition _control;
private _controlParent = ctrlParentControlsGroup _control;
while { !isNull _controlParent } do {
private _parentPos = ctrlPosition _controlParent;
_controlPos set [0, (_controlPos select 0) + (_parentPos select 0)];
_controlPos set [1, (_controlPos select 1) + (_parentPos select 1)];
_controlParent = ctrlParentControlsGroup _controlParent;
};
_controlPos
(So call that instead of ctrlPosition)
I'll have to pull out the 🗞 adanteh
Adanteh, this probably doesn't work for rotated controls or triangle shapes like in the concept art.
Bye, lol
triangle controls? you mean weird polygons? huehuehue
A triangle is a weird polygon.
use inPolygon huehuehue
You probably could abuse inPolygon for this actually. 🤔
yep
As long as there are no rounded edges of the pseudo buttons.
sides*
I like the inPolygon idea.
i like you
Same.
It's funny, because the guy that asked this probably already left because they didn't like the answer.
nono i'm here
lol
do not give up that fast lol
ezpz
create a picture control, in the config, duplicate the size and position elements, and turn it into a button 😃
That will not work. Please check out the posted picture before making suggestions.
I'm trying to add functionality to this script to destroy all buildings of 3 specific classnames, in addition to applying sethit to random building components.if (isServer) then { { for "_i" from 1 to 2 do { _x sethit [format ["dam%1",_i],selectRandom [0,1],false]; _x sethit [format ["dam %1",_i],selectRandom [0,1],false]; }; } forEach ((markerpos "DE1") nearObjects ["house",600]); };
This works, randomly damaging buildings in the radius.
When it comes to targeting those specific buildings to setdamage 1 on, this is what I've tried to no success
{
{
_killhouses = Land_House_K_1_EP1,Land_House_K_5_EP1,Land_House_L_1_EP1;
for "_i" from 1 to 4 do {
_x sethit [format ["dam%1",_i],selectRandom [0,1],false];
_x sethit [format ["dam %1",_i],selectRandom [0,1],false];
_killhouses setdamage [1,false];
};
} forEach ((markerpos "DE1") nearObjects ["house",600]);
};```
```_killhouses = format ["%1", ["Land_House_K_1_EP1","Land_House_K_5_EP1","Land_House_L_1_EP1"]];
if (isServer) then
{
{
for "_i" from 1 to 4 do {
_x sethit [format ["dam%1",_i],selectRandom [0,1],false];
_x sethit [format ["dam %1",_i],selectRandom [0,1],false];
};
} forEach ((markerpos "DE1") nearObjects ["house",500]);
{
for "_i" from 1 to 4 do {
_x setdamage [1,false];
};
} forEach ((markerpos "DE1") nearObjects [_killhouses, 1000]);
};```
what do i need to add to this to make it a vitual arsenal
_Cargo = createVehicle ["B_supplyCrate_F", position _parachute, [], 0, 'NONE'];
// add your items here
_Cargo addAction ["Open Virtual Arsenal", {["Open",true] spawn BIS_fnc_arsenal}];
Anybody have experience creating units via Orbat, ive followed every step and I just can't get my units to show up in game.
@obsidian chasm Are you talking about BiS ORBAT Viewer or ALiVE
Alive, sorry. I didnt know there were others
and you've followed this: http://alivemod.com/wiki/index.php/ORBAT_Tool , right?
Aye, watched videos on it as well
I wonder if I'm failing on the addon/pbo part as far as I know I'm doing it properly
if you're loading ALiVE and CBA I don't think so
Ye.. I copied the things the guy in the video told me to the autogen.hpp and cfgpatches.hpp I then packed them into a pbo , placed the @myfaction folder into arma 3 directory and then loaded local mod
yet what I created does not show
I feel like I've missed a step somewhere because I've done exactly what I'm reading
_KH = format ["%1", ["Land_House_K_5_EP1","Land_House_L_1_EP1","Land_House_K_1_EP1"]];
{
for "_i" from 1 to 2 do {
_x sethit [format ["dam %1",_i],1,false];
};
} forEach ((markerpos "DE1") nearObjects ["_KH",600]);
};``` I'm not getting any script errors from this, but it still isn't destroying those buildings. Tried with _x setdamage [1,false] too
It takes one typename
_KH is not a valid typename
And an array of valid typenames is also not one typename
{
{
for "_i" from 1 to 2 do {
_x sethit [format ["dam %1",_i],1,false];
};
} forEach ((markerpos "DE1") nearObjects [_x,600]);
} forEach ["Land_House_K_5_EP1","Land_House_L_1_EP1","Land_House_K_1_EP1"]
Thanks, I'll give that a go. This is what I'd just tried forEach ((markerpos "DE1") nearObjects ["Land_House_L_1_EP1",600]);
nearObjects only lists mission objects, not terrain objects.
Interesting, the earlier part of the script works despite using nearobjects
{
{
for "_i" from 1 to 2 do {
_x sethit [format ["dam%1",_i],selectRandom [0,0,1],false];
_x sethit [format ["dam %1",_i],selectRandom [0,0,1],false];
};
} forEach ((markerpos "DE1") nearObjects ["house",600]);
};
{
{
{
for "_i" from 1 to 2 do
{
_x setdamage [1,false];
};
} forEach ((markerpos "DE1") nearObjects [_x,600]);
} forEach ["Land_House_K_5_EP1","Land_House_L_1_EP1","Land_House_K_1_EP1"];
};``` in its entirety. Still doesn't destroy the listed buildings
Yeah
because that code is never executed
{...}; You create a CODE type value. And just discard it again
Remove the left most braces
I'll have to keep an eye out for that, now it works. Thanks for your help @still forum
The only reason I needed to do that in the first place is cause those buildings have some weird bug, only a unit's gear (minus uniform) is visible from the outside looking in or vice-versa
CUP?
Yeah
A uniform is not gear (loong story)
That's the playermodel as far as the game's concerned right?
yeah
I wanted to know if someone had managed to fix that, but after this it'd have been the wrong time to ask lol
No way to fix that besides fixing cup
Either go to cup discord in #channel_invites_list or report it https://dev.cup-arma3.org/ there
Done, surprised it hadn't been caught before, it's been happening for a few months
If I want to retrieve a variable from the client when they disconnect how would I do that? I have a event handler for seeing when they disconnect, but I don't believe I can remoteExec to a disconnected client
You can't. The moment they disconnect it's too late.
I figured. I guess I'll just track the variable on the server side
@Manason#7990 Its better to store that kind of stuff in some database
@unborn ether it is stored in a database, but to edit the data I need it on the client, when they disconnect I want to update the database with the new data
save frequently, not on disconnection event or you can always have issues with unexpected events (client crash, etc)
@river meteor You can just save stuff on some events ^, like InventoryOpened or when RscDisplayInterrupt (ESC menu) gets active, etc. Frequent enough and not flooding events.
@river meteor Or you can just make some delay counter and use it everywhere possible. This will give more consistency with some flood protection.
@still forum https://imgur.com/46LmwbI (discussion-related meme)
@outer scarab 22. do not post URL links w/o short description of what it is , anywhere
I don't get it.
anyone know anything about
_pos = player getRelPos [10, 0];
_tank = createSimpleObject ["a3\armor_f_beta\apc_tracked_01\apc_tracked_01_rcws_f.p3d", _pos];
_tank setPos (_pos vectorAdd (getPosWorld _tank vectorDiff (_tank modelToWorld [0,0,0])));
_tank hideSelection ["zasleh", true];
_tank hideSelection ["zasleh2", true];
_tank hideSelection ["clan", true];
_tank animate ["Wheel_podkoloL3", 0.5, true];
_tank animate ["Wheel_podkoloL6", 0.5, true];
``` syntax not working on a server?
_tank setPos (_pos vectorAdd (getPosWorld _tank vectorDiff (_tank modelToWorld [0,0,0])));
tf?
its from the wiki
So what's wrong. There is a tank in your vid.
that was from the second syntax
Maybe it's your debug console.
apparently the tank is there , but invisible ...
_pos = player getRelPos [10, 0];
_tank = createSimpleObject ["a3\armor_f_beta\apc_tracked_01\apc_tracked_01_rcws_f.p3d", _pos];
player setpos (getpos _tank);
systemChat format ["%1",_tank];
_pos = player getRelPos [10, 0];
_tank = createSimpleObject ["a3\armor_f_beta\apc_tracked_01\apc_tracked_01_rcws_f.p3d", _pos];
player setpos (getpos _tank);
systemChat format ["%1",_tank];
``` this is what im using now.
still same issue.
i was just using the stuff on the wiki to start, works fine in editor.
but not on the server
Editor, what map?
idk, looks bizarre to me.
yh
its only so I can use simpleobjects for my farming system, instead of classnames xD
wouldn't have worked, but now they added set/get var on simple objects , it will 😃
re:
_pos = player getRelPos [10, 0];
_tank = createSimpleObject ["a3\armor_f_beta\apc_tracked_01\apc_tracked_01_rcws_f.p3d", _pos];
player setpos (getpos _tank);
systemChat format ["%1",_tank];
getRelPos reports AGL, or really just z=0 always.
CSO requires ASL or ASLWorld with model paths.
ahh
So the object is created at sea level inside the terrain.
getPos reports AGLS, so for objects stuck under ground z is probably 0 or negative.
setPos being AGL would put you on top of the terrain for 0, dunno about negative.
so you have to create it with ASL, but then you can use normal setPos to move it ?
No.
Damn, spent a while learning how to use orbat alive, turns out i just get so many errors from my custom soldiers. fuck this game man
ye, just get some weird errors
i just wanted them to work like any normal soldier because my mission wont save inventory
i just give up, its demoralising
weak
my mission wont save inventory
getUnitLoadout?
i have no idea how to go about that
i mean will it even fix my issue?
the inventory saves using save inventory/load inventory just sometimes on respawn it changes to the default soldier
it can go 19 respawns without randomly switching also
🤔
if I may ask here, does anyone have experience with bikb commands, aka kbTell, kbAddTopic etc? I need help to fill the biki. please @ me or contact me at #community_wiki . Thanks!
Sounds like a race condition, Victus. I bet it's the scheduler. It's always the scheduler.
would that first comment possibly be what might work?
i cant get on now to try it, thats all
😦
The script in the post is a mess. Looks like someone threw shit at the wall hoping it sticks.
thats my plan
- ctrl+a, delete, so broken code doesn't interfere
params ["_newUnit", "_oldUnit"];
if (isNull _oldUnit) exitWith {};
_newUnit setUnitLoadout (getUnitLoadout _oldUnit);
what about that
2,
// initPlayerLocal.sqf
params ["_unit"];
_unit addEventHandler ["killed", {
params ["_unit"];
private _loadout = getUnitLoadout _unit;
_unit setVariable ["commy_respawnLoadout", _loadout];
}];
_unit addEventHandler ["Respawn", {
params ["_unit"];
private _loadout = _unit getVariable "commy_respawnLoadout";
_unit setUnitLoadout _loadout;
}];
respawnTime has to be > 0 for this to work.
hm, how come?
Otherwise respawn eh triggers before killed eh.
my mission is escape so being downed and revived etc
i mean I guess I could set respawn delay to 0 lol
if thats what i have to do
It has to be > 0, not 0.
ye i know lol
the loadout is via script
well ... commy knows de wey ^ 😀
hopefully this works because I cant be bothered if not
its so tiresome being unable to do stuff like this when you have zero idea why
lol nope, still spawning as the default soldier
🤣
how you add your loadouts ?
through a script in initplayerlocal apparently
player playmoveNow (selectRandom ["Acts_TreatingWounded01","Acts_TreatingWounded02","Acts_TreatingWounded03","Acts_TreatingWounded04","Acts_TreatingWounded05","Acts_TreatingWounded06"]);
``` just checking, this should work for anims right ?
@obsidian chasm show it
BIS_fnc_addRespawn inventory < that thing required config loadout
in your case, first loadout in that config will be uns_men_USMC_68_MED
did you copied that from BIS mission ?
check description.ext in that BIS mission, you will find there something like #include "Loadouts.inc" or #include "LoadoutClasses.inc"
Or just better create your own functions.
yes ^
i have // Player loadouts
#include "LoadoutClasses.inc"
make your own
are there any tutorials on how to do that?
please
i remember a while back i tried changing that stuff but it didnt seem to have any effect
i have no idea about tutorials
ah ok, so if i can figure out how to change this, itll fix my issue?
or is this a shot in the dark lol
im at wits end honestly
ah ok, so if i can figure out how to change this, itll fix my issue?
yes
glhf
@obsidian chasm The best way is to study SQF from scratch.
Interesting, if you can actually wait for setVariable result besides just diffing the data before and after?
lol nope, still spawning as the default soldier
Of course you spawn as the default soldier. The script makes it so you respawn with what you had when you died.
You're still just throwing shit at a wall. You probably have some script error in your mission that prevents everything else from working. I said step 1 is to ctrl+A delete. Make a new mission, add my script, and you'll see that it works.
Why use that instead of onPlayerRespawned?
Why use onPlayerRespawned instead of the simpler eventhandler?
you realise I spawn as a different guy, right?.. so me spawning as the default guy isnt good
@little eagle
Your mission is borked, mate.
So the other guy lied?
or are you just being an arse for no reason lol
@little eagle
What? Your mission is evidently broken. First step I'd do is checking the RPT's.
it was working fine last year
only recently has this been happening
but ye i can see you're kind of hard to deal with, kind of odd but whatever
it is what it is
Code I gave you works 100%. If it doesn't for you, then you made a mistake or the problem is somewhere else. Check the RPT's.
we already came to the conclusion that it is loadclasses..
conclusion should be "do not copy paste crap" and more important do not copy paste things when you have no idea what they doing... make things yourself from scratch and you will have less frustration... so far everything what you showed from that mission and your scripts, can be described with
commy2 💩💩 - Today at 02:03
Looks like someone threw shit at the wall hoping it sticks.
Victus_Mortuus - Today at 02:03
thats my plan
^ also probably "greatest quotes update" there 😄
it's almost as though I'm trying to learn something kind of hard with zero prior knowledge and just getting told it's "easy" etc
i wonder if you guys were ever new or just born with the ability to mod arma and stuff lol
🤣
I already knew how to program when I got into Arma
If you know the basics then it's really all easy stuff
i started with scripting in different game, with different language, had 0 experience with "programming for games"... in arma first scripting happened for me in a1 times... but something serious/complex only after a3 release... still noob, but i'm trying 🤷
Victus haven't read the context here at all but are you trying to learn sqf or?
@obsidian chasm there is no easy way here. Either find/pay someone or learn it yourself from scratch indeed. Everyone has his/her story on why we do it, but it all comes down to the same. We all one day wanted to create something.
Except commy, he fell in a tub of sqf while young.
nihao ma
your comparison is semi-correct. You can easily compare this to a genuine language. You learn to speak it by talking to others. By yourself you only get so far.
while totally neutral to this conversation, ^ I like the comparison
and I am trying, you realise I knew literally nothing about all of this last year but jumped into the deep end because my friends and I enjoyed Tanoa escape so I thought "damn a ww2 escape would be sweet" so I made it
it's extremely hard to communicate on here since I don't know half the things you lot are saying majority of the time
so me explaining things also gets muddled very quickly
When in doubt, google it. If that results in nothing, ask. People will happily help if the question is well constructed
SQF is much more readable than other languages.
Usually its hard for the people trying to explain something to know what level they should explain it on.
^
That is true
SQF is plain english. But there are other languages which really are chinese
Like brainfuck
Dedmen, You are assuming everyone speaks English in that statement.
Well. Everyone who is in this discord does indeed speak english
But If you have low skill level I recommend just having some fun in the debug console and having the rpt open
It's very readable to us, Frenchies could have a harder time.
Least I finally fixed my issue
now only one issue left lol
it never ends does it
fix it
One does not simply play without RPT errors
Hi guys. I have a weird problem, and I dont think this have been attempted before. Here goes...
Im spawning 50mx50mx50m boxes on memorypoints.
Im using this script to do so
private ["_ship"];
_ship = _this select 0;
_ship setFeatureType 2;
for "_i" from 1 to 749 do
{
_mempoint = format["Component%1", _i];
_box = "TIOW_geo_box_50m" createVehicle (position _ship);
_boxSpawn = _ship selectionPosition [_mempoint, "Memory"];
_box setPos (_ship modelToWorld [_boxSpawn select 0,_boxSpawn select 1,_boxSpawn select 2]);
sleep 0.005;
};
for some reason, half the boxes spawn alot further up than the rest
private ["_ship"];
_ship = _this select 0;
->
params ["_ship"];
its not a function. just an init script
@meager heart will do when i figure out the issue lol
Doesn't change my argument ^^
it works to some extent, but around half spawn further up than where the memorypoint actually is
Could it be that the ones that spawn higher up are the ones that spawned after some boxes already existed below them?
hm, I have 749 mempoints each with individual names
Yeah that is the problem
oh
