#arma3_scripting
1 messages ยท Page 290 of 1
isn't B_Soldier_LAT_F as readable as b_soldier_lat_f
most of them are already snake cased just some uppercase mixed in
or actually there's a lot of mixes nvm
How would you guys rate SQF as a scripting language? Is it better than Lua? Worse?
Yes.
I agree with @jade abyss
I would prefer Lua
it doesn't matter what one prefers... A3 is SQF, deal with it ๐
SQF is alright
mess with commands, random naming, useless commands, lack of essential commands is the problem
Yep. It's easy, once you understood the basics.
That's why you never ever use setPos
No issues with setPosATL\ASL
\World
hm
does modelToWorld work on simple object?
World indeed uses model center
As for ASL I think it uses land contact points
We really could use a command to return these
Also a command to return surface level, the one setPos\getPos uses
Well, I don't think I can influence it much
Here is crazy idea, make a library of placing points offsets in profileNamespace
if there isn't one, create normal object, then fine offset, save it into profile namespace, create simple object
all next simple objects will get it off profile namespace
Just parse entire CfgVehicles at start and make model => class table
so you can use that for finding offset automaticall if there isn't one saved in profile namespace
just do it on start up
you wouldn't even notice it
Does getModelInfo always return .p3d?
I mean in the end of file path
Fuck it, gonna script it right now
Inspector SaMatra is on the case
Why does my dialogue close after opening only the first time I open it createdialog "mydialog";
prepareModelPath = {
_this = toLower _this;
if(_this select [0,1] == "\") then {_this = _this select [1, 1e6];};
if(_this find ".p3d" != count _this - 4) exitWith {_this + ".p3d"};
_this;
};
initLookupTable = {
lookupTableModels = [];
lookupTableClasses = [];
{
_model = getText(_x >> "model") call prepareModelPath;
if!(_model in lookupTableModels) then {
lookupTableModels pushBack _model;
lookupTableClasses pushBack configName _x;
};
} forEach ("getNumber(_x >> 'scope') > 0" configClasses (configFile >> "CfgVehicles"));
};
placingOffsetTableModels = profileNamespace getVariable ["placingOffsetTableModels", []];
placingOffsetTableVectors = profileNamespace getVariable ["placingOffsetTableVectors", []];
createSimpleObjectASL = {
params ["_model", "_pos"];
_model = _model call prepareModelPath;
private _index = placingOffsetTableModels find _model;
if(_index < 0) then {
private _class_index = lookupTableModels find _model;
if(_class_index < 0) exitWith {};
private _object = (lookupTableClasses select _class_index) createVehicleLocal [0,0,0];
_object setDir 0;
_index = placingOffsetTableModels pushBack _model;
placingOffsetTableVectors pushBack (getPosWorld _object vectorDiff getPosASL _object);
deleteVehicle _object;
};
if(_index >= 0) then {
_pos = _pos vectorAdd (placingOffsetTableVectors select _index);
};
createSimpleObject [_model, _pos]
};
here you go
had some issues with \ in the beginning of model path
saveProfileNamespace whenever you like
anyone in here currently running arma and could send me the output of https://community.bistudio.com/wiki/supportInfo ?
deleteVehicle test; test = ["a3\armor_f_gamma\mbt_02\mbt_02_arty_f.p3d", ATLtoASL(player modelToWorld [0, 10, 0])] call createSimpleObjectASL; test
for quick tests
got no arma on this computer and that wont change till next week sadly :/
If you have 5 min @queen cargo Ahh me too late
It works fine, I just tested it
Call initLookupTable on start up, then createSimpleObjectASL when needed.
Feel free to post it on forums, I am too lazy.
During the session, it does the first time you create new model path
otherwise it pulls it from profile namespace array
All you need is to call initLookupTable during init somewhere
and then just use the createVehicleLocalASL whenever you want
there is setDir 0 for this reason
for maps that have slope in [0,0,0]
Or they can like you know add scripting command for it
instead of this trickery
<array> = placingPoint <entity>
My dialog says that it's missing the CT_TREE.colorPicture
Why?
colorPicture is not defined anywhere, and in the template it does not give me that error
ohh, okay there we go thanks.
Dialogs are fun, but they are difficult. Just like math
5*7="directory mission/rscText.font not found"
font= "RobotoCondensed";
How can I use the treeview to select some data?
apparently setValue can only be a intriger
Hey guys, I have this sqf evh = (findDisplay 46) displayAddEventHandler [ "KeyDown", "if ( _this select 1 in ( actionKeys 'Fire' ) ) then { hint 'yes'; }"]; to show a hint every time I fire, unfortunately its not doing anything. Any thoughts on why it wouldn't`?
its supposed to pick whatever key is bound to the fire action, not necessarily mouse button?
[6:19 PM] nigel: How can I use the treeview to select some data?
[6:19 PM] nigel: apparently setValue can only be a intriger
@peak plover the most common way is creating an array, then using setValue / setData as an index in that array
though it probalby does not pick mouse button with keydown so add another to check the mouse button
But it should be checking any key connceted to that action
which can be defined in normal settings
So there shouldn't really be any problem in my eyes
yes but its for keyboard keys. mouse button has different event than the keydown
Thanks. This seems to be a good solution
ah so you mean add onMouseButtonClick evh?
yes
or the buttondown one probably works too
and might be better if your firing on full auto
you cant overwrite the fire action though
it will still do that
afaik there is no Mouse EH
Where can i get the Bis Variables? Is there a list? Thank you
Are you sure, this works with Mouse Input?
i've tied remote turret firing on mouse with this
Do you have a quick example?
I had to scrap it though as it does not overwrite the default action (fire)
Ah! Doesn't overwrite! That was the Prob.
yes
Yeah, i remember again
๐ญ
So there is no way you can overwrite a mouse button action?
To return that it's been handled
and not let you fire
Take on Mars have 16 square kilometers maps! How could Arma 3 run on it?
?
I'm doing this, don't even getting a hint sqf VAR_onMouseButtonClick_EVH = ( findDisplay 46 ) displayAddEventHandler [ "MouseButtonClick", { hint "no"; }];
on
@rotund cypress actionKeys and all related commands are unusable, because the id system BI uses exceeds the precission of the floats SQF uses as NUMBER type.
If you want to show a hint every time you fire, you have to use a fired eventhandler
The problem is this: I want to remove the projectile, did that wit onFired eventhandler
Although
For some reason, when I shoot someone really close
It doesnt remove the bullet
When I shoot longer ranges
it deletes the bullet
What was the code?
Onfired?
yeah
SimZor, that commands must be executed on ClientSide
Means -> The one who fires needs to have the onFired EH attached to him
Then it gets deleted properly
It won't solve your issue either. Someone could just rebind firing to a keyboard key
Thats the other thing
What do you really want to achieve? Stop people from firing?
safezone?
No it's not for a safezone
player addEventHandler [ "Fired", {
private _projectile = _this select 6;
if ( ZOR_Weapons_DisableFire ) then {
deleteVehicle _projectile;
};
}];```
Doesnt delete the projectile fast enough
Ah nice
Mytag_allowShooting = false;
player addAction ["", {hint "hi"}, [], -99, false, false, "DefaultAction", "!Mytag_allowShooting"];
Oh that could be useful
You still have to delete grenades I think tho. It used to work with "Throw", but BI broke it.
put it very low on the list of actions, so it doesn't interfere with the action menu.
Ah ok
You'd think they made actual API for that and not just have a dirty way around. Oh well.
player addEventHandler ["Fired", {call MyTag_fnc_Handle_Fired;} ];
MyTag_fnc_Handle_Fired =
{
_Player = _this select 0;
_Projectile = _this select 6;
if( VarABC )then
{
deleteVehicle _Projectile;
};
Worked flawlessly
If you stand right next to a wall aswell?
Yes
The fired eh executes one frame after you shoot. Maybe they already did some projectile traveling simulation and hit detection at that point.
Never heard of that though.
I was standing with a buddy, right next to eachother, Guns inside our heads (mk200) -> emptied our Clips -> Both still alive
MP?
My BUDDY and me were in SP, simulating our movements in the Editor
ffs, Commy... cmon
Of course MP ^^
Buddy could refer to an AI, dude
I don't live in your mind.
Be glad
How lonely would you need to be to start calling the AI "my buddy".
Just put him on your side and not on opfor
yes
https://twitter.com/_Lystic/status/809150982076727296
Did you think a DayZ SA dev would post something Arma 3 relevant? ๐
Variable does not support serialization and should not be stored in missionnamespace
what??
sounds like you're doing stuff with UI
if you want to refer to a display/dialog/ctrl using a variable then use uinamespace
disableSerialization;
Do UI stuff
or that yea
I want to onTreeSelChanged = "_this call fnc_selectSpawn; false";
But it does not #work
maybe post the whole script and not a tiny fragment
okay
Answer was already given oO
Dscha - Today at 7:27 PM
disableSerialization;
Do UI stuff```
Translated:
Add ` disableSerialization; ` to the first lines of your ` fnc_selectSpawn `
Thanks this seems to work.
'''SQF
_CT_INS_TREE tvSetValue [[_teammates],0];
_debugval1 = _CT_INS_TREE tvValue [_teammates];
Later on it returns 28
params ["_idc","_path"];
_value = _idc tvValue _path;
systemChat (str _value + str _path);
28
wtf
well 28[1]
Feels like tvSetValue is reset?
What is the value of _teammates?
1
hm, are you sure?
And _idc is?
D:
_idc is 450
wait
systemChat (str _idc); //#control 450
onTreeSelChanged = "_this call {
params ["_idc","_path"];
systemChat (str _idc);
_value = _idc tvValue _path;
systemChat (str _value + str _path);
_spawnUnit = insurgency_respawn_spawnList select _value;
mapAnimAdd [1, 0.1,(getpos _spawnUnit)];
mapAnimCommit;
}; false";
This is what it is. the IDC is same
but
escape your quotations
That's just copy so you can see. It's actually onTreeSelChanged = "_this call BRM_insurgency_respawn_fnc_selectSpawn; false"
ah
onTreeSelChanged = "_this call {
params ["_idc","_path"];
==
Error
Change the " to ' inside the " "
e.g.
["_idc" -> ['_idc'
You tired today @jade abyss :D?
Read what I first said, then he said ๐
๐
Hmm, maybe it's something to do with where I define the tvValues
private ["_groups"];
#include "defines.hpp"
_display = _this select 0;
_CT_STATIC = _display displayctrl 420;
_CT_BUTTON = _display displayctrl 421;
_CT_BUTTON2 = _display displayctrl 422;
_CT_INS_TREE = _display displayctrl 450;
_CT_MAP = _display displayctrl 470;
//insurgency_respawn_spawnList
insurgency_respawn_spawnList = [player];
_bases = _CT_INS_TREE tvAdd [[],"BASES"];
_CT_INS_TREE tvSetValue [[_bases],0];
_bases_main = _CT_INS_TREE tvAdd [[_bases],"MAIN BASE"];
_CT_INS_TREE tvSetValue [[_bases_main],(count insurgency_respawn_spawnList)];
insurgency_respawn_spawnList pushBack main_base;
if (!isNil 'fob') then {
_bases_fob = _CT_INS_TREE tvAdd [[_bases],"FOB"];
_CT_INS_TREE tvSetValue [[_bases_fob],(count insurgency_respawn_spawnList)];
insurgency_respawn_spawnList pushBack fob_base;
};
_teammates = _CT_INS_TREE tvAdd [[],"TEAMMATES"];
_CT_INS_TREE tvSetValue [[_teammates],0];
_debugval1 = _CT_INS_TREE tvValue [_teammates];
systemChat ("create = " + str _CT_INS_TREE);
_groups = [];
{
if (side _x == side player && (count units _x) > 0 && !((count units _x isEqualTo 1) && (player in units _x))) then {
_groups pushBackUnique _x;
};
true
}count allGroups;
{
_addGroup = _CT_INS_TREE tvAdd [[_teammates],groupId _x];
_CT_INS_TREE tvSetValue [[_addGroup],0];
{
if (alive _x && !(_x isEqualTo player)) then {
_unit = _CT_INS_TREE tvAdd [[_teammates,_addGroup],name _x];
_CT_INS_TREE tvSetValue [[_unit],(count insurgency_respawn_spawnList)];
insurgency_respawn_spawnList pushBack _x;
true
};
}count units _x;
true
}count _groups;
systemChat (str _this); // [Control #450,[1]]
executed in onTreeSelChanged or inside the Script?
both
Gesundheit
I'm currently wondering, if maybe, just maybe, my use of tvSetValue is wrong, but it seems to return the correct value inside the script. but when called later by the dialog, it won't get the correct value
I can't find the damn command to spawn vehicles. Isn't there a spawnvehicle command? I am not looking for createvehicle. I'm looking for the other one, if it exists and I'm not confused.
@tough abyss, that's it! Thanks!
ohh, figured out my problem
_CT_INS_TREE tvSetValue [[_teammates,_addGroup],0];
instead of
_CT_INS_TREE tvSetValue [[_addGroup],0];
It was not working correctly and overwriting the original values
_addGroup = _CT_INS_TREE tvAdd [[_teammates],groupId _x]; does not have the full destnation
count is so ugly
hmm what would be an effective way to remove holdaction from other clients while one is in the "progress" phase?
from other clients??
have a variable that you check for having that holdaction availabe
hmm
Yeah. Ideally every client is responsible for it's own holdaction thing
Sounds to me like another one of these cases, where you rather should simply set the condition to false instead of removing the action.
the holdactions are tied to AI units that are spawned dynamically so i always have trouble figuring out how to refer to things, it'd be simple if it was a specific named unit
but is there a way to use remoteexec so that i runs on all players except the specific one?
*it
Is it possible to create clickable hyperlink in game?
check
_canHold = _unit getVariable ["my_unitHeld",false];
When holding beginns
_unit setVariable ["my_unitHeld",true,true];
Yep
They are AWESOME
@dusk sage Did you reply to me?
@tender fossil href it
Aight, thanks
setVariable \ getVariable really is the bread and butter of anything more advanced in SQF
Too bad it's such a clumsy syntax.
Yeah. Better off using the getVar STRING syntax and then if isNil
It's alright though.
To be fair, only seen it cause an issue once
It's not THAT often that you have an expression as default value instead of simly objNull or -1 or ""
Only time I've seen is having name _x as the default, where _x at the time was some map object
Likes to spam the RPT
That fucking command is so annoying
It even spams the RPT if you use it on a unit that was just created a few frames before.
or a dead one
- RPT output
15:56:29 "[Display #6600]"
15:56:29 "<spawn>"```
2) RscDispayMain onLoad code
```disableSerialization;
params["_display"];
['onLoad',_this,'RscDisplayMain','GUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay');
{
_x ctrlShow false;
true;
} count allControls _display;
createDialog "DS_MainMenu";```
3) DS_MainMenu onLoad code
```//new thread needed for animation sleeps
diag_log "What the flappery Fuck";
diag_log str(_this);
_var = _this spawn {
diag_log "DS_MainMenu init";
disableserialization;
params["_display"];
private _btn1 = _display displayCtrl 5;
private _btn2 = _display displayCtrl 6;
private _btn3 = _display displayCtrl 7;
private _btn4 = _display displayCtrl 8;
private _btn5 = _display displayCtrl 9;
private _txtHeader = _display displayCtrl 10;
private _txtSubtitle = _display displayCtrl 11;
// -- Animate buttons
{
private _oldPos = ctrlPosition _x;
_x ctrlShow false;
_x ctrlSetFade 1;
_x ctrlSetPosition [(_oldPos select 0) - 0.2, _oldPos select 1, _oldPos select 2, _oldPos select 3];
_x ctrlCommit 0;
_x ctrlShow true;
_x ctrlSetPosition _oldPos;
_x ctrlSetFade 0;
_x ctrlCommit 0.3;
sleep 0.05;
} forEach [_btn1, _btn2, _btn3, _btn4, _btn5, _txtHeader, _txtSubtitle];
};
diag_log str(_var);```
Problem: The code within _this spawn in DS_MainMenu onLoad code is not running
Proof of problem:
1) There is no reason diag_log "DS_MainMenu init"; would not output unless there was an error
2) There is no error in the rpt
3) the rpt output of str(_var) proves that the thread is started P.S. This code is meant to override the arma 3 main menu if you couldn't tell.
oh lord
The fact it's diag_logging str(_this) but not the first line of your spawn, is odd
yes
I had this problem too. You cannot spawn any threads onLoad in the main menu
zzz
Probably too soon for the game to recognize that.
I don't know any workaround either.
Hey guys, does anyone know what addons PBO HPP's are stored in? For the example RscDisplayDebugPublic?
Can you please ask that again. Don't understand
That sentence is missing a verb.
There? ^
It's not in any HPP
I don't know what you mean by addons PBO HPP. In every PBO there can be a HPP. And what is the reference to RscDisplayDebugPublic? That is a config class
No, but that class needs to be somewhere. Do you know where it is?
News flash, dialogs don't need to be in HPPs
a3\ui_f\config.cpp
Maybe just wants to know where to put a display class definition
in which case, in the mission (in my case)
Hhaah
specifically description.ext
I have an #include there that points to a file that I have the classes defined in
All I wanted to know, is where the ArmA dialogs are, that are not community made
@rotund cypress You should write down, what you want. Mindreading is (probably) not invented yet.
Sorry for not explaining good enough bois
Bow down and praise us. At the same time: Beg for forgivness.
๐คฃ
YOU THINK I AM MOTHERHUGGING JOKING???
there's some stuff in this folder you might find useful (or your equivalent)...
C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\Binarize\bin
๐
What I would recommend is extracting everything onto your P drive, and then searching through it with notepad++ or another capable text editor
grepWin
I know. I am the best.
@tough abyss Stop posting that in every motherhugging Channel...
If someone has an answer, he will answer you. Stop trying to force it, just have patience and wait.
OR: GOOGLE
and what might "anti nss" be?
NSS Admin console. Who doesn't have time to formulate a real request also doesn't have time to read an answer. So why bother
not even sure how NSS could be a problem that requires some "anti" thing ยฏ_(ใ)_/ยฏ
It can execute scripts. So can any other Mod put together in 5 minutes
Is there a way to change the mission name in the mp mission selector?
Yes. But I don't know how
yeah but isn't that what signatures are for? ๐
exactly. But some people apparently don't know a dime about what they are doing
I think in the mission attributes you can define a displayName. I'm not a mission maker.. #arma3_scenario @delicate lotus
there is a menu for that in the eden editor
Else description.ext But that is also integrated into eden now
๐ just figured out you can stream live cam to a gui using r2t and rscVideo
yeah, not sure how the live video from an outside source works, a bit beyond me. I did see a vid on that life mod though. Think a problem was they had to wait until the video buffered for everyone on the server so it took a minutes before the vid would start.
Also just saw url = ""; in RscActivePicture not sure how that works yet gonna try rn
Quality is kind of shit. Canging pip quality does nothing, this is as big as I can make it while still being able to see http://i.imgur.com/MTjsc5C.png
it's possible to get the quality higher, i managed it before, playing with FOV or something
problem is, disabling pip in your options menu makes all your work pointless
so i never used pip to ctrl in the end
yeah, I'm gonna use isPipEnabled to let the player know to turn it on. Only good if I can get it to look better though, will try messing with fov
@little eagle So i did a workaround for the mainscreen ui.
instead of using a thread i changed the ctrlCommit timer based on the sleep timer.
so i was using something like this
{
_x ctrlCommit 0.2;
uiSleep 0.05;
} forEach _ctrlList;
and now use
{
_x ctrlCommit (0.2 + (0.05 * _forEachIndex));
} forEach _ctrlList;
You could attempt something like onEachFrame with a ticker, but idk how accurate it would be or if it would even work
Is there any way to enable BI revive by script? I can't find any commands or functions that affect it in the BIki. I would like to primarily use ACE Medical, falling back on BI Revive if the mod is not present
@old basin https://community.bistudio.com/wiki/Arma_3_Revive go to the config settings/ read the page
I didn't know you could make mission config settings conditional on a mod being present, how would I do that?
in multiplayer, does it work if grouping/animation commands for AI units are run by some client or should the commands always be run on the machine that handles the AI units (i.e. usually the server) ?
Probably on the machine that owns the AI.
when i call a script through a unit init, that script will be executed server sided is it?
if not, how would i make sure of that?
i believe commy's last answer also applies to you to...it'd be executed on whichever machine owns the unit
https://community.bistudio.com/wiki/remoteExec if you want to control where it's run
@proven crystal if (!isServer) exitWith {}; at the top of the script
ok so what im trying to do is call a script from the unit ini. its a custom respawn for ai, that stores a bit of data, so id like to keep that on the server rather than players
nul = [this] remoteExec ["fez\fez_ai_respawn.sqf", 2];```
crap
just do a normal execvm and put what i posted above in it
unit init runs for everyone
how to start running a trigger only if all opfor in trigger radius is dead?
{
side _x == EAST && alive _x;
} count thisList == 0;
thanks!
I've got an array of units. I want to find the nearest unit to the player
Any "clean" way of doing so?
I've only got some dirty ideas
foreach and distance?
i mean you can use nearestobject unless you really want to use that array
Okay, but it feels dirty
{
_distance = _x distance player;
if (_distance < _closestDistance) then {
_closest = _x;
_closestDistance = _distance;
};
true
} count _spawnableList;
i mean thats fine for what you want to do
nearestobjects could be really fast if the range is small
using CBA?
_nearestVeh = [player, vehicles] call CBA_fnc_getNearest
but yea their implementation is basicallty that
i mean the way you have it is perfectly fine so id just stick with that
is there a way to add modules from a SQF?
@indigo snow IIRC the cba function finds all within a circle right?
or am i thinking of something else
A function used to find out the nearest entity parsed in an array to a position. Compares the distance between entityโs in the parsed array.
commy_fnc_nearest = {
params ["_origin", "_objects"];
private _distances = _objects apply {_x distanceSqr _origin};
_objects select (_distances find selectMin _distances)
};
If you need it to be fast, this is the fastest you can get with SQF.
Are you a wizard?
You don't like it? ๐ฆ
On the contrary.
๐
@little eagle createVehicle? call BIS_fnc_whateverTheModuleFunctionIs ?
means
createVehicle call BIS_fnc_modulefucntion
?
If you don't look too closely into some parts.
No, adir. It depends on what module you're talking about.
well of course it wont be perfect but its helpful
What you wrote makes no sense.
then you probably should explain yourself abit better because there's a reason why I asked
It's impossible to say more without knowing what module.
You can create it via createVehicle or just call the modules functions
Which one exactly... you never said.
it's the sling load module
worth a read. i think the module UI settings are saved on the module via setvariable. not sure if you need to do that manually
Yep
Maybe they defined it as a Var again
moduleSlingload = {};
Yeah, FN ^^
Yeah, it iterates over synchronizedobjects of the module
folder?
So I guess one would use this?
private _module = "ModuleSlingload_F" createVehicle [0,0,0];
_module synchronizeObjectsAdd [unit1, unit2, unit3];
Never tried that.
Or do you have to use createUnit on modules. Can't remember
Erm, maybe?
idk
Would you guys consider it a bug if a function call without arguments for ex safezoneW is the same as a variable lookup?
Let's visualize a script run of call myVariable in the engine
//call
this is a call instruction. I know that. This was already evaluated at compiletime
//myVariable
This may be a variable or a function
if it starts with _ it is a local variable -> return the variable
To prevent variables from overriding functions check if this is a Variable
if getVariable myVariable == Nil then
Check if myVariable is a function. and call and return the function result
return getVariable myVariable
So actually because of a old bug that Commy informed me about getVariable is called twice. So this is what the game does when myVariable is a variable
it's not a local Variable so check for global
getVariable myVariable //It is not Nil so we don't check if it's a function
getVariable myVariable and return that.
Let's see what it does when we call safeZoneW
Does it start with _ ? no it doesn't.
getVariable safeZoneW -> Nil //It's not a variable so let's check if it's a function
checkIfFunction safeZoneW //Yes it is a function
call safeZoneW and return result.
So actually for every nular or Variable in script the game call's getVariable twice. If it would evaluate at compile time if it was a function it wouldn't need to do all that at every execution. I think this could be a moderate boost to script performance
This perf problem can be circumvented by using local variables where possible.
https://feedback.bistudio.com/T123419
Is there any way to tell if arma detects an extension? I have a mod that's calling an extension, but the extension doesn't seem to respond.
Attach a debugger and see if the dll is loaded.
Have the extension return a string ?
Newer rc/dev builds have rpt output if the extension wasn't loaded / found
Hey guys, if I had a listbox with all players in it, and I wanted to make a search function, would I have to make a RscEdit and then make a function for filtering the listbox?
The Rpt logs the extension name when it's loaded. With something like "can't get version"
is there a way to apply a texture to for instance a sign whilst being in a multiplayer server and I have admin rights and using ARES? ( code excecute thingy)
@still forum rc builds now complain it can't find extension
i assume it occurs when it can't load extension. but i never bothered to test it
dedem? wow ๐
blah ๐
does createVehicle not work for backpacks?
what to do? its been some years i was into sqf ..
create GWH, then add it via addItem (or Weapon, not sure)
_a = "GroundWeaponHolder" createVehicle [0,0,0];
_a addItem "BackPackClassName"; //OR AddWeapon
tx
is there a way to get an Rsc layer above a diolag?
iirc they are always in the BG
pbtbtbtbtb
so do I have to make a new diolag for a text notification?
I could add a text box to each interface and change the text in it. Just was wondering if there was a better way :P
I'll think it over lunch
anyone got an idea why playSound3D might have stopped working? playSound3D ["\JDG_carrier\sounds\elevator.ogg", _elevator, false, getPosASL _elevator, 20, 1, 300];
I called it with player instead of _elevator from the debug console, no joy. Though the elevator sound plays back with say3D.
Im trying to create a moving respawn point but It is not moving.
What am I doing wrong?
respawn_west_move setMarkerPos getpos (leader pgroup);
hintSilent "test";
sleep 3;
};
(code is excuted in a script which is called from a trigger by using execVM)
There is also always a error message which says that there is no marker named respawn_west_move but I placed one and gave it the exact name.
maybe put quotes around "respawn_west_move"
all markers have to be referenced as a string
oh...
common mistake
โ yep
notification after entering something from another diolag
disableSerialization;
closeDialog 0;
_handle=createdialog "info";
_string= format ["Time limit set to %1 seconds",Timer_Length];
ctrlSetText [9009,(parseText format ["%1",_string])];
class info
{
idd=115;
movingenable=false;
class controls
{
class info_frame: RlcFrame
{
idc = 9006;
x = 0.314375 * safezoneW + safezoneX;
y = 0.115 * safezoneH + safezoneY;
w = 0.37125 * safezoneW;
h = 0.088 * safezoneH;
};
class info_back: IGUIBack
{
idc = 9007;
x = 0.314375 * safezoneW + safezoneX;
y = 0.115 * safezoneH + safezoneY;
w = 0.37125 * safezoneW;
h = 0.088 * safezoneH;
};
class info_button: RlcButton
{
idc = 9008;
text = "OK"; //--- ToDo: Localize;
x = 0.649531 * safezoneW + safezoneX;
y = 0.137 * safezoneH + safezoneY;
w = 0.0257812 * safezoneW;
h = 0.044 * safezoneH;
action = "closeDialog 0;";
};
class info_text: RscText
{
idc = 9009;
text = "test"; //--- ToDo: Localize;
x = 0.319531 * safezoneW + safezoneX;
y = 0.126 * safezoneH + safezoneY;
w = 0.319688 * safezoneW;
h = 0.066 * safezoneH;
sizeEx = 1 * GUI_GRID_H;
};
};
};
the diolag shows up but the settext isn't working
also that diplay thing and waituntil are just old
the timer_length and stuff happens from the button
waitUntil {!(isNull (findDisplay 115))};
-->>
disableSerialization;
closeDialog 0;
_handle=createdialog "info";
waitUntil {!(isNull (findDisplay 115))};
//____
_string= format ["Time limit set to %1 seconds",Timer_Length];
ctrlSetText [9009, _string];
//OR
ctrlSetText [9009, format ["Time limit set to %1 seconds",Timer_Length]];
doesn't parseText return a StructuredText string
at least I need to do parseText "blah" before passing it to ctrlSetStructuredText
edited code above
hmm okay
โค double teamed
format the formatted formatting
formated format again
reformat the formatting
edited the formated format before mat
mat before for expect after parse
Anyone have a good example of sql_custom
Ini for extdb3
Also will help to know sql
yeah i have enough knowledge of it but have been having issues with exile and extdb3
I can't figure out why this diolag is showing up no text at all
at first I thought ctrlSetText was justing messing with it, but not that I tested it, it doesn't even show the default text
check your .rpt
Converting exile from extDB2->extDB3 is relatively simple. Just the queries regarding inserting NULL Values are abit different.
Due to NULL Support in extDB3 i.e no need for inserting CUSTOM strings into the query.
@plucky beacon Try:
((findDisplay 115) displayCtrl 9009) ctrlSetText (format ["Time limit set to %1 seconds",Timer_Length]);
instead of
ctrlSetText [9009, "Text"];
15:45:20 Sound: Error: File: ca\ui\data\sound\onover.wss not found !!!
15:45:20 Sound: Error: File: ca\ui\data\sound\new1.wss not found !!!
15:45:20 Sound: Error: File: ca\ui\data\sound\onclick.wss not found !!!
๐ fix it
ye
16:03:50 Error loading control R:\... ...\Permadeath.VR\description.ext/info/controls/info_text/
but wheeeereeee
class info_text: RlcText
{
idc = 9009;
text = "";
x = 0.319531 * safezoneW + safezoneX;
y = 0.126 * safezoneH + safezoneY;
w = 0.319688 * safezoneW;
h = 0.066 * safezoneH;
sizeEx = 1 * GUI_GRID_H;
};
do you need quotations for position?
I've seen it dont multiple ways
the rest of the diolag is up there
but ya it's rlc because Rsc is taken by another diolag
but ya it's rlc because Rsc is taken by another diolag
iuignf9ughtn ??????
^^
Tag_RscText <- the usual way, but yours also works ๐
Anyone experienced with DrawIcon3D and compensating for distance and zoom? Doing some gamey stuff http://i.imgur.com/el7dSxA.png . I figured how to compensate offsets for the icon, but not able to get it done for the Text. Arma does some weird zooming and positioning based on distance and zoom.
The text wanders down the further away i get.
You mean reducing the text Size ?
No, i can do that, but the text goes all the way "down". It's positioned at the soldiers head, but at 100m, ARMA seems to think the head is at it's ass.
I figured out a "formula" so the icon stays where its supposed to. But the Text gets handled different i think.
2.25 should be enough with variable Fontsize
https://community.bistudio.com/wiki/drawIcon3D
drawIcon3D [texture, color, pos, width, height, angle, text, shadow, textSize, font, textAlign, drawSideArrows]
Thanks. Tried to compensate with textSize, but i think the only way is to adjust pos somehow. My guess is that worldToScreen (tried it with a control instead of drawIcon3D) is not very accurate. A head at 10 meters is accurate. At 100m the coordinates are way off.
I did it that way, and it worked like a charm. But try for yourself, maybe you find some other way =}
Will play around again with that in mind. Thanks!
@ebon nymph check killzone kid's website, i think he's got an example of exactly what you're trying to do
I saw a video of him with a name tag thing.
Oh yeah. That looks good. Thanks a lot! (btw. did a video of my problem https://youtu.be/ZnTa2uzjRYM)
Does anyone know when arma loads extensions? at server start, mission start or call time?
And I can call any extension file (I'm running linux so a .so file) in any @mod folder that is loaded?
as soon as you run the game i'd guess
#arma3_tools is probably a better place to ask
and yeah, at least with .dll it doesn't matter what @ folder it's in
They're loaded at game start. You can use them at any time.
layerName cutText [text, type, speed, showOnMap]
can anyone confirm that showOnMap has no effect if this alternative syntax is used or do i have to specify a specific name?
if this is true then either the wiki is wrong or its a bug
example (use in debug console):
"test" cutText ["","BLACK", 1, false];
should fade to black (at least it does for me)
same with text...
but still makes the map black too regardless of the showOnMap value
seems to be already on the feedback tracker :
https://feedback.bistudio.com/T120768
Did you use "test" as layer before?
nope
weird
("testC" cutFadeOut 0) cutText ["This should not be visible on map screen", "PLAIN", 1, false];
yep got this... works
Anyone know how to get preloadCamera to work on a dedicated server?
In SP the preload command takes about 3 seconds to run. On a dedicated it returns true immediately
and doesn't appear to do anything
Does anyone know when arma loads extensions? at server start, mission start or call time? -> They're loaded at game start. You can use them at any time.
No they are loaded at first call.
Greetings, Help me out here please.
I'm trying to look at the Arma 3 revive system, but I cannot really set it up. It's set in 3DEN, I even tried description ext, and all this with dedicated server.
If I die, I just respawn. So what's the deal? Does it only work if there are at least 2 players in the game?
@lunar mountain You need to enable it and make sure it is enabled for ALL PLAYERS. Did you check the unit attributes to see if it is also enabled on the playable units?
enabled for all players, but unit attribute "revive enabled" is disabled (makes sense)
I'm assuming you've read through this then https://community.bistudio.com/wiki/Arma_3_Revive
kind of... not all ๐
respawn = "BASE";
respawnDelay = 5;
respawnTemplates[] = {"Revive"};
respawnOnStart = -1;
reviveDelay = 10;
reviveForceRespawnDelay = 5;
reviveBleedOutDelay = 180;
is this in your description.ext?
trying it ๐
granted this is an older version so don't get your hopes up
Respawn template "revive" not found
anyways
either I'm dumb (but 3den scenario attributes are easy, so) or it needs some workaround nobody documented ๐
anyways, @ me if anyone knows anything about this ๐
@chilly hull Arma extensions are loaded on first time you do callExtension
is there a way to access tasks in a script which are created by the task modules?
hi, i come back to arma after two years, what's the best script editors for now? heard about some webstorm integration?
Sublime Text 3
i use notepad++ with some community made syntax highlighting that's probably a bit old
sublime text was payware?
used sublime in the past as well as np++
They have a popup like every 20 times you save a file that can be clicked away.
ST is better with large files.
what's with webstorm?
integrated development environment I think
debugger
The only debugger for SQF is the game ...
I use VS Code
notepad++, it's good and fast
used to use atom and vs code but they aren't very responsive and can't handle big files
I found that n++ is bad when opening files like the allInOne config.
Does anyone know how to create a new main menu? Like BreakingPoint? How can i do that
Edit the current one. It's also pretty pointless.
depends on what it's for...if it's a total conversion then it can be a nice touch
No one plays the game to look at the main menu. It's a waste of time that will only lead to unnecessary incompatibilities with other mods and future patches.
first impressions are quite important actually imo
BI didn't change vanilla a3 main menu for nothing
the old one looked like it was from the 90's
Funny. I thought it was easier to use.
Definitely faster to enter VR after game start.
Now it looks like something you see on a console. Yikes.
you are right in a lot of ways, but you're not the full target audience for this game bro
most people want things to look pretty
True, most people are stupid.
would you still play arma 3 if it had N64 level visuals though?
@rancid ruin obviously, it's arma
You don't know who you're asking this, bro.
Worlds greatest text adventure
you take fire from the west what do you do? uhhh ... M.. move nor- dead
@rancid ruin I don't know what other ide's have git built in but it helps
VS code is great for me
think everything's got a git plugin by now
i really liked VS code, nicer than atom imo, just a bit slow
electron apps will always be slower than native
Atom & VSc are only slow if you start opening massive things ๐
I guess I haven't reached the large files sizes yet so it still working really well for me
I still prefer eclipse for doing all programming related stuff
๐ค
Where's all the hate towards eclipse coming from?
Heck if i know. I just know the interface is a bit too cluttered for me. Vs code has a minimal interface
Have you tried any other IDEs?
No I started with eclipse and sticked to it
I've only ever used eclipse in Java
Yeah thats what I started with and now I have written my plugin (Editor + Syntax check) for SQF for it...
Working well?
Never noticed anything like that
productivity that was my kicker
๐
Well it doesn't detect everything but I would say it's pretty decent
The new update will improve parser speed in certain situations and after that it should be a really handy feature
@dusk sage I always thought the memory was a java thing
The only thing not working on Vs code sqf is switch case
Sure, but do you want your IDE bloating that aswell ๐
I didn't know it was eclipse too :p
The only debugger for SQF is the game ... Not much longer ๐
pic or didn't happend
No screenshot. It's currently only working inside the debugger as there is no way to input commands yet ^^
This is debug console output that I have right now.
https://github.com/CBATeam/CBA_A3/blob/master/addons/help/fnc_setVersionLine.sqf#L79
instruction L2 O1 new command
instruction L2 O9 const "_display"
instruction L2 O8 array (1 items)
instruction L2 O1 function params
instruction L4 O23 new command
instruction L4 O40 var uinamespace
instruction L4 O65 const "cba_help_VerScript"
instruction L4 O87 var scriptnull
instruction L4 O64 array (2 items)
instruction L4 O52 operator getvariable
instruction L4 O28 function scriptdone
instruction L4 O27 function !
instruction L4 O23 function if
instruction L4 O110 const {}
instruction L4 O101 operator exitwith
instruction L6 O115 new command
instruction L6 O137 var _display
instruction L6 O136 array (1 items)
instruction L6 O153 const {
uiSleep 3;
"_this call compile preProcessFileLineNumbers '\x\cba\addons\help\fnc_setVersionLine.sqf'" configClasses (configFile >> "CBA_DirectCall");
}
instruction L6 O147 operator spawn
Load
uiSleep 3;
"_this call compile preProcessFileLineNumbers '\x\cba\addons\help\fnc_setVersionLine.sqf'" configClasses (configFile >> "CBA_DirectCall");
instruction L6 O134 _verscript = ... (local)
instruction L11 O310 new command
instruction L11 O310 var uinamespace
instruction L11 O335 const "cba_help_VerScript"
instruction L11 O357 var _verscript
instruction L11 O334 array (2 items)
instruction L11 O322 operator setvariable
Could set a breakpoint at each of these steps and read all local variables of current and higher scopes. Modify variables, Inject code at that place. Works for scheduled and unscheduled. Only started on that 2 days ago so it's very messy right now.
UI will probably be made by X39 later or I'll try to build something remotely usable
soooo, never a UI ๐
X39 is probably too busy to build some UI the next few months yeah ^^. But I planned on building some Profiling UI as profiling scripts was my main target. we'll see. I will make the debugger backend stuff open-source after I polished the code a bit
Gg no re
I hope it does work out because I edit code on computers not with arma. Hard to check what works and doesn't
The debugger requires Arma. It's a debugger not a Emulator. It hooks into the running engine
Made some UI icons from ingame assets https://www.dropbox.com/s/1s2r3wynft162oo/Soolie_Icons.rar?dl=0
Seen in toolbar here http://i.imgur.com/7E9ieFJ.png
Can anyone tell me why this respawn script doesn't work for everyone in a group?
//initPlayerLocal.sqf
player addEventHandler ["Respawn", {
params ["_unit"];
if (group _unit == sqd1) then {
_unit setPos (getPos AlphaSpawn);
}
else {
if (group _unit == sqd2) then {
_unit setPos (getPos BravoSpawn);
}
}
}];```
on a dedicated server...
wasn't it OnRespawn?
Hay Guys, i try to delete some houses and stuff. I got this code, how can i say that it doesnt go from the CapitalCity, i want him to go from the marker "mack" _pos = position (nearestLocation[[0,0,0], "NameCityCapital"]); {_x hideObjectGlobal true} foreach nearestTerrainObjects [_pos,[],600];
_pos = getMarkerPos "mack"
So this?: _pos = getMarkerPos "mack"; {_x hideObjectGlobal true} foreach nearestTerrainObjects [_pos,[],600];
@quasi thicket Try it with the corpse ( params ["_unit","_corpse"]; ). But i am not entirely sure, if the Corps stays in the group
@dusk sage doesnt work ๐ฆ
@jade abyss - Some people spawned correctly on the boat marker, but some people in the group spawned on their corpse location
uhm, okay
What do you mean, 'doesn't work'
When i go in Eden Editor, and type that in debug =_pos = getMarkerPos "mack"; {_x hideObjectGlobal true} foreach nearestTerrainObjects [_pos,[],600]; it doesnt clear
yes o.o its a Warning Marker : variable: mack
This will be one of the few times I say -> work it out for yourself
You literally have the code there
Or is it this? _pos = getMarkerPos (nearestLocation[[0,0,0], "Mack"]); {_x hideObjectGlobal true} foreach nearestTerrainObjects [_pos,[],600];
no
That reminds me of the daughter of a friend. Wildy guessing until its right^^ (just guessing, no trying to solve it, just guessing)
Okay, i think i got it^^
๐
๐คฆ
i now its not the right above there
but even when i try to fix the code and search in wiki it doesnt work
you're trying to hide all the buildings within 600m of the marker "Mack"?
Yes
But it doesnt work
I know it works but only with the CityCapital
i want it with a marker
the code you're using doesnt work*
no need for location commands at all if using a marker
This works but not with a marker :/ _pos = position (nearestLocation[[0,0,0], "NameCityCapital"]); {_x hideObjectGlobal true} foreach nearestTerrainObjects [_pos,[],600];
_pos = getMarkerPos "Mack";
if (player == z1) then {
null=execVM "GUI\spawn_menu.sqf";
};
shouldn't this only run if the player is variable name z1?
in the init.sqf
@plush cargo _pos = getMarkerPos "Mack";{_x hideObjectGlobal true} foreach nearestTerrainObjects [_pos,[],600];?
_nearest = nearestTerrainObjects [_pos,[],600];
{_x hideObjectGlobal true}forEach _nearest;
you should be using the simplest syntax(shown on wiki) and get it working before trying to combine multiple commands
_pos = getMarkerPos "Mack";{_x hideObjectGlobal true}forEach _nearest; _nearest = nearestTerrainObjects [_pos,[],600];
o.O i think im too dumb. i gonna uninstall sqf in my brain i swear
you have the hide object (which contains the variable _nearest) before the line that defines _nearest
cant do foreach nearest wo knowing what it is
doesnt work either xD
_pos = getMarkerPos "Mack"; _nearest = nearestTerrainObjects [_pos,[],600];{_x hideObjectGlobal true}forEach _nearest;
@plush cargo He is just copy and pasting it. Don't expect anything further ๐
Im asking for help, im not here to battle whos the best in scripting. I know im not good
Why cant you help me? is this so hard?
I dont understand that for real^^
Its not about "who is the best" its about: Read the Wiki and at least try to fix it for yourself.
yes and im trying. But i cant get it to work
oh boy everybody get in the bunker
What did you try?
do you have -showscripterrors enabled?
have you tried using hint or systemchat to see whats going on?
Answers will be "No", i bet.
use logs or hints or something in between each command so you can find where it breaks
_pos = getMarkerPos "Mack"; hint "a"; _nearest = nearestTerrainObjects [_pos,[],600];{_x hideObjectGlobal true}forEach _nearest; doesnt show a hint ๐ค
then you can narrow down where your supposed to look for fixing things
systemchat str _pos; for example. (Like: Is he even getting the position??)
there you go, now you know its not making it that far in the code
do you have showscripterrors on?
it is absolutely neccessary
I turn it on
Did you checked your .rtp files?
I bet the half of the life mission you use if broken^^
half the life missions up rn are broken
3/4 of Arma is Life ๐
_pos = getMarkerPos "Mack";
diag_log format ["Marker position is %1",_pos];
_nearest = nearestTerrainObjects [_pos,[],600];
diag_log format ["nearest terrain objects %1",_nearest];
{
_x hideObjectGlobal true;
diag_log format ["%1 hidden",_x];
}forEach _nearest;
I would debug like this
imho, that is nothing to be proud of, Miller.
Dscha!
pls miller, dont do that
@plucky beacon there is an ; missing in your script
lmfao
crucify me
lmao get ur shit together nitro
btw @plush cargo in my code there is no error.
I've been a bad scripter, there's only one way to correct mistakes like this
1 hr in a life server
NOOOOOO
and you gotta sit in their ts
And doing hardcore RP!
even worse:
You have to be in the police, with a 14Year old Chief!!!111oneoneoneeleven
lol
dies
Okay, enough spamming in here ๐
if (player == z1) then {
null=execVM "GUI\spawn_menu.sqf";
};
between this and
if (player == z1) then {
null=execVM "GUI\spawn_menu.sqf";
};
do either of them do what I think they do?
locally run the script on z1
could be, yeah
hm
although...
don't want it to run for every player
or.. I mean really just the top one works anyway
lol I just boiled it down to the exact same thing
shit
Anyone know what all the unitTraits do? cant find any solid documentation on it
audibleCoef (scalar)
camouflageCoef (scalar)
engineer (bool)
explosiveSpecialist (bool)
loadCoef (scalar)
medic (bool)
UAVHacker (bool)
i know medic can heal and engineer can fix cars
load changes stamina
thought maybe hacker could use enemy uavs
that works with what other players hear? or just ai
what about explosive specialist?
can use defusal kit and plant explosives maybe?
nah
nup
might be a config thing
explosive specialist = Specialist in Explosives.
Job done, praise me now.
*DropsMic*
hmmm
(weren't ExpSpecs the guys who carry the ammo for the LauncherGuys?)
this setUnitTrait ["audibleCoef",0];
ai cant hear anything, full sprint up to their back and no response
this setUnitTrait ["camouflageCoef",0];
ai cant see shit
knows your their when standing right in front of them but cant target you
there*
this is setting the player's traits not the ai , to be clear
ya
that's actually pretty neat, you could make some cool ghille missions
with the audible thing that could be pretty cool for sneaky missions
yeah deff, would have to test and find the threshold when they hear if you're standing but not when crouched
Also camo is increased during night I'm pretty sure
Or maybe it's a diffrent value
player setUnitTrait ["audibleCoef",0.25]; they can hear you if crouched and walking reg but not with slow walking speed
ffs im too into something else rn, already building a whole stealth scenario in my head
deff does
custom traits are set with setUnitTrait, bool only. player setUnitTrait ["isaNoob",0,true];
why do that instead of setVariable is my question
I made a mini game ๐
disableSerialization;
_rscProgressBar = ((findDisplay 850000) displayCtrl (850401));
_diff = 0.025;
while {ctrlShown _rscProgressBar} do
{
sleep 0.01;
_pos = progressPosition _rscProgressBar;
switch (_pos) do
{
case 0: {_diff = 0.025;};
case 1: {_diff = - 0.025;};
default {_diff = _diff};
};
_rscProgressBar progressSetPosition (_pos + _diff);
};
fucking mindblowing gameplay!
the basic idea for this was to operate mining equipment this way to get resources to bring to a "weapon factory" to craft weapons/ items etc. I did however have an idea for a server that was basically an open world lobby full of stupid shit to do, and get other server info/ join games. But i couldnt find a way to go straight from one server to the next so i gave up on that.
too bad ๐ฆ
this was never implemented or it was and failed?
never implemented
Part's of it were implemented once. But not sure if it ever worked. The function parsing the ConnectTo message and initiating a Server connect is still in the latest binary
I can't remember having anything added oO Do you know what was added?
Edited my last msg
Are you sure, you don't mix it with sendUDPMessage?
yes
The script function is functional and tells the network manager to send the message. And the receiving end also looks intact to me. Either they disabled it on purpose in some location I don't see right now. Or it's working
I never managed to make it working (not connected/reacted/nuttin)
I also don't think that's a very good idea. People could redirect players to maybe malicious servers or something
Whats a malicious Server? Life? ๐
But on the other hand -> It would open alot of possibilitys for several Gamemodes (e.g.: "Dungenons" for the Survival Players)
That would be pretty cool
Altis > Go to airport > Select a destination > loading screen > Tanoa
i made a ghetto travel system of sorts in a mission before
like, you'd get a plane on altis for example, fly 5km south off the map border, server would kick you and set your status to "travelling to stratis" in the database
then when you connect to the stratis server you're spawned 5km north of the border in your aircraft
http://prntscr.com/eay3d6 Profiler UI test for my debugger ^^ Very minimalistic but useable already.
@still forum There could be some user verification like "you are heading to IP address server named server name are you sure you want to leave?"
but then again people still fall for the "free ipad" popups so whatever
maybe if it changes the port but no the IP, constrict it to a single server
have multiple servers running and one as teh hub or main port, that people walk around going to the other ports on the server
i don't really see how you could do anything malicious with it anyway
@plush cargo
Fun fact. The numbers are so high, that the isNumber command would actually return false.
lol
had to use toFixed to get it.
to be fair it's not a trillion but 999,999,999,654 or some shit
quads have 30 fuel capacity for some reference
Yeah, the value is way too high for the single floats SQF uses
Cannot be accurately represented.
too high for any logistics involving oil mining to make sense as well.
Why is it so high anyway?
๐คท
maybe it's the best balance they could achieve with jets using the same fuel as atvs
just gonna have to define my own values for how much mined fuel will fill the refuel trucks/fuel containers
repair and ammo are exactly the same
Repair, refuel and rearm trucks ARE incredibly bugged and dodgy to use though.
Massive locality problems and the zones where to place the vehicles are weird.
You have to do really weird shit to get it to work.
You have to be alone in the refuel truck
And there has to be only one non driver in the vehicle to refuel or something like that
It's just as bugged as the commanders smoke launcher is in tanks.
wtf
Try it. It was a science the last time we used it.
But yeah. Tanks carry around so much fuel in vanilla that you can drive for like a week straight before the they're empty.
Vehicles in general. The fuel consumption thing only really works for helicopters.
Which are also the only vehicles that lose fuel when the HitFuel hitpoint is damaged.
Effectively all the fuel simulation does in vanilla is waste frames.
Very rarely use vanilla vehicles :/
It takes forever
is the fuel consumption realistic, if you refer to the ranges of the real life counterparts?
Id imagine a tank irl lasts a good long while on fuel
The fuelConsumption config entry is bugged for once and does not work for non helis (not sure about planes)
I know RHS planes lose fuel, dunno about vanilla
Our missions last about 2.5 to 3 hours and the fuel bar on the tanks does move like one pixel.
Engine running all the time. Specifically to test if fuel matters.
yeah, we've never ran out of fuel in a land vehicle in my community
For a game I'd say you would scale it down to not last as long as it would irl.
Sorta like how you scale down artillery ranges.
yup
I mean, you are driving on fucking Islands that are like 30 sqkms
With tanks and artillery guns lol
We drove all the way across Europe with those things
Does anyone have an idea why a RscListbox created via ctrlCreate is showing scrollbars although it doesn't actually has the need to do it as all entries fit in the size of the box?
And even weirder: I can't select the lower entries of the listbox (like the last 3 or so). In order to select them I have to scroll them up first
I've had that problem before, iirc changing the sizing fixed it
or maybe using safezones
_backX = 0.74 * safezoneW + safezoneX;
_backY = 0.69 * safezoneH + safezoneY;
_backW = 0.25 * safezoneW;
_backH = 0.29 * safezoneH;
_background ctrlSetPosition [_backX, _backY, _backW, _backH];
_background ctrlCommit 0;
But shouldn't the size be correct if the actual control has the correct size on screen?
I guess fuel is only really important when the mission maker gives you only a few minuted worth of fuel to drive
Can anyone explain why this code works on a hosted server, but not on a dedicated?
END_TIME = 300; // 5 Minutes
ACTIVE = true;
publicvariable "ACTIVE";
if (isServer) then
{
[] spawn
{
ELAPSED_TIME = 0;
START_TIME = diag_tickTime;
while {(ELAPSED_TIME < END_TIME) && (ACTIVE)} do
{
ELAPSED_TIME = diag_tickTime - START_TIME;
publicVariable "ELAPSED_TIME";
sleep 1;
};
};
};
if !(isDedicated) then
{
[] spawn
{
while {(ELAPSED_TIME < END_TIME) && (ACTIVE)} do
{
_time = END_TIME - ELAPSED_TIME;
_finish_time_minutes = floor(_time / 60);
_finish_time_seconds = floor(_time) - (60 * _finish_time_minutes);
if (_finish_time_seconds < 10) then
{
_finish_time_seconds = format ["0%1", _finish_time_seconds];
};
if (_finish_time_minutes < 10) then
{
_finish_time_minutes = format ["0%1", _finish_time_minutes];
};
_formatted_time = format ["%1:%2", _finish_time_minutes, _finish_time_seconds];
hintSilent format ["Time left:\n%1", _formatted_time];
sleep 1;
};
};
};```
it should start a countdown and display a hint with the remaining time
How do you launch the script?
i activated it with a trigger which has onActivation="count1 = [] execVM ""startCountdown.sqf"";
count1 is used to stop the timer if the another objective is complete
And hows that trigger triggered?
onActivation="titleText [""The missile has self-destructed"", ""PLAIN"", 3] ; deleteVehicle CountLose; ACTIVE = False; publicvariable 'ACTIVE'; hintSilent """";";```
uhm
well, seems i don't use count1 anywhere ๐
damn, why did i put count1 = there ๐ฆ
Dunno but I'd prefer if you wouldnt quote the mission.sqm plz
Uhm
....
Wrong trigger?
I wanted the one that execVM's the countdown :D
Hmmmmm I dont see why it shouldnt work then either :S
Not at home right now so unfortunatly I cant investigate it on my own dedicated server
same here ๐
just got the sqm files on my dropbox
i have a mission failed trigger if the players do not complete the objective in time, i wonder if that one works if the time runs out
luckily, during testing the players DID complete the objective, and still played for 10 more minutes to extract
you aren't initializing ELAPSED_TIME in the second if
shouldn't a dedicated server go through the first If?
and on !(isDedicated), the script worked fine
Yep, the first if is alright
but the second the script is executed on the client only
my problem is that it doesn't work on dedicated though... it works fine in singleplayer and hosted MP
indeed
man.... arma scripting to hard
not at all, let me think about an explanation
in the meanwhile check the wiki https://community.bistudio.com/wiki/isDedicated
Its scripting in general. Sometimes during late night scripting, it appears fine but you oversee one subtle mistake
I got if !(isDedicated) then and the wiki has if (!isDedicated) then {
that doesn't change anything, lol
okay :p
most of the script is ripped from a BI forum post so, i didn't write it. I just modified it to my needs (i.e. strings and start time)
So, the first block gets executed if: you're the host of the game, doesn't matter if it is dedicated or not . Second if: gets executed if you're any kind of player (host or not).
if you aren't hosting the game then you don't know about ELAPSED_TIME that's initialized in the first if
Have you tested it with two clients? Mayby thats more insightful
that's why it seems to be working in singleplayer and hosted MP, you meet the condition that satisfies both ifs
get another player, the second if shouldn't be working for him either
so only the host sees the actual countdown hint
"Another player" just hit "Launch Arma" twice :D
yes, because ELAPSED_TIME is undefined for other players
oh shit, you're right
sleep 1; if !(isDedicated) then ?
WaitUntil {!isNil "ELAPSED_TIME"};
^ yeah, like that
^
WaitUntil {!isNil "ELAPSED_TIME"};
if !(isDedicated) then
{ ```
ok, i'm gonna try that this evening ๐
Now it has to wait until the variable is defined
shameless promotion: https://steamcommunity.com/sharedfiles/filedetails/?id=860592329
It's my first real mission, i'm pretty proud at what i managed to do so far
but i had a lot of help from here ๐
I hope I got that syntax right
it's waitUntil not WaitUntil
anyway, i'm gonna lunch.... thanks for the help @turbid thunder & @surreal kettle
good appetite ๐
I tend to capitalize a lot for readability
In my past bullshit scripting I never capitalized anything xD somehow still worked despite all its flaws
do as you please, I was joking ๐
Mobile connection is cloning my messages D:
I prefer over-capitalized things over thisunreadablemess
There is a programm with SQF syntax that literally bitches about wrong capitalization
deleteVehicle = command. deletevehicle = detected as global variable by the tool xD
I dont know it myself xD
It costs yearly though
Ok gotta go now back to doing ny exam :(
lol, good luck
"Using publicVariable too frequently in a given period of time can cause other parts of the game to experience bandwidth problems."
i assume "too frequently" means "quite damn lot of times" ?
Yeah... Like in a loop or something like that
@pulsar fog everything you do super frequently will eat your bandwidth and performance. Nyte is only updating one var every second. Easy to handle. But imagine a while loop with no pauses and a lot of different variables = kill
ForEach is a pretty good performance killer too
Everything is a performance killer oO
Try nearRoads or smth with a big radius
Your game will briefly freeze
Used to use that to spawn cars on roads but it has the ability to put your game in arma3.exe is not responding mode
Does anyone know how to do a foreach for several groups at once?
Yes
{_x execVM "Gear.sqf";} forEach units _G2,_G1,_G5;```
How do I do that kind of thing appropriately?
Oh!
DelJ
Thanks! @little eagle!
You are missing []