Welcome, Guest. Please login or register.

Author Topic: Using "skip lab back" in scripts  (Read 3059 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Using "skip lab back" in scripts
« 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
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Using "skip lab back" in scripts
« Reply #1 on: December 19, 2010, 03:42:45 PM »
It shouldn't make any difference, but I've always used "skip back "...
int p; // A
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Using "skip lab back" in scripts
« Reply #2 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
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Using "skip lab back" in scripts
« Reply #3 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
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Using "skip lab back" in scripts
« Reply #4 on: December 19, 2010, 03:51:13 PM »
Is ArcadeGameSelector in the current search path at this point?
int p; // A
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Using "skip lab back" in scripts
« Reply #5 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
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Franko

  • Hero Member
  • *****
  • Join Date: Jun 2010
  • Posts: 5707
    • Show only replies by Franko
Re: Using "skip lab back" in scripts
« Reply #6 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... :)
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Using "skip lab back" in scripts
« Reply #7 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.
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Using "skip lab back" in scripts
« Reply #8 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
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Using "skip lab back" in scripts
« Reply #9 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
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Franko

  • Hero Member
  • *****
  • Join Date: Jun 2010
  • Posts: 5707
    • Show only replies by Franko
Re: Using "skip lab back" in scripts
« Reply #10 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... :(



The Main program and source code is available from my site if anyone wants it...
« Last Edit: December 19, 2010, 05:38:36 PM by Franko »
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Using "skip lab back" in scripts
« Reply #11 on: December 19, 2010, 05:38:50 PM »
That looks good! I use ArcadeGameSelector which is very effective.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Franko

  • Hero Member
  • *****
  • Join Date: Jun 2010
  • Posts: 5707
    • Show only replies by Franko
Re: Using "skip lab back" in scripts
« Reply #12 on: December 19, 2010, 05:43:50 PM »
Quote from: motorollin;599976
That looks good! I use ArcadeGameSelector 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... :)
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Using "skip lab back" in scripts
« Reply #13 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
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Using "skip lab back" in scripts
« Reply #14 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).
« Last Edit: December 19, 2010, 07:44:13 PM by Piru »