HELP! Plot Script Crazyness

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
RabMoghal
Red Slime
Posts: 30
Joined: Sun Dec 07, 2014 3:11 pm
Location: Middlesbrough, UK
Contact:

HELP! Plot Script Crazyness

Post by RabMoghal »

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?
User avatar
Gizmog
Metal King Slime
Posts: 2615
Joined: Tue Feb 19, 2008 5:41 am

Post by Gizmog »

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
include, Two.txt
and then compile One.txt. I betcha you'll see your second script then.
User avatar
RabMoghal
Red Slime
Posts: 30
Joined: Sun Dec 07, 2014 3:11 pm
Location: Middlesbrough, UK
Contact:

not quite

Post by RabMoghal »

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.
User avatar
Urkelbot666
Slime Knight
Posts: 188
Joined: Sat Oct 18, 2014 5:29 pm

Post by Urkelbot666 »

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?
User avatar
RabMoghal
Red Slime
Posts: 30
Joined: Sun Dec 07, 2014 3:11 pm
Location: Middlesbrough, UK
Contact:

separate

Post by RabMoghal »

It's two separate text files. Should they be in the same txt document?
User avatar
RabMoghal
Red Slime
Posts: 30
Joined: Sun Dec 07, 2014 3:11 pm
Location: Middlesbrough, UK
Contact:

OMFG

Post by RabMoghal »

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!
User avatar
Urkelbot666
Slime Knight
Posts: 188
Joined: Sat Oct 18, 2014 5:29 pm

Post by Urkelbot666 »

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 :D
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

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.
Last edited by TMC on Sun Dec 07, 2014 8:58 pm, edited 2 times in total.
User avatar
Gizmog
Metal King Slime
Posts: 2615
Joined: Tue Feb 19, 2008 5:41 am

Re: not quite

Post by Gizmog »

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.
User avatar
RabMoghal
Red Slime
Posts: 30
Joined: Sun Dec 07, 2014 3:11 pm
Location: Middlesbrough, UK
Contact:

Thank You

Post by RabMoghal »

Just wanted to say a huge thank you to everyone who replied!

So glad I found this community!
User avatar
Urkelbot666
Slime Knight
Posts: 188
Joined: Sat Oct 18, 2014 5:29 pm

Re: Thank You

Post by Urkelbot666 »

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!
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Re: Thank You

Post by TMC »

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.
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6247
Joined: Mon Dec 08, 2008 7:07 am
Location: Home
Contact:

Post by Spoonweaver »

tl;dr :V


IT looks like you need to include
resume player
commands.
Post Reply