ID:164317
 
Im trying to make a ranking system for my game where when the player reaches a certain lvl then their rank changes. This is part of what i have now:
if(scr.Level<=9)
scr.Rank = "Vagrant"
return
if(scr.Level>=10 & scr.Level<=19)
if(scr.Class = "Warrior"
scr.Rank = "Trainer"
return
if(scr.Class = "Magician"
scr.Rank = "Apprentice"
return
if(scr.Class = "Assist"
scr.Rank = "Protector"
return
if(scr.Class = "Archer"
scr.Rank = "Rogue"
return

The thing is when I compile it all it says
error: scr:missing comma ',' or right-paren ')'
and it always says that on the line where I have the Trainer and Apprentice rank. So i moved the if the class was warrior and magician and put it beneath the archer class. But it still said the same error for the same two lines. Not as in It said the Trainer and Apprentice ranks were wrong but now the Protector and Rogue ranks were wrong.
    if(scr.Level<=9)
scr.Rank = "Vagrant"
return
if(scr.Level>=10 & scr.Level<=19) // the & should be &&
if(scr.Class = "Warrior" // you're missing an ending )
scr.Rank = "Trainer"
return
if(scr.Class = "Magician" // you're missing an ending )
scr.Rank = "Apprentice"
return
if(scr.Class = "Assist" // you're missing an ending )
scr.Rank = "Protector"
return
if(scr.Class = "Archer" // you're missing an ending )
scr.Rank = "Rogue"
return


I've commented two of the obvious errors in your code. I'm also assuming that by 'scr' you means 'src' or, the source of the proc. Another issue is that you're using a big list of if statements and returns instead of a switch like you should be using. This is how it should be written:

    switch(src.Rank)
if(0 to 9)
src.Rank = "Vagrant"
if(10 to 19)
switch(src.Class)
if("Warrior")
src.Rank = "Trainer"
if("Magician")
src.Rank = "Apprentice"
if("Assist")
src.Rank = "Protector"
if("Archer")
src.Rank = "Rogue"
In response to Foomer

In response to Monkeykid0049
You are setting it right under mob rather than a procedure or a verb.
In response to GhostAnime
Okay this is my Ranking System so far and my game says I have a missing expression on each line with the required class.(i.e.) if(src.Class = "Warrior)
mob/proc/LvlRankCheck()
if(src.Level<=9)
src.Rank = "Vagrant"
if(src.Level>=10 && src.Level <=19)
if(src.Class = "Warrior")
src.Rank = "Trainer"
return
if(src.Class = "Magician")
src.Rank = "Apprentice"
return
if(src.Class = "Assist")
src.Rank = "Protector"
return
if(src.Class = "Archer")
src.Rank = "Rogue"
return
if(src.Level>=20 && src.Level<=29)
if(src.Class = "Warrior")
src.Rank = "Fighter"
return
if(src.Class = "Magician")
src.Rank = "Mage"
return
if(src.Class = "Assist")
src.Rank = "Guardian"
return
if(src.Class = "Archer")
src.Rank = "Outlaw"
return
In response to Monkeykid0049
Sorry I bothered.
In response to Foomer
mob/proc/LvlRankCheck()
if(src.Level<=9)
src.Rank = "Vagrant"
if(src.Level>=10 && src.Level <=19)
switch(src.Class)
if("Warrior")
src.Rank = "Trainer"
return
if("Magician")
src.Rank = "Apprentice"
return
if("Assist")
src.Rank = "Protector"
return
if("Archer")
src.Rank = "Rogue"
return
if(src.Level>=20 && src.Level<=29)
switch(src.Class)
if("Warrior")
src.Rank = "Fighter"
return
if("Magician")
src.Rank = "Mage"
return
if("Assist")
src.Rank = "Guardian"
return
if("Archer")
src.Rank = "Outlaw"
return


Read the DM Guide Please it will come in handy.

- Miran
In response to Monkeykid0049
lol is this from flyff?
In response to Yasuhiko
yes.....i couldnt think of my own ranks so i just took the ones from flyff
In response to Monkeykid0049
You're trying to set Rank inside the if statement (=), what you want is to compare it (==). The snippet from Foomer will save you a lot of space, but you'll have to change the first switch statement to use Level instead of Rank.

If you plan on classes having a good bit of difference though, you should think about using different subtypes of /mob for them (instead of a text variable).
In response to Miran94
Miran's code says theres no errors with it but it doesnt show the person rank in the stat tab.
In response to Monkeykid0049
Monkeykid0049 wrote:
Miran's code says theres no errors with it but it doesnt show the person rank in the stat tab.

Well did You call the Stat() proc? If you did and it dosent show then you are calling the level up proc on the wrong mob.

- Miran
In response to Miran94
The Stat() proc does not need to be called. You may be thinking of stat(), which is used in Stat().
In response to Garthor
I think the point was, "Lets see your Stat() proc!"
In response to Foomer
oh.....well ive pretty much given up on a rank system now cuz i dont really know what to do.