Can I use a script to spawn a door?
Débuté par
Tyndrel
, mars 19 2013 11:25
#1
Posté 19 mars 2013 - 11:25
I have a building placeable that only spawns whan approached, it seems (from experimentation and the Lexicon) that I cannot use the same function (CreateObject) to spawn a door. Is there some way to do this?
#2
Posté 19 mars 2013 - 02:13
<musing...>
While I can't think of any way to script a proper door, I can think of a way to fake it.
This would requie a placeable, preferable animated door and a placeable SAM.
You'd have to calculate the position and facing of each (perhaps using a waypoint pair - one for the building and one offset for the door/SAM).
When the door is activated (opened), spawn in the SAM. When the SAM is clicked on, transition.
<...aloud>
While I can't think of any way to script a proper door, I can think of a way to fake it.
This would requie a placeable, preferable animated door and a placeable SAM.
You'd have to calculate the position and facing of each (perhaps using a waypoint pair - one for the building and one offset for the door/SAM).
When the door is activated (opened), spawn in the SAM. When the SAM is clicked on, transition.
<...aloud>
#3
Posté 19 mars 2013 - 02:16
No, spawning a door is not possible.
However, you can spawn one of the several door placeables with either the standard 'secret door' script attached to it in its OnUsed event, or create your own script on a custom door placeable. I'm not sure what your building placeable looks like so the placeable door may not completely cover the door entrance, and there will be a little work involved to get the placeable door setup correctly so it moves the people who use it to where you want.
However, you can spawn one of the several door placeables with either the standard 'secret door' script attached to it in its OnUsed event, or create your own script on a custom door placeable. I'm not sure what your building placeable looks like so the placeable door may not completely cover the door entrance, and there will be a little work involved to get the placeable door setup correctly so it moves the people who use it to where you want.
#4
Posté 19 mars 2013 - 04:20
Thanks folks, I used a placeable door to calculate the exact position for the waypoint, I'll just have to use a placeable door for the actual spawn too. Back to the drawing board.
#5
Posté 20 mars 2013 - 02:12
Ooooor ... depending on the scene you're setting up, you could use an actual door and just cover it with a larger placeable to hide/disguise it. Then, when you spawn in your hidden building, destroy the obscurring placeable to reveal the door as well. Of course, the door existing might give away where to look when a player is "mousing" around the map "looking" for stuff to find.
#6
Posté 20 mars 2013 - 08:18
I'm using the NwN 2 building placeables, converted by The George, to make a "Ghost village". The destroyed buildings are spawned in the area "OnEnter" but if a player approaches a building they enter a trigger that changes it into it's non-destroyed counterpart. I was just surprised to find that the "CreateObject" function didn't work with door object types. It was always going to be tricky to make it function just like a normal area, I'll just have to make it as close as I can but choosing to enter a building that you know wasn't there a moment before probably shouldn't be that normal anyway.
#7
Posté 20 mars 2013 - 12:56
Can you copy doors? That might allow storing prefab doors in a DM area, then copying them to the new location, if possible.
#8
Posté 20 mars 2013 - 10:41
Has anyone tried applying cutscene invisibility to a door? You could leave it open, then shut it and strip the effect, depending on your specific needs for the Ghost Village. Haven't tried, so may not work. Just spitballin'.
Funky
Funky





Retour en haut






