Jump to content

billw

Member
  • Content Count

    21
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About billw

  • Rank
    Private First Class
  1. Also you could add some debugging strings in there to see if values are what you expect. e.g.: player sideChat "some text"; player sideChat (format ["a value = %1", someVariable]); Might start with: _temp = _this select 0; _varname = vehicleVarName _temp; _unit = objnull; // debugging player sideChat (format ["called with %1, %2, %3", _temp, _varname, _unit]); createMarkerLocal [_varname, [0,0]]; _varname setMarkerShape "ICON"; _varname setMarkerColor "ColorBlack"; _varname setMarkerSize [1,1]; _varname setMarkerType "b_mech_inf"; while {true} do { // debugging player sideChat (format ["looking for unit %1", _varname]); waitUntil { call compile format ["_unit = %1",_varname]; alive _unit; }; // debugging player sideChat (format ["found unit %1", _varname]); while {alive _unit} do { if (side _unit == west) then { // debugging player sideChat (format ["detected unit %1 is blufor", _varname]); _varname setMarkerColor "ColorBLUFOR"; }; _varname setMarkerDir getDir _unit; _varname setMarkerPos getPos _unit; sleep 0.5; }; _varname setMarkerColor "ColorBlack"; sleep 5; }; Also you could parameterize your function so you don't need different script files (makes it a lot easier to debug and maintain): _temp = _this select 0; _markerType = this select 1; _markerShape = this select 2; _varname = vehicleVarName _temp; _unit = objnull; // debugging player sideChat (format ["called with %1, %2, %3", _temp, _varname, _unit]); createMarkerLocal [_varname, [0,0]]; _varname setMarkerShape _markerShape; _varname setMarkerColor "ColorBlack"; _varname setMarkerSize [1,1]; _varname setMarkerType _markerType; while {true} do { // debugging player sideChat (format ["looking for unit %1", _varname]); waitUntil { call compile format ["_unit = %1",_varname]; alive _unit; }; // debugging player sideChat (format ["found unit %1", _varname]); while {alive _unit} do { switch (side _unit) do { case west: { // debugging player sideChat (format ["detected unit %1 is blufor", _varname]); _varname setMarkerColor "ColorBLUFOR"; }; case east: { // debugging player sideChat (format ["detected unit %1 is opfor", _varname]); _varname setMarkerColor "ColorOPFOR"; // is this colour right? I don't know marker colours }; case resistance: { // debugging player sideChat (format ["detected unit %1 is resistance", _varname]); _varname setMarkerColor "ColorGUER"; // is this colour right? I don't know marker colours }; }; _varname setMarkerDir getDir _unit; _varname setMarkerPos getPos _unit; sleep 0.5; }; _varname setMarkerColor "ColorBlack"; sleep 5; }; Now you can call it like: [theUnit, "b_mech_inf", "ICON"] spawn myscriptname;
  2. What sort of trigger? Radio is a trigger: in editor you can select radio calls to activate a trigger instead of players in an area. Do you mean trigger area? i.e. you walk into a certain area and a supply drop arrives? If so you should be able to reuse whatever code you found for doing it via radio, but instead call it in the On Act part of a trigger area...
  3. The name of the script file doesn't matter, if the script file contents are the same its equivalent to running the same script. vehicleVarName (according to docs I just read which you can find here) returns the name of the object as given in the editor, if it wasn't given a name it will return nothing. If it returns nothing then the marker name will be blank, and markers need unique names (which sucks but lets ignore that for now). What is the effect you are trying to achieve? If you want specific units to be visible on the map you could update their "known" status instead. But really its not practical to hack in script to missions if you don't know how to script at all, sorry!
  4. billw

    Farooq's Revive

    Escape from Altis does this, check out how it does it?
  5. billw

    =BTC= Revive

    Just FYI top right of this page just below the page numbers you can see "Search Thread". If you put VAS into that you will get all posts where VAS is mentioned in just this thread. If you then find the latest one where someone asks your question, click the post title it will take you to that post in context, you can then scroll down from there to find response.
  6. Thanks! So just to clarify, BIS_fnc_spawnVehicle IS broken? I know how to do this stuff "manually", but I am modifying an existing code base and want to make as few changes as possible. There is a piece of script that spawns enemies and requires an array of valid vehicle classes. Previously that list was OPFOR vehicles only, but I wanted to allow the enemies to use any vehicle so added the other classes to the list. But this for some reason causes the spawned vehicles to belong to whatever side the vehicle class defaulted to instead of the one being specified in spawnVehicle. ---------- Post added at 13:05 ---------- Previous post was at 11:32 ---------- Okay well it looks like this function definitely doesn't work consistently. I checked spawnCrew which is supposed to have a default mode where you don't provide a crew type and it derives it from the group side, but this uses selectCrew which can only return "USMC_Soldier_Crew", "US_Soldier_Crew_EP1", "RU_Soldier_Crew" or "TK_Soldier_Crew_EP1". So yeah... Ahh, just seen, if I select A3 from the second drop down in Function viewer these "spawn" functions no longer show up, so I guess I shouldn't expect them to work for A3! ---------- Post added at 13:14 ---------- Previous post was at 13:05 ---------- For your consideration: bw_fnc_spawnVehicle = { private ["_vehicleType", "_group", "_position"]; _vehicleType = _this select 0; _group = _this select 1; _position = _this select 2; _veh = createVehicle [_vehicleType, _pos, [], 0, "NONE"]; _soldierType = ""; switch(side _group) do { case west: { _soldierType = "B_Soldier_F"; }; case east: { _soldierType = "O_Soldier_F"; }; case resistance: { _soldierType = "I_Soldier_F"; }; default {}; }; [_veh, _group, FALSE, "", _soldierType] call BIS_fnc_spawnCrew; _veh }; _pos = position player; _pos set [0, (_pos select 0) + 10]; _grp = createGroup west; _veh = ["I_MRAP_03_F", _grp, _pos] call bw_fnc_spawnVehicle; Thanks for the help!
  7. Sorry if the title is confusing: basically if I try and use BIS_fnc_spawnVehicle to spawn a BLUFOR MRAP (e.g. "B_MRAP_01_F") but on side east it doesn't correctly set the side? I tried with creating an east group and passing that as well but it still returned a vehicle that thought it was BLUFOR (showed blue on map). Only way I get it to work is if I create the group first, pass it in then add the vehicle and crew returned to the group again my self. Still the vehicle shows up blue on my map until I get close enough to it to presumably identify that the crew is in-fact opfor. Any ideas, intended behavior (why?!) or bug?
  8. Thanks that's very nice, I like future proof!
  9. Oh never mind I got it: http://browser.six-projects.net/cfg_vehicles/classlist?utf8=%E2%9C%93&version=67&commit=Change&options%5Bgroup_by%5D=faction&options%5Bsort_by%5D=vehicleclass&options%5Bfaction%5D=&options%5Bvehicleclass%5D=Car
  10. Maybe I'm not so bright but I can't figure out how to get a list of ONLY movable vehicles out of that. If I click on vehicles it shows everything in cfgVehicles, and if I click on any of the tags like "superclass LandVehicle" I get server error 500. If I type in LandVehicle as a search filter it filters it down to one entry... /edit Also you can only sort by name or display name columns. Basically maybe this is useful if you know the name of something and want to see what it looks like, but not if you want to find all of something based on criteria.
  11. I'm referring to the "internal" vehicle names that can be used with createVehicle. I am modifying a script that spawns patrols etc., and need to specify a list of valid vehicles, but obviously cfgVehicles is just a giant list of mostly indecipherable gibberish with soldiers, vehicles, statics etc all mixed in together. Is there an existing vehicle list for Arma 3 somewhere? If not is there already a script or app that will generate one? If not I know what I am doing this lunch time :) If there is also a script command to save named screenshots then I should be able to auto generate a set of screen shots paired with the internal names, based on a set of heuristics which sounds pretty useful!
  12. From the wiki: To remove the hint box from the screen, pass a null string ("") to the command. hint "" So you want hint "" in your deactivation of the box so the hint appears when you enter and disappears when you leave right? But I think it won't update when the value changes. In that case you could try and spawn a bit of script with a timer. e.g. hint.sqf while(trigger area is triggered) { write the hint text; wait 100 ms; } hint ""; trigger area: on act: spawn hint.sqf
  13. So I am trying to script an assault to capture a VIP in an office building. Firstly I UnitPlay some choppers to the roof and eject the passengers, this works okay. But the first thing they do is all walk off the roof, unless they are in one specific location right next to the skylight ladder. So I figured I would "stop" them so they don't move then teleport them to the good location. Only I can't get setPos to work for the life of me. I have tried using markers, also game logic units to get a position from. Markers are no good they don't have height setting, so I can't put them on a roof, game logic has a height as it is a unit, but I can't seem to work out how to move my guys to the placed game logic unit. Any help please?! Surely it should just be {_x setPos getPos teleport1; _x stop false;} foreach units group groupleader1; Where teleport1 is a game logic unit at the desired position and height, and groupleader1 is the group leader of the unit whose soldiers I want to move. On another note, the units seem to walk through walls quite often but I guess this is an AI bug? I hope... The building I drop them on has surrounding short walls, but they still just walk straight through them and fall to their death in stead of navigating to the ladder and walking down the stairs...
  14. So I got this working based off , the one problem remaining is how to immediately apply the UnitPlay. I have tried using the init script of the heli, and also using a stand alone logic unit, but neither of those work. Using a trigger area around the heli does work, but there is a half a second gap between the mission starting and the animation starting so it makes the camera jump.Any ideas?
×