[ZSCRIPT] Polyobject doors - unlocking and breaking
Posted: Wed Sep 13, 2023 10:53 am
Two things I want to do:
1. Create a lock pick object that when used on a polyobject all locks are removed
2. Make a polyobject destroyable by taking damage
For the first one, I thik what I need to do is create a inventory item that when used fires a linetrace. If the linetrace hits a wall, check to see if that wall is part of a poly object and if so get the poly object number. Then iterate all lines in the map looking for polyobject specials and if they point to that poly object number then remove the lock on that line.
I can create the inventory item and fire the ine trace, the rest I'm trying to figure out.
For the second one, I think I could be able to use the UDMF settings for Health and HealthGroup. I'm still tying to figure out exactly how to do that. Is it possible to destroy a polyobject like you can destory an actor? And where to put the code? An event handler? Or have a line that activates an invisible actor and put the code in that actor's activation function?
The thread on destructable geometry I'm trying to understand that but the example is done with ACS.
1. Create a lock pick object that when used on a polyobject all locks are removed
2. Make a polyobject destroyable by taking damage
For the first one, I thik what I need to do is create a inventory item that when used fires a linetrace. If the linetrace hits a wall, check to see if that wall is part of a poly object and if so get the poly object number. Then iterate all lines in the map looking for polyobject specials and if they point to that poly object number then remove the lock on that line.
I can create the inventory item and fire the ine trace, the rest I'm trying to figure out.
For the second one, I think I could be able to use the UDMF settings for Health and HealthGroup. I'm still tying to figure out exactly how to do that. Is it possible to destroy a polyobject like you can destory an actor? And where to put the code? An event handler? Or have a line that activates an invisible actor and put the code in that actor's activation function?
The thread on destructable geometry I'm trying to understand that but the example is done with ACS.