Modme Forums

Care Package

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: Psh
Cataclysm is almost done and I've made an attempt at trying to script some of the stuff by myself. That didn't go well so if anyone could help out.

This is what I was attempting to code:

- Planes fly by every (10-20 minutes)
- Drops supply drop to script_structs random outside location
- Press F to open, has a bar like the actual care packages from MP
- When interacted, spawns 2-5 random powerups : 1 max ammo
- Could include free perk or pap powerup (very rare)
- Fleshy mammal sound from IW
- Epic | Heroic when getting free perk or pap

And here is the catastrophe that I've attempted:

function carePackages()
{
	level flag::wait_till( "initial_blackscreen_passed" );
	IPrintLn("Blackscreen passed.");
	wait(10);
	IPrintLn("Wait over.");
	thread planesSetup();
}

function planesSetup()
{
	IPrintLn("Launching.");
	struct = struct::get("plane1a_stop","targetname");
	struct2 = struct::get("plane1b_stop","targetname");
	struct3 = struct::get("plane1c_stop","targetname");
	model = GetEnt("plane1a", "targetname");
	model2 = GetEnt("plane1b", "targetname");
	model3 = GetEnt("plane1c", "targetname");
	model MoveTo((struct.origin), 10);
	model2 MoveTo((struct2.origin), 10);
	model3 MoveTo((struct3.origin), 10);
	
	wait(10);
	
	model delete();
	model2 delete();
	model3 delete();
	
	level.planesDeploy = 0;
	
	thread planesRepeat();
}	

function planesRepeat( planesDeploy )
{	
	struct = struct::get("plane1a_stop","targetname");
	struct2 = struct::get("plane1b_stop","targetname");
	struct3 = struct::get("plane1c_stop","targetname");
	model = GetEnt("plane1a", "targetname");
	model2 = GetEnt("plane1b", "targetname");
	model3 = GetEnt("plane1c", "targetname");

	IPrintLn("Repeat start.");
	wait(RandomIntRange(2,5));
	IPrintLn("Wait over.");
	
	if (level.planesDeploy > 2)
	{
		IPrintLn("Launching v2.");
		model = spawn( "script_model", model.origin ); 
		model.angles = self.angles; 
		model SetModel( "veh_t7_mil_jet_cargo" ); 
		
		model2 = spawn( "script_model", model2.origin ); 
		model2.angles = self.angles; 
		model2 SetModel( "veh_t7_mil_jet_cargo" ); 
		
		model3 = spawn( "script_model", model3.origin ); 
		model3.angles = self.angles; 
		model3 SetModel( "veh_t7_mil_jet_cargo" ); 
		
		model MoveTo((struct.origin), 10);
		model2 MoveTo((struct2.origin), 10);
		model3 MoveTo((struct3.origin), 10);
		
		wait(10);
		
		model delete();
		model2 delete();
		model3 delete();
	}
	else
	{
		level.planesDeploy++;
		IPrintLn("Increased deploy level.");
		thread planesRepeat();
	}
	//return planesDeploy;
}


And yes, I want the planes to move in a straight line, no vehicle curves or whatever are needed. In addition, the planes do move on the queue the first time through, but never respawn. Furthermore if someone could either recreate or fix the entire script you have my thx.


ModmeBot:

Reply By: Abnormal202
What is the problem with it? What is working/ not working?


ModmeBot:

Reply By: Psh

Abnormal202
What is the problem with it? What is working/ not working?

They move once, and that's about it.


ModmeBot:

Reply By: steviewonder87
Looks good will try later.


ModmeBot:

Reply By: TCM
This looks like it would be a really good idea, When fully working.