MODULE: Hotspot ComboLock

Started by Ashen, Sat 03/12/2005 16:55:59

Previous topic - Next topic

Ashen

MODULE: Hotspot ComboLock
by Nik 'Ashen' Mallon.


Yet another Passcode Lock Module, specifically designed to use hotspots and objects, rather than a GUI. A module-ified version of the code I posted in this thread, partially based on SSH's Combination Lock Keypad module, and compatible with both 2.7 and 2.71 (as far as I can tell).

Everything should be explained in the README, let me know if it isn't (documentation isn't my strong suit).

Example:
Code: ags

// room script

function room_a() {
  // script for Room: Player enters room (before fadein)
  HotspotLock.SetCode(1,9,7,9, 5,0);
}

function hotspot1_a() {
  // script for Hotspot 1 (Hotspot 1): Any click on hotspot
//Button '1'
  HotspotLock.EnterCode(1);
}

function hotspot2_a() {
  // script for Hotspot 2 (Hotspot 2): Any click on hotspot
  //Button '2'
  HotspotLock.EnterCode(2);
}

 // Etc, etc ...

function hotspot12_a() {
  // script for Hotspot 2 (Hotspot 12): Any click on hotspot
  // Button 'Enter Code'
  if (HotspotLock.CheckCode() == eCodeCorrect) {
    //Code entered correctly
    Display("Well Done!");
    player.ChangeRoom(10, 120, 200);
  }
  else if (HotspotLock.CheckCode() == eCodeWrong) {
    // Wrong code entered.
    Display ("Code Invalid");
    HotspotLock.ResetCode();
  }
}


Download here:
Hotspot ComboLock Module
I know what you're thinking ... Don't think that.

jamesreg

I tried to download this but it says invalid archive tyoe or bad file when I try to open it.

I have a combination lock sequence I need to do which will involve using hotkeys
I will have a six digit code as the combination a player will be clicking on color coded hotkeys
to enter the sequence once they have clicked all six color buttons in the right order they will
hit a seventh button to test if the code was right or wrong and then the resulting action will happen.

It looks like your hotspot thing will work here but I could probably code it without a module

based on what I said here how would you do it or could you point me in the right direction
of another module or thread that might work there seems to be several out there but I been confused
about this part.

monkey0506

Geocities got eaten by a Vermicious Knid I believe. ::)

If Ashen (or someone else) doesn't respond with a mirror/updated link in the next few days it might be worth PMing him and ask if he still has a copy of it. It's also been since 2005 so there is also the possibility the module may be out of date and could potentially not work. Never used it so I don't know for sure, but just something to keep in mind.

Good luck.

TerranRich

Geocities was shut down by Yahoo. It would be sad if Geocities-hosted AGS files were just gone.

Use ShutUpload to upload files, guys. ;) I own and run it, and it's unlimited.
Status: Trying to come up with some ideas...

Dualnames

Quote from: monkey_05_06 on Thu 05/11/2009 04:45:03
Geocities got eaten by a Vermicious Knid I believe. ::)

If Ashen (or someone else) doesn't respond with a mirror/updated link in the next few days it might be worth PMing him and ask if he still has a copy of it. It's also been since 2005 so there is also the possibility the module may be out of date and could potentially not work. Never used it so I don't know for sure, but just something to keep in mind.

Good luck.

Always know where your modules are. I have probably a list of all the modules on the forums, so yes, I do have a linky, so wait up, till i fetch it eh!
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk