Extend Pocketmine Knowledge

Discussion in 'Resources' started by Defications2po, May 17, 2017.

  1. Defications2po

    Defications2po Witch

    Messages:
    54
    OK so am getting tired of having to come to pmmp everyday and asking questions and yet most of the people don't even help. Shout out to the people that do but what am saying is that if there's any way i can increase my knowledge of the Pocketmine API. I will do anything to achieve such knowledge. So am asking the GODS of coding to help me ehm *cough* *cough* @Muqsit @ImagicalGamer @JackNoordhuis @AppleDevelops @falk @dktapps @Lowkey @SOFe how did you guys get at such a higher level of Knowledge of the Pocketmine API it will be very helpful if u guys can tell me and other future dev's that are watching this thread right now what to do to acquire such Knowledge. You might even see us be big dev's in the community just because of what you told us to do in this thread:p.

    To all the Big dev's in the community
    Defi
     
    Lowkey and falk like this.
  2. xZeroMCPE

    xZeroMCPE Witch

    Messages:
    65
    GitHub:
    xZeroMCPE
    Knowledge is proud that they've learn'd so much.

    Therefore, they're not "gods". It's just Knowledge; from the things they've learned.
    Develop a passion, and use that to extend you're knowledge; by studying.
     
    corytortoise and Defications2po like this.
  3. SavionLegendZzz

    SavionLegendZzz Witch

    Messages:
    74
    GitHub:
    savionlegends
    Well since i am not noticed anymore i guess i could help you(i was once a big dev in the community). I think the best way to "expand" your knowledge about PocketMine's API and PHP in general is to code more., maybe do some commissions, make a plugin for the forums, etc. If you really wanted to you can make/join a github organization to work on repos with other people and maybe you can learn from them or teach them a thing or two.
     
    0x15f, Muqsit, Sandertv and 3 others like this.
  4. jasonwynn10

    jasonwynn10 Wither Skeleton Poggit Reviewer

    Messages:
    1,388
    GitHub:
    jasonwynn10
    If you truly want to become learned in the ways of PocketMine-MP, first you must gain common sense and use the search bar for your previously answered questions. Then, you have to learn as much as you can about generic PHP and OOP. Finally, you must memorize each of these pages: https://jenkins.pmmp.io/job/PocketMine-MP-doc/doxygen/annotated.html
     
  5. Sandertv

    Sandertv Skeleton Poggit Reviewer

    Messages:
    802
    GitHub:
    Sandertv
    Developing good plugins isn't something you learn in a single day, week, month or even longer, especially depending on how good you are at PHP. Developing plugins can't be learned through simply reading. Even reading EVERY tutorial on these and old PM forums would bring you almost nowhere further. The trick is to have an idea first. If you have a good idea for a plugin, you want to finish the plugin, no matter what it takes. Start writing the plugin, code everything you know and can, and when you come to a halt with something in the plugin, Poof! There's the entire (intyre) internet for you to browse and find answers. This way you learn things, you learn how to use them AND you remember them.

    Coding takes time. If you don't enjoy it, don't do it. It's very important you're driven to learn more. Also, it's a good idea to code a variety of plugins. Maybe something using databases, one using (async)tasks, a minigame plugin, anything works. Just keep challenging yourself and you'll find yourself getting better and better.
     
  6. falk

    falk Slime Poggit Reviewer

    Messages:
    75
    GitHub:
    falkirks
    I completely understand this. A lot of questions here are receiving very unhelpful answers that add nothing to the discussion. This was not always the case. I remember when I first joined, I wrote utterly awful code and couldn't explain my problems, but there were more experienced users who were patient and helped me learn. Sometimes people would critique me or say something harsh, but the overall sentiment was to help me learn. I want to help new developers like I was helped and ensure our community stays friendly and welcoming. I have no respect for "go google it" answers. None at all. They are a waste of space and provide no help for the person asking the question, they only serve to humiliate them and discourage them from learning. If someone comes here for help, they should get help in one way or another.

    You probably didn't need this rant, but I just wanted you to know that your not alone in being tired of this.


    By messing up a lot and guessing and experimenting until things worked. By cutting and pasting code from existing plugins and trying my best to understand it. By asking questions when I didn't understand something. I did not sit down and read the documentation because I have always valued learning by hacking when it comes to programming. The only way I know I have mastered something is if I can set myself a complex task and succeed. Learning by reading manuals is boring and doesn't force you to understand.

    Also, I came into this community with existing PHP knowledge, and that was very helpful for me. Starting learning the PocketMine API without learning PHP (or another programming language) first, is going to be very difficult.
     
  7. Lowkey

    Lowkey Slime

    Messages:
    94
    Thanks for complimenting me, I do appreciate (but I am not a 'god').

    I see you working with commands, events and easier things. The best way to improve is to code stuff out of your comfort zone.
    Work with GUI's, tiles, task, spawning entities, NBT, complex arrays, creating your own version of a plugin (like EconomyAPI) without copy-pasting.

    I do remember being in the same position as you. I hope you excel in the future and best of luck!
     
  8. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    740
    GitHub:
    dktapps
    Read the source code, read the documentation, read plugin source code, read all the things.

    The way I learned was to take someone else's code, mess with it to make it do something different, and then fix it when it breaks.

    The best way to learn is by doing it yourself. Experiment, find what works and what doesn't, read docs if you get stuck. Docs can be tedious though, so I don't recommend reading the entire manual before you get started, you'll just get bored and likely won't understand what you're reading until you mess with other stuff.

    Oh, and don't be scared of things crashing: a crash tells you you've made a mistake, where it came from, and usually make it pretty obvious what you need to fix. In other words, don't be scared to make mistakes, just do stuff and learn.
     
  9. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,894
    GitHub:
    sof3
    When you begin, you should aim for making it work. But when you advance, try to aim for making something that you understand. Something that may or may not work, but that you understand the whole thing from the abstract level to every single byte, looking at both the big things and small things. Ask yourself why it is every time you type something. Ask yourself if there are other ways to do it, and why this is better. Repeat this process until you can write code without asking yourself why, because you've thought of it so many times and you don't need to think about it again because you already recited your minds flow. Then try to look at different people's code doing the same thing and compare.
     
    Defications2po, jasonwynn10 and Awzaw like this.
  10. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,159
    GitHub:
    Thunder33345
    i dont consider myself big or anything but maybe some level of decency, my opinion is:

    stable your foundation of [normal] PHP, try coding websites commandline apps or anything with PHP for fun or profit, just go it to increase your knowledge and to get use to it, also try to use/understand all the things PHP provide(like "yield" statement a rarely used thing here) without going into OOP

    then stable your OOP foundation, doing things with OOP PHP making anything, just to get yourself used to OOP, this time tho, try to use/understand everything PHP has to offer, it never hurts to have a few more tools in your tool belt, you could also help with understanding things like interface, extend implement, and what these actually is and does, you could also learn design patterns, like "singelton", "fluent express" and so on

    finally you could attempt to understand PMMP, dont just blindly call "$this->getServer()->getPluginManager()->registerEvents($this,$this);" without knowing what it does, start reading it's source code for that function, you may never know some cool stuff PHP can do(hint: there's something "cool" inside registerEvents) also like why every plugin starts with "something extends PluginBase" not something else, now you mostly are all set able to understand PMMP fully

    some people may say, why do i need to care on PHP or OOP isnt that just a waste of time if we want to write PMMP plugins?
    a great answer would be building a pyramid of card, you dont just build the top part without a proper foundation, if you do it will all just tumbler apart, wasting your time eventually if you keep trying it that way, i am not saying it's impossible but it's kinda the harder route, remember PMMP is written on top of PHP and OOP trying to build on it will require PHP and OOP, PMMP did not invent it's own language for plugins it just borrowed PHP and OOP

    an IDE could help you, to speed up your process on trial and error so you dont spend 70% of your time coding wasted in finding that syntax error

    the first two part can be done together if you wish, generally i was saying just discover everything PHP has to offer and play around with it, understand it

    you should also incorporate ideas of others which i wont repeat here but they have good points of their own

    Sorry if this is kinda wordy and very very long

    I will end mine with this quote off a game
     
    Defications2po, 0x15f, Lowkey and 2 others like this.
  11. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    296
    GitHub:
    TheDiamondYT1
    I wouldnt call myself no expert, but im decent enough.

    I will tell you how i learnt JavaScript, Java, C# and PHP. I know they are different things, but i learnt the languages the same way

    Everyone has heard of ModPE, right? I wanted to have a crack at that. I was 11 at the time (14 now) and this was after i had been playing around with AppShed on my iPod. My first ModPE mod. Gradually i got better (but not great). I was inspired to lewrn Java then.

    There once was a project named RedstoneLamp (original repo deleted). I was completely new to Java at this time. I knew the absolute basics. I tried implementing some things (like this) but i was really bad at it. I made a Gitter account and joined the chat. I learn some things from the developer because he kept correcting me when i asked for help. I eventually got banned from the repo after learning some basics and spamming xD I then turned to Android development. Downloaded AIDE on my phone and gave it my best. I learnt alot from StackOverflow, as you will too.

    I found out about MiNET, and thought i'd give it a shot. I knew barely anything about C#. I didnt evem have visual studio. I used AIDE and made this PR. Okay, so that isint the worst code in the world but still, i jumped in at the deep end and guess what!

    [​IMG]
    I was banned.

    This was after i had learnt a bit of PHP from working on server networks such as ExplosivePE (later known as EnderPixel) and DarkRealms. I cant really explaim how i learnt PHP, because i cant remember. Im guessing i just looked at plugin source and looked at the PocketMine source code. I asked alot of dumb questions and tried to help people when i didnt even know myself. However, which a bit of practice and copying i got through. I learnt the basics of PHP. If you want to know what a function is, search the PHP docs on php.net! It helps! Just recently i learnt about the vsprintf function which is the same as sprintf but allows an array as the second parameter. Basically what im saying it look at the source code of plugins and the server itself. heres a good place to start: https://github.com/search?l=PHP&q=pocketmine+plugin&type=Repositories&utf8=✓

    I guess ive always had a good memory for things that i dont need. Thats why i like piano, i find it easy to remember :p

    You're making plugins for a server software for a game. Have fun with it, copy some peoples code and dont claim it as your own, just dont piss everyone off in the process.
     
  12. Muqsit

    Muqsit Chicken

    Messages:
    1,554
    GitHub:
    muqsit
    You need to cough a bit more before tagging me. I am not even close to being called a professional. Most of the time I have to google up php functions just to find out the order of the parameters/arguments.
    For example, I get confused a lot while using the in_array function.. Is it supposed to be in_array(array, value) or in_array(value, array)?
    That's just one of the functions..!

    If you go through my GitHub profile, you'll find out how I am moving from non OOP styling to OOP styling (don't go through my old repos please :oops:). Yeah, not a big deal but I used to think more files/objects = more time for code to execute (thats somewhat right to an extent though).
     
    jasonwynn10 and Thunder33345 like this.
  13. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    296
    GitHub:
    TheDiamondYT1
    That's true for webpages
     
    Muqsit likes this.
  14. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    740
    GitHub:
    dktapps
    lol, you're not alone... PHP functions are inconsistent af. I can never remember the parameter order for explode(). php.net comes in useful frequently.
     
  15. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,894
    GitHub:
    sof3
    Protip:
    Code:
    in       array
    (inside) (array)                           (in_array($inside, $array))
    (string) (the substring at that position) (strpos($string, $substr))
    str      pos
     
    Last edited: May 18, 2017
  16. Muqsit

    Muqsit Chicken

    Messages:
    1,554
    GitHub:
    muqsit
    Whoa, that makes it a lot easier :p
     
    jasonwynn10 likes this.
  17. jasonwynn10

    jasonwynn10 Wither Skeleton Poggit Reviewer

    Messages:
    1,388
    GitHub:
    jasonwynn10
    We have a community of preachers...
     
  18. HimbeersaftLP

    HimbeersaftLP Chicken

    Messages:
    1,632
    GitHub:
    HimbeersaftLP
    ProProTip:

    Use an editor that shows the args lol
     
  19. 0x15f

    0x15f Baby Zombie

    Messages:
    145
    GitHub:
    0x15f
    I thought u were dead for a while, your twitter account was private and you never tweeted anything.

    #ReadTheDocs <-- Thats how I learned
     
    jasonwynn10 likes this.
  20. Lowkey

    Lowkey Slime

    Messages:
    94
    This thread deserves an award! I love how everyone is actually trying to help and explaining!
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.