This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk
Forum rules
Forum rules
Gibbing bug
Forum rules
By using the forum you agree to the following rules. For this forum you also need to follow these additional rules.
By using the forum you agree to the following rules. For this forum you also need to follow these additional rules.
- TheYourocktube
- Meatbag
- Posts: 7
- Joined: Tue Mar 22, 2016 1:07 am
- Title: Male
- SFD Account: Yrk
- Started SFD: When There Were 2 Genders
- Location: USA
- Contact:
He is referring to the Deathmatch script created by # and yourself. The script needs some updating (so does the Team version). I believe the problem is with the gib part of it. Battle, DM, and TDM all auto gibs players. Link below.
http://sfdmaps.at.ua/_ld/1/194_DM.txt
http://sfdmaps.at.ua/_ld/1/194_DM.txt
0 x
- Gurt
- Lead Programmer

- Posts: 1887
- Joined: Sun Feb 28, 2016 3:22 pm
- Title: Lead programmer
- Started SFD: Made it!
- Location: Sweden
- Gender:
- Age: 36
It turns out that gibbing, removing or killing the same player in its OnPlayerDeathEvent is a poor idea ever since the changes to this event in Alpha 1.2.0 since it will quickly call OnPlayerDeathEvent for each time you call gib, remove or kill - eventually hitting a stack overflow exception and SFD stops working.
This will be fixed after Alpha 1.2.1. so that scripts will work correctly again.
If you want to get the DM script to start working again replace the whole public void Death() function with the following:
Added in 30 minutes 13 seconds:
This will be fixed after Alpha 1.2.1. so that scripts will work correctly again.
If you want to get the DM script to start working again replace the whole public void Death() function with the following:
Code: Select all
private HashSet<int> handledDeaths = new HashSet<int>();
public void Death(TriggerArgs args){
IPlayer ply = (IPlayer)args.Sender;
if (handledDeaths.Add(ply.UniqueID)) {
IUser user = ply.GetUser();
if (user != null && UserStillHere(user)){
spawnQueue.Add(new PlyData(ply, user, ply.GetTeam(), FromNow(RESPAWN_DELAY)));
Mod.Kills ++;
//Mod.Message(user.GetProfile().Name + " died!");
} else {
Game.PlayEffect("PWT", ply.GetWorldPosition(), "PLAYER LEFT");
Game.TriggerExplosion(ply.GetWorldPosition());
ply.Gib();
}
CheckGameOver();
}
}Gurt wrote:It turns out that gibbing, removing or killing the same player in its OnPlayerDeathEvent is a poor idea ever since the changes to this event in Alpha 1.2.0 since it will quickly call OnPlayerDeathEvent for each time you call gib, remove or kill - eventually hitting a stack overflow exception and SFD stops working.
This will be fixed after Alpha 1.2.1. so that scripts will work correctly again.
If you want to get the DM script to start working in this version without waiting for the next just replace the whole public void Death() function with the following:Code: Select all
private HashSet<int> handledDeaths = new HashSet<int>(); public void Death(TriggerArgs args){ IPlayer ply = (IPlayer)args.Sender; if (handledDeaths.Add(ply.UniqueID)) { IUser user = ply.GetUser(); if (user != null && UserStillHere(user)){ spawnQueue.Add(new PlyData(ply, user, ply.GetTeam(), FromNow(RESPAWN_DELAY))); Mod.Kills ++; //Mod.Message(user.GetProfile().Name + " died!"); } else { Game.PlayEffect("PWT", ply.GetWorldPosition(), "PLAYER LEFT"); Game.TriggerExplosion(ply.GetWorldPosition()); ply.Gib(); } CheckGameOver(); } }
0 x
Gurt