mob
monster
proc
MonsterNumber()
usr.monsters = rand(1,3)
if(usr.fighting == Slime)
if(usr.monsters == 1)
monster1.name = "Slime A"
monster1.hp = Slime.hp
/*This is only part of it for I haven't finished the other part but i already have problems, now here is monster1 as a monster class*/
monster1
name
hp
mp
expreward
jobexpreward
gold
attack
defense
intelligence
agility
<dm>
Here are the errors I get:
loading Slime Journey.dme
MonsterNumber.dm:6:error:Slime:undefined var
MonsterNumber.dm:8:error:monster1.name:undefined var
MonsterNumber.dm:9:error:monster1.hp:undefined var
MonsterNumber.dm:9:error:Slime.hp:undefined var
NewBattle.dm:37::warning: empty switch statement
I've tried making it /mob/monster/Slime for example (because ive defined it that way in other places with no problem) but i still get this problem. Can someone help?
ID:147732
![]() Jan 6 2004, 12:18 am
|
|
I'm making a multimonster battle for my game, and I might be approaching it the wrong way, but thats now what I need help for, You see, i made a new proc to make it randomly choose how many monsters you will fight. And I dont want help on how to change it to make it better, unless its unfixable. Heres the code:
|
I need to know that if making it a variable, it will work, cause im not gonna waist time tring to figure something out to get it to work when it wont. and second, ill update this when im on a computer where i can show u that code (preferably mine) lol
|
Metroid wrote:
I need to know that if making it a variable, it will work, cause im not gonna waist time tring to figure something out to get it to work when it wont. and second, ill update this when im on a computer where i can show u that code (preferably mine) lol Please don't show him your code until you fix the usr problem in Bump(). We've been over that way too many times for you to still have such a mistake in your code, let alone show it to others and encourage them to do the same. Reposts of that same code as-is will have to go the way of your previous two posts. If someone asks for help, they should be able to expect that the code shown to them isn't buggy and wrong. Lummox JR |
I had a friend help me fix it up but what was wrong with it? I forget, when you told me last it was prolly when I couldnt fix it, so can u give me a link to the post with it?
|
Metroid wrote:
I had a friend help me fix it up but what was wrong with it? I forget, when you told me last it was prolly when I couldnt fix it, so can u give me a link to the post with it? Your Bump() proc is stuffed with usr. That's what's wrong with it. Lummox JR |
The problem seems to be that the compiler does not know what monster1 is starting at line 8. Now an easy way to change this would be to make a new line before line 8 that says :
var/mob/monster1=new/mob/monster/Slime
OR
var/mob/monster/monster1 = new/mob/monster/Slime
Upon doing this you no longer need to set the variables for monster1's def, str, agi and so on, making your coding a little bit less space consuming, and a little easier on you.
I will gladly help with the first error if you post the rest of the code I have asked for.