Charles Darwin
Member-
Content Count
133 -
Joined
-
Last visited
-
Medals
Everything posted by Charles Darwin
-
A-10 and 30 mm
Charles Darwin replied to Wiki's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
if you wanted to give AI the ability to fire only 30mm remove all other weapons from the plane, give the pilot a long view distance(at least 7K) and set it to SAD in the area...though it wont be nearly as pretty as the unitplay/unitcapture method it is however more dynamic -
Civilian Immersion Script Suite
Charles Darwin replied to Kolmain's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Sorry real life snuck in last week and robbed me of most of my time. -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
thanks for the info on control second bit I am aware of and am in the process of changing..I have the server running a script to monitor two variables (LHD_Elev and LHD_Elev_W) determines which one is larger and then moves the elev object based on that. I am now going to work on a simple dialog to add to the control object(hence forth elev_control) that will activate the elevator and have several buttons so that the player can chose which level he wants the elev to go to. -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
if(isserver)then{ _lhde = (getposASL LHD_center select 0); _lhds = (getposASL LHD_center select 1); _lhdz = (getposASL LHD_center select 2); _LHDspawnpoint = [_lhde, _lhds, -.43]; { _dummy = createVehicle [_x, _LHDspawnpoint, [], 0, "NONE"]; _dummy setdir (getdir LHD_center); _dummy setPos _LHDspawnpoint; } foreach ["Land_LHD_house_1","Land_LHD_house_2","Land_LHD_1","Land_LHD_2","Land_LHD_3","Land_LHD_4","Land_LHD_5","Land_LHD_6"]; sleep .01; elev = createvehicle ["Land_LHD_elev_r", _LHDspawnpoint, [], 0, "NONE"]; publicvariable "elev"; elev setdir (getdir LHD_center); elev setPos _LHDspawnpoint; sleep .1; control = createvehicle ["powergenerator", _lhdspawnpoint, [], 0, "NONE"]; publicvariable "control"; control enablesimulation false; control setdir (getdir LHD_center); control attachto [LHD_center,[18.5547,-81.7495,14.7995]]; sleep .1; elev_trig = createTrigger["EmptyDetector",_lhdspawnpoint]; publicvariable "elev_trig"; elev_trig setTriggerArea[6.5,6.5,0,true]; elev_trig setTriggerActivation["ANY","PRESENT",true]; elev_trig setTriggerStatements["this", "", ""]; elev_trig attachto [LHD_center,[22.5283,-92.0315,.339975]]; _marker1 = createMarker ["test", _lhdspawnpoint]; _marker1 setMarkerShape "RECTANGLE"; "test" setMarkersize [22,127]; "test" setmarkercolor "Colorblue"; "test" setmarkerDir (getdir LHD_center); }; sleep 1; act = control addAction ["Lower Elevator", "LHD\elevdown.sqf",elev,7,TRUE]; latest init it's still not dedicated compatible as far the actions go this solves the problem of the control object opbject creation, the init was running too fast and basically getting ahead of itself. -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
ok did a bunch of testing and it's something in the init(there are other dedicated issues but this is where I am stuck right now) on a dedicated server elev = createvehicle ["Land_LHD_elev_r", _LHDspawnpoint, [], 0, "NONE"]; elev setdir (getdir LHD_center); elev setPos _LHDspawnpoint; Works spawns the elevator all good! control = createvehicle ["Powergenerator", _lhdspawnpoint, [], 0, "NONE"]; control setdir (getdir LHD_center); control attachto [LHD_center,[18.5547,-81.7495,14.7249]]; does not work, spawns but is not labeled as control so that it can be referenced by the items right below it there the same code minus the attach command :confused: curse you ArmA mulitplayer scripting:mad:! lol -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
OOh I think I know why it's failing in dedicated..though now I am not sure why it worked dedicated before:confused: lol I'll do some testing when I get home in a few hours -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
[/color]hmm it was working when i tested it on dedicated, I have to get to bed but Ill do some testing tomorow and see -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
NP :) As I said I am working on making it more self contained, IE the script will spawn eveything it needs based off the location and position of the LHD_center logic. in that effort I am trying to add the actions to a spawned power generator. then attach the generator the LHD_Center at the appropriate offset, unfortunately I have hit a bit of a head scratcher. If the control object is in mission(ie placed in editor) it works fine..if i have the script spawn it, the action isn't added: // control = createvehicle ["POWERgenerator", getmarkerpos "test" , [], 0, "NONE"]; control setdir (getdir LHD_center); act = control addAction ["Lower Elevator", "elevdown.sqf",elev,7,TRUE]; control attachto [LHD_center,[18.5547,-81.7495,14.7249]]; control enablesimulation false; any ideas? EDIT__________________ Ok it DOES add the action but only after about 10 seconds:confused: -
Civilian Immersion Script Suite
Charles Darwin replied to Kolmain's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
will do! it'll probably be thursday when i can record them.If you get me a list of the actions ie Get out of car put the weapon down etc I will record some :) -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Will do! it should be a lot easier to get it working after I finish making the code self supporting by having the trigger and the control object created alongside the LHD based on the position of the LHD_center -
Civilian Immersion Script Suite
Charles Darwin replied to Kolmain's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Kolmain, more than willing to do voice acting for you -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Woohooo! I'm honored I have found a lot of really cool scripts on armaholic and I am glad I can contribute too :D Also not to be a nag, especially since it's due to my not being very clear in my last posts, but the issue with the vehicles not moving with out AI or player in them has been fixed, but you'll need to add a trigger over the LHD elevator area and name it elev_trig. I would suggest adding a limitation describing that there is an invisible floor on the flight deck that will interfere with vehicle's when they go down or come up as shown in video Sorry there hasn't been any improvements I work week on week off so in a few days there should be some improvements. My next goal is to automate trigger and control creation basing their positions off the LHD_center object. Againa very honored to be frontpaged! :D -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
absolutely, its a really easy task to set the height just change the -17.1 in red to what ever height you like. In my mission -.345 is the default "up" height ASL of the elevator and that number is in the same location but in the elevup.sqf, though from testing it seems that the set/getposASL is not functioning correctly so you may have to fiddle with the exact height to get it right. I my testing the hangar bay was around -10 i beleive. //****************************** Define Stuff*******************//; // This is the controlling object that will have the action attached to it; _object = _this select 0; _obx = (getposasl _object select 0); _oby = (getposasl _object select 1); // This is the Unit Activating the Action; _caller = _this select 1; //ID of the action so we can remove it; _id = _this select 2; //Name of the elevator object defined in the init; _elev = _this select 3; // Trigger that checks for vehichles so we can give them a nudge down.; _trig = list elev_trig; // ***************************Actual Script Stuff here*******************//; // Check if server; if (isServer) then { // Remove the Action that was called; _object removeaction _id; // Check Initial height of the elevator; _height = (getposASL _elev select 2); //Hint for testing Purposes; hint format ["%1 %2", (list elev_trig select 0),(list elev_trig select 1)]; //Nudge any vehicles down so they don't get stuck in mid air {_x setposASL [getposASL _x select 0, getposASL _x select 1,((getposASL _x select 2)-.015)]; } foreach _trig; // Move the Elevator; [color="#FF0000"]while {_height > -17.1}[/color] do { _elev setposASL [getposasl _elev select 0, getposASL _elev select 1, ((getposasl _elev select 2) -.015)]; // Activate the line below this if you want your control object to move down with the elevator; // _object setposASL [_obx, _oby, ((getposasl _object select 2) -.015)]; //Checks the height of the elevator again so the script knows when to stop.; _height = (getposASL _elev select 2); sleep .01; }; // Add the Action to raise the elevator.; act = _object addAction ["Raise Elevator", "elevup.sqf",elev,7,TRUE]; -
How to change unit setcaptive status when it gets near certain moving units?
Charles Darwin replied to CaptainBravo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
and you tried with just {(_x iskindof "Fin")} correct? -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
my guess is that is was planned for the LHD to have an open flight deck and LCAC bay but time/money constraints got the upper hand.there is a modeled LCAC bay but the rear doors don't open and there is no way down to the bay from inside the ship. The only reason this is possible is because the elevator is modeled as a separate piece from the rest of the flight deck so I can move w/o moving the other unfortunately it's not possible with out making a new model, to add this to the lcac bay doors -
How to change unit setcaptive status when it gets near certain moving units?
Charles Darwin replied to CaptainBravo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
no reason it shouldn't try it with the trigger set to anybody(as apposed to blufor-opfor). If not Im not sure you could attach an object to every one of the dogs and then hide them. -
How to change unit setcaptive status when it gets near certain moving units?
Charles Darwin replied to CaptainBravo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
set it to be activated by anybody and see what that does. might be this as well {!(_x iskindof "Fin")} count thislist > 0; try: {(_x !iskindof "Fin")} count thislist > 0; -
How to change unit setcaptive status when it gets near certain moving units?
Charles Darwin replied to CaptainBravo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
{(_x iskindof "classname") count thislist > 0} in the activation field of the trigger should do it Oh I don't know if atachto works for triggers lemme see what I can find ok 30 seconds on google seems to say it can work the way you are doing it..let me know -
How to change unit setcaptive status when it gets near certain moving units?
Charles Darwin replied to CaptainBravo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
http://community.bistudio.com/wiki/ArmA_2:_CfgVehicles -
How to change unit setcaptive status when it gets near certain moving units?
Charles Darwin replied to CaptainBravo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
attach trigger to the captive..when activated by enemy forces..setcaptive false? OOh specific patrols..is there a way you could put a specific unit in each of the moving patrols? IE enemy in trigger area..checks if it iskindof "enemygrenadier" if it is not grenadier nothing happens..if it is grenadier it will setcaptive false -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
NP happy it is being received so well :) Still wondering though if anyone knows why moving the LHD_Center would mess up the setposASL and getposASL (seemingly based on the terrain under the water on the chernarussian map) it would be a great help I don't deal with getposASL very much so I am not familiar with why it would be doing this. -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
EDIT: For some reason the youtube video editor put the end of the video at the beginning, so the first bit youll see should be at the end of the video lol Video is processing so if it says it is unavailable at first just wait a few minutes and try again. In the video first you'll see that it works with vehicles both with AI OR Player in them as well as with no AI or player. Then I show how there is an invisible floor that extends over the elevator on the carrier deck model that will interfere with vehicles both going down and coming up, but so far it appears more a cosmetic annoyance than a real problem, just don't put too many vehicles on the elevator it may push some of them off the back side as it goes up, and be careful with how you park vehicles when going down. The floor extends to where the carrier deck would be if the elevator was not there. Gnat what did it used to do? -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
In real life no the elevator doesnt go to the water only to the hangar deck..however in real life vehicles can get to the water line via the LCAC bay which is not in arma unfortunately, I'd much rather have an LCAC and an LCAC bay but such is life..or such is arma anyway lol ---------- Post added at 05:57 AM ---------- Previous post was at 04:52 AM ---------- elevdown.sqf //****************************** Define Stuff*******************//; // This is the controlling object that will have the action attached to it; _object = _this select 0; _obx = (getposasl _object select 0); _oby = (getposasl _object select 1); // This is the Unit Activating the Action; _caller = _this select 1; //ID of the action so we can remove it; _id = _this select 2; //Name of the elevator object defined in the init; _elev = _this select 3; // Trigger that checks for vehichles so we can give them a nudge down.; _trig = list elev_trig; // ***************************Actual Script Stuff here*******************//; // Check if server; if (isServer) then { // Remove the Action that was called; _object removeaction _id; // Check Initial height of the elevator; _height = (getposASL _elev select 2); //Hint for testing Purposes; hint format ["%1 %2", (list elev_trig select 0),(list elev_trig select 1)]; //Nudge any vehicles down so they don't get stuck in mid air {_x setposASL [getposASL _x select 0, getposASL _x select 1,((getposASL _x select 2)-.015)]; } foreach _trig; // Move the Elevator; while {_height > -17.1} do { _elev setposASL [getposasl _elev select 0, getposASL _elev select 1, ((getposasl _elev select 2) -.015)]; // Activate the line below this if you want your control object to move down with the elevator; // _object setposASL [_obx, _oby, ((getposasl _object select 2) -.015)]; //Checks the height of the elevator again so the script knows when to stop.; _height = (getposASL _elev select 2); sleep .01; }; // Add the Action to raise the elevator.; act = _object addAction ["Raise Elevator", "elevup.sqf",elev,7,TRUE]; }; Added something to nudge vehicles as they go down since before they would hang in mid air when the elevator started to go down. recorded a new video showing both this new feature as well as some of the limitations of the system inherent from the model BIS made. The video is incoming uploading to youtube now(need to record in something other than AVI i guess lol) -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks for the kind words guys :D the code in the first post is actually correct all I did was disable to control object being moved down with the elevator. In the movie I used a power generator (empty -> Objects -> Power generator) with these coordinates: position[]={15017.712,14.180637,-54.900513}; and in it's init [getposASL this select 0, getposASL this select 1, 14]; this enableSimulation false; I am still working on it to improve it. Right now there must be a unit in the vehicle or else it doesnt move with the elevator. Possible remedy is to check if vehicle is empty and if it is create a unit and then delete it when the elevator stops but still working on it so we'llsee :) ---------- Post added at 03:10 AM ---------- Previous post was at 01:46 AM ---------- Hmm.just realized for some reason moving the LHD a new position messes up the setposasl/getposasl? It seems to be related to the elevation of the sea floor under the LHD marker but shouldn't it measure from the Sea Level?:confused: -
Working LHD Elevator
Charles Darwin replied to Charles Darwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Slightly Modified Version of the above, I moved the control box off the lift and onto the catwalk to permit the use of the lift with out having to worry about being on the lift as this caused problems when infantry began to swim as the lift was moving up arma would detect the collision and kill the player who activated the lift.