Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
xanrer

Can i move a sectors x,y,z coordinates with scripts?

Recommended Posts

Im using zdoom script thingy, im quite new, what i need is moving a sector i open press use on a door, as long as the door is open i need that sector to be there and when the door is completely closed i need it to go back to the place it started.

Share this post


Link to post

Sectors can't move about on the x and y axis, that's a fundamental limitation of the Doom engine.

 

However there are a lot of work-arounds for most things you could want to do. What exactly are you trying to achieve?

Share this post


Link to post
5 minutes ago, Bauul said:

Sectors can't move about on the x and y axis, that's a fundamental limitation of the Doom engine.

 

However there are a lot of work-arounds for most things you could want to do. What exactly are you trying to achieve?

Well this moving sector thingy was a work-around too, what i wanted to do is making levels without light shadowmaps errors.

 

Let me explain everything from start. There is a feature called light shadowmaps in gzdoom, this feature gives dynamic lights more natural formations with the walls in the room. However this feature actually doesn't work with every wall it only works with walls that are hollow inside.

 

And that creates a big problems when it comes to making things like doors. Due to the fact that doors cannot be hollow inside lights can get through them which kills the whole atmosphere.

 

For explaining it better here are few pictures.

 

First of all this is our lines (middle part is the door)(sorry its kind of dark because i have to work with dynamic lights).

https://i.imgur.com/NyOGtxP.png

Now lets say thats our door when its open with the dynamic lights at the other side

https://i.imgur.com/m68RyG9.png

This happens when you close it.

https://i.imgur.com/5Tde4xj.png

And that's not what we want.

When we cut the door and make it hollow in the middle like this

https://i.imgur.com/ILKfF9e.png

We achieve what we want.

https://i.imgur.com/2KGARR2.png

So for doing that i thought moving a sector between the two door sectors was an good idea yet that's not gonna work and i am kind of out of ideas.

 

Any ideas?

Share this post


Link to post

You could use the lighttag feature in Door_Raise or Door_Open. It is not exactly what you are looking for, but it will give you slightly more realistic lighting when the door opens (and closes) than a plain old door.

Share this post


Link to post

Tricky problem!  But there are some alternative approaches that could work:

  1. Write a script that, presuming the player has passed under the door, deactivates the dyn light once the door closes (you can use Tag_Wait for that).  Then reactivate it when the door is opened.  From the player's point of view it'll look the door blocked the light, not that the light was just turned off.
     
  2. On the dark side of the door, place a subtractive light.  You could even use a spotlight to control the exact angle.  Subtractive lights reduce light, so you can use them to counteract a dyn light.  Either just have a subtractive light the whole time, or turn one on as the door closes.
     
  3. Don't fight it: place a light texture on both sides of the door, and place dyn lights on both sides.

One thing to bare in mind: Shadowmaps require a relatively modern PC to render, so they won't always be visible to everyone playing your map.  When you release your map, make sure to call them out specifically.  Many people don't play with them turned on.

Share this post


Link to post

Thank you for your suggestions! however there always is a problem :/

  1. Even if i had the skill to write such code (which i don't) coop would be problematic.
  2. That might make some problems when there is multiple lights which sadly they are :/ However that might be the temporary solution.
  3. It is impossible with this project sadly.

Yep i know importance of that i released a mod with this feature before, so far i had no complaints from misuse. But thank you for warning me regardless.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×