Jump to content

Nielsen

Member
  • Content Count

    203
  • Joined

  • Last visited

  • Medals

Everything posted by Nielsen

  1. Nah, not quite :).. This references some other code. The triggers the code we want to change I think.Otherwise it is the unit.lifecycle.fsm file that handles it. But I dont know much about FSM I must say. What recruit script are you using? Give me a link to it, and I'll see if I can figure it out ;)
  2. This is prolly not the answer you are looking for (sorry about that) but practise makes perfect. It really is a downer to put alot of units inside towers etc. but once you get the hang of it, you can pretty much copy/paste the units to other towers (same height, same relative position etc.). For regular buildings you can use this command: Where _unit is the name of the unit, _house is the name of the house, and _posNo is the house position number. To get the building name you can use this: nearestBuilding _unit; To get positions you can use some commands or Grizzle's "Visual House Position Module" here: .. So use the module to check the locations in the types of houses you need, and then put this in the init line of the unit you want in there and place him on the house in the editor: then just replace the _X with the wanted position inside the house. Hope it helps
  3. @Acelondoner: You just have to add the iedDetect_init to the recruit script you are using.. E.g. your script has a or something like that.Throw this next line in right below the one above: Make sure the "_unit"'s match. The _unit in red should be the same as the variable/prefix allready used to describe the unit in the recruit script (the blue one). Hope that helps :)
  4. Thats a great idea. Looking forward to any updates! EDIT: A bit more feedback: 1. When the IED is detonated, the added action for remote detonation stays on it, and it doesnt get removed when executed. You just get the "Too far" hint. 2. I think it is cool that the script runs automated scans. Thats great for many scenarios. However I think that it would be nice with an option to make manual scans. It would be way cool if you could bring up the scanner (if possible not from the action menu) and hit a scan button. Maybe it would take a few seconds to get results. Or you could bring up the dialog, switch on the scanner, and the script would stay active while it was turned on. In that regard it would be nice if we could pause the script. 3. I really like the manual defusal idea. The "nasty defusal" sounds cool, and with that then who would want to be an engineer:cool:. I would rather have it be determined by class of unit than object though. So engineers can disarm the regular way to stay BIS compatible, everyone else has to do it the "nasty" way. That way we can still disarm regular ied's placed by another script the fun way :)
  5. I'm really loving this script. Your suggested method did not work for me, so I haxxed around with it a bit, and got it working with James' Advanced IED script. At least it works for me testing it out. Not sure how it will affect MP. I got inspired by your way of detection in v.1. :) One way to do it is to change James IED_MAN_v6.sqf script file. At line 83 he has a "sleep 2;". Replace that line with the following code: //Initiate Reezo's "SR5 Tactical IED Detection and Remote Det script"; sleep 5; private ["_near","_nearCount","_Check_Types"]; _near = _iedpos nearObjects 2; _nearCount = count _near; _Check_types = ["BAF_ied_v1","BAF_ied_v2","BAF_ied_v3","BAF_ied_v4","BAF_IEDBox","Land_IED_v1_PMC","Land_IED_v2_PMC","Land_IED_v3_PMC","Land_IED_v4_PMC"]; for [{_y = 0},{_y < _nearCount},{_y = _y + 1}] do { { if ((_near select _y) isKindOf _x) then { nul0 = [(_near select _y)] execVM "scripts\IEDdetect\IEDdetect_add.sqf"; //the line below does not seem to work when trying to incorporate HOZ' disarm script. // HOZBOMBACT = (_near select _y) addAction ["Disarm Bomb", "HOZ_dabomb\scripts\ACT_dabombdlg.sqf", [player]]; }; } forEach _Check_types; }; Now it is important to replace the sleep, as the 2 second sleep is insufficient time for the ied to get setup correctly and return as an object... That had me going for a while :D. With that working it should be no problem to further incorporate Hoz' script. I've added the line for good measure. Just setup Hoz script as allways, and uncomment the line under the one that says "uncomment line below" ;). EDIT: Scratch that. I tried it and that didnt work. The IED department is really shaping up real nice these days :)
  6. @Albertos: That would be cool.. The Hoz script allows you to define the correct wire, in addition you have the ability to set a variable that triggers a hint about the correct wire when finding "bomb instructions". I've modified Hoz' script a little bit for my own use, and it should be easy enough to make the scripts work together I think. Great idea about the global array by the way. About the IED script question. I use "James (00DC15)' Advanced IED script" http://forums.bistudio.com/showthread.php?t=107754. I think that is a really nice script.
  7. Just realized that I never said thanks in this thread. This is a great script man. I love it. Thanks for the good work!
  8. This is a great initiative! Cant wait to try it out. Sounds really sweet. Thanks for your work man! @Clawhammer: It might not be very "easy", but Hoz from OFPEC has made a really nice disarm script that simulates a 4 wire bomb, where you have to cut one of the wires. Someone else pointed me to it. Its great. You can find it here:' http://www.ofpec.com/forum/index.php?topic=33455.0 Nielsen
  9. I'm having a problem despawning a spawned group. Ive got no problem deleting units outside the group vehicle. The problem arises when all units are dead and some are in a vehicle, and I want to delete them and the group vehicle. is not working. I'm using this bit of code to test it: It works fine when the soldiers are alive, but if I kill them all before the despawn fires, then i get errors and it wont work proper. The problem suggested by my diag_log debug is, that the object names seem to change when they die. I get this error in the .rpt: ..I've searched around but found nothing, very much to my surprise. Any ideas on how to handle this and deleting the group (and vehicle) when soldiers are dead inside the vehicle? Thanks in advance
  10. @Shk: Thats the trick I'm looking for :) Working like a charm now. Thanks for the help all..
  11. Thanks for taking the time to answer. Oops yeah I see with the diag_log.. Silly me. However it was the other variable that really concerned me. Normally {DeleteVehicle _x} foreach units group; works, but when this is a vehicleGroup it does not seem to function. I'm not sure how to reference the vehicle other than how i did it above, and that wont work for me. Maybe I should just spawn the units and vehicles individually, that way I should be able to despawn just fine. It just pisses me off that I cant work it out, and I figure that there must be an easy way since I use the BIS_fnc_spawngrp, which should work I guess. I'm sure I'm not the first one to despawn a config group.
  12. Nielsen

    ZGM Mapmaking Tutorial

    This is a great initiative! Something like this might actually inspire people like me to delve into mapmaking. Two thumbs up!
  13. After reading Kylanias astute description on how to use the BAF IEDs here, I found myself in the need of a way to randomize this process. So, I've wipped up a script that will make this easier. Realizing that someone else (even less versed in scripting than myself) might find this usefull, I thought I might as well throw it up here on the forum. To be honest I'm kinda hoping that someone better at scripting *cough*Kylania*cough*Shk*cough* will be appalled by my crude code and/or method, and decide to make something solid :D. Well here goes. It's just a simple script doing the exact thing that Kylania showed. An ai sets an ied, moves of and blows it when the target side gets within 10m. I use it to place random IEDs by placing a civilian or opfor (execVM the script in init), and grouping him to several markers to make it random. I have added some control over the type of IED to set. Parameters are explained at the top of the script. I have tested it SP and it seems to work fine. I have not had a chance to test it in MP though. It should work I guess. BAF_iedScript.sqf // --------------------------------------------------------------------------------------------------------- // BAF IED Script // Author: Nielsen // Credit: // Kylania @ bisforums for describing how to use the BAF IEDs. // Shk @ bisforums for helping me debug the script (and several others). // Please feel free to modify or distribute this code as you see fit. Any recognition will be appreciated. // --------------------------------------------------------------------------------------------------------- // USAGE: // Place this script in your mission directory. Place an ai in the editor AND NAME HIM. // It is important to name him, what you name him is not important. // In the init line put: // ied = [this,"type","size","side"] execVM "BAF_iedScript.sqf"; // The ai will set an ied of the chosen type, move of a certain random distance and hide. // When the chosen side are within 10m of the IED, if still alive the ai will detonate it. // // Required parameters: // unit = Unit to set the IED (i.e. this). // type = Type of IED set. Options are "garbage", "ground" and "random". // size = Size of the IED. Options are "small", "big" and "random". // side = Side that will make the IED explode. Options are "west", "east", "civ" and "guer". // // Init line examples: // ied = [this,"garbage","big","WEST"] execVM "BAF_iedScript.sqf"; // ied = [this,"random","small","CIV"] execVM "BAF_iedScript.sqf"; // ied = [this,"random","random","EAST"] execVM "BAF_iedScript.sqf"; // --------------------------------------------------------------------------------------------------------- if !(isServer) exitWith {}; private ["_ai","_ied","_iedSize","_randomIED","_position","_hidePos"]; _ai = _this select 0; _ied = _this select 1; _iedSize = _this select 2; _randomIED = floor (random 2); _position = getPos _ai; //Set IED type private ["_iedType"]; switch (_ied) do { case "garbage": { switch (_iedSize) do { case "small": { _iedType = "BAF_ied_v1"; }; case "big": { _iedType = "BAF_ied_v2"; }; case "random": { if (_randomIED == 0) then { _iedType = "BAF_ied_v3"; }; if (_randomIED == 1) then { _iedType = "BAF_ied_v4"; }; }; }; _hidePos = [(getpos vehicle _ai select 0) + ( 50 + ((random(50)))*sin(getdir vehicle _ai - 180)), (getpos vehicle _ai select 1) + ( 50 + ((random(50)))*cos(getdir vehicle _ai - 180))]; }; case "ground": { switch (_iedSize) do { case "small": { _iedType = "BAF_ied_v3"; }; case "big": { _iedType = "BAF_ied_v4"; }; case "random": { if (_randomIED == 0) then { _iedType = "BAF_ied_v3"; }; if (_randomIED == 1) then { _iedType = "BAF_ied_v4"; }; }; }; _hidePos = [(getpos vehicle _ai select 0) + ( 100 + ((random(100)))*sin(getdir vehicle _ai - 180)), (getpos vehicle _ai select 1) + ( 100 + ((random(100)))*cos(getdir vehicle _ai - 180))]; }; case "random": { switch (_iedSize) do { case "small": { if (_randomIED == 0) then { _iedType = "BAF_ied_v1"; }; if (_randomIED == 1) then { _iedType = "BAF_ied_v3"; }; }; case "big": { if (_randomIED == 0) then { _iedType = "BAF_ied_v2"; }; if (_randomIED == 1) then { _iedType = "BAF_ied_v4"; }; }; case "random": { private ["_randomType"]; _randomType = round random 3; switch (_randomType) do { case 0: { _iedType = "BAF_ied_v1"; }; case 1: { _iedType = "BAF_ied_v2"; }; case 2: { _iedType = "BAF_ied_v3"; }; case 3: { _iedType = "BAF_ied_v4"; }; }; }; }; _hidePos = [(getpos vehicle _ai select 0) + ( 50 + ((random(150)))*sin(getdir vehicle _ai - 180)), (getpos vehicle _ai select 1) + ( 50 + ((random(150)))*cos(getdir vehicle _ai - 180))]; }; }; //set IED muzzle private ["_iedMuzzle"]; _iedMuzzle = format ["%1_muzzle",_iedType]; //Debug //diag_log format ["iedType: %1 - IedMuzzle: %2",_iedType,_iedMuzzle]; //Add and set IED removeAllWeapons _ai; _ai addMagazine format ["%1",_iedType]; _ai playmove "amovpercmstpsraswrfldnon_gear"; _ai Fire format ["%1",_iedMuzzle]; //Create proximity trigger private ["_tgtSide"]; _tgtSide = _this select 3; IEDtrigger = createTrigger["EmptyDetector", position _ai]; IEDtrigger setTriggerActivation [format["%1",_tgtSide], "PRESENT", false]; IEDtrigger setTriggerArea [5, 5, 45, false]; IEDtrigger setTriggerStatements ["this",format["%1 action [""TOUCHOFF"",%1]",_ai],""]; //Run and hide _ai doMove _hidePos; sleep 10; _ai setBehaviour "STEALTH"; Sample mission: here Everyone is more than welcome to improve on this. I would appreciate any thoughts on the code or related. I'm especially interested in advice on a better way to make the ai hide and watch for opfor. I'm thinking that a 'BLUEFOR - Detected by OPFOR' trigger might be cooler for detonation but that would require some more clever control of where the ai hides to be effective. Well anyways. I hope someone finds it usefull. Regards,
  14. Well if it says 'IED.sqf not found' then the script file is probably not in the right mission folder. Make sure the script it in the same folder as the mission.sqm and make sure that it is correctly named.
  15. I would recommend the EODD script by Rommel to familiarize yourself with dialogs. I havent done any dialogs yet, as I figure I want to be better at scripting first. But when I looked through Rommels script the dialogs made alot more sense to me. The script uses a simple dialog, and the dialog (+ the connected scripts) are pretty much the only features in the mission, so you do not get confused while sorting out the relevant information. Just a thought
  16. Nielsen

    BAF IED-Script

    Yes that is indeed the problem. The ai setting the IED must be named, because the trigger cant identify the ai otherwise. Shk pointed this out to me here.
  17. Nielsen

    BAF IED-Script

    Hey James.. You bet. I have been checking the thread for your updates on a day-to-day basis ;) Seems like the scipt is comming along. Sounds great! I'm looking forward to trying it out.
  18. This looks really nice. I'm very impressed by your house objects. Those are (to embrace the lingo) plain awesome! :) You should consider making object packs sometime, as you are obviously a great modeller. Looking forward to the island!
  19. Nielsen

    BAF IED-Script

    That sounds great. Looks like you've got it pretty much locked down. I like your approach to no. 5. I was wondering how you would achieve it without making an addon. 1: I see. If he places the IED at a (somewhat) random time, wont that be a potential problem. With waypoints wouldnt I have to ensure that the AI was at a good IED spot all the time? Or do you have some sort of failsafe? 2: No exactly. My script makes the AI run of a certain random distance dependant on the object type. What I wanted was some way of defining for example either a city- or a rural IED. In a city you would want the AI to stay relatively close to the IED - maybe in a building - for him to be able to see it. On the other hand, if the IED is set out on the open road, then you want the AI to move of somewhat further and take cover (maybe even spawn a bush for him to hide behind). The point is different behaviour dependant on the environment. I guess you could just check the distance to nearest house object to infer if the AI is in a city, and set the behaviour accordingly. 3: Yeah, I figure since the detonate command allows anybody to set of the IED, it wouldnt be that hard to implement. I guess passing the array as a parameter and doing some forEach would take care of it. I really like the idea of civs watching with binoculars from rooftops! 4: Guess that feature is build in then. Great. In that case it would be cool if the engineers did not trigger the detonation. Still looking forward to your script.
  20. Nielsen

    BAF IED-Script

    Yeah. Thats the reason i didnt put the 'detected by' trigger in there. It is easy to make him face the IED, but I do not know how to ensure that he can see it.@00dc15: Sounds great. I was hoping someone would make a better script. I initially had those same criteria in mind, but 4 and especially 5 are somewhat out of my scope atm. Have you figured out how you are going to achieve 5? Some feedback: 1: I would not want you to restrict IEDs from roads. The garbage IED models are quite nice on roads. Essentially I would like garbage on the road and ground/dirt models on the side of the road. 2: In my script the (random) distance the AI runs of is dependent on the object type. I think it would be cool to make something a bit more advanced, so that you you place an IED out in the open, he will run to the edge of detonation range and prone. Alternatively it would be cool to have them seek sufficient cover in the terrain, I guess that could be achieved by having them in 'combat'. 3: It would be cool if the user was able to specify an array of AI's that could detonate the IED, so that you could have several civilians around the site watching it. That way you would also be able to decrease the chance having no detonation. 4: It would be great if engineers did not trigger the detonation by default, but instead had a slight chance of detonating it regardless of it being observed, ideally when trying to defuse it. If this is not allready a feature in the game that is. Havent seen it yet though. 5: That would be just plain awesome! I'm really looking forward to your script. Sounds promising :)
  21. Nielsen

    BAF IED-Script

    @DarkEclip: No worries, glad you got it working. @Callihn: Yeah, I made that mistake myself when testing the script. I started to debug before i realized I had the wrong side :P... Nice idea with the building btw, and that is something that my limited abilities does actually allow me to do. I figure that often I want IED's in the open, and the nearest building would be too far away. I'm propably gonna add another parameter for the AI to either hide in the open, or hide in nearest building.
  22. Nielsen

    BAF IED-Script

    Hmm. Thats weird. The script and mission are so simple that I am not sure what can be wrong. You do have Arrowhead and the BAF DLC right? Do you get any errors? As soon as the mission begins both the ai should put an IED on the ground and move of. If you start the mission and just watch, then nothing happens and the bluefor vehicles just pass by?
  23. Nielsen

    BAF IED-Script

    I have put a link to a sample mission in my first post. I hosted it on rapidshare, as I dont know where else to host it. @DarkEclip: Just to be sure, the 'exeVM "filename"' have to match the filename. If you have named your script BAF_iedScript.sqf as I have above, then your init line should read: ied = [this,"random","random","west"] execVM "BAF_iedScript.sqf";. If this is not the problem then I'm not sure why this happens. But if you use an Opfor unit, then remember that Bluefor will engage him if they spot him, and may take him down before he sets of the bomb (i.e. Bluefor within 10m). Give the sample mission a try :)
  24. Nielsen

    IED Module

    An IED module (like the VBS one showed) would be SO awesome, especially after Arrowhead has come out. I cross my fingers that BIS sees a demand for this. I would also have no problem with paying for it as DLC! Anything to have a proper working IED system.
  25. As the headline states, I am having a problem using format when setting trigger statements in a script. What I am really trying to do is to transfer a local variable to a trigger. IEDtrigger setTriggerStatements ["this",format["%1 action [""TOUCHOFF"",%1]",_ai],""]; _ai is defined and private above. I get a script-error telling me that I'm missing a ; but I cant figure out where. Any help would be greatly appreciated. Thanks
×