Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Making A New Crate
Re: Making A New Crate [message #271891 is a reply to message #271761] Mon, 09 July 2007 03:56 Go to previous messageGo to previous message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma:
General (3 Stars)
Ok, the vehichles have the scripts attached to them in the cinematic file, not the source code to the scripts.dll. I have no idea if there is a script that makes something ignored by base defence.
What I am trying to say to you, is you need to attach a script to the vehichle in the cinematic to do what you want.
I would personally make a script using the following statements:

Commands->Set_Is_Visible(obj,false);

And call it something like joe_add_spy. Remember to destroy the script on ::killed

The actual code for the crate would something like this, but I havn't tested or compiled it, there is most likely missing syntax, this is just something for you to base your code on:

			else if	((RandomIntCrate <=	(percent+=Settings->CrateSpyVehicle)) && (Settings->CrateSpyVehicle	> 0)) {
				if (Get_Vehicle(sender) || Settings->GameMode != 1 || Settings->CrateVehSpawnPos[0].X == 0.0f || Settings->CrateVehSpawnPos[0].Y == 0.0f || Settings->CrateVehSpawnPos[0].Z == 0.0f || Settings->CrateVehSpawnPos[1].X == 0.0f || Settings->CrateVehSpawnPos[1].Y == 0.0f || Settings->CrateVehSpawnPos[1].Z == 0.0f) {
					goto CrateStart;
				}
				Vector3	Pos = Settings->CrateVehSpawnPos[Get_Object_Type(sender)];
				Damage_All_Vehicles_Area(999999.0f,"Laser_NoBuilding",Pos,2.0f,obj,0);
				Commands->Set_Position(sender,Pos);

				GameObject *Temp = Commands->Create_Object("Invisible_Object",Pos);
	
				StrFormat2(message2,"%ls picked up a Random Vehicle Crate.",Get_Wide_Player_Name(sender));
				StrFormat2(message1,"ppage %d [Crate] You got a special spy stank from the Spy Vehicle Crate.",Get_Player_ID(sender));
				Commands->Attach_Script(Temp,"Test_Cinematic",StrFormat("%sSpy_Veh.txt",Commands->Get_Player_Type(sender)	== 0?"Nod":"GDI"));
				Console_Input(StrFormat("msg Crate: Looks like %ls just got a spy vehicle! Go them!",Get_Wide_Team_Name(Team)).c_str());
				if (Settings->Gamelog) {
					Vector3 pos = Commands->Get_Position(sender);
					StrFormat2(message3,"CRATE;VEHICLE;%d;%s;%f;%f;%f;%f;%f;%f;%d", Commands->Get_ID(sender),	Commands->Get_Preset_Name(sender), pos.Y,pos.X,pos.Z, Commands->Get_Facing(sender),	Commands->Get_Max_Health(sender),Commands->Get_Max_Shield_Strength(sender),Get_Object_Type(sender));
				}	
			}


This would mean that it only calls the "NodSpy_Veh.txt" and the "GSISpy_Veh.txt", which you would have to create, and make so it creates a stealth tank and then attaches you "joe_add_spy" script to it.

Something like this:
(You can adapt this for both cinematics, but this is the GDI version.
;************************* Transport Helicopter Hummvee Drop  ************************

; ****************************** Trajectory Transport

-1	Create_Object,		1, "XG_TransprtBone",			0, 0, 0, 0
-1	Play_Animation,		1, "XG_TransprtBone.XG_HD_TTraj", 1

; ****************************** Transport

-1	Create_Real_Object,	2, "CnC_GDI_Transport", 1, "BN_Trajectory"
-1	Attach_Script,		2, "KAK_Prevent_Destruction_Until_Entered"
-1	Set_Primary,		2
-1	Attach_to_Bone,		2, 1, "BN_Trajectory"
-1	Play_Animation,		2, "v_GDI_trnspt.XG_HD_Transport",1
-700	destroy_object,		2

; ****************************** Trajectory Nod_Light_Tank

-1	Create_Object,		3, "XG_HD_HTraj",			0, 0, 0, 0
-1	Play_Animation,		3, "XG_HD_HTraj.XG_HD_HTraj", 1

; ****************************** Nod_Spy_Stank

-1	Create_Real_Object,	4, "CnC_Nod_Stealth_Tank", 3, "BN_Trajectory" 
-1	Attach_Script,		4, "joe_add_spy"
-1	Attach_Script,		4, "M02_Player_Vehicle", "0"
-1	Attach_Script,		4, "KAK_Prevent_Destruction_Until_Entered"
-1	Attach_to_Bone,		4, 3, "BN_Trajectory"
-437	Attach_to_Bone,		4, -1, "BN_Trajectory"
-437	Move_Slot,		7, 4

; ****************************** Harness

-1	Create_Object,		6, "XG_HD_Harness",			0, 0, 0, 0
-1	Play_Animation,		6, "XG_HD_Harness.XG_HD_Harness", 0

;******************************* SigFlare

-1	Create_Real_Object,	8, "SignalFlare_Gold_Phys3"
-437	Destroy_Object,		8

; ****************************** Primary Destroyed

1000000 Destroy_Object, 1
1000000 Destroy_Object, 2
1000000 Destroy_Object, 3
1000000 Destroy_Object, 4
1000000 Destroy_Object, 5
1000000 Destroy_Object, 6


You will also need to amend the entries for:
void Crate_Defaults()
void Crate_Level_Loaded()
void CrateSettings
So that it includes you new crate (this is a simple task).


You should have all the information you need now to start working on your spy veh crate on your own now.



 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Is it possible to enable weapons spawn in Multiplayer Practice?
Next Topic: How do you make plugins for ssgm?
Goto Forum:
  


Current Time: Sun Jan 12 06:03:41 MST 2025

Total time taken to generate the page: 0.01599 seconds