Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: motorollin on December 19, 2010, 03:40:43 PM

Title: Using "skip lab back" in scripts
Post by: motorollin on December 19, 2010, 03:40:43 PM
Here's a sample of my startup-sequence:

Quote

C:CheckKey 50
IF WARN
  skip boot
ENDIF

C:SetPatch QUIET
MakeDir RAM:AGS
Assign AGS: RAM:AGS
Assign Games: Work:Games
Copy Games:AGS/#? AGS: ALL QUIET

Lab loop
ArcadeGameSelector
IF EXISTS RAM:.run
  Execute RAM:.run
  Delete RAM:.run
EndIF

skip loop back

lab boot

;normal startup sequence stuff to load workbench goes here


Basically, if F1 is being pressed on boot it skips forward to the "boot" label and loads Workbench. Otherwise, it loads ArcardeGameSelector. This works fine. Now, when I quit the game I've been playing, it should skip back to the loop label and re-run ArcadeGameSelector. However, it just gives an error saying "object not found. skip failed returncode 10". Any ideas?

--
moto
Title: Re: Using "skip lab back" in scripts
Post by: Karlos on December 19, 2010, 03:42:45 PM
It shouldn't make any difference, but I've always used "skip back "...
Title: Re: Using "skip lab back" in scripts
Post by: motorollin on December 19, 2010, 03:45:48 PM
Just tried it - same error. The weird thing is that this works:

Quote
lab loop
echo "hi"
skip loop back

It prints endless lines of "hi" when executed. I can't see how this is syntactically different to what I did :-?

--
moto
Title: Re: Using "skip lab back" in scripts
Post by: motorollin on December 19, 2010, 03:50:33 PM
Ok I think it's something to do with WHDLoad, as if I comment out "execute ram:.run" then the loop works (but obviously it just goes straight back to the menu without loading the game). Weird!

--
moto
Title: Re: Using "skip lab back" in scripts
Post by: Karlos on December 19, 2010, 03:51:13 PM
Is ArcadeGameSelector in the current search path at this point?
Title: Re: Using "skip lab back" in scripts
Post by: motorollin on December 19, 2010, 03:56:51 PM
It's in C:. But I don't think that's the problem - the problem is that it's not skipping back to the loop label when WHDLoad runs. Here's the solution I have come up with:

Quote
;s:startup-sequence
Run Execute S:AGS-startup
Quit

Quote
;s:AGS-startup
ArcadeGameSelector
Execute RAM:.run
Delete RAM:.run

Run Execute S:AGS-startup
Quit

Not as elegant as using labels, but it works.

--
moto
Title: Re: Using "skip lab back" in scripts
Post by: Franko on December 19, 2010, 04:08:12 PM
Here's an example of  the PlayGame script I use to run WHDLoad games from my GamesLauncher Util...

Code: [Select]
CD "RAM:Action Fighter/"

Assign SAV: "SAVES:Action Fighter"

LAB LOOP
WHDLoad Slave=ActionFighter.slave PreLoad NoCache NoFilter NTSC
SKIP BACK LOOP
[/B]

This works fine on all my games without any problems... :)
Title: Re: Using "skip lab back" in scripts
Post by: Piru on December 19, 2010, 04:16:19 PM
Quote from: motorollin;599950
it just gives an error saying "object not found. skip failed returncode 10". Any ideas?
It is a limitation of label + skip in conjucation of executing external scripts.
Title: Re: Using "skip lab back" in scripts
Post by: motorollin on December 19, 2010, 04:26:56 PM
Quote from: Piru;599958
It is a limitation of label + skip in conjucation of executing external scripts.


Ahh ok, so does calling an external script wipe out the labels in the script that called it?

--
moto
Title: Re: Using "skip lab back" in scripts
Post by: motorollin on December 19, 2010, 04:27:56 PM
Quote from: Franko;599956
Here's an example of  the PlayGame script I use to run WHDLoad games from my GamesLauncher Util...

Code: [Select]
CD "RAM:Action Fighter/"

Assign SAV: "SAVES:Action Fighter"

LAB LOOP
WHDLoad Slave=ActionFighter.slave PreLoad NoCache NoFilter NTSC
SKIP BACK LOOP
[/B]

This works fine on all my games without any problems... :)


The problem is that ArcadeGameSelector creates a script which you then have to execute in order to get the game to run. As Piru says, this doesn't work with labels. Is your GamesLauncher on Aminet?

--
moto
Title: Re: Using "skip lab back" in scripts
Post by: Franko on December 19, 2010, 05:36:50 PM
Quote from: motorollin;599963
The problem is that ArcadeGameSelector creates a script which you then have to execute in order to get the game to run. As Piru says, this doesn't work with labels. Is your GamesLauncher on Aminet?

--
moto

Unfortunately no... It's pretty much set up to run on my system and would require the user to edit  a script that sets up various assigns and make as much memory available as possible to run multi disk games from ram:... :(

I did try putting a package together a while back when some folk asked for it but couldn't figure out a way that would make it easy for the user to initially set it up, so I'm afraid I gave up... :(

(http://i995.photobucket.com/albums/af79/frankosamiga/Amiga%20Pics/AmigaGamesSelc1.gif)

The Main program and source code is available from my site if anyone wants it...
Title: Re: Using "skip lab back" in scripts
Post by: motorollin on December 19, 2010, 05:38:50 PM
That looks good! I use ArcadeGameSelector (http://www.paradroid.net/ags/) which is very effective.

--
moto
Title: Re: Using "skip lab back" in scripts
Post by: Franko on December 19, 2010, 05:43:50 PM
Quote from: motorollin;599976
That looks good! I use ArcadeGameSelector (http://www.paradroid.net/ags/) which is very effective.

--
moto


Yeah, I've seen that one, its good but I prefer to stick with my own one cos it just sits as an icon on the workbench screen until you want to launch a game... :)
Title: Re: Using "skip lab back" in scripts
Post by: motorollin on December 19, 2010, 05:48:35 PM
Ahh ok. My A1200 boots straight into ArcadeGameSelector unless I hold down F1 during boot, since my Amiga is only really used as a games machine ;)

--
moto
Title: Re: Using "skip lab back" in scripts
Post by: Piru on December 19, 2010, 07:40:17 PM
Quote from: motorollin;599962
Ahh ok, so does calling an external script wipe out the labels in the script that called it?
Execute from a script creates a temporary script file in T: which includes the script executed with rest of the original script appended. Thus you cannot 'skip back' to labels that reside before the execute command.

A
execute B
C

You can't reach A from C after the execute command (because the temporary script created only includes contents of B and C).
Title: Re: Using "skip lab back" in scripts
Post by: kolla on December 19, 2010, 08:58:00 PM
Amiga shell needs some more work in it :)
The hackish way script execution from within scripts is done has many unwanted and unexpected side effects and should be fixed, and I also miss being able to create functions and various loops.
Title: Re: Using "skip lab back" in scripts
Post by: motorollin on December 19, 2010, 09:15:34 PM
@Piru
Thanks for the explanation. Very interesting :)

Have any of these issues with AmigaDOS been addressed in any of the NG AmigaOS flavours?

--
moto