Jump to content

Recommended Posts

Hello first off, I'm not sure if this is the correct place to post this. I was on the fence between here and "ARMA 2 & OA : ADDONS - Configs & Scripting". Im want to know more about the actuall scripts/commands than the addon itself so I think it belongs here. Edit this post as you wish.

 

I saw someone use a debug console and I thought it was the greatest thing I have eveer seen in Arma. However now having one (This one in specific https://forums.bistudio.com/topic/72232-debug-console-for-arma-2/ ) I dont quite understand it. For example I managed to get some things working like:

hint format ["Hello %1",getPos player];
cursorTarget setDamage 1
cursorTarget setDamage 0
player setPos [(getPos player select 0) +10, getPos player select 1, getPos player select 2];

but if I tried to run a script (that I know works when executed from my action menu) It did only some parts like hints, and finding my direction, but I didn't spawn anyvehicles in like it should have. Here is the line I executed in the console:

_handle = execVM "flyingDestroyerT1.sqf";

This above is me not understanding how this works especially why I cannot for the life of me figure out how to spawn a vehicle from it.

 

Next, since I I managed to get "player setPos" above to work, I wanted to try to make a command to teleport infront of myself like the one in infistar by branching off of that command since it only moves me one direction reguardless of where I faced. So I came up with this, which doesn't work:

player setPos (player getPos [50,(getDir player)]);

I saw in the wiki That I could use the getPos command like this:

player getPos [10,45];

to get the position 45degrees and 10 feet away from me so I thought I would replace 45 with getDir since I know that worked for an output in the debug console but nothing happened once executed, I tried many forms of this with no success so I succome to the forum.

 

Shorted down, my end questions are:

-Why/how can I spawn vehicles in debug (I've seen it happen in Arma 3)

-any basic info I should know about the debug console since I found little to no info/help on it.

-How to get the TP infront of me command/script to work.

-Why only half of my script "flyingDestroyerT1.sqf" ran when used in the console (I can include this if you wish).

 

Thanks, this is pretty much my first post, sorry for mistakes or this being impossible to understand, I tried my best!

Share this post


Link to post
Share on other sites

-Why only half of my script "flyingDestroyerT1.sqf" ran when used in the console (I can include this if you wish).

 

 

Your flyingDestroyerT1 script had a 2 errors that I noticed. It works now.

To use it in the debug console, use...

_handle = [player] execVM "flyingDestroyerT1.sqf";

You weren't giving any arguments/parameters.

//////////////////////////////////////
//                                  //
//   The Real American Destroyer    //
//          By: ReWind              //
//            Steam:                //
//http://steamcommunity.com/id/45645667867834534/ // Maff - You forgot to comment out the link!
//////////////////////////////////////






//Identifing Player
//Spawning the Apache on players position
//Moving player in driver seat of Apache
//Spawning Destroyer on players position
//Attaching Destroyer to Apache
//Getting player Direction before spawn
//Telling player the direction they faced
//Setting Apache and player direction where player looked

	_unit = _this select 0;
	_position = getPos _unit;                                       // you can spawn this anywhere since your player is automatically moved to driver
	_vehicle = "BAF_Apache_AH1_D" createVehicle (_position);        // You may change "BAF_Apache_AH1_D" to any vehicle classname you want and it will function the same
	_vehicle engineOn true;                                         // False to spawn the vehicle off
	_unit moveInDriver _vehicle;                                    // !!You NEED this otherwise there is no way to get into the driver seat!!
	_vehicle allowDamage true;                                      // Set False to make the chopper indestructable (if you crash a heli while invincable it still often times explodes)
	_vehicle0 = "Land_Destroyer" createVehicle (_position);         // There is also another boat I think it is called "Land_Fragetta" not sure but you can interchange them however the props will not allign properly
	_vehicle0 attachTo [_vehicle,[ 0, 0, 4.5]];
	_vehicle0 setVectorDir[0,0,180];
	_vehicle0 setDir 180;
	_direction = getDir _unit;
	hintSilent format["Based on the direction you were looking, the Object will spawn facing: %1 degrees",_direction];
	_vehicle setDir (_direction);
	_unit setDir (_direction);

//Adding other props to give detail

	_vehicleProp13 = "C130J_static_EP1" createVehicle (_position);
	_vehicleProp13 attachTo [_vehicle,[7,0,11.5]];
	_vehicleProp14 = "C130J_static_EP1" createVehicle (_position);
	_vehicleProp14 attachTo [_vehicle,[-7,0,11.5]];
	_vehicleProp13 setVectorDir[0,0,180];
	_vehicleProp14 setVectorDir[0,0,180];
	_vehicleProp13 setDir 180;
	_vehicleProp14 setDir 180;
	_vehicleProp1 = "FlagCarrierUSA_EP1" createVehicle (_position);
	_vehicleProp1 attachTo [_vehicle,[ 7.65, -25.22, 16.5]];
	_vehicleProp2 = "FlagCarrierUSA_EP1" createVehicle (_position);
	_vehicleProp2 attachTo [_vehicle,[ -7.65, -25.22, 16.5]];
	_vehicleProp3 = "FlagCarrierUSA_EP1" createVehicle (_position);
	_vehicleProp3 attachTo [_vehicle,[ 7.6, -27.82, 16.5]];
	_vehicleProp4 = "FlagCarrierUSA_EP1" createVehicle (_position);
	_vehicleProp4 attachTo [_vehicle,[ -7.6, -27.82, 16.5]];
	_vehicleProp5 = "FlagCarrierUSA_EP1" createVehicle (_position);
	_vehicleProp5 attachTo [_vehicle,[ 7.5, -31.3, 16.5]];
	_vehicleProp6 = "FlagCarrierUSA_EP1" createVehicle (_position);
	_vehicleProp6 attachTo [_vehicle,[ -7.5, -31.3, 16.5]];
	_vehicleProp7 = "FlagCarrierUSA_EP1" createVehicle (_position);
	_vehicleProp7 attachTo [_vehicle,[ 7.5, -33.9, 16.5]];
	_vehicleProp8 = "FlagCarrierUSA_EP1" createVehicle (_position);
	_vehicleProp8 attachTo [_vehicle,[ -7.5, -33.9, 16.5]];
	_vehicleProp9 = "FlagCarrierUSA_EP1" createVehicle (_position);
	_vehicleProp9 attachTo [_vehicle,[ 7.39, -37.38, 16.5]];
	_vehicleProp10 = "FlagCarrierUSA_EP1" createVehicle (_position);
	_vehicleProp10 attachTo [_vehicle,[ -7.39, -37.38, 16.5]];
	_vehicleProp11 = "FlagCarrierUSA_EP1" createVehicle (_position);
	_vehicleProp11 attachTo [_vehicle,[ 7.34, -39.28, 16.5]];
	_vehicleProp12 = "FlagCarrierUSA_EP1" createVehicle (_position);
	_vehicleProp12 attachTo [_vehicle,[ -7.34, -39.28, 16.5]];
	
//Maintaining smokes when player is alive
//Spawning Blue Smokes
//Attaching Blue smokes to Apache even with back of destroyer
//Starting cleanup, when vehicle is not active, smokes stop, props are then removed. Also deletes props if the vehicle explodes

while {alive _vehicle} do {
	
		if (vehicle player == _vehicle) then
		{
			hint "Vehicle Active: True";
		
			_vehicle1b = "SmokeShellBlue" createVehicle (_position);
			_vehicle1b attachTo [_vehicle,[0,-70.6,4.5]];
			_vehicle2b = "SmokeShellBlue" createVehicle (_position);
			_vehicle2b attachTo [_vehicle,[0,-70.6,4.7]];
			_vehicle3b = "SmokeShellBlue" createVehicle (_position);
			_vehicle3b attachTo [_vehicle,[0,-70.6,4.9]];
			_vehicle4b = "SmokeShellBlue" createVehicle (_position);
			_vehicle4b attachTo [_vehicle,[0,-70.6,5.1]];
			_vehicle5b = "SmokeShellBlue" createVehicle (_position);
			_vehicle5b attachTo [_vehicle,[0,-70.6,5.3]];
			_vehicle6b = "SmokeShellBlue" createVehicle (_position);
			_vehicle6b attachTo [_vehicle,[0,-70.6,5.5]];
			_vehicle7b = "SmokeShellBlue" createVehicle (_position);
			_vehicle7b attachTo [_vehicle,[0,-70.6,5.7]];
			_vehicle8b = "SmokeShellBlue" createVehicle (_position);
			_vehicle8b attachTo [_vehicle,[0,-70.6,5.9]];
			_vehicle9b = "SmokeShellBlue" createVehicle (_position);
			_vehicle9b attachTo [_vehicle,[0,-70.6,6.1]];

			//Spawning Red Smokes
			//Attaching Red smokes to Apache even with back of destroyer

			_vehicle1r = "SmokeShellRed" createVehicle (_position);
			_vehicle1r attachTo [_vehicle, [0,-70.6,6.3]];
			_vehicle2r = "SmokeShellRed" createVehicle (_position);
			_vehicle2r attachTo [_vehicle, [0,-70.6,6.5]];
			_vehicle3r = "SmokeShellRed" createVehicle (_position);
			_vehicle3r attachTo [_vehicle, [0,-70.6,6.7]];
			_vehicle4r = "SmokeShellRed" createVehicle (_position);
			_vehicle4r attachTo [_vehicle, [0,-70.6,6.9]];
			_vehicle5r = "SmokeShellRed" createVehicle (_position);
			_vehicle5r attachTo [_vehicle, [0,-70.6,7.1]];
			_vehicle6r = "SmokeShellRed" createVehicle (_position);
			_vehicle6r attachTo [_vehicle, [0,-70.6,7.3]];
			_vehicle7r = "SmokeShellRed" createVehicle (_position);
			_vehicle7r attachTo [_vehicle, [0,-70.6,7.5]];
			_vehicle8r = "SmokeShellRed" createVehicle (_position);
			_vehicle8r attachTo [_vehicle, [0,-70.6,7.7]];
			_vehicle9r = "SmokeShellRed" createVehicle (_position);
			_vehicle9r attachTo [_vehicle, [0,-70.6,7.9]];

			//Spawning White Smokes
			//Attaching White smokes to Apache even with back of destroyer

			_vehicle1w = "SmokeShell" createVehicle (_position);
			_vehicle1w attachTo [_vehicle, [0,-70.6,4.3]];
			_vehicle2w = "SmokeShell" createVehicle (_position);
			_vehicle2w attachTo [_vehicle, [0,-70.6,4.1]];
			_vehicle3w = "SmokeShell" createVehicle (_position);
			_vehicle3w attachTo [_vehicle, [0,-70.6,3.9]];
			_vehicle4w = "SmokeShell" createVehicle (_position);
			_vehicle4w attachTo [_vehicle, [0,-70.6,3.7]];
			_vehicle5w = "SmokeShell" createVehicle (_position);
			_vehicle5w attachTo [_vehicle, [0,-70.6,3.5]];
			_vehicle6w = "SmokeShell" createVehicle (_position);
			_vehicle6w attachTo [_vehicle, [0,-70.6,3.3]];
			_vehicle7w = "SmokeShell" createVehicle (_position);
			_vehicle7w attachTo [_vehicle, [0,-70.6,3.1]];
			_vehicle8w = "SmokeShell" createVehicle (_position);
			_vehicle8w attachTo [_vehicle, [0,-70.6,2.9]];
			_vehicle9w = "SmokeShell" createVehicle (_position);
			_vehicle9w attachTo [_vehicle, [0,-70.6,2.7]];
		
			sleep 15;
		
		}
		else
		{
			hint "Vehicle Active: False";
			sleep 1;
			hint "Removing inactive spawns and ending script";
			deleteVehicle _vehicle;
			deleteVehicle _vehicle0;
			
			deleteVehicle _vehicle1b;
			deleteVehicle _vehicle2b;
			deleteVehicle _vehicle3b;
			deleteVehicle _vehicle4b;
			deleteVehicle _vehicle5b;
			deleteVehicle _vehicle6b;
			deleteVehicle _vehicle7b;
			deleteVehicle _vehicle8b;
			deleteVehicle _vehicle9b;
			deleteVehicle _vehicle1r;
			deleteVehicle _vehicle2r;
			deleteVehicle _vehicle3r;
			deleteVehicle _vehicle4r;
			deleteVehicle _vehicle5r;
			deleteVehicle _vehicle6r;
			deleteVehicle _vehicle7r;
			deleteVehicle _vehicle8r;
			deleteVehicle _vehicle9r;
			deleteVehicle _vehicle1w;
			deleteVehicle _vehicle2w;
			deleteVehicle _vehicle3w;
			deleteVehicle _vehicle4w;
			deleteVehicle _vehicle5w;
			deleteVehicle _vehicle6w;
			deleteVehicle _vehicle7w;
			deleteVehicle _vehicle8w;
			deleteVehicle _vehicle9w;
			deleteVehicle _vehicleProp1;
			deleteVehicle _vehicleProp2;
			deleteVehicle _vehicleProp3;
			deleteVehicle _vehicleProp4;
			deleteVehicle _vehicleProp5;
			deleteVehicle _vehicleProp6;
			deleteVehicle _vehicleProp7;
			deleteVehicle _vehicleProp8;
			deleteVehicle _vehicleProp9;
			deleteVehicle _vehicleProp10;
			deleteVehicle _vehicleProp11;
			deleteVehicle _vehicleProp12;
			deleteVehicle _vehicleProp13;
			deleteVehicle _vehicleProp14;
			
		};
		sleep 3;
		hint "script cycled";
		
	sleep 1}; // MAFF - You forgot ";".
	

-How to get the TP infront of me command/script to work.

Why? haha I'll get back to you on that.

 

-any basic info I should know about the debug console since I found little to no info/help on it.

I've only just downloaded the debug console so I can't help you on that one.

 

-Why/how can I spawn vehicles in debug (I've seen it happen in Arma 3)

"BAF_Apache_AH1_D" createVehicle position player;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×