EOSERV Forum > EOSERV > Rebirth system?
Page: << 1 >>
Rebirth system?
Author Message
Post #202456 Rebirth system?

Friend and I are trying to add rebirth to our server and we are both new to C++ :) we looked at one of the older rebirth systems from 2011 and we could not get it to work... We kind of think that it may have been because it was outdated does anyone know if their is a working one? Thanks a bunch!

---
Graphics Designer.
"I'll keep believing in the future, not caring if anyone laughs at me"
Hi : D I am me!
7 years, 11 weeks ago
Post #202457 Re: Rebirth system?

Find the level up code. Use the variable for level and do if level == 200 level = 0

(so when they are lvl 200 and want to level up, make it be level 0, and reset their exp to 0 too.) Then to keep track of your rebirths you need to record this data into your database... search how to add new tables to your database.

---
I not hacker

“Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its
whole life believing that it is stupid.” - Albert Einstein : Really Great Quote Ramy!
7 years, 11 weeks ago
Post #202460 Re: Rebirth system?

I stupidly forgot to backup my releases when switching sites. Had a few small Aoe/Rebirth and Pet codes about. I've got some spare time tonight though, I'll write up a small guide and edit this post later tonight for you^^

7 years, 11 weeks ago
Post #202461 Re: Rebirth system?

I believe yours was actually the one we looked at that would be so helpful of you thank you so so much! @Callum and Hacker_Alex

---
Graphics Designer.
"I'll keep believing in the future, not caring if anyone laughs at me"
Hi : D I am me!
7 years, 11 weeks ago
Post #202462 Re: Rebirth system?

@Callum

Any guide for rebirth and all of the features you described, would be very much appreciated! I would love to implement them all.

You are the man. Thank you so much!

---
Just your friendly neighborhood Programmer-Man!
7 years, 11 weeks ago
Post #202466 Re: Rebirth system?

I've written up a quick code and updated my old post here

It's a very basic system and I've tried explaining it step by step! if you have any problems with it let me know and I'll try fix them

I've added a command for it too, but I haven't gone into detail with it as you'd need a command handler etc.. Hope the code works tho!

7 years, 11 weeks ago
Post #202468 Re: Rebirth system?

@Callum

Thank you so much! I was able to implement Rebirth with your instructions.

The code and instructions were very helpful to get me started. I feel like there was some code missing, so I made some changes to the instructions, if you are interested:

http://www.shilocity.com/site/sharex/Rebirth.txt


I'll explain the changes I made:

- In Character.CPP, the rebirth count needs to be saved into the database:

For example:


- Next, the Rebirth function needs to have the log below all the code, and for extra customizability, I added a "RebirthLevelStart" variable in the config file. I also set the experience based on the level and the experience table:


- In rebirth.ini, I added the following value:


- Last but not least, the rebirth command handler needs to also send out a packet to update the exp/level on the client in realtime:


- It might be worth mentioning in the tutorial, that the user will need to add a "Rebirth" column in the database. I forgot to add that into your tutorial.

---

I am having one major problem: In some cases, the client doesn't seem to handle the packets correctly when you set the level to 0 (via RebirthLevelStart). Anything above 0 works fine.

When leveing up/rebirthing from an NPC kill, it will successfully set your level and exp to 0.

But if you level up/rebirth via an EXP/Reward item (Or via the #rebirth or $rebirth command), it wont actually update the level on the client. It requires logging off and back on to update to the current level of 0.

I also confirmed that this bug is also with "$setlevel Username 0". It also requires a re-log.

To top it all off, there's even more desyncing happening with the core client and core server code:

If you use "$setlevel Username X" either the server doesn't send the correct packet, or the client doesn't handle it properly, because it also resets "St.pts", "Sk.pts", and "TNL" all reset to 0. So they don't show the correct value.

The above problem also happens with "rebirth" command handler. It doesn't happen when rebirthing via EXP/reward items though.

I am still new to this all, so I'm not exactly should how to build the packets correctly. Do you know how I might change the packet in the "rebirth" command, so that it can sync the Client correctly when using level 0 as the rebirth start. Also there must be a way to send a proper packet so it doesn't have the client reset "St.pts", "Sk.pts", and "TNL".

----

I really appreciate your help! It means a lot and I hope to see more of your tutorials. :D

---
Just your friendly neighborhood Programmer-Man!
7 years, 11 weeks ago
Post #202470 Re: Rebirth system?
Shilo posted: (15th Feb 2017, 04:54 am)

@Callum

Thank you so much! I was able to implement Rebirth with your instructions.

The code and instructions were very helpful to get me started. I feel like there was some code missing, so I made some changes to the instructions, if you are interested:

http://www.shilocity.com/site/sharex/Rebirth.txt


I'll explain the changes I made:

- In Character.CPP, the rebirth count needs to be saved into the database:

For example:


- Next, the Rebirth function needs to have the log below all the code, and for extra customizability, I added a "RebirthLevelStart" variable in the config file. I also set the experience based on the level and the experience table:


- In rebirth.ini, I added the following value:


- Last but not least, the rebirth command handler needs to also send out a packet to update the exp/level on the client in realtime:


- It might be worth mentioning in the tutorial, that the user will need to add a "Rebirth" column in the database. I forgot to add that into your tutorial.

---

I am having one major problem: In some cases, the client doesn't seem to handle the packets correctly when you set the level to 0 (via RebirthLevelStart). Anything above 0 works fine.

When leveing up/rebirthing from an NPC kill, it will successfully set your level and exp to 0.

But if you level up/rebirth via an EXP/Reward item (Or via the #rebirth or $rebirth command), it wont actually update the level on the client. It requires logging off and back on to update to the current level of 0.

I also confirmed that this bug is also with "$setlevel Username 0". It also requires a re-log.

To top it all off, there's even more desyncing happening with the core client and core server code:

If you use "$setlevel Username X" either the server doesn't send the correct packet, or the client doesn't handle it properly, because it also resets "St.pts", "Sk.pts", and "TNL" all reset to 0. So they don't show the correct value.

The above problem also happens with "rebirth" command handler. I can only assume it also happens when you rebirth via an experience/reward item, since they share the same problem when trying to rebirth to level 0.

I am still new to this all, so I'm not exactly should how to build the packets correctly. Do you know how I might change the packet in the "rebirth" command, so that it can sync the Client correctly when using level 0 as the rebirth start. Also there must be a way to send a proper packet so it doesn't have the client reset "St.pts", "Sk.pts", and "TNL".

----

I really appreciate your help! It means a lot and I hope to see more of your tutorials. :D


lmao wow, I sorta feel like you bragged about changed then posted saying they didn't work underneath xd..

But yeah, the main reason I didn't add the changed you did is cause It wasn't suppose to give you an option to set a start level, the point was to have a rebirth(back to level 0). It did originally go back to level 0 but then the Reward Items didn't update the client:

reply.AddChar(level_up ? character->level : 0);

Tbh it was me being lazy as I didn't think it mattered if the player was level 0 or 1. I only really made the command as a guide, eoserv doesn't support player commands so I assumed if someone added them in they'd be able to make the command.

There's one thing I did forget about and that is to update the resetting of stats to account for the extra levels in the rebirth. I'll update that sometime tomorrow!

EDIT: I actually forgot to add the rebirth value in the save function to the tutorial, I'll add that too.

7 years, 11 weeks ago
Post #202471 Re: Rebirth system?
callum posted: (15th Feb 2017, 05:45 am)

Shilo posted: (15th Feb 2017, 04:54 am)

@Callum

Thank you so much! I was able to implement Rebirth with your instructions.

The code and instructions were very helpful to get me started. I feel like there was some code missing, so I made some changes to the instructions, if you are interested:

http://www.shilocity.com/site/sharex/Rebirth.txt


I'll explain the changes I made:

- In Character.CPP, the rebirth count needs to be saved into the database:

For example:


- Next, the Rebirth function needs to have the log below all the code, and for extra customizability, I added a "RebirthLevelStart" variable in the config file. I also set the experience based on the level and the experience table:


- In rebirth.ini, I added the following value:


- Last but not least, the rebirth command handler needs to also send out a packet to update the exp/level on the client in realtime:


- It might be worth mentioning in the tutorial, that the user will need to add a "Rebirth" column in the database. I forgot to add that into your tutorial.

---

I am having one major problem: In some cases, the client doesn't seem to handle the packets correctly when you set the level to 0 (via RebirthLevelStart). Anything above 0 works fine.

When leveing up/rebirthing from an NPC kill, it will successfully set your level and exp to 0.

But if you level up/rebirth via an EXP/Reward item (Or via the #rebirth or $rebirth command), it wont actually update the level on the client. It requires logging off and back on to update to the current level of 0.

I also confirmed that this bug is also with "$setlevel Username 0". It also requires a re-log.

To top it all off, there's even more desyncing happening with the core client and core server code:

If you use "$setlevel Username X" either the server doesn't send the correct packet, or the client doesn't handle it properly, because it also resets "St.pts", "Sk.pts", and "TNL" all reset to 0. So they don't show the correct value.

The above problem also happens with "rebirth" command handler. I can only assume it also happens when you rebirth via an experience/reward item, since they share the same problem when trying to rebirth to level 0.

I am still new to this all, so I'm not exactly should how to build the packets correctly. Do you know how I might change the packet in the "rebirth" command, so that it can sync the Client correctly when using level 0 as the rebirth start. Also there must be a way to send a proper packet so it doesn't have the client reset "St.pts", "Sk.pts", and "TNL".

----

I really appreciate your help! It means a lot and I hope to see more of your tutorials. :D


lmao wow, I sorta feel like you bragged about changed then posted saying they didn't work underneath xd..

But yeah, the main reason I didn't add the changed you did is cause It wasn't suppose to give you an option to set a start level, the point was to have a rebirth(back to level 0). It did originally go back to level 0 but then the Reward Items didn't update the client:

reply.AddChar(level_up ? character->level : 0);

Tbh it was me being lazy as I didn't think it mattered if the player was level 0 or 1. I only really made the command as a guide, eoserv doesn't support player commands so I assumed if someone added them in they'd be able to make the command.

There's one thing I did forget about and that is to update the resetting of stats to account for the extra levels in the rebirth. I'll update that sometime tomorrow!

EDIT: I actually forgot to add the rebirth value in the save function to the tutorial, I'll add that too.


I'm sorry. My intent was never to brag. There's no reason for any bragging.

Quote:

"There's one thing I did forget about and that is to update the resetting of stats to account for the extra levels in the rebirth. I'll update that sometime tomorrow!

EDIT: I actually forgot to add the rebirth value in the save function to the tutorial, I'll add that too."


That's actually the only thing I was referring to when I mentioned missing code (along with the command function). I understand that you tossed it together to help us out and I appreciate it!


My changes to the Rebirth function was just to contribute to the tutorial and community.


Thank you for all your help!

---
Just your friendly neighborhood Programmer-Man!
7 years, 11 weeks ago
Post #202472 Re: Rebirth system?

Apologies for my friend I told him thats what it sounded like! I am very sorry.... we are very thankful for your code it helped us get started and we were very confused on where to even begin and we started adding onto it on what we wanted so I am very glad you helped us thank you very very much!

---
Graphics Designer.
"I'll keep believing in the future, not caring if anyone laughs at me"
Hi : D I am me!
7 years, 11 weeks ago
Page: << 1 >>

EOSERV Forum > EOSERV > Rebirth system?