ID:178150
 
I am going to try to make a game, and i don't want to use libraries, or want other people to code it for me.. id like people who know how to do that thing to teach me how to code correctly.. and to help me find out where undetectable bugs spring up and how to fix them please

- Ezrah.
EzrahChan wrote:
I am going to try to make a game, and i don't want to use libraries, or want other people to code it for me.. id like people who know how to do that thing to teach me how to code correctly.. and to help me find out where undetectable bugs spring up and how to fix them please

- Ezrah.

when you code, never do somthing like this

mob/verb/Test()
if(usr.Super == 1)
usr << "Your super!"
if(usr.Super1 == 1)
usr << "Your more super!"
if(usr.Super2 == 1)
usr << "Wow your super!"


Do somthing like this:

mob/verb/Test()
if(usr.Super == 1 || usr.Super1 == 1 || usr.Super2 == 1)
usr << "Your super!"


Login / Out.

mob
Login()
if(usr.key == "RaeKwon")
world << "Bow, RaeKwon has entered! O.o"
else
world << "[usr] entered."
Logout()
world << "[usr] leaves..."
del src


Basic Attack..

mob/verb/Attack(mob/M in oview(2))
var/damage = rand(1,str) // makes the damage accurate.
if(usr.str - M.defense > 0) // Subtracts damage for M's defense.
view() << "[usr] Attacked [M] for: [damage]"
M.DeathCheck() // Your deathCheck proc.
else
view() << "[usr] Bounced off [M] hahah!" // Cause your to week, they go to much defense



Now for HUD, appearing Objects on the screen.

Note for HUD: dont use layer = 1000 or whatever for HUD, may cause it to flicker, use layer = MOB_LAYER+5 // Or whatever you would like

Basic HUD code:

obj/Who
icon='icons1.dmi'// the icon
icon_state="who"//the icon state
layer=MOB_LAYER+1 // There we go, Layer!
New(client/C) // Client
screen_loc="12,1" // where you want the hud..
C.screen+=src // Located it on the screen
Click()
usr<<usr.Who() // Calls the who proc when clicked..


Don't forget to call it in Client/New as follows..

client
New()
..()
new/obj/Who(src)


Well, hope that explains some basic stuff.

RaeKwon
There is nothing wrong with using a library if it does what you need it to do, just make sure that your game adds something more than a collection of libraries. Examining well written libraries is a great way to learn how to code.

My rule of thumb for quickly judging if a library is worth learning from: If they can't describe it with proper English, they're too lazy to write properly in DM.
It depends on what you are making, what are you making?
In response to Ter13
an rpg, im influenced my several things.
1.the old ultimas (god i love those games.. i have like all of them :P)

2. UO

3. My stories

4. The book "At Winter's End"

several other things..

i liked the level of interactivity in the Ultima series, my stories tend to focus on interpersonal relationships, economic/militairy/political/racial conflicts and drives. (racial conflict as in more then 2 species in a conflict.. both allying and waring with one another.)