#arma3_scripting
1 messages ยท Page 244 of 1
You're never going to hide any code from somebody who wants and knows how to take it in ARMA
You have to edit the script that overwrites though
I'm quite aware BoGuu
not the script were the variable was overwritten
Just shift stuff server side then, it would have alot more effect than renaming variables
If I ever develop anything independently for Arma, it will be 100% stealable
I have
But this is all client side stuff for displays and the like
Not good on the server ๐
You're trying to 'obfuscate' your dialogs?
No
I have scripts that change their contents and stuff
Trying to obfuscate those
You can still put those server sided
Did you write these originally?
My efficiency is pretty great atm, thanks
Yes, I did
I wrote this whole mission with Benargee's help
We're hoping to release soon
Definitely should start using private
You're releasing an 'obfuscated' mission ๐ซ ?
No
"We're" releasing an obfuscated mission
Independently, I'm all about open source
I really dislike this obfuscation nonsene :/
Open Source, yay
I repeat, I'm not the boss, it isn't my idea
stick it all on one line that'll make people not even bother
oh god
Have you not thought of just encrypting the PBO?
I would like to but haven't had a lot of luck there
because you can't.....
All the encryption puts the key on the client
vs renaming variables and putting code on one line, in any case it'll be better
Waiting for the day someone uses one time padding.
With one key per function
I'm trying to do everything
not just a one fix solution
@little eagle I actually considered that this morning
Then I could obfuscate my keys too
Send them from the server
If you go with otp
I know it's not impossible to hack, but I'm trying to make it a huge pain in the ass
you might as well drop everything else
OTP is perfect if you throw away to key
I just spent like 16 hours doing it manually...
write a script
if you want to stop hacking obfuscation isn't going to help.
It'll help, but not as much as I want it to
Let me just tell the story so I stop getting harrassed.
no, remoteExec protections and BE do
In any way your key(s) are available to anyone
Boss wants obfuscation, I explain how it's futile, boss still wants obfuscation, I obfuscate. The end.
Here is my idea:
- you put all functions encrypted with one time padding into the mission
- the server gets an addon with all decryption keys for all functions
- the server sends those on mission start
- the client loads the functions from the mission (via loadFile - so no macros / comments)
- the client applies the correct key for each file and compiles
That's what I was planning out this morning lol
only problem is that one would have to remove all macros
because unfortunately the game does loading the file and preprocessing in one step
And then you store the decrypted functions?
only as mission variables
So they are readable then
with tools I guess
Everything is readable
Well, theoretically no
The game still has to interpret the scripts, so people can too
If it's stored, then yes
but you can't use the mission without the server addon with the decryption keys
I thought that was the point
Yes
I was under the impression it's so no one can get ahold of the code
And we already have a server addon, so it wouldn't be hard to add
People will still have to download part of the mission, but I don't want anyone else hosting it
I've never done this, but IF you never use macros or preprocessor commands
if you don't want anyone else to host it it's much easier
then it should be easy enough
What do you guys recommend?
I'm sorry
I also thought he wanted unobtainable code
I thought that was the best way to do it
No one is gonna copy all scripts from memory with tools to recreate the mission
You could use a lot of methods to disallow hosting for others*
I'm looking for the perfect method
^^ good luck ๐
That's out of the scope of this channel.
imo there is no point spending the effort trying to "encrypt" shit, if "they" want it, they will get is somehow
And also, it's not my plan, so you'd have to ask the boss.
Maca, I agree.
For me, all the stuff I have in my server addon should be sufficient to keep anyone from hosting it, but..
not my call
Back to the point. What, then, is the best way to prevent unauthorized rehosting?
Do you plan to release all the relevant files?
Everything that they need. Everything else will be on the server.
That they need, including server files..?
No
Very lost
They don't need any server files
So without the server files, what are they going to host?
That's the reason I started down obfuscation and encryption.
sooo... you want to prevent people rehosting files that everyone has access to? I suppose you mean modify and rehost... Whats the use for modifying the client files when not having access to server so not being able to use the modified code
I'd like to prevent reverse engineering.
They are not going to remake all the server files
remove everything from the client side you dont want to get reverse engineered
If you release the server addon, then one time padding as I suggested won't help you
Because anyone could decrypt that
I'd like to ensure that they don't, rather than just assuming. I'm not releasing the server addon.
That's all top secret.
๐
basically people can decrypt everything that arma can still read
But wouldn't the mission be useless then? Why release it?
yeah.. you cant prevent that... you can make it hard... run it through the obfuscator multiple times ^^
Enough for people to play on our server, but not enough for them to rehost.
well.. they would need the server files for rehosting wouldnt they?
We're going in circles. Yes. I am aware that they need the server addon.
Again, I'd like to prevent them from even reading any of my code or reverse engineering it.
not possible
Sure, but next best is to make it as hard as possible.
you could even go as hardcore and push some of your code into an extension to get processed there.. then obfuscate and vmprotect the binary.... but even that can be reverse engineered with enough time
So we've gone back to having unobtainable code
as hard as possible... Run it through an obfuscator multiple times.. then pack it with Mikeros paid tools that make the pbo unpackable for most generic unpackers
That's already in my plan as I mentioned previously
there is nothing higher than that
^^
Thank you. I'll also look into OTP, commy2
@little eagle should we tell them about mikeros ""obfuscatior"" ?
tagging @nocturne bluff because he'll surely like it
@tough abyss @queen cargo
regarding the isNil generic error here is my code block:
private _shiftDirection = if (_offset == 0) then {
1
} else {
_offset / abs _offset // 1 or -1
};
// Shift
private _shiftedLineIndex = _lineIndex;
waitUntil {
_shiftedLineIndex = _shiftedLineIndex + _shiftDirection;
_otherMarkerControl setVariable [QGVAR(lineIndex), _shiftedLineIndex];
_otherMarkerControl = _overlapCacheLineIndices param [_shiftedLineIndex, nil];
_overlapCacheLineIndices set [_shiftedLineIndex, _otherMarkerControl];
isNil "_otherMarkerControl"
};
tried removing some other code from the waitUntil? just in case
because i also could not spot the problem from here by now
but it is 100% not the isNil
What was the reported error?
nop just this
Do you still have the RPT?
are you sure about that not having a ; ? BIKI doesnt have it in examples 1-3 but it has it in example 4
You use ; to seperate statements
is it posible that this is because waitUntil and unscheduled env?
is it posible that this is because waitUntil and unscheduled env?
yes, I think so
because you can't
^
`23:10:58 Suspending not allowed in this context
23:10:58 Error in expression <shiftedLineIndex, _otherMarkerControl];
isNil "_otherMarkerControl"
};
} else {
23:10:58 Error position: <isNil "_otherMarkerControl"
};
} else {
23:10:58 Error Generic error in expression
23:10:58 Suspending not allowed in this context
23:10:58 Error in expression <shiftedLineIndex, _otherMarkerControl];`
omg
wow
:facepalm:
lol
you can use a waitUntil as a while loop
not in unscheduled
with a simple return
the point of waitUntil is to sleep one frame between cycles
waitUntil suspends the script, can't do that in unscheduled
^^^
no we dont sleep
yes, waitUntil does that
doesn't matter what you wrap it into, can't use it.
one frame
lol ok
read it up on the wiki
sinse when?
i remeber that worked befor
oh and also mikero's "obfuscation" can be removed by hand, with notepad
but it works if there is only one cycle
^ nice
๐
Not suprised in the slightest
@nocturne bluff mentionned it a while ago commy
have to admin however ... would never have come up with that conclusion ... congrats @little eagle
notepad doesnt handle null chars well... ^^
I didn't found that
when he was raging with swifty ๐
alganthe did, I think
then congrats @lone glade?
id say congrats to @zealous solstice for actually providing the important line of the RPT ^^
if only BI decided to stop spamming the ever living fuck out of RPTs
would be more happy about some propert out-of-arma SQF emulation tool
or at least make the errors useful
I'd be happy just for an awesome IDE with error checking
there are plenty currently in developement @winged thistle
@winged thistle search youtube for "Arma Studio 2016"
lol working title
and in case you need some better UI-Editor, i am currently also solving that lil problem
even though ... the crash reports which come in are damn useless as nobody adds the notes about how they got to that crash ...
Toss me a link. I'll check it out and not be a noob for you.
Anyone know if its possible to use something like setObjectTexture on a gui element?
Ive been trying to figure out how to get an animation to display on a gui. All i have come up with so far is 90 .paa's and a headache
could use a video and play that in your ui.. that should work
hmmm. Might actually work if i can get it to play smoothly. Will give it a shot
what kind of visualization would you guys recommend for selectionNames+selectionPosition and names of the latest cursorTarget model?
For debugging?
drawIcon3D definitely
the thing i am worried is when a model has many named selections the overlapping and overlaying will be a mess
small font and get close I guess
for the names i thought about having them shown with an offset next to the model connected with lines (and use different color for each selection)
but no real idea how to set this up properly to have this working dynamically regardless of the number of selections
hm good idea
definitely draw a dot at the exact position
another idea i had was to show the list of selections as a list on the side of the main interface
e.g. the red collimator dot
one could connect this list and its order to hotkeys to select/highlight the desired one
format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen],
well i want to possible to turn it and and off dynamically
you have to use that one, because OEF would look jerky with draw commands
well i want to possible to turn it and and off dynamically
exitWith
and only add it if you enable it for the first time
i see. good design. thanks again
Oh and btw. @queen cargo
ye
the onLoad event handlers work for controls
its already in the UI editor ๐
I just changed
onLoad = "_dlgNaviPad = _this select 0; {(_dlgNaviPad displayCtrl _x) ctrlShow false} forEach [2, 9];
to two
onLoad = "(_this select 0) ctrlShow false";
now I'm trying to figure out how I can abuse this
mhh?
to emulate onLoad events for displays
there is actually no real difference between this one and the dialog ones
ahh
so you think about not rly abusing it bur more to use it as weird extension to the UIs onLoad
Yeah
A dummy control for adding custom config based "onLoad" handles
because everything must be an event handler
or just a text with w and h 0
its the same in the end ... so ... ๐
I'll test what can be drawn with the least amount of calculation time
probably an empty picture
ST_STATIC should be it
Is that RscText ?
but tbh ... you most likely wont feel any difference
true
CBA currently hijacks BIS_fnc_initDisplay
But you can't get the class name of displays
And some displays use the same string to identify themselves
think there was some hacky way to get the IDD
or using that one ... ^^'
ctrlIDD has a horrible names
using it you could search for the display
would take ages though ...
there are no controls involved in that command
using it you could search for the display
multiple displays can share the same idd
but using all informations should get some solid results
"solid" isn't good enough : /
lets say it different: if you check every information available, you will be able to find your display 100% of the time unless the dump dev behind created a dup of a dialog
All RscUnitInfo have idd 300
That's like fifty
But they obviously have different class names
this whole idd and idc concept is BS anyway
nah ... it is actually just stupid naming
idd => id display/dialog
idc => id control
because magic โ
because lack of logic by the original devs
might has some historical reason nobody remembers anymore
and nobody ever removed it as ppl are used to it
I guess numbers are faster
we will never know
dont think so (not like i assume strings are as fast ... but do not think that was the reason)
internal engine logic is connected to idds and idcs AFAIK
you can look at the defines in source configs
(not saying its a good system but thats where its coming from)
thats known thing
still it could be changed
any idea how I could check if there's water between two points ?
or if a unit can move to a waypoint without obstructions ? I see the AI unnasign waypoints after a while standing still, so I guess it's doable but I don't know how.
any idea how I could check if there's water between two points ?
You mean no land brigde between two points?
I want to check if there's a body of water between two waypoints pretty much
well, there could be a pond and you could walk around it
Pretty much I want to check if the infantry can access the waypoint
in this case the units can't get there
generation is done using selectBestPlaces
I could check the median distance between the two points and check the water depth but it wouldn't be accurate :/
(i'll add headers later ๐ )
You could iterate across the line
would be a ressource hog tho.
Can me anyone show how to say the server to read a binarizes PBO, please
Buy a Mic Plug it in your Server and shout it to him?
maybe try in #server_admins
just that there is no other way @lone glade
unless you do it the hacky dll way
is someone aware in which order functions with postInit = 1 are executed? just in order they defined under CfgFunctions?
That seems to be the case in my mission.
My mission is finally ready for an alpha test!!! Thanks for helping to all that did.
Does this format look right? ```if(license_civ_rebel) {
case "rebel":
{
_return = [
["U_O_FullGhillie_ard",["cloth",1]],
["U_O_FullGhillie_lsh",["cloth",1]],
["U_O_T_FullGhillie_tna_F",["cloth",1]],
["U_I_GhillieSuit",["cloth",1]],
["U_O_FullGhillie_sard",["cloth",1]]
];
};
};```
This is the whole file http://hastebin.com/luzubuxupo.md
You would put the if inside of the case
I've tried that and it works, but each case is a seperate category in the GUI menu and I'm trying to create a seperate category for my "Rebels"
You're probably better off looking/asking on the Altis life forums as we don't have the full context or related scripts
Yeah, I was just seeing if there was a quick format issue. Thanks though
@tough abyss it does actually, use __EVAL
very cool enhanced marker system - mainly to designate hostiles and friendly
https://forums.bistudio.com/topic/192062-easytrack/
EasyTrack - posted in ARMA 3 - ADDONS & MODS: COMPLETE: EasyTrack
ย
โEasyTrack is a mod for Arma 3 that enables you to use a BFT (Blue Force Tracking) and a RFT (Red Force Tracking) system.
ย
The BFT is used to track position, type and size of allies.
The RFT is used to trackย position, type and size of enemies.
ย
Downloads
Download the latest version (1.1.3) here.
WITHOUT signatures, at the time of creation of this thread (06/27/2016).
I will work on delivering a versio...
problem being that the water could be a small pond, or 300m of ocean
if only there was a command that was returning BOOL if a unit can access an area or not
yeah I figured as much
I rolled back my system to BIS_fnc_taskPatrol
they do patrol jungles, since I spawn them inside it
at least selectBestPlaces stop vehicles from spawning inside shacks, or trees, or walls
yo guys, anybody know why when packing with Mikero's pboManager, It keeps saying UI.hpp is invalid? :/ (sorry if wrong place to ask)
check the logs in P
pboProject*
Sometimes I have to press T while looking at an object, for it to display an object name and be able to interact with it. Anyone know why this is and how to get around it?
@normal citrus I believe it's required to "reveal" a target, look at Doolittle's note here https://community.bistudio.com/wiki/reveal
its about the awareness of an objects and its type
you can check with knowsAbout the value
via other sqf cmd what type the unit can determine
(like from anything-vehicle-car-uaz-uaz_mg-hostile)
Sorry for the deleyed response. It was a rough shift at work and I went to take a nap. Thank you for the info.
I'm tired of programming with Python / C++ for today ๐ฉ I want to go home and continue with arma scripting ๐ข
@willow basin i am a certified health doctor
you experience mental illness and should go to a professional to let him check your sanity
Reason: SQF > Python > C++
those arrows are in the wrong direction
lol
lol
Guys, are there any instructions available for"viewing where ai sees you"? Like a big red arrow marking the position where ai thinks you are/sees you.
Does anyone know a way to count how much time is an entity alive,without involving loops?
onPlayerResapwn onPlayerKilled time comparison
Does this apply to an agent ?(animal)
you could save the time when the agent is created and give it a killed EH
then compare both
Sweet! Thank you once again
Where can i get some bodys battle eye guid?
not their player id
their guid
- With Battleye Extended Controls, is there a way to change it so instead of requring somebodys GUID it requires their player id?
You can convert Steam UID to BattlEye GUID tho
There are free online converters tools for that
- operating admin commands on A3 server requires BattleEye, and BattleEye works with.. BattleEye GUID, so it will still need that kind of ID anyway
cheers
๐
Does anyone know any programs where someone without dedicated box access could use BEC to whitelist someone for my server?
@high plume there's a mission somewhere on BIF that does exactly this
@halcyon cryptyeah I thought so. The question is how to find it... bif search is apiece if shit.
I'll Prolly Google it
Saw your vid about the new environment audio values and stuff the other day, promises some great things! ๐
laxeman already uses the commands for his enhanced soundscape. ๐
@halcyon crypt thanks for the link bro.
Is there any way how i can disable the Tactical Ping?
unbind the key
Is there no other way to disable it? Would like to disable it for a whole Server...
no idea then...
Mhn, thats what i thought aswell ๐
And in BI Wiki i havent found anything about the TP until now :/
maybe it can be disabled through the difficulty settings?
Thats what my scripter thought aswell but until now we found nothing there....
And then i found this here on BI Forum ^^
Updated my cron manager script for Arma, for those who wants to minimize their usage of loops (while, waitUntil etc)
https://forums.bistudio.com/topic/189569-release-cron-manager-for-arma-3-less-loops-more-performance/
Updated Arma 3 Mission Skeleton
https://forums.bistudio.com/topic/192009-release-arma-3-mission-skeleton-version-11-with-mission-build-script/
Now features a build script and very simple workflow.
@vital onyx
https://github.com/ussrlongbow/rwt_cron/blob/master/longbow/cron/functions/fn_cronJobAdd.sqf#L113
you could just do
missionNamespace setVariable [fromat["RWT_var_cronJobsAt_%1",_first_time],_this];
same goes for getVariable 2 lines up
missionnamespace getVariable [format["'RWT_var_cronJobsAt_%1",_first_time],[]];
instead of call compile blah blah
@fallen locust thanks for advise! Definitely cleaner way :)
๐
Guys a little information,does anyone know if deleting a vehicle will set its global variables to 'nil' to avoid broadcasting of useless things?
it will destroy them of course
variables on a vehicles are stored in namespace class in a entity itself so in theory as soon as that base entity disapears all the vars are gone...
but its arma so who knows
Lol thank you guys!
@jovial nebula variable should then be objNull thing
not nil
@fallen locust talks about the variables added to that vehicle
if you want the variable nilled out, you have to nil it yourself
indeed
thanks @queen cargo ,from what i read it doesn't affect performances
it does .... but at an impact rate that is so baerly notable ... that you should not bother
unless you have like 1000000 variables
got it
Only a few xD
Uhm what about a way to convert config entries in multidimensional arrays?
mhh?
easy
Can anyone help me understand my problem better? I basically have a list of functions defined within a mod/pbo, and a server running that mod. I want to access the functions through a mission's initServer but it doesn't seem to work. Is there any way I can do this or does it just not work that way?
it does work that way, where and how have you defined the functions?
CfgFunctions in the mod pbo
That sounds fishy
??? how so?
question about arma 3 editor -- I notice that if you make a scenario wherein you tell bot helis to fly around to certain waypoints, you cannot set desired altitude, speed, manner of flying, etc. The helis fly at a fixed altitude and a fixed speed. Any way to achieve more control over what you want your heli-bots to do?
Does not loiter waipoint work for you? tried with APEX's VTOL - worked pretty fine
i tried loiter once, i don't think it recoginzed altitude I gave it, I will try again. What is 'APex VTOL'?
cool
i'm trying it with ah9 pawnee
perhaps I'm doing it wrong
i'll keep fiddling with it
Does allowing custom faces on a server impact performance, or is it handled peer-to-peer?
if image is under 100kb it is sent to server, every custom face is synced across players once
I would suggest that faces should be distributed in the way similar to squad.xml
Would make sense, imo. Could be mildly expensive on a large server, then, if a bunch of people have custom faces. Would be nice if it could be toggled client-side and apply a default face for lower end machines.
But good to know, thank you.
Is someone aware if it is possible to list files in folder within SQF?
like linux ls command
No, sqf doesnt have access to the filesystem like that
Heya. I need help. Im using Hoverguy's simploe weapon shop script. and the initial money value is in initPlayerLocal.sqf
_player setVariable["HG_myCash",800];
im trying to make it so that when you kill a player, money is added
so i added the code he posted that should do this. (i put it also in initPlayerLocal.sqf)
[] spawn
{
{
_x addEventHandler
[
"Killed",
{
private["_unit","_killer];
_unit = _this select 0;
_killer = _this select 1;
if((isPlayer _killer) AND {_killer != _unit}) then
{
private["_oldCash","_newCash"];
_oldCash = _killer getVariable "HG_myCash";
_newCash = _oldCash + 300;
_killer setVariable ["HG_myCash",_newCash];
};
}
];
} forEach allUnits;
};
@torn jungle use code block to make your snippets more readbale (triple ` will do the trick), like this
//my code...
oh sorry hold on
3x ` MyCode 3x "TheSameSignAsBefore"
/*
Add action to player
*/
[] spawn
{
{
_x addEventHandler
[
"Killed",
{
private["_unit","_killer];
_unit = _this select 0;
_killer = _this select 1;
if((isPlayer _killer) AND {_killer != _unit}) then
{
private["_oldCash","_newCash"];
_oldCash = _killer getVariable "HG_myCash";
_newCash = _oldCash + 300;
_killer setVariable ["HG_myCash",_newCash];
};
}
];
} forEach allUnits;
};```
thats the initPlayerLocal.sqf
so Hg_myCash is the money variable
i want it to increase everytime a player kills someone
but its not happeningg
for multiplayer?
yessir
try MPKilled event handler for that
but will that also work for killing ai (in mp game)? Because i have no one to test it against currently.
for AI you may just assigned Killed EH on server
because by default spawned AI belongs to server
reading the wiki and it says i have to use addMPEventHandler correct?
yes
still not working. hmmm why isnt the variable changing?
'ello there, scripting noob present with a problem.
I am trying to grab the UID field from a "HandleDisconnect" event, but for some reason it just refuses to work
here's the code I am trying to get to work
(init.sqf)
EventDisconnect = compile loadfile "EventDisconnect.sqf";
EventDisconnectHandler = addMissionEventHandler ["HandleDisconnect", {_this call EventDisconnect}]
(EventDisconnect.sqf)
_guy = _this select 0;
_guyuid = _this select 2;
"B_Soldier_F" createUnit [getPos _guy, group _guy, "this setVariable [""uid"", _guyuid];"]
am I doing some sort of obvious mistake?
Mind pointing me a bit further?
I believe I got the localities right, according to the wiki this is all serverside
Well what about it isn't working?
I'm guessing the _uid variable isn't being assigned correctly in the createUnit init because that variable is local to the script and the init parameter is executed in a different scope
Yeah, fixed that bit already, someone else was pointing it out
Fixed it by putting it as a format argument
oddly enough _guy still gets recognized though and part of the loadout transferred
except for the uniform
prolly will end up converting the loadout to a string and giving that to the setunitloadout
nah, I jsut wrote an array2string routine so I can pass the loadout in the init string
it works but its literally one of the worst ways of doing it
what are you trying to accomplish as first thing
is it just applying a loadout to a unit?
Yeah I am trying to copy the player onto a new unit and have him spawn there again if he returns
but respawn normally if his phantom is killed
also, my approach actually works pretty great right now, it copies the loadout flawlessly now
_arraytostring =
{
_buf = "";
for "_i" from 0 to (count _this -1) do
{
_pick = _this select _i;
switch (typeName _pick) do
{
case "SCALAR": {_buf = format ["%1%2", _buf, _pick]};
case "STRING": {_buf = format ["%1""%2""", _buf, _pick]};
case "ARRAY": {_buf = format ["%1%2", _buf, _pick call _arraytostring]};
};
if (_i + 1 < count _this) then {_buf = format ["%1,", _buf]};
};
format ["[%1]", _buf];
};
Discord markdown is your friend https://support.discordapp.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-
_arraytostring =
{
_buf = "";
for "_i" from 0 to (count _this -1) do
{
_pick = _this select _i;
switch (typeName _pick) do
{
case "SCALAR": {_buf = format ["%1%2", _buf, _pick]};
case "STRING": {_buf = format ["%1""%2""", _buf, _pick]};
case "ARRAY": {_buf = format ["%1%2", _buf, _pick call _arraytostring]};
};
if (_i + 1 < count _this) then {_buf = format ["%1,", _buf]};
};
format ["[%1]", _buf];
};
๐
If only there was a toString command...
Granted you could be doing something special with yours but it's hopeless reading code on mobile with discord
Ehh but then you keep the brackets
@little eagle Oh thx, didnt find this earlier
so I assumed it didnt exist
and wrote my own version
this makes shit alot easier obviously
the no brackets method can be used to convert functions/CODE into strings, which can then be compiled into functions again.
there are people who actually use it to reduce network traffic... this saves 4 byte per function or something like that
it's crazy
is that even worth it?
in my opinion? sending code over net should never be done
so no
but some people want to have mods without having the users to install anything
and then they also don't want to maintain missions
so they make a server only addon that sends around uncompiled code
turns out allVariables uiNamespace is pretty taxing
are you using the debug console?
because the problem in those "watch" fileds is that you have to display a huge string
which is the slowest part about this and makes it show yellow / red
just ran hint str allVariables uiNamespace once
same with hint
i think it returned a rather large string lol
its the displaying a loooong string part
I'm not entirely sure, but allVariables should just read the array directly from a variable in C++ land
i went from about 40 frames per second to about 40 seconds per frame
Is str slower than toString? I have a faint memory of using it on an array with thousands of elements and toString was much faster
toString != str
Is there a way to create indentions in diary entries?
spaces
Ah, that's lame. I'm not above it, I'll definitely do it, but there's no like <BLOCKQUOTE> tricks or anything?
I just put spaces inside of my ""?
ye
Well yes toString != str, but for arrays I can't see why it would be faster to use str and then assign the string to a variable with the brackets removed.
Keyword in my previous phrase "for arrays"
I ignore those relevant notes.
str is most likely faster than toString
I'm skeptical but can't disprove you for the time being.
select is faster
toString [65,97,338] == "Aaล"
and
str [65,97,338] == "[65,97,338]"
so this are 2 complet different commands
private _array = allVariables uiNamespace;
private _index = floor random count _array;
private _array2 = toArray format ["%1", _array select _index];
_array set [_index, toString _array2];
sleep 1;
_array = _array apply {str _x};
sleep 1;
private _string = "";
for "_i" from 0 to (count _array - 1) do {
_string = _string + (_array select _i);
};
hint _string;
if (true) exitWith {};```
But calling that "toString" might wasn't the best idea ^^
thats how i would do it
@deft zealot dont troll here ๐
I'm pretty sure I'm fighting a locality problem here -- does handleDamage have to be enacted on the locality causing the damage?
Or can it be the locality receiving the damage
Something of a target range, lets say, I'm 0; -ing out all incoming damage, but reporting what limb is hit, and the goofballs are dying in multiplayer
Problem is these guys are spawning randomly by the server, and I'm beginning to fear it might be difficult to ensure everything syncs properly :<
hitPartIndex: Number - Hit part index of the hit point, -1 otherwise.
whats the point of this btw?
i see. thanks
My mistake, I was thinking of joinString, not toString
= )
I'm looking for some help with getting a Blackfish to drop a vehicle mid-air
I'm not sure what scripting it requires as
A action ["Unload vehicle",osprey] does not work
@opal glacier You can use setVehicleCargo on a specific vehicle in crago. So, if the cargo is called "boat1", you can say "objNull setVehicleCargo boat1;"
But how do I get it to unload? I already have the vehicle inside of the blackfish, all I want to do is set a trigger to have it eject the prowler on a parachute. I can manually select 'Unload vehicle' from the drivers seat, but I want it to just do it automatically at a certain point.
You can put that line into the trigger, or you can put "this setVehicleCargo objNull", I think... that should eject all cargo
So, I should set the trigger to say this setVehicleCargo objNull prowler; ? For reference the blackfish is titled "osprey" and the prowler is "prowler"
Or do I set that script on the blackfish itself?
No, setVehicleCargo works like this:
vehicle setVehicleCargo cargo
so if the Blackfish is called osprey, and the cargo prowler, you'd say "objNull setVehicleCargo prowler" in the trigger. You don't actually need to know the name of the carrier, just the cargo.
You can also do it "generic" like
{objNull setVehicleCargo _x] forach getVehicleCargo osprey;
That would eject all cargo from the carrier named "osprey"
ah, and } instead of ]
for each instead of forach as well?
{objNull setVehicleCargo _x} foreach getVehicleCargo osprey;
Fixed ๐ Sorry, haven't eaten yet ๐
haha, i know the feels, lemme give this a shot real quick
HAH! Success! Thank you so much!
I just started building missions 2 days ago and it's a pretty steep learning curve. I'm on my 3rd mission now and I'm trying to challenge myself by making each one more difficult to build
Heh, yeah, scripting can be scary if you don't have experience with it
It's very exciting to learn though, idk, maybe its just the sense of pride seeing all these systems working together and knowing you made it happen.
Now, is there a way to remove the player's ability to jettison the vehicle to prevent a premature ejaculation
Also, how do I get the Blackfish to open its cargo ramp??
@opal glacier https://community.bistudio.com/wiki/animateSource
Hmmm, so how do i figure out what BIS titled the blackfish's cargo ramp?
Because according to that I need something like "cargo ramp animateSource ["Door_1_source",1]; //Open"
""osprey = this; osprey animateSource ["Door_1_source", 1, true];"" does not work :/
user
sorry, wrong chat, ill check that
ehhh where would I find that? I cant seem to find much information on the blackfish on that site
http://foxhound.international/arma-3-sqf-cheat-sheet.html
http://foxhound.international/development.html
the non pros should fine this useful; and even for some pros it will be handy ๐
A cheat sheet for ARMA 3 SQF language elements and commands.
Research and tutorial information on ARMA 3 scripting and modding.
Oh sweet tits, Thanks!
So how do I find the names for the blackfish cargo door n such?
Damn, this is really kicking my ass, I'm trying another script with no luck, here:
osprey = this; osprey animateSource ["Door_rear_source", 1, true];
- issue is that you with this script only can use one osprey at the same time
does anyone has a marco cheat sheet? I am aware of simple stuff from BiKi - but interested in more complex macro with explanations (like I've seen for example in CBA)
they are documented in the header file
https://github.com/CBATeam/CBA_A3/blob/master/addons/main/script_macros_common.hpp
when remoteExec says the return value can be "anything", does it mean something like this would ever work? _Knownvariables={_vars=allvariables player;_vars;} remoteExec ["bis_fnc_call", owner _player];
how can I share global variables from a client to the server? is using the 'true' statement with the setvariable command necassary?
- owner only works on the server machine
A dedicated server has no player though
- remoteExec only has a return value if the third right side parameter (jip id) is used. it returns a jip id STRING
- remoteExec does not send back the return value to the machine were you executed it
I think this is what you want:
[player, {
params ["_origCaller"]
_allVariables = allVariables player;
[_allVariables, {
params ["_allVariables"];
{
systemChat _x;
diag_log _x;
} forEach _allVariables;
}] remoteExec ["call", _origCaller];
}] remoteExec ["call", _player];
Or do you have to have "allVariables" from that remote player as return value in your function? That can be done too, but it's a tiny bit more complicated and requires your function to be executed in suspendable environment
ya, im trying to get the list of variables from a client player, and check them against a master list to see which ones the client has and what there values are. its helpful to see how you remoteExec in the remoteExec
thanks
Don't do stuff like that if you have many players though
CODE is send as string and those get huge quickly
is it better to create functions and have those remoteExec?
yes. then only the functions name has to be send
the same principle can be used though. Just that "call" get's replaced by the functions name
you have to make sure that the functions are defined on every machine though
awesome, i can see what i need to do now. ty
anyone has experience with cam scripting in A3?
i am trying some stuff, but it seems BI broke various parts of it
Has anyone been able to make buildings indestructible? It worked in ArmA 2 yet not in ArmA 3. We've tried multiple ways and this is our most recent way;
test = nearestTerrainObjects [[0,0,0], [], 9999];
{
_x allowDamage false;
_x addEventHandler ["HandleDamage", {0}];
} forEach test;
....please help
On what map? Because 9999 wouldn't be enough to get every object, but that's kind of a crappy way to do it
Your current method in theory would cause every terrain object on the map to be indestructible. I would also think that just the allowDamage false should work without the HandleDamage event handler
It's plenty on Stratis which is only ~6,649 from our current position/location. What would be a non-crap way? And that's correct. We want any terrain objects to be indestructible. Really just buildings and walls (but ofc BIS doesn't allow walls :()
So does your current method work for any objects? I'm curious which of those type names walls fall under for nearestTerrainObjects
Hmm read the notes for allowDamage https://community.bistudio.com/wiki/allowDamage
I didn't know that until now, but that was from 2013 so maybe there is a way
read that previously and the point in my first message/question was that we've tried both but I could've been more clear
neither worked though was what I meant ๐ฆ
The Feebback tracker site was down for the past 6 months or whatever so we were unable to effectively report/complain/request fixes if that is STILL BROKEN since 2013?!
Have you been testing this in both MP and single player (editor)?
Only MP as it's all that matters
Is every client executing that or only the server?
As of right now, I'm just trying to get it to work from the debug console with a global exec
Implementation will come later
I'm assuming you two are working together. So you are global executing the whole block of code Reason posted? Which included assigning the test variable for nearestTerrainObjects
Yes
Just trying to get it to work on buildings within range
then I'll focus on tweaking my array
The focus here is the handle damage bit
And how are you damaging the building?
Charges
explosive charges placed and not through script
Yeah you guys seem to know what you are doing and have all of the gimmicky things covered so I'm leaning towards it not being possible
I'm very doubtful of this working but you could try returning false instead of 0 for the HandleDamage event handler.
Hopefully someone else will come along and be able to offer more insight
I don't think false or 0 makes a difference for the HandleDamage EVH
From past testing
Yeah you're probably right
I guess it's faster to ask here than booting up A3 ^^
does if (<some condition>) exitWith { /* some code */ } else { /* some code */ }; work?
Test it?
okaaayyy
if (true) exitWith {hint "Yes"} else {hint "Nope"}; <-- ??
5s thing and you can answer that yourself ๐
if (false) exitWith { diag_log "1" } else { diag_log "2" }; => error in expression
guess not ๐ฆ
cause it doesnt make sense at all
it made sense to me when I wrote the code that uses it.. โ
its like if (true) then {<some code>};
and you need the else for what reason?
You don't need else because that code would only execute if it didn't exit
/* some code */
};
/* some code that would be in the "else" */```
works ๐
kinda weird thinking on my end ๐
glad you got it ๐
would love to have the break and continue keywords though.. ^^
any way to detect if we're in scheduled or unscheduled space?
like if (<unscheduled>) exitWith { diag_log "This needs to run in scheduled space" };
nevermind.... https://community.bistudio.com/wiki/canSuspend
Yo, it's me again, just got a few question about namespaces and how persistent they are
I am trying to save a players inventory when he is disonnecting, so I found you can save stuff into namespaces
are they behaving differently in client and server contexts?
and if so, how do I make sure that I stay on the server?
I tried saving into missionNamespace, as I read that's where all the other global stuff gets saved
looks something like this:
(EventDisconnect.sqf)
_guyuid = _this select 2;
if (_guy in safeUnits) then {
missionNamespace setVariable [_guyuid, [getUnitLoadout _guy,_guy getVariable "face", _guy getVariable "speaker"]];
}```
okay I think I almost got the problem
apparently my loadoutscript is executed locally on the client
any way I can pull my required info from there?
Possibly without making it public?
profilenamespace
that's saving it on the client tho innit?
Yes
Does anyone know what became of this?:
https://forums.bistudio.com/topic/140837-development-branch-changelog/page-23#entry2799349
Added: Unique ID to inventory items (for MP - WIP)
I was hoping this could allow for proper weapon jamming simulation and many other possibilities.
@versed willow profilenamespace on the server; better use a DB though
is there a way ingame to determine via sqf what RES LOD is shown for a given model?
no
Guys, can you please remind how to refer to a current MP mission's file from addon's functions? I need to read params from current mission's description.ext, thanks!
great! thanks a lot @indigo snow
but if a want to read a specific sqf file from mission?
found - \mpmissions__CUR_MP.Stratis*
Killzone Kid's articles are awesome
you can access files in the current mission natively though
\scripts\myscript.sqf would be a file called myscript.sqf in the scripts folder inside your mission folder
only some commands have issues with this
@fluid garden You'd use this command:
https://community.bistudio.com/wiki/setObjectTextureGlobal
so every time i need to use this command?
yes
it would require some more advanced scripting
okay. I have made the paa file. So now where should I place that file
and where should I use this script
??
im sorry, i dont have time to teach someone entirely new to scripting
ohh
read up some tutorials, the wiki and read up
@indigo snow in case of execVM called from mission's script yes, but I need to access it from addon's function
That sounds dangerous - it would cause errors if the user played a mission without that file present
if you are a server admin and mission author at the same time - then it is fine
why are you execVM ing a mission side script from the addon then?
triggering a mission side EH seems safer regardless
the addon is the one executing
the file is present in the mission
it should work, its just an unwieldy way to go about it i guess
one of the idea why one may need it: HC is storing complex AI behaviour logic and fsm in addon to reduce mission size, and params for that execution should be stored in mission
and missionConfigFile is not always best place for it (for example when we talk about rather large arrays)
anyway probably will find a better approach
but need it for prototyping
hey sorry to interrupt but I'd like to know what are the main uses and benefits of fsm's?
are there any good tutorials or guides online I could read up on arma related fsm?
oh nvm there's a wiki page lol
@ruby spoke I would recommend to start with this one after you read biki page, http://www.armaholic.com/page.php?id=28702
The main benefit is actually that it lives in its own scheduler
FSMs run in a different portion of the frame than SQF scripts
Ohhh I see, that's interesting
btw does anyone know what happened to the extDB2 wiki?
oh wat
:0 why wasn't I aware of this hahaha
subscribe to torndeco's topic on BI forums ;-)
Could someone please tell me why I can't get this simplistic trigger to work (other than the obvious reason of my being thicker than the proverbial 2 short planks)? I've got 9 units in a 200m trigger, 8 of whom have a waypoint to move out. What I need is to detect when the unit count drops below 5 and perform an action when that happens. The specific numbers aren't really relevant, its just for testing & trying to understand how this works.
Trigger1
OPFOR PRESENT
Cond: This
On Act: opcounter = ({side _x == OPFOR}count thislist); hint format ["%1! %1 OPFOR! AHH AHH AHHH!",opcounter];
Trigger2
No activation
Cond: this
On Act: if (opcounter <= 5) then { hint format ["New count is %1", opcounter]};
I've tried with repeatable on & off with both triggers but nothing seems to update, I can read the counter with a hint from the debug console but it's stuck where it started. Any ideas what the hell I'm doing wrong? If you make a variable in a trigger, can you not use it outside of that trigger?
Try using East I don't think opfor works.
Scrap that it works :)
Why do you use if statements on your on act?
You can put that in the condition.
I wasnt able to get them to work in the condition, it kept complaining it expected an array but I gave it a boolean (or maybe the other way around). Is the usage in the condition just if (opcounter <= 5) & the rest of the onact/ondeact funtioning as the 'then/else'? That'll be cool if so but it doesn't sound like it'll help the no updating counter thing
condition = like a waitUntil
On Act = do this when condition has been met
On Deact = Do this when condition is not met anymore
So if opfor enters a trigger the on Act will wait until the condition is met with what you put in.
if it activated, and after a while the condition is not met anymore it will do the on deact code.
So if I wanted to do something like checking enemy numbers in a town & getting them to retreat when they're down to say 10 men, I'd set up the enemynumber counter to get their full number in one trigger (would setting it to repeat & have a countdown of 1s keep the info current?) then in the other trigger I'd be best off having the condition 'while enemynumber >10', the onact as something like setting them to combatmode red & the deact setting them to combatmode blue, speed full & assigning a retreat waypoint?
You can do it with 2 triggers, both on the same place same size, first one checks if the enemy is there, when they are there, a global variable will be set like 'enemiesHere = true;'. In the 2nd trigger in the condition use 'enemiesHere && (({side _x == east} count thisList) < 10)'. and then use on act some code for them to retreat.
So if the enemies go in the trigger zone slow, it wont trigger the retreat to straight away.
This is what you mean if it understand you correctly.
Its plenty enough for me to have another go with in the morning. Cheers mate
can someone please help me out
what is your specific question?
I have made retexture file
paa format
I want to use it ingame
but I am unable to
can you please help me over tv
why are you unable to?
are you making it an addon?
player setObjectTextureGlobal [0, "\MyAddon\blue.paa"];
where is this folder?
I made this folder inside the arma 3 folder
if youre using it in a mission, it needs to be in the mission folder
setObjectTextureGlobal
was the file in the mission folder at the time?
Command doesn't work for soldiers. texture depends on the uniform alone
ohhk
(uniformContainer player)
make a custom uniform. will require a mod
@cptnick the uniform container does store the items, but has itself no model
maybe can i re texture a default uniform
Ah so thats the trick
You can retexture it, but only by making a custom uniform via addon config
okay can you let me know how to do that
I know all about making paa and pbo
but i don't know about configs
First of all, these configs cannot be done via mission
is that a problem?
@indigo snow Just do typeOf uniformContainer player You will notice something if you ever wrote a config
I will use it in a tanoa life server
Yeah. Those run vanilla usually or am I wrong?
I don't know much
But I do know how to write a uniforms config
man commy im pretty sure if you setObjectTextureGlobal on a unit it textures their uniform
player setObjectTextureGlobal [0,"#(rgb,8,8,3)color(0,0,1,1)"]
what if the soldier drops the uniform?
Yea youll need a ton of extra scripting
I read a thing by KK where he did it
Some inventory EHs and saving to the uniform containers iirc
won't help you when addUniform is used
class U_B_CombatUniform_mcam;
class My_Custom_CombatUniform: U_B_CombatUniform_mcam {
hiddenSelectionsTextures[] = {<PATH TO CUSTOM TEXTURE>};
};
^ config
where do i need to put this config??
into an addon in CfgWeapons
addUniform would be the exception, but then again, im assuming that will be an in mission script you can control unyway
seems a little too advanced for this dude tho
then where will i find this uniform
player addUniform "My_Custom_CombatUniform"
probably also the arsenal
Yeah. I'm pretty sure you don't want an addon if you are running "life"
no, no time for that, sry
Retextures can be included in mission files and just used with setObjectTexture or setObjectTextureGlobal
what if the soldier drops the uniform?
check the EH on the wiki for setObjectTextureGlobal
it gets saved to the uniformContainer belonging to that uniform
However i would say this probably quickly becomes a scripting nightmare on a Life server
If they dropped it I believe they would lose it so you'd have to use one of the various inventory event handlers to reapply it
I'm testing out the Arma 2 editor and i'm stuck on spawning people on trigger, the trigger works but the spawning in doesn't here's my code:
GroupSquad1 = [getMarkerPos "Spawn", east, ["TK_INS_Soldier_TL_EP1","TK_INS_Soldier_3_EP1","TK_INS_Soldier_4_EP1","TK_INS_Soldier_AAT_EP1","TK_INS_Soldier_MG_EP1","TK_INS_Soldier_AR_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_AA_EP1","TK_INS_Soldier_TL_EP1","TK_INS_Warlord_EP1","TK_INS_Soldier_MG_EP1"]] call BIS_fnc_spawnGroup;
If they dropped it I believe they would lose it so you'd have to use one of the various inventory event handlers to reapply it
ok. what if addUniform is used
I'd imagine there should be more information on the Altis life forums with guides as well
Then you set the texture on the next line of code
so edit every line where addUniform comes into play?
What if you don't have access to that part. If it's from a third party
it's a huge mess
Hence why it would be better as an addon like you suggested, but some people are trying to work around only including things in a mission file
but what if you put multiple uniforms into the same weapon holder?
What if two guys access the same weapon holder at the same time. This whole thing is a gigantic mess.
I mean there are people who don't care about such things, because they don't happen regularly
But I don't think this hacky work around is any good
@fluid garden
This is the best I can come up with:
init.sqf
My_fnc_addCustomUniform = {
params [["_unit", objNull, [objNull]], ["_uniform", "", [""]], ["_texture", "", [""]]];
_unit addUniform _uniform;
if (_texture != "") then {
_unit setObjectTextureGlobal [0, _texture];
(uniformContainer _unit) setVariable ["custom_texture", _texture, true];
};
};
0 spawn {
waitUntil {!isNull player};
player addEventHandler ["Take", {
params ["_unit"];
private _texture = (uniformContainer _unit) getVariable ["custom_texture", ""];
if (_texture != "") then {
_unit setObjectTextureGlobal [0, _texture];
};
}];
};
And then, whenever you would use addUniform, you use this instead:
[player, "U_B_CombatUniform_mcam", "#(rgb,8,8,3)color(1,0,0,1)"] call My_fnc_addCustomUniform;
drawbacks:
- Take event handler does not work after team switch and does not work with zeus remote controlled units (I don't think those happen with "life" though)
- You have to replace every
addUniformwith this one.
Life works around applying textures to the players uniform based on the players status/variables
So it's not specific to the uniform itself, as it could differ from player to player, based on their 'rank', for example
My internet cut out before I finished. I was saying that a 'fn_playerSkins' function is called to reapply textures, in pretty much any event where uniform would change
I suggest you look at the other examples in the file and work from them
can anyone tell me why 'getText(configFile >> "CfgVehicles" >> (typeOf cursorTarget) >> "vehicleClass");' returns "container" but when im standing next too the cursorTarget (a container) 'nearestObjects[getPos player,["Container"],10];' returns '[]'
You could use inheritsFrom in conjuction with nearestObjects, also
Des francais ? :<
my EN is so bad but i try, i need help
if (not isDedicated) then {
[] spawn {
waitUntil { alive player };
player addEventHandler ["KILLED", {
[] spawn
{
private ["_leader", "_spawnPos"];
waitUntil { alive player };
_leader = leader player;
if ((alive _leader) and (player != _leader)) then {
// Move the player just behind the leader, but ensure they arrive on the ground.
_spawnPos = (vehicle _leader) modelToWorld [0, -5, 0];
_spawnPos set [2, 0]; // Ensure respawn on the ground.
player setPos _spawnPos;
This script for spawn a player on LeaderSquad is work, but i need change this script for : no respawn if leader is dead.
someone can help me ?
ty !
( Actually, if leader die, he spawn on BASE or on BODY )
i don't script, i don't know what i can do with that ๐ฆ
but thx for your help ;o)
question: we have a static weapon (mortar, titan, hmg) - when we disassemble it - how the remaining ammo is stored? is there any getter for remaining ammo on disassembled static weapon?
thx ๐
I believe the remaining ammo is automatically attributed to the weapon itself. IE the backpack with the gun. not the bi/tripod
yep, but is there a way to get it from backpack?
dialog related question, is it not possible to "overlay" dialogs? I'm trying to create 2 dialogs on top of each other, the first with a background and the second without, but I can only see the second one (without the background)
I do not know much about creating dialogs, but based off of minimal reading, I would make sure they are on different layers
there can be only one dialog at the same time
if you want to simlate one dialog atop of another - you may try luck with rsctitles
just discovered that camera streaming to texture, does not render billboard and VR objects
When you are too bored - https://www.youtube.com/watch?v=HHwXwOhBQAQ (sorry, but relates to scripting)
@vital onyx how can you be bored? ๐ (serious question)
You were really bored
I guess script changed images on display
So yeah, really bored ๐
#Its a video texture
When I was bored: https://www.youtube.com/watch?v=f-CZ1gh71pY
That intel inside made it work !
loool
im so jelous
I never get fun with scripts
usualy i'm just trying to fix something cause "ARHG ITS STILL NOT WORKING AND ITS 2 AM"
๐
My scripting is usually not very goal oriented, just messing around in the editor aimlessly. So the 2am debugging is actually the fun part for me.
If I were really trying to produce something proper stuff, I'd probably rage quit way before.
It's the journey...
Love it though, right? ๐
that's all I do nowadays.
Because, apparently, i don't have the time to actually play the game. But still manage to find about ten hours a week to play scripter. ๐
@split coral thats clever and accurate - only thing was missing and that is VR - HTC Vive in there
Thanks, RH
@barren magnet not a video texture, simple rtt
@queen cargo that's the puzzle from me ;)
@queen cargo in general - script only
@velvet merlin when you have to make some basics for your missions, which you expected game developer should do.
@shrewd lichen nope, every letter is indivudual, this is kind of wip
Nicely done then
by doing magic @night void
@queen cargo how it magic looks?
has someone tried changing textures for objects created with CreateSimpleObject?
with SetObjectTexture
i think that dont work
because the sources from setObjectTexture is in the config under hiddenselections
from biki
Description:
Create object with given shape defined as path to .p3d model. Supported LODs include Geometry, Fire Geometry, Roadway, View Geometry and ShadowVolume. Supported features include collision, texturing, animation, penetration, AI spotting occlusion, and surface specific sounds (like footsteps). Unsupported features include PhysX, damage, AI pathfinding (causes walking through walls), and built in lights.
so textures are supported only defined and stored in model itself?
you texture the hidden selection of the object, not the object itself
but not every model has texturable hidden selections
how could i generate a string containing all latin characters, numbers, and all cyrillic characters?
sounds like hard work
Well, Arma has no function for something like that afaik if that was your question
I am using an sql query which is resulting a text field but not recognized by extdb2 as a text field.. therefor the result is something like [5,0,123456,my text here] and of course arma give me an error "my" is not a variable. An idea how to make sure extdb knows it's a text field? (it's a select with UNION etc), thank !
Anyone figure out if it's possible to dig into dev branch files to examine the co-op campaign missions, export emblems, ect?
@elfin bronze is that your returned array?
yes
And you want the last index to be a string? Just do something like "str (_this select 3)"
@native hemlock nah it's bugging before this... extdb probably tries a compile so it's getting an undefined variable on that string before it's not a quoted string
Well does it have quotes in the SQL database? There is some specific things needed for escaping quotes with extDB
no there is no quote on the DB (using this DB with other apps/web interface, etc) but it's working good with varchar and string but here it's a string with a UNION so it's not knowing it's a string anymore.. anyway to tell him "that field is to be threated as a string"
I'm not sure then, when I messed around with extDB2 I never did any unions. Torndeco is still active but has released a new version (extDB3) so it might be worth trying that and contacting him
He's not responding
lol well I didn't necessarily mean right now
I sented a message last Sunday
Okay
What exactly is happening here
I fetch a variable from a vehicle
_originalData = (vehicle player) getVariable ["mav_tuning",[]];
then some lines below edit the original data array
_toEdit = _originalData select 0;
_toEdit set [_poolIndex, if ((_toEdit select _poolIndex) == 0) then {1} else {0}];
_originalData set [0, _toEdit];
and the variable on the vehicle changes
although I never do setVariable to overwrite its value
If this is true ^ @tame portal
You've just solved me a big headache
Vehicle init:
this setVariable ["test",[[1,1],[2,2]]];
Debug:
_array = cursorTarget getVariable "test";
_test = _array select 1;
_test set [0,5];
hint str (cursorTarget getVariable "test");
@tame portal @dusk sage arrays are mutable objects in SQF
the changes also are not broadcasted over the network
see following exampl
_arr = [];
_arr2 = _arr;
_arr2 pushBack 1;
hint str _arr; //will be [1]
as the vehicle is just another namespace, it behaves the same
if you want a copy of given array, just add a +
_arr = [];
_arr2 = +_arr; (creates a copy of the array)
_arr2 pushBack 1;
hint str _arr; //will be []
I actually did not know that
I assumed given that it always creates copy it would also do the same with arrays
doing so, SQF would be slow as fuck when working with arrays
But in the case of getVariable, on an object, as in the example above, it would seem the changes are broadcast