#if you create the door with lua just

1 messages · Page 1 of 1 (latest)

quiet crescent
#

Could you give me a little more information about this?

I'm seeing two options for adding outputs:

#

What, if anything, am I missing here?

#

@quartz geyser, in case creating a thread doesn't ping you

quartz geyser
#

ent:SetKeyValue("OnOpen", "portal,Open,,0,-1")

#

this is another way to add outputs

quiet crescent
#

Interesting

quartz geyser
#

thats how the engine internally creates entities for the maps

#

it just creates the ent and sets all keyvalues, outputs are just keyvalues too

#

there are couple ways to add outputs

#

ent:Fire("AddOutput", "OnOpen portal,Open,,0,-1") would work too

quiet crescent
#

What are the values you're using?

#

Where are you getting those?

quartz geyser
#

the format is

quiet crescent
#

Looks like comma-delimited arguments

quartz geyser
#

named_ent,Action,parameter,delay,repeats

#

valve developer wiki has all the info about this

#

you can also see it in hammer if im not mistaken if you disable the advanced view

quiet crescent
#

door:Fire( "AddOutput", "OnFullyOpen " .. portalName .. ":Open::0:-1" )

quartz geyser
#

whats the issue?

quiet crescent
#

Oh

#

This won't work

#

I don't know why I didn't see that before

#

These outputs only fire when the door opens/closes

#

I'm not opening the door, I'm moving it in the same way that it would normally move when opening, via MoveAngular, but without actually firing the Open input

#

Because the Open input does other things that I don't want to do in my use case

#

So, that AddOutput thing did work in terms of adding the output, but did not work in terms of actually solving my problem

quartz geyser
#

what is the problem?

quiet crescent
#

The issue is that area portals don't know that the prop_door_rotating is open because I'm not firing the Open input, so I need to manage the area portals for a given door myself

#

When the door finishes moving, it automatically calls the C++ function MoveDone, which changes depending on the door's current state

#

In some cases, that MoveDone function turns off the attached area portals, which is bad

#

I'm trying to find a way to keep the area portal open

quartz geyser
#

that sounds all very hacky to what you are doing

quiet crescent
#

I wouldn't call it "hacky" per se

quartz geyser
#

what is the point in bypassing the normal functionality of doors?

quiet crescent
#

I'm adding "breaching" functionality to doors

#

In order for it to work properly, I need to be able to move the doors to angles other than their normal open/close angles

#

Doors don't support that, so I'm recreating the method doors use to move internally

quartz geyser
#

why not recreate prop_door_rotating in lua then and keep the outputs working

#

sounds like you are almost there already

quiet crescent
#

I'd like to do that at some point, but that's a larger scope than I have right now

quartz geyser
#

you are kinda breaking maps with this

quiet crescent
#

My goal here is to not do that

quartz geyser
#

yeah but in order to not do that is to do what valve intended

quiet crescent
#

What aspect of this breaks maps?

quartz geyser
#

you are not firing any outputs

quiet crescent
#

Not currently, but it's not done yet

quartz geyser
#

you cant really force an entity to fire outputs, at least not as long its not implemented in lua

#

well I suppose you could capture all the registered outputs and do it manually

quiet crescent
#

The door doesn't necessarily need to be the one to actually fire the output, it just needs to be blamed for firing the outputs

#

It also doesn't need to be perfect, it just needs to work in the majority of cases where someone might want it

#

But area portals breaking is a pretty big case

quartz geyser
#

i mean this sounds rather simple to do, at some point you are forcing it open so just lookup the linked portal entity and open it

quiet crescent
#

Yep, and I've done that

quartz geyser
#

so where is the problem at 😄

#

if those doors no longer work remove the area portal from the door

quiet crescent
#

One moment, let me grab that

#

SetMoveDone is the issue

#

It's a pointer to a function that will be called when the door arrives at the angles it's moving to

#

That gets set all over the class depending on what state the door is in

#

I have no control over it

#

I cannot suppress it

#

I also cannot detect it

#

So when the door moves, something will happen to it

#

One of the things that it can do is to tell its attached area portals that they should turn off

#

Which leads to the issue you can see in that video above where the area portal opens, then closes as soon as the door finishes moving

#

In this case the door is just moving slightly in-place to show that it's broken

#

I can do something like this, but there's always going to be a delay of some kind between the door finishing its movement and the timer firing, which leads to an unpleasant flicker

OpenAreaPortals( door )
timer.Simple( moveDuration + 1, function()
    if not IsValid( door ) then return end
    OpenAreaPortals( door )
end )
#

If I don't add to the moveDuration, it doesn't work. Presumably because the function call happens before the MoveDone function does