Jump to content

Rook Mk1

Member
  • Content Count

    133
  • Joined

  • Last visited

  • Medals

Everything posted by Rook Mk1

  1. Hi, I was wondering which was the most efficient and readable way to manage tasks. I used to have task functions in different scripts and fsms, but now want to keep all in one script to make it more readable. What I have so far: //Mount Vehicles Task private _title = "Mount Vehicles"; private _description = "Mount your patrol vehicles."; private _waypoint = "Mount"; private _position = (getMarkerPos "marker_mountCars"); private _myTask = [B12_1,["taskCar"],[_description,_title,_waypoint],_position ,"ASSIGNED",2,true,"getin"] call BIS_fnc_taskCreate; []spawn { while {condition} do { switch (condition) do { case case1: { ["taskCar","SUCCEEDED"] call BIS_fnc_taskSetState; }; case case2: { ["taskCar","FAILED"] call BIS_fnc_taskSetState; }; case case3: { ["taskCar","CANCELLED"] call BIS_fnc_taskSetState; }; }; }; }; I just put generic conditions and cases in this example. However, I know []spawn is not the most economical performance wise. I also tried looking at Bohemia's mission files to get an idea, but I can't really make heads or tails of it.
  2. Make a daring escape down a Norwegian mountain by car or bike before your flight leaves! Mods Required: https://steamcommunity.com/sharedfiles/filedetails/?id=1282716647 Mods Recommended (But playable without): https://steamcommunity.com/sharedfiles/filedetails/?id=1640399582 https://steamcommunity.com/sharedfiles/filedetails/?id=1715110132 Known issues: Music will pause randomly for a couple of seconds when pausing or saving. Audio pops occasionally between loops (arma doesn’t handle music the best) The player bobbing around randomly can make it harder to select a car. Thanks: Health Regen Script: Unknown BI Forums member (Let me know who is the og author!) Timer Script: cobra4v320 Autoflip Script: DaVidoSS Music: Sweaty Little Sow - Saki Kaskas Download - Steam Workshop
  3. I'm making a custom campaign, and whenever I try adding a new mission it just refuses to acknowledge that I added a new one. I made a class with the template name exactly the same as the one in the campaign's mission folder but it stops at the previous mission. In the past I could just duplicate the campaign folder and it would work, but in this case it's just refusing to show. //Campaign Description.ext class Chapter1 : NoEndings { firstMission = Mission1; endDefault = ; // other endings are defined by inheritance from NoEndings class Mission1 : MissionDefault { end1 = Mission2; // other endings are defined by inheritance from MissionDefault, inheriting from NoEndings end2 = Mission2; end3 = Mission2; end4 = Mission2; end5 = Mission2; end6 = Mission2; endDefault = Mission2; template = BW_takiBase.takistan; }; class Mission2 : MissionDefault { end1 = Mission2a; // other endings are defined by inheritance from MissionDefault, inheriting from NoEndings end2 = Mission2a; end3 = Mission2a; end4 = Mission2a; end5 = Mission2a; end6 = Mission2a; endDefault = Mission2a; template = BWCAMP02.takistan; }; class Mission2a : MissionDefault { end1 = Mission3; // other endings are defined by inheritance from MissionDefault, inheriting from NoEndings endDefault = Mission3; template = BW_RoadAttack.takistan; }; class Mission3 : MissionDefault { end1 = Mission4; end2 = Mission4; end3 = Mission4; end4 = Mission4; end5 = Mission4; end6 = Mission4; endDefault = Mission5; template = BW_Search.takistan; }; class Mission4 : MissionDefault { end1 = Mission5; // other endings are defined by inheritance from MissionDefault, inheriting from NoEndings end2 = Mission5; end3 = Mission5; end4 = Mission5; end5 = Mission5; end6 = Mission5; endDefault = Mission5; template = BW_NightRaid.takistan; }; class Mission5 : MissionDefault { end1 = Mission6; end2 = Mission6; end3 = Mission6; end4 = Mission6; end5 = Mission6; end6 = Mission6; endDefault = Mission6; template = BW_Battle.takistan; }; class Mission6 : MissionDefault { template = BW_rubble.takistan; }; }; Stops after mission 6
  4. So say if I spawned an opfor unit, and only wanted to make a script activate if they had a certain name followed by any number. Say badman_1 or badman_25 etc. How would I check for that? I tried things like if (vehicleVarName _this == "badman_%1") then {code} but it hasn't worked.
  5. Hi I have a condition that needs to be returned true once a unit has been patched up in ace. Any idea how to do it? Thanks.
  6. Rook Mk1

    Return Damage ACE 3

    @stanhope Yeah I got that suggested on r/armadev and managed to get it working, thanks anyway.
  7. Is there a way via scripting to change what icon is displayed in the unit box in the command bar manually? e.g. like a little grenade symbol for grenadiers or triangle for engineers, etc. Right now I have some custom loadouts and its bugging me that I can't tell what role they are supposed to be when commanding them.
  8. @panther42 Yeah I saw that. I guess I'll just have find a way to apply it. Thanks.
  9. Nah just for individual units. See the spanner above his name? Just the ability to change a unit's icon to anything without changing the unit's config.
  10. Basically I need a colour variable to be passed through to a subtitle header. //Select HEX colour from given string private _colourHTML = switch (toUpper _colour) do { case "SIDE": {"#00ccff"}; case "GLOBAL": {"#d7d7d9"}; case "VEHICLE": {"#fbd40b"}; case "COMMAND": {"#e5e760"}; case "GROUP": {"#beee7e"}; case "DIRECT": {"#fffffb"}; case "CUSTOM": {"#ec5a29"}; case "SYSTEM": {"#8a8a88"}; case "BLUFOR": {([WEST,false] call BIS_fnc_sideColor) call BIS_fnc_colorRGBtoHTML}; case "OPFOR": {([EAST,false] call BIS_fnc_sideColor) call BIS_fnc_colorRGBtoHTML}; case "GUER": {([INDEPENDENT,false] call BIS_fnc_sideColor) call BIS_fnc_colorRGBtoHTML}; case "CIV": {([CIVILIAN,false] call BIS_fnc_sideColor) call BIS_fnc_colorRGBtoHTML}; }; // Show subtitle _text = parseText format [ if (_from == "") then { "<t align='center' shadow='2' size='%3' font='RobotoCondensedBold'>%2</t>" } else { if (_from == "#sfx") then { "<t align='center' shadow='2' size='%3' font='RobotoCondensedBold'>*%2*</t>" } else { "<t align='center' shadow='2' size='%3' font='RobotoCondensedBold'><t color='%4'>%1:<t color='#ffffff'><br />%2</t>" } }, toupper _from, _text, (safezoneH * 0.65) max 1, _colorHTML ]; I just get Error Undefined variable in expression: _colorHTML It works if I put something like _colorHTML = "#00ccff"; before the subtitles part though. Any idea why?
  11. Oh god, getting my regional spelling mixed in. Thanks for catching that.
  12. Since waitUntil no longer does anything outside Booleans, what are some other good ways to wait in a script until a certain condition is activated? while do works for certain things but it's not 100% reliable. for instance originally you would have waitUntil {speed _object < 20}; so i would try something like: while {speed _object > 19} do {sleep 0.1}; But it was returning errors.
  13. Rook Mk1

    waitUntil alternatives

    @Dedmen Yeah I realise that it works now, it was a problem with the script. I was just under the impression that including anything other than true or false into a waituntil condition didn't work after update v1.93.145618
  14. Is it possible to check if an item is in a container? e.g. if (hgun_P07_F in _box) then I've tried a few different things but none seem to work.
  15. if ("hgun_P07_F" in (WeaponCargo ammobox)) then Success! Thanks!
  16. I tried if ("hgun_P07_F" in (items _box)) then {hint "true" } else {hint "false"}; always returns false.
  17. [_unit, 10, pistol] call gunScript; in code params ["_unit", "_stubbornness", "_weapon"]; but it fails to recognise _weapon whenever I try to use it, any idea why?
  18. Ok, wasn't aware of that, but I know now, thanks all
  19. I changed it to a number and it worked from if (_weapon == pistol) then { _unit addWeapon "hgun_P07_F"; _unit addHandgunItem "16Rnd_9x21_Mag"; for "_i" from 1 to 2 do {_unit addItemToUniform "16Rnd_9x21_Mag"}; }; if (_weapon == 1) then { _unit addWeapon "hgun_P07_F"; _unit addHandgunItem "16Rnd_9x21_Mag"; for "_i" from 1 to 2 do {_unit addItemToUniform "16Rnd_9x21_Mag"}; };
  20. So I want to change a local variable in a script with an add action command. Example _action = { _var = false; _unit addAction ["Change var", {_var = true}]; }; However due to addaction being its own scope, I am unable to change the var in the action code, any ideas how to do so?
  21. Are we talking global setVariable or just var = addaction?
  22. Again I can’t really do that since it’s used by more than one unit.
  23. Another question, would it be possible to assign setVariable to an addaction command. For instance instead of _actionID = player addaction "etc"; It could be: player setVariable ["actionID", addAction "etc"]; then i could remove it using: player removeAction actionID or something.
  24. I cut and pasted everything into a new script which fixed it for some inexplicable reason.
×