MODULE: Combination Lock Keypad v1.01 (new dl site)

Started by SSH, Thu 17/11/2005 16:59:38

Previous topic - Next topic

SSH

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: ags

// 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

12

Candle

#1
Wow great, going to look at it right now.
Sorry to bug you but how would you use it with hotspots?

SSH

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...
12

Candle

#3
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);

monkey0506

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: ags
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: ags
SetGlobalInt(300, 0);


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

Candle


Maverick

#6
Great module but unfortunately it doesn't solve the issue I'm stuck with.
Thanks!


Trent R

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
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

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...

strangeDetective


I tried to download this module but they're all dead links. I'm trying to find a module where I can implement a password/combo lock/dial phone type puzzle using the latest version of AGS. Was hoping to find a module I could try to adapt, rather than code one from scratch, as I'm not that familiar with the intricacies of scripting yet.

Ideally, I'd like a GUI with buttons to pop up, player enters a sequence of correct letters/numbers and it runs a script. I looked for a telephone module and/or a combo-lock passcode module and this link was all I could find. Does anyone know of a place where I can download this, and will it work in the latest version of AGS?

Snarky

There seems to be an active link here: http://americangirlscouts.org/agsresources/modules.html

(The module is pretty old, though, so no guarantees that it'll work with the current version of AGS without modification.)

SMF spam blocked by CleanTalk