ID:262400
 
Code:
mob
Luke_Sky_Walker
icon = 'male.dmi'
verb
Talk()
switch(alert("Would you like to do a quest for me?","Quests","Yes","No"))
if ("Yes")
usr.asked1 = 1
alert("Thanks, go and find my light laber. I last saw it in a tusken raider came to the east of here")
if ("No")
alert("Well thanks anyways")


Problem description: I got a error it is 'Quests.dm:10:error: proc definition not allowed inside another proc'

> mob
> Luke_Sky_Walker
> icon = 'male.dmi'
> verb
> Talk()
> switch(alert("Would you like to do a quest for me?","Quests","Yes","No"))
> if ("Yes")
> usr.asked1 = 1
> alert("Thanks, go and find my light laber. I last saw it in a tusken raider came to the east of here")
> if ("No")
> alert("Well thanks anyways")
That should fix it based on what I saw.
t was merely an indentation error because you didn't keep the if() procs under the switch() proc.
In response to Jamesburrow (#1)
Now whats wrong with this?

mob
Luke_Sky_Walker
icon = 'male.dmi'
verb
Talk()
set src in oview(1)
switch(alert("Would you like to do a quest for me?","Quests","Yes","No"))
if ("Yes")
usr.asked1 = 1
alert("Thanks, go and find my light laber. I last saw it in a tusken raider came to the east of here")
if ("No")
alert("Well thanks anyways")
if usr.asked1 = 1
alert("Were is it?")




mob/var
asked1 = 0
lightsab = 0
quest1done = 0
In response to Accentin inc. (#2)
I don't really see anything wrong with it, but you might want to include a way for you to give it to him if you have it....I can't think of a way right now, anybody else know?
In response to Accentin inc. (#2)
                    if usr.asked1 = 1
alert("Were is it?")

//////// Fixed
if (usr.asked1 = 1)
alert("Were is it?")


Remember the () I'm pretty sure DM requires them.

-Ryan
In response to Ryne Rekab (#4)
                    if (usr.asked1 = 1)
alert("Were is it?")
//Fixed:
if (usr.asked1 == 1)
alert("Were is it?")

Somehow, I didn't catch that, but there was still an error. Your supposed to use == in an if statement like that, because = is used ot set a variable.
Use if(var) instead of if(var==1) & if(!var) instead of if(var==0)
In response to Jamesburrow (#5)
mob
Luke_Sky_Walker
icon = 'male.dmi'
verb
Talk()
set src in oview(1)
switch(alert("Would you like to do a quest for me?","Quests","Yes","No"))
if ("Yes")
usr.asked1 = 1
alert("Thanks, go and find my light laber. I last saw it in a tusken raider came to the east of here")
if ("No")
alert("Well thanks anyways")
if (usr.asked1 = 1)
alert("Were is it?")


loading Star Wars Legacy.dme
Quests.dm:13:error::missing expression

Star Wars Legacy.dmb - 1 error, 0 warnings (double-click on an error to jump to it)


Now what?
In response to Accentin inc. (#7)
I answered that in the post above...>_>
                    if (usr.asked1 == 1)
alert("Were is it?")

in an if() proc, you use ==, because = is used to set a variable.
In response to Jamesburrow (#8)

Ehum....

mob
Luke_Sky_Walker
icon = 'male.dmi'
verb
Talk()
set src in oview(1)
switch(alert("Would you like to do a quest for me?","Quests","Yes","No"))
if ("Yes")
usr.asked1 = 1
alert("Thanks, go and find my light laber. I last saw it in a tusken raider came to the east of here")
if ("No")
alert("Well thanks anyways")
if (usr.asked1 == 1)
alert("Were is it?")



mob/var
asked1 = 0
lightsab = 0
quest1done = 0








loading Star Wars Legacy.dme
Quests.dm:13:error::expected a constant expression

Star Wars Legacy.dmb - 1 error, 0 warnings (double-click on an error to jump to it)
In response to Accentin inc. (#9)
Try this:
mob
Luke_Sky_Walker
icon = 'male.dmi'
verb
Talk()
set src in oview(1)
mob
Luke_Sky_Walker
icon = 'male.dmi'
verb
Talk()
set src in oview(1)
if (usr.asked1 == 1)//I moved the if() proc to here
alert("Were is it?")
else
switch(alert("Would you like to do a quest for me?","Quests","Yes","No"))
if ("Yes")
usr.asked1 = 1
alert("Thanks, go and find my light laber. I last saw it in a tusken raider came to the east of here")
if ("No")
alert("Well thanks anyways")
if (usr.asked1 == 1)
alert("Were is it?")
//I moved the if() proc.



mob/var
asked1 = 0
lightsab = 0
quest1done = 0

If that doesn't work, I don't know.
In response to Jamesburrow (#10)
Yay thx i'll post more if i need mroe help. im makeing the item and adding the end of the quest now thx
In response to Accentin inc. (#11)
Ok now whats wrong...

mob
Luke_Sky_Walker
icon = 'male.dmi'
verb
Talk()
set src in oview(1)
if (usr.lightsab = 1)
alert("Thanks, you can keep it!")
if (usr.asked1 == 1)
alert("Were is it?")
else
switch(alert("Would you like to do a quest for me?","Quests","Yes","No"))
if ("Yes")
usr.asked1 = 1
alert("Thanks, go and find my light laber. I last saw it in a tusken raider came to the east of here")
if ("No")
alert("Well thanks anyways")



loading Star Wars Legacy.dme
Quests.dm:8: Inconsistent indentation.

Star Wars Legacy.dmb - 1 error, 0 warnings (double-click on an error to jump to it)
In response to Accentin inc. (#12)
Accentin inc. wrote:
Ok now whats wrong...

mob
> Luke_Sky_Walker
> icon = 'male.dmi'
> verb
> Talk()
> set src in oview(1)
> if (usr.lightsab = 1)
> alert("Thanks, you can keep it!")
> if (usr.asked1 == 1)
> alert("Were is it?")
> else
> switch(alert("Would you like to do a quest for me?","Quests","Yes","No"))
> if ("Yes")
> usr.asked1 = 1
> alert("Thanks, go and find my light laber. I last saw it in a tusken raider came to the east of here")
> if ("No")
> alert("Well thanks anyways")
>
>


loading Star Wars Legacy.dme
Quests.dm:8: Inconsistent indentation.

Star Wars Legacy.dmb - 1 error, 0 warnings (double-click on an error to jump to it)
In response to Jamesburrow (#3)
PLEASE
In response to Accentin inc. (#14)
whats wrong with this
mob
Luke_Sky_Walker
icon = 'male.dmi'
verb
Talk()
set src in oview(1)
if (usr.lightsab = 1)
alert("Thanks, you can keep it!")
if (usr.asked1 == 1)
alert("Were is it?")
else
switch(alert("Would you like to do a quest for me?","Quests","Yes","No"))
if ("Yes")
usr.asked1 = 1
alert("Thanks, go and find my light laber. I last saw it in a tusken raider came to the east of here")
if ("No")
alert("Well thanks anyways")

In response to Accentin inc. (#15)
Dude, you gotta wait another day to bump..
In response to Mecha Destroyer JD (#16)
bump
In response to Accentin inc. (#15)
                 if (usr.lightsab == 1)//Here's the problem
alert("Thanks, you can keep it."

Once again, you have to have a ==, not an =