CPCWiki forum

General Category => Games => Topic started by: Devlin on 21:01, 07 July 23

Title: The Sword of Truth - improper argument in 1270
Post by: Devlin on 21:01, 07 July 23
I've been playing this RPG called Sword of Truth with limited success, due to after a short while of playing, it fails with an "Improper Argument in 1270"

The offending line:
1270 WINDOW SWAP 0,2:LOCATE 10,8:PRINT FNBAR$(SRC):LOCATE 10,9:PRINT FNBAR$(DIV):LOCATE 10,10:PRINT FNBAR$(WND):LOCATE 10,11:PRINT FNBAR$(0.7*WGT/(MEN-(MEN=0))):LOCATE 10,12:PRINT FNBAR$(FTG):WINDOW SWAP 0,2:RETURN
the source file it appears in is attached - I don't know *why* it's failing the way it is, just that I know it's always failing there.

Also there's a spelling mistake on line 1055 (I should really modify my copy of the disk image and correct that)
Title: Re: The Sword of Truth - improper argument in 1270
Post by: Rabs on 09:55, 08 July 23
Quote from: Devlin on 21:01, 07 July 23I've been playing this RPG called Sword of Truth with limited success, due to after a short while of playing, it fails with an "Improper Argument in 1270"

The offending line:
1270 WINDOW SWAP 0,2:LOCATE 10,8:PRINT FNBAR$(SRC):LOCATE 10,9:PRINT FNBAR$(DIV):LOCATE 10,10:PRINT FNBAR$(WND):LOCATE 10,11:PRINT FNBAR$(0.7*WGT/(MEN-(MEN=0))):LOCATE 10,12:PRINT FNBAR$(FTG):WINDOW SWAP 0,2:RETURN
the source file it appears in is attached - I don't know *why* it's failing the way it is, just that I know it's always failing there.

Also there's a spelling mistake on line 1055 (I should really modify my copy of the disk image and correct that)
How long does it take to fail.

Running game now and seems ok.

Sword of Truth.JPG

The text file you attached looks corrupt at the end.

Corrupt.JPG
Title: Re: The Sword of Truth - improper argument in 1270
Post by: Devlin on 10:33, 08 July 23
that corruption at the end isn't part of the code (line 2033 is the last one), seems like an artefact of the amstrad's "save as ascii" feature.

my sequence of playing goes like this:

load"sword
start game with custom army
wander around a bit near the starting town after buying 20 warriors and some long swords
eventually it crops up. It happens on real hardware too, so I have no idea.
Title: Re: The Sword of Truth - improper argument in 1270
Post by: Rabs on 10:45, 08 July 23
How are you running it?

Run "Sword.bas"?
Title: Re: The Sword of Truth - improper argument in 1270
Post by: Devlin on 12:56, 08 July 23
Quote from: Rabs on 10:45, 08 July 23How are you running it?

Run "Sword.bas"?
Sword.bas, yes.

Think that does character definitions, then loads the sword2 bas which in turn loads a binary blob
Title: Re: The Sword of Truth - improper argument in 1270
Post by: Jean-Marie on 13:07, 08 July 23
Try replacing line 1270 with this :
1270 WINDOW SWAP 0,2:LOCATE 10,8:PRINT FNBAR$(SRC)
1271 LOCATE 10,9:PRINT FNBAR$(DIV)
1272 LOCATE 10,10:PRINT FNBAR$(WND)
1273 LOCATE 10,11:PRINT FNBAR$(0.7*WGT/(MEN-(MEN=0)))
1274 LOCATE 10,12:PRINT FNBAR$(FTG)
1275 WINDOW SWAP 0,2:RETURN

You'll still have a bug, but now it well tell you where is located the faulty instruction.
Title: Re: The Sword of Truth - improper argument in 1270
Post by: Rabs on 13:27, 08 July 23
Quote from: Devlin on 12:56, 08 July 23
Quote from: Rabs on 10:45, 08 July 23How are you running it?

Run "Sword.bas"?
Sword.bas, yes.

Think that does character definitions, then loads the sword2 bas which in turn loads a binary blob
Still cannot get it to fail but keep getting defeated by the Water Demons  :)
Title: Re: The Sword of Truth - improper argument in 1270
Post by: Devlin on 13:35, 08 July 23
Quote from: Rabs on 13:27, 08 July 23
Quote from: Devlin on 12:56, 08 July 23
Quote from: Rabs on 10:45, 08 July 23How are you running it?

Run "Sword.bas"?
Sword.bas, yes.

Think that does character definitions, then loads the sword2 bas which in turn loads a binary blob
Still cannot get it to fail but keep getting defeated by the Water Demons  :)
Try going with 25 warriors, you're practically invulnerable 
Title: Re: The Sword of Truth - improper argument in 1270
Post by: SwordOfTruth on 13:20, 09 July 23
The disc image on CPC files sites is incomplete
The mode0 loading screen is missing
There are numerous spelling mistakes and bugs in the basic code
The machine code has memory leaks and will prevent disc operations from working after a while playing the game
You can still use snapshots to save the game if playing on emulators
If you do not have any armor you will never have any men killed in battle
You can still die if no food or water
It is possible to complete the game by attacking the castles, ruins, temples and then attacking the tomb

An easy completion would be to start the game with default army
Sell potions, swords and armor
Buy as many great swords as you can
Fight until you can hire 25 warriors and buy 25 great swords
Fight until you have 10000 gold
Buy the teleport sorcery spell
Teleport to the ruins, castles, temples
Attack the monsters guarding the structures
Teleport to the tomb
Attack the monsters guarding the structure
Game complete

The teleport coordinates can be found in the basic code from line 1615
Title: Re: The Sword of Truth - improper argument in 1270
Post by: Devlin on 16:37, 09 July 23
Quote from: SwordOfTruth on 13:20, 09 July 23The disc image on CPC files sites is incomplete
The mode0 loading screen is missing
There are numerous spelling mistakes and bugs in the basic code
The machine code has memory leaks and will prevent disc operations from working after a while playing the game
You can still use snapshots to save the game if playing on emulators
If you do not have any armor you will never have any men killed in battle
You can still die if no food or water
It is possible to complete the game by attacking the castles, ruins, temples and then attacking the tomb

An easy completion would be to start the game with default army
Sell potions, swords and armor
Buy as many great swords as you can
Fight until you can hire 25 warriors and buy 25 great swords
Fight until you have 10000 gold
Buy the teleport sorcery spell
Teleport to the ruins, castles, temples
Attack the monsters guarding the structures
Teleport to the tomb
Attack the monsters guarding the structure
Game complete

The teleport coordinates can be found in the basic code from line 1615

It sounds like you know a lot about this. Is there a complete image of this out there? Is there a bugfixed version, perhaps?
Title: Re: The Sword of Truth - improper argument in 1270
Post by: SwordOfTruth on 10:14, 10 July 23
QuoteIt sounds like you know a lot about this. Is there a complete image of this out there? Is there a bugfixed version, perhaps?
I know some things about the game
I do not know if a finished or bugfixed version is out there, maybe some one from Mordorsoft would know more
Changing the border to color 3 looks better in the game
The loading of the background graphics should have been in the basic loader program and not a 17k screen hence the delay after changing the mode0 inks and using for-next as a delay before chaining the main basic code
It is possible that the castles, ruins, temples will not give you all six keys to complete the game

Is there a person here who can fix the bugs in the game?
It is a interesting role playing game from 1986 and would benefit from some modernisation
Powered by SMFPacks Menu Editor Mod