Ultimate Amiga

Network Boards => AMOS Language Discussion => AMOS Factory => AMOS Professional Forum => Topic started by: rockersuke on December 07, 2010, 10:18:44 PM

Title: Forcing my way into an input command
Post by: rockersuke on December 07, 2010, 10:18:44 PM
Just out of plain curiosity, is there any known way of hacking an AMOS "input" command for doing something while the program waits the string to be entered?
The goal: implement an input routine in which you can, at any time, use the up/down arrows keys to navigate through previous sentences in a text adventure, like most infocom/magnetic scrolls classics did.

My guess is my best bet is writting my own input procedure from scratch, which is, after all, what most commercial text adventures did in the happy 80's in both 8 and 16 bits machines. Just wanted to know, lazy me, if there was a shortcut to this I wasn't aware of.  :D

--
Title: Re: Forcing my way into an input command
Post by: SamuraiCrow on December 08, 2010, 12:43:28 AM
I don't know of any shortcut.  You'll be probably be better off writing your own input routine.
Title: Re: Forcing my way into an input command
Post by: Lonewolf10 on December 18, 2010, 01:02:50 PM

I agree with SamuraiCrow.

A short loop that uses the X$=Input$(1) instruction would do. You can then see what X$ contains. Not sure if it would be compatible with control keys (e.g. Amiga, Shift, cursor keys etc.). If it isn't you would replace Input$(1) with Inkey$.
You can then transfer the valid contents of X$ to whatever variable the inputted data is going to and invalid contents (cursor keys etc.) can activate whatever you wish them to without interferring with.

I use loops like that in the title screens of my software so that I can hide debug menu's etc. ;)


Regards,
Lonewolf10

Title: Re: Forcing my way into an input command
Post by: rockersuke on December 19, 2010, 11:07:26 AM

 you would replace Input$(1) with Inkey$.


Yup, that's what I finally did. I took the input routine (an Inkey$ loop) from the "Castle Amos" adventure (in Amos The Creator Data Disk) and improved from there to suit my needs. The goal was to achieve some "browse old commnads with arrow keys" functionality. Some AMOS written text advs did it in the past, like Space Jest (http://aminet.net/package/game/think/SpaceJest). So far, It seems to be working nicely!

Thanks!

Title: Re: Forcing my way into an input command
Post by: skateblind on December 20, 2010, 07:57:34 PM
My uncle made Space Jest. Good game.  :)