ID:146194
 
Code:
mob
verb
fly()
set category = "Actions"
usr << "You hover above the ground"
if mob.Race = "Saiyan"
icon = 'loginicons.dmi'
icon_state = "gokufly"
if mob.Race = "Namekian"
icon = 'loginicons.dmi'
icon_state = "Fly2"
if mob.Race = "Human"
icon = 'loginicons.dmi'
icon_state = "Fly3"
density = 0 //now we can walk through dense obj's.


Problem description: What wrong with this code ...i thought it would work you see i have different races and for every race a want the flying icon that goes with it ...but it just gives me errors

mob
verb
fly()
set category = "Actions"
usr << "You hover above the ground"
if(usr.Race = "Saiyan")
usr.icon = 'loginicons.dmi'
usr.icon_state = "gokufly"
if(usr.Race = "Namekian")
usr.icon = 'loginicons.dmi'
usr.icon_state = "Fly2"
if(usr.Race = "Human")
usr.icon = 'loginicons.dmi'
usr.icon_state = "Fly3"
density = 0
In response to Holy Retribution
doesnt work...... this is my code for defining races though

how would you define it under this?


Code:
mob/Race/Saiyan
icon= 'loginicons.dmi'
icon_state = "Goku"
density=1

mob/Race/Namekian
icon= 'loginicons.dmi'
icon_state = "Namekian"
density=1


mob/Race/Human
icon= 'loginicons.dmi'
icon_state = "Human"
density=1


In response to Pyromaniac4382
mob
var
ostate1
verb
fly()
set category = "Actions"
usr << "You hover above the ground"
usr.ostate = usr.icon_state
if(usr.icon_state = "Saiyan")
usr.icon = 'loginicons.dmi'
usr.icon_state = "gokufly"
if(usr.icon_state = "Namekian")
usr.icon = 'loginicons.dmi'
usr.icon_state = "Fly2"
if(usr.icon_state = "Human")
usr.icon = 'loginicons.dmi'
usr.icon_state = "Fly3"
density = 0
In response to Holy Retribution
verbs.dm:50:error:usr.ostate:undefined var
verbs.dm:51:error::missing expression
verbs.dm:54:error::missing expression
verbs.dm:57:error::missing expression
In response to Pyromaniac4382
You could always use...

istype(usr, /mob/Saiyan)

Any fether help doesnt come from me, I've given you everything you need to fix the problem.
In response to Holy Retribution
what is the missing expression though ..... with the if command that is
In response to Pyromaniac4382
Thats cause you coded it wrong, its == not =, I thought you would pick that up, I wasn't going to waste my time correcting it.
In response to Holy Retribution
o thanks im not really good with defining under multiple mobs
How you say it..Seems like its not your code(not saying its not)..In later posts, try to restrain from saying "want"..Sounds like you are asking ppl to do your code..0_0 ..(Just a suggestion)

Also..Indent under your ifs
In response to Pyromaniac4382
Pyromaniac4382 wrote:
doesnt work...... this is my code for defining races though

how would you define it under this?


Code:
> mob/Race/Saiyan
> icon= 'loginicons.dmi'
> icon_state = "Goku"
> density=1
>
> mob/Race/Namekian
> icon= 'loginicons.dmi'
> icon_state = "Namekian"
> density=1
>
>
> mob/Race/Human
> icon= 'loginicons.dmi'
> icon_state = "Human"
> density=1
>
>

It's quite simple:
mob
Race
verb
Fly()
Saiyan
Fly()
src.icon_state="gokufly"
Human
Fly()
src.icon_state="Fly3"
Namek
Fly()
src.icon_state="Fly2"