Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

need script to disable gibs

All technical topics that have been answered in one way or another can be found here.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
The_JOKER
Fighter
Fighter
Posts: 38
Joined: Mon Jul 18, 2016 2:35 am
Title: I'm Korean JOKER :)
SFD Account: JOKER_Korea
SFD Alias: JOKER
Started SFD: April 2016
Location: South Korea
Gender:
Age: 23
Contact:

need script to disable gibs

Post by The_JOKER » Tue Oct 04, 2016 3:16 am

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.
0 x

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 25

Post by JakSparro98 » Thu Oct 06, 2016 4:41 pm

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?
0 x

User avatar
gwendalaze
Superfighter
Superfighter
Posts: 84
Joined: Sat Mar 19, 2016 12:55 pm
Title: Jarate Yellow Belt
Started SFD: PreAlpha 1.1.4
Location: France

Post by gwendalaze » Thu Oct 06, 2016 7:40 pm

You can remove them on spawn, but I don't think it'll fix any performance issue.
0 x
- Gwendalaze, failing at being fun, just like this signature

User avatar
The_JOKER
Fighter
Fighter
Posts: 38
Joined: Mon Jul 18, 2016 2:35 am
Title: I'm Korean JOKER :)
SFD Account: JOKER_Korea
SFD Alias: JOKER
Started SFD: April 2016
Location: South Korea
Gender:
Age: 23
Contact:

Post by The_JOKER » Fri Oct 07, 2016 1:11 am

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...
0 x

User avatar
Motto73
Superfighter
Superfighter
Posts: 316
Joined: Mon May 09, 2016 7:35 am
Title: Lazy ass
SFD Account: Motto73
Started SFD: Multiplayer Test Demo
Location: Sunny City
Gender:
Age: 24

Post by Motto73 » Fri Oct 07, 2016 7:53 am

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.
2 x
Image

User avatar
The_JOKER
Fighter
Fighter
Posts: 38
Joined: Mon Jul 18, 2016 2:35 am
Title: I'm Korean JOKER :)
SFD Account: JOKER_Korea
SFD Alias: JOKER
Started SFD: April 2016
Location: South Korea
Gender:
Age: 23
Contact:

Post by The_JOKER » Fri Oct 07, 2016 10:18 am

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?
0 x

User avatar
Motto73
Superfighter
Superfighter
Posts: 316
Joined: Mon May 09, 2016 7:35 am
Title: Lazy ass
SFD Account: Motto73
Started SFD: Multiplayer Test Demo
Location: Sunny City
Gender:
Age: 24

Post by Motto73 » Fri Oct 07, 2016 11:00 am

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...
0 x
Image

User avatar
The_JOKER
Fighter
Fighter
Posts: 38
Joined: Mon Jul 18, 2016 2:35 am
Title: I'm Korean JOKER :)
SFD Account: JOKER_Korea
SFD Alias: JOKER
Started SFD: April 2016
Location: South Korea
Gender:
Age: 23
Contact:

Post by The_JOKER » Fri Oct 07, 2016 11:48 am

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 :)
0 x

User avatar
Motto73
Superfighter
Superfighter
Posts: 316
Joined: Mon May 09, 2016 7:35 am
Title: Lazy ass
SFD Account: Motto73
Started SFD: Multiplayer Test Demo
Location: Sunny City
Gender:
Age: 24

Post by Motto73 » Fri Oct 07, 2016 12:18 pm

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
1 x
Image

User avatar
gwendalaze
Superfighter
Superfighter
Posts: 84
Joined: Sat Mar 19, 2016 12:55 pm
Title: Jarate Yellow Belt
Started SFD: PreAlpha 1.1.4
Location: France

Post by gwendalaze » Fri Oct 07, 2016 6:02 pm

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
0 x
- Gwendalaze, failing at being fun, just like this signature

User avatar
The_JOKER
Fighter
Fighter
Posts: 38
Joined: Mon Jul 18, 2016 2:35 am
Title: I'm Korean JOKER :)
SFD Account: JOKER_Korea
SFD Alias: JOKER
Started SFD: April 2016
Location: South Korea
Gender:
Age: 23
Contact:

Post by The_JOKER » Sat Oct 08, 2016 2:14 am

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
1 x

Post Reply