Home » Renegade Discussions » Mod Forum » Hello
Hello [message #326239] |
Mon, 14 April 2008 22:20 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
Its there a script that makes it ingame when you leave the game you character explodes and drops weapon instead of just disappearing like a ghost?
|
|
|
|
Re: Hello [message #326406 is a reply to message #326239] |
Wed, 16 April 2008 07:54 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
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 *.
|
|
|
Re: Hello [message #326418 is a reply to message #326406] |
Wed, 16 April 2008 09:53 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
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
|
|
|
|
Re: Hello [message #326420 is a reply to message #326419] |
Wed, 16 April 2008 10:27 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
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 ), 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);
}
]
}
[Updated on: Wed, 16 April 2008 10:29] Report message to a moderator
|
|
|
Re: Hello [message #326423 is a reply to message #326420] |
Wed, 16 April 2008 10:45 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
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 ), 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".
|
|
|
Re: Hello [message #326433 is a reply to message #326423] |
Wed, 16 April 2008 12:28 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
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 ), 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?
|
|
|
Re: Hello [message #326439 is a reply to message #326239] |
Wed, 16 April 2008 12:48 |
|
reborn
Messages: 3231 Registered: September 2004 Location: uk - london
Karma: 0
|
General (3 Stars) |
|
|
If you want to add a custom sound / animation when a player dies then yeah, add it to the same place.
But you could try and do something a little more exciting and add custom death sounds for the dead player based on his preset.
|
|
|
Re: Hello [message #326460 is a reply to message #326439] |
Wed, 16 April 2008 14:40 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
reborn wrote on Wed, 16 April 2008 12:48 | If you want to add a custom sound / animation when a player dies then yeah, add it to the same place.
But you could try and do something a little more exciting and add custom death sounds for the dead player based on his preset.
|
cool....how about animation?
umm let me guess
crate object on death (solider that cant die?)
then after that add animation?
|
|
|
|
Re: Hello [message #326464 is a reply to message #326239] |
Wed, 16 April 2008 14:52 |
_SSnipe_
Messages: 4121 Registered: May 2007 Location: Riverside Southern Califo...
Karma: 0
|
General (4 Stars) |
|
|
i just remembered the scripts already ingame might have problem with the objects file the presets of the characters have a script hooked up via lvl edit to crate an explosion so is there way to make it so it ONLY has explosions i choose to only when you leave?
maybe i should leave this
if (!Data->Mod && Settings->DropWeapons && WasKilled) {
|
|
|
Goto Forum:
Current Time: Fri Jan 10 16:02:08 MST 2025
Total time taken to generate the page: 0.00914 seconds
|