OK.... i have been through this tutorial and i am at the very end where it gets u to add armor and weapons. got it all put in to where it should work then it says
loading tutorial.dme
tutorial.dm:63:error:sword :undefined proc
tutorial.dm:73:error::missing expression
tutorial.dm:80:error::missing expression
tutorial.dm:64:Get :warning: unused label
tutorial.dm:68:Drop :warning: unused label
tutorial.dm:72:Equip :warning: unused label
tutorial.dm:79:Unequip :warning: unused label
tutorial.dm:87:error:armor :undefined proc
tutorial.dm:97:error::missing expression
tutorial.dm:104:error::missing expression
tutorial.dm:88:Get :warning: unused label
tutorial.dm:92:Drop :warning: unused label
tutorial.dm:96:Equip :warning: unused label
tutorial.dm:103:Unequip :warning: unused label
tutorial.dmb - 6 errors, 8 warnings (double-click on an error to jump to it)
i cant figure out wtf is wrong. here is the code will somebody please help i have spent about 5 hours on this alrdy. im adding in the tabs so it will be easier for yall to see
world
name = "My First Game."
turf = /turf/grass
view = 5
turf
grass
icon = 'person.dmi'
icon_state = "grass"
water
icon = 'person.dmi'
icon_state = "water"
density = 1
mob
Login()
usr.icon_state = input("What Gender?") in list ("Male","Female")
usr.Move(locate(1,1,1))
icon = 'Person.dmi'
var
//**STATUS**
maxhp = 10
hp = 10
str = 5
def = 2
//**Armor**
armor_equipped = 0
weapon_equipped = 0
Stat()
statpanel("Status")
stat("Health", "[num2text(hp,50)]/[num2text(maxhp,50)]")
stat("Strength", "[num2text(str,50)]")
stat("Defense", "[num2text(def,50)]")
verb
Add_Strength(msg as num)
usr.str += msg
Attack(mob/M as mob in oview(1))
var/damage = usr.str - M.def
if(damage <= 0)
usr << "[M] Easily dodges your attack!"
M << "You easily dodge [usr] attack."
else
M.hp -= damage
view() << "[usr] attacks u [M] for [damage] damage!"
M:deathcheck()
proc
deathcheck()
if(src.hp <= 0)
view() << "[src] dies!"
src.hp = "[maxhp]"
src.Move(locate(1,1,1))
usr.str += 1
usr.def += 1
obj
sword()
Get
set src in oview(1)
usr.contents += src
view() << "[usr] picks up \a [src]"
Drop
new/obj/sword(usr.loc)
view() << "[usr] drops \a [src]"
del(src)
Equip
if(usr.weapon_equipped = 0)
usr.str += 2
usr.weapon_equipped = 1
usr << "[usr] equipes a sword."
else
usr << "You are alrdy weilding a sword"
Unequip
if(usr.weapon_equipped = 1)
usr.str -= 2
usr.weapon_equipped = 0
view() << "[usr] unequips a sword."
else
usr << "You aren't wielding this."
armor()
Get
set src in oview(1)
usr.contents += src
view() << "[usr] picks up \a [src]"
Drop
new/obj/armor(usr.loc)
view() << "[usr] drops \a [src]"
del(src)
Equip
if(usr.armor_equipped = 0)
usr.def += 2
usr.armor_equipped = 1
usr << "[usr] wears some armor."
else
usr << "You are already wearing something."
Unequip
if(usr.armor_equipped = 1)
usr.def -= 2
usr.armor_equipped = 0
view() << "[usr] takes off some armor."
else
usr << "You aren't wearing this."
1
2
ID:170659
Dec 29 2004, 11:42 am
|
|
In response to Foomer
|
|
ok, here is the new code and what its telling me now.
world name = "My First Game." turf = /turf/grass view = 5 turf grass icon = 'person.dmi' icon_state = "grass" water icon = 'person.dmi' icon_state = "water" density = 1 mob Login() usr.icon_state = input("What Gender?") in list ("Male","Female") usr.Move(locate(1,1,1)) icon = 'Person.dmi' var //**STATUS** maxhp = 10 hp = 10 str = 5 def = 2 //**Armor** armor_equipped = 0 weapon_equipped = 0 Stat() statpanel("Status") stat("Health", "[num2text(hp,50)]/[num2text(maxhp,50)]") stat("Strength", "[num2text(str,50)]") stat("Defense", "[num2text(def,50)]") verb Add_Strength(msg as num) usr.str += msg Attack(mob/M as mob in oview(1)) var/damage = usr.str - M.def if(damage <= 0) usr << "[M] Easily dodges your attack!" M << "You easily dodge [usr] attack." else M.hp -= damage view() << "[usr] attacks u [M] for [damage] damage!" M:deathcheck() proc deathcheck() if(src.hp <= 0) view() << "[src] dies!" src.hp = "[maxhp]" src.Move(locate(1,1,1)) usr.str += 1 usr.def += 1 obj sword Get() set src in oview(1) usr.contents += src view() << "[usr] picks up \a [src]" Drop() new/obj/sword(usr.loc) view() << "[usr] drops \a [src]" del(src) Equip() if(usr.weapon_equipped = 0) usr.str += 2 usr.weapon_equipped = 1 usr << "[usr] equipes a sword." else usr << "You are alrdy weilding a sword" Unequip() if(usr.weapon_equipped = 1) usr.str -= 2 usr.weapon_equipped = 0 view() << "[usr] unequips a sword." else usr << "You aren't wielding this." armor Get() set src in oview(1) usr.contents += src view() << "[usr] picks up \a [src]" Drop() new/obj/armor(usr.loc) view() << "[usr] drops \a [src]" del(src) Equip() if(usr.armor_equipped = 0) usr.def += 2 usr.armor_equipped = 1 usr << "[usr] wears some armor." else usr << "You are already wearing something." Unequip() if(usr.armor_equipped = 1) usr.def -= 2 usr.armor_equipped = 0 view() << "[usr] takes off some armor." else usr << "You aren't wearing this." and its telling me this loading tutorial.dme tutorial.dm:72:error:Equip :undefined proc tutorial.dm:73:error::missing expression tutorial.dm:79:error:Unequip :undefined proc tutorial.dm:80:error::missing expression tutorial.dm:96:error:Equip :undefined proc tutorial.dm:97:error::missing expression tutorial.dm:103:error:Unequip :undefined proc tutorial.dm:104:error::missing expression tutorial.dm:64:error:Get :undefined proc tutorial.dm:68:error:Drop :undefined proc tutorial.dm:88:error:Get :undefined proc tutorial.dm:92:error:Drop :undefined proc tutorial.dmb - 12 errors, 0 warnings (double-click on an error to jump to it) |
In response to Odine
|
|
Put proc before your procs.
|
In response to Hell Ramen
|
|
sorry... complete newb here, that would be where?
|
In response to Odine
|
|
obj |
In response to Hell Ramen
|
|
They are supposed to be verbs arn't they?
|
In response to Hell Ramen
|
|
thanks, that fixed alot of my problems now its telling me i have 4 errors left that i dont get why it is saying. here is the code
world name = "My First Game." turf = /turf/grass view = 5 turf grass icon = 'person.dmi' icon_state = "grass" water icon = 'person.dmi' icon_state = "water" density = 1 mob Login() usr.icon_state = input("What Gender?") in list ("Male","Female") usr.Move(locate(1,1,1)) icon = 'Person.dmi' var //**STATUS** maxhp = 10 hp = 10 str = 5 def = 2 //**Armor** armor_equipped = 0 weapon_equipped = 0 Stat() statpanel("Status") stat("Health", "[num2text(hp,50)]/[num2text(maxhp,50)]") stat("Strength", "[num2text(str,50)]") stat("Defense", "[num2text(def,50)]") verb Add_Strength(msg as num) usr.str += msg Attack(mob/M as mob in oview(1)) var/damage = usr.str - M.def if(damage <= 0) usr << "[M] Easily dodges your attack!" M << "You easily dodge [usr] attack." else M.hp -= damage view() << "[usr] attacks u [M] for [damage] damage!" M:deathcheck() proc deathcheck() if(src.hp <= 0) view() << "[src] dies!" src.hp = "[maxhp]" src.Move(locate(1,1,1)) usr.str += 1 usr.def += 1 obj sword proc Get() set src in oview(1) usr.contents += src view() << "[usr] picks up \a [src]" Drop() new/obj/sword(usr.loc) view() << "[usr] drops \a [src]" del(src) Equip() if(usr.weapon_equipped = 0) usr.str += 2 usr.weapon_equipped = 1 usr << "[usr] equipes a sword." else usr << "You are alrdy weilding a sword" Unequip() if(usr.weapon_equipped = 1) usr.str -= 2 usr.weapon_equipped = 0 view() << "[usr] unequips a sword." else usr << "You aren't wielding this." armor proc Get() set src in oview(1) usr.contents += src view() << "[usr] picks up \a [src]" Drop() new/obj/armor(usr.loc) view() << "[usr] drops \a [src]" del(src) Equip() if(usr.armor_equipped = 0) usr.def += 2 usr.armor_equipped = 1 usr << "[usr] wears some armor." else usr << "You are already wearing something." Unequip() if(usr.armor_equipped = 1) usr.def -= 2 usr.armor_equipped = 0 view() << "[usr] takes off some armor." else usr << "You aren't wearing this." here are the errors loading tutorial.dme tutorial.dm:75:error::missing expression tutorial.dm:82:error::missing expression tutorial.dm:100:error::missing expression tutorial.dm:107:error::missing expression tutorial.dmb - 4 errors, 0 warnings (double-click on an error to jump to it) |
Your code should look like this:
world |
In response to Odine
|
|
Change proc to verb, they are supposed to be verbs, and show us what line it is giving you missing expression on.
|
In response to Skye Reaver
|
|
You forgot to put another = :
Equip() That should fix the missing expressions. |
In response to Skye Reaver
|
|
ok i changed it to verb. and here is what it says now. im not going to post the code again just the error and the code it reffers to
tutorial.dm:74:error::missing expression if(usr.weapon_equipped = 0) tutorial.dm:81:error::missing expression if(usr.weapon_equipped = 1) tutorial.dm:99:error::missing expression if(usr.armor_equipped = 0) tutorial.dm:106:error::missing expression if(usr.armor_equipped = 1) thats the errors. better yet ill give the whole code just incase u need it and i wont have to post again world name = "My First Game." turf = /turf/grass view = 5 turf grass icon = 'person.dmi' icon_state = "grass" water icon = 'person.dmi' icon_state = "water" density = 1 mob Login() usr.icon_state = input("What Gender?") in list ("Male","Female") usr.Move(locate(1,1,1)) icon = 'Person.dmi' var //**STATUS** maxhp = 10 hp = 10 str = 5 def = 2 //**Armor** armor_equipped = 0 weapon_equipped = 0 Stat() statpanel("Status") stat("Health", "[num2text(hp,50)]/[num2text(maxhp,50)]") stat("Strength", "[num2text(str,50)]") stat("Defense", "[num2text(def,50)]") verb Add_Strength(msg as num) usr.str += msg Attack(mob/M as mob in oview(1)) var/damage = usr.str - M.def if(damage <= 0) usr << "[M] Easily dodges your attack!" M << "You easily dodge [usr] attack." else M.hp -= damage view() << "[usr] attacks u [M] for [damage] damage!" M:deathcheck() proc deathcheck() if(src.hp <= 0) view() << "[src] dies!" src.hp = "[maxhp]" src.Move(locate(1,1,1)) usr.str += 1 usr.def += 1 obj sword verb Get() set src in oview(1) usr.contents += src view() << "[usr] picks up \a [src]" Drop() new/obj/sword(usr.loc) view() << "[usr] drops \a [src]" del(src) Equip() if(usr.weapon_equipped = 0) usr.str += 2 usr.weapon_equipped = 1 usr << "[usr] equipes a sword." else usr << "You are alrdy weilding a sword" Unequip() if(usr.weapon_equipped = 1) usr.str -= 2 usr.weapon_equipped = 0 view() << "[usr] unequips a sword." else usr << "You aren't wielding this." armor verb Get() set src in oview(1) usr.contents += src view() << "[usr] picks up \a [src]" Drop() new/obj/armor(usr.loc) view() << "[usr] drops \a [src]" del(src) Equip() if(usr.armor_equipped = 0) usr.def += 2 usr.armor_equipped = 1 usr << "[usr] wears some armor." else usr << "You are already wearing something." Unequip() if(usr.armor_equipped = 1) usr.def -= 2 usr.armor_equipped = 0 view() << "[usr] takes off some armor." else usr << "You aren't wearing this." |
In response to Odine
|
|
I just told you how to fix that, where the ifs(weapon/armor_equipped = 1/0) make that == , not =
|
In response to Skye Reaver
|
|
thanks your a life saver... 1 question why do i need to use == and not =? that hasnt been even mentions in 1 tutorial
|
In response to Odine
|
|
if you're checking to see if something is equal to something else you need ==. If you are setting something to something else you need =.
|
In response to Artekia
|
|
o... wish people would put that in there tutorial somewhere...
|
In response to Odine
|
|
Well, I guess he just forgot to put it, I forget to put double = all the time, == means if [A] and [B] are equal, = MAKES [A] and [B] equal.
|
In response to Odine
|
|
You might not know....But you can push F1 while in Dream Maker and type in what you need help on, and if the topic is there, it will tell you alot about it.
|
In response to Skye Reaver
|
|
nvm its in the tutorial right he just never went over it. i mussed of glimpsed at it and considerd it an error and just put it in with 1 = since i dont copy and paste
|
1
2
You've got the () thing backwards. You've got it like this:
obj
sword()
Get
Drop
Equip
Unequip
It should be like this:
obj
sword
Get()
Drop()
Equip()
Unequip()
Since only procs have arguments (in parenthasis), not object defenitions.