Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Forcing my way into an input command  (Read 2651 times)

0 Members and 1 Guest are viewing this topic.

rockersuke

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 15
Forcing my way into an input command
« 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

--
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: Forcing my way into an input command
« Reply #1 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.
Logged

Lonewolf10

  • AMOS Extensions Developer
  • AMOS Dev
  • A2000
  • *****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 618
    • http://www.aliensrcooluk.com
Re: Forcing my way into an input command
« Reply #2 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

Logged

rockersuke

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 15
Re: Forcing my way into an input command
« Reply #3 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. So far, It seems to be working nicely!

Thanks!

Logged

skateblind

  • Important 'looking' person
  • Forum Mod
  • A2000
  • *****
  • Karma: 668
  • Offline Offline
  • Gender: Male
  • Posts: 509
Re: Forcing my way into an input command
« Reply #4 on: December 20, 2010, 07:57:34 PM »

My uncle made Space Jest. Good game.  :)
Logged
What are you looking at?
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022