Jump to content

Asuriel

Member
  • Content Count

    18
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About Asuriel

  • Rank
    Private First Class
  1. you could spawn the game logics within the script placing them in the positions you want using either modeltoworld command or using polarcoordinates. Now i find polarcoordinates more accurate to work with, since you'll be using angles and distances to place the logics instead of only distances in [x, y, z] form. It makes predicting the placement ingame more easy. actually, all move commands such as domove, move, moveto take position arrays so you don't actually need any game logics at all. just calc the position where you'd put your gamelogic (so where the soldier should move to) and send it to him after ejecting directly using a move command. as with the return formation. I think I'd create a trigger in the script which is placed on the vehicle with a given radius which triggers a global variable when the opposing forces are defeated. after that you can oder them to move again and they should return to formation automatically since they are still one group. now getting them to sit still in their positions is probably going to be more difficult then having them return to formation
  2. Asuriel

    rotating a gbu12?

    nobe didn't work
  3. hi there, i am trying to spawn GBUs at an high altitute and having them hit a target right below them. But they always drift off in the direction they are facing. I tried setvectorup and setvector direction, but i can't get them to face directly downwards. does any1 know how to?
  4. Asuriel

    OnMapClick CAS

    btw here is the gridcoord.sqf which is called inside the cas.sqs which i posted above. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">comment "Cheetah, 6th of January 2007 - contact: forum www.ofpec.com or cheetah99 [at] hotmail [dot] com"; comment "V1.00"; private ["_unit","_x","_upperArray","_lowerArray","_numberArray","_xLeft","_yLeft","_s1","_s2","_s3","_s4","_xCoordB","_xCoordS","_yCoordB","_yCoordS","_coord"]; _unit = _this select 0; _xLeft = (getPos _unit) select 0; _yLeft = (getPos _unit) select 1; _upperArray = ["V","W","X","Y","Z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P"]; _lowerArray = ["a","b","c","d","e","f","g","h","i","j"]; _numberArray = ["4","3","2","1","0","9","8","7","6","5","4","3","2","1","0","9","8","7","6"]; _numbersArray = ["1","0","9","8","7","6","5","4","3","2","1","0","9"]; _s1 = -10000; _s2 = -8000; _s3 = 0; while { (_xLeft >= _s1) } do { if (abs(_xLeft) < _s2) then { if (_xLeft > 0) then { _xLeft = _xLeft - ((_s3-5) * 2000); }; }; _s1 = _s1 + 2000; _s2 = _s2 + 2000; _s3 = _s3 + 1; }; if (abs(_xLeft) >= 2000) then { _xLeft = _xLeft + (abs(_s3-5) * 2000); _x = 1; }; _s4 = (abs(_xLeft) / 200); _s4 = (_s4 - (_s4 mod 1)); _xCoordB = (_upperArray select (_s3-1)); if(_x == 1) then { _s4 = 9-_s4; }; if(_xCoordB == "Z") then { _s4 = 9-_s4; }; _xCoordS = (_lowerArray select _s4); _s1 = -9520; _s2 = -7520; _s3 = 0; while { (_yLeft >= _s1) } do { if (_yLeft < _s2) then { if (_yLeft < 0) then { _yLeft = _yLeft + (_s3 * 2000); _yLeft = _yLeft * -1; } else { _yLeft = _yLeft - ((_s3-5) * 2000); }; }; _s1 = _s1 + 2000; _s2 = _s2 + 2000; _s3 = _s3 + 1; }; _s4 = ((_yLeft-80) / 200); _yCoordS = (_numbersArray select (_s4 - (_s4 mod 1))); _yCoordB = (_numberArray select (_s3-1)); _coord = format ["%1%2%3%4",_xCoordB,_xCoordS,_yCoordB,_yCoordS]; _coord
  5. Asuriel

    OnMapClick CAS

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_type = _this select 0 _base = _this select 1 _times = _this select 2 ;_times = 120 _west = ["AH1W","AH6","UH60MG", "A10", "AV8B", "AV8B2"] _east = ["KA50","Mi17_MG","Su34","Su34B"] ?(_type in _west): _tpilot = "SoldierWPilot"; _side = west ?(_type in _east): _tpilot = "SoldierEPilot"; _side = east ?(side player != _side):exit ?(cas_busy):[_side, "airbase"] sidechat format ["%1, currently no CAS available.", name player];exit cas_busy = true [_side, "airbase"] sidechat format ["%1, broadcast position for CAS over.", name player] onmapsingleclick"pos = _pos; onmapsingleclick''; goon = true; true; hint 'braodcast'" @goon _posi = pos goon = false _gridc = compile loadfile "gridcoord.sqf" _tmp = "helihempty" createvehicle _posi ~1 _area = [_tmp] call _gridc deletevehicle _tmp [_side, "airbase"] sidechat format ["Understood %1, CAS supporting position %2.", name player, _area] ?(_type == "AH1W" || _type == "AH6" || _type == "KA50"):goto "heli" ?(_type == "A10" || _type == "AV8B" || _type == "AV8B2" || _type == "Su34" || _type == "Su34B"):goto "plane" #heli _pgroup = creategroup _side _plane = _type createvehicle [getpos _base select 0, getpos _base select 1, 0] [_plane, "track"] exec "follow.sqs" _pilot = _pgroup createunit [_tpilot, getpos _plane, [], 0, "NONE"] _pilot setskill 1 _pilot moveindriver _plane ?(_type == "AH1W" || _type == "Su34" || _type == "Su34B"):_gunner = _pgroup createunit [_tpilot, getpos _plane, [], 0, "NONE"]; _gunner moveingunner _plane ;_plane setpos [getpos _plane select 0, getpos _plane select 1, 100] _wp = _pgroup addwaypoint [_posi,0] _wp setwaypointtype "SAD" _pgroup setcurrentwaypoint [_pgroup, 1] ~30 @unitready _plane hint "unit ready" _i = 0 #loopheli ~1 ?(!alive _plane): _pilot sidechat format ["%1, %2, going down!", name player, name _pilot]; deletevehicle _pilot; goto "exit" ?(!canmove _plane): _pilot sidechat format ["%1, %2, going down!", name player, name _pilot]; deletevehicle _pilot; goto "exit" ?(!alive _pilot): _pilot sidechat format ["%1, %2, going down!", name player, name _pilot];{deletevehicle _x} foreach crew _plane; goto "exit" ?(!someammo _plane): _pilot sidechat format ["%1, %2, out of ammo!\nReturning to base. Over", name player, name _pilot];goto "helireturn" ?(fuel _plane <= 0.25): _pilot sidechat format ["%1, %2, out of fuel!\nReturning to base. Over", name player, name _pilot];goto "helireturn" ?(_times > 0): _i = _i + 1 hint format ["%1:%2", _i, _times] ?(_times > _i):goto "loopheli" _pilot sidechat format ["%1, %2, Returning to base", name player, name _pilot] #helireturn ~30 _plane move getpos _base @unitready _plane hint "delete" goto "exit" #plane _pgroup = creategroup _side _plane = _type createvehicle [getpos _base select 0, getpos _base select 1, 1000] [_plane, "track"] exec "follow.sqs" _vel = velocity _plane; _dir = direction _plane; _speed = 200; comment "Added speed"; _plane setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+ (cos _dir*_speed),(_vel select 2)]; _pilot = _pgroup createunit [_tpilot, getpos _plane, [], 0, "NONE"] _pilot setskill 1 _pilot moveindriver _plane ?(_type == "AH1W" || _type == "Su34" || _type == "Su34B"):_gunner = _pgroup createunit [_tpilot, getpos _plane, [], 0, "NONE"]; _gunner moveingunner _plane _plane setpos [getpos _plane select 0, getpos _plane select 1, 300] _wp = _pgroup addwaypoint [_posi,0] _wp setwaypointtype "SAD" _pgroup setcurrentwaypoint [_pgroup, 1] ~30 @unitready _plane hint "unit ready" _i = 0 #loopplane ~1 ?(!alive _plane): _pilot sidechat format ["%1, %2, going down!", name player, name _pilot]; deletevehicle _pilot; goto "exit" ?(!canmove _plane): _pilot sidechat format ["%1, %2, going down!", name player, name _pilot]; deletevehicle _pilot; goto "exit" ?(!alive _pilot): _pilot sidechat format ["%1, %2, going down!", name player, name _pilot];{deletevehicle _x} foreach crew _plane; goto "exit" ?(!someammo _plane): _pilot sidechat format ["%1, %2, out of ammo!\nReturning to base. Over", name player, name _pilot];goto "planereturn" ?(fuel _plane <= 0.25): _pilot sidechat format ["%1, %2, out of fuel!\nReturning to base. Over", name player, name _pilot];goto "planereturn" ?(_times > 0): _i = _i + 1 hint format ["%1:%2", _i, _times] ?(_times > _i):goto "loopplane" _pilot sidechat format ["%1, %2, Returning to base", name player, name _pilot] #planereturn _plane move getpos _base ~30 @unitready _plane hint "delete" #exit deletevehicle _plane deletevehicle _pilot ~_time cas_busy = false exit there is one example. not exactly what u want and not sure if it works in MP but you can change that i guess. doesn't work with UH60MG yet i think. no gunners in there. also its pretty dirty coding. did that some time in the early morning hours and just left it that way as it finally worked. -Asuriel
  6. Asuriel

    Ai skill settings

    daytime command!
  7. Asuriel

    Ammo and choppers and parachutes

    To spawn ammo/weapon boxes near an object or unit change the 'position player' to the unit/object's name <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">veh = createVehicle ["WeaponBoxWest", Replace_Text_with_VEHICLENAME, [], 0, "NONE"] the command can be simpler: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">varname = "cfgclass" createvehicle position look in the wiki under the createvehicle command. there you'll find a link to the cfgvehicles page. there you'll find the classname of the parachute you need.
  8. Asuriel

    Ammo and choppers and parachutes

    The thing with the ammo can't be done the way you'd like. Simply because you can't get what weapons are in a vehicles cargospace. You could put your weapons into a crate instead of into the chopper. then hide it somewhere on the map where the player doesn't come by and the call the parachute script. which will make it look like as if the ammobox was loaded and then dropped from the chopper. The parachute is simple. I already posted the script above. you have to call the script using <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[ammobox, parachute] exec "ammodrop.sqs" of course only when you save the script as "ammodrop.sqs". you still have to spawn the parachute using the createvehicle command. look in the wiki for more info.
  9. Asuriel

    Ammo and choppers and parachutes

    you should be able to do this using the weaponpool. actually used to transfer weapons between missions. use <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">pickweaponpool chopper to add the weapons in the chopper's cargo space to the weaponpool. Then spawn your ammobox with parachute and use <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">putweaponpool ammobox to fill the weapons previously added to the weaponpool from the chop's cargo into the ammobox. you have to write a script that setpos the ammobox right underneath the empty parachute you spawn. should look something like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _ammobox = _this select 0 _parachute = _this select 1 #loop ~0.1 _ammobox setpos [getpos _parachute select 0, getpos _parachute select 1, (getpos _parachute select 2) - #] ?(getpos _ammobox select 2 < 1):exit goto "loop" now "#" has to be replaced by some number which makes the entire setup look believable. good luck!
  10. i am not familiar with using markers as random start positions. I tried it once, can't remember if it was OPF or ARMA and as far as i can remember it didn't work out. I can't test it now, might tomorrow, but if it works with normal units you could try a trigger. maybe that will work. Another way to do it would be to add all 12 building's objectIDs into an array and select one randomly using the script you have already written. Then again its a pain in the arse to write down 12 IDs and put them into an array. Not very flexible. I can't think of another way to do it right now. Might find one when i try it myself.
  11. not sure if your initial questions has been answered (just flew over the replies since i have to be going soon). to make a chop land with engine on simply put <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">chop land "getin" or<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">chop land "getout" on the WP. the rest u have to sync. so if guys should get in give them a "get in" wp and put the above code into the chop's "load" wp sync them put an empty H or some other H where the chop should land and voila! done! if guys get out then all you need is the "transport unload" WP on the chop. it will kick everyone out that does not belong to the crew on that WP. again with chop land "getout" in the WPs activiation field.
  12. Asuriel

    Random Insertion Point

    do you change the group's position in the leader's ini line to the starting marker or did you forget to add it in the ini.sqs? cause simply selecting a random pos and adding a marker, won't move your group to that position. try <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x setpos (_array select _rnumber)} foreach units this or change <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this to the group's name (of course you have to name the group first by adding <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">groupname = group this to any units ini line. not sure if that will work with an ini.sq(f;s). ok i made it an ini.sqs (not sqf) but it works. the group is named sfrec. it actually is random, but it often sets you in the same spot. here it is: test.intro - offline you have 48 hours to download. after that i'll delete it of my uni-server.
  13. Asuriel

    wiki help. EHkilled??

    could work, but should be (_this select 0) not (_this select 1)
  14. Asuriel

    Improved armor?

    use eventhandlers. either add <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this addEventHandler ["dammaged", {(_this select 0) setdammage (getdammage (_this select 0) - ((_this select 2)*0.95)); hint format ["%1,%2,%3", (_this select 2), (_this select 2)*0.95, getdammage (_this select 0)]}] in all the units ini lines or you use a trigger which is as larger than the map set to "on east/west present" and "on activation" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> {_x addEventHandler ["dammaged", {(_this select 0) setdammage (getdammage (_this select 0) - ((_this select 2)*0.95)); hint format ["%1,%2,%3", (_this select 2), (_this select 2)*0.95, getdammage (_this select 0)]}]} foreach thislist kinda works. it won't if the unit is hit too fast with several rounds.
  15. Asuriel

    Lights off on helo

    lights won't stay off when the unit is set on careless. you can get around it by setting the combatmode of the chpper to never fire ("blue") and leave the behaviour at default or whatever. that way the chopp won't attack anyone and will fly with it's lights off.
×