Jump to content

Recommended Posts

BEHOLD!!!  I give you JBOY Freakin' PumpkinHead!!!!!  No mods required.

 

Pumpkin-Head-Crew.jpg

Pumpkin-Head-Crew2.jpg

And the best part:  Their heads freakin' explode in pumpkin chunks when shot!!!!

Pumpmkin-Head-Explode.jpg

 

How to use:  In the Editor,  place a player and friendly and unfriendly AI all about.  Then run.  In the console, paste the following code:

Spoiler

JBOY_PumpkinHead =
{
	 params["_dude","_unitPos"]; 
	 _hatType = headGear _dude;
	 removeHeadgear _dude;
	 _pumpkin = "Land_Pumpkin_01_F" createVehicle [0,0,0];  
	 _pumpkin setDir 0;

	 _hat = ("Headgear_" + _hatType) createVehicle [0,0,0];  
	 _hat enableSimulation false;
	 _pumpkin enableCollisionWith _dude;   
	 _pumpkin attachTo [_dude,[0.0, 0.03, 0.06],"neck"];  
	 _dude enableMimics false;  
	 _pumpkin setVariable ["hatType",_hatType,true];
	 _pumpkin setVariable ["dude",_dude,true];
	 _dude setUnitPos _unitPos;
	 
	_light = "#lightpoint" createVehicleLocal [0,0,0];
	_light setLightBrightness 0.08;
	_light setLightColor [0.5, 0.0, 0.0];
	_light setLightUseFlare true;
	_light  setLightFlareSize 400;
	_light setLightFlareMaxDistance 3;
	_light lightAttachObject [_pumpkin, [0,.4,0]];

	 detach _hat;  
	 _hat enableCollisionWith _pumpkin; 
	switch (true) do 
	{
		case (toLower(_hatType) find  "construction" >= 0): {
			 _hat attachTo [_pumpkin,[0.0, .08, -0.08]];     _hat setdir (getdir _pumpkin +180); 
		};
		case (toLower(_hatType) find  "strawhat" >= 0): {
			 _hat attachTo [_pumpkin,[0.0, 0.07, -0.07]];       
		};
		default {
			 _hat attachTo [_pumpkin,[0.0, -0.055, -0.08]];     _hat setdir (getdir _pumpkin); 
			 _hat attachTo [_pumpkin,[0.0, -0.055, -0.08]];     _hat setdir (getdir _pumpkin); 
		};
	};
	glassesArr = [	"G_Shades_Red","G_Shades_Green","G_Shades_Black","G_Shades_Blue",
					"G_Sport_BlackYellow","G_Sport_Blackwhite","G_Sport_Red","G_Sport_Blackred","G_Sport_Greenblack","G_Sport_checkered",
					"G_Goggles_VR"];
	_glassesType = selectRandom glassesArr;
	_glasses = createVehicle ["WeaponHolderSimulated_scripted",[0,0,0],[],0,"CAN_COLLIDE"]; 
	_glasses enableCollisionWith _pumpkin;
	_glasses enableCollisionWith _dude;
	_glasses addItemCargoGlobal [_glassesType,1]; 
	_glasses enableSimulation False;    
	_glasses attachTo [_pumpkin,[.1, 0.65, -.66]];    
	_glasses setdir getdir _pumpkin;   
	_glasses setVectorDirAndUp [[0,0,1],[0,1,0]];  
	_glasses setdir getdir _pumpkin;   
	_glasses setVectorDirAndUp [[0,0,1],[0,1,0]]; 
	_glasses attachTo [_pumpkin,[.1, 0.65, -.66]];    
	_glasses setdir getdir _pumpkin;   
	_glasses setVectorDirAndUp [[0,0,1],[0,1,0]];  
	_glasses setdir getdir _pumpkin;   
	_glasses setVectorDirAndUp [[0,0,1],[0,1,0]]; 

	Glasses = _glasses;
	Pumpkin = _pumpkin;

	_offset = 0;
		 
		_slug =  createSimpleObject ["FxCartridge_127x54_APDS", [0,0,0]];
		_slug enableSimulation false; 
		_slug enableCollisionWith _pumpkin;    
		_slug attachTo [_pumpkin,[0.03 + _offset, 0.11, .029]];  
		_slug setdir (getdir _pumpkin + 180);
		_slug attachTo [_pumpkin,[0.03 + _offset, 0.11, .029]];  
		_slug setdir (getdir _pumpkin + 180);
		
		_slug2 =  createSimpleObject ["FxCartridge_127x54_APDS", [0,0,0]];
		_slug2 enableSimulation false; 
		_slug2 enableCollisionWith _pumpkin;    
		_slug2 attachTo [_pumpkin,[-0.03 + _offset, 0.11, .029]];  
		_slug2 setdir (getdir _pumpkin + 180);
		_slug2 attachTo [_pumpkin,[-0.03 + _offset, 0.11, .029]];  
		_slug2 setdir (getdir _pumpkin + 180);

	 _slantOffset = -.004;
	_centerToothz = -.03;
	_toothOffsetY = 0;

	if ((random 100) > 50) then
	{
		_slantOffset = _slantOffset;
		_centerToothz = -.025;
	} else
	{
		_slantOffset = _slantOffset *-1;
		_centerToothz = -.03;
		
	};

	_toothType = "FxCartridge_762";
	if (toLower(_toothType) find  "cartridge" >= 0) then
	{
		_toothOffsetY = .045;
	};

	_tooth = createSimpleObject [_toothType, [0,0,0]];
	_tooth enableCollisionWith _pumpkin;  
	_tooth attachTo [_pumpkin,[0.0 + _offset, 0.08 + _toothOffsetY, _centerToothz]];  
	_tooth setdir (getdir _pumpkin +180);  
	_tooth attachTo [_pumpkin,[0.0 + _offset, 0.08 + _toothOffsetY, _centerToothz]];  
	_tooth setdir (getdir _pumpkin +180);  

	_tooth1 = createSimpleObject [_toothType, [0,0,0]];
	_tooth1 enableCollisionWith _pumpkin;  
	_tooth1 attachTo [_pumpkin,[0.011 + _offset, 0.08 + _toothOffsetY, _centerToothz + _slantOffset]];  
	_tooth1 setdir (getdir _pumpkin +180 );  

	_tooth2 = createSimpleObject [_toothType, [0,0,0]];
	_tooth2 enableCollisionWith _pumpkin;  
	_tooth2 attachTo [_pumpkin,[-0.011 + _offset, 0.08 + _toothOffsetY, _centerToothz + _slantOffset]];  
	_tooth2 setdir (getdir _pumpkin +180);  
	_tooth2 attachTo [_pumpkin,[-0.011 + _offset, 0.08 + _toothOffsetY, _centerToothz + _slantOffset]];  
	_tooth2 setdir (getdir _pumpkin +180);  

	_slantOffset = _slantOffset + _slantOffset;
	_tooth3 = createSimpleObject [_toothType, [0,0,0]];
	_tooth3 enableCollisionWith _pumpkin;  
	_tooth3 attachTo [_pumpkin,[0.022 + _offset, 0.08 + _toothOffsetY, _centerToothz + _slantOffset]];  
	_tooth3 setdir (getdir _pumpkin +180 );
	_tooth3 attachTo [_pumpkin,[0.022 + _offset, 0.08 + _toothOffsetY, _centerToothz + _slantOffset]];  
	_tooth3 setdir (getdir _pumpkin +180 );
	  
	_tooth4 = createSimpleObject [_toothType, [0,0,0]];
	_tooth4 enableCollisionWith _pumpkin;  
	_tooth4 attachTo [_pumpkin,[-0.022 + _offset, 0.08 + _toothOffsetY, _centerToothz + _slantOffset]];  
	_tooth4 setdir (getdir _pumpkin +180); 
	_tooth4 attachTo [_pumpkin,[-0.022 + _offset, 0.08 + _toothOffsetY, _centerToothz + _slantOffset]];  
	_tooth4 setdir (getdir _pumpkin +180); 
	 
	_slantOffset = _slantOffset + _slantOffset;
	_tooth5 = createSimpleObject [_toothType, [0,0,0]];
	_tooth5 enableCollisionWith _pumpkin;  
	_tooth5 attachTo [_pumpkin,[0.033 + _offset, 0.08 + _toothOffsetY, _centerToothz + _slantOffset]];  
	_tooth5 setdir (getdir _pumpkin  +180); 
	_tooth5 attachTo [_pumpkin,[0.033 + _offset, 0.08 + _toothOffsetY, _centerToothz + _slantOffset]];  
	_tooth5 setdir (getdir _pumpkin  +180); 
	 
	_tooth6 = createSimpleObject [_toothType, [0,0,0]];
	_tooth6 enableCollisionWith _pumpkin;  
	_tooth6 attachTo [_pumpkin,[-0.033 + _offset, 0.08 + _toothOffsetY, _centerToothz + _slantOffset]];  
	_tooth6 setdir (getdir _pumpkin  +180);
	_tooth6 attachTo [_pumpkin,[-0.033 + _offset, 0.08 + _toothOffsetY, _centerToothz + _slantOffset]];  
	_tooth6 setdir (getdir _pumpkin  +180);

	{_x enableSimulation false;} foreach [_tooth,_tooth1,_tooth2,_tooth3,_tooth4,_tooth5,_tooth6];
	
	 _pumpkin addEventHandler ["HandleDamage", {  
		params ["_pumpkin", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
		_pumpkin removeAllEventHandlers "HandleDamage";
		_dude = _pumpkin getVariable "dude";
		_n = [_pumpkin,_dude] spawn {
			params ["_pumpkin","_dude"];
			_pos = (_dude modelToWorld [0,0,1.9]);
			_pos = (ASLtoATL eyePos _dude) vectorAdd [0,0,1];
			_w = createVehicle ["WeaponHolderSimulated_scripted",[0,0,0],[],0,"CAN_COLLIDE"];
			hat = _w;
			_w enableCollisionWith _dude;
			_w enableCollisionWith _pumpkin;
			_h = _pumpkin getVariable "hatType";
			_w addItemCargoGlobal [_h,1];
			_w attachTo [_dude,[-0.2,-.8,.93],"head"];
			attachedTo _pumpkin setHit ["head", 1]; 
			{deleteVehicle _x} forEach attachedObjects _pumpkin; 
			_pumpkin setdir (random 360); 
			_pumpkin setdamage 1; 
			sleep .001;
			detach _w;
			_dir = random 360;
			_speed = 1;
			_w setVelocity [_speed * sin(_dir), _speed * cos(_dir),.1];  
		};

	 }]; 
};
{
	_x enableSimulation false;
	_x unassignItem "NVGoggles";
	_x removeItem "NVGoggles";
	removeHeadGear _x;
	_x addHeadGear selectRandom ["H_Construction_basic_black_F","H_StrawHat"];
	n=[_x,"UP"] call JBOY_PumpkinHead;
	_n=[_x] spawn {params["_unit"]; sleep .1; _unit enableSimulation true;};
} foreach (allUnits - [player]);
 
 	

 

 

Head shots explode the pumpkins and kill the units. 

 

Note:  Each type of headgear requires its own attachTo offsets for the hat to look good on the pumpkin.  So I currently only support the Hardhats and Straw hats.  If you want to put a beret or some other helmet on the pumpkins, you can modify the switch/case code to support a new headgear type and play with the x,y,z offsets until the hat looks good.

 

I'm planning on creating better faces in the future when I work this into a horror mission in the Last Tango campaign.

 

Happy Halloween everybody.

 

  • Like 7
  • Haha 7

Share this post


Link to post
Share on other sites

thanks @johnnyboy always an inspiration for inventive scripting, i like how the pumpkin men are all wearing their hats backwards 90's white rapper style ;)

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites

Is this a trick...or a treat??? :don11:

 

Great stuff as usual johnnyboy

 

Happy Halloween! :yikes:

 

  • Thanks 1

Share this post


Link to post
Share on other sites
On 29/10/2018 at 10:35 PM, johnnyboy said:

BEHOLD!!!  I give you JBOY Freakin' PumpkinHead!!!!!  No mods required.

 

 

 Ok i wanna need ta party with THOSE guys!

  • Haha 1

Share this post


Link to post
Share on other sites
1 minute ago, froggyluv said:

Ok i wanna need ta party with THOSE guys!

You know it buddy.  When I have time I gonna hook these dudes up with that cigarette/stogie mod.  They'd be sweet tokin' on a stogie!

  • Like 1

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

×