Post new topic    
Red Slime
Send private message
HELP! Plot Script Crazyness 
 PostSun Dec 07, 2014 3:16 pm
Send private message Reply with quote
Hello,

Thank you for reading this!

Wrote my first plot script, very basic..walk show text box, etc...

placed onto the map data and everything worked fine.

Duplicated the txt file:

changed:
plotscript, zero, begin
to:
plotscript, one, begin

changed the name of the txt file to match. (zero/one)

The file imports/compiles fine but erases the previous one. It seems I can only have one plot script, which ever is the latest I compile/import.

I am using a MAC

can anyone help me with this?
Metal King Slime
Send private message
 
 PostSun Dec 07, 2014 3:42 pm
Send private message Reply with quote
You should always post your full script when asking questions like this, because it makes it easier to figure out what's going on. From the information you've given, I think your problem is you have scripts you want in two files, let's say One.txt and Two.txt, right? And so you compile One.txt to One.hs, and you import that, and then you compile Two.txt into Two.hs and you import that, and you've only got one script.

What you should do, is put a line at the start of One.txt that says

Quote:
include, Two.txt


and then compile One.txt. I betcha you'll see your second script then.
Red Slime
Send private message
not quite 
 PostSun Dec 07, 2014 3:53 pm
Send private message Reply with quote
Thank you for replying.

here are my two scripts.

THE FIRST:

include, plotscr.hsd
include, Rab.hsi

plotscript, PZero, begin
suspend player
walk hero (me,east,2)
wait for hero (me)
walk hero (me,south,3)
wait for hero (me)
show text box (207)
wait for text box
walk hero (me,east,5)
wait for hero (me)
walk hero (me,north,2)
set hero direction (me,south)
show text box (208)
wait for text box
walk hero (me,west,5)
end

THE SECOND

include, plotscr.hsd
include, Rab.hsi

plotscript, pone, begin
suspend player
walk hero (me,east,2)
wait for hero (me)
walk hero (me,south,3)
wait for hero (me)
show text box (209)
wait for text box
walk hero (me,east,5)
wait for hero (me)
walk hero (me,north,2)
set hero direction (me,south)
show text box (210)
wait for text box
walk hero (me,west,5)
end

If I upload the first plot script it works fine. When I upload the second plot script it just replaces the old one.

I tried this at the start

include, plotscr.hsd
include, Rab.hsi
include, pone.txt

and this

include, pone.txt
include, plotscr.hsd
include, Rab.hsi

but both came up with error messages.
Slime Knight
Send private message
 
 PostSun Dec 07, 2014 4:13 pm
Send private message Reply with quote
I'm no expert, and I'm not sure I understand exactly what your issue is. Are you putting both scripts into the same text file? Or are you using a different file for each script?
Red Slime
Send private message
separate 
 PostSun Dec 07, 2014 4:20 pm
Send private message Reply with quote
It's two separate text files. Should they be in the same txt document?
Red Slime
Send private message
OMFG 
 PostSun Dec 07, 2014 4:24 pm
Send private message Reply with quote
my my, that's it, they needed to be in one document!

You know I hunted every document and F.A.Q. trying to work this out.

Thank you so so much for pointing out the absolute obvious!
Slime Knight
Send private message
 
 PostSun Dec 07, 2014 5:05 pm
Send private message Reply with quote
No problem, I've had my own share of moments that turned out to be incredibly silly oversights on my part. I tend to have trouble with some very elementary issues. It happens! Hope things are working out now, good luck Grin
Metal King Slime
Send private message
 
 PostSun Dec 07, 2014 8:54 pm
Send private message Reply with quote
It's a common mistake; there is actually a FAQ (well, actually it appears this question was removed from the FAQ page, so I put it back):
Why can't I have more than one script at a time?

Also, welcome!

Also, I see that you forgot to put "resume player" at the end of your scripts.
Metal King Slime
Send private message
Re: not quite 
 PostSun Dec 07, 2014 9:21 pm
Send private message Reply with quote
RabMoghal wrote:
Thank you for replying.

here are my two scripts.

THE FIRST:

include, plotscr.hsd
include, Rab.hsi

plotscript, PZero, begin
suspend player
walk hero (me,east,2)
wait for hero (me)
walk hero (me,south,3)
wait for hero (me)
show text box (207)
wait for text box
walk hero (me,east,5)
wait for hero (me)
walk hero (me,north,2)
set hero direction (me,south)
show text box (208)
wait for text box
walk hero (me,west,5)
end

THE SECOND

include, plotscr.hsd
include, Rab.hsi

plotscript, pone, begin
suspend player
walk hero (me,east,2)
wait for hero (me)
walk hero (me,south,3)
wait for hero (me)
show text box (209)
wait for text box
walk hero (me,east,5)
wait for hero (me)
walk hero (me,north,2)
set hero direction (me,south)
show text box (210)
wait for text box
walk hero (me,west,5)
end

If I upload the first plot script it works fine. When I upload the second plot script it just replaces the old one.

I tried this at the start

include, plotscr.hsd
include, Rab.hsi
include, pone.txt

and this

include, pone.txt
include, plotscr.hsd
include, Rab.hsi

but both came up with error messages.


You only need to include plotscr.hsd and Rab.hsi once. When you included your second file, you included it again and were duplicating a lot of the stuff the .hsi and .hsd had already set up, hence the errors. Delete that from the top of the second file, and this time, I bet it'll work. As others have noted, you can have more than one script in a given text file. Whether or not you do is mostly up to your own organizational habits.
Red Slime
Send private message
Thank You 
 PostSun Dec 07, 2014 9:44 pm
Send private message Reply with quote
Just wanted to say a huge thank you to everyone who replied!

So glad I found this community!
Slime Knight
Send private message
Re: Thank You 
 PostSun Dec 07, 2014 10:31 pm
Send private message Reply with quote
RabMoghal wrote:
Just wanted to say a huge thank you to everyone who replied!

So glad I found this community!

^^ Yeah, I'd be lost without these goons!
Metal King Slime
Send private message
Re: Thank You 
 PostMon Dec 08, 2014 7:17 am
Send private message Reply with quote
RabMoghal wrote:
So glad I found this community!


I hope it wasn't hard to find. Really, I would hope people end up here by default.
Liquid Metal King Slime
Send private message
 
 PostMon Dec 08, 2014 4:30 pm
Send private message Reply with quote
tl;dr V


IT looks like you need to include
resume player
commands.
Display posts from previous: