Hi, I've tried implementing the INV, triggering it when FIRE2 is pressed, however rather than display as expected per the documentation it is just printing the first line of my text messages file instead.
Hi, I don't know if in the new MPAGD the inventory is treated the same way as in the old AGD. But in the latter, in order to enable the inventory, you must create a list in a single text message by putting each item name on a different line, e.g.
The MPAGD documentation is as follows (I'm pretty certain the MENU at the end of the paragraph is a typo and should be INV):
INV Requires a text string argument encased in quotes. Similar to MENU, but this produces a menu based on objects in the player's possession. The text string should contain the list of the object names used in your game separated by commas. INV will present the player with a menu containing only those items currently in the player's inventory. Useful for selecting an item to process or drop. The screen is redrawn after MENU.
Example: LET LINE = 5 LET COLUMN = 6 PRINT “SELECT ITEM TO DROP” LET LINE = 7 LET COLUMN = 9 INV “KEYS,MAGNET,FLASK,SCREWDRIVER,ZX VEGA,SCARF,BALL” IF OPT <> 255 DROP OPT ENDIF
Post by Jonathan Cauldwell on Apr 2, 2020 18:31:19 GMT
You're right, the MENU at the end of the paragraph should be INV. I've fixed it in the documentation so it will be correct in the next release.
I've been playing around with INV today and haven't managed to recreate your problem on the Spectrum or Amstrad. If you want to zip up your project files and send them to me I could try and recreate the problem with your files
I've made a bit of progress, I looked in the source code and noticed that my screen names which were in my text messages file didnt have the DEFINEMESSAGES data definition - so i added DEFINEMESSAGES to the top of my text messages file and then the INV command works, although it wont drop the items, I noticed that when I build there is an error message: Unrecognised instruction on line 1913: DROP OPT
I cant see anything about DROP as a command in the documentation so I'm not sure if this is a bug, sorry, I am a total noob with MPAGD but having a lot of fun learning!....been about 35 years since I last coded on a speccy!