chris
Junior Member
Posts: 58
|
Post by chris on Oct 7, 2024 10:15:22 GMT -5
Here's a cool trick for making hinged doors. This seems to be an undocumented remnant from the early days of the DOS engine (Lethal Tender, etc.). First, create a door, it doesn't matter which way you have it set to open, but go ahead and select which key, if any, you want to require. Next, select the door and Edit Attributes. For the first box, decide whether you want the door to hinge left or hinge right. 6200 will hinge left, 220 will hinge right.
For the second box things get weird. Refer to this chart: Orientation | 1st Red Box
| 2nd Red Box
| North-opening, hinge left | 6200 | (552,584,648,680,712,744,776) | North-opening, hinge right | 220 | (784-776) | South-opening, hinge left | 6200 | (24,56,88,120,152,184,216) | South-opening, hinge right | 220 | 256 | East-opening, hinge left | 6200 | (256,288,320,352,384,384,416) | East-opening, hinge right | 220 | (520-512) | West-opening, hinge left | 6200 | (784,816,848,880,912,944,976) | West-opening, hinge right | 220 | (24-16) |
*If you want the door to open faster, try 1026 or 5200 for right hinge, and 7600 for a faster hinge left. These series of numbers are how much you want the door to swing open. The middle number should be 90 degrees, and adjusting up and down will open the door more or less, depending on the size of your room, etc. You could go beyond those numbers but I think for the majority of cases these are the ranges you're looking for. As you can see I really struggled with south-opening, right hinge doors, I could only get it to work at 90 degrees. Note I haven't completely reverse-engineered this. I'm sure these numbers reflect multiplying and adding certain numbers, but I'm not exactly sure what those numbers are. I believe there's also a way to change the sound the doors make when opened, but I don't remember how to do that. However, they will default to the creaking and slamming door sounds, which is awesome. You also might notice that some orientations seem to want to spin 360 degrees before setting themselves closed. I believe there's probably a better set of numbers to prevent this from happening, but I haven't found it yet. If you crack the code a better way, let me know. Another note. I believe this feature no longer works in the GCSW 3 engine. It will revolve the door infinitely, never finding a closed position. I haven't done much experimenting either though, but this is what I remember from years ago. Regardless you might find a use for an infinitely revolving panel in the Windows engine.
|
|
|
Post by lgb3d on Oct 7, 2024 11:36:02 GMT -5
Cool! I can't wait to try this. Awesome Do you remember how you discovered this? A few times in the past by mistake I discovered how to make slanted polygons in dos engine that set on a diagonal horizontally. Discovered by accident by messing with attributes and could never remember how I did it although I've done it a few times by mistake messing with the attributes.
|
|
chris
Junior Member
Posts: 58
|
Post by chris on Oct 7, 2024 11:59:32 GMT -5
The first I remember hearing about this was the GCSTalk email list back in the 90s. Somebody had discovered it by accident, I think someone else asked Kevin about it and he was like, "oh wow I can't believe that still works, if it does in fact still work." Then I remember reading GCS Dojo #1 (http://leileilol.mancubus.net/garyacordsucks/64.246.6.138/_gcsgames.com/Tutorials/index.htm) from John Worsham (the other GCSW developer besides Kevin... anyone talked to him lately?) which has a brief mention of how to make a revolving door. Using that as a baseline, I literally just spent a day punching numbers into the red boxes and writing down what they do.
As far as what you're talking about with polygons, I definitely did that once somehow! I rotated the polygon 45 degrees probably by playing with the red boxes, and I have no idea what I did. I wanna say the GCSP manual might mention how to do this? It would be nice to know since there's no way to do it with the level editor.
|
|
|
Post by lgb3d on Oct 7, 2024 12:19:52 GMT -5
Yeah sometimes I've tweaked out and just put numbers and the attributes boxes trying to find things. Always important to take notes once you discover a change. Cool story on the history I was never on that mailing list but I remember it being advertised back in the day.
The slanted polygons I want to say it's in the attributes and it's either putting one of the numbers as a negative and don't draw back or something like that I've messed around a little bit a few times and not discovered it. Somewhere I have a screenshot from when I did achieve it like wow and I wrote down a little note on a piece of paper but it wasn't a real important Discovery at the time so I lost that piece of paper.
Can't wait to be off work and try these doors that spin on a pivot point this is going to be cool
|
|
|
Post by lgb3d on Oct 7, 2024 21:06:34 GMT -5
Wow this is super cool definitely takes a bit of tweaking. But it sure is a real game changer..
My first door that I'm trying this on sets north to south and opens to the West so I used West opening hinged left. And I noticed that it draws the door hinging location at the center of where the graphic was actually placed on the map. So I go back into the editor and I offset the location of the door it's a 400x400 so I move it 200 units and now the hinge is right at the corner of the wall. The door is located in a hallway with two perpendicular walls on each side of the door so at 784 which is hitting a perfect 90° angle the pixels blend with the wall behind when doors open. I tried adjusting the numbers a little bit and I see what you mean that you get a variety of different outcomes.
I think part of the learning curve is to build your level considering the door function knowing how and where it's going to Pivot don't stick it in some tight narrow hallway and expect 90° to work. You would have to construct the hallway in a way that considers the doors point B.
In my case since a warp to point is directly behind the door like as soon as you cross the threshold.. if I offset the wall behind the door where the hinge is it comes off beautifully as the player would never see that little Gap.
I have very few doors in my game. Almost all of the doors are blocking the player from a warp to point. So offsetting the wall behind it just a little bit would be the fix for me and my situation
|
|
|
Post by lgb3d on Oct 7, 2024 22:03:50 GMT -5
Crud I was just exploring a little bit more.
These type doors do not require key, as well do not open on explosion.
In the attributes the first red box appears to be used for resistance to damage open on explosion and the second red box is the key required..
If you first place a door and use the default door placement tool select a key type for it and get the key type # from the second red box you add the angle of pivot to that number in second box.. and repace first number with pivot door number, it will still require key and still pivot. Good.. But if you mess with the first Red Box trying to add or subtract the swinging door number from the existing number produced with resistance to damage and open on explosion you get all sorts of different outcomes but you lose The Swinging Door.
So I might be wrong but these doors can require key but cannot be blasted open with explosives
|
|
chris
Junior Member
Posts: 58
|
Post by chris on Oct 8, 2024 7:05:00 GMT -5
I would suggest creating doors and watching to see how the red boxes get populated. I looked through my notes and it looks like if you divide the second red box by 1024 you'll get the pickup scancode for the key you select. So you might try doing the opposite to get keys working for the hinged doors. You know how it goes, many of these red boxes have 2-3 numbers crammed into one integer to save RAM using *256, *1024, etc. I'm pretty sure I accidentally created tons of hinged doors that required keys, so it's doable. As far as damage resistance and open on explosion, I'm not sure how those factor in, but see how it affects the boxes and maybe there's a way to work it into the numbers.
Heck yeah, once you figure out the weird placement though it's a cool trick. I'll be using it in my game as well.
|
|
|
Post by lgb3d on Oct 9, 2024 17:35:11 GMT -5
A little further testing and experiments.
Guards can see through this door and will shoot you through the door. My doors I'm using this feature on right now are a windowed wall with a little caged window so it makes sense. The player can shoot through these doors as well.
Guard approaches door door always opens for guard..
Open on explosion still a bit of a mystery.
But I have discovered although a placeable bomb that is triggered with the B button no matter how close or precisely placed will not open the door. Throwing a grenade at the door when the grenade bounces off the door the door opens even before the explosion it needs an object into 3D World to make contact with it it's not reacting to the blast. The same works with rockets you shoot a rocket at the door the door opens when the graphic of the rocket makes contact with it
Shooting a rocket at the door and it opening looks about right. But throwing a grenade and it bouncing off the door and the door swinging open before the explosion goes off just looks wrong.
Here's the funny part. Set the door to function with the key and swing.. guards will still shoot through it you can shoot through it guards can still open it. But you can not bounce a grenade off of it or hit it with a rocket to open.
|
|