Pages:<< prev 1 next >>
#1 Feb 23, 2010 6:50 am
GroupMembers
Posts10
JoinedMay 18, 2009
Well, maybe it's just me, but I have this small mob prog that is just driving me a little nutty.
As far as I can see, it all works fine. But I'm still getting a bug error.
The program still works, but this bug report is just driving me a little nuts.
Here's the code for the prog.
If anyone has a solution t this it would be great. Will be able to sleep better then.
Oh, also, this is what's happening at the time of the report.
As far as I can see, it all works fine. But I'm still getting a bug error.
Bug: [*****] BUG: Mob #701: Found else in an else section.
The program still works, but this bug report is just driving me a little nuts.
Here's the code for the prog.
3>all_greet_prog 100 if ispc($n) if isimmort($n) if name($n) == Aster Say Greetings Aster, Creator of the Omniverse else say Greetings Immortal. How fare thee on this fine day? endif else if sex($n) == 0 say Greetings, Creation of Legaeldan. mpsleep 4 say Do you wish to converse with the almighty creator of the realm? else if sex($n) == 1 Say Greetings Son of Aster. mpsleep 4 say Do you wish to converse with the almighty creator of the realm? else if sex($n) == 2 say Greetings Daughter of Silvanyis. mpsleep 4 say Do you wish to converse with the almighty creator of the realm? endif endif else say Greeting creature of the realm. endif endif endif
If anyone has a solution t this it would be great. Will be able to sleep better then.
Oh, also, this is what's happening at the time of the report.
Erewen arrives from below.
Aster's Assistant says ' Greetings, Creation of Legaeldan. '
Ok.
<30000hp 30000m 30000mv>[0Gold][RVnum 706]
Aster's Assistant says ' Do you wish to converse with the almighty creator of th
e realm? '
Bug: [*****] BUG: Mob #701: Found else in an else section.
#2 Feb 23, 2010 11:13 am
GroupAdministrators
Posts1,946
JoinedJul 26, 2005
3>all_greet_prog 100
if ispc($n)
if isimmort($n)
if name($n) == Aster
Say Greetings Aster, Creator of the Omniverse
else
say Greetings Immortal. How fare thee on this fine day?
endif
else
if sex($n) == 0
say Greetings, Creation of Legaeldan.
mpsleep 4
say Do you wish to converse with the almighty creator of the realm?
else
if sex($n) == 1
Say Greetings Son of Aster.
mpsleep 4
say Do you wish to converse with the almighty creator of the realm?
else
if sex($n) == 2
say Greetings Daughter of Silvanyis.
mpsleep 4
say Do you wish to converse with the almighty creator of the realm?
endif
endif
else
say Greeting creature of the realm.
endif
endif
endif
It doesn't like all those else being used in there. You can probably get it all done without having all the else in there and just use the if checks. I don't have time currently to test it out though, but try it a few different ways and let me know how it goes for you.
#3 Feb 23, 2010 1:35 pm
Off the Edge of the Map
GroupAdministrators
Posts1,200
JoinedMar 21, 2006
When I read that prog, I'm not sure what to make of it.
Is it only supposed to trigger on Immortals? and then mortals all get called creatures of the realm? Or is there maybe an endif out of place?
Is it only supposed to trigger on Immortals? and then mortals all get called creatures of the realm? Or is there maybe an endif out of place?
#4 Feb 23, 2010 3:24 pm
GroupMembers
Posts10
JoinedMay 18, 2009
It works, essentially. It's just giving me that bug error once it's said the sentence about conversing.
The way it works is, it responds to immortals with a normal greeting without the question.
Then if the player is not an immortal, it greets them depending on sex, followed by the question about conversing.
So if a girl walks in, it greets a daughter or silvanyis, a boy, it greets a son of aster, and a nuetral, a creation of legaeldan.
It works fine on immortals. But when it gets to the section about mortals and their sex, when it comes to the end of the section of code, it bugs. And it's the same for all sexes, not just one or two.
The way it works is, it responds to immortals with a normal greeting without the question.
Then if the player is not an immortal, it greets them depending on sex, followed by the question about conversing.
So if a girl walks in, it greets a daughter or silvanyis, a boy, it greets a son of aster, and a nuetral, a creation of legaeldan.
It works fine on immortals. But when it gets to the section about mortals and their sex, when it comes to the end of the section of code, it bugs. And it's the same for all sexes, not just one or two.
#5 Feb 23, 2010 3:29 pm
GroupMembers
Posts723
JoinedMar 5, 2005
Just use breaks.
etc
if isnpc($n)
say Greeting creature of the realm.
break
endif
if isimmort($n)
...
etc
#6 Feb 24, 2010 3:46 am
GroupMembers
Posts10
JoinedMay 18, 2009
Thanks for all the help you guys. I had a play with things, and changed the way the program asked the if checks.
Finally works the way I need it to.
Here's what I went with:
Thanks for the help
Finally works the way I need it to.
Here's what I went with:
if name($n) == Aster say Greetings Aster, Creator of the Omniverse. else if isimmort($n) say Greetings Immortal ruler of the land. else if sex($n) == 0 say Greetings, Creation of Legaeldan. mpsleep 4 say Do you wish to converse with the almighty creator of the realm? else if sex($n) == 1 Say Greetings, Son of Aster. mpsleep 4 say Do you wish to converse with the almighty creator of the realm? else if sex($n) == 2 say Greetings, Daughter of Silvanyis. mpsleep 4 say Do you wish to converse with the almighty creator of the realm? endif
Thanks for the help
#7 Feb 24, 2010 5:35 am
Off the Edge of the Map
GroupAdministrators
Posts1,200
JoinedMar 21, 2006
Glad you got it working.
I personally probably would have gone a route like:
Although, as a further stipulation, I'm pretty sure I've implemented elseif as an argument for my progs locally, so my actually prog probably wouldn't look exactly like this. But still.
I personally probably would have gone a route like:
if name($n) == Aster say Greetings Aster, Creator of the Omniverse. else if isimmort($n) say Greetings Immortal ruler of the land. else if ispc($n) if sex($n) == 0 say Greetings, Creation of Legaeldan. mpsleep 4 say Do you wish to converse with the almighty creator of the realm? else if sex($n) == 1 Say Greetings, Son of Aster. mpsleep 4 say Do you wish to converse with the almighty creator of the realm? else if sex($n) == 2 say Greetings, Daughter of Silvanyis. mpsleep 4 say Do you wish to converse with the almighty creator of the realm? endif else if isnpc($n) say Greetings, Creature of the realm. endif
Although, as a further stipulation, I'm pretty sure I've implemented elseif as an argument for my progs locally, so my actually prog probably wouldn't look exactly like this. But still.
Pages:<< prev 1 next >>