Hello,
I need some help again.
Hamserspeak.exe is not happy with this script anymore, after I added an other script behind it one.
I tried to find the mistakes, changes a few ( and )... well, now I am as confused again.
The mesaage was "expced top-level-declaration, but found "else" as message.
# is triggered by textbox 23
# checks if player shall buy dye and has not beein in trouble yet.
if (checktag (tag:buy dye) && checktag(tag:was in trouble)) then
(
show textbox (113) # should continue with 131
set tag (tag: buy dye, off)
set tag (41,on)
wait for textbox
show textbox (131) # should continue with the script
wait for textbox
)
else
if (checktag (tag:run)) then
(
show textbox (187)
)
)
else
if (checktag (tag:confess)) then
(
(show textbox (242)
)
)
end
By the way, is there an Editor for writing Plotscripts?
Like Notepad++ or such?
I'd like to see several Errors/Misstakes as once. These Compiler(?)-Messages from Hamsterspeak are rather confusing me.
If you want to use the "else if" construct, then 'else' and 'if' must be next to each other on the same line. Assuming that that's what you want, you also have an extra ) before the last else.
Now i have new questions: Is it possible to use several else ifs - one afer another- on the same level? Like switch-case?
Can I use case for checking tags or is this comand just for numbers?
I tried the Hamser Wisper, but the compiler also alsways shows just one mistake. And there is also no colored text , still it's fast to use than the OHR's compiler.
# is triggered by textbox 23
# checks if player shall buy dye and has not beein in trouble yet.
if (checktag (tag:buy dye) && checktag(tag:was in trouble)) then
(
show textbox (113) # should continue with 131
set tag (tag: buy dye, off)
set tag (41,on)
wait for textbox
show textbox (131) # should continue with the script
wait for textbox
)
else
if (checktag (tag:run)) then
(
show textbox (187)
)
else
if (checktag (tag:confess)) then
(
(show textbox (242)
)
)
end
if(condition) then(
# do something
)else if(another condition) then(
# do something else
)else if(another condition) then(
# do something else
)else if(another condition) then(
# do something else
)else if(another condition) then(
# do something else
)else(
# if none of the other conditions are true do this
)
Is that normal that the Complier says this?
The Tag "buy dye" is set then using another NPC, so it should be able to be set...
Then I get the message Hspeak.exe sreported failure.
Seems like something is still wrong here ... I guess I need some more help, please? ^^"
# is triggered by textbox 23
# checks if player shall buy dye and has not beein in trouble yet.
if (checktag (tag:buy dye) ==1 && checktag (41) ==off) then
(
show textbox (113) # should continue with 131
set tag (tag: buy dye, off)
set tag (41,on)
wait for textbox
show textbox (131) # should continue with the script
wait for textbox
)
else if (checktag (tag:run)) then
(
show textbox (187)
)
else if (checktag (tag:confess)) then
(
show textbox (242)
)
else if ((tag:buy dye) == off ) then
(
show textbox (23)
)
else
(
show textbox (251)
)
end