Jump to content
The Dark Mod Forums

Working Combination Lock Download


Fidcal

Recommended Posts

Testmap works like a charm cool.gif but you hav´t given the code for the combolock in the map or text fileunsure.gif 1,2,3,4 not that hade to figure out wink.gif

Is the only way to set the code to rename the .script to .txt and then set the code there and name it back to .script???

string TestCombo()
{
vector angles;
float num1, num2, num3,num4;
string numString="";

num1 = getNum($NumWheel1);
num2 = getNum($NumWheel2);
num3 = getNum($NumWheel3);
num4 = getNum($NumWheel4);

That giv the code; 1,2,3,4

so to set the code to say 1,9,7,4 it would look like this

string TestCombo()
{
vector angles;
float num1, num9, num7,num4;
string numString="";

num1 = getNum($NumWheel1);
num2 = getNum($NumWheel9);
num3 = getNum($NumWheel7);
num4 = getNum($NumWheel4);

or what???

 

EDIT: nop it´s not it wink.gif

Edited by Nielsen74
Link to comment
Share on other sites

Sorry, my mistake. I put it in the script file at the top but missed it out of the instructions I'll add it now and update it...

 

Each number wheel entity must have a spawnarg wheel_digit with the combo digit you want for that wheel. You don't need to change or set anything in the script file normally.

Link to comment
Share on other sites

yer I had another readthrough of the text file and it´s right there in the middel blush.gif

 

This zip contains files to get a combination lock (numberwheel machine) working in Dark Mod:

A demo map: combolock.map which shows it working

A script file: combolock.script which is needed to make it work

A prefab to insert it into your own maps

 

The prefab consists of 4 numberwheels and machine, 8 buttons & 9 atdm:target_callscriptfunction entities,

2 levers (one mirrors the other in case you need one inside to get out) and one door

(which can be eg, a chest lid or whatever.)

 

The lever not only tests the player-entered combination but also unlocks and opens the door.

The door is frobable so can also be opened and closed normally once unlocked but it can also be made unfrobable

with frobable 0 so it is only operated by the lever if preferred.

 

The script is not optimised but handles up to 2 combination locks in one FM. It might be made obsolete at some

future time with an official coded entity but that should not break this scripted method.

 

The script unlocks and opens a door entity which must be named ComboDoor (or ComboDoor2 for 2nd combo)

 

The number wheel entities must be named NumWheel1 to 4 (or 5 to 8 for 2nd combo)

 

Each number wheel entity must have a spawnarg wheel_digit with the combo digit you want for that wheel.

 

IMPORTANT: When inserting the prefab into your map, names and targets are likely to change so you need to correct

them all one by one to the above. This needs great care but I can't find any easy way to do it. You might try

backing up your map and pasting the prefab text at the end of your map in a text editor.

I've not tried this but it should be OK; all entities have very distinctive names like ComboLockBackPlate so

hardly likely to clash. It should then work immediately. Otherwise insert the prefab normally and change the following...

 

The door name.

The number wheel entities

The call spawnarg on the atdm:target_callscriptfunction entities must be named thus...

NumWheel1Up & Down and the same for 2, 3, 4, etc

The buttons can be any name but they must target the tdm:target_callscriptfunction entities

The levers can be any name but the main one must target the ScriptTestCombo entity.

 

The entire script text from combolock.script should either be copied into any existing script file you are

already using with your map or..

 

The script file combolock.script should be renamed to the same as your map and put in your maps folder,

eg mymapname.script

 

my bad blush.gif sorry smile.gif

Edited by Nielsen74
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 0 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
×
×
  • Create New...