Jump to content

NGagedFX

Member
  • Content Count

    77
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

2 Followers

About NGagedFX

  • Rank
    Corporal
  1. NGagedFX

    Clusterbomb

    Well that fixes the problem. :) However, it spreads like a perfect square aligned to the x and y axis. Do you have any idea of how I could make it more roundly shaped? This is the CBU.sqf as I have it right now, it executes itself with a different number of variables so I don't need 2 seperate files: _cnt = count _this; if (_cnt == 1) then { _plane = _this select 0; while {true} do { _weaponClass = currentWeapon _plane; if (_weaponClass == "AirBombLauncher") then { null = _plane addEventHandler ["Fired", {[] execVM "CBU.sqf";}]; waituntil {_weaponClass != "AirBombLauncher"}; } else { _plane removeEventHandler ["Fired", 0]; }; sleep 0.1; }; }; if (_cnt == 0) then { _plane = vehicle player; _weaponClass = currentWeapon _plane; _detoheight = 30; _explode = false; private ["_pos", "_dir", "_vel"]; if (_weaponClass == "AirBombLauncher") then { _bomb = nearestobject [_plane, "Bo_FAB_250"]; sleep 1; waitUntil {((getPos _bomb select 2) < _detoheight)}; _pos = getPos _bomb; _dir = getDir _bomb; _vel = velocity _bomb; deleteVehicle _bomb; _explode = true; } else { _plane removeEventHandler ["Fired", 0]; }; if (_explode) then { _ammo = "B_30mmA10_AP"; _submun = 250; _spread = 100; _spread2 = (_spread / 2); _speed = (sqrt ((_vel select 0)^2 + (_vel select 0)^2)); for [{_i=0}, {_i<_submun}, {_i=_i+1}] do { _bomblet = _ammo createVehicle [2000,2000,2000]; _bomblet setPos [(_pos select 0) + (_spread2 - Random _spread), (_pos select 1) + (_spread2 - Random _spread), _pos select 2]; _bomblet setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+(cos _dir*_speed),(_vel select 2)*3]; }; }; }; Right now I'll try to add a some kind of 'pop' effect/sound to the FAB_250 so it doesn't just disappaer mid-air. :)
  2. Where else can you download Mike's F16 v1.2 without six-updater?
  3. Something like this: EnTank.sqf WestGrp01 = CreateGroup West; _leader1 = WestGrp01 createUnit ["GUE_Soldier_AR", [(getMarkerPos "tank1") select 0,(getMarkerPos "tank1") select 1,0], [], 3, "FORM"]; _unit1 = WestGrp01 createUnit ["GUE_Soldier_GL", [(getMarkerPos "tank1") select 0,(getMarkerPos "tank1") select 1,0], [], 3, "FORM"]; _unit2 = WestGrp01 createUnit ["GUE_Soldier_MG", [(getMarkerPos "tank1") select 0,(getMarkerPos "tank1") select 1,0], [], 3, "FORM"]; _leader1 = leader WestGrp01; _newGrp1 = (group _leader); _tank1 = "T72_TK_Ep1" createVehicle [(getMarkerPos "tank1") select 0,(getMarkerPos "tank1") select 1,0]; _leader1 moveInCommander _tank1; _unit1 moveInDriver _tank1; _unit2 moveInGunner _tank1; _wp = _newGrp1 addWaypoint [getPos player, 0];
  4. For now I simply created an array of all vehicles followed by a forEach by putting this in the init.sqf: _varray = vehicles; hintSilent format ["vehicles = %1", _varray]; {_x addEventhandler ["GetIn", {_x addAction ["Create Waypoint", "pilotWaypoint2.sqf"]}];} forEach _varray; This however does nothing, not even when I change it {player addAction... :(
  5. I'm working on a clusterbomb script and I nearly got it finished. Here is the code: airplane init: _plane addWeapon "AirBombLauncher"; _plane addMagazine "4Rnd_FAB_250"; nul = [this] execVM "CBU.sqf"; CBU.sqf _plane = _this select 0; hintSilent "starting script"; while {true} do { _weaponClass = currentWeapon _plane; if (_weaponClass == "AirBombLauncher") then { 0 = _plane addEventHandler ["Fired", {[_plane] execVM "CBU2.sqf"}]; } else { _plane removeEventHandler ["Fired", 0]; }; sleep 0.5; }; CBU2.sqf _plane = vehicle player; _weaponClass = currentWeapon _plane; _explode = false; private ["_pos", "_dir", "_vel"]; if (_weaponClass == "AirBombLauncher") then { _bomb = nearestobject [_plane, "Bo_FAB_250"]; sleep 1; waitUntil {((getPos _bomb select 2) < 30)}; _pos = getPos _bomb; _dir = getDir _bomb; _vel = velocity _bomb; deleteVehicle _bomb; _explode = true; } else { _plane removeEventHandler ["Fired", 0]; }; if (_explode) then { _submun = 300; _spread = 100; _smarray = []; for [{_i=0}, {_i<_submun}, {_i=_i+1}] do { _bomblet = "B_30mmA10_AP" createVehicle [2000,2000,2000]; _bomblet setPos [(_pos select 0) + ((_spread / 2) - Random _spread), (_pos select 1) + ((_spread / 2) - Random _spread), _pos select 2]; _bomblet setVelocity _vel; _smarray = _smarray + [_bomblet]; _cnt = count _smarray; hintSilent format ["%1 bomblets", _cnt]; }; }; It kinda works pretty good. When I load the editor, the first bomb will do exactly what I want it to do. It creates the exact amount of bomblets and it does so smoothly. However, when I drop a 2nd CBU, it creates double the amount of bomblets, even though _cnt displays there are only 300. This causes the sim speed to drop and there is a noticable slowdown. When I drop the 3rd bomb, it creates double that of the first! 1 ingame second takes 4 RL seconds which is unacceptable. Eventually the game just crashes. I made sure to reset _smarray and I've also tried setting every other variable to null/0 but that didn't work? I have no idea what to do here. :confused:
  6. I see! So right now I kinda got it working. I haven't tested it in MP yet, but in the editor it works solid. plane_1 init this addEventHandler ["GetIn", {plane_1 addAction ["Create Waypoint", "test2.sqf"]}]; addWaypoint.sqf onMapSingleClick { _waypoint = (group player) addWaypoint [[_pos select 0, _pos select 1, -6], 0, 1]; _waypoint setWaypointStatements ["!(Alive player)", "deleteWaypoint [(group player), 1]"]; }; _id = _this select 2; (vehicle player) removeAction _id; _action = (vehicle player) addAction ["Delete Waypoint", "deleteWaypoint.sqf"]; _delete = false; _plane = vehicle player; while {!(_delete)} do { _grpp = group player; if (!(Alive player) OR !(Alive vehicle player) OR (vehicle player == player)) then { deleteWaypoint [_grpp, 1]; _delete = true; _plane removeAction _action; }; sleep 1; }; deleteWaypoint.sqf _id = _this select 2; deleteWaypoint [(group player), 1]; (vehicle player) removeAction _id; (vehicle player) addAction ["Create Waypoint", "test2.sqf"]; However, there are some thing I can't get to work. 1. In the eventHandler in the init of plane_1, I have to attach it specifically to plane_1. addEventHandler ["GetIn", {this addAction ["Create Waypoint", "test2.sqf"]}]; does not work. :confused: 2. Right now the actions are added to the vehicle and I don't want an action to pop up for people standing next to it, so I rather have the action added to the player. But no matter what I try, player addAction does nothing. 3. I don't want to add the eventHandler to each vehicle in the editor, I want it to be more general. So I was thinking of adding this to the init.sqf: {_x addEventhandler ["GetIn", {_x addAction ["Create Waypoint", "test2.sqf"]}];} forEach listObjects "Air"; //forEach *vehicle that isKindOf "Air";*
  7. Because this isn't the way they do it in an A10 :p Giallustio, I automatically define local variables and even though (vehicle player) worked, I was quite confused as to why _grpp didn't. PvPscene, simple but solid solution. :) I came up with this: onMapSingleClick { _waypoint = (group player) addWaypoint [[_pos select 0, _pos select 1, -8], 0, 1]; }; _waypoint setWaypointStatements ["!(Alive player)", "deleteWaypoint [(group player), 1]"]; However, the waypoint still gets deleted when I get close. I tried global variables (without the _ ) and I tried every combination of the private command. :confused:
  8. But I declared _grpp private so it can be used in the onMapSingleClick scope right? Or what would be the solution for that? I can't find anything about the setWaypointCompletionRadius bug, is it something that should be fixed by BIS in the next patch? Cause else I can never get this to work properly. The whole idea behind this is for infantry to put a marker on the map and then the pilot can create a waypoint by clicking on the map so he has an arrow on his HUD pointing at the target. This way he won't have to constantly look at his map where he's going and it would make non-laser-guided weapons a lot more effective.
  9. I'm trying to create a script that allows pilots to add a waypoint for themselves with a mapclick. I'm experiencing some weird problems though. init of airplane this addAction ["Create Waypoint", "addWaypoint.sqf"]; addWaypoint.sqf - this piece of code works onMapSingleClick {(group player) addWaypoint [[_pos select 0, _pos select 1, -8], 0, 1]}; addWaypoint.sqf - while this doesn't :confused: private ["_grpp"]; _grpp = group player; onMapSingleClick {_grpp addWaypoint [[_pos select 0, _pos select 1, -8], 0, 1]}; Since the waypoint disappears at about 1km distance when in an airplane, I want to set the completion radius to 0, but this doesn't do anything: onMapSingleClick {(group player) addWaypoint [[_pos select 0, _pos select 1, -8], 0, 1]}; [(group player), 1] setWaypointCompletionRadius 0;
  10. I can't find any documentation on sub-menus in the action menu. Let's say you got your standard options "Gear" and "M911". It looks clean and I don't want to make a mess of it, so I only add 1 action "Customize Loadout". When I click on this action I want all of these (including gear and your secondary weapon) to disappear and 6 new actions will popup, like a sub-menu. The BIS ARMEX exposition has this, when you look at one of the info displays for example. I've looked in the mission files but I can't find any there. :(
  11. There are some great templates on that page. I also once made a FOB template which was a real pain (which is the reason it isn't finished yet). If you like it you're free to use in whatever way you can imagine. :) http://hotfile.com/dl/132411088/84d55f3/FOBTemplate.Takistan.rar.html
  12. With great help of Neokika I got a credits system working in which your team gains credits for completing objectives and with which you can buy vehicles and other stuff. In SP this works great, but in MP it gets all messy. I got some scripting knowledge but I have no clue and never had any about MP scripting. I often play with friends where I'm host, but my mission also needs to be compatible with a dedicated server. Here's the setup: Soldier A, B & C, each with the same init My_group1 = group this; init.sqf if (isServer) then { {_x setvariable ["groupCredits", 3, true]} forEach [My_group1]; }; trigger onAct My_group1 setVariable ["groupCredits", ((My_group1 getVariable "groupCredits") + 1), true]; nil = [My_group1] execVM "supplyDrop\credits.sqf"; *this code is started from either a trigger or script I also have a billboard with custom textures to reflect the current status. This is updated by running credits.sqf switch ((_this select 0) getVariable "groupCredits") do { case 0 : { hint "Your team has 0 Credits"; supplyDropbb setObjectTexture [0,"textures\SD_0_credits.jpg"] }; case 1 : { hint "Your team has 1 Credit"; supplyDropbb setObjectTexture [0,"textures\SD_1_credits.jpg"] }; case 2 : { hint "Your team has 2 Credits"; supplyDropbb setObjectTexture [0,"textures\SD_2_credits.jpg"] }; case 3 : { hint "Your team has 3 Credits"; supplyDropbb setObjectTexture [0,"textures\SD_3_credits.jpg"] }; case 4 : { hint "Your team has 4 Credits"; supplyDropbb setObjectTexture [0,"textures\SD_4_credits.jpg"] }; case 5 : { hint "Your team has 5 Credits"; supplyDropbb setObjectTexture [0,"textures\SD_5_credits.jpg"] }; case 6 : { hint "Your team has 6 Credits"; supplyDropbb setObjectTexture [0,"textures\SD_6_credits.jpg"] }; case 7 : { hint "Your team has 7 Credits"; supplyDropbb setObjectTexture [0,"textures\SD_7_credits.jpg"] }; case 8 : { hint "Your team has 8 Credits"; supplyDropbb setObjectTexture [0,"textures\SD_8_credits.jpg"] }; case 9 : { hint "Your team has 9 Credits"; supplyDropbb setObjectTexture [0,"textures\SD_9_credits.jpg"] }; case 10 : { hint "Your team has reached the maximum amount of 10 Credits. Buy something before acquiring even more Credits!"; supplyDropbb setObjectTexture [0,"textures\SD_10_credits.jpg"] }; }; We all connect and start the mission: everyone has the same amount of credits and the billboard is up-to-date. When either one us fires the trigger, most of the time everyone will get credits, but this is very inconsistent. Sometimes the player who fires the trigger will get double or triple the credits, while at other times other people don't get anything. There are moment when everything is in sync, but it takes very little effort to mess it all up. :confused: I think the problem is with running the scripts 'serverside/clientside' and I should probably use publicVariables but I have no idea where to start and how all this stuff works. So if anyone could point me in the right direction and help me out it would be greatly appreciated, as this credit system is the core of my sandbox map. :)
  13. When you are in an airplane you will only be able to see laser painted targets while having the GBUs selected. While only the GBUs are able to lock onto the painted target and guide themselve, I also find this laser to be really useful in marking an area for a GAU-8 or Hydra strike. Is there any way to make it possible for pilots to see the laser targets with every weapon? This would greatly increase the effectiveness of other weapons. :)
  14. NGagedFX

    SQS to SQF

    I feel a bit ashamed right now cause it's to goddamn obvious I should have declared _class instead of _vehiclesonly. :o I had been scripting for a whole day and I was pretty tired so my brain was kinda low on logical creativity. :p Does it matter though where you declare a certain variable? I primarily use other scripts as a reference and they always seem to use the private command on top of their script or just after selecting all variables (= _this select *; etc). I haven't got a folder with Macs Tools or Squint, and I'm definitely in the need for such a program. Would be much faster then hitting preview, check the error arma shows and alt-tabbing back to notepad. I think I screwed up yesterday so I'll just do a 2nd attempt with a rested head. :D
×