Hello all, I have been here in the community passively just reading posts and learning from other people who share their knowledge. It has been nearly a month now since I started to learn to code in C# through making a private server (Redux). I already know other languages Python, PHP and I know how to work with databases (MySQL). I have been lurking the Redux forum and it really has MASSIVE information shared which could be really helpful to beginners like myself.
what is the purpose?
After many trials (not saying that its hard, I am a noob as I said), I managed to make a working Arrow Auto Equip system although it is not near to perfect but it does what we need it to do in that case removing finished pack of arrows, correctly replacing the new one and deleting the old one.
I will post the code below but before I do that I need to thank so many people who shared their valuable knowledge for the community to learn from. I do not take any credit for this at all. In fact, I learned a lot and would like to specially thank Spirited and Pro4Never even though he is banned, and Many other people who shared Mina, Turk55. so credit and thanks goes to all people who shared to the community.
Also I am open for corrections to the code. it would be really helpful, consider me your student. but what is not helpful is any negative attitudes.
what I made is in players.cs I made a definition
Then in Combat Manager (this part after the bool hasitem= was first made as a not working outline by ETERU).
so then replaced the "//Take arrow count code region" with this.. now we are using the auto equip arrow and reassigning different id if arrows are different..
As you can see I am checking if the dura(count of arrows) is <=3 not checking if its 0, that is because this function in combat manager is only accessible when doing a skill not when using only one arrow maybe there is another function for using one arrow so i can use the same method of reload in it. but i am using <=3 because if it goes to 1 then it doesn't reload at all. for 2 reasons
1- the scatter doesn't work when having only 1 arrow
2- as i said if no scatter then your option is to hit only one arrow and then the method isn't accessed so you are left with 0 arrows.
i got around it by adding the <=3 so when it reduces to 3 it reloads and remove the possibility that it reaches 1. idk if i messed up in this part but i guess i did.
Thanks ElitePVPers for giving helping us learn coding!!
Thanks Spirited, Pro4Never..
Thanks all..
If I am on the right track I hope I will contribute more in the future.
what is the purpose?
After many trials (not saying that its hard, I am a noob as I said), I managed to make a working Arrow Auto Equip system although it is not near to perfect but it does what we need it to do in that case removing finished pack of arrows, correctly replacing the new one and deleting the old one.
I will post the code below but before I do that I need to thank so many people who shared their valuable knowledge for the community to learn from. I do not take any credit for this at all. In fact, I learned a lot and would like to specially thank Spirited and Pro4Never even though he is banned, and Many other people who shared Mina, Turk55. so credit and thanks goes to all people who shared to the community.
Also I am open for corrections to the code. it would be really helpful, consider me your student. but what is not helpful is any negative attitudes.
what I made is in players.cs I made a definition
Then in Combat Manager (this part after the bool hasitem= was first made as a not working outline by ETERU).
so then replaced the "//Take arrow count code region" with this.. now we are using the auto equip arrow and reassigning different id if arrows are different..
As you can see I am checking if the dura(count of arrows) is <=3 not checking if its 0, that is because this function in combat manager is only accessible when doing a skill not when using only one arrow maybe there is another function for using one arrow so i can use the same method of reload in it. but i am using <=3 because if it goes to 1 then it doesn't reload at all. for 2 reasons
1- the scatter doesn't work when having only 1 arrow
2- as i said if no scatter then your option is to hit only one arrow and then the method isn't accessed so you are left with 0 arrows.
i got around it by adding the <=3 so when it reduces to 3 it reloads and remove the possibility that it reaches 1. idk if i messed up in this part but i guess i did.
Thanks ElitePVPers for giving helping us learn coding!!
Thanks Spirited, Pro4Never..
Thanks all..
If I am on the right track I hope I will contribute more in the future.