Holding Cells (level 2) teleporters

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Goodygumdrops
Posts: 6
Joined: Mon Oct 15, 2012 8:26 pm

Re: Holding Cells (level 2) teleporters

Post by Goodygumdrops »

Stevedog wrote:How about "walking" the real transporter thrugh the cells? Have the fake transporters show the whole time but the real transporter just hits one cell at a time in sequence 0.1 seconds apart.
Komag wrote:you got it - that's basically how my approach works, I set it to go through as fast as possible, and it's pretty convincing to be instant.
I'll have to try this, but it sounds like it might be possible to notice a difference in time if there is 0.1 seconds. That would mean the last one would happen 0.6 seconds after the first one. I guess I'll have to see what the minimal time possible is.
Stevedog
Posts: 17
Joined: Tue Mar 27, 2012 8:58 pm

Re: Holding Cells (level 2) teleporters

Post by Stevedog »

I doubt anyone would notice an overall half second delay. You would be hard pressed to even turn around and look at the transporters in that time.
Goodygumdrops
Posts: 6
Joined: Mon Oct 15, 2012 8:26 pm

Re: Holding Cells (level 2) teleporters

Post by Goodygumdrops »

Stevedog wrote:I doubt anyone would notice an overall half second delay. You would be hard pressed to even turn around and look at the transporters in that time.

I would know! And I can't get it to work, anyway.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Holding Cells (level 2) teleporters

Post by Komag »

.5 seconds is a HUGE delay and is very noticeable if you are looking for it. In the original game you can see the cells immediately to the left and right of the buttons so you can tell how fast it is happening.

It's possible with this method to get it nearly instant so the delay is only barely noticeable if you are really looking for it hard. I set my timer to 0.001 seconds, but the game program is incapable of actually doing it that fast, so I'm not sure what the end result really is, maybe 0.03 or something, for a total cumulative delay of maybe 0.2 or so.

Also, it has to be able to stand up to tons of fast repeated spamming of the buttons and still all work correctly, like the original.
Finished Dungeons - complete mods to play
Stevedog
Posts: 17
Joined: Tue Mar 27, 2012 8:58 pm

Re: Holding Cells (level 2) teleporters

Post by Stevedog »

Why not just drop the timer? I have never used LUA before last week but it works like some other languages I've used then the transporter walk can be done through script sequencing alone. I know that the syntax here will be wrong but the concept is the same.

Code: Select all

On buttonPress ()
  Local doOnce = 1
  Spawn(fakeTransport1)
  Spawn(fakeTransport2)
  Spawn(fakeTransport3)
  Spawn(fakeTransport4) 

  If doOnce == 1
    If pressure_plate1 == active
      Then spawn(transport1)
      Delete(transpot1)
      doOnce = doOnce + 1
      Else doOnce = doOnce + 1
    Endif
  Endif
  If doOnce == 2
    If pressure_plate2 == active
      Then spawn(transport2)
      Delete(transpot2)
      doOnce = doOnce + 1
      Else doOnce = doOnce + 1
    Endif
  Endif
  If doOnce == 3
    Ecetera 
You could probably get away with not using the local doOnce variable now that I'm looking at it. Actually the whole thing could be a lot cleaner, but you get the idea. Of course this all assumes that LUA follows the code in a linear fashion, then the whole script will run faster than the timer can count.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Holding Cells (level 2) teleporters

Post by Komag »

I tried something like that before but it apparently works "too" fast because nothing gets teleported, the teleporter is turned off before any time passes so it doesn't have any effect
Finished Dungeons - complete mods to play
User avatar
Shroom
Posts: 98
Joined: Tue Mar 27, 2012 6:37 pm
Location: UK

Re: Holding Cells (level 2) teleporters

Post by Shroom »

Komag wrote:I tried something like that before but it apparently works "too" fast because nothing gets teleported, the teleporter is turned off before any time passes so it doesn't have any effect
I would imagine thats because each script is processed in its entirety before the code that is triggered by the teleporter is run.

you could try splitting them out to seperate scripts, buts its likely that they will just be processed as a chain although its probably worth trying - or chaining other objects to do it may work - ie have counters that link to each new part of the script and have each snippet decrement the counter in order to trigger the next script when code that checks for those things is run (you may still have the same problem of order of processing or even race conditions of course)

hmm maybe I will have a look and see :geek:
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Holding Cells (level 2) teleporters

Post by Komag »

I did try lots of separate functions, which is pretty much what different scripts is. I spent an inordinate amount of time trying to second guess what order the program would run, and the ONLY thing that had any luck was the slight time delay method. It really is fast enough to appear instantaneous for app intents and purposes.
Finished Dungeons - complete mods to play
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Holding Cells (level 2) teleporters

Post by Komag »

just in case anyone is interested, I found that the fastest most reliable solution for this (for me at least) was to have 7 separate rooms to teleport everything into as a single interim step, then teleport all to contents of those rooms to the next cells in succession in a single step, so the whole process is only two steps in stead of 7 or 8, and is extremely fast and reliable.
Finished Dungeons - complete mods to play
Post Reply