ID:263441
 
Code:
var/usr/atk
var/usr/def
var/usr/calcatk
var/usr/weapons = 1
var/usr/armor = 1
var/usr/gladname/
var/usr/level
var/usr/life
var/usr/losses
var/usr/victories


usr/proc/calculate()
atk = rand(1,20)
atk += weapons*5
life = 100
def = armor*5

proc
battle(one,two)
loop
one.calculate()
two.calculate())
one.atk - two.def
two.atk - one.def
one.life - two.atk
two.life - one.atk
if(one.life <= 0)victory(one,two)
else if(two.life <= 0)victory(two,one)
/*else
goto loop*/


Problem description:
Many, many errors pop up.

The last of the code is in comments because it removes the rest of the errors from the showing errors when trying to compile. The errors it gives is:
battlesystem.dm:29:error: proc definition not allowed inside another proc
There is no /usr datum.
Eternal_Dread wrote:
Problem description:
Many, many errors pop up.


That I believe. There is so much wrong in there that it just HAS to happen.

1.variables made for 'usr' are mob variables. so you'd do it like so:
mob/var/atk


2.procs made for 'usr' are also mob procs. so you'd do it like so:
mob/proc/calculate()
In response to VcentG
Yeah, I haven't worked with code for a couple months. Anyway, a friend of mine helped me. Thanks, though, for that.
In response to Eternal_Dread
You have to read the DM Guide, urgently...then move on to tutorials and demos.