//This is a TestWorld created by Jason On March, idk about the day, 2008.
mob
icon = 'person.dmi'//New players will use this icon
bug
icon = 'bug.dmi'
obj
gold
icon = 'gold.dmi'
var
Hp = 30 //makes a new variable that sets user's hp at 30.
Login() //calls the login procedure
icon_state = gender //changes icon state to key accordingly
..() //calls the parent procedure which is original login
proc
Deadcheck() //declares a death proc
if (Hp <= 0)
world << "[src], dies"//tells world that the mod died.
del(src) //removes the corpse
verb
attack(mob/M as mob in oview(1)) //suppose to let you attack a mob that is 1 tile in front of you.
if (M.Hp <= 0)
usr << "[M], is already dead!"
else
usr << "you attack [M]" //lets user know who he is attacking
oview() << "[usr] attacks [M]" //tells the world what user attack what.
var/damage = rand(1,10) //sssigns a randomn value to damage variable.
world << "[damage],damage!" //relays damage to the rest of the world.
M.Hp -= damage //deducts damage from the mob
M.Deadcheck() //see if the mob is dead.
turf
grass//makes some grass prototype, not real grass.
icon = 'grass.dmi'
water //just added this here to refesh my memory
icon = 'water.dmi'
world //world characteristic
turf = /turf/grass//sets grass as default map thingy ( how should I know I can't code X_X )
Well I was going through Zilal's tutorial and while adding in her code to check if an npc is dead I get a crapload of errors. I spent 2 hours trying to figure it out to no fortune. This code is very similar to zilal's so you shouldn't have any real problems figuring it out. These are the errors im getting.
loading TestWorld.dme
TestWorld.dm:25:warning: empty 'else' clause
TestWorld.dm:13:error:Login :undefined proc
TestWorld.dm:23:error:M.Hp:undefined var
TestWorld.dm:23:if :warning: if statement has no effect
TestWorld.dm:25:error:else :invalid proc definition
TestWorld.dm:26:error:<< :invalid proc definition
TestWorld.dm:27:error:<< :invalid proc definition
TestWorld.dm:28:error:damage :invalid proc definition
TestWorld.dm:29:error:<< :invalid proc definition
TestWorld.dm:30:error:-= :invalid proc definition
TestWorld.dm:31:error:M :invalid proc definition
TestWorld.dm:17:error:Deadcheck :previous definition
TestWorld.dmb - 10 errors, 2 warnings (double-click on an error to jump to it)
You:
Zilal:
Also make sure that your indents are done using the Tab key, not spacebar. Pressing Ctrl+T in Dream Maker will help to distinguish between the two.
Hiead