ID:151158
 
OK, I almost have my experience thing down (I think) here's the code:
var/list/fighterLevels = list(100, 2000, 4000, 8000, 16000)

mob
var/list/expLevelList
var/exp
var/level
var/savefile="player.sav"
fighter
expLevelList = list(100, 2000, 4000, 8000, 16000)
level = 1
expLevelList
level = 1
New()
..()
src.expLevelList = list(100, 2000, 4000, 8000, 16000)
src << "You gained [++exp]!"

proc/AddExperience(myAmount)
exp += myAmount
if(exp >= 100[level+1])
src << "You are now level [++level]!"
HP += 1




I assign enemies with experience like this:
Wolf
icon='wolf.dmi'
exp=100


but when i kill something nothing happens! help!
I'm getting a warning that says that the if statement (I've made that line a bigger font) has no effect, is that a problem?
Thanks,
Gilser
the lines below the IF should be indented one more step, I believe.
In response to Kaidorin
I'd like to check that experience code, but when i made my enemies have random walk, but they don't stop to fight! The code looks like this:
Wolf
icon = 'wolf.dmi'
HP = 1
shield = 1
dexterity = 1
armor = 2
offense = 2
karma = 0
exp=100
New()
..()
walk_rand(src, 10)
I just want the wolf to stop and fight you when you touch it, any ideas?
Thanks,
Gilser

P.S.
Thanks Kaodrin, I've been trying to get rid of that warning for a while!
In response to Gilser
On 3/3/01 2:13 am Gilser wrote:
I'd like to check that experience code, but when i made my enemies have random walk, but they don't stop to fight! The code looks like this:
Wolf
icon = 'wolf.dmi'
HP = 1
shield = 1
dexterity = 1
armor = 2
offense = 2
karma = 0
exp=100
New()
..()
walk_rand(src, 10)
I just want the wolf to stop and fight you when you touch it, any ideas?

Call walk(src,0) on the wolf.
In response to Gilser
On 3/3/01 2:13 am Gilser wrote:
I'd like to check that experience code, but when i made my enemies have random walk, but they don't stop to fight! The code looks like this:
Wolf
icon = 'wolf.dmi'
HP = 1
shield = 1
dexterity = 1
armor = 2
offense = 2
karma = 0
exp=100
New()
..()
walk_rand(src, 10)
I just want the wolf to stop and fight you when you touch it, any ideas?

I'm also trying to get this code to compile, here it is:
var/list/fighterLevels = list(100, 2000, 4000, 8000, 16000)

mob
var/list/expLevelList
var/exp
var/level
var/savefile="player.sav"
fighter
expLevelList = list(100, 2000, 4000, 8000, 16000)
level = 1
expLevelList
level = 1
New()
..()
src.expLevelList = list(100, 2000, 4000, 8000, 16000)
src << "You gained [++exp]!"

proc/AddExperience(myAmount)
exp += myAmount
if(exp >= expLevelList[level+1]
<font size="6">src << "You are now level [++level]!"</font>

I get the error:
players.dm:21:error: src: missing comma ',' or right-paren ')'
any ideas?
Thanks,
Gilser

P.S.
Thanks Kaodrin, I've been trying to get rid of that warning for a while!
In response to Gilser
if(exp >= expLevelList[level+1]
<font size="6">src << "You are now level [++level]!"</font>

I get the error:
players.dm:21:error: src: missing comma ',' or right-paren ')'

Look at the line above it...
In response to Spuzzum
...Now I feel like an idiot...but thanks!
Check http://www.byond.com/forum/ forum.cgi?action=message_read&forum=code&message=418&view=0 post, I don't under stand where I should be putting the following things:
var/experience = 98
mob.AddExperience(experience) //change mob to src, usr, or the target, and experience to the number you'd like to add.

and

usr.AddExperience(mob.exp)

Thanks,
Gilser
P.S
shouldn't
-a href="http://www.blahblah.com"- Blah -/a- (> and <'s replaced with 's)











In response to Gilser
too bad I missed you gilser...oh well we use the same code so I know how to fix yer problem

Wolf
icon = 'wolf.dmi'
HP = 1
shield = 1
dexterity = 1
armor = 2
offense = 2
karma = 0
exp=100
step_mode=2

that does everything ya need...have fun.yes the monster will stop to fight. :)


In response to Gilser
I got that if thing to stop saying warning, but my experience still isn't working! the code is posted in a earlier part of this string, take a look and help me out, please!
Thanks
Gilser