Page 3 of 3
Re: [Blender]SlidingDoor OpenClose&EnableDisable NodeTrees
Posted: Sun Sep 06, 2020 9:20 am
by Maroonroon
Hello

So... After a break, I have finaly finish converting my Blend files to Korman, re-scale the objects (for some other reasons), and then testing the Node Tree in game (Complete Chronicles only, for now).
Note:
- Take a look at the nodes elements titles, they gives informations.
- The sounds used are probably not the definitive sounds.
Here's my working "OfficeDoorOpenClose" Node Tree (for a door with "exterior one shot animations", but it's easy to delete the "exterior one shot animations"):
- Show Spoiler
Node Tree attached to the door animated object (the parent object).
There's no collider and the only 2 collisions are in the clickables objects; the exclude region is used as the door collider...
[url=https://forum.guildofwriters.org/download/file.php?id=2717][attachment=1]office_door_open_close_node_tree_4.png[/attachment][/url]
And here's my working "OfficeDoorEnableDisable" Node Tree (for a "lockable from inside only" door, but it's easy to add "lockable from ouside" elements in this Node Tree, using the "OfficeDoorOpenClose" Node Tree as model):
- Show Spoiler
Node Tree attached to the door interior lock clickable, which is a child of the animated interior lock button (visual element).
The door is enabled (but closed) by default and is "force enabled" when the Age is empty.
[url=https://forum.guildofwriters.org/download/file.php?id=2718][attachment=0]office_door_enabled_disabled_node_tree.png[/attachment][/url]
SDL:
- Show Spoiler
[code]STATEDESC StiltHouse01
{
VERSION 1
# Age Mechanics
VAR BOOL OfficeDoorClosed[1] DEFAULT=1
VAR BOOL OfficeDoorEnabled[1] DEFAULT=1
}[/code]
Re: [Blender]SlidingDoor OpenClose&EnableDisable NodeTrees
Posted: Mon Sep 07, 2020 7:14 am
by Maroonroon
Now I have to understand how to set the Python file...
For only 1 door, the "OfficeDoor" with the "OfficeDoorClosed" variable, the Python file is like this:
- Python File: Show Spoiler
[code]from Plasma import *
from PlasmaTypes import *
gPages = [
'FemaleSwimDockExit',
'MaleSwimDockExit']
# Note: Change all "ptResponder" to "ptModifier" for a Modifier class
class StiltHouse01(ptResponder):
def __init__(self):
ptResponder.__init__(self)
self.id = 281000
self.version = 1
PtPageInNode(gPages)
def OnFirstUpdate(self):
pass
def OnServerInitComplete(self):
sdl = PtGetAgeSDL()
sdl.setFlags('OfficeDoorClosed', 1, 1)
sdl.sendToClients('OfficeDoorClosed')
sdl.setNotify(self.key, 'OfficeDoorClosed', 0.0)
def OnNotify(self, state, id, events):
pass
def OnSDLNotify(self, VARname, SDLname, playerID, tag):
if SDLname != 'StiltHouse01':
print 'SDLname =', SDLname, ', not StiltHouse01'
elif VARname == 'OfficeDoorClosed':
ageSDL = PtGetAgeSDL()
getSDL = ageSDL[VARname][0]
def __del__(self):
for page in gPages:
PtPageOutNode(page)
### Python Glue ###
[...][/code]
But how to add in it the "OfficeDoorEnabled" variable?
And how to add another door, the "LivingRoomDoor" for example, with the "LivingRoomDoorClosed" variable and the "LivingRoomDoorEnabled" variable?
Re: [Blender]SlidingDoor OpenClose&EnableDisable NodeTrees
Posted: Tue Sep 08, 2020 8:51 am
by Tsar Hoikas
You don't need to add anything to your Age's python file for doors - the python files you specified in the node tree handle everything for you. The stuff you have in the age python file related to OfficeDoor and OfficeDoorClosed doesn't do anything of relevance.
Re: [Blender]SlidingDoor OpenClose&EnableDisable NodeTrees
Posted: Tue Sep 08, 2020 1:47 pm
by Maroonroon
Ah ok, thank you very much.
- Python File: Show Spoiler
[code]from Plasma import *
from PlasmaTypes import *
gPages = [
'FemaleSwimDockExit',
'MaleSwimDockExit']
# Note: Change all "ptResponder" to "ptModifier" for a Modifier class
class StiltHouse01(ptResponder):
def __init__(self):
ptResponder.__init__(self)
self.id = 281000
self.version = 0
PtPageInNode(gPages)
def OnFirstUpdate(self):
pass
def OnServerInitComplete(self):
pass
def OnNotify(self, state, id, events):
pass
def OnSDLNotify(self, VARname, SDLname, playerID, tag):
pass
def __del__(self):
for page in gPages:
PtPageOutNode(page)
### Python Glue ###
[...][/code]