mr-blizzard 10 Posted April 22, 2015 Does Arma 3 have "objects" like in JavaScript? If your not sure what im talking about, it is something along the lines of a variable Inside of a variable. Share this post Link to post Share on other sites
dreadedentity 278 Posted April 22, 2015 (edited) Yes it does, however you cannot access object attributes directly, they've all been encapsulated and abstracted. The only way to get the information each field contains is by using the scripting commands available to us. When you say objects "like JavaScript", I assume you're talking about objects in the context of object-oriented programming. The answer is most undoubtedly yes, because Real Virtuality is also most likely written in an object-oriented programming language (probably C++ like almost every game these days). For example their solider class might look something like this: class Soldier_Base { public: model = //stuff name = //stuff faction = NULL health = 1; direction = 0; float returnDirection() { return direction; }; //other fields and functions } However, there is no way to access object attributes directly using .sqf (and probably .sqs also). We have to use commands like getDir or direction: _myDir = direction player; //equivalent C++ statement (pre-compiled code): resultToSQF = Soldier_Base.returnDirection(); Notice how we did not access the variable directly, but rather used a function? Using functions to return relevant information rather than accessing attributes directly is called encapsulation. Edited April 22, 2015 by DreadedEntity Share this post Link to post Share on other sites
NeMeSiS 11 Posted April 22, 2015 https://community.bistudio.com/wiki/setVariable may be close enough to what you are looking for. Share this post Link to post Share on other sites
rübe 127 Posted April 22, 2015 https://community.bistudio.com/wiki/setVariable may be close enough to what you are looking for. Indeed. For example you can use empty logics as your "objects", and then set-/getVariable. But more often than not, it's actually nicer to use already existing objects: groups, units, ... and set-/getVariable on them. Or just use a hashmap/dictionary (you need to implement that in sqf though...). Share this post Link to post Share on other sites
mr-blizzard 10 Posted April 22, 2015 However, there is no way to access object attributes directly using .sqf (and probably .sqs also). We have to use commands like getDir or direction: _myDir = direction player;//equivalent C++ statement (pre-compiledNever really thought about it like that, really do appreciate the feedback guys, thanks. Share this post Link to post Share on other sites
killzone_kid 1331 Posted April 22, 2015 Arma 3 no, but Take on Mars scripting is very promising. Share this post Link to post Share on other sites