#arma3_scripting
1 messages ยท Page 252 of 1
Your suggested approach will work like this
_array = [player, objNull, objNull, player, objNull, objNull, player];
_todel = [];
{if(isNull _x) then {_todel pushBack _forEachIndex}} forEach _array;
{_array deleteAt (_x - _forEachIndex)} forEach _todel;
Doubt its any fast though
Trying to find quickest method to do this, have to go through rather large array in single frame somewhat often
hm
_deleteIndex = 0;
_array = [player, player, objNull, player, objNull, player]
{
if (isNull _x) then {
_array deleteAt (_forEachIndex - _deleteIndex);
_deleteIndex = _deleteIndex + 1;
};
} forEach _array;
not sure on speed, but can test
Wish there was ++ command to increment number variable in single command
yea i agree
0,018ms PerfTest
_Index = [];
_Arr = ["1","2","2","3","2"];
{
if(_x == "2")then{_Index pushback _forEachIndex;};
}forEach _Arr;
_Index sort false;
@meager granite will it be unique elements in the array or overlapping?
0,0155ms (no clue why faster WITH deleteAt)
_Index = [];
_Arr = ["1","2","2","3","2"];
{
if(_x == "2")then{_Index pushback _forEachIndex;};
}forEach _Arr;
_Index sort false;
{_Arr deleteAt _x}foreach _Index;
_array = [player, player, objNull, player, objNull, player];
{
if (isNull _x) then {
_array deleteAt (_array find _x);
};
nil;
} count _array;
I don't know how fast that is, but i've seen it get used quite a lot
What does your array contain @meager granite (types?)
list of entities, some of which become null over time and I need to clear them out while retaining same array
well just check in arma and see what's faster.
array = [];
for "_i" from 1 to 300 do {array pushBack (if(_i % 3 == 0)then{player}else{objNull})};
array of 300 elements for execution time checks
that's not unique though, so keep that in mind obviously when testing
but yeah i think fasted loop through array is currently { /whatever/ nil; } count _array
Using what approach, @dusk sage ?
array = array select {!isNull _x};
Assuming you only have objects etc, within your array
That works? oO
Ofcourse
good point actually
Nice to know.
But if you have any other types, strings, scalars, w/e, it'll hit the ground like a truck on each frame, haha
all the new usages of select are so nice
So its just usable for NullCheck?
I creates new array, point was to retain original array
Why are you looking to retain your original array?
It is referenced from multiple places through local variables
If it wasn't about keeping original array, I'd go for - [objNull] which times quicker than select {}
So you're relying on the local variables being pointers to your predefined array?
To change
It is not predefined and changes dynamically with time
I guess we could use select code like command which modifies original array instead
For now I guess I'll stick to manual iteration with forEachs
Something like: _array extrude {isNull _x}
well
Then it's a battle between the speed of find and incrementing a variable ๐
I'd imagine the latter
Whats wrong with array = array - [objNull]; performance reasons ?
I creates new array, point was to retain original array
I got 2 question if someone would be able to help me. First question is about the magic variable _x (count). I don't really understand it basically, is there any way someone would give me an example of how it works and what it does? Second question is I have seen alot of like %1 and %2 in codes. Example: hint format ["%1" ]. I have seen them in alot of codes in hints, scripts etc. Have no clue what they do, maybe someone could explain it to me the easiest way? I have tried Google to search but I just don't understand.
Here's some examples for you to wrap your head around:
{
hint _x;
} forEach ["hi","bye"];
_x will give you the current element as you iterate through your array. count would also work here (using _x).
So we would see, hi, then bye, hinted.
hint format ["Hi %1 %2","Marvin", "Putrus"];
Would hint 'Hi Marvin Putrus'
Ah okay, makes some sense now, still gonna try stuff till I get it 100% but thanks anyways.
np
Is it possible to turn an object, like a UAV backpack, into a "prop"? I.e. Position it in the world and not have it automatically reposition itself on it's back when the mission/server initialises?
Have tried disabling simulation locally/globally, but seems to only affect some objects
createsimpleobject command
You can make 'any' model into a prop with that command.
Run it on mission start and then use setVectorUp and so to position it
@ivory nova
@austere granite Thank you so much, noting this down now and will try ๐
Does anyone know if you can keep units in the ragdolled state originally caused by setUnconscious true? It's for a mod, so editting the configs is okay
Already tried class Unconscious: Default { ConnectTo[] = {}; }; but no luck
Yeah so basically there's still no way to properly ragdoll people and keep them incapped like that. I was rewriting my medic system, because keeping units dead has some other issues (Mainly compatibility with every other mod out there) plus all the commands that include dead units are slower, so was hoping to just use setUnconscious but then keep people in that ragdoll state
Changed all the animation configs that showed up when using setUnconscious false; and nothing
When using setUnconscious true in vehicle you can also still drive them okay, 10/10 implementation
Can't rotate turret, but can fire it
Yep.
Actuially that's a lie
... you can go forward!
You can't steer / go backward though
Good job BIS
Yeah expect I don't want that
Because it's retarded.
I'll just keep units dead I guess :/
It's all working okay, but figured I'd make use of the amazing engine-side setUnconscious command yayyyyy
I don't use AI, so there's that.
I couldn't even deal with damage handling, which for some reason didn't manage to stop units dying on.... sahrani
Not even kidding. it worked a-okay and did exactly what it did, but when playing on sahrani it didn't stop units from dying
At least I can't circumvent the inability to steer by assinging left/right analog to my pedals
At one point before as a ragdoll'd incap state I spawned in a dead AI unit in place instead and then switched camear to that while hiding the other unit
You'd constantly hear helicoptersa and so flying around, even though there were none in the mission ๐
Also sometimes after respawn your character would speak talking in Czech radio messages
setUnconscious seems to be okay if you can live with those limitation
I still gotta test that. Lemme do it actually, although I got custom dragging animation configs because i was getting sick of it sometimes magically transsferring into a carry (instead of drag)
Well blocking the other inputs should be fine
Turret can't move, and blocking firing I can do with defaultAction as empty addAction shortcut
i guess i could just run enableSimulation false; on player to keep in ragdoll
HAHAHA FUIG
i dont need camera rotation
but... even when you turn it back on and setUnconscious false
.. the camera is still in the same spot
cameraOn still returns player
if (!alive tower) then {
//code
hint "tower down";
} else {
//code
hint "tower up";
};
i dont get tower down when it destroy it why?
when do you call this?
init
init executes once, on initialization
ohhh
its only usable for modelmakers
Any advice for setting up an AI squad to hunt for players at the last position the players engaged AI at?
@quiet bluff do you want it to be displayed as soon as the tower changes its state or just at one particular point in time?
@rocky cairn you could use a "Fired" event handler and check whether the player fired in the direction of the AI. The you simply add a waypoint to the AI so that they will move to the player's current position
Thanks
You're welcome
You might find a better EH for that though but I'm too lazy to browse the different EHs ^^
Creating simple objects is probably better.
You can spawn lots of objects with disabled simulation far from camera and see how it affects framerate
@scarlet spoke as soon it change
Try embracing the string into an array
KZK is awesome.
@quiet bluff then you might want to to use a waitUntil: waitUntil {! alive tower} ; hint "Tower is down!" ;
If you want it to fire more than on e you could do `while {true} do {
waitUntil {!alive tower} ;
hint "Tower is down!" ;
waitUntil {alive tower} ;
hint "Tower is alive!" ;
} ;`
Have you tried it when Arma is started with filepatching enabled? (Also available as parameter in launcher) @tough abyss
I don't think filePatching is the issue. I sent Killzone Kid a message about that command back in March and the response I got from him was
logNetwork might still be WIP. I will try to find out what its status after the Easter
He is probably a busy guy, so it probably wouldn't hurt to poke him about it again
Nice code: [] spawn {[] spawn {[] spawn {[] spawn {[] spawn {๐ฉ };};};};};
I like it
There is an oficial download source for Arma 3 KOTH?
I was about to make a server, but i got it. Thankyou.
Hello ๐ Is it possible to include rotation position data in some way when using createVehicleLocal?
Follow up:
Is it the case that backpacks can not be used with createSimpleObject?
Can turn other objects into "props", but not a UAV backpack
createsimpleobject takes a p3d.. it should work
maybe it's under the ground or something
@vapid frigate I see that it has been created, but not at the coords I entered ๐ฆ I'll keep toying!
And it is still usable, etc
someObject = createSimpleObject [_theObjectPath, AGLToASL (player modelToWorld [0, 2, 0])];
That should spawn it in front of the player and not in the ground
How do I go about tracking down a sound that a boat uses when it's door opens? It's a mod, therefore looking in the Cfg viewer of the boat itself, I can see the script it uses to open and close the door on user action, however the problem is that the statement = is too long and I cannot view were it defines the sound. Poking around in anything that says sound on it has proved useless, any idea's? Then what command would I use in a script to trigger that sound? Thanks! -Soko
you can push ctrl-c with the line selected and paste it in notepad or something
-_- โค why didn't I think of this ffs, I need to quit assuming, that's going to get me in trouble one of these days...
@native hemlock Thanks! I can get the backpacks to spawn, but not as simpleObjects, even with the createSimpleObject command
@native hemlock Can still pick them up and equip, and can't manipulate using vectorDir, setDir, setPitchBank, etc
Function I have works for other objects though
๐ฆ
Guess backpacks can never be decorative objects ๐
@ivory nova if you have @CUP There's the Rucksack pile from ArmA 2
@shut fossil Thanks man! Will keep that in mind! Trying to stay vanilla for this one ๐
@ivory nova No prob, was just throwing it out there.
@ivory nova Possibly try to disable the objects simulation under the special states in the editor? Or have you already tried that?
@shut fossil Appreciate it!
Yeah I already tried that too
So far only bags won't become simple objects
even had a atmosphere cap ready to go lol http://i.imgur.com/F0I5ar6.png
(screenshot from editor)
Hmm, that is odd. There's probably a logical explanation out there somewheres for it. That's awesome, I love that you can hit backspace in 3Den, so awesome for screenshots! xD
๐
"extDB2: Error with Database Connection1" anybody know how to fix this issue
Is there any way to obtain PositionWorld in the editor? When I copy position to log for use in createSimpleObject the resulting position is always way off from its original position in the editor
I'm creating a temp object on the position I get from the editor and then using getWorldPos on the temp object to plug into createSimpleObject, but always very different
getPosWorld*
@vagrant badge Both are installed yes
altislife or westland ?
Altis
are you have in @extDB2\extDB\sql_custom_v2 ini file ?
Yes
I got all that setup I got a mate name BoGuu to set it up but we thought it was because the Redist wasn't installed but that is no longer the case
Yes I have the username and password set etc
The last log was last night but this issue occurred today
check logs first and paste
So the log hasn't saved this error
The last one was saved on the 29th and I am on the 30th
no logs - no server started
correctly
maybe password to mysql changed by owner ?
try run server and chceck logs
I have, and it doesn't save the log
if dont save log - @extdb dont start if dont create log
Well the database isn't connected so I mean the log won't be their
install tads and run server corectly maybe you have error in commandline to start server
I will first thing in the morning; right now I have to go to sleep but I will keep it touch with you. But I am happy to show you via TeamViewer etc tomorrow
hmm
4.4r3 ?
first try to connect to databes by external software not arma and chceck connection
maybe password changed
๐ฆ i did see that, was hoping someoune found another way
Hello, which life.sql do i need to add on my Lakeside server? I used Captain Honda's tutorial.
@tough abyss just use mine
it was always said that load*commands works only within subdirectories of Arma 3 server root
absolute (full path) outside Arma 3 server folder for -servermod= , same with profile directories and cfg locations
it puts them out of reach by various load script command features which are limited (for logical security reason)
it's wrong to try put blame on the new performance build (atm. scripts.txt isn't working due to some changes in-need of BE update)
btw. fix filters to list addweaponcargoglobal is done too
cleared up some comment text so there is more clarity https://community.bistudio.com/wiki/server.cfg#Server_Security
just to avoid some 'i didn't knew' in near future ๐
not much, just most of the leaks is because of those were ignored/misconfigured and so on ...
and you can ofcourse imagine if someone places .ini , .cfg and his .db / .sql files into arma 3 server root (or subfolders) how it ends ๐
loadFile mysecret.ini , dump to variable, transfer over another command, laugh badly ... been there seen that, 2014 and so on ...
ironically this was exactly reason the alloweLoadFile settings were made for and why mod,servermod, profiles and configs supports full paths ๐
mod/servermod full path? Didn't knew that
Can anyone confirm whether remoteExec(Call) with target param set to an object is broken in SP eden editor preview? e.g. remoteExecCall ["someFunc",player]; is not executing in SP eden editor preview but remoteExecCall ["someFunc",0]; is
if you put an object as target it will query the server for it
I guess that if the server isn't present it's going to fail :/
my revive system
updated https://community.bistudio.com/wiki/server.cfg#Server_Security , to make it more clear what's not safe
nice job on adding a restart server command ๐ and also the super useful firedMan event
@lone glade makes sense....if that's true then it'd be an oversight on whoever made remoteExec
not really an oversight, just a design flaw
Thanks for updating the wiki Dwarden.
what design flaw ? @lone glade @thin pine
@lavish ocean e.g. remoteExecCall ["someFunc",player]; is not executing in SP eden editor preview but remoteExecCall ["someFunc",0]; is
alganthe was mentioning a possible reason why that could be
and if that was in fact the reason it'd be a design flaw
By eden editor preview, are you referring to when you actually it the preview button and load in? Or when you are still able to place objects?
the first one
so, SP testing
same issue happens in self hosted too since you're the server
if you use -2 as target you don't recieve the remoteExec
because, well, you're the server.
Well yeah but my problem is with the 'object' type variant of the target parameter
"Object - the function will be executed only where unit is local"
in SP: local player returns true. but the function does not execute
thing is, it checks serverside which ID has the object
Debug console uses this
//--- Local
case 0: {[[], _inputCode] spawn {_this remoteExec ["call", [player, clientOwner] select isNull player]}};
//--- Global
case 1: {[[], _inputCode] spawn {_this remoteExec ["call", 0]}};
//--- Server
case 2: {[[], _inputCode] spawn {_this remoteExec ["call", 2]}};
The two last notes are about it as well here https://community.bistudio.com/wiki/remoteExec
yer
but that's all about the number target type. I'm talking about the one where you pass an object as parameter.
someFunc = { systemchat "hi" };
remoteExec ["someFunc",player]; comment "does not work";
remoteExec ["someFunc"]; comment "does work";```
now anyway, I think i'll just post this on the tracker or sumn
oh and also (I feel like i'm repeating myself) remoteExec mode 1 is broken and increases bandwith use by a pretty massive amount, especially when a player connects
increase which will create desync and server crashes.
thanks @lone glade @native hemlock @thin pine the issues is now investigated there might be bug
With the new respawn system (https://community.bistudio.com/wiki/Arma_3_Respawn:_New_Respawn_Screen), is it possible to grab the role/loadout to allow scripting on selected units?
@worthy spade as far as I know there should be some global variables holding the current role... But you have to dig through the sources yourself as I don't remember what's the name of them is.
If I'm wrong then you might have successfully with the metaData array used inside the respawn script...
use getUnitTrait for that, it might not work with CfgRoles tho
Just found something very curious/odd, I guess my texture for the water fountain/waterfall reacts to the weather in the game? If it's a stormy day/night the water will actually become rough. Hmm I wonder what it'll do if I were to set the waves to max?
fixed @lone glade @native hemlock @thin pine see today's dev branch changelog
Brilliant @lavish ocean
๐
Is it possible to get a custom role from cfgroles in an if (condition)?
Something like "if (role Player = "xyz") then ..."
Sry, just realised @worthy spade asked the same question before.
Got it?
getUnitTrait/setUnitTrait just give a Unit a Trait like Medic, so he can use MedKits :/
but this is not what i need. ๐ฆ
but i guess i can use uniform as well... good enough for my intentions :]
@lone glade whats ?? i dont understand whats you write i english language
nope. everything i tried checked the editor unit, not the actual loadout -.-
maybe there's a variable set on the unit for the role? (not sure)
allVariables player
Hello, i want to ask for a help. Depending on wiki, there is command ctrlSetAngle for 2D controller in A3, but seems that it exists only in VBS. So, is there any alternatives to rotate gui elements? (link https://community.bistudio.com/wiki/ctrlSetAngle )
Are you on 1.62? It should be available
dank
does that mean leftPad is coming soon?
๐
What should I use now that camera.sqs is no longer...
arghs... what was the command to get the Terrain Slope/Vector... i can't remember -.-
nvm, found it surfaceNormal
If anyone has a need for a 3rd person view, 360 deg orbital camera (mouse controlled + zoom in out with mouse wheel let me know) let me know. Can attach to any object.
Essentially the same as the 3rd person free look mode
I would love to make a Squad'ish style game mode for Arma, capturing flags and building FOB's, get money buy more equitment. Anyone know if this game mdoe exists?
How do I skip an optional argument number?
For what command? The wiki should state a default value for that argument so you can use that
If you are in game you can look at the code of that function from the function viewer. If you have the game data unpacked it is in a3\functions_f\gui\fn_dynamicText.sqf
I'll have a look, thank you!
Here it is on pastebin http://pastebin.com/h5tTfiBw
It's actually pretty ugly, but you should be able to see the default values
thank you, any idea why Bohemia decided not to allow to pass something like null, or None?
@tough abyss http://www.tacticalbattlefield.net/forum/
โขAdded: A new "FiredMan" Event Handler
โขAdded: A new "PlayerViewChanged" Event Handler
โขAdded: A new BIS_fnc_attachToRelative function
โขAdded: A new BIS_fnc_vectorDirAndUpRelative function
โขAdded: A new BIS_fnc_weaponDirectionRelative function
โขAdded: A new setConvoySeparation script command
โขAdded: A new toFixed script command ```
PlayerViewChanged and setConvoySeparation werent mentioned, are they?
Both were in that last message.
@lavish ocean So with those new event handlers being added, is there any chance we could get an incomingFire one? >> https://resources.bisimulations.com/wiki/Category:VBS:_Event_Handlers#IncomingFire
Does anyone know how to get reliable icon scaling with drawIcon? Using 25 icon size on different terrains gives different effect. In the past I used (worldSIze / 8192) as a modifier, but that doesn't seem to be reliable
Actually nvm, i accidentally used it in two spots.
((getNumber (_vehicleCfg >> "mapSize")) * 0.075) / (worldSize / 8192) seems to work for scaling icons
the firedMan and PlayerViewChanged weren't on the main post @lavish ocean so I suppose they were added later
anyways i'll finally be able to finalize my base protection system, before it didn't pick up properly who from the vehicle fired (but still deleted the projectile), should be good now.
@austere granite Icon sizes had something to do with screen size constant of 640 x 480
I looked into this few years ago and had it figured
Found it, drawIcon size formula was: (480 / (getResolution select 5))
FiredMan not in 1.64 T.T
This size is entire screen's height
I'll take a look later. Seems to work okay already though.
Any got a clue on how to loop a sound while fading in / out it's sound level by any chance?
or not possible?
So I'm trying to spawn a zombie via the debug menu and I've got my code here "http://pastebin.com/t23Ld71t" and it spawns but it doesnt move, any ideas?
You're spawning the zombie at the player location making the move command pointless
I guess
Nope, I removed that and they still just stand there :/
removed what?
the move bit
try unit move [0,0,0];
also, setting them to careless will make them ignore pretty much everything
Hello, I have a vehicle issue. Simulation disabled and damage disabled in editor, init this lock 2; this addAction ["Unlock", "Unlock.sqf"]; this addAction ["<t color='#FF9900'>Push</t>","scripts\BoatPush.sqf",[],-1,false,true,"","_this distance _target < 8"];
_boat = _this select 0; _id = _this select 2; _boat enablesimulation true; _boat lock 0; sleep 2; _boat allowdamage true; _boat removeaction _id; unlock.sqf
when entering the vehicles on dedi you cannot get out
as if they were locked again
SP or MP?
MP dedi
check if _boat is local in unlock.sqf since lock requires the object to be local
actually, doesn't matter since you're able to enter the vehicle ๐
was about to say that
I do feel like it's something locality related though
it does seem that way, the boats will move just a tiny bit after unlock then seem to be stuck again
hmm
would the simulation and damage flags being set in the editor instead fo teh init have anything to do with it?
I'd suggest testing it without the simulation and damage stuff and just the locking
Fixed it by unlocking the vehicles and moving unlock.sqf to an eventhandler
@here Some vehicles have hitpoints in their config although they don't really have them physically. (for example the Hunter has the same eight wheel-hitpoints as the HEMMT although he only has four wheels) Is there a way to determine whether these hitpoints are just "fake"
how much usage of global setVariable is too much?
I just looked at exile and they only call it 95 times on client.
PS: I'm not really sure if this question fits more in the config-editing channel soo..... ๐
Mine calls it FAR more than that, and I'm wondering if it is affecting performance
@tender root Are they also returned by this command? https://community.bistudio.com/wiki/getAllHitPointsDamage
They are beeing returned, since they are pre-defined in the Config.
yes
"Car" iirc
+What Penny wrote.
- add a check, if the Dmg of that Hitpoint is > 0 . If not -> Ignore/Skip that one.
Thats how i did it for this, for example:
http://images.akamai.steamusercontent.com/ugc/269475820104408452/70AE0515D5005C9D259F73C9BAA24E46987D3106/
Yes they are beeing returned
Yeah but i want to get a average wheel damage of the vehicle to do that i would just sum them up and divide by the amount of wheels
get the current Cfg Entry and count it
iirc, there are just the "active ones" in it
e.g.
https://community.bistudio.com/wiki/configProperties
Example 3
with false, instead of true ( "true" stays!)
ill try
_HitPoints = [];
_GetCfgProp = configProperties [configFile >> "CfgVehicles" >> (typeOf cursorTarget) >> "HitPoints", "_HitPoints pushBack configName _x; true", false];
{diag_log _x}forEach _HitPoints;```
Try this one
Yeah seems to work
thx @jade abyss and @native hemlock
didn't know that command exists
And if all breaks loose -> getAllHitpoints -> forEach (getAllHitpointsArray select 0)-> if _x in ["Wheel1","wheel2"] (define all Wheels you wanna check) then ((GetAllHitpointsArray select 2) select forEachIndex)
something like that
erm... messy up there, but i think you get what i mean ๐
actually no ๐
then... i can't help you^^ I am too tired
no problem
the solution with configProperties seems to work so i will go with that one
im tired as hell aswell ๐ด
_Dmg = []
_GAHTPArr = getAllhitpoints cursortarget
{if(_x in [PredefinedArrayWithTheNamesOfTheWheels])then{_Dmg pushback _GAHTPArr select 2) select _foreachIndex}; }forEach (_GAHTPArr select 0);
_Dmg_Tot = 0;
{ _Dmg_Tot + _x;}foreach _Dmg;
_Dmg_Tot = (_Dmg_Tot / count(_Dmg_Tot));
hint str _Dmg_Tot;
don't think its clean, but gives you a hint ๐
(Means: Messy and (for sure) not the best way, but it should work like that :D)
i see exile does this to compile it's code
_code = compile (preprocessFileLineNumbers _file);
missionNamespace setVariable [_function, _code];
wait...nevermind, answered my question. ๐
wait, no i didn't. haha. why do they set the variable too? shouldn't _code = compile do it?
for reference http://pastebin.com/QEU68Qpx
global versus local vars, read up on them
_code compiles it, but there's no way for other functions to access it like that, that's why it's saved under missionNamepsace, which really just means _function = _code, except inthis case it'll be accesible everywhere
Mh why doesn't they use compileFinal for the function variable?
I changed it just to compile so that I can edit it in the debug console without having to restart mission.
it is normally compileFinal
Ah good
entities "WeaponHolderSimulated" is much faster than allMissionObjects "WeaponHolderSimulated"
yes
Yes, allMissionObjects for GroundWeaponHolder, entities for simulated ones
Also (allMissionObjects '') select {_x isKindOf 'WeaponHolderSimulated'} works just fine
its pretty slow
Your example should work fine too, problem must be from elsewhere
But yeah its better to let engine do class-dependent selection in entities and allMissionObjects for you, it is times and times quicker than scripted checks for larger number of entities in the world.
he means feeding the command the class and let it do the sorting in C++ land
second might be better since amo goes through each and every entity in the game each time you call the command
if (typeOf _x isEqualTo 'weaponholdersimulated') <- Just stood up, so don't judge me if wrong ๐
Yeah, its typeOf
You should try to get into more config stuff......once you're able to combine config work with scripting no-one can stop you :D except hard engine limitations
if ruins is a parent class of whatever object you're testing then it works fine
isKindOf goes through all of the parent classes of the object
gnah... arma! y u no update damage when u setHitpointDamage someone arghs... -.-
Remember there are Hitpoints index numbers or names to use with the set commands.
personally I like the index better.
try https://community.bistudio.com/wiki/setHitIndex @jade abyss
Nah, can't use that
Anyway to set a custom GPS window position in the mission file or in a mod? I want to move the GPS windows a little bellow.
The position is user defined, so I don't think it can be moved by a script.
@worthy spade I believe it have a default position, when you are in the Arma 3 Hud profile, where everything is default.
okay so apparently I am using the wrong bikey even tho I directly copied the keys from my PC to the server, and all I get is session lost. Before I would get the exact addon that was causing problems. How can I find that out now?
if it's related to keys it should also be reported to the RPT I think
session lost usually indicates a crashed server though
#server_admins <-- There they are talking. He posted that in several chans
Is there a way to get the location of a marker that a player has placed?
getMarkerPos <- ?
Performance wise, is it a bad practice to compile all the functions on the server and then PV them out?
It's stuff, that needs to be transported over the Net, each time a client connects, sooo...
If you are going to do that. Just do parts of files. I'm assuming your doing it to keep stuff secret...
short: Keep the script as simple and short as possible.
OR: Let the server handle the stuff and send requests over with remoteExec(call)
yes, both secret and to help prevent those who would try and exploit the files to their advantage. Such as if I make a mistake that allows them to do something on the server.
comes with my career. ๐
put the functions into a pbo for clients, and call them from the server?
ahhhh, ok, gotcha
thanks. ๐
I guess there is no way to switch throwable muzzle?
Interestingly SwitchWeapon action does change to throw muzzles but only if this muzzle is empty.
Yeah, there is no way
Is it me or explosiveSpecialist trait (setUnitTrait) doesn't actually do anything?
Hey, I have a problem, when exec my script i go "Error Undefined variable in expression: _vehicle" and i dont know why ...
My params are ok in my rpt : "50065600# 3: offroad_01_unarmed_f.p3d 10 50 1234"
params [
["_vehicle", objNull,[objNull]], //This return the current vehicle
["_armSpeed", 0, [0]], //Retrun 50
["_activateSpeed", 0, [0]], //Return 70
["_disarmCode", 0, [0]] //Return 1234
];
diag_log format ["%1 %2 %3 %4", _vehicle, _armSpeed,_activateSpeed,_disarmCode];
private ["_vehicle"];
[_vehicle] spawn {
waitUntil {speed _vehicle >= _armSpeed};
_vehicle say3D "bombarm";
hint "Bom armed";
waitUntil {speed _vehicle < _activateSpeed};
if (_vehicle getVariable "speedBombSet") then {_vehicle setDamage 1};
}; ```
When you spawn, you dont reassign _vehicle
Add params ["_vehicle"] after you spawn your code
omg -_- thank you !
Nevermind, explosiveSpecialist requires Toolkit just like engineer
how can i put the map(live with drwing and marker) on object like whiteboard?
Can't...not live
ok
Is it more effecient for enemies to be spawned in with scripts, or have them in the mission sqm itself?
Having a trigger issue. Type: none activation: BLUFOR Activation type: Not Present not repeatable server only. Condition vehicle player isKindOf "Air" The trigger fires as soon as the player enters an air vehicle instead of being in an Air vehicle and outside the trigger zone.
What's the onAct
script that ends the mission
is it single or multiplayer
multi
One group or multiple groups of players
one group
try syncing the trigger to the group, and you'll get new conditions instead of (Blufor,Opfor....) and get ones like (This vehicle, any of group, all of group)
Ahhh didnt think of that
make sure you use "thislist"
acutally if it's set up properly I think you can get away with using "this"
try this && {vehicle player isKindOf "Air" }
@indigo snow That worked thanks
this contains the BOOL value of the trigger conditions. Adding it back in means the conditions apply again.
AH ha
how to sqf:cmd sort config data type?
Let me guess: There is no way to retexture a BagBunker_Small that isn't debinarizing the p3d model, or is there?
@candid abyss your guess is correct
any idea how a "preview" model is done as seen in the first thirty seconds here? https://www.youtube.com/watch?v=XPJH75lzIiQ
did they create cutom p3d files?
they're probably warfare construction models
and therefore they should available in the samples?
if they included them then sure
I'm not 100% sure since it's been a while since I've played A2 warfare but I think it had those preview models
Going to search through the sample data, maybe I find some stuff.
@halcyon crypt you are right, it is indeed from the warfare construction thing. That also explains why in the video only some have the outline. But that is already a huge step forward
@Quiksilver#5042 agree with you. I had backup each 5 minutes on my high populated A2 Epoch server.
About don't worry too much about hackers.
The more you worry the more you get problems.
If only we had this command, then you could should something similar to that preview models https://resources.bisimulations.com/wiki/diag_drawmode
+1 @lavish ocean ๐
yeah this should be made available in diag.exe finally
there is also draw modes for AI
Yes pls
Well they recently added some more of the AI debug to it, and I think X3KJ added them to the wiki https://community.bistudio.com/wiki/Arma_3_Diagnostics_Exe
I want to have a "dynamic" text in my dialog so the I do it with sleep, but it's not clean I have 150 lines ... Anyone know how to optimize this ?
_text ctrlSetStructuredText parseText "<t size='0.8' font='PuristaLight'>Dรฉmarrage de la procรฉdure de dรฉsamorรงage en cours<t/>";
sleep 1;
_text ctrlSetStructuredText parseText "<t size='0.8' font='PuristaLight'>Dรฉmarrage de la procรฉdure de dรฉsamorรงage en cours .<t/>";
sleep 1;
_text ctrlSetStructuredText parseText "<t size='0.8' font='PuristaLight'>Dรฉmarrage de la procรฉdure de dรฉsamorรงage en cours ..<t/>";
sleep 1;
_text ctrlSetStructuredText parseText "<t size='0.8' font='PuristaLight'>Dรฉmarrage de la procรฉdure de dรฉsamorรงage en cours ...<t/>";
sleep 2;
_text ctrlSetStructuredText parseText "<t size='0.8' font='PuristaLight'>Dรฉmarrage de la procรฉdure de dรฉsamorรงage <t color='#26b026'>OK</t><br/>Chargement du code<t/>";
sleep 1;
_text ctrlSetStructuredText parseText "<t size='0.8' font='PuristaLight'>Dรฉmarrage de la procรฉdure de dรฉsamorรงage <t color='#26b026'>OK</t><br/>Chargement du code <t color='#26b026'>OK</t><t/>";
sleep 0.5;
_text ctrlSetStructuredText parseText "<t size='0.8' font='PuristaLight'>Dรฉmarrage de la procรฉdure de dรฉsamorรงage <t color='#26b026'>OK</t><br/>Chargement du code <t color='#26b026'>OK</t><br/>Anaylse de l'architecture systรจme .
<t/>";
sleep 1.5;
_text ctrlSetStructuredText parseText "<t size='0.8' font='PuristaLight'>Dรฉmarrage de la procรฉdure de dรฉsamorรงage <t color='#26b026'>OK</t><br/>Chargement du code <t color='#26b026'>OK</t><br/>Anaylse de l'architecture systรจme ..
<t/>";
Demo : https://www.youtube.com/watch?v=sYt6PnGO_9g&feature=youtu.be
well the really useful ones are like AI view, AI roadmap, AI cost map, AI danger map, etc
its kinda weird also that they dont share the diags used for the pathfinding eventhough they want repro missions
I fucking wish I had access to them
dont we all?
@elfin bronze setup an array with the string and the time it should wait and go through that?
{
_text ctrlSetStructuredText parseText (_x select 0);
sleep (_x select 1);
} forEach _yourArray;
something like that I guess
_yourArray = [
["<t size='0.8' font='PuristaLight'>Dรฉmarrage de la procรฉdure de dรฉsamorรงage en cours<t/>", 1],
["<t size='0.8' font='PuristaLight'>Dรฉmarrage de la procรฉdure de dรฉsamorรงage en cours .<t/>", 1],
// etc
];
it's probably better to append the periods instead of having separate strings though.. ^^
Oh thank i test this tomorow
Ok i try it it's work but le text is whipe each time :/
I try this but it's still whiped
{
_text ctrlSetStructuredText parseText format ["%1%2", ctrlText 36901,_x select 0];
sleep (_x select 1);
} forEach _textToShow;
36901 isnt anything
lol @ people trying to hide SQF code from prying eyes
just GIVE UP
seriously, every solution you can think of is easily countered.
Trust me, I know more than you about SQF and how it works.
greetins gentlemen , how would i impliment a sound feed back when i kill enemy ai or anyone in my missions ?
if AI or player kill ,play sound ?
wat event covers both ai and player death ?
need your support guys
well i guess you are right to large parts; however the AI code is probably in the worst state of all engine parts; and there is only limited AI programmer talent on the market; finally to switch to another solution is not feasible I'd assume; the thing VBS decided to use didnt seem to "explode" either
however i would assume they still wand and will reuse most AI parts for the new engine
maybe merge it somehow/somewhat with the ToM/CC AI engine parts
I think VBS has a 3rd party AI system
@grizzled cliff is intercept still on your radar or is it abandoned?
a few high level questions:
- how does one best cache the content of a text field in a dialog - save to profileNamespace?
- is there a functionality/framework in A3 already to have a history for a text field (last 10 entries)?
- can one verify the input of a text field for correct sqf to avoid errors on execution?
Related to 1) and 2), CBA extends the vanilla debug console to allow you to navigate to "previous statements", and it appears they do it using profileNamespace. I'm sure they can explain it further but here is one of the related functions https://github.com/CBATeam/CBA_A3/blob/master/addons/diagnostic/fnc_initExtendedDebug.sqf
cheers
yes, the expressions from the extended debug console are stored in the profile. this is the only way to keep them persistent between game starts
i know you all know this, but this is how I think about it:
missionNamespace... persistent during mission, deleted after mission restart
uiNamespace... persistent during session, deleted after game restart
profileNamespace ... persistent across game restarts
would you limit the amount of entries to store? also when to store - on execution or when no longer focusing the field?
I think it's all in one variable ... array
on execution
note that enter key is bugged atm. only pressing the "exec" button(s) works
also i guess it would be useful to have also to select from the list of saved entries, rather to step through them one by one (probably that list should be unique entries only and sorted)
maybe. that's not what it does atm. atm it just goes backwards (or forwards) in history
I think it would be usefull to have a "exec scheduled" button
so you don't have to write 0 spawn { .... }; all the time when testing if your function actually works in it's intended environment
But generally debugging with the console isn't helpful imo. Just set up a proper dev environment and reload the mission
I guess that is due to the debug console obviously not understanding macros, which I usually use
limit is 50 statements in the array, apparently
githu lies. this function is from nou. I just put it in one file instead of having all this in the general pre/postInit function directly
Does anyone know of a way to script the creation of players? I would like to have a script that creates the playable units so I don't have to do it manually in the editor everytime I create a mission.
not possible -> https://community.bistudio.com/wiki/setPlayable
NOTE: Currently in Arma 3 this command does nothing.
it's kinda expected because the host/server needs to know how many slots are available
That's a shame, I was hoping there was a way to execute some code prior to the lobby to create the units and just define the player numbers in description.ext
I suppose I could just do it manually in the editor and make it a composition that I can add in when I start a new mission.
"exec scheduled" button
@little eagle good point. will consider it
@sly mortar open sqm in text editor
use (regex) search and replace to mass add the attribute to the desired units
i will make these stuff available directly in the updated console of mine
https://community.bistudio.com/wiki/Arma_3_Diagnostics_Exe
I tend to not edit the sqm file manually as it seems to get rewritten each time I open it in the editor.
what i am unsure about is convenience functions for mission testing or AI debug
@sly mortar you're doing it wrong then... ^^
if you edit the (unbinarized) sqm file and reopen the mission in the editor it will have your changes
yeah. reopen the mission before saving it again ingame. otherwise you overwrite your changes with the temporary files which don't have them
save -> alt tab, edit, -> load
player SetPos [(getMarkerPos _dest select 0)-10*sin(_dir),(getMarkerPos _dest select 1)-10*cos(_dir)];
hey can anyone tell if theres anything wrong with this?
the array after setPos requires 3 elements, xyz
so there must be a second comma somewhere
also you might wanna use the alternative syntax of getPos
origin getPos [distance, heading]
so:
player setPos (getMarkerPos _dest getPos [10, _dir]);
looks way less confusing (if you get used to the alternative getPos syntax)
just a quick question... what is the arma 3 scripting language? I am a sort of advanced beginner programmer, learning to program with Python, btw
ok thanks
actually one more question ... would it be possible to adjust the brightness of helicopter gauges via scripting? They are too bright when night flying
no
that's what I suspected
you could overlay them with a semi-transparent image .. ๐
that's an idea!
do you mean those 2d things from advanced flight model?
yes, there are 4 of them near bottom of screen in advanced flight
you actually can change them
you can move them in Layout I think
really the only problem is the brightness, and as I say, only when night flight... i like this transparent overlay trick idea
can you give me a hint how to start learning how to do that?
I can program like a beginner ๐
dearie me
I wonder if i could use an always-on-top prog totally outside the game and just stick it on
maybe I can figure something out, but getting the controls only via scripting...
using CBA?
cba = already-existing mod?
yes
if i were to make a mod, does that mean I couldn't play on any Mulit server that didn't also run that mod?
everyone would have to have that mod
hmm perhaps not the best approach then
hey guys how come this doesnt spawn the weapon "arifle_Mk20_GL_plain_F" createVehicle position player;
createvehicle uses objects, not weapons
you have to create a "ground weapon holder"
it's basically the same as a ammo box. you can add the weapon to it via addWeaponCargoGlobal
@fallen skiff the display can be found using uiNamespace getVariable "igui_displays"
but it shows a bunch, so you have to figure out which one it is. The position can change though depending on what you do
you also have to adjust the controls every time they are created.
basically every time you enter the helicopter or a savegame is loaded while sitting in one
just checking game options/layouts and colors...
I found uiNamespace getVariable "igui_displays" in binary game save files, is that where I should be looking?
nope. they never adjust it via scripting
It's added to by initDisplay
not really. initDisplay is just a function that runs after the display is created via engine magic
class RscInGameUI {
class RscUnitInfoAir;
class RscUnitInfoAirRTDBasic: RscUnitInfoAir {};
class RscUnitInfoAirRTDFullNoWeapon: RscUnitInfoAir {};
class RscUnitInfoAirRTDFull: RscUnitInfoAirRTDFullNoWeapon {};
class RscUnitInfoAirRTDFullDigitalNoWeapon: RscUnitInfoAir {};
class RscUnitInfoAirRTDFullDigital: RscUnitInfoAirRTDFullDigitalNoWeapon {};
};
it's one of these if you wanna go with config
what file is that found in?
no idea. I got it from the all in one config
ui_f ?
Yup A3_Ui_F, so add that to requiredAddons in CfgPatches
I'm afraid this is a bit over my head -- what do i need to study first to eventually do this?
am I making a mod for my own testing purposes?
Don't say that it's over your head.. ^^
Having a goal in mind is a great way to actually learn real stuff ๐
"I want to reduce brightness on the AFM dials" is way better than "I want to learn SQF"
but yeah, everything related to configs will have to be done with a mod
yes I'm just trying to find where to begin.... I found the Config lists in the debug editor thing
so I will be creating a mod?
yep
you're probably better of getting an AllInOne config dump than using the shitty config browser ๐ https://forums.bistudio.com/topic/191737-updated-all-in-one-config-dumps/
yes I understand that
awesome
in one sense what i want to do may be simple -- i'll make a mod using everything that exists already, with one little helicopter, but I'll try to change the AFM dials only
http://killzonekid.com/ is another great resource which is more tutorial-ish
^ that's mostly about scripting though
I see he makes things like '3D Compass' in Arma -- I'll contact him and see what he thinks about chaning dial brightness
There is a way to know if a vehicle can be destroyed? For exampe, sand bags can't be destroyed, and i need to detect it.
Found: Need to check for the existence of classes inside the vehicle class DestructionEffects. The sandbag have an empty class DestructionEffects.
Look at destrType
Also I think you might need to look at "armor" as I think some objects can be destroyed but practically impossible due to extremely high armor value.
Pretty much you need to check for DestructNo or 0 values in there
There is also DestructDefault case which takes destruction type off p3d, you'll have to guess it by model name and purpose in such case.
@halcyon crypt Yea, kinda dead. Wish someone would take it up in my absence. Too busy building satellites now.
@meager granite thanks for the tips.
To avoid the case where some building explode and others not i'm using deleteVehicle on everything that is not motorized and setDamage 1 in everything that is motorized (cars, tanks, Heli, planes...). This is part of the player properties management, where he can destroy his stuff anytime.
how to sort configFile data type fastest?
array sort true doesnt work for it
toString with configName; sort the array of strings; determine the position of the elements with find and reshuffle the original array that way?
sort by the configName?
(array apply {[configName _x, _x]} sort true) apply { _x select 1 };
which is pretty much what you said i think
thanks! let me check how it goes
not sure if that's enough brackets.. might need ((array apply {[configName _x, _x]}) sort true) apply { _x select 1 };
hm
it doesnt like to have sort applied on the array returned by apply directly as far as i can tell
e =(c apply {[configName _x, _x]}); e sort true;
i dont get this part though: array apply { _x select 1 };
ah nvm
<- stupid
ok speed test now
the apply x select 1 is to convert it back from [configName _x, _x] to just _x
yep i got it ๐
unfortunately its not that much faster to the other approach
_cfgEntries = (_cfgEntries apply {[configName _x,_x]});
_cfgEntries sort true;
_cfgEntries = _cfgEntries apply {_x select 1;};
probably the double array creation slows it down a lot
yeah
previous:
{
if (count _this < 2) exitWith {};
private ["_array1", "_array2", "_tmp", "_isSorted"];
for "_inc" from 0 to (count _this -2) do
{
for "_dec" from _inc to 0 step -1 do
{
_array1 = toArray(toLower(configName(_this select _dec)));
_array2 = toArray(toLower(configName(_this select _dec +1)));
_isSorted = false;
for "_i" from 0 to (count _array1) do
{
if (_i >= count _array2 || {_array1 select _i > _array2 select _i}) exitWith
{
_tmp = _this select _dec;
_this set [_dec, _this select _dec +1];
_this set [_dec +1, _tmp]
};
if (_array1 select _i < _array2 select _i) exitWith {_isSorted = true}
};
if _isSorted exitWith {};
};
};
};```
would be nice if you could put a custom predicate on sort.. something like 'array sort { configName _this > configName _other }'
for now i think doing it manually is the best performance though
well ive asked KK if they could make sort work with configFile data type ๐
Would it be possible to override the function call of the Spectate button on the respawn menu? Meaning, I'd like to call my own function instead.
Make something that triggers once (findDisplay 49) exists (the menu)
Then look up the IDC of the spectate button and add from there
Tweaked: Vehicle-in-Vehicle Transport vehicles now have their side set when loaded with another vehicle
Tweaked: It is now possible to load a vehicle into an enemy vehicle by script or editor
Added: The ability to load data from a config class using unit setUnitLoadout config
BRPVP Tip: You can make custom buildings appears on map easily with draw rectangle and getting bbox x and y sizes. The "artificial rectangle" match perfectly the map native buildings.
i have a question why do my characters never enter the incapactitated state even after i enable there attibutes throught the editor
am i doin something wrong?
Question about saving profile namespace, does clearing the user profile saved/usersaved folder not clear it properly?
I want to make an in-game overlay using scripting, is this a reasonable scripting thing?
yes
BRPVP Tip: Programing + Cooffee + Cheese is good.
hurray i just made my first ever functioning script, here it is: sleep 5; hint "hint says hello";
it works
I hope you will all subscribe to my new YouTube channel, "Vicious Lee -- Postdoctoral Scripting."
I'm watching video tute on beginning scripting, the guy tests his scripts with something called "Model Viewer." How do i do that? Right now I'm just testing by restarting the mission from Eden Editor
testing scripts or models? I think that'd be buldozer
made progress, got Arma 3 tools running correctly
i want to create a dialog that will be open and user will be still able to play
and then the dialog name?
_screen = createdisplay "monitor";?
What a maximum value of a variable where type "number"?
Nice, thanks
Any ideas on making objects that are attached to players not collide with players in multiplayer missions? I've been thinking this for a day now and can't come up with a JIP friendly and good solution in terms of performance
Carrying objects? Will they be carried long enough to justify worrying about JIP?
Disabling the simulation should also disable collision...
I don't think position updates will be made if you disable their simulation. maybe attachTo overrules that though. the command causes constant position updates (and therefore constant traffic)
I'll try it out. Thanks.
@little eagle constant position updates like to use setPos each frame?
@crimson hawk hey, was able to enable incapacitated state? I also have interest in this one.
@tough abyss i was somehow it worked and im not sure how but i enabled the revive and respawn ability throught the missions attibutes page and when i uploaded the mission to my dedicated server it worked but did not work in the editor so im not sure
@tough abyss but i would just try it throught the editror
@crimson hawk thankyou, i will try that.
disableCollisionWith does not work with PhysX objects
constant position updates like to use setPos each frame?
kinda, but not each frame
Can someone tell me how to get this bit of code working in editor --
private "_private";
_playerPos = getPosATL player;
drawIcon3D [
"\a3\ui_f\data\IGUI\Cfg\Radar\radar_ca.paa",
[0,0,1,0.5],
[_playerPos select 0,_playerPos select 1,2.3],
5,
5,
direction player,
"COMPASS",
0,
0.03,
"PuristaMedium"
];
};```
where do i put it? init.sqf didn't seem to work
I see it references the P drive, I have that mounted and all the correct folders and files seem to be there
other little statements and commands in init.sqf DO work for me now
so i know the basic scripting routine is working
ok
addMissionEventHandler ["EachFrame", { ... }];
But if you do this for drawIcon3D then you should use Draw3D instead of EachFrame
well the game is seeing it now, but I have an undefined variable, would it be 'player'?
I think I need to declare some variables before this block?
I mean that I write this in init.sqf, then I 'Play Scenario
from the Eden Editor
perhaps I should not have said "call this in the editor"
Here let me paste my entire init.sqf, it is very small:
Draw3D {
private "_private";
_playerPos = getPosATL player;
drawIcon3D [
"\a3\ui_f\data\IGUI\Cfg\Radar\radar_ca.paa",
[0,0,1,0.5],
[_playerPos select 0,_playerPos select 1,2.3],
5,
5,
direction player,
"COMPASS",
0,
0.03,
"PuristaMedium"
];
};```
that's all I have in init.sqf so far. I must be missing something?
yes I'm trying to understand
you write
addMissionEventHandler ["Draw3D", { ... }];
and put your script into the curly brackets
instead of "Draw3D { ... }"
like this?
{
private "_private";
_playerPos = getPosATL player;
drawIcon3D [
"\a3\ui_f\data\IGUI\Cfg\Radar\radar_ca.paa",
[0,0,1,0.5],
[_playerPos select 0,_playerPos select 1,2.3],
5,
5,
direction player,
"COMPASS",
0,
0.03,
"PuristaMedium"
}];```
that can't be what you meant
got it, works
Military simulator vs military game
I'm sure they're looking over everyone's shoulder, just like everyone does in the same industry.
Or do you mean something specific they've blatantly copied from modders?
That's a good thing...bohemia does it too
It'd be bad if companies didn't look at ways to improve their product through a possible modding community
First two very noticeable examples that popped up in my head happen to be Gluck's work. Firing from vehicles and more noticeably and recently the squad radar
But yeah i get that the vbs team's looking at arma modders' ideas...:P
are they doing it well though?
Well, modders do it for free, VBS designers do it for money. ๐ค
And BIS does share a lot of their ideas publicly on their website and videos
ehm like what?
do you have an example
BIS does share a lot of their ideas publicly on their website and videos
So turns out Tanoa objects are physically unavailable if you don't have DLC bought and will be invisible if placed in the game.
@velvet merlin I'm not exactly sure what kind of ideas are we talking about, but they have a bunch of youtube videos for example. I assume there's a lot of ideas there...?
Probably just no p3d, I guess it calls error on clients too
Didn't test, but it sure does happen with pillboxes
Actually fire geometry is bigger than visible hole
So there are some threshold where you can shoot through the wall
Just tested, no error on client, just invisible
Nice
isClass(configFile >> "CfgVehicles" >> "Land_PillboxBunker_01_hex_F") => false
on client without apex
So none of these green repainted buildings are available or visible on clients without apex
If you know the selection names use selectionPosition with a distance check in the condition of the addactions
If close to left door show option
Saves you UI work and stays closer to native controls
Is it possible to instantly stop any gestures currently playing?
in this case I'm playing gestureHandFreeze, but I'd like to switch to some other (Make some custom ones) but it entirely depends on whether I can stop them whilst playing
Is there a nice way to select a specific digit of a number?. Ie if i have 12 in a variable then i get split it into 1 and 2
Grey, one of the alternate select syntaxes will work.
Couldnt see a number syntax for select. Closest was the string but i didn't fancy messing with converting strings. Ill see if the basic syntax works
@wind heron
(str 12) select [1,1]
or
parseNumber ((str 12) select [1,1])
Do you know how many digits there will be, and can there be decimals?
Whats the difference between preprocessfile and loadfile for loading a function in an external file
also whats currently the best texteditor + addons for development?
stridey i'm very new to sqf but the doc pages for those two commands suggest that loadfile simply reads and returns the content of its target file, whereas preprocessfile actually executes any commands and functions in it
loadfile returns a string containing the contents of the file
Yeah. I was just looking at the different ways
Both need to be compiled so eh
ill stick to loadfile
I have 2 vars that needs to be changed together, or before anything else executes, to maintain consistency on others scripts that use then. There is a way to garantee that?
also whats currently the best texteditor + addons for development?
Imo Sublime Text 3 with this SQF syntax plugin https://github.com/JonBons/Sublime-SQF-Language
Whats the difference between preprocessfile and loadfile for loading a function in an external file
withpreprocessFileLineNumbers, the file will be preprocessed, which means that all comments (// comment,/* comment */) are removed and all macros are resolved.
WithloadFile, the file is directly converted into a string.
loadFileis a nieche command and not very usefull outside a few edge cases. Never usepreprocessFile, as thelineNumbersversion is more powerfull, in that it adds the line numbers to error pop ups, which greatly helps debugging.
I have 2 vars that needs to be changed together, or before anything else executes, to maintain consistency on others scripts that use then. There is a way to garantee that?
Execute the script that sets these two variables before the other scripts and IN UNSCHEDULED ENVIRONMENT. Either via preInit, or you force unscheduled environment with one of the various tricks out there.
hey guys, so i got this script to spawn zombies in but i cant make the zombies attack civs? any ideas? http://pastebin.com/tqE0uhmT
@meager granite
So turns out Tanoa objects are physically unavailable if you don't have DLC bought and will be invisible if placed in the game.```
I told you a few weeks ago ๐
Anyone know off the top of their head what happens if you use the localize script command and the key doesn't exist?
""
perfect
might cause RPT logging
Just use this? https://community.bistudio.com/wiki/isLocalized
: )
@rocky marsh the z's you're making are civilian themselves. it won't target its own faction.
civilian setFriend [civilian, 0]; <--- this would set all civlians against each other.
I guess don't arm non-zombies
ive made them east, west, independent, etc etc but it wont work?
i tried that
but it still didnt work :/
"Have effect only when called on server" ... fyi. shouldn't matter if you tried in the editor.
I was on a server doing it..
[ civilian, [ civilian, 0 ] ] remoteExec [ "setFriend", 2 ];
@little eagle thanks
Brendan, although we don't really support zombies on the civ side, try enabling the "Allow zombies to attack civilians" options in the zombie settings or abilities module
Odds are that'll attack fellow zombies tho
BIS
Because BIS campaign missions don't need it
^ +1
So anyone knows waddap with selectionNames on a house showing "door_handle_1" but when using selectionPosition "door_handle_1" it returns [0, 0, 0]
Is there another way to get the position of that memory point?
Is there some actually good reaosn that it's impossible to retrieeve thse points that obviously exist? I also checked the rotation sources and so already, but none of those give me a position either.
did you tried alternative syntax? https://community.bistudio.com/wiki/selectionPosition
I guess that selection exist in visual lod only
and selectionPosition returns pos from special lods only
Yep tried all of them
The Door_Handle_N_Axis does return a position... ofcourse that one isn't shown through selectionNames though ๐
// -- Try to get the door handle position -- //
private _splitPosition = _memoryPoint splitString "_";
private _trySelection = format ["%1_Handle_%2_Axis", (_splitPosition select 0), (_splitPosition select 1)];
private _doorPos = _building selectionPosition _trySelection;
private _realTime = false;
if (_doorPos isEqualTo [0, 0, 0]) then {
_doorPos = _building selectionPosition _memoryPoint;
} else {
_memoryPoint = _trySelection;
_realTime = true;
};
extremely elegant, but it works
Are there other ways to enable the new revive system other than the module on the map?
ah so its not a module, its a EDEN setting hm
Hey Guys!
Is there any option to add a big radio (tfar) to a civilian car/the police car?
@tame portal you can use the description.ext to activate the revive system
So, the same "old" commands?
Old?
Just look up the different commands for the description.ext and there should be some listed in order to configure the revive system (what I know for sure is that you have to use the "revive" respawn template)
There are in fact commands but they are listed as "old"
Overhauled by the new system, no indicator whether the old commands still have their functionality though
How do I make the simplest possible overlay? I just want to start with drawing a black rectangle which covers part of screen (later I will make it transparent to filter brightness of some HUD elements)
I added this on description.ext to enable revive:
respawnTemplates[] = {"Revive","Counter","Base"};
reviveDelay = 6;
reviveForceRespawnDelay = 3;
reviveBleedOutDelay = 120;
But was unable to test it because i continue to die without a incapacitated stage.
Any help please? ๐
Revive Tutorial: https://community.bistudio.com/wiki/Revive_remastered
Well, if you actually read that page you will notice that you configure revive in the editor nowadays. ๐ซ
Yes. Still not work, not sure because i'm alone on server and there is no one to revive... but will keep testing.
I believe it only works in multiplayer.
Thankyou for the help. I noticed my mission.sqm is a little screwed... i will try do to it 100% the Eden editor and then put it in my mod.
I did it manually.
When setting multiplayer settings is it better to do it manually or use the editor?
You have more control in the configs. 3den multiplayer settings works just fine though.
If you can figure out what was changed in the sqm by Eden editor, you can change your sqm file manually. I will go for trying to do it 100% at Eden editor.
I'm having issues opening the sqm I use notepad++ and downloaded a config for it but it still is encoded
a program called unRap can convert it to txt
awesome thanks ๐
๐
@humble frost on the general atributes you can uncheck the last option "binarize mission" and i believe it will be saved as text.
really? Awesome thans @tough abyss
If the Wiki is missing a Syntax -> Check the Debug Console:
logNetwork [filename, filter]
does it even work?
No clue
I wish there was case-insensitive in command, toLower'ing strings or doing count check with == comparison is so much slower than single command when dealing with large arrays
== is already case-insensitive
but it means you'll have to execute code block for each array element while in command is fully handled by engine but case-sensitive
Or you meant that in command does isEqualTo check?
It does indeed, but I was looking for case-insensitive fast solution
Fast != Arma =}
new to scripting, quick question.
with Params;
params [["_mode", "", [""]] what does that third value mean? the [""]
I see that the _mode value is set to "" (or whatever param I send to it), but what is the [""] saying? Wiki suggests it's.. expecteddatatypes, expectedarraycount but none of that makes sense lol
https://community.bistudio.com/wiki/params
[variableName, defaultValue, expectedDataTypes, expectedArrayCount]
https://community.bistudio.com/wiki/params
https://community.bistudio.com/wiki/param
expecteddatatypes = Bool, Number, String, Array
expectedarraycount = afaik optional
check Param
[""] means that only strings will be accepted
["",[]] means: String AND Array is accepted
+1 sa-matra! that also explains the other half of the param values; I assume [0] means only ints
like when you expect a number:
_res = [0] param[0,-1,[-1]];
hint str _res; //0
_res = [""] param[0,-1,[-1]];
hint str _res; //-1
Thanks to you both!
yw
Anyone know of a way to have dedicated server save container contents between sessions and persist?
db
MySQL hell
What would be the best way to write a mission that extends the default exile one? I don't want to have to edit core files because then when I want to update exile it will be living hell
profileNamespace is sufficent enough since you don't need to share it between servers
eh having done research looks like my only choice is to edit the core files
kek
why cant this be more like gmods modding api
Well you can create your addon for server which registers your CfgFunctions and then simply add in calls (instead of code itself) to your functions in exile server side
Anyone know how i can remove all items from a player?
removeAllWeapons _unit;
removeAllAssignedItems _unit;
removeAllItems _unit;
removeAllContainers _unit;
removeHeadgear _unit;
oh, would this work in a trigger?
seeing triggers don't do anything magical special things.. yes
Thank you.
Obvoiusly you'll have to make sure that _unit actually refers to whoever you're trying to remove from
yeah'
I have a code statement i want to add in BE script.txt filter, but this statement is from Arma 3 vanilla code and is splited in 4 lines. How i add it to script.txt if it is 4 lines?
For example:
[
"B_CAR_F",
100
] someFunction;
@native hemlock please post more gists on your github
i've had it in a stack of tabs for months but you haven't posted anything new in months ๐ข
lol of what though? I've run out of ideas for debug type stuff
RTS camera please
AI debugs
Hi guys, may I ask you if anybody knows if this
while { (hour < 12 && hour> 00 ) && (count >playableUnits < 10) } do {};
Is more resource-heavy than this
while {true} do { if ((hour < 12 && hour> 00 ) && (count playableUnits < 10)) then {}; sleep 1800; };
Thank you all
it is, because the first one evaluates multiple times in a frame
So it's running all the time
also the first one has a script error
the second one too. pseudo code?
you can also put the sleep into the while code field
while {sleep X; <CONDITION>} do {<STATEMENT>};
Is there any way to freeze the current time in Arma?
I want the environment to stay at a particular light level.
setAccTime 0
At the very least, slow it down as much as possible.
Thank you!
I can put this in the initserver safely, yes?
this works in MP, but it's only the daytime, not the speed things move
Does anyone know how to track terrain objects getting destroyed? For example destroying a radar tower that has already been placed onto the map?
you add a "killed" event handler
a piece of code that will be executed when the assigned object dies
How can I track a preplaced object though?
hmm, you probably can't
I could have sworn there is a way but okay thanks though ๐
I mean, you can try adding the event handler anyway
It's what I think im going to do
I was told BI did stuff with streamed objects
Oh okay if this makes it easier I managed to find the object id for the tower
nah
okay guess im placing an invisible object that will get destroyed lol
just place a game logic on the tower and get the object with nearestTerrainObject or some command like that
okay
oh really how come?
when BI changes the map, the ids are completely different
e.g. when they add a rock on the other end of the map
oh okay this is for thirsk from arma 2 though so I don't think that there are going to be any updates to it
maybe. do what you want. just warning you about what might happen
a "killed" event handler is the solution
Yeah i get that ๐ thanks for the help there though commy ๐
@little eagle cool! didn't think about that
you should always put the sleep in the condition. otherwise you still have a death loop if the condition is false
imo
Oh, another question. Is there anything I can do to prevent players from picking up enemy equipment?
hmm
maybe don't let the players open the inventory on them as containers?
return true to overwrite
You have to somehow figure out that the container is from an enemy
it will be ugly and finicky. no easy way unfortunatly
Is it AI only?
The enemies? Yes.
In a name like "A3_Characters_F" -- what does the F indicate?
iirc futura the original name of arma 3
@tough abyss [\n"B_CAR_F",\n100\n] someFunction;
@mint frost thankyou!
anybody got an idea to disable ONLY PhysX? (enableSimulation falseis not an option, since i need it enterable (seats))
hello, I'm trying to give a trigger a statement by a code but it seems not to work.
_newTrigger setTriggerStatements ["this", "_newObject animate ["Door_1_rot", 1]", "_newObject animate ["Door_1_rot", 0]"];
11:00:48 File C:\Users\***\Documents\Arma 3 - Other Profiles\***\missions\***\***\***\***_charlie.sqf, line 44 11:00:48 Error in expression <atements ["this", "_newObject animate ["Door_1_rot", 1]", "_newObject animate ["> 11:00:48 Error position: <Door_1_rot", 1]", "_newObject animate ["> 11:00:48 Error Missing ]
_newTrigger setTriggerStatements ["this", "_newObject animate ['Door_1_rot', 1]", "_newObject animate ['Door_1_rot', 0]"];
should work
oh you changed " to '?
you used " iside a string started by "
if you do that the string would end there leaving the rest as unknown syntax
strings in strings must always be mentioned in another "style"
if you start with " use double " or '
for any string inside
does it matter if I start with " or '?
be aware this must be the case for each "childstring"
the highest depth is therefore 3 afaik
and would look like: "blaaa ' bhasd "" blahh "" ' "
however, you problem is solved isnt it?
no errrors but the trigger's still not working
_newTrigger setTriggerArea [4.588, 8.851, 0, true, 4];
_newTrigger setTriggerActivation ["WEST", "PRESENT", true];
_newTrigger setTriggerStatements ["this", "_newObject animate ['Door_1_rot', 1]", "_newObject animate ['Door_1_rot', 0]"];```
it should work isn't?
Info: You can also start strings with '
systemchat '"Test"'; // "Test"
systemchat "'Test'"; //'Test'
yeah so it can be both ways
Should work, as you wrote it up there
it's weird because in my case the gate won't move
try animateSource
_newObject animateSource ['door_1_source',1]
(wich is also better in MP)
the code is working I checked it in the editor now
still: You should switch to animateSource, it has the fancy doorknob anim in it ๐
I'm using a gate ๐
It is recommended that animateSource command is used instead of animate whenever is possible, as it is more efficient and optimized for MP
still not working :/
["WEST", "PRESENT", true]; means the activation key is BLUFOR, it's present and repeatable, right?
No clue, i don't use trigger anymore^^
ok I debugged the trigger with hints and it's working so it's something about the door anim code
Guys, remember me please addon / mod name where u can deformate gound by explosions
in real time
Arma support it
or how to do it by self?
that was DBO Afghanistan or something
its not Afganistan, it was standalone addon
well it was by DBO anyway
you have to escape the quote marks
dammit discord
_newObject is undefined in the triggers scope, @tough abyss
god damit ####### discord
@night void http://www.armaholic.com/page.php?id=10695
seems like it's a terrain that's generated during the mission
Hi guys, just a quick question
Would you use the callExtension command in a while condition or it would need too much resources?
I'm trying to use the "9:LOCAL_TIME" command with extDB
So it would end up like this
while { (((extDB2 callExtension "9:LOCAL_TIME") > 0) && ((extDB2 callExtension "9:LOCAL_TIME") < 12)) } do {};
(Pseudocode)
why dont you use missionstart (add it up with servertime
delivers the exact real life date and time
@halcyon crypt i seen same thing for Arma 3