Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Community Reputation

9 Neutral

About juleshuxley

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Why is my RSC text not centered? Here's my RSC class: #define CT_STRUCTURED_TEXT 13 #define ST_CENTER 0x02 class MyRscStructuredText { idc = -1; type = CT_STRUCTURED_TEXT; // defined constant style = ST_CENTER; // defined constant x = 0.1; y = 0.1; w = 0.1; h = 0.1; size = 0.018; text = ""; class Attributes { font = "TahomaB"; color = "#000000"; align = "center"; valign = "middle"; shadow = false; shadowColor = "#ff0000"; size = "1"; }; }; Here's the implementation: _item = _display ctrlCreate ["MyRscStructuredText", -1]; _item ctrlSetPosition [0,0,0.0,0.0]; _item ctrlSetText "X"; _item ctrlSetBackgroundColor [1, 0, 0, 1]; _item ctrlSetTextColor [1,1,1,1]; Result: While it appears to be horizontally aligned, why is it not vertically aligned? Why is valign being ignored? I just want that white x to be in the dead center of the red box, I don't mind what type the RSC is. Setting it to Structured Text doesn't appear to be doing anything anyway
  2. juleshuxley

    Center text in a RscText box

    Stupid mistake needed to definte ST_CENTER in the header: #define ST_CENTER 0x02
  3. Why is the A left aligned? class MyTextControl : RscText { type = CT_HTML; w = 0.06; h = 0.05; font = "TahomaB"; sizeEx = 0.04; colorBackground[] = {0,0.9,0,1.0}; text = "A"; shadow = 0; align = "CENTER"; style = ST_CENTER; valign = "top"; }; I've tried setting align and style but it appears to be left aligned. How do I change it so the text is in the center of the box?
  4. I'm having real difficulty with UI's as there isn't much documentation. I've been able to use ctrlCreate to create a RscText box and change it's position and color with commands such as ctrlSetPosition and ctrlSetBackgroundColor. My mission folder contains three folders: config.cpp init.sqf mission.sqm config.cpp: class RscText { access = 0; type = CT_STATIC; idc = -1; style = ST_LEFT; w = 0.1; h = 0.05; //x and y are not part of a global class since each rsctext will be positioned 'somewhere' font = "TahomaB"; sizeEx = 0.04; colorBackground[] = {0,0.9,0,0}; colorText[] = {1,1,1,1}; text = "HELLO WORLD"; fixedWidth = 0; shadow = 0; }; init.sqf "someLayer" cutRsc ["RscTitleDisplayEmpty", "PLAIN"]; disableSerialization; _display = uiNamespace getVariable "RscTitleDisplayEmpty"; _columnWidth = 0.015; _rowHeight = 0.02; _currentRow = uiNamespace getVariable ["currentRow",safeZoneY]; _font = "EtelkaMonospacePro"; //_text = "A"; _item = _display ctrlCreate ["RscText", -1]; _currentColumn = safeZoneX + (1 * _columnWidth); _item ctrlSetPosition [_currentColumn,_currentRow,_columnWidth,_rowHeight]; _item ctrlSetFontHeight _rowHeight; //_item ctrlSetBackgroundColor [0.0,0.0,0.0,1.0]; //_item ctrlSetText _text; _item ctrlCommit 0; _item ctrlSetTextColor [1.0,1.0,1.0,1.0]; So I'd expect this code to create a RscText on the screen, containing the text "HELLO WORLD" and with a green background. But no, nothing. It doesn't seem to pick up on my classes in config.cpp. Main question: So how should I create a custom RscText class? Side question: nothing is displayed if I don't have this line at the top of my code: "someLayer" cutRsc ["RscTitleDisplayEmpty", "PLAIN"]; How does ctrlCreate know to attach my RscText to someLayer? Does it just look for an empty layer? And why is disableSerialization needed? Tanks a lot
  5. I can use loadMagazine to get an AI gunner in a vehicle to reload the tank gun with an ammo type. Is there a command to get an infantry soldier to reload a certain magazine type for his rifle, and keep using magazines of that type until they are all gone? Or a trick to do this if there is no such command?
  6. Man the closest I can get is this: ugv = vehicle player; ugv animateSource ["turret", 0]; ugv animateSource ["mainTurret", rad 0, true]; ugv animateSource ["mainGun", rad 0, true]; ugv animateSource ["mainTurret", -rad 90, true]; ugv addAction ["Show Turret", {ugv animateSource ["Turret", 0]}]; ugv addAction ["Turret Left", {ugv animateSource ["mainTurret", rad 90]}]; ugv addAction ["Turret Right", {ugv animateSource ["mainTurret", -rad 90]}]; ugv addAction ["Turret Up", {ugv animateSource ["mainGun", rad 30]}]; ugv addAction ["Turret Down", {ugv animateSource ["mainGun", -rad 20]}]; Which is an example I got from the wiki https://community.bistudio.com/wiki/animateSource It's weird though. It sort of spawns in a turret than can then be moved. I tried with a RCWS stomper (that already has the turret) and it doesn't move it. Weird example IMHO
  7. Would also like to see how elevation can be animated
  8. I've confirmed that "mainTurret" is the correct name of the animation that rotates the turret with getText (_turretConfig >> "animationSourceBody"); So this shoud insantly rotate the turret 90 degrees to the right, right? _tank = vehicle player; _tank animateSource ["mainTurret", rad 90, true]; The player is in the commanding position, other crew positions are filled. The turret stays stubbornly immobile. As usual Arma 3 gives absolutely no error messages. I can workaround using doWatch and triggernometry, but I feel it would be better to use the animateSource, right? // untested pseudo code _deg = 50; _radius = 100; gunner _vehicle doWatch ([getPos _vehicle,[_radius * cos(_deg),_radius * sin(_deg),0]] call addToArray ); // makes the gunner watch 50 degrees when placed in an infinite while loop so as the vehicle moves the watch point moves.
  9. This is outside the scope of the main question, but can I query what button a weapon is linked to? Or query what button is linked to what what weapon group and what that weapon group contains?
  10. If you look under controls>movement, 1 selects weapons group 1, 2 selects weapons group 2...4 selects weapons group 4. There is no mention of selecting a weapons group 5. Which leads me to the conclusion that there can only be 4 weapons per turret?
  11. thank you so much, really detailed answer. and thanks for pointing out that unique ammo returns a number rather than a string that would have tripped me up for sure.
  12. Right so you're saying I should have an if statement that says when weaponLockSystem is 16, check it's lockType because 16 is generic. Else, 4 means laser guided
  13. I'm creating a mod that shows what each ammo type is useful for. There is definitely some confusion regarding what ammo does what, many people think the ATGM (anti tank guided missile) is actually an Air to Ground Missile! Now my first thought is to simply manually add a description to each ammo config myself (definitely doable, would only take a few hours), but I'm wondering if it's possible to programatically determine if a ammo is anti-air/anti-infantary/anti-land from its config attributes? Attributes such as indirectHit, dangerRadiusHit, caliber maybe. Apologies if this is a bit of an open ended question.