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.
New to the forum? Say hello in this topic! Also make sure to read the rules.
Script Requesting
Forum rules
By using the forum you agree to the following rules.
By using the forum you agree to the following rules.
- CrazyDuck
- Fighter
- Posts: 20
- Joined: Thu Sep 15, 2016 7:42 am
- SFD Account: CrazyDuckk
- SFD Alias: CrazyDuck
- Started SFD: 2014
- Location: China
- Gender:
- Age: 23
- Contact:
Script Requesting
I don't know how to write scripts at all , So I hope to have a player that good at scripting can help me write a small script
If someone could help me , i will be able to finish my map . thank you guys!
The Scripts i need will resurrect the player on the body 5 seconds after he dead, and remove dead bodies from Resurrection, and if the body disappears, he will not be resurrected. And the script is in the form of public void, because I want to use it on the map instead of using it independently
If someone could help me , i will be able to finish my map . thank you guys!
The Scripts i need will resurrect the player on the body 5 seconds after he dead, and remove dead bodies from Resurrection, and if the body disappears, he will not be resurrected. And the script is in the form of public void, because I want to use it on the map instead of using it independently
0 x
- JakSparro98
- Superfighter
- Posts: 530
- Joined: Fri Jul 15, 2016 7:56 pm
- Started SFD: PreAlpha 1.0.5
- Location: Rome, Italy
- Gender:
- Age: 25
Before I can start the code I need to ask you if the player have to resurrect in the same position he died and if the script needs to start at game start.CrazyDuck wrote: ↑Thu Oct 12, 2017 4:07 pmI don't know how to write scripts at all , So I hope to have a player that good at scripting can help me write a small script
If someone could help me , i will be able to finish my map . thank you guys!
The Scripts i need will resurrect the player on the body 5 seconds after he dead, and remove dead bodies from Resurrection, and if the body disappears, he will not be resurrected. And the script is in the form of public void, because I want to use it on the map instead of using it independently
Then I want to precise that "public void form" as you say doesn't automatically makes a script for a map or indipendent, in particular the public keyword allows to declare if the code needs to be visible on more "levels" that's why when you trigger some script from game objects we use public instead of leaving it blank or giving it private.
0 x
- CrazyDuck
- Fighter
- Posts: 20
- Joined: Thu Sep 15, 2016 7:42 am
- SFD Account: CrazyDuckk
- SFD Alias: CrazyDuck
- Started SFD: 2014
- Location: China
- Gender:
- Age: 23
- Contact:
Thank you for reply,JakSparro98 wrote: ↑Thu Oct 12, 2017 7:14 pmBefore I can start the code I need to ask you if the player have to resurrect in the same position he died and if the script needs to start at game start.CrazyDuck wrote: ↑Thu Oct 12, 2017 4:07 pmI don't know how to write scripts at all , So I hope to have a player that good at scripting can help me write a small script
If someone could help me , i will be able to finish my map . thank you guys!
The Scripts i need will resurrect the player on the body 5 seconds after he dead, and remove dead bodies from Resurrection, and if the body disappears, he will not be resurrected. And the script is in the form of public void, because I want to use it on the map instead of using it independently
Then I want to precise that "public void form" as you say doesn't automatically makes a script for a map or indipendent, in particular the public keyword allows to declare if the code needs to be visible on more "levels" that's why when you trigger some script from game objects we use public instead of leaving it blank or giving it private.
Yes, I need to make it work at the beginning of the game
I don't need it to work on more levels, but on a particular map
The place where I need players to resurrect is changeable, and where their bodies are moved, he'll be resurrected there unless his body is destoryed or removed
Thank you very much for helping me
0 x
- JakSparro98
- Superfighter
- Posts: 530
- Joined: Fri Jul 15, 2016 7:56 pm
- Started SFD: PreAlpha 1.0.5
- Location: Rome, Italy
- Gender:
- Age: 25
Sorry for the late answer, I was been busy all the week, here's what you requested:CrazyDuck wrote: ↑Sat Oct 14, 2017 7:00 amThank you for reply,JakSparro98 wrote: ↑Thu Oct 12, 2017 7:14 pmBefore I can start the code I need to ask you if the player have to resurrect in the same position he died and if the script needs to start at game start.CrazyDuck wrote: ↑Thu Oct 12, 2017 4:07 pmI don't know how to write scripts at all , So I hope to have a player that good at scripting can help me write a small script
If someone could help me , i will be able to finish my map . thank you guys!
The Scripts i need will resurrect the player on the body 5 seconds after he dead, and remove dead bodies from Resurrection, and if the body disappears, he will not be resurrected. And the script is in the form of public void, because I want to use it on the map instead of using it independently
Then I want to precise that "public void form" as you say doesn't automatically makes a script for a map or indipendent, in particular the public keyword allows to declare if the code needs to be visible on more "levels" that's why when you trigger some script from game objects we use public instead of leaving it blank or giving it private.
Yes, I need to make it work at the beginning of the game
I don't need it to work on more levels, but on a particular map
The place where I need players to resurrect is changeable, and where their bodies are moved, he'll be resurrected there unless his body is destoryed or removed
Thank you very much for helping me
Download template
You can move the spawnpoint by triggering ScriptTriggers as set as in the map example, the last triggered will be used next time a player die and his body is still present. When not even one is triggered, the default spawn will be at map origin (0,0).
Tell me if it's what you wanted, I'm at your disposal for any question.
Last edited by JakSparro98 on Sun Oct 22, 2017 12:02 pm, edited 1 time in total.
0 x
- CrazyDuck
- Fighter
- Posts: 20
- Joined: Thu Sep 15, 2016 7:42 am
- SFD Account: CrazyDuckk
- SFD Alias: CrazyDuck
- Started SFD: 2014
- Location: China
- Gender:
- Age: 23
- Contact:
Thank you! but, i can't open this download link...JakSparro98 wrote: ↑Fri Oct 20, 2017 8:58 pmSorry for the late answer, I was been busy all the week, here's what you requested:CrazyDuck wrote: ↑Sat Oct 14, 2017 7:00 amThank you for reply,JakSparro98 wrote: ↑Thu Oct 12, 2017 7:14 pm
Before I can start the code I need to ask you if the player have to resurrect in the same position he died and if the script needs to start at game start.
Then I want to precise that "public void form" as you say doesn't automatically makes a script for a map or indipendent, in particular the public keyword allows to declare if the code needs to be visible on more "levels" that's why when you trigger some script from game objects we use public instead of leaving it blank or giving it private.
Yes, I need to make it work at the beginning of the game
I don't need it to work on more levels, but on a particular map
The place where I need players to resurrect is changeable, and where their bodies are moved, he'll be resurrected there unless his body is destoryed or removed
Thank you very much for helping me
Download template
You can move the spawnpoint by triggering ScriptTriggers as set as in the map example, the last triggered will be used next time a player die and his body is still present. When not even one is triggered, the default spawn will be at map origin (0,0).
Tell me if it's what you wanted, I'm at your disposal for any question.
maybe you can send the txt file to my email 798108753@qq.com
0 x
- JakSparro98
- Superfighter
- Posts: 530
- Joined: Fri Jul 15, 2016 7:56 pm
- Started SFD: PreAlpha 1.0.5
- Location: Rome, Italy
- Gender:
- Age: 25
I modified the link in the previous post, can you retry?CrazyDuck wrote: ↑Sun Oct 22, 2017 5:18 amThank you! but, i can't open this download link...
maybe you can send the txt file to my email 798108753@qq.com
0 x
- CrazyDuck
- Fighter
- Posts: 20
- Joined: Thu Sep 15, 2016 7:42 am
- SFD Account: CrazyDuckk
- SFD Alias: CrazyDuck
- Started SFD: 2014
- Location: China
- Gender:
- Age: 23
- Contact:
Yes , thank you . But I think you not fully understand what I mean... Your script is similar to the checkpoint script, but what I need is to make fighters like zombies, where to die and where to rise Please help me revise it again , Thank You!JakSparro98 wrote: ↑Sun Oct 22, 2017 12:03 pmI modified the link in the previous post, can you retry?CrazyDuck wrote: ↑Sun Oct 22, 2017 5:18 amThank you! but, i can't open this download link...
maybe you can send the txt file to my email 798108753@qq.com
By the way , my map has been completed, and now it's just need the script to make it work. It will be a really fun and creative map!
0 x
- JakSparro98
- Superfighter
- Posts: 530
- Joined: Fri Jul 15, 2016 7:56 pm
- Started SFD: PreAlpha 1.0.5
- Location: Rome, Italy
- Gender:
- Age: 25
Never talked about reviving bots, I thought you needed it for players, and yes, this code is a variation of the checkpoint system.CrazyDuck wrote: ↑Mon Oct 23, 2017 6:48 amYes , thank you . But I think you not fully understand what I mean... Your script is similar to the checkpoint script, but what I need is to make fighters like zombies, where to die and where to rise Please help me revise it again , Thank You!
By the way , my map has been completed, and now it's just need the script to make it work. It will be a really fun and creative map!
Do you need only to revive bots or both players and bots?
1 x
- CrazyDuck
- Fighter
- Posts: 20
- Joined: Thu Sep 15, 2016 7:42 am
- SFD Account: CrazyDuckk
- SFD Alias: CrazyDuck
- Started SFD: 2014
- Location: China
- Gender:
- Age: 23
- Contact:
JakSparro98 wrote: ↑Mon Oct 23, 2017 10:39 amNever talked about reviving bots, I thought you needed it for players, and yes, this code is a variation of the checkpoint system.CrazyDuck wrote: ↑Mon Oct 23, 2017 6:48 amYes , thank you . But I think you not fully understand what I mean... Your script is similar to the checkpoint script, but what I need is to make fighters like zombies, where to die and where to rise Please help me revise it again , Thank You!
By the way , my map has been completed, and now it's just need the script to make it work. It will be a really fun and creative map!
Do you need only to revive bots or both players and bots?
I'm talking about getting players to resurrect on their bodies, not checkpoints! Right on their dead bodys! It's in the dead place resurrection rather than teleport to the checkpoint! And when the body was destroyed, they would not revive, and that was the most important thing!
0 x
- JakSparro98
- Superfighter
- Posts: 530
- Joined: Fri Jul 15, 2016 7:56 pm
- Started SFD: PreAlpha 1.0.5
- Location: Rome, Italy
- Gender:
- Age: 25
Clear, here's the script, I hope it's what you're asking:CrazyDuck wrote: ↑Tue Oct 24, 2017 8:03 amJakSparro98 wrote: ↑Mon Oct 23, 2017 10:39 amNever talked about reviving bots, I thought you needed it for players, and yes, this code is a variation of the checkpoint system.CrazyDuck wrote: ↑Mon Oct 23, 2017 6:48 amYes , thank you . But I think you not fully understand what I mean... Your script is similar to the checkpoint script, but what I need is to make fighters like zombies, where to die and where to rise Please help me revise it again , Thank You!
By the way , my map has been completed, and now it's just need the script to make it work. It will be a really fun and creative map!
Do you need only to revive bots or both players and bots?
I'm talking about getting players to resurrect on their bodies, not checkpoints! Right on their dead bodys! It's in the dead place resurrection rather than teleport to the checkpoint! And when the body was destroyed, they would not revive, and that was the most important thing!
Code: Select all
const int RespawnSeconds = 5;
static List < DeadPlayer > DPlayersList = new List < DeadPlayer > ();
Events.PlayerDeathCallback m_playerDeathEvent = null;
Events.UpdateCallback m_updateEvent = null;
class DeadPlayer {
IProfile P_profile;
public IUser P_user;
public IPlayer P_body;
public float P_DeathTime = 0f;
PlayerTeam P_team;
public DeadPlayer(IPlayer player) {
P_profile = player.GetProfile();
P_user = player.GetUser();
P_DeathTime = Game.TotalElapsedGameTime;
P_body = player;
P_team = player.GetTeam();
}
public void Respawn() {
IPlayer pl = Game.CreatePlayer(P_body.GetWorldPosition());
pl.SetUser(this.P_user);
pl.SetProfile(this.P_profile);
pl.SetTeam(this.P_team);
this.P_body.Remove();
DPlayersList.Remove(this);
}
}
public void OnStartup() {
m_playerDeathEvent = Events.PlayerDeathCallback.Start(OnPlayerDeath);
m_updateEvent = Events.UpdateCallback.Start(OnUpdate, 0);
}
public void OnPlayerDeath(IPlayer player) {
if (!player.IsBot && !player.IsRemoved && DPlayersList.FirstOrDefault(s => s.P_user.UserID == player.GetUser().UserID) == null) {
DeadPlayer pl = new DeadPlayer(player);
DPlayersList.Add(pl);
}
}
public void OnUpdate(float elapsed) {
for (int i = 0; i < DPlayersList.Count; i++)
if (IsElapsed(DPlayersList[i].P_DeathTime, RespawnSeconds * 1000) && !DPlayersList[i].P_body.IsRemoved)
DPlayersList[i].Respawn();
}
public static bool IsElapsed(float TimeStarted, float TimeToElapse) {
if ((float)(Game.TotalElapsedGameTime - TimeStarted) >= TimeToElapse)
return true;
else
return false;
}
0 x