Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Hello
Re: Hello [message #326433 is a reply to message #326423] Wed, 16 April 2008 12:28 Go to previous messageGo to previous message
_SSnipe_ is currently offline  _SSnipe_
Messages: 4121
Registered: May 2007
Location: Riverside Southern Califo...
Karma:
General (4 Stars)
reborn wrote on Wed, 16 April 2008 10:45

SSnipe wrote on Wed, 16 April 2008 13:27

reborn wrote on Wed, 16 April 2008 10:03

SSnipe wrote on Wed, 16 April 2008 12:53

reborn wrote on Wed, 16 April 2008 07:54

Not that I know of, but you could edit the ssgm_player script so that all the drop weapons code is also added to the ::Destroyed event, and add a little explosion at the same position as the player GameObject *.

i looked at the scripts...i think i understand some of what u said but just a little stuck


ATM the drop weapon code is on the ::Killed event (I think, working from memory here Razz), change it so that it is on the ::Destroyed event of SSGM_Player instead. This way when a player leaves it will happen too. You will also have to create an explosion too, this won't be too much extra work as the drop weapon already gets the Vector position for where to crate the weapon drop, so just use that position for the explosion too.

so pretty much chage that thing and replace the weapon drops with an explossion? or add a explosion along with weapon drop?


the killed event has no wep drop stuff :S

heres what i think i made problley 99.9% junk but im trying

void MDB_SSGM_Player::Destroyed(GameObject *obj) {
	if (Settings->DestroyPlayerVeh && Get_Vehicle(obj)) {
		GameObject *Veh = Get_Vehicle(obj);
		if (Get_Vehicle_Driver(Veh) == obj) {
			Commands->Apply_Damage(Veh,99999,"Death",false);
		}
	}

	if (!Data->Mod && Settings->DropWeapons && WasKilled) {
		WasKilled = false;
		Vector3 DeathPlace = Commands->Get_Position(obj);
		int RandomNum = Commands->Get_Random_Int(1,5);
		GameObject *BackpackScript = 0;
		if (strstr(Commands->Get_Preset_Name(obj),"CnC_GDI_MiniGunner_0")) {
			BackpackScript = Commands->Create_Object("POW_AutoRifle_Player",DeathPlace);
			Commands->Create_Explosion(Get_Parameter("ag_braxis_large.w3d"),Commands->Get_Position(obj),0);
		}
		
	
		]
}



Oh, it's on the ::Destroyed event already. I guess it should drop then, I wonder why it doesn't.

Let me look...

Ah. You need to change a line from this:
if (!Data->Mod && Settings->DropWeapons && WasKilled) {

To this:
if (!Data->Mod && Settings->DropWeapons) {


Which basically means it will drop his weapons if he was killed or left the server, instead of only dropping if he is killed.

For the explosion you need to add this line here:
(note you need to use some explosion name in that parameter there.
Commands->Create_Explosion("some explosion name here",DeathPlace,0);


You will need to add it here:

		else {
			BackpackScript = Commands->Create_Object("POW_Armor_025",DeathPlace);
		}
		Commands->Attach_Script(BackpackScript,"MDB_SSGM_Drop_Weapon","");
	}
// Add the line here SSnipe and then remove this comment
	if (Find_My_Veh(obj)) {
		Commands->Send_Custom_Event(obj,Find_My_Veh(obj),1111,0,0);
	}
}



That will mean an explosion happens when any player is killed or leaves at the place they died or was when they left.
If you want it to only expload if they drop a weapon you would need to add that line under all the instances in that event where you see "BackpackScript = Commands->Create_Object etc etc etc".



cool ill try it.....does the same thing work if i decide to add an animation along with the explosion? and a sound?
 
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: Adding colored lights in RenX to a building
Next Topic: Vechile/Harvester Help
Goto Forum:
  


Current Time: Fri Jan 24 02:50:51 MST 2025

Total time taken to generate the page: 0.01254 seconds