keyguard transition (alphabeting)

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

keyguard transition (alphabeting)

Postby Giuseppe » Mon Feb 09, 2015 10:05 pm

I'm using load, save, and exit with keyguard and works.
I Use the string -Component ("KeyGuard"). Object.PauseComponent- to disable those functions in the screens where you do not have to be used. But if I use a transition cancel the command Component ("KeyGuard"). Object.PauseComponent-
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Re: keyguard transition (alphabeting)

Postby reneuend » Wed Feb 11, 2015 3:15 am

I'm sorry, but I don't understand what you are asking.
Do you want to know how to cancel the PauseComponent?

I would have to test it, but I would think you would want it as the first command in the frame properties for the next frame that you want to cancel the PauseComponent.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2691
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Re: keyguard transition (alphabeting)

Postby Giuseppe » Wed Feb 11, 2015 6:59 pm

ok, my english in not very good.

I use the keyguard function with keyborad to save (s) load (L) and exit (x).
In the introduction of the game I canceled this function with "Object.PauseComponent", and work fine.
But if in the screens of introduction I use the transition, cancel function " Object.PauseComponent" and I can save and load. I want to use the transition but must not operate the load, save, exit.
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Re: keyguard transition (alphabeting)

Postby reneuend » Thu Feb 12, 2015 12:44 am

No problem about not knowing english very well. I admire you for trying. I would struggle worse than you if this forum wasn't in english! :wink:

Here is an easier way to do it and gives you more control

Create 3 integer variables:
AllowSave
AllowLoad
AllowQuit

From the Project Properties:
Options Tab:
checkmark on: Hide the "Load" button
checkmark on: Hide the "Save" button

Advanced Tab:
checkmark on: Execute some VBScript code every time that a frame is loaded
Code: Select all
AllowSave = 0
AllowLoad = 0
AllowQuit = 0


From any Frame Properties:
Advanced Tab:
[Procedures...] button

Code: Select all
sub KeyGuard_KeyPressed(KeyID)
  ProcessKeyStrokes GetCurrentFrameName, KeyID(0)
  Action.message "key: " & KeyID(0)
End Sub

Sub ProcessKeyStrokes(CurrentFrame, KeyID)
    If KeyID = 8 then
      if AllowSave = 1 then
        Action.PopupSaveGame
      end if
    elseif KeyID = 9 then
      if AllowLoad = 1 then
        Action.PopupLoadGame
      end if
    elseif KeyID = 16 Then
      if AllowQuit = 1 then
        Action.Quit
      end if
    End If
End Sub



For the Frame Properties where you don't want to allow any of the 3 options:
Advanced Tab:
Code: Select all
AllowSave = 0  'No Save
AllowLoad = 0  'No Load
AllowQuit = 0  'No Quit



For the Frame Properties where you want to allow any of the 3 options:
Advanced Tab:
Code: Select all
AllowSave = 1
AllowLoad = 1
AllowQuit = 1



You can mix and match the options to Save, Load, or Quit as you please.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2691
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Re: keyguard transition (alphabeting)

Postby Giuseppe » Thu Feb 12, 2015 6:05 pm

ok thanks. I'll try!
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Re: keyguard transition (alphabeting)

Postby Giuseppe » Thu Feb 12, 2015 7:54 pm

ok work but in every image with variables 0 or 1 in the screen appear the key number the button that i have pressed.

Image
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm

Re: keyguard transition (alphabeting)

Postby reneuend » Fri Feb 13, 2015 1:56 am

OOPS! I left a message in my code so I could see what key was what! :shock:

In the Procedures area:

remove this line: Action.message "key: " & KeyID(0)

Code: Select all
sub KeyGuard_KeyPressed(KeyID)
  ProcessKeyStrokes GetCurrentFrameName, KeyID(0)
  Action.message "key: " & KeyID(0)
End Sub
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2691
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Re: keyguard transition (alphabeting)

Postby Giuseppe » Fri Feb 13, 2015 10:11 am

ok, work fine.
Tanks very much!
Giuseppe
Frequent Poster
 
Posts: 147
Joined: Wed Mar 12, 2008 12:01 pm


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: MSN [Bot] and 2 guests

cron