Jump to content

kylania

Member
  • Content Count

    9181
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by kylania

  1. Can you post the code you're using so we can see if we spot any errors?
  2. See, Gunn. This is why I gave up trying to help you in another thread. You put absolutely NO effort into learning. Ghost linked you a lot of great help options. I linked you a thread where the second sentence was "...how do i make sure it only trigger when there's no more enemies within the trigger area?" Did you not even read that far? Did you even click either of our links? If you're not willing to even try, you're not going to get much done. Set up a Trigger which should cover the area you're fighting in (try Axis A = 5000 and Axis B = 5000). Set it to Activation of OPFOR, ONCE, Not Present. Set it's Type to End1. Done. Though, to make it a Success, you'll need a Briefing file as well. Good luck.
  3. There was even a thread from today with this very answer in it...
  4. Here's the code I use, but using your variable names, maybe it'll work? :) _vcl SetVehicleVarName _name_vcl; _vcl Call Compile Format ["%1=_This ; PublicVariable ""%1""",_name_vcl];
  5. kylania

    setFace

    I assure you it works, when used properly. Where exactly are you putting this "command line"? The code goes in the unit's Initialization field. Here are two Riflemen. The one the left has no Init field. The one on the right has this setFace "face04_camo4"; as it's Init field. When used correctly, this does work. Note that this will not work for the "Force Recon" named units such as Cooper, Miles, O'hara, and the others but will for the generic Force Recon faces.
  6. TL;DR = It works. Within 15m with engine off. Action is on the MHQ. Test mission included. You can download the test mission, MHQ Proof of Concept to follow along with the umm.. following. Well, the main challenge in this was dealing with vehicle respawn. I'm actually not sure it's working properly in multiplayer to be honest. The vehicle respawn method I used was "Simple Vehicle Respawn Script v1.3" by Tophe. It didn't really work with the ammo box though, and I'm too tired to try to fix it, so instead I made the ammo box a one time thing. If you lose it, too bad you're gonna have to use the ammo at base. For the MHQ itself, I decided to stick with the 'respawn at base, teleport to the MHQ' concept, but very simple. No dialogs, no error checking, just.. poof! I also use ArmATec's AmmoRefiller script on the ammobox to keep it full all the time it's alive. I decided to limit the loading of the box to only work with the MHQs engine turned off and the box within 15 meters of the MHQ. Unloading is similar, having to have the engine turned off. While this does allow some speedy coasting load/unload times, it seemed reasonable. So, first up, the ammobox! It's called mhq1_ammobox since I was too lazy to make a full init file with options and stuff. So call it that. It's init string is the following, which simply sets up the autorefill script for it. Otherwise, nothing special about it. _null = [this] execVM "AmmoRefill.sqf"; Second you have your MHQ. It must be called mhq1, again since I'm lazy. It also must be the LAV25_HQ vehicle, or else you'll need to change some code to make it match the proper typeOf after respawn. It's init string is a bit more complicated, since we're both adding the option to load the ammobox and setting up vehicle respawn on it. _null = mhq1 addaction ["Load ammobox", "attach_ammobox.sqf"]; veh = [this, 15, 100000000, 5, TRUE] execVM "vehicle.sqf"; The 100,000,000 setting in the respawn line is to keep it from exploding when you get out. Several times it would think you'd abandoned it and explode. At first it was funny, not so much after a few hours of testing. I put a few extra vehicles with respawns in the test mission as well. There's also a Flag pole with the following init: _null = this addaction ["Teleport", "teleport.sqf"]; Basically, run up to it, click Teleport and you appear behind the MHQ. There are two triggers, Radio Alpha to kill yourself and Radio Beta to kill the MHQ, for testing or lulz. Now, the scripts! The first script is what attaches the box to the MHQ. attach_ammobox.sqf: // If for some reason the ammo box is destroyed, don't try to load it and remove actions to load or unload. if (!alive mhq1_ammobox) then { // Remove the current actions. _removeActions = [mhq1] execVM "removeActions.sqf"; waitUntil {scriptDone _removeActions}; hint "Nothing to load!"; } else { // Since the box is still in one piece, make sure it's within 15m of the MHQ and the MHQ isn't on. if (mhq1 distance mhq1_ammobox < 16 and !isEngineOn mhq1) then { // Attach the box to the MHQ roof. mhq1_ammobox attachTo [mhq1,[.5,-1.5,.9]]; // Clear the current actions. _removeActions = [mhq1] execVM "removeActions.sqf"; waitUntil {scriptDone _removeActions}; // Change the action on the MHQ to unload the box now. _null = mhq1 addaction ["Unload ammobox", "detach_ammobox.sqf"]; } else { // If the box isn't within 15m or the engine is running, tell them they have to try again. hint "You must be within 15m of the ammo box, with your engine off, to load it!"; }; }; Next is the code for detaching the ammobox and moving it 10m behind the MHQ. detach_ammobox.sqf: // If for some reason the ammo box is destroyed, don't try to load it and remove actions to load or unload. if (!alive mhq1_ammobox) then { // Remove the current actions. _removeActions = [mhq1] execVM "removeActions.sqf"; waitUntil {scriptDone _removeActions}; hint "Nothing to load!"; } else { // Since it's alive, make sure the engine is off on the MHQ. if (!isEngineOn mhq1) then { // Detach it, and move it 10m behind the MHQ, on the ground. detach mhq1_ammobox; _worldPos = mhq1 modelToWorld [0,-10,0]; mhq1_ammobox setPos [_worldPos select 0, _worldPos select 1, 0]; // Remove the current actions. _removeActions = [mhq1] execVM "removeActions.sqf"; waitUntil {scriptDone _removeActions}; // Add the action to load it again. _null = mhq1 addaction ["Load ammobox", "attach_ammobox.sqf"]; } else { // If the engine was running, warn the user. hint "You can't unload while your engine is running!"; }; }; Third script is just a little function for clearing the actions. Since it's called so often I wrote it once and reference the function instead of writing the code each time. removeActions.sqf: // Grab the input. _mhq = _this select 0; // Remove all player added actions from the object. _action = _mhq addAction["foo", "foo.sqf"]; while {_action >= 0} do { _mhq removeAction _action; _action = _action - 1; }; Here's the crazy basic teleport script. teleport.sqf: // Who activated the action? _caller = _this select 1; // Move them 5m behind the MHQ. _worldPos = mhq1 modelToWorld [0,-5,0]; _caller setPos [_worldPos select 0, _worldPos select 1, 0]; And here's what I added to the Vehicle Respawn system to allow the MHQ to continue working after being destroyed (something I read most vehicle respawn scripts don't handle.) Additions to vehicle.sqf: // Added by Venori. // This checks if it's the MHQ being respawned and if so, sets the vehicle name back to "MHQ1" so the scripts all keep working. if (_type == "LAV25_HQ") then { _VarName = "mhq1"; _unit SetVehicleVarName _VarName; _unit Call Compile Format ["%1=_This ; PublicVariable ""%1""",_VarName]; sleep 1; // If for some reason the ammo box is still alive, give the option to load it again. if (alive mhq1_ammobox) then { _null = mhq1 addaction ["Load ammobox", "attach_ammobox.sqf"]; }; }; The few remaining bugs are 1) the respawn script I choose doesn't appear to be MP friendly 2) it's possible to at times blow up the MHQ, but not the ammobox that was attached. In this case the ammobox floats in mid air till you drive back to it and reload it. 3) Not really a bug, but I'm slightly disappointed I couldn't get the box respawn working.
  7. I got the ammo box working using attachTo. It's pretty neat. :) Working in the MHQ respawn stuff I think you're using too.
  8. What you're asking for isn't a few lines of code nor will it be easy, it's a system. To use it you'll want to know what you're doing. You could try something like "TransBox" from Mad Max. It's for OFP, but might work for ArmA2. Problem is, it might conflict with your MHQ stuff. Depends on how you're doing the MHQ thing really. Posting that would help. I've already explained basically what you'll need to do, and given you links to the commands that will do them. If you're a newbie to scripting and want to learn, this is a pretty good exercise to start with. :) Give it a try and post what you get. Edit: Something you asked in another thread gave me an idea, and you could actually use attachTo for this and skip a lot of the variable nonsense. hmm. Using a USBasicWeapons box you'd use this to mount it: this attachTo [MHQ1,[.5,-1.5,.9]];
  9. kylania

    Ammo classname

    The vehicle weapons aren't listed there though, so the rocket/missile ones are missing.
  10. It's probably just done by setting a variable attached to the vehicle of it's got something in or not. When you deploy you create whatever box you want, when you load it you delete whatever one was previously deployed. Look into createVehicle/deleteVehicle for creating and destroying the crate. The US Basic Weapons box has a classname of USBasicWeaponsBox, you'd probably want to empty this and fill it with whatever weapons/ammo you wanted. Look into clearMagazineCargo and clearWeaponCargo along with addWeaponCargo and addMagazineCargo Then check out setVariable for keeping track of if it's loaded or not.
  11. kylania

    Ammo classname

    I imagine the ones from ArmA would have stayed the same, so would be found here: http://community.bistudio.com/wiki/ArmA:_Weapons For new one, I guess you need to pick apart some of the config files?
  12. kylania

    3.5 mins to save game?

    ^^ Truth. It used to take me like 3 minutes to start Age of Conan. Then I went defragged, after that it took 30 seconds. Defragging is huge. Of course it can also piss you off if you use an automatic defragger that doesn't quite realize "Oh, you're playing a game? Sorry, I'll stop trying to move your game files....". :)
  13. kylania

    setFace

    It's exactly the same, just for a single unit. setFace In your unit's init field put the following: this setFace "face04_camo4"; The Face number is from Face01 to Face107 and the Camo number is from camo1 to camo6.
  14. kylania

    setFace

    The 12th post on the front page of this forum included an example: Adding Camo Faces to AllUnits
  15. Here's the helpful ArmA list: http://community.bistudio.com/wiki/ArmA:_CfgVehicles And the less helpful (till it's edited) ArmA2 list: http://community.bistudio.com/wiki/ArmA2:_CfgVehicles
  16. Erm, are you asking for us to answer all of that? Coz, at least with #1 you've essentially answered it yourself, and I answered it earlier in another thread. Start here with your search of knowledge. http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA2 Then look for similar scripts here to see how others did it. http://www.ofpec.com/ Then if you still have questions, ask here. Your initial question shows a disturbing lack of having tried anything yet and is extremely complex for what you want it to do. Start small, learn as you go, get better. :)
  17. Great to hear Mr Murray, your first guide was just amazing!
  18. Here's a sample mission that does what you want I believe. It's abstracted, as in the evidence doesn't become an inventory item, it just goes away and completes the task. First place your player. Second place the evidence, named evi1, where you want it to be found. I used EMPTY -> Objects (Small) - Evidence (File2) for my example. Also place an EMPTY marker called obj1 there so the task system knows where to direct the player to look. In the Init field of the evidence object I put the following: evi1's init field: this addaction ["Collect evidence!", "collect.sqf"]; This will add an action to the folder allowing the player to use the item to collect it. The contents of the collect.sqf is as follows: collect.sqf: deletevehicle evi1; tskEvidence1 setTaskState "SUCCEEDED"; [objNull, ObjNull, tskEvidence1, "SUCCEEDED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf"; That will delete the item in game since you've "collected" it. Set your current task to SUCCEEDED and display a pretty hint window saying so. I also have a trigger with the condition of !alive (evi1) which plays some music when you find the folder. I also have another trigger which ends the mission. It's an End1 Type trigger with this as it's settings: End1 Trigger Condition: taskCompleted tskEvidence1; End1 Trigger On Act: End1; I also set the timeout period for this trigger at 10/10/10 so you could listen to the music and see the 'Task Completed' hint. :) The actual task system is set up via three files, init.sqf, briefing.sqf and briefing.html. These are those files: init.sqf: execVM "briefing.sqf"; briefing.sqf: player createDiaryRecord ["Diary", ["Mission: Find the Folder", "Your mission is to pick up this folder."]]; tskEvidence1 = player createSimpleTask ["Find evidence."]; tskEvidence1 setSimpleTaskDescription ["Near the fountain you'll find a blue folder. Pick it up.", "Find evidence.", "Search for Evidence"]; tskEvidence1 setSimpleTaskDestination (getMarkerPos "obj1"); player setCurrentTask tskEvidence1; [objNull, ObjNull, tskEvidence1, "ASSIGNED"] execVM "CA\Modules\MP\data\scriptCommands\taskHint.sqf"; briefing.html: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1250"> <title>Title</title> </head> <body bgcolor="#FFFFFF"> <! -----DEBRIEFING-----> <hr> <br> <h2><a name="Debriefing:End1">Evidence Found!</a></h2> <br> <p> <! ------victory------> You found the stuff, I am so proud of you! </p> <br> <hr> <br> <h2><a name="Debriefing:End2">WHAT DID YOU DO!?</a></h2> <br> <p> <! ------KIA------> Srsly? </p> <br> <! -----DEBRIEFING END-----> </body> </html>
  19. Synch the "area clear" trigger with the hold waypoint.
  20. Here's a quick and dirty way to do it with a bomber and two waypoints. You can download the test mission to see how it works as well. Place the Radar object where you want it, named radar. Place the bomber pointing at it, flying. Name it bomber. Place a MOVE waypoint just past the Radar (you'll want to play around with the distance past to make it look good.) then another MOVE waypoint where you want it to disappear. In the On Act. of the first waypoint put: pos = getPos radar; b2 = "Bomb" createVehicle pos; b2 setPos pos; b1 = "Bo_GBU12_LGB" createVehicle pos; sleep 0.5; deleteVehicle b2; In the On Act. of the second waypoint put: {deleteVehicle _x} forEach crew bomber; deleteVehicle bomber; Note that if you don't delete the crew first, they poor pilot will be left hanging in the air where you deleted the plane! :)
  21. Set up a Trigger that covers the area you're intersted in. Set the Trigger to activate on Anybody, Present, Repeatedly . Put this in it's Condition field: vehicleName in thislist;
  22. With disableAI: _soldier1 disableAI "MOVE"; You can combine that with _soldier1 setUnitPos "UP"; to keep them standing after you attack them. The main drawback of this is that they can't move at all. Meaning, unless you stand directly in their line of line (not arc, line) they can't turn to shoot you.
  23. Make sure the name of your SOM module is SOM.
  24. To make the heli land instead of hover, place an invisible H (Heli pad) where you wanted it to land.
  25. I prefer to make the whole crew get out, and the others kill the ones not needed, then the survivors reboard and fly to me. Wait no, I prefer to make an empty chopper and move in a pilot, is what i meant to say.
×