Jump to content
The Dark Mod Forums

Crash to desktop using combination lock


joebarnin

Recommended Posts

I've got a CTD that happens when using a atdm:combination_lock_small. The lock is bound to a safe door (atdm:mover_door). I can get it to happen every time by setting the combo correctly (which opens the door), then closing the door, then trying to spin one of the combo dials again - as soon as you do this TDM crashes.

 

I cranked up logging. I saw one thing interesting, that didn't show up until the CTD:

 

[game\BinaryFrobMover.cpp ( 533):DEB (FROBBING) FR: 5085] [safe_door1] FrobMover is locked
This might be related to the crash because it's the last thing that is logged, just before all of the C++ destructor logging (which I assume is associated with the crash). E.g.:
[game\Entity.cpp (1889):DEB (FUNCTION) FR: 5085] this: 327766FC [idEntity::~idEntity]
But that's just a guess.
Anyway, it was suggested that Obsttorte might be the right person to help me with this? I've got a simple test map that displays this issue. Or let me know if there's anything else I should try.
Thanks.

Edit - I've experimented with different spawnargs on the combination lock, trying to see if that changed behavior - no luck. Also, I found a different FM that used the same lock (and doesn't crash), and tried to see what it does differently, but so far I can't figure out why it works and mine doesn't.

Edited by joebarnin
Link to comment
Share on other sites

The combination lock needs to target the door that it is suppossed to open (as said in the description!!!). You most probably missed that.

 

 

post-11230-0-97597400-1536823595_thumb.jpg

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

I added the following to the beta test thread, maybe it is useful here:

 

I found out one more thing: It crashes, if the dial is touched, after the safe opens.

 

Since I'm using the mousewheel for dialing, I seem to overshoot the last number one in five times.

 

Reproducing it with the keys also will lead to a crash, if you put in one more keystroke, as the number you'll need.

 

So it looks like its not the opening per se, but dialing after it opens - even if the door hasn't moved yet.

 

Maybe this can help to get to the bottom of this.

Link to comment
Share on other sites

The combination lock needs to target the door that it is suppossed to open (as said in the description!!!). You most probably missed that.

 

 

The lock does target the door. I've created a very simple test map (attached). It is just a locked door, with a combination lock bound to it (and it targets the door too). I can get the CTD to happen every time: set the combo to 111, which opens the door. Close the door, then try to change the combo in any way. Poof.

 

Here are the two entities. You can see that the combination lock targets and binds to the door.

 

// entity 3
{
"classname" "atdm:3panel_104x56"
"name" "door"
"origin" "64 64 768"
"rotation" "1 0 0 0 1 0 0 0 1"
"lock_picktype" "-"
"lock_pins" "0"
"locked" "1"
"rotate" "0 90 0"
"used_by" "-"
}
// entity 4
{
"classname" "atdm:combination_lock_small"
"name" "combo_lock"
"bind" "door"
"combination" "111"
"frob_peer" "door"
"frobable" "1"
"model" "models/darkmod/mechanical/combination_housing01_small.lwo"
"origin" "34.76 61.875 821.75"
"rotation" "1 0 0 0 1 0 0 0 1"
"target" "door"
}
Link to comment
Share on other sites

Summary: I think I figured it out. Looks like there's a bug in tdm_numberwheel_lock.script. I can work around it in my FM, but I don't know what the real fix is.

 

Details: I have a software background, so I download the DarkMod source code, and VisualStudio, and did some debugging. Eventually I figured out that the crash is happening on line 73 of tdm_numberwheel_lock.script:

 

callGlobalFunction("closeBar",$safe_bar);
From my limited understanding of scripting, this code requires that the mod have a script called "closeBar" and an entity named "safe_bar". My mod had neither. I found an FM (Mission 1: A New Job) that uses the combination lock, and it has both. I think what this code is doing is, when you spin a combo dial away from the correct combination, it should close the "safe_bar" (slide it closed) which effectively locks the safe.
My safe doesn't have a safe_bar, so the hard-coded references in tdm_numberwheel_lock.script cause the crash. I can work around it by creating a dummy "safe_bar" entity in my map, and a no-op "closeBar" script.
But perhaps that script code should be more bullet-proof, so that if those objects don't exit, the app doesn't crash?
  • Like 1
Link to comment
Share on other sites

Fuck, completely forgot about that. This issue has come up several times now.

 

The script shipped with the mod was specifically designed for the "A New Job" Mission and should have been placed in the corresponding fm folder. I noted the misplacement in the past but the file hasn't been moved by now.

 

For anyone using the script, remove the closeBar line.

 

I would say sorry for the circumstances, but it isn't my fault to be honest. :mellow:

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Perhaps I'm misunderstanding, but tdm_numberwheel_lock.script is part of the standard DarkMod install, in tdm_base01.pk4. I wouldn't think it was possible to modify that file. Can it be overridden (it defines an object called numberwheel_lock)? (Anyway, my workaround works fine).

Link to comment
Share on other sites

Perhaps I'm misunderstanding, but tdm_numberwheel_lock.script is part of the standard DarkMod install, in tdm_base01.pk4.

It shouldn't. :(

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 0 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...