ID:149283
 
mob
store
shop
icon = 'RingAnnouncer.dmi'
verb
Talk()
set category = "Talkin"
alert("Welcome to Mazarot/Branks's Skate Game (Still no title)")
alert("You wana buy a skateboard?")
switch(input("Blue Skateboard", "Red Skateboard", text) in list ("Blue Skateboard", "Red Skateboard")
if("Blue Skateboard")
usr << "there ok, hope u like it"
usr.overlays+= 'redboard.dmi'
usr.overlays-= 'skateboard.dmi'

if("Red Skateboard")
usr << "there ok, hope u like it"
usr.overlays+= 'skateboard.dmi'
usr.overlays-= 'redboard.dmi'


Has Error on line. if("Blue Skateboard") says there is no comma, or right paran ')'
Any help please?
Add another ) after text)

Also, you need a set src in oview(1)
In response to Garthor
where after "text)" ? :D
In response to mazarot
it should be text))
In response to Garthor
npcs.dm:11:error: missing left-hand argument to in.

i get that wen i add the extra )and "set src in oview(1)"

"switch(input("Blue Skateboard", "Red Skateboard", text)) in list ("Blue Skateboard", "Red Skateboard")." thats the line
In response to mazarot
look up input. I'm too lazy to keep on helping you.
mazarot wrote:
mob
store
shop
icon = 'RingAnnouncer.dmi'
verb
Talk()
set category = "Talkin"
alert("Welcome to Mazarot/Branks's Skate Game (Still no title)")
alert("You wana buy a skateboard?")
switch(input("Blue Skateboard", "Red Skateboard", text) in list ("Blue Skateboard", "Red Skateboard")
if("Blue Skateboard")
usr << "there ok, hope u like it"
usr.overlays+= 'redboard.dmi'
usr.overlays-= 'skateboard.dmi'

if("Red Skateboard")
usr << "there ok, hope u like it"
usr.overlays+= 'skateboard.dmi'
usr.overlays-= 'redboard.dmi'


Has Error on line. if("Blue Skateboard") says there is no comma, or right paran ')'
Any help please?






here you go:


mob/store/shop
icon = 'RingAnnouncer.dmi'
verb
Talk()
set category = "Talkin"
set src in oview(2)
alert("Welcome to Mazarot/Branks's Skate Game (Still no title)")
alert("You wana buy a skateboard?")
switch(input("Blue Skateboard", "Red Skateboard", text) in list ("Blue Skateboard", "Red Skateboard"))
if("Blue Skateboard")
usr << "there ok, hope u like it"
usr.overlays+= 'redboard.dmi'
usr.overlays-= 'skateboard.dmi'

if("Red Skateboard")
usr << "there ok, hope u like it"
usr.overlays+= 'skateboard.dmi'
usr.overlays-= 'redboard.dmi'



- RaeKwon
In response to RaeKwon
Thank you man
In response to Garthor
Garthor wrote:
Add another ) after text)

Also, you need a set src in oview(1)

Garthor, stop trying to help people until you figure out what you're doing. This is not the first time I've seen you give someone bad advice because you failed to think a problem through.

In this case, you didn't see that the missing parentheses belong at the end of the line, not after "as text". In fact, the parentheses that are immediately after "as text" have to go too.

Also, "set src in oview(1)" is not necessary; it's redundant, and in this case wrong. The desired behavior is likely to talk to a mob if one is next to you without having to choose from a list; therefore the correct line would be "set src=oview(1)", which I believe happens to be the default. (The difference between = and "in" in a set src line is that = will choose automatically if there's only one choice.)

The way Ter13 (I think it was him) went off on you recently in Newbie Central was certainly uncalled for, since he wasn't being clear, but most of the times I've seen you try to help people you've given them shoddy code or advice that will only muddy the waters. You really need to spend more time learning the system yourself, and spend some time thinking about what you're saying before you say it.

Lummox JR
In response to mazarot
mazarot wrote:
Thank you man

No problem, glad i could help.
- RaeKwon
In response to Lummox JR
Also, "set src in oview(1)" is not necessary; it's redundant, and in this case wrong. The desired behavior is likely to talk to a mob if one is next to you without having to choose from a list; therefore the correct line would be "set src=oview(1)", which I believe happens to be the default. (The difference between = and "in" in a set src line is that = will choose automatically if there's only one choice.)

"set src in oview(1)" is actually the default.

To supplement your post (and clarify your parenthetical remarks), "in" is the explicit case (that is, if there are two or more targets, you must pick one from a list), while "=" is the implicit case (that is, if there are two or more available targets, the target will be chosen automatically).

It's one of the less intuitive aspects of DM syntax, but once you learn the distinction and memorize it, it seems like second nature. =)