 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Camdog
Joined: 08 Aug 2003 Posts: 606
|
Posted: Tue Sep 23, 2008 7:22 am Post subject: Strange Script Import Problem |
|
|
I downloaded Baby Bob to mess around with sidescrolling. I made some very minor changes to implement double-jumping. Specifically, I added the global variables:
Code: | global variable(7, totalJumps)
global variable(8, jumpsLeft) |
and changed
Code: | #jumping
if (want jump) then(
if ((try down(player,NPC pixel x(player),NPC pixel y(player),1)==0)) then(
write global(yv+player,-10)
)
) |
to this:
Code: | #jumping
if (want jump) then(
if ((try down(player,NPC pixel x(player),NPC pixel y(player),1)==0)) then(
jumpsLeft := totalJumps
)
if (jumpsLeft >> 0) then(
write global(yv+player,-10)
jumpsLeft := jumpsLeft -- 1
)
) |
(and of course added to the initialize routine:)
Code: | totalJumps := 2
jumpsLeft := totalJumps |
All of this compiles fine, and hspeak tells me it's compiling 11 scripts from the side-scroll.hss file, but when I import the scripts into my game, it says it only imports 2 scripts (mastergameloop and keypresshandler). Then, when I run the game, I get an error saying the mastergameloop script is missing, and pressing a key returns the error that keypresshandler is missing.
I tried doing a test import of another compiled hamsterspeak file, and all the scripts appeared to import correctly. Any ideas as to what's going on? |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Tue Sep 23, 2008 12:18 pm Post subject: Re: Strange Script Import Problem |
|
|
Camdog wrote: | All of this compiles fine, and hspeak tells me it's compiling 11 scripts from the side-scroll.hss file, but when I import the scripts into my game, it says it only imports 2 scripts (mastergameloop and keypresshandler). Then, when I run the game, I get an error saying the mastergameloop script is missing, and pressing a key returns the error that keypresshandler is missing. |
The importer only reports thew number of directly callable scripts (that is, old-style scripts with ID numbers, or newstyle scripts using "plotscript") It does not report old style autonumber scripts or new style scripts using "script"
That should probably be changed to avoid confusion.
As for the error in game, go into the general game data and re-select the master game loop as the newgame and loadgame script. Then re-select the keypress handler script in the map editor.
As for why it is doing that, I am not sure, but it would help to know whether you are using the copy of baby_bob in the zip file I uploaded way-back-when, or if you are using the copy of baby_bob from subversion. |
|
Back to top |
|
 |
Camdog
Joined: 08 Aug 2003 Posts: 606
|
Posted: Tue Sep 23, 2008 12:58 pm Post subject: |
|
|
Right, but all the script declarations in side-scroll.hss are new-style script declarations (script, script name, begin). I believe Custom lists all of them during import, right?
And the file is the old .zip file (got the link from an issue of HamsterSpeak), not what's on the subversion server.
edit:
Oops, nevermind! Script is the old style; new is plotscript. Duh. Too used to working with the new style stuff, I guess. I just could've sworn it listed every script as being imported earlier. Ah well, everything works dandy now. Thanks! |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|