Jump to content

bull_a

Member
  • Content Count

    305
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by bull_a

  1. Hi all, I'm having a bit of a problem with styling a UI control. Here is the defines: And here is the dialog definition: This is the result: Clearly the control text is neither centered or upper case. Does anyone have an idea as to why this would not be working? Bull
  2. bull_a

    Kill count

    I would start with looking at the MPKilled event handler. You can use it to spawn code (or execute a counter function) when a unit is killed. Bull
  3. uiNamespace is a great way to save variables. As far as I understand, it doesn't reset until after the game is closed down, and can be used across multiple missions. Can someone confirm this to me? This leads me onto profileNamespace, you can add variables to this at anytime and save them, so why are people using systems like iniDB2 and extDB? I am not saying that these are pointless, I firmly believe that they are fantastic extensions and I am myself writing similar ones for my own modifications. What are the benefits of using an extension like ini/extDB compared to just writing the variables into the persistent profileNamespace? The way I was thinking of doing this is by have one namespace with a tree like structure (please bear with me, when I'm trying to explain this :) ) profileNamespace - database: /* Structure: "ArmaDB" - database name |_ "UsersTable" - a table |_ Record - a record stored as an array |_ bRecord - another record |_ "SomeTable" - another table |_ ....... */ // To set another record in Users _record = [1,something,somethingElse]; // Gets the database - i.e. opens a connection _database = profileNamespace getVariable ["ArmaDB",[]]; if (count _database <= 0) exitWith {false;}; // Inserts a new record _userRecords = _database select 0; _userRecords pushBack _record; _database set [0,_userRecords]; // Commits the update profileNamespace setVariable ["ArmaDB",_database]; saveProfileNamespace; Bull
  4. Sorry if I did not make this clear :) The information would be saved into the profileNamespace on the server machine. Too be brutally honest, I am not in the slightest bit concerned with hacking/clients running scripts because it happens, and I have wasted too many hours coming up with prevention's that do not work because of the limitations in the scripting engine :) I don't worry myself with the actions of a few script kiddies, that job lies with the server administrators :) True, but I can't imagine a single server (in Arma) would have enough information stored on it where this would make a missive difference?!
  5. In the vehicle Init: _nul = [this,[list of player uids]] execVM "vehicleUIDLock.sqf"; vehicleUIDLock.sqf _vehicle = _this param [0,objNull,[objNull]]; _uidList = _this param [1,[],[[]]]; if (isNull _vehicle) exitWith { ["vehicleUIDLock.sqf: No vehicles was passed! RETURNED - false"] call BIS_fnc_error; false; // returns false }; _vehicle setVariable ["UID_LOCK_LIST",_uidList]; _vehicle addEventHandler ["GetIn",{ _vehicle = _this select 0; _position = _this select 1; _unit = _this select 2; _uidList = _vehicle getVariable ["UID_LOCK_LIST",[]]; // Will prevent AI from getting in the vehicle _uid = -1; if (isPlayer _unit) then { _uid = getPlayerUID _unit; }; // If unit uid is not in the list - unit is moved out of the vehicle if !(_uid in _uidList) then { moveOut _unit; }; }]; true; // return true (Code not tested) Hope this helps, Bull
  6. bull_a

    Work out size of markers

    You can get size of town simply by returning a list of locations and using the size command: (code not tested) _locations = [/*list of locations*/]; { _location = _x; _size = size _location; ... _marker setMarkerSize _size; // Do more stuff } forEach _locations; Hope that helps, Bull
  7. So can the event handlers, I feel as though they offer more control over who executes the onXXX event :) I wouldn't agree with it being easier, it depends on how you prefer to script. I was only suggesting another alternative, as I would prefer to do it with event handlers. Both solutions would work :)
  8. I would add them to an EventHandler, you can only have one onPlayerXXX.sqf whereas you can have multiple event handlers for a unit. The theory and code is the same (or relatively similar) though, both ways will execute on the player onXXXX event. Bull
  9. bull_a

    GUI onLoad issue

    Best practice is to do this: Dialog: class Rsc_YourDisplay { idd = ...; onLoad = "_nul = ['onLoad',_this] execVM 'Rsc_YourDialog_script.sqf';"; onUnLoad = "_nul = ['onUnLoad',_this] execVM 'Rsc_YourDialog_script.sqf';"; class Controls { SomeControl : SomeReferencedClass { idc = ...; onLBChanged = "_nul = ['SomeControlLbChange',_this] execVM 'Rsc_YourDialog_script.sqf';"; // You can also add other UI event handlers }; }; }; Rsc_YourDialog_script: _mode = _this param [0,"",[""]]; if (_mode isEqualTo "") exitWith {false}; _params = _this param [1,[],[[]]]; switch (toLower _mode) do { case "onload" : { _display = _params select 0; }; case "somecontrollbchange" : { _control = _params select 0; _selection = _params select 1; }; // You can define other cases // Always include a default case default {}; }; true; // returns true If you wish to use a called function, you must make sure that it has been previously compiled/preprocessed - can be done in the description.ext with CfgFunctions. Hope this helps, Bull
  10. The display idd are in the game configuration files. You can either unpack the game asset folders using Arma Tools or you can access the Config Viewer in the mission editor (Crtl + G). You need to be looking in ui_f (if you unpacked the game folders) or for the Rsc* entries in the config viewer (the displays id number is IDD - ID Display and the controls id number is IDC - ID Control: just so you know how to differentiate, you are looking for a Display). As I have said above, you cannot access RscTitles displays using findDisplay, you will most likely have to use uinamespace getvariable ['XXXX',displayNull]; The uiNamepace variable will be referenced in the OnLoad attribute. Hope this helps, Bull
  11. As for finding a way to change texts and such you would need to find the idd associated with the score board resource. Because the scoreboard is a RscTitle is it likely that you will need to retirieve a variable from uiNamespace (you can check the onLoad action of the resource to find the variable name) It may also be that the controls are dynamically created using the ctrlCreate command. If this is the case, it may be likely that they are added to the game display. If so, you would need to return the display: _display = findDisplay 46; Reference code below (not tested - intended for insight only) // Scoreboard resource defined in RscTitles _display = uiNamespace getVariable ["RscScoreboard_idd",displayNull]; if (isNull _display) exitWith {fales}; _controls = allControls _display; // You can then access the controls Hope this helps, Bull
  12. hasInterface may be a better solution, as isPlayer may sometimes return false on a client machine. It also means that code can be executed on a local server (when the player is a player and server) and ensures code is not executed on headless client. Also, by using the commands for remote execution, you can broadcast a function to execute on specific targets (see remoteExec for more details). Hope that helps, Bull
  13. From what I can understand (I am sure to be corrected), the player dies twice when using the BIS Revive System. The Revive system is only compatible with the Endgame game mode, but can be used with some development, to work in all scenarios. This is the (very) basic flow for the revive system (as far as I can tell): 1. Player takes damage and dies. 2. Revive Event Handler from BIS Revive System is initialized. 3. If player can be revived, set unit in revive state (This uses the varaible 'BIS_revive_incappacitated' - may change due to updates). <-- you can use this variable to check a player is 'revive-able' 4. If player bleeds out or is killed in the revive state, the player dies 5. Revive Event Handler from BIS Revive System is initialized. 6. Player respawn as normal Hope that helps, Bull
  14. You can use the Killed and Respawn event handlers to trigger scripts/functions adding gear back to the unit. As for saving gear, I have made a system in the past which utilizes BIS fnc saveInventory and BIS fnc loadInventory. You can store the loadout in a global variable. Hope that this is a point in the right direction, Bull
  15. I would stick to using pictures with sizes ^2, and in the .paa format. To set the width i would recommend 400px (that seems to work on my screen). The picture should scale automatically, if not, you can always play around with the sizing It is always best practice (whenever creating images in arma) to use pictures that are of sizes ^2 and in .paa format Bull
  16. bull_a

    Disabling Radio Chatter

    The command fadeRadio will stop all sounds sent via the conversation system. 0 fadeRadio 0; This will still display the AI chatter on the screen. To disable this dialog, you can use showChat showChat false; Hope this helps, Bull
  17. bull_a

    Destroy Trigger not working

    Adding to what Revo has mentioned... It is best practice to NOT use id's. The reason is that whenever the map is updated the id's of the objects change due to the algorithm that is used to define object id's in terrain builder (or BI in-house equivalent). ID's are now a redundant for mission development. You can still use them, but you'll have to readjust your mission after every update to ensure compatibility. Bull
  18. Wont say its impossible, im sure someone has a bit of knowledge out there on how it can be down (probably with an extension), but from a basic-intermediate scripting standpoint, you are not able to do this
  19. bull_a

    Load EDEN without loading mods?

    Umm... dont launch Arma with mods, then the Eden wont be able to initialize the mods content?! If your talking about loading Eden into an empty map (much like launching Arma with -world=Empty) this is not a feature (as of yet)
  20. There is very little in it but there is a slight difference (you can test it using in-game functions from the debug console that measure script execution time), there is information the code optimization page. I'm not entirely sure why it does this (guessing it has something to do with forEach executing in blocks), but from testing in the past (Arma 2 and 3) forEach has (for me) always been the slower of the two when looping through large arrays.
  21. forEach loops are less optimised than for loops. If the array you are checking is small, the difference is only points of a microsecond, however for large arrays the difference can increase exponentially. I recommend using a for loop, for example: while {true} do { _allUnits = allUnits; for "_i" from 0 to ((count _allUnits) - 1) step 1 do { _unit = _allUnits select _i; if (fleeing _unit) then { // do something }; }; // Delay sleep 1; }; Code not tested Hope this helps, Bull
  22. Firstly, this is probably the wrong place for this topic, hopefully a moderator can move it :) Secondly, I just did a quick google search and this was the first result: Arma 3 Server Monetization There is also a huge FAQ section on the Bohemia Interactive website
  23. You could create it on the server and hide it on every other client except the one you choose. Please reference: hideObject hideObjectGlobal I assume you could also Disable Simulation on all other clients, but as killzone said it will probably end up with the unit being "brainless". (This is just an idea, not sure if it would work, something to test) Bull
  24. bull_a

    Dialog isnt Visible

    Also, if you want to make changes to the content in your dialog, set an IDD to a unique number that has not been used before, don't just leave it as -1
  25. Both. I beleive the display idds for the RscDisplayClientReady and RscDisplayServerReady are 18 and 17 respectively (this should work on all machines except for dedicated, you would have to use hasInterface). Code for holding execution would be waitUntil {(isNull (findDisplay 17)) && (isNull findDisplay 18))}; Code not tested Hope this helps, Bull
×