[MAP] - View Points

Status
Not open for further replies.
https://wiki.srb2.org/wiki/Cut-Away_View

If you want to run it when you press a button in the map, just set up a normal linedef executor with that effect, tagged to the button. If you want it to run when you press a button on the keyboard, use Lua to trigger a linedef executor set up in a similar fashion.

Code:
addHook("MobjThinker", function(mo)
    if not mo.player then continue end
    local buttons = mo.player.cmd.buttons
    if buttons & BT_CUSTOM1 then -- or any other button you'd like
        P_LinedefExecute(4000, mo) -- or any other tag you'd like
    end
end, MT_PLAYER)

(You could also manually search for the object and set player.awayviewmobj, player.awayviewtics and player.awayviewaiming manually, if you're prefer.)
 
https://wiki.srb2.org/wiki/Cut-Away_View

If you want to run it when you press a button in the map, just set up a normal linedef executor with that effect, tagged to the button. If you want it to run when you press a button on the keyboard, use Lua to trigger a linedef executor set up in a similar fashion.

Code:
addHook("MobjThinker", function(mo)
    if not mo.player then continue end
    local buttons = mo.player.cmd.buttons
    if buttons & BT_CUSTOM1 then -- or any other button you'd like
        P_LinedefExecute(4000, mo) -- or any other tag you'd like
    end
end, MT_PLAYER)

(You could also manually search for the object and set player.awayviewmobj, player.awayviewtics and player.awayviewaiming manually, if you're prefer.)


I guess buttons work better, I'll try it out. Thanks!

Edit:
One more thing, if I were to press the buttons and I didn't want the character to move, what set up to be used there?
 
https://wiki.srb2.org/wiki/Cut-Away_View

If you want to run it when you press a button in the map, just set up a normal linedef executor with that effect, tagged to the button. If you want it to run when you press a button on the keyboard, use Lua to trigger a linedef executor set up in a similar fashion.

Code:
addHook("MobjThinker", function(mo)
    if not mo.player then continue end
    local buttons = mo.player.cmd.buttons
    if buttons & BT_CUSTOM1 then -- or any other button you'd like
        P_LinedefExecute(4000, mo) -- or any other tag you'd like
    end
end, MT_PLAYER)

(You could also manually search for the object and set player.awayviewmobj, player.awayviewtics and player.awayviewaiming manually, if you're prefer.)


Alright so if I were to make it a true false statement to open/close a door, what can I do about that? I'm trying to understand LUA as much as I can but eh, it's not coming around.

I have two doors set up and using BT_CUSTOM1 and BT_CUSTOM2 to close left and right doors, but I want to execute BOTH OPEN AND CLOSE.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top