ID:181756
![]() Sep 27 2009, 5:30 pm
|
|
I would like to know how other started there career into programing on Byond. I been at it for a few days and I learned quite a bit but yet I know i barely scratched the surface when I look through the DM Reference. So I was wondering if people can tell me how they started and what was the best ways they learned (that doesn't cost money, I JUST got a job and I'm poor. Anything will help so I would appreciate it.
|
What is a good way to spot a bad habit? oh and the complete startup guide is pretty useless... Google comes up with everything BUT byond coding..
|
The first article I saw was a byond coding guide, and I'd always wanted to do that so you got to be my guinea pig.
As for spotting bad coding it all comes down to what you already know, because if you don't know it's bad why would you consider it to be bad. When I said that I liked to study other people's code I meant after I already had a good basic knowledge of how DM syntax worked (DM reference/beginners articles). Once you know the basics of the syntax it gets pretty easy to spot stupid things that people do like usr abuse. The forums is a good way to find out if you're using bad practices it's filled with multiple people willing to help (for free)! |
Lol well I'm honored (I think). Well I'm having problems learning. See I read most of the guides for beginners but it only covers so much but when I look at someone else game the code is so complex that I get lost in moments.
|
Well ill post my testing sript:
mob icon = 'Player.dmi' //make it so all mobs will be created with the person icon Login() icon_state = gender //Icons state ..() //Gender of there key? Then call the parent? mob/proc/DeathCheck() //checks to see if an attack is deadly if (HP <= 0) //if the defender's HP is low enough... world << "[src] dies!" //do the death messaging src.HP += 10 src.Move = (locate(1,1,1)) mob/bug icon = 'bug.dmi' mob/bug/var HP = 30 // A variable named HP of 30 Str = 1 Def = 1 mob/verb say(msg as text) //what the usr says is passed into "msg" as text world << "[usr]: [msg]" //the world sees chatroom-like output attack(mob/M as mob in oview(1)) //attack a mob within 1 tile of you oview() << "[usr] attacks [M]!" //send this message to everybody else var/damage = usr.str - src.def //assign a random # to a new variable world << "[damage] damage!" //tell the damage to the world M.HP -= damage //take away the damage from M M.DeathCheck() mob/obj/gold icon = 'gold.dmi' mob/obj/gold/var amount turf/floor icon = 'floor.dmi' world turf = /turf/floor mob/ZerosaCessi icon = 'player.dmi' mob/ZerosaCessi/var HP = 100 str = 1 def = 1. Most of that I got from Z's tut but when i try doing my own things I get major errors |
mob what are you not getting about this script? and post what your attempting to do. |
Oh i'm sorry, I forgot to post the error!
loading Hello.dme Testworld.dm:10:error:HP:undefined var Testworld.dm:12:error:src.HP:undefined var Testworld.dm:13:error:src.Move:cannot assign a proc! Testworld.dm:31:error:usr.str:undefined var Testworld.dm:31:error:src.def:undefined var Testworld.dm:33:error:M.HP:undefined var That is what I get when I try to put some kind of stats in there. Also in a pervious post on the forums. I tried to figure out how to make my floor tiles generate randomly on the floor using the world/turf/floor then icon_state but that didn't seem to work. |
It is strongly suggested you don't "learn" from other people's code because 95% of source files that you'd be able to find are utter, utter, utter, UTTER trash. Unless you can learn by the process of elimination (just don't do everything you see and you'll only be left with what's right!) I suggest sticking to the guide and tutorials.
|
Aye I am, but the errors make no sence to me and i tried searching them up in the forms and that was no help :/.
|
Ominitsu wrote:
But the guides confuse me What exactly confuses you? And you might try and cooperate with AZA[link]. |
I started with a combination of reading the Guide and writing code. Excruciatingly poor code, but code nonetheless - the learning came from repeatedly rewriting stuff when I realised it was poorly written.
|
Thanks guys, my problem was that the code from DM guide was a little to dry and I had no idea what was going on until I read a few peoples guides that explained WHY this happen or WHAT makes this work. That was what was getting me but know after reading a few of the guides I seemed to understand the DM guide a bit better when I came back to it.
|
I am going to be very blunt with you. It seems to me that you have absolutely no clue what you are doing and want others to do work for you. That is not how thing work on these forums. You either do some work yourself or don't bother asking at all. Did you even attempt to read zilal's tutorial fully or the dm guide for that matter? or did you just copy and paste code.
on a side note an obj is not a mob. Why do you try to access it as such. This is the precedence chart taken directly from the dm guide area turf mob obj |
I started programming when I was 11 years old, and made crappy chicken games where the chickens could talk and thought it was amazing :)
I practiced with things for about 6 months, and then dropped coding. A few years later I picked it up again, read the blue book multiple times, and made more load of crap games, then dropped it again. A few years later (now I'm 16), I picked up on DM again and grasp things much easier than ever before, although I'm still a nublett. <-- I'm not exactly sure how to rate yourself? Probably. At least I can make almost anything I want now, with a little determination, a few questions on the forum, and some educated guessing :) If you look back on my history of the forums, you can see some of the retarded questions I asked- I think I became known as a "help vampire" at one point (which is a bad thing). |
Nate1123 wrote:
I think a few people wouldn't recommend this, but I like to study other peoples code to learn. This accompanied with the DM reference and other articles is a very good way to start. Just have to watch out for bad programming practices so they don't become your own habits Those guides don't help at all, they spend like 20 pages of text to tell you how to make an object have an icon, you'd be better off ripping apart game sources and basic libraries tbh |
FagTrax wrote:
I am going to be very blunt with you. It seems to me that you have absolutely no clue what you are doing and want others to do work for you. That is not how thing work on these forums. You either do some work yourself or don't bother asking at all. While it's nice to know that someone who has had a registered key on BYOND for an entire day gets the way that these forums work, you're actually quite wrong, and we're willing to give help to people that honestly don't know what they need to do. |
Here are the articles for beginners:
Beginner's Articles
This helps too:
Dream Maker Beginners - Complete Startup Guide