Page 1 of 1
need script to disable gibs
Posted: Tue Oct 04, 2016 3:16 am
by The_JOKER
I'm making a new map, but player gibs is making glitch.
I need a script to disable player's gibs. as a full script, pls.
Re: need script to disable gibs
Posted: Thu Oct 06, 2016 4:41 pm
by JakSparro98
The_JOKER wrote:I'm making a new map, but player gibs is making glitch.
I need a script to disable player's gibs. as a full script, pls.
I don't think it's possible to disable completely the gib, you can add health on dead bodies but you cannot avoid a bazooka shot making a player explodes in pieces.
Is your issue related to the objects spawned with the player explosion or a bug from other scripts?
Re: need script to disable gibs
Posted: Thu Oct 06, 2016 7:40 pm
by gwendalaze
You can remove them on spawn, but I don't think it'll fix any performance issue.
Re: need script to disable gibs
Posted: Fri Oct 07, 2016 1:11 am
by The_JOKER
gwendalaze wrote:You can remove them on spawn, but I don't think it'll fix any performance issue.
some players are squashed by blocks, and some gib is not squashed and remain between block.
it doesn't make bad performance, but in visual...
Re: need script to disable gibs
Posted: Fri Oct 07, 2016 7:53 am
by Motto73
The_JOKER wrote:gwendalaze wrote:You can remove them on spawn, but I don't think it'll fix any performance issue.
some players are squashed by blocks, and some gib is not squashed and remain between block.
it doesn't make bad performance, but in visual...
If I understood correctly, you want to remove the giblets when they are spawned. This script removes all giblets spawned as fast as possible:
Code: Select all
string[] gibNames = { "Giblet00", "Giblet01", "Giblet02", "Giblet03", "Giblet04" };
public void Update(){
for (int i = 0; i < 4; i++) {
foreach (IObject giblet in Game.GetObjectsByName(gibNames[i]))
giblet.Remove ();
}
}
You dont need any other trigger or things, just paste this into your script.
Re: need script to disable gibs
Posted: Fri Oct 07, 2016 10:18 am
by The_JOKER
Motto73 wrote:
If I understood correctly, you want to remove the giblets when they are spawned. This script removes all giblets spawned as fast as possible:
Code: Select all
string[] gibNames = { "Giblet00", "Giblet01", "Giblet02", "Giblet03", "Giblet04" };
public void Update(){
for (int i = 0; i < 4; i++) {
foreach (IObject giblet in Game.GetObjectsByName(gibNames[i]))
giblet.Remove ();
}
}
You dont need any other trigger or things, just paste this into your script.
yes, its ok if it remove gibs as fast as it can, but script you gave me doesn't seem to work on my map. did i missed something?
Re: need script to disable gibs
Posted: Fri Oct 07, 2016 11:00 am
by Motto73
The_JOKER wrote:Motto73 wrote:
If I understood correctly, you want to remove the giblets when they are spawned. This script removes all giblets spawned as fast as possible:
Code: Select all
string[] gibNames = { "Giblet00", "Giblet01", "Giblet02", "Giblet03", "Giblet04" };
public void Update(TriggerArgs args){
for (int i = 0; i <= 4; i++) {
foreach (IObject giblet in Game.GetObjectsByName(gibNames[i]))
giblet.Remove ();
}
}
You dont need any other trigger or things, just paste this into your script.
yes, its ok if it remove gibs as fast as it can, but script you gave me doesn't seem to work on my map. did i missed something?
Ok i made something wrong with the update method..
Use a OnUpdateTrigger with method Update. this should fix it.
I'm sorry for this...
Re: need script to disable gibs
Posted: Fri Oct 07, 2016 11:48 am
by The_JOKER
oh, I think this is right one
string[] gibNames = { "Giblet00", "Giblet01", "Giblet02", "Giblet03", "Giblet04" };
public void Update (
TriggerArgs args){
for (int i = 0; i <
5; i++) {
foreach (IObject giblet in Game.GetObjectsByName(gibNames
))
giblet.Remove ();
}
}
Now all gibs are removed. Thanks for the script and help 
Re: need script to disable gibs
Posted: Fri Oct 07, 2016 12:18 pm
by Motto73
The_JOKER wrote:oh, I think this is right one
string[] gibNames = { "Giblet00", "Giblet01", "Giblet02", "Giblet03", "Giblet04" };
public void Update (
TriggerArgs args){
for (int i = 0; i <
5; i++) {
foreach (IObject giblet in Game.GetObjectsByName(gibNames
))
giblet.Remove ();
}
}
Now all gibs are removed. Thanks for the script and help 
i fixed them up there already
Re: need script to disable gibs
Posted: Fri Oct 07, 2016 6:02 pm
by gwendalaze
Motto73 wrote:The_JOKER wrote:oh, I think this is right one
string[] gibNames = { "Giblet00", "Giblet01", "Giblet02", "Giblet03", "Giblet04" };
public void Update (
TriggerArgs args){
for (int i = 0; i <
5; i++) {
foreach (IObject giblet in Game.GetObjectsByName(gibNames
))
giblet.Remove ();
}
}
Now all gibs are removed. Thanks for the script and help 
i fixed them up there already
you should have used the onUpdate event that has been implemented recently
Re: need script to disable gibs
Posted: Sat Oct 08, 2016 2:14 am
by The_JOKER
string[] gibNames = { "Giblet00", "Giblet01", "Giblet02", "Giblet03", "Giblet04" };
public void Update(TriggerArgs args){
for (int i = 0; i <= 4; i++) {
foreach (IObject giblet in Game.GetObjectsByName(gibNames))
giblet.Remove ();
}
}
Yes, anyway thank you everyone