splatsh
-
Content Count
123 -
Joined
-
Last visited
-
Medals
Posts posted by splatsh
-
-
Killed EH when the damage is 1, aka the object is dead/destroyed.Thanks.
---------- Post added at 07:44 PM ---------- Previous post was at 07:28 PM ----------
It was no good with that check...
I shoot it so its engine got damage, so the helo landed.
And then the helo got no damage 1.
I need to check if vehicle is alive or canMove
And if it is not alive and can not move, then I need to do some code.
But where to put that code in my code?
And what to use:
- do while...
- If vehicle...
-
Myke;1843475']Is it important for mission control (mission fails/win when all dead) or is it just to delete it?It is just for delete stuff =)
---------- Post added at 07:05 PM ---------- Previous post was at 07:04 PM ----------
Hi' date='_vehicle addEventHandler ["killed", { ...code to execute when vehicle is destroyed... }];_neo_[/quote']
Is that for alive and canMove to?
Or I don't need alive and canMove check?
-
I have this right now:
// Code with spawn of vehicle // " // " // " // Code with creation of wayoints // " // " // " // Code with waypoint 2 // Here I have one setWaypointStatements ["true","TheEnd=1;"]; // " // " // " // Code with delete stuff if (TheEnd == 1) then { Delete all stuff };Now, how can I at best way check if my spawned stuff is alive all the way from start to the end?
1) Create a trigger to check it
2) With other code to check it (what kind of code can I use then)
-
Oh, thanks, I will try it out later =)
Thanks =)
-
I have a code that is called by player.
Then the code will create a marker in front of player and the helo is landing at that marker.
But if I am in a big town or in a heavy forest, then the helo will allways try to land at the marker and allways chrash.
So how can I get the helo to land on safe ground?
-
Nice, thanks.
Now I can build some nice support =)
-
This code will spawn one MtvrRefuel on my transporthelo in air:
_spawntype = [position transporthelo, 0, "MtvrRefuel", WEST] call bis_fnc_spawnvehicle;
1) How to do if I want the MtvrRefuel to spawn 5 meter under the transporthelo?
Can my transporthelo fly with this MtvrRefuel attached with attachTo command?
If yes then:
2) How to attach this MtvrRefuel to this transporthelo, so its attached like 5 meter under the transporthelo with code?
3) How to release this MtvrRefuel from transporthelo with code?
-
deleteWaypoint work fine =)
Thanks
-
If I give a medic a support waypoint with:
wp08 = _spawngroup addwaypoint [_cpos, 0]; // Position player wp08 setwaypointtype "SUPPORT"; wp08 setWaypointSpeed "FULL"; wp08 setWaypointStatements ["true",""];
How to cancel that wayoint and give it one other waypoint, one "MOVE" waypoint for example?
I did try this, but it did not work:
wp09 = _spawngroup addwaypoint [_cpos, 10]; // Position player wp09 setwaypointtype "MOVE"; wp09 setWaypointSpeed "FULL"; wp09 setWaypointStatements ["true",""];
-
I have now remaked my code and after the help I got from you I got this to wirk fine now, and I got it all to work as I wanted. Thanks
My code are:
call_medic.sqf
menuID0_7 = _unit addaction ["Cancel Medic", "scripts\request\medic\cancel.sqf", [transporthelo, _spawngroup, _chGroup], 1, false, true, "", ""];
cancel.sqf
_unit = _this select 0; // who called it. _position = (_this select 3) select 0; // Helo position _spawngroup = (_this select 3) select 1; // Group with medic _chGroup = (_this select 3) select 2; // Helo pilot group DeleteAll = 0; HomeReady = 0; hint "Medic team returning to base!"; // Assign group to helo {_x assignAsCargo _position;} forEach Units _spawngroup; // Create waypoint to get group inside helo wp03 = _spawngroup addwaypoint [_position, 10]; wp03 setwaypointtype "GETIN NEAREST"; wp03 setWaypointStatements ["true","HomeReady=1"]; waitUntil {HomeReady == 1}; // Create waypoint to get helo to fly home wp04 = _chGroup addwaypoint [getMarkerPos "hStart", 10]; wp04 setwaypointtype "MOVE"; wp04 setWaypointStatements ["true","DeleteAll=1; {deleteVehicle _x} forEach crew transporthelo; deletevehicle transporthelo;"]; waitUntil {DeleteAll == 1}; deleteMarker hStart; // Delete marker. hint "Medic team are ready for new orders!"Thanks for the assist and help.
And I am sure this code can get better and so on, but it works anyway so I am happy, feel free to make it better if you want to =)
-
I am sorry, but that did not work =/
-
Oh sorry, I mean cancel.sqf =)
And I have this in my code:
_ch = [[_start select 0, _start select 1, 50], _flightPath, _chopperType, side _unit] call BIS_fnc_spawnVehicle;
transporthelo = _ch select 0; _chGroup = _ch select 2;
_ch select 0 setVehicleInit "transporthelo = this; this setVehicleVarName ""transporthelo""";
But I don't have any like that for my group of medics, I use
_spawngroup = [_start, WEST, ["US_Soldier_TL_EP1", "US_Soldier_MG_EP1", "US_Soldier_Medic_EP1", "US_Soldier_Medic_EP1", "US_Soldier_Medic_EP1", "US_Soldier_Medic_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
And my waypoints is working fine
wp01 = _chGroup addwaypoint [_landPos, 0]; wp01 setwaypointtype "TR UNLOAD"; wp01 setWaypointStatements ["true","MedicOut=1;transportHelo land ""LAND"""]; waitUntil {MedicOut == 1}; wp02 = _spawngroup addwaypoint [_cpos, 10]; wp02 setwaypointtype "MOVE"; wp02 setWaypointSpeed "FULL"; wp02 setWaypointStatements ["true","MedicReady=1"];And I am at this part right now
waitUntil {MedicReady == 1}; hint "You can now cancel your support medic team!"; menuID0_7 = _unit addaction ["Cancel Medic", "scripts\request\medic\cancel.sqf", ["_transporthelo", "_spawngroup"], 1, false, true, "", ""];And the last part is not working
cancel.sqf
_unit = _this select 1; _transporthelo = (_this select 3) select 0; _spawngroup = (_this select 3) select 1; hint "Medic team returning to base!"; {_x assignAsCargo _transporthelo; _x action ["getIn", _transporthelo]} foreach units _spawngroup; -
Well, I think that is that I am trying to find out and I did think that my addAction could tell cancel_medic.sqf
Is that wrong?
How does the cancel_medic.sqf file know what _trasporthelo and _spawngrop is then? =)
-
I am playing with som stuff, and now I am trying to build one support script that will fly in some medics and so on..
And to get my medics into the chopper I use this
call_medic.sqf
{_x assignAsCargo _transporthelo; _x moveInCargo _transporthelo} forEach Units _spawngroup;Now the transporthelo is flying to me and land and the medics are coming to me (player)
So far so god...
Now I have done one addAction to get cancel on my medics, and I want to let them go inside this chopper again and the chopper will lift of and go home.
menuID0_7 = _unit addaction ["Cancel Medic", "scripts\request\medic\cancel.sqf", [], 1, false, true, "", ""];
cancel_medic.sqf
_unit = _this select 0; // who called it. hint "Medic team returning to base!"; {_x assignAsCargo _transporthelo; _x action ["getIn", _transporthelo]} foreach units _spawngroup;How do I get right arguments in my addAction to get my code to work proper in cancel_medic.sqd file?
-
My AH-64D does not fly around to support, it does land as my support chopper with medic does.
And my A-10 fly in air to support until the support group say Ready.
After that the plane will fly to runway and land, after that the pilot leave the plane and run to the support group.
And my AH-64D crew does the same, they land when ready is on, and then they leave the chopper and run to support squad.
And then all will stay there. No dirent if I press 5-1-6 (Done) to my support medic call.
And the medic that is in the support group is not healing my wounded men until I run request medic one more time after they have give ready order and I give done order.
Is there any better way to get support then the game support waypoint does?
-
oki :)
Initfield player:
_startGear = [this, "JAVELIN"] call compile preprocessFile "scripts\fnc_gear.sqf"; _playerInit = [this] execVM "init_player.sqf";
fnc_gear.sqf
if (!isServer) exitWith {}; _unit = _this select 0; _strLoadout = _this select 1; if (_strLoadout == _unit) then {_strLoadout = _this select 3}; removeAllWeapons _unit; removeBackpack _unit; switch (_strLoadout) do { case "MG": { {_unit addBackpack "US_Backpack_AmmoMG_EP1";} forEach [1]; clearMagazineCargo unitBackpack _unit; {_unit addMagazine "100Rnd_556x45_BetaCMag";} forEach [1,2,3,4,5]; {_unit addMagazine "ACE_Bandage";} forEach [1,2,3,4,5,6,7,8]; _unit addWeapon "M249_m145_EP1"; (unitBackpack _unit) addMagazineCargo ["100Rnd_556x45_BetaCMag",5]; }; case "START": { {_unit addBackpack "US_Backpack_AmmoMG_EP1";} forEach [1]; clearMagazineCargo unitBackpack _unit; {_unit addMagazine "100Rnd_556x45_BetaCMag";} forEach [1,2,3,4,5]; {_unit addMagazine "ACE_Bandage";} forEach [1,2,3,4,5,6,7,8]; _unit addWeapon "M249_m145_EP1"; (unitBackpack _unit) addMagazineCargo ["100Rnd_556x45_BetaCMag",5]; }; case "STINGER": { {_unit addBackpack "US_Backpack_AmmoMG_EP1";} forEach [1]; clearMagazineCargo unitBackpack _unit; {_unit addMagazine "20Rnd_762x51_B_SCAR";} forEach [1,2,3,4,5]; {_unit addMagazine "ACE_Bandage";} forEach [1,2,3,4,5,6,7,8]; _unit addWeapon "Stinger"; _unit addWeapon "ACE_SCAR_H_STD_Spect"; (unitBackpack _unit) addMagazineCargo ["20Rnd_762x51_B_SCAR",5]; (unitBackpack _unit) addMagazineCargo ["Stinger",1]; }; case "JAVELIN": { {_unit addBackpack "US_Backpack_AmmoMG_EP1";} forEach [1]; clearMagazineCargo unitBackpack _unit; {_unit addMagazine "20Rnd_762x51_B_SCAR";} forEach [1,2,3,4,5]; {_unit addMagazine "ACE_Bandage";} forEach [1,2,3,4,5,6,7,8]; {_unit addMagazine "ACE_Javelin_Direct";} forEach [1]; _unit addWeapon "ACE_Javelin_Direct"; _unit addWeapon "ACE_SCAR_H_STD_Spect"; (unitBackpack _unit) addMagazineCargo ["ACE_Javelin_Direct",1]; (unitBackpack _unit) addMagazineCargo ["20Rnd_762x51_B_SCAR",5]; }; case "SNIPER": { {_unit addBackpack "US_Backpack_AmmoMG_EP1";} forEach [1]; clearMagazineCargo unitBackpack _unit; {_unit addMagazine "ACE_5Rnd_127x99_B_TAC50";} forEach [1,2,3,4,5,6,7,8,9,10,11]; {_unit addMagazine "ACE_Bandage";} forEach [1,2,3,4,5,6,7,8]; _unit addWeapon "ACE_AS50"; (unitBackpack _unit) addMagazineCargo ["ACE_5Rnd_127x99_B_TAC50",10]; }; case "SMAW": { {_unit addBackpack "US_Backpack_AmmoMG_EP1";} forEach [1]; clearMagazineCargo unitBackpack _unit; {_unit addMagazine "20Rnd_762x51_B_SCAR";} forEach [1,2,3,4,5]; {_unit addMagazine "ACE_Bandage";} forEach [1,2,3,4,5,6,7,8]; {_unit addMagazine "SMAW_HEAA";} forEach [1,2]; _unit addWeapon "SMAW"; _unit addWeapon "ACE_SCAR_H_STD_Spect"; (unitBackpack _unit) addMagazineCargo ["20Rnd_762x51_B_SCAR",5]; (unitBackpack _unit) addMagazineCargo ["SMAW_HEAA",1]; }; }; if (!(_unit hasWeapon "itemGPS")) then { _unit addWeapon "itemGPS"; }; _unit addWeapon "Binocular_Vector"; _unit addWeapon "NVGoggles"; _unit addMagazine "ACE_Battery_Rangefinder"; _primaryWeapon = primaryWeapon _unit; _unit selectweapon _primaryWeapon; // Fix for weapons with grenade launcher _muzzles = getArray(configFile>>"cfgWeapons" >> _primaryWeapon >> "muzzles"); _unit selectWeapon (_muzzles select 0);init_player.sqf
_unit = _this select 0; _plactID1 = _unit addAction ["Gear: STINGER","scripts\fnc_gear.sqf",[_unit, "STINGER"],1,false]; _plactID2 = _unit addAction ["Gear: JAVELIN","scripts\fnc_gear.sqf",[_unit, "JAVELIN"],1,false]; _plactID3 = _unit addAction ["Gear: SMAW","scripts\fnc_gear.sqf",[_unit, "SMAW"],1,false]; _plactID4 = _unit addAction ["Gear: MG","scripts\fnc_gear.sqf",[_unit, "MG"],1,false]; _plactID5 = _unit addAction ["Gear: SNIPER","scripts\fnc_gear.sqf",[_unit, "SNIPER"],1,false]; _plactID6 = _unit addAction ["Request: Transport","init_transport.sqf"];
-
If you go back to your original script and follow the two steps I outlined in the post above, it will work both for initial gear selection and changing gear later.Are you sure?
I tested to do so at firts, but without good result.
Please upload a demo so I can see that I tested the right thing.
-
Thanks, I have now done this:
At player init:
_playerInit = [this] execVM "init_player.sqf";
init_player.sqf
_unit = _this select 0; _plactID1 = _unit addAction ["Gear: STINGER","scripts\change_gear.sqf",[_unit, "STINGER"],1,false]; _plactID2 = _unit addAction ["Gear: JAVELIN","scripts\change_gear.sqf",[_unit, "JAVELIN"],1,false]; _plactID2 = _unit addAction ["Gear: SMAW","scripts\change_gear.sqf",[_unit, "SMAW"],1,false]; _plactID2 = _unit addAction ["Gear: MG","scripts\change_gear.sqf",[_unit, "MG"],1,false]; _plactID2 = _unit addAction ["Gear: SNIPER","scripts\change_gear.sqf",[_unit, "SNIPER"],1,false];
At this works great and it works as I wanted it do work.
Thanks for the assist on that one :)
No to the problem I got, how do I call a custom loadout from a player at player initfield?
My change_gear.sqf look like this now:
change_gear.sqf
_unit = _this select 1; _strLoadout = (_this select 3) select 1; removeAllWeapons _unit; removeBackpack _unit; switch (_strLoadout) do { case "MG": { {_unit addBackpack "US_Backpack_AmmoMG_EP1";} forEach [1]; clearMagazineCargo unitBackpack _unit; {_unit addMagazine "100Rnd_556x45_BetaCMag";} forEach [1,2,3,4,5]; {_unit addMagazine "ACE_Bandage";} forEach [1,2,3,4,5,6,7,8]; _unit addWeapon "M249_m145_EP1"; (unitBackpack _unit) addMagazineCargo ["100Rnd_556x45_BetaCMag",5]; }; case "START": { {_unit addBackpack "US_Backpack_AmmoMG_EP1";} forEach [1]; clearMagazineCargo unitBackpack _unit; {_unit addMagazine "100Rnd_556x45_BetaCMag";} forEach [1,2,3,4,5]; {_unit addMagazine "ACE_Bandage";} forEach [1,2,3,4,5,6,7,8]; _unit addWeapon "M249_m145_EP1"; (unitBackpack _unit) addMagazineCargo ["100Rnd_556x45_BetaCMag",5]; }; case "STINGER": { {_unit addBackpack "US_Backpack_AmmoMG_EP1";} forEach [1]; clearMagazineCargo unitBackpack _unit; {_unit addMagazine "20Rnd_762x51_B_SCAR";} forEach [1,2,3,4,5]; {_unit addMagazine "ACE_Bandage";} forEach [1,2,3,4,5,6,7,8]; _unit addWeapon "Stinger"; _unit addWeapon "ACE_SCAR_H_STD_Spect"; (unitBackpack _unit) addMagazineCargo ["20Rnd_762x51_B_SCAR",5]; (unitBackpack _unit) addMagazineCargo ["Stinger",1]; }; case "JAVELIN": { {_unit addBackpack "US_Backpack_AmmoMG_EP1";} forEach [1]; clearMagazineCargo unitBackpack _unit; {_unit addMagazine "20Rnd_762x51_B_SCAR";} forEach [1,2,3,4,5]; {_unit addMagazine "ACE_Bandage";} forEach [1,2,3,4,5,6,7,8]; {_unit addMagazine "ACE_Javelin_Direct";} forEach [1]; _unit addWeapon "ACE_Javelin_Direct"; _unit addWeapon "ACE_SCAR_H_STD_Spect"; (unitBackpack _unit) addMagazineCargo ["ACE_Javelin_Direct",1]; (unitBackpack _unit) addMagazineCargo ["20Rnd_762x51_B_SCAR",5]; }; case "SNIPER": { {_unit addBackpack "US_Backpack_AmmoMG_EP1";} forEach [1]; clearMagazineCargo unitBackpack _unit; {_unit addMagazine "ACE_5Rnd_127x99_B_TAC50";} forEach [1,2,3,4,5,6,7,8,9,10,11]; {_unit addMagazine "ACE_Bandage";} forEach [1,2,3,4,5,6,7,8]; _unit addWeapon "ACE_AS50"; (unitBackpack _unit) addMagazineCargo ["ACE_5Rnd_127x99_B_TAC50",10]; }; case "SMAW": { {_unit addBackpack "US_Backpack_AmmoMG_EP1";} forEach [1]; clearMagazineCargo unitBackpack _unit; {_unit addMagazine "20Rnd_762x51_B_SCAR";} forEach [1,2,3,4,5]; {_unit addMagazine "ACE_Bandage";} forEach [1,2,3,4,5,6,7,8]; {_unit addMagazine "SMAW_HEAA";} forEach [1,2]; _unit addWeapon "SMAW"; _unit addWeapon "ACE_SCAR_H_STD_Spect"; (unitBackpack _unit) addMagazineCargo ["20Rnd_762x51_B_SCAR",5]; (unitBackpack _unit) addMagazineCargo ["SMAW_HEAA",1]; }; }; if (!(_unit hasWeapon "itemGPS")) then { _unit addWeapon "itemGPS"; }; _unit addWeapon "Binocular_Vector"; _unit addWeapon "NVGoggles"; _unit addMagazine "ACE_Battery_Rangefinder"; _primaryWeapon = primaryWeapon _unit; _unit selectweapon _primaryWeapon; // Fix for weapons with grenade launcher _muzzles = getArray(configFile>>"cfgWeapons" >> _primaryWeapon >> "muzzles"); _unit selectWeapon (_muzzles select 0);And I want that each of my player start diferent loadouts.
Example of players initfield:
Player 1:
_LoadOut = [this, "MG"] execVM "scripts\change_gear.sqf";
Player 2:
_LoadOut = [this, "JAVELIN"] execVM "scripts\change_gear.sqf";
Player 3:
_LoadOut = [this, "STINGER"] execVM "scripts\change_gear.sqf";
Now this exampel is not working, so how to write it so it will work with my change_gear.sqf file?
And my addAction must work at the same time in that way I got it now with my change_gear.sqf file.
-
One ambulance is needed.
I did not see that one yesterday.
But know I got ambulance out on my map and waypoint support to it.
So now it works.
-
Is anyone actually hurt/damaged? Maybe there's a check on that or a minimum of damage needs to be endured before the ambu is willing to go out... but that's pure speculation. :/I was shooting my own at some point to test that to :D
But no luck with the ambulance...
Do I need to place a medic or can I just place that medic chopper and no more to get him to support me?
If I place a medic and group him with my chopper, then they will come and support me when I call for medic support, not ambulance support. :j:
So how is support waypoint work?
Do I need one medic in every team that I want to support me?
(Not ammo, fuel or repair trucks)
And how to get respond on ambulance?
Anyone that done that and got it to work?
Please tell me how, and please link up with your mission so I can take a look
Thanks.
-
Don't really know about ambulances, but the choppers with medical capabilities (M60-S or something) always were happy to move out. Maybe the distance is too much for the ambulance, the route not considered save or something along these lines...Oh, okej, but I can't get this chopper to move... they only say negative...
I place the chopper (UH-60 M MEDEVAC)
Give it a support waypoint
Place myself in a squad as leader
Start mission
Press 5-1-2 and requesting a ambulance
Then they allways say "NEGATIVE" to me...
I don't know why they do that, all other stuff is working...
What can be wrong?
-
I want to have some medic and supply support and so on.
This is what works for me.
Place one squad and make leader a player
Place waypoint support on medic, repairtruck, ammotruck, fueltruck and then
- Call medic support.
- Call repair support.
- Call fuel support.
- Call ammo support.
With 5-1 button.
But I can't get this Ambulance support to work, all it say is negative.
So what do I need to get ambulance support to work?
Thanks
-
Add -showScriptErrors to your shortcut. That way you will see errors on the screen. They are also logged to your arma2.RPT, with or without that parameter.I think that is not the problem, the problem is that I don't know to write this down with right parameters and so on, need someone to guide me to write it right...
My script is working fine...
And I need to add some addActions that can change my gear while I am playing the game.
And that addAction is going to point at my fnc_gear.sqf file.
Can it not be done with my code (fnc_gear.sqf) now, so please show me how to do it right.
Thanks.
-
So how can I do to use my fnc_gear.sqf file to my purpose?
I need this so my starting loadout work
B]fnc_gear.sqf[/b]
_unit = _this select 0; _strLoadout = _this select 1;
And I need this to get addAction to work?
B]fnc_gear.sqf[/b]
_target = _this select 0; // the object the action is assigned to; here: player _caller = _this select 1; // the object using the action; here: usually the player _id = _this select 2; // the action id, also the return value of addaction _parameters = _this select 3; // the parameters; here: [player,"JAVELIN"]
I want to use the same file twice, can it be done?
(I don't want to have more then one fnc_gear.sqf file)
Check alive, better way?
in ARMA 2 & OA : MISSIONS - Editing & Scripting
Posted
Wow, cool, thanks =)