Hendo/Sandbox – User

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
Line 59: Line 59:
== Example Scripts ==
== Example Scripts ==


=== UAV Shadow ===


<pre>
_forever = true;
while {(_forever)} do {
_pos = position player;
_x = 100+(_pos select 0);
_y = (_pos select 1);
_z = 1000+(_pos select 2);
_dest = [_x,_y,_z];
uav_1 flyInHeight 33;
//uav_1 disableAI "PATHPLAN";
//uav_1 disableAI "TARGET";
//uav_1 disableAI "AUTOTARGET";
//uav_1 disableAI "MOVE";
joe doMove _dest;
//uav_1 doMove _dest;
uav_1 setDestination [_dest, "LeaderPlanned", true];
//uav_1 setPos _dest;
//uav_1 disableAI "PATHPLAN";
//apache doMove (_player modelToWorld [0,0,0]);
apache doMove _dest;
  //hint format ["uav flying toward %1..",_dest];
_wPosArray = waypoints uav_1;
hint format ["uav has %1 waypoint..%2",(count _wPosArray), _wPosArray];
sleep 1;
};
</pre>


=== Melee ===
=== Melee ===

Revision as of 17:36, 1 March 2010

Modeling

Modeling tips, links, and tutorials

VBS2

VBS2 Specific Stuff

Links

HowTo

Make Pilot fly to waypoints

Scripting

VBS2 Directory

Object Names and Handles in VBS2

Debugging

hint format["Hello %1",player]

Tools

ScriptEdit IDE

Links

Hooahman's_Sandbox

SQF Syntax]

Scripting Tutorial]

Event Driven Architecture

Script as threads

Bunch of scripts

VBS2 specific script info

Event scripts

Nice third-party scripting blog

script example

by How To (i.e. CAS)

Example Scripts

UAV Shadow

_forever = true;
while {(_forever)} do {
	_pos = position player;
	_x = 100+(_pos select 0);
	_y = (_pos select 1);
	_z = 1000+(_pos select 2);
	_dest = [_x,_y,_z];
	uav_1 flyInHeight 33;
	//uav_1 disableAI "PATHPLAN";
	//uav_1 disableAI "TARGET";
	//uav_1 disableAI "AUTOTARGET";
	//uav_1 disableAI "MOVE";
	joe doMove _dest;	
	//uav_1 doMove _dest;
	uav_1 setDestination [_dest, "LeaderPlanned", true];
	//uav_1 setPos _dest;
	//uav_1 disableAI "PATHPLAN";
	//apache doMove (_player modelToWorld [0,0,0]);
	apache doMove _dest;
   //hint format ["uav flying toward %1..",_dest];
	_wPosArray = waypoints uav_1;
	hint format ["uav has %1 waypoint..%2",(count _wPosArray), _wPosArray];
	sleep 1;
};

Melee

/*

Purpose: Trigger demo

Preconditions:  

- Create a T72 platoon 
- Create an A10 team
- Create a playable USMC marine
- Create a Trigger where you want the ambush

Activator:  trigger

Author:  Henderson


*/

//Feedback on script start
hint "Fly Started!";

_grp = group player;

//Create a tank
_myTank1 = "M1Abrams" createVehicle (position player);

//Create a driver
//See: http://community.bistudio.com/wiki/VBS2:_CfgVehicles
"SquadLeaderW" createUnit [position player, _grp, "pilot = this ;"];

//Place them in the tank
pilot action ["getInDriver", _myTank1];
player action ["getInGunner", _myTank1];

//Create a tank
_myTank2 = "M1Abrams" createVehicle (position player);

//Create a driver
//See: http://community.bistudio.com/wiki/VBS2:_CfgVehicles
"SquadLeaderW" createUnit [position player, _grp, "pilot2 = this ;"];
"SquadLeaderW" createUnit [position player, _grp, "gunner2 = this ;"];

//Place them in the tank
pilot2 action ["getInDriver", _myTank2];
gunner2 action ["getInGunner", _myTank2];


//Cue the A10s
hog commandMove (position player); 




Killer AH1Z

/*

Purpose: Have A1Z engage player

Preconditions:  A1Z (snake) spawn

Activator:  snake

Author:  Henderson

TO USE:

Save this file in C:\Documents and Settings\user\My Documents\VBS2\mpmissions\missionname\
Make an M1A1 and name it player
Make an AH1Z and name it snake
	- use the following initialization script for snake
	
	 call {player execVM "snake.sqf";}


Run like the dickens!

*/


//Feedback on script start
hint "Snake Started!";
this flyInHeight 200; 


while {alive player} do 
{
	snake doMove getPos player;
	snake doTarget player;
	//hsnake selectWeapon "HellfireLauncher";
	snake doFire player;	
	sleep 1;
};
hint "Snake killed player!";


AH6

here