spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

Welcome, Guest. Please login or register.
30 Jul 2010, 01:40

Home | Help | Search | Games | Wiki | Login | Register


AGS Forums  |  Using AGS  |  Modules, Plugins and Technical FAQ (Moderators: Gilbet V7000a, Scorpiorus, strazer)  |  Topic: MODULE: Combination Lock Keypad v1.01 (new dl site) « previous next »
Pages: [1] Print
Author Topic: MODULE: Combination Lock Keypad v1.01 (new dl site)  (Read 2267 times)
SSH
Member


now with added scroll!

Scripting: I've written loads of modules

« on: 17 Nov 2005, 16:59 »

I feel prolific, oh so prolific, I feel witty and prolific and straight....

Here's another module from my mighty pen, for doing combination locks.

Very simple: Download, read the readme, import the GUE and module and Bob's your builder:

Code:
// room script

function room_a() {
  // script for Room: Player enters room (before fadein)

  ComboLock.Combination = "1337";
  gKeypad.Centre();
  gKeypad.Visible = true;

}

function room_b() {
  // script for Room: Repeatedly execute

  if (ComboLock.Status() == eLockStatusCorrect) Display("Woot!");
  else if (ComboLock.Status() == eLockStatusWrong) Display("You die!");

}

Download here (Requires AGS v2.71!)
Documentation
Download here (Requires AGS v2.71!)
Mirror

« Last Edit: 06 Nov 2006, 13:28 by SSH » Logged

Candle
Member


Truly Hated


« Reply #1 on: 17 Nov 2005, 17:34 »

Wow great, going to look at it right now.
Sorry to bug you but how would you use it with hotspots?
« Last Edit: 17 Nov 2005, 17:53 by Candle » Logged
SSH
Member


now with added scroll!

Scripting: I've written loads of modules

« Reply #2 on: 17 Nov 2005, 19:32 »

Candle: For the hotspot for button marked "1" you'd make its interaction do:

ComboLock.Press("1");

etc for button 2, 3, 4. Combinations can be letters instead of numbers if you prefer...
Logged

Candle
Member


Truly Hated


« Reply #3 on: 17 Nov 2005, 21:42 »

Thank you SSH I got it working now . this is better then sliced bread.
Anyway to fix this? with it in the  // script for Room: Repeatedly execute
When it plays the sound 4 it keeps playing it and it did the samething with the woot? had to Alt+x to quit the game as it was in a loop with the woot or sound?
if (ComboLock.Status()==eLockStatusCorrect) Display ("Woot!");
else if (ComboLock.Status()==eLockStatusWrong) PlaySound(4);
« Last Edit: 18 Nov 2005, 01:32 by Candle » Logged
monkey_05_06
Member


With 90-somethin' percent accuracy!

AGS tutoring (no further info specified)Play-testing (no further info specified)Voice acting (no further info specified)Proof reading (no further info specified)Scripting (no further info specified)Story design (no further info specified)
Web design (no further info specified)

« Reply #4 on: 18 Nov 2005, 03:57 »

It looks like the Status() function is returning the same value repeatedly causing the code to be run over and over.

Try setting and checking a global variable:

Code:
if ((ComboLock.Status() == eLockStatusCorrect) && (GetGlobalInt(300) != 1)) {
  Display("Woot!");
  SetGlobalInt(300, 1);
  }
else if ((ComboLock.Status() == eLockStatusWrong) && (GetGlobalInt(300) != 2)) {
  PlaySound(4);
  SetGlobalInt(300, 2);
  }

Then in the code for the interaction you may want to put:

Code:
SetGlobalInt(300, 0);

I hope this helps (Seeing as I should be doing my English homework and then going to bed).
Logged

Nothing we can do will ever change the past; the only real power we hold is that of making a better future.
Candle
Member


Truly Hated


« Reply #5 on: 18 Nov 2005, 04:15 »

Thanks , that worked .
Logged
Maverick
Member


The Trinity is on its way!

Play-testing (no further info specified)Voice acting (no further info specified)Proof reading (no further info specified)Story design: Need a puzzle?

« Reply #6 on: 30 Nov 2005, 19:41 »

Great module but unfortunately it doesn't solve the issue I'm stuck with.
Thanks!
« Last Edit: 24 Dec 2005, 19:09 by strazer » Logged

Ruben654
Member
Posts: 6


« Reply #7 on: 27 Apr 2009, 19:46 »

how you use the gue file
Logged
Trent R
Member


"I am the weapon" -Richard Cypher

AGS tutoring: Very good with scripting, I can tutor you through beginner and semi-advance questions.Scripting: I have used multiple languages, and have picked up AGS scripting very easily and very fast.

« Reply #8 on: 27 Apr 2009, 21:26 »

Gue files are old, so you need to do a few steps:

1)load it into 2.72
2) upgrade the project to 3.1
3) (if needed) export to .guf file


~Trent
Logged

To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.

Current Project: The Wanderer
On Hold: Hero of the Rune
HaReL
Member


« Reply #9 on: 22 May 2009, 14:35 »

Hi.
Can you tell me how to export the moudle?
I upgraded it from 2.72 to 3.1.2, but I didnt understsand how to export it..
(when you said "load it into 2.72" you meant to open it inside a game, and then upgrade the game. right?)

Thanks alot...
Logged
Pages: [1] Print 
AGS Forums  |  Using AGS  |  Modules, Plugins and Technical FAQ (Moderators: Gilbet V7000a, Scorpiorus, strazer)  |  Topic: MODULE: Combination Lock Keypad v1.01 (new dl site) « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.104 seconds with 14 queries.