Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [script]Bot paratroopers function
[script]Bot paratroopers function [message #301091] Tue, 04 December 2007 18:37 Go to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
I created a function that calls in paratroopers/reinforcements.
I used a chat hook to call the function, but it could be called in a number of ways in-game.

Here is a link to a short small movie of it working in-game:
http://www.mp-gaming.com/reborn/movies/para.wmv

And here is how I made it work:

void reb_Nod_reinforcements::Created(GameObject *obj) {

Vector3 position = Commands->Get_Position(obj);
GameObject *flare = Commands->Create_Object("Signal_Flares",position);
flareID = Commands->Get_ID(flare);
Commands->Attach_Script(flare,"JFW_Disable_Physical_Collision","");

Commands->Create_2D_WAV_Sound("m00gnod_secx0007r3nors_snd.wav");
Console_Input("msg Nod reinforcements have been called in!");
Console_Input(StrFormat("ppage %d [Mission controll] You have called in reinforcements, friendly soldiers will be arriving at your position soon.",Get_Player_ID(obj)).c_str());

Commands->Start_Timer(obj,this,3.0f,1);
Commands->Start_Timer(obj,this,6.0f,2);
Commands->Start_Timer(obj,this,9.0f,3);

}

void reb_Nod_reinforcements::Timer_Expired(GameObject *obj, int number) {

GameObject *flare = Commands->Find_Object(flareID);

if(number == 1){

		Commands->Create_2D_WAV_Sound("m00gnod_kill0020a3nors_snd.wav");
		Commands->Attach_Script(flare,"Test_Cinematic","Nod_Paratroopers.txt");
	}
if(number == 2){

	Console_Input("msg Nod reinforcements are arriving!");	
	}
if(number == 3){

		Commands->Create_2D_WAV_Sound("m00evag_dsgn0009i1evag_snd.wav");
	}
}






void reb_GDI_reinforcements::Created(GameObject *obj) {

Vector3 position = Commands->Get_Position(obj);
GameObject *flare = Commands->Create_Object("Signal_Flares",position);
flareID = Commands->Get_ID(flare);
Commands->Attach_Script(flare,"JFW_Disable_Physical_Collision","");

Commands->Create_2D_WAV_Sound("m00gnod_secx0007r3nors_snd.wav");
Console_Input("msg GDI reinforcements have been called in!");
Console_Input(StrFormat("ppage %d [Mission controll] You have called in reinforcements, friendly soldiers will be arriving at your position soon.",Get_Player_ID(obj)).c_str());

Commands->Start_Timer(obj,this,3.0f,1);
Commands->Start_Timer(obj,this,6.0f,2);
Commands->Start_Timer(obj,this,9.0f,3);

}

void reb_GDI_reinforcements::Timer_Expired(GameObject *obj, int number) {

GameObject *flare = Commands->Find_Object(flareID);

if(number == 1){

		Commands->Create_2D_WAV_Sound("m00gnod_kill0020a3nors_snd.wav");
		Commands->Attach_Script(flare,"Test_Cinematic","GDI_Paratroopers.txt");
	}
if(number == 2){

	Console_Input("msg GDI reinforcements are arriving!");	
	}
if(number == 3){

		Commands->Create_2D_WAV_Sound("m00evag_dsgn0009i1evag_snd.wav");
	}
}





ScriptRegistrant<reb_Nod_reinforcements> reb_Nod_reinforcements_Registrant("reb_Nod_reinforcements","");

ScriptRegistrant<reb_GDI_reinforcements> reb_GDI_reinforcements_Registrant("reb_GDI_reinforcements","");



class reb_Nod_reinforcements : public ScriptImpClass {
	void Created(GameObject *obj);
	void Timer_Expired(GameObject *obj,int number);
	int flareID;
};

class reb_GDI_reinforcements : public ScriptImpClass {
	void Created(GameObject *obj);
	void Timer_Expired(GameObject *obj,int number);
	int flareID;
};


The real work is done by the cinematic file that test_cinematic makes use of.
The cinematic files look like this:


Nod version

;_________________________________________
;
; Available Cinematic Script Commands
;
; time/frame	Create_Object,	id (slot), preset_name, x, y, z, facing, animation
; id can be -1 to mean do not store this object, and do not destroy
; 0 Create_Object, 0, .44 Magnum, 0, 0, 0, 180, "Human.jump"
;
; time/frame	Destroy_Object, id (slot)
; 0 Destroy_Object, 0
;
; time/frame	Play_Animation, id (slot), animation_name, looping, sub_obj_name
; 0 Play_Animation, 0, "Human.Jump", false
;
; time/frame	Control_Camera,	id ( slot )
; use id -1 for disabling control;
; note this will also disable star control and disbale the hud
; 0 Control_Camera,	0
;
;_________________________________________

;*******************  CHEAT SHEET ******************************

;Start frame	create_object	slot number	model	x,y,z,facing	animation name( model*hierarchy*.anim )
;Start frame	Play_Animation 	slot number	anim name ( model*hierarchy*.anim )	looping		Sub Object
;Start frame	Play_Audio	wave filename	slot number	bone name
;								* no slot # / bone name = 2D Audio
;0= NO LOOP ( kills object when finshed )	1= LOOP

;************************* LEVEL 11: C130 Nod Troop Parachute drop  ************************



; ****************************** Nod Chinook

-1	Create_Real_Object,	1, "Nod_Cargo_Plane"
-1	Play_Animation,		1, "v_Nod_cplane.v_Nod_cplane", 1
-1	Play_Animation,		1, "v_Nod_cplane.X5D_C130Anim", 1
-1	Attach_To_Bone,		1, 2, "BN_chinook_1"
-280 	Destroy_Object,		1

; ****************************** Path

-1	Create_Object,		2, "X5D_Chinookfly",			0, 0, 0, 0
-1	Play_Animation,		2, "X5D_Chinookfly.X5D_Chinookfly", 1
-280 	Destroy_Object,		2
-1	Attach_To_Bone,		1, 2, "BN_chinook_1"

; ****************************** Parachute_1

-169	Create_Object,		3, "X5D_Parachute",			0, 0, 0, 0
-169	Play_Animation,		3, "X5D_Parachute.X5D_ParaC_1", 1
-260	Destroy_Object,		3

; ****************************** Parachute_2

-179	Create_Object,		4, "X5D_Parachute",			0, 0, 0, 0
-179	Play_Animation,		4, "X5D_Parachute.X5D_ParaC_2", 1
-270	Destroy_Object,		4

; ****************************** Parachute_3

-198	Create_Object,		5, "X5D_Parachute",			0, 0, 0, 0
-198	Play_Animation,		5, "X5D_Parachute.X5D_ParaC_3", 1
-280	Destroy_Object,		5
; ****************************** Box 1
-145	Create_Object,		6, "X5D_Box01",				0, 0, 0, 0
-145	Play_Animation,		6, "X5D_Box01.X5D_Box01", 1
-260 	Destroy_Object,		6
; ****************************** Box 2
-155	Create_Object,		7, "X5D_Box02",				0, 0, 0, 0
-155	Play_Animation,		7, "X5D_Box02.X5D_Box02", 1
-270 	Destroy_Object,		7
; ****************************** Box 3
-165	Create_Object,		8, "X5D_Box03",				0, 0, 0, 0
-165	Play_Animation,		8, "X5D_Box03.X5D_Box03", 1
-280 	Destroy_Object,		8

;******************************* Soldiers
-145	Create_Real_Object,	9, "Nod_Minigunner_3Boss_alt", 6, "Box01"
-145    Attach_Script,          9, "M11_C130_Dropoff_Dude_JDG", ""
;-145    Attach_Script,          9, "M01_Hunt_The_Player_JDG", ""
-145    Attach_Script,          9, "M00_No_Falling_Damage_DME", ""
-145	Attach_To_Bone,		9, 6, "Box01"
-145	Play_Animation,		9, "H_A_X5D_ParaT_1", 0
-255	Attach_To_Bone,		9, -1, "Box01"
;-280    Attach_Script,          9, "M01_Hunt_The_Player_JDG", ""


-155	Create_Real_Object,	10, "Nod_RocketSoldier_3Boss", 7, "Box02"
-155    Attach_Script,          10, "M11_C130_Dropoff_Dude_JDG", ""
;-155    Attach_Script,          10, "M01_Hunt_The_Player_JDG", ""
-155    Attach_Script,          10, "M00_No_Falling_Damage_DME", ""
-155	Attach_To_Bone,		10, 7, "Box02"
-155	Play_Animation,		10, "H_A_X5D_ParaT_2", 0
-265	Attach_To_Bone,		10, -1, "Box02"
;-280    Attach_Script,          10, "M01_Hunt_The_Player_JDG", ""

-165	Create_Real_Object,	11, "Nod_RocketSoldier_3Boss", 8, "Box03"
-165    Attach_Script,          11, "M11_C130_Dropoff_Dude_JDG", ""
;-165    Attach_Script,          11, "M01_Hunt_The_Player_JDG", ""
-165    Attach_Script,          11, "M00_No_Falling_Damage_DME", ""
-165	Attach_To_Bone,		11, 8, "Box03"
-165	Play_Animation,		11, "H_A_X5D_ParaT_3", 0
-275	Attach_To_Bone,		11, -1, "Box03"
;-280    Attach_Script,          11, "M01_Hunt_The_Player_JDG", ""





GDI version

;_________________________________________
;
; Available Cinematic Script Commands
;
; time/frame	Create_Object,	id (slot), preset_name, x, y, z, facing, animation
; id can be -1 to mean do not store this object, and do not destroy
; 0 Create_Object, 0, .44 Magnum, 0, 0, 0, 180, "Human.jump"
;
; time/frame	Destroy_Object, id (slot)
; 0 Destroy_Object, 0
;
; time/frame	Play_Animation, id (slot), animation_name, looping, sub_obj_name
; 0 Play_Animation, 0, "Human.Jump", false
;
; time/frame	Control_Camera,	id ( slot )
; use id -1 for disabling control;
; note this will also disable star control and disbale the hud
; 0 Control_Camera,	0
;
;_________________________________________

;*******************  CHEAT SHEET ******************************

;Start frame	create_object	slot number	model	x,y,z,facing	animation name( model*hierarchy*.anim )
;Start frame	Play_Animation 	slot number	anim name ( model*hierarchy*.anim )	looping		Sub Object
;Start frame	Play_Audio	wave filename	slot number	bone name
;								* no slot # / bone name = 2D Audio
;0= NO LOOP ( kills object when finshed )	1= LOOP

;************************* LEVEL 11: C130 Nod Troop Parachute drop  ************************



; ****************************** Nod Chinook

-1	Create_Real_Object,	1, "GDI_Transport_Helicopter_Flyover"
-1	Play_Animation,		1, "v_Nod_cplane.v_Nod_cplane", 1
-1	Play_Animation,		1, "v_Nod_cplane.X5D_C130Anim", 1
-1	Attach_To_Bone,		1, 2, "BN_chinook_1"
-280 	Destroy_Object,		1

; ****************************** Path

-1	Create_Object,		2, "X5D_Chinookfly",			0, 0, 0, 0
-1	Play_Animation,		2, "X5D_Chinookfly.X5D_Chinookfly", 1
-280 	Destroy_Object,		2
-1	Attach_To_Bone,		1, 2, "BN_chinook_1"

; ****************************** Parachute_1

-169	Create_Object,		3, "X5D_Parachute",			0, 0, 0, 0
-169	Play_Animation,		3, "X5D_Parachute.X5D_ParaC_1", 1
-260	Destroy_Object,		3

; ****************************** Parachute_2

-179	Create_Object,		4, "X5D_Parachute",			0, 0, 0, 0
-179	Play_Animation,		4, "X5D_Parachute.X5D_ParaC_2", 1
-270	Destroy_Object,		4

; ****************************** Parachute_3

-198	Create_Object,		5, "X5D_Parachute",			0, 0, 0, 0
-198	Play_Animation,		5, "X5D_Parachute.X5D_ParaC_3", 1
-280	Destroy_Object,		5
; ****************************** Box 1
-145	Create_Object,		6, "X5D_Box01",				0, 0, 0, 0
-145	Play_Animation,		6, "X5D_Box01.X5D_Box01", 1
-260 	Destroy_Object,		6
; ****************************** Box 2
-155	Create_Object,		7, "X5D_Box02",				0, 0, 0, 0
-155	Play_Animation,		7, "X5D_Box02.X5D_Box02", 1
-270 	Destroy_Object,		7
; ****************************** Box 3
-165	Create_Object,		8, "X5D_Box03",				0, 0, 0, 0
-165	Play_Animation,		8, "X5D_Box03.X5D_Box03", 1
-280 	Destroy_Object,		8

;******************************* Soldiers
-145	Create_Real_Object,	9, "GDI_Ignatio_Mobius", 6, "Box01"
-145    Attach_Script,          9, "M11_C130_Dropoff_Dude_JDG", ""
;-145    Attach_Script,          9, "M01_Hunt_The_Player_JDG", ""
-145    Attach_Script,          9, "M00_No_Falling_Damage_DME", ""
-145	Attach_To_Bone,		9, 6, "Box01"
-145	Play_Animation,		9, "H_A_X5D_ParaT_1", 0
-255	Attach_To_Bone,		9, -1, "Box01"
;-280    Attach_Script,          9, "M01_Hunt_The_Player_JDG", ""


-155	Create_Real_Object,	10, "GDI_MiniGunner_3Boss", 7, "Box02"
-155    Attach_Script,          10, "M11_C130_Dropoff_Dude_JDG", ""
;-155    Attach_Script,          10, "M01_Hunt_The_Player_JDG", ""
-155    Attach_Script,          10, "M00_No_Falling_Damage_DME", ""
-155	Attach_To_Bone,		10, 7, "Box02"
-155	Play_Animation,		10, "H_A_X5D_ParaT_2", 0
-265	Attach_To_Bone,		10, -1, "Box02"
;-280    Attach_Script,          10, "M01_Hunt_The_Player_JDG", ""

-165	Create_Real_Object,	11, "GDI_RocketSoldier_3Boss", 8, "Box03"
-165    Attach_Script,          11, "M11_C130_Dropoff_Dude_JDG", ""
;-165    Attach_Script,          11, "M01_Hunt_The_Player_JDG", ""
-165    Attach_Script,          11, "M00_No_Falling_Damage_DME", ""
-165	Attach_To_Bone,		11, 8, "Box03"
-165	Play_Animation,		11, "H_A_X5D_ParaT_3", 0
-275	Attach_To_Bone,		11, -1, "Box03"
;-280    Attach_Script,          11, "M01_Hunt_The_Player_JDG", ""




Whilst this function is used to make a reinforcement mod, you could easily adapt it so you can call any other cinematic file.

Here is the chat hook I used to test the mod in-game:

class NodreChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);
		Commands->Attach_Script(obj,"reb_Nod_reinforcements","");
	}
};
ChatCommandRegistrant<NodreChatCommand> NodreChatCommandReg("!nodre",CHATTYPE_TEAM,0,GAMEMODE_AOW);

class GDIreChatCommand : public ChatCommandClass {
	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		GameObject *obj = Get_GameObj(ID);
		Commands->Attach_Script(obj,"reb_GDI_reinforcements","");
	}
};
ChatCommandRegistrant<GDIreChatCommand> GDIreChatCommandReg("!gdire",CHATTYPE_TEAM,0,GAMEMODE_AOW);



[Updated on: Fri, 30 January 2009 14:43] by Moderator

Report message to a moderator

Re: Bot paratroopers function [message #301096 is a reply to message #301091] Tue, 04 December 2007 19:07 Go to previous messageGo to next message
IronWarrior is currently offline  IronWarrior
Messages: 2460
Registered: November 2004
Location: England UK
Karma: 0
General (2 Stars)
Reborn is taking the role of Renegade's Santa me thinks. In Love
Re: Bot paratroopers function [message #301106 is a reply to message #301091] Tue, 04 December 2007 20:56 Go to previous messageGo to next message
bisen11 is currently offline  bisen11
Messages: 797
Registered: December 2004
Karma: 0
Colonel
That's cool.

http://i6.photobucket.com/albums/y206/bisen11/bisensubzerosig2.jpg
Re: Bot paratroopers function [message #301122 is a reply to message #301096] Wed, 05 December 2007 01:14 Go to previous messageGo to next message
Veyrdite is currently offline  Veyrdite
Messages: 1471
Registered: August 2006
Location: Australia, Sydney
Karma: 0
General (1 Star)
IronWarrior wrote on Wed, 05 December 2007 13:07

Reborn is taking the role of Renegade's Santa me thinks. In Love

Ctrl+7


WOL: Veyrdite Previously: Dthdealer ( a long time ago )
Re: Bot paratroopers function [message #301132 is a reply to message #301091] Wed, 05 December 2007 04:32 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
already made that in lua lol
Re: Bot paratroopers function [message #301133 is a reply to message #301091] Wed, 05 December 2007 04:36 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
plz stop posting scripts... in 3 months all servers will be the same.. Sad it will going to be boring Sad
Re: Bot paratroopers function [message #301140 is a reply to message #301133] Wed, 05 December 2007 05:53 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
MadRockz wrote on Wed, 05 December 2007 11:36

plz stop posting scripts... in 3 months all servers will be the same.. Sad it will going to be boring Sad


stfu you are only annoyed because you have it on your server.
Re: Bot paratroopers function [message #301150 is a reply to message #301140] Wed, 05 December 2007 06:55 Go to previous messageGo to next message
Genesis2001
Messages: 1397
Registered: August 2006
Karma: 0
General (1 Star)
RoShamBo wrote on Wed, 05 December 2007 05:53

MadRockz wrote on Wed, 05 December 2007 11:36

plz stop posting scripts... in 3 months all servers will be the same.. Sad it will going to be boring Sad


stfu you are only annoyed because you have it on your server.


And I think I'm the one that gave you the basis for this somewhere on the Lua forum ^,^


~MathK1LL
Re: Bot paratroopers function [message #301151 is a reply to message #301150] Wed, 05 December 2007 07:03 Go to previous messageGo to next message
Caveman is currently offline  Caveman
Messages: 2476
Registered: July 2005
Location: Wales, UK
Karma: 0
General (2 Stars)

Man reborn you can't win can you? If you don't release the source code people will moan and if you do release source code people still moan lol.

Anyways, nice work. I'll try and have a look through some of it later Smile


CarrierII wrote

BLUEHTHEN YOU AR NOT JUST A BIG CHEATAS AND YOU THE BIG HEAD JUST YOU USE FLY H4X FUCK YOU BIG CHEATAS YOUR CHEATZ IS BAD YOU WANT I WRAUGHT THIS YOUR CHEATZ IS BAD HEY IS 1 YEAR YOUR PROMESS A FLY HAX IN MULTIPLAYER AND IS DONT JUST TROOPRM02 I TELL IT ALL WHO REPLYER IN THIS FORUM YOU CHEATZ

Please don't make me type something like that again, not using puntuation is annoying.


http://r9.fodey.com/2158/bc450f3ca15045e9bdd7651fa49f3a0a.0.gif
Re: Bot paratroopers function [message #301171 is a reply to message #301091] Wed, 05 December 2007 08:21 Go to previous message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
lol no, i created my best commands myself without any help...
Previous Topic: [model/replacement]weapon replacements for renegade
Next Topic: [script]Base power crate function
Goto Forum:
  


Current Time: Mon Dec 02 05:58:04 MST 2024

Total time taken to generate the page: 0.01276 seconds