Jump to content

UltimateBawb

Member
  • Content Count

    250
  • Joined

  • Last visited

  • Medals

Everything posted by UltimateBawb

  1. UltimateBawb

    Any good GUI tutorials?

    Nope, the unit that addAction is run from is a center for anyone to use that action. It's kind of weird, but adding that action would be akin to the "Get in" action for a vehicle.
  2. UltimateBawb

    Any good GUI tutorials?

    As for the addition to the action menu in an init field, try: this addAction ["This appears in the scroll menu", "anything.sqf"]; The first object string is the text that appears, while anything.sqf is a script in your mission's directory which is called when you click the scroll menu option. As for GUI, it's a real pain. That was one of the first things I wanted to do when I first started scripting, but I just dropped it. It's referred to as 'dialog' scripting; a beginner's tutorial can be found here: http://forums.bistudio.com/showthread.php?144954-Dialog-Tutorial-For-Noobs-By-A-Noob
  3. UltimateBawb

    Assertion

    The basic problem with that is that it only runs once, and the script is much more complex. What I currently have: _vipHeliSpawn = ""; _vipSpawn = ""; carWayDone = false; heliWayDone = false; if (isServer) then { _vipGroup = createGroup east; _rand = (floor 100); if (_rand < 33) then {_vipSpawn = getMarkerPos "vipCarSpawn";}; if ((_rand > 33) and (_rand < 66)) then {_vipSpawn = getMarkerPos "vipCarSpawn_1";} else {_vipSpawn = getMarkerPos "vipCarSpawn_2";}; unitK = _vipGroup createUnit ["O_Soldier_SL_F", _vipSpawn, [], 6, "NONE"]; vipMan = _vipGroup createUnit ["C_man_polo_1_F", _vipSpawn, [], 6, "NONE"]; _unit1 = _vipGroup createUnit ["O_Soldier_lite_F", _vipSpawn, [], 6, "NONE"]; _unit2 = _vipGroup createUnit ["O_Soldier_lite_F", _vipSpawn, [], 6, "NONE"]; _unit3 = _vipGroup createUnit ["O_Soldier_AR_F", _vipSpawn, [], 6, "NONE"]; _unit4 = _vipGroup createUnit ["O_medic_F", _vipSpawn, [], 6, "NONE"]; removeAllWeapons vipMan; vipMan addWeapon "hgun_Rook40_F"; vipMan addMagazine "30Rnd_9x21_Mag"; vipMan addMagazine "30Rnd_9x21_Mag"; _rand = (floor 100); if (_rand < 50) then {_vipHeliSpawn = "northHelipad";} else {_vipHeliSpawn = "southHelipad";}; _vipHeli = createVehicle ["O_Ka60_Unarmed_F", getMarkerPos _vipHeliSpawn, [], 0, "NONE"]; _vipHeliGroup = createGroup east; _unitPilot1 = _vipHeliGroup createUnit ["O_helipilot_F", getMarkerPos _vipHeliSpawn, [], 4, "NONE"]; _unitPilot2 = _vipHeliGroup createUnit ["O_helipilot_F", getMarkerPos _vipHeliSpawn, [], 4, "NONE"]; _unitPilot1 assignAsDriver _vipHeli; _unitPilot2 assignAsCargo _vipHeli; _vipCar = createVehicle ["O_Ifrit_MG_F", _vipSpawn, [], 10, "NONE"]; _vipEscort = createVehicle ["O_Ifrit_MG_F", _vipSpawn, [], 10, "NONE"]; _vipCar setDir 240; _vipEscort setDir 250; unitK assignAsDriver _vipCar; vipMan assignAsCargo _vipCar; _unit1 assignAsGunner _vipCar; _unit4 assignAsCargo _vipCar; _unit3 assignAsDriver _vipEscort; _unit2 assignAsGunner _vipEscort; _vipGroup addVehicle _vipCar; _vipGroup addVehicle _vipEscort; {[_x] orderGetIn true} foreach units _vipHeliGroup + [vipman]; null = [] spawn { while {(sideMissionOn) and (alive vipMan)} do { if (! (_followMarker == objNull)) then { deleteMarker "followVIPMarker"; deleteVehicle "_followMarker"; }; _followMarker = createMarker ["followVIPMarker", getPosATL vipMan]; "followVIPMarker" setMarkerType "mil_dot"; "followVIPMarker" setMarkerColor "ColorRed"; "followVIPMarker" setMarkerText "VIP"; sleep 1; }; }; null = [] spawn { while {sideMissionOn} do { assert (alive vipMan); }; }; _carWay = _vipGroup addWaypoint [getMarkerPos _vipHeliSpawn, 15]; _carWay setWaypointType "MOVE"; _carWay setWaypointStatements ["true", "carWayDone = true;"]; while {! carWayDone} do {sleep 5;}; while {(! unitReady unitK) and (alive vipMan)} do {sleep 5}; unitK action ["eject", vehicle unitK]; vipMan action ["eject", vehicle vipMan]; _unit1 action ["eject", vehicle _unit1]; _unit4 action ["eject", vehicle _unit4]; _unit3 action ["eject", vehicle _unit3]; unassignVehicle vipMan; vipMan assignAsCargo _vipHeli; [vipMan] joinSilent _vipHeliGroup; _heliWay = _vipHeliGroup addWaypoint [getMarkerPos "outOfMapMarker", 30]; _heliWay setWaypointType "MOVE"; _heliWay setWaypointStatements ["true", "heliWayDone = true;"]; while {! heliWayDone} do {sleep 5;}; while {(! unitReady _unitPilot1) and (alive vipMan)} do {sleep 5}; }; if (alive vipMan) then {sideWin = false;} else {sideWin = true;}; if (sideWin) then { ["win", "VIP"] execVM "sideMissions\endSideMission.sqf"; } else { ["lose", "VIP"] execVM "sideMissions\endSideMission.sqf"; }; deleteMarker "followVIPMarker"; deleteVehicle "_vipHeli"; deleteVehicle "vipMan"; deleteVehicle "unitPilot1"; deleteVehicle "unitPilot2"; deleteVehicle "unitK"; deleteVehicle "_unit1"; deleteVehicle "_unit2"; deleteVehicle "_unit3"; deleteVehicle "_unit4"; deleteVehicle "_vipCar"; deleteVehicle "_vipEscort";
  4. UltimateBawb

    arm a civilian ?

    removeAllWeapons _unit; _unit addWeapon "hgun_Rook40_F"; _unit addMagazine "30Rnd_9x21_Mag"; _unit addMagazine "30Rnd_9x21_Mag"; You can replace the handgun and magazines with whatever weapon classnames you like. Classnames: http://browser.six-projects.net/cfg_weapons/classlist?version=67
  5. You can add this to the conditions field: ((getpos (thislist select 0)) select 2 < 1) It will check if the vehicle is on the ground. EDIT: To make them get out, try this in the on activation field" {unassignVehicle _x} forEach crew _vehicleName
  6. UltimateBawb

    arm a civilian ?

    http://community.bistudio.com/wiki/addWeapon
  7. UltimateBawb

    Client side ammo box for each class

    Run the script on each client; addWeaponCargo and addMagazineCargo are client side only, so the weapons and magazine will only appear on the client that they are run.
  8. I'm trying to make a dynamic side mission generator, starting with a VIP mission. The VIP and group of 5 other soldiers starts at "vipCarSpawn" with 2 cars, on unarmed and one armed. The two cars should move to "_vipHeliSpawn," which is randomly selected from 2 positions, a north helipad and south helipad. At either helipad, their is a helicopter with two pilots which should fly him off of the map, or to "outOfMapMarker." If the helicopter makes it to the marker with the VIP still alive, the side mission is lost, but if the VIP is killed, it is won. I've turned on the -showScriptErrors launch option and debugged all syntax errors, but the checks to see if the groups are at their waypoints are ignored, and the convoy does not move to the helipad successfully. I believe it has to do with the setWaypointStatements parts of the script and have tried multiple fixes to no avail. Any help? while {true} do { _rand = (floor 100); if ((_rand < 101) and (! sideMissionOn) and (isServer)) then { _vipHeliSpawn = ""; carWayDone = false; heliWayDone = false; sideMissionOn = true; _vipGroup = createGroup east; unitK = _vipGroup createUnit ["O_Soldier_SL_F", getMarkerPos "vipCarSpawn", [], 6, "NONE"]; vipMan = _vipGroup createUnit ["C_man_polo_1_F", getMarkerPos "vipCarSpawn", [], 6, "NONE"]; _unit1 = _vipGroup createUnit ["O_Soldier_lite_F", getMarkerPos "vipCarSpawn", [], 6, "NONE"]; _unit2 = _vipGroup createUnit ["O_Soldier_lite_F", getMarkerPos "vipCarSpawn", [], 6, "NONE"]; _unit3 = _vipGroup createUnit ["O_Soldier_AR_F", getMarkerPos "vipCarSpawn", [], 6, "NONE"]; _unit4 = _vipGroup createUnit ["O_medic_F", getMarkerPos "vipCarSpawn", [], 6, "NONE"]; removeAllWeapons vipMan; vipMan addWeapon "hgun_Rook40_F"; vipMan addMagazine "30Rnd_9x21_Mag"; vipMan addMagazine "30Rnd_9x21_Mag"; _rand = (floor 100); if (_rand < 50) then {_vipHeliSpawn = "northHelipad";} else {_vipHeliSpawn = "southHelipad";}; _vipHeli = createVehicle ["O_Ka60_Unarmed_F", getMarkerPos _vipHeliSpawn, [], 0, "NONE"]; _vipHeliGroup = createGroup east; _unitPilot1 = _vipHeliGroup createUnit ["O_helipilot_F", getMarkerPos _vipHeliSpawn, [], 4, "NONE"]; _unitPilot2 = _vipHeliGroup createUnit ["O_helipilot_F", getMarkerPos _vipHeliSpawn, [], 4, "NONE"]; _unitPilot1 assignAsDriver _vipHeli; _unitPilot2 assignAsCargo _vipHeli; _vipCar = createVehicle ["O_Ifrit_F", getMarkerPos "vipCarSpawn", [], 6, "NONE"]; _vipEscort = createVehicle ["O_Ifrit_MG_F", getMarkerPos "vipCarSpawn", [], 6, "NONE"]; _vipCar setDir 260; _vipEscort setDir 260; unitK assignAsDriver _vipCar; vipMan assignAsCargo _vipCar; _unit1 assignAsCargo _vipCar; _unit4 assignAsCargo _vipCar; _unit3 assignAsDriver _vipEscort; _unit2 assignAsGunner _vipEscort; _vipGroup addVehicle _vipCar; _vipGroup addVehicle _vipEscort; _carWay = _vipGroup addWaypoint [getMarkerPos "_vipHeliSpawn", 15]; _carWay setWaypointType "MOVE"; _carWay setWaypointStatements ["true", "carWayDone = true;"]; while {! carWayDone} do {sleep 5;}; while {(! unitReady unitK) and (alive unitK)} do {sleep 5}; unitK action ["eject", vehicle unitK]; vipMan action ["eject", vehicle vipMan]; _unit1 action ["eject", vehicle _unit1]; _unit4 action ["eject", vehicle _unit4]; _unit3 action ["eject", vehicle _unit3]; unassignVehicle vipMan; vipMan assignAsCargo _vipHeli; [vipMan] joinSilent _vipHeliGroup; _heliWay = _vipHeliGroup addWaypoint [getMarkerPos "outOfMapMarker", 30]; _heliWay setWaypointType "MOVE"; _heliWay setWaypointStatements ["true", "heliWayDone = true;"]; while {! heliWayDone} do {sleep 5;}; while {(! unitReady _unitPilot1) and (alive _unitPilot1)} do {sleep 5}; if (alive vipMan) then { hint "Failed."; } else { hint "Success."; }; sideMissionOn = false; }; sleep 600; };
  9. Ah, thanks. I'll test in when I can in about a half and hour. :) Sorry about the first 'if' test; it was meant to check a global boolean sideMissionOn that was defined in the init, and the '_rand < 101' was meant for debugging purposes. The whole thing was meant to loop every 10 minutes with a very low probability of the VIP side mission actually occurring if another side mission was not already in progress. I'll probably make a universal counter script to call them later. Thanks again!
  10. UltimateBawb

    Blend in scripting

    How about using canFire along with hasWeapon?
  11. UltimateBawb

    Accessing array elements

    I know it wouldn't be universal, but wouldn't a quick work around be to have either a switch or multiple if statements like so?: Group = ["Ondrej","Jay","Marek","Ivan"]; for [{_i = 0} {_i < _num} {_i = i + i}] do { _unit = [Group select _i]; if (_unit == "Ondrej") then {[Ondrej] joinSilent (group player)}; if (_unit == "Jay") then {[Jay] joinSilent (group player)}; if (_unit == "Marek") then {[Marek] joinSilent (group player)}; if (_unit == "Ivan") then {[ivan] joinSilent (group player)}; }; It would probably be more efficient to dynamically parse each unit object to remove quotation marks when found, but I don't know if that's possible with SQF...
  12. UltimateBawb

    Accessing array elements

    The 'select' function is what you want to use. In SQF you would do something like this: Group = ["Ondrej","Jay","Marek","Ivan"]; // Group select 0; is "Ondrej" // Group select 1; is "Jay" // Group select 2; is "Marek" // Group select 3; is "Ivan" [Group select 0] joinSilent (group player); // adds "Ondrej" to player group [Group select 1] joinSilent (group player); // adds "Jay" to player group // etc... Is this what you mean?
  13. UltimateBawb

    Quick live feed script

    I'm not very well versed in the PIP module, but camera.sqs should work for what you need. You could make a unit called cameraMan where you want the camera to be, run hideObject this; in its init, and make a seperate [cameraMan] exec "camera.sqs]; script which is called somehow. Wouldn't that work for what you want?
  14. Just found some terrible misspellings, sorry. null = this execVM "refreshAmmo.sqf"; _amountAmmo = 20; _amountAmmoRare = 10; _amountEquip = 5; _amountEquipRare = 2; _refreshTime = 600; _crate = _this select 0; _crate allowDamage false; while {true} do { clearWeaponCargoGlobal _crate; clearWeaponCargoMagazine _crate; clearItemCargoMagazine _crate; _crate addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag", _amountAmmo]; _crate addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag_Tracer", _amountAmmo]; _crate addMagazineCargoGlobal ["30Rnd_65x39_case_mag", _amountAmmo]; _crate addMagazineCargoGlobal ["30Rnd_65x39_case_mag_Tracer", _amountAmmo]; _crate addMagazineCargoGlobal ["100Rnd_65x39_caseless_mag", _amountAmmoRare]; _crate addMagazineCargoGlobal ["100Rnd_65x39_caseless_mag_Tracer", _amountAmmoRare]; _crate addMagazineCargoGlobal ["16Rnd_9x21_Mag", _amountAmmo]; _crate addMagazineCargoGlobal ["30Rnd_9x21_Mag", _amountAmmoRare]; _crate addMagazineCargoGlobal ["NLAW_F", _amountAmmoRare]; _crate addMagazineCargoGlobal ["20Rnd_762x45_Mag", _amountAmmoRare]; _crate addMagazineCargoGlobal ["UGL_FlareWhite_F", _amountAmmoRare]; _crate addMagazineCargoGlobal ["1Rnd_HE_Grenade_shell", _amountAmmoRare]; _crate addMagazineCargoGlobal ["1Rnd_Smoke_Grenade_shell", _amountAmmoRare]; _crate addWeaponCargoGlobal ["arifle_TRG20_F", _amountEquipRare]; _crate addWeaponCargoGlobal ["arifle_MX_F", _amountEquipRare]; _crate addWeaponCargoGlobal ["hgun_P07_F", _amountEquipRare]; _crate addWeaponCargoGlobal ["arifle_MXM_F", _amountEquipRare]; _crate addWeaponCargoGlobal ["arifle_TRG21_F", _amountEquipRare]; _crate addWeaponCargoGlobal ["arifle_MXC_F", _amountEquipRare]; _crate addWeaponCargoGlobal ["launch_NLAW_F", _amountEquipRare]; _crate addItemCargoGlobal ["Medikit", _amountEquip]; _crate addItemCargoGlobal ["FirstAidKit", _amountEquip]; _crate addItemCargoGlobal ["ToolKit", _amountEquip]; _crate addItemCargoGlobal ["muzzle_snds_B", _amountEquipRare]; _crate addItemCargoGlobal ["muzzle_snds_H", _amountEquipRare]; _crate addItemCargoGlobal ["muzzle_snds_L", _amountEquipRare]; _crate addItemCargoGlobal ["acc_flashlight", _amountEquipRare]; _crate addItemCargoGlobal ["acc_pointer_IR", _amountEquipRare]; _crate addItemCargoGlobal ["H_Cap_blu", _amountEquipRare]; _crate addItemCargoGlobal ["H_Cap_headphones", _amountEquipRare]; _crate addItemCargoGlobal ["optic_Holosight", _amountEquipRare]; _crate addItemCargoGlobal ["optic_Hamr", _amountEquipRare]; _crate addItemCargoGlobal ["optic_Aco", _amountEquipRare]; sleep _refreshTime; };
  15. I've made a short patrol script for car patrols in north and south Stratis, but units don't seem to move anywhere. Can anyone help? Placed in car's init: null = [this, "North"] execVM "carPatrol.sqf"; carPatrol.sqf: _car = _this select 0; _setType = _this select 1; while ((alive _car) && !(unitReady _car)) do { sleep 2; }; while (alive _car) do { if (_locationArray == "North") then {_locationArray = ["markerPatrolNorth", "markerPatrolNorth_1", "markerPatrolNorth_2", "markerPatrolNorth_3", "markerPatrolNorth_4", "markerPatrolNorth_5", "markerPatrolNorth_6", "markerPatrolNorth_7", "markerPatrolNorth_8", "markerPatrolNorth_9"} else {_locationArray = ["markerPatrolSouth", "markerPatrolSouth_1", "markerPatrolSouth_2", "markerPatrolSouth_3", "markerPatrolSouth_4", "markerPatrolSouth_5", "markerPatrolSouth_6", "markerPatrolSouth_7", "markerPatrolSouth_8", "markerPatrolSouth_9"}; _selectLocation = _locationArray call BIS_fnc_selectRandom; (group _car) move (getMarkerPos _selectLocation); while {((alive _car) && !(unitReady _car))} do { sleep 2; }; };
  16. UltimateBawb

    Help with Patrol Script

    Ah, fixed. Can't test until tomorrow though. Thanks again. Also, the if statement before the else doesn't need a semicolon, right?
  17. UltimateBawb

    Help with Patrol Script

    AH SHIT! I completely missed the local variables, guess I just rushed through them. And I am using NP++ by the way. ;) Thanks, checking now. EDIT: OP editted to add semicolons, still dosen't work. :/
  18. I created a base template in the 3D editor, and made an SP mission load the template as a script successfully. The problem is that when I try tho export the working SP mission to an MP mission, the MP mission loads with no slots available. Is there something I'm not getting?
  19. I created a base template in the 3D editor, and made an SP mission load the template as a script successfully. The problem is that when I try tho export the working SP mission to an MP mission, the MP mission loads with no slots available. Is there something I'm not getting?
  20. I did that recently for a quick-fix, but all Z values are lost, which is one of the main reasons I've used the 3D editor. Have you been reading what I've said? It works FINE in the 2D editor. MULTIPLAYER is the issue.
  21. The mission works completely fine in the 3D and 2D editor; I copied the mission.sqf and ran it as a script in 2D. that works ok. After some troubleshooting, it turns out that loading the mission.sqf as a script in MULTIPLAYER is an issue, for when I remove the mission.sqf the units appear and the mission runs properly. Only problem is, this removes the 3D edited objects...
  22. Yes, and that's why I'm confused. I've also moved the mission folder manually from the SP mission folder to the MP mission folder to edit. Even when I edit that and place playable units, they don't show. :/
  23. I've set "in formation" to false, but when units in groups spawn, they auto form a V. How can I stop this?
×