Jump to content

Valfunction

Member
  • Content Count

    51
  • Joined

  • Last visited

  • Medals

Everything posted by Valfunction

  1. I have somewhat completed work on a garrisoning script for A3. Just a quick way to spawn dudes in buildings (outside of the military ones the sites module already does). However at present it is a little cumbersome to implement. You put down markers, input their names into an array in the script and then the script finds the nearest building for each marker and populates it based on some parameters you give it. I was wondering if/how it is possible to implement it into a module that is selectable under the modules tab? That way you can plop down a module and synchronise it to the buildings you want and voila. Is there a tutorial for making modules? I tried google and I get a lot of hits for how to use modules but not so much for creating them. EDIT: I was initially going to do it via radius and then it selects a certain percentage of the buildings within that radius (so you don't populate every building in a 100m radius in Kavala as it would spawn several hundred AI), but if there is a way to sync it to specific buildings it would be nice.
  2. Valfunction

    Creating a module

    @Larrow Cheers mate will try it out @Pac Man I've only tested it on Stratis so far. Will have to try it on Altis and see what happens. My script is a variation of what you have tried. It is run out of an sqf rather than the init field.
  3. Valfunction

    Scripting door closing

    Is there a way to dynamically check when a door opens/closes. Obviously the AI can check if a door is closed and open it before they walk through. I just wanted to add an element where the door closes after a certain number of seconds but only for that specific door.
  4. Valfunction

    Creating a module

    Sorry guys for not getting back to this page (actually forgot about this - been away for a bit). I ended up going with it as a script. The info on module creation was very useful and I will file it away for future use, but for now I'm keeping my one as a script. Just wondering, is there any way to synchronise something to a building - using F5 doesn't work?
  5. I was looking through scripting commands and I found the one "handsHit" which tells you if your unit has been hit in the hands. Is there one for legs? How does arma know to force your unit to crawl when leg damage is above a certain threshold?
  6. Valfunction

    Find where unit has been hit

    I noticed the tag on the HitPart event saying it is not working correctly in MP. Do you know if this is still the case? Because obviously when you get hit in the legs in MP you still crawl. Having not used HitPart before I am struggling to wrap my head around the locality issues that it seems to have. Also looking at the array which is passed back by HitPart which bit of it actually returns the body part hit? Or do I have to work it out from the Position value (below certain height = legs, between 2 heights = torso and above certain height = head)?
  7. I am trying to create an addAction which displays a variable in the action menu. For instance I want the action to say "Move to [VARIABLE]" where [VARIABLE] is the name of a variable. How do I format my addaction display string to display the variable name after the "Move to" part? So for example: _this addAction ["Move to [VARIABLE]", "move.sqf"] //this is obviously not correct syntax but just wanted to know what the correct syntax is.
  8. Valfunction

    addAction string formatting

    Forgot about waitUntil. That one will work perfectly. No longer related to what the original script is doing just a general question - if I wanted the variable to change every time a player entered the server the best would still be waitUntil is that right?
  9. Valfunction

    addAction string formatting

    That is a good iead. At the moment the variable is only used in the one script and it doesn't seem to have massive overheads by updating it every 60 seconds. But I'll keep that in mind if I expand the concept of the script. To check variable value would I just use: if (_marker1 != _marker1 ) then {//magic} and just check that every 60 seconds?
  10. Valfunction

    addAction string formatting

    That's true. I have it inside a while loop that updates every 60 seconds and does what you said.
  11. Valfunction

    addAction string formatting

    Thanks guys. I added some funky colors and other conditions but in the end it came out like this: _jipPole addAction [("<t color=""#FFFF33"">" + ("Move to " + _marker1 + " - NATO base") + "</t>"), "move_to_basel.sqf", [], 1, false, false] and yes _marker1 must be a string.
  12. I have a script that is run from an addAction. The addAction is added to the playable units (MP). I want to make it so only the person who the addAction is attached to is able to use it. In other words, player A cannot access the action which is attached to player B. Is there a way to do this?
  13. Valfunction

    addAction only for self use

    Sorry I'll be a bit more specific. Each unit has a "beacon" which is activated/deactivated via an action. Each unit should be able to turn on their own beacon on/off but not another unit's beacon (all units are human so don't have to worry about AI). @kylania On a dedicated server now I have no addAction options at all. My assumption is that it is adding the actions locally to the server so the clients cannot see them. @coding I don't know how to get UIDs but stepping through the code I don't really see how it is different from just adding the actions via the init field for each unit. EDIT: I seem to have sussed it by fiddling the parameters. Now looks like this: _unit addAction ["Beacon", "beacon.sqf", [] , 1 , true , true , "" , "_this == _target"]; This way it checks if the unit the action is attached to and the one triggering the action are the same.
  14. Having used NVG before what you see through them is pretty much what is in game. There is normally a rubber "cup" around the lenses which prevents light leakage. So all you see when wearing the NVG is the image from the tube and black around it from the cups. You don't actually see the frame of the NVG at all. Basically it looks very much like it does in game now.
  15. I have set up a mission where Independent are friendly with East using the intel menu (where time of day, weather etc is). In the preview it is all sweet but as soon as I test it on a dedicated server they start shooting each other. Does anyone know what is going on? SOLVED: My stupidity is what was wrong with it.
  16. Getting a bit ahead but for that part you will need to use the "Fired" event handler (http://community.bistudio.com/wiki/ArmA_2:_Event_Handlers)
  17. At present I have a script for loading prisoners into vehicles. Problem is I can only make them load into Land OR Air OR Ship but not all of them. The script is as follows: This is for loading them onto planes and helicopters: _thisunit = _this select 0; _veh = nearestObject [_thisunit, "Air"]; if ((_thisunit distance _veh) < 10) then { detach _thisunit; ["Getin", [_thisunit, _veh]] call CBA_fnc_globalEvent; }; I can use either "LandVehicle", "Air" or "Ship" with nearestObject, but I need a way to use all three (so the prisoner gets into the nearest vehicle of ANY type). I tried "AllVehicles" but since people are technically vehicles _veh becomes the unit being manipulated. Anyone know how?
  18. Cheers man. Haven't had the chance to try it out yet but it seems to be on the money. I take it you simply use "select #" to work through the array?
  19. Set up a trigger. Activated by BLUFOR. Once. Put all the civvies inside the trigger area and name the group civGroup1. Call the following script from the activation field. _vehicle = nearestObject [player, "Landvehicle"]; //assign the vehicle to be the one nearest to the player {_x moveInCargo _vehicle;} forEach units civGroup1; //moves all of the units of civGroup1 into the vehicle In the above script the moveInCargo will teleport the civvies into the truck - which works but doesn't look awefully pretty. If you want it to look better check out other commands such as getInCargo, orderGetIn or assignAsCargo.
  20. Does Arma2 support this resolution? I am thinking about buying a new screen and saw Dell does one in this resolution and thought the extra width would be good for work purposes. Just wondering if it would work with Arma as well as the extra FOV would be nice.
  21. Valfunction

    Wave Defense Script

    Make the first group move onto your position as normal. Make a trigger near your position for OPFOR not present (make sure it covers where the first group initially is spawned). For the second group put a move waypoint close to where they start and sync it with a trigger that you just created, then create another waypoint for them to attack your position. You now don't have to place the second unit 1500m away because they will wait until the first unit is wiped out. Just make sure they are outside the trigger you created.
  22. I am trying to create a script where if you point at civilians with your weapon they stop moving. I have tested it with a couple mates in multiplayer (I'm the host) and it seems that I am the only one for whom the script works. When they point at the civilians nothing happens. I'm kinda stumped as to why. Code below: while {alive player} do { if ( (side cursorTarget) == civilian ) then { _trg = cursorTarget; _trg disableAI "MOVE"; sleep 5; _trg enableAI "MOVE"; } };
  23. Valfunction

    cursorTarget help

    Did not know this. Using the spawn command created some really weird lag. What I ended up doing is creating an event for the disableAI and addActions and then a separate event for the enableAI and removeActions. I called the first then slept 5 then called the second.
  24. I have a script where you can arrest a unit and then put them into the cargo of a vehicle for transport. I'm using action ["getInCargo"] to get them in the vehicle but then when I try to get them out the unit pops out for a fraction of a second and then snaps back into the spot it previously occupied in the vehicle. It works fine in the editor and if I am the host but in MP it stuffs up and does what I just described. The script to get them out is as follows. As you can see I've tried everything to get the to stay out of the car. { if (alive _x) then { _x disableAI "MOVE"; detach _x; unassignVehicle _x; _x leaveVehicle (nearestObject [player, "Landvehicle"]); _x action ["cancelAction", (nearestObject [player, "Landvehicle"])]; _x action ["getOut", (nearestObject [player, "Landvehicle"])]; moveOut _x; _x switchMove "ActsPsitMstpSnonWunaDnon_sceneNikitinDisloyalty_Sykes"; _x addAction ["Escort", "CIS\escort.sqf"]; _x removeAction putdown1; }; } forEach (crew cursorTarget);
×