ID:143879
 
I knwo this is going to be a nooby quetion but I am new at programming can I ask what is wrong?
Code:
NPC
icon = 'NPCs.dmi'
icon_state = "Bob"
switch(input("What race would you like to be?","Choose a Race") in list ("White Mage","Black Mage","Demon Path"))
if("White Mage")
src<<"You Have chose, White Mage Path!"
src.loc=locate(1,2,2)
if("Black Mage")
src<<"You choose, Black Mage Path!"
src.loc=locate(1,1,3)
if("Demon Path")
src<<"You choose, Demon Path!"
src.loc=locate(1,1,4)


Problem description:
loading Magic.dme
NPC's.dm:5: Inconsistent indentation.
NPC's.dm:5: Inconsistent indentation.
NPC's.dm:6: Inconsistent indentation.
NPC's.dm:7: Inconsistent indentation.
NPC's.dm:8: Inconsistent indentation.
NPC's.dm:8: Inconsistent indentation.
NPC's.dm:9: Inconsistent indentation.
NPC's.dm:10: Inconsistent indentation.
NPC's.dm:11: Inconsistent indentation.
NPC's.dm:11: Inconsistent indentation.
NPC's.dm:12: Inconsistent indentation.
NPC's.dm:13: Inconsistent indentation.

Magic.dmb - 12 errors, 0 warnings (double-click on an error to jump to it)

i will help you out once, so read this carefully... do not just copy/paste it into your game without the sightest care and say "Hmm it works so why read it.."

READ THIS AND SEE WHATS DIFFERENT:

world
mob=/mob/NPC
mob
NPC
icon = 'NPCs.dmi'
icon_state = "Bob"
Login()
switch(input("What race would you like to be?","Choose a Race") in list ("White Mage","Black Mage","Demon Path"))
if("White Mage")
src<<"You Have chose, White Mage Path!"
src.loc=locate(1,2,2)
if("Black Mage")
src<<"You choose, Black Mage Path!"
src.loc=locate(1,1,3)
if("Demon Path")
src<<"You choose, Demon Path!"
src.loc=locate(1,1,4)


This worked for me, it should work for you.
In response to VolksBlade
VolksBlade wrote:
i will help you out once, so read this carefully... do not just copy/paste it into your game without the sightest care and say "Hmm it works so why read it.."

READ THIS AND SEE WHATS DIFFERENT:

> world
> mob=/mob/NPC
> mob
> NPC
> icon = 'NPCs.dmi'
> icon_state = "Bob"
> Login()
> switch(input("What race would you like to be?","Choose a Race") in list ("White Mage","Black Mage","Demon Path"))
> if("White Mage")
> src<<"You Have chose, White Mage Path!"
> src.loc=locate(1,2,2)
> if("Black Mage")
> src<<"You choose, Black Mage Path!"
> src.loc=locate(1,1,3)
> if("Demon Path")
> src<<"You choose, Demon Path!"
> src.loc=locate(1,1,4)
>

This worked for me, it should work for you.


It did work But not to be picky or anything but Its just when you go to the NPC and you talk to him then it brings up the selection. Well if you can please help but untill then I will try and fix it myself ;)


EDIT: Well so far this is all I came up with and it still doesnt work :P

NPC
icon = 'NPCs.dmi'
icon_state = "Bob"
Click()
switch(input("What race would you like to be?","Choose a Race") in list ("White Mage","Black Mage","Demon Path"))
if("White Mage")
src<<"You Have chose, White Mage Path!"
src.loc=locate(1,2,2)
if("Black Mage")
src<<"You choose, Black Mage Path!"
src.loc=locate(1,1,3)
if("Demon Path")
src<<"You choose, Demon Path!"
src.loc=locate(1,1,4)

In response to K0rn
1: you didnt listen to me... NPC has to be set as a MOB thus making the MOB/NPC

2: when you are coding, dont use the space bar when you are making the indents, use the TAB key (every key board has one im sure).

3: when making a verb/enter/entered/click off of a obj/turf/other-mob make sure that the person clicking is defined as usr, using the 'src' just makes it happen to the obj/turf/other-mob that is being clicked/entered/verbed.

4: here is your repaired coding:
mob
NPC
icon = 'NPCs.dmi'
icon_state = "Bob"
Click()
switch(input("What race would you like to be?","Choose a Race") in list ("White Mage","Black Mage","Demon Path"))
if("White Mage")
usr<<"You Have chose, White Mage Path!"
usr.loc=locate(1,2,2)
if("Black Mage")
usr<<"You choose, Black Mage Path!"
usr.loc=locate(1,1,3)
if("Demon Path")
usr<<"You choose, Demon Path!"
usr.loc=locate(1,1,4)
In response to VolksBlade
VolksBlade wrote:
1: you didnt listen to me... NPC has to be set as a MOB thus making the MOB/NPC

He can have it set up as /NPC... however, if he wants to retain the properties of mob's [such as the variables that is mob-access only], he has to either make it mob/NPC OR place this special line: parent_type = /mob which signals that it's parent is /mob.

2: when you are coding, dont use the space bar when you are making the indents, use the TAB key (every key board has one im sure).

You can use spaces for indents, just not a space and tab mix... tabs are so much easier and neater though :P Also, some broken keyboars don't have the TAB key :P

3: when making a verb/enter/entered/click off of a obj/turf/other-mob make sure that the person clicking is defined as usr, using the 'src' just makes it happen to the obj/turf/other-mob that is being clicked/entered/verbed.

Eh, wha? Please do not give out faultyadvice :( Sure using usr may be safe in Click() and verb, as thy usually are solely called by the client and almost never in any other way, but NEVER USE USR IN ENTER() AND ANY OTHER MOVEMENT PROCEDURES!!! (Move(), Exited(), etc).

usr is defined as: "This is a mob variable (var/mob/usr) containing the mob of the player who executed the current verb, or whose action ultimately called the current proc."

One line in the DM Ref. for usr states this as well: The only time usr is assigned for you is when a player (in Dream Seeker) executes a verb, clicks something with the mouse, or any other such action.

As well as this: It is mostly not safe to apply usr in a movement proc such as Move() or Enter(), because objs and non-player mobs may move as well, without setting usr.

So yeah... avoid usr in movement procs... use arguments >_<

Also, src = source = the source of a verb or proc (meaning src = whoever had the proc or verb that was called).
In response to GhostAnime
thats what i meant, just i dont word things correctly...
In response to VolksBlade
Well i see what u both mean but the problem is that how DO i make him talk i clicked and it just says u clicked roshi
In response to Ninjabeshoy1
Please don't revive zombie threads, make a new one. You don't want to make Zombie Jebus mad at you, now do you?

In cases like this, a snippet of your program would be wanted... but I will take a wild guess and say that Click() for Roshi is outputting its name to the usr.
In response to GhostAnime
turf
Start
Click()
switch(input("What race would you like to be?","Choose a Race") in list ("White Mage","Black Mage","Demon Path"))
if("White Mage")
usr<<"You Have chose, White Mage Path!"
usr.loc = locate(1,2,2)
if("Black Mage")
usr<<"You choose, Black Mage Path!"
usr.loc = locate(1,1,3)
if("Demon Path")
usr<<"You choose, Demon Path!"
usr.loc = locate(1,1,4)


try that and put it over a icon saying start or what ever you want

i really didn't want to give you the easy way out but this is easy to follow and you can edit it to turn it into your own