Difference between revisions of "Korman:Logic Nodes"
m (→One Shot) |
m (→Responder Nodes: Fixed spelling. Nodes don't have monetary value.) |
||
Line 36: | Line 36: | ||
Responder nodes are where you want to start with your tree. They are essentially the "brain". Other nodes will stretch outward from them. | Responder nodes are where you want to start with your tree. They are essentially the "brain". Other nodes will stretch outward from them. | ||
− | <blockquote>NOTE: Responder Command nodes have been | + | <blockquote>NOTE: Responder Command nodes have been deprecated and are no longer needed.</blockquote> |
====Responder==== | ====Responder==== |
Revision as of 09:54, 14 July 2020
This is a tutorial page. |
This tutorial will cover Blender's Node Editor and the basic functions of each type in Korman.
Contents
Introduction
Nodes are a visual system that allows an artist to view a system in a graph of inputs and outputs that can be hooked up to produce the effect desired by the artist. This is a very powerful system and is therefore used as the basis for all game logic exposed by Korman. Logic Nodes are used instead of PyPRP's more cumbersome AlcScript. This means that if your age was originally created in PyPRP, Korman will not attempt to read the AlcScript.
Setting Up
It's best to have a lot of space in your Blender window while working with your node trees. You can switch one of your windows to the Node Editor window.
Use the mouse to stretch the window as big as you like. Your other windows will be out of view, but you can always move things back.
First, click the + sign to start a new NodeTree. You can rename this tree to something unique.
Click Add on the menu bar and choose the type of node you would like.
Once you have your first node on screen, you can start branching the node three using two methods:
- You can continue using the Add menu and linking the nodes together with the sockets.
- You can click the + next to any socket. It will either add the node (if only one kind can connect) or give you a selection of nodes that can connect to the socket.
Types of Nodes
Soft Volume Nodes
To read about the Soft Volume nodes, see this tutorial.
Python Nodes
To learn more about Python nodes, see this tutorial.
Responder Nodes
Responder nodes are where you want to start with your tree. They are essentially the "brain". Other nodes will stretch outward from them.
NOTE: Responder Command nodes have been deprecated and are no longer needed.
Responder
This node is where you will start and where all your responder states will connect.
- Reference: This socket is used to connect the responder tree to a Python script.
- State (ID): Socket that connects the various responder states. A new socket will appear when the previous one is connected.
- Generally, Detect Trigger is the only thing checked.
- Detect UnTrigger will stop the responder to which it's connected.
- Don't F-Fwd Sounds, when checked, will play sounds if things are fast-forwarded.
- Condition: Socket connects to either a clickable object or region sensor object.
Responder State
You can use multiple states for your object, with one marked as your Default State, the state in which the object starts.
For example, you would have one responder state for a closed door to open, then another to close the open door. Which responder state you mark as default will determine if the door is open or closed when you first Link in.
- Send Message: the first set of actions in your responder will connect here. Multiple message nodes can connect to this single socket.
- Triggers State (right side): connect this socket to the next responder state.
- Default State: Determines if the responder state is the starting state. Only one responder state should be checked!
- Triggers State (left side): this socket will receive a connection from the previous responder's Trigger State (right side).
- Responder: Connects to the main Responder node's State (ID) node.
Responder Tree Examples
Below are examples of a responder with one, two, and three states and how they interconnect.
Message Nodes
Message nodes will tell URU what action it should do and in what order.
Animation Messages
Using these will change the animation of a particular object or texture. Before wiring, be sure the object in question has an animation.
- Type - choose which kind of animation to trigger: object or texture
- Object - the modeled object that contains the animation.
- Material - if you choose texture for type, this tells which material has the texture with the animation you want.
- Texture - once the material is chosen, here you choose the texture that has the animation.
- Go To - tells the game where you want the animation to start. Don't Change will leave the animation wherever it last left off.
- Action - tells the game that you want to play, stop, toggle between start and stop, play to a certain frame, or play to a certain percentage of the animation.
- Direction - tells the game which way you want the animation to play: forward or backwards.
- Looping - tells the game whether you want to loop the animation after triggering it or not.
- Loop Begin - the first frame of the animation you'd like to play. This can be any frame within the animation if you don't want it to start at the very beginning.
- Loop End - the last frame of the animation you'd like to play. This can be any frame within the animation if you don't want it to stop at the very end.
- Callback - when the responder is notified. End is at the end of the action, Stop is when there's a message, and (None) doesn't tell the responder anything. Usually, End is the best option.
Example:
Enable/Disable
The Enable/Disable node generally links to a clickable node or a region sensor node, but can influence most objects. It can affect audio, physical attributes or the visibility of a clickable or region sensor, or a combination on all three.
- Send To: Socket connects to the object you want to enable or disable.
- Enable/Disable: choose which function you'd like the node to do.
- Send To Children: this will send the same command to any other objects parented to the selected object.
- Affects: an enable/disable node can affect multiple aspects of an object.
- Audio: affects any sound mod associated with the object.
- Physics: affects any bounds associated with the object.
- Visibility: affects the draw of the object, making it either visible or invisible.
- Modifiers: affects any Plasma modifiers attached to the object.
If you want to enable or disable a scene object instead, pair this node with the Send To Object node.
Exclude Region
The exclude region node is used to keep an avatar from getting stuck in moving objects, such as doors. You want to link this node to a region surrounding the moving object in question.
- Region: defines the exclude region object.
- Cmd: Determines what the region will do.
- Clear will move the avatar within the region to a safe point.
- Release will let the avatar back out again.
- Sender: connects to either a responder state or another message node.
Footstep Sound
You can use this node if you would like to wire a footstep region manually. Alternately, you can also use a footstep modifier on your region.
- Surface: Chooses the type of footstep noises the surface will have.
- Sender: connects to either a responder state or another message node.
Link To Age
NOTE: There is now an easier method of creating Linking Book logic. This node and the node tree method will still work too.
The Link To Age node is the node that actually tells Uru which Age and what instance of that Age to Link the avatar.
- Rules
- Basic: This will Link an avatar to a public instance of an Age.
- Examples: Ae'gura, Kirel
- Sub Age: An instance of the Age that can only be Linked to from a particular instance of the Age from which you Link.
- Examples: Eder Delin and Tsogal
- Child Age: This instance will take you to a version of the Age only reachable from an Age you've already visited (ie "own", like personal Ages or neighborhoods).
- Example: Gahreesen book in the hoods.
- Owned Age: This will Link the avatar to their personal instance of an Age. THIS WILL FAIL IF NONE EXISTS
- Original Age: This will link the avatar to their personal instance of an Age. If none exists, the book will create one.
- Basic: This will Link an avatar to a public instance of an Age.
- Parent Age (Child Age Rules Only): Specifies the filename of a parent Age for the child Age.
- Age Filename: The filename of the Age as it appears in the DAT folder.
- Age Instance: If the filename doesn't match the Age's name, type the proper name here.
- Example: Garrison.age is renamed Gahreesen
- Age GUID (Basic Rules Only): Utilizes the GUID of the instance in question. Needed for public instances.
- Spawn Title: The name of the spawn point the avatar will Link to.
- Spawn Point: The object name of the spawn point. LinkInPointDefault is the most common.
One Shot
A One Shot node is used to move the avatar to a specific point.
- Anim - the animation you would like the avatar to do. Check the list of avatar animations for the Name and Callback Marker of each.
- Example: DoorButtonTouch, InsertKiHand, etc.
- Marker - putting the Callback Marker here will cause the next series of message nodes to happen in the middle of the avatar animation. Leaving this blank will cause the messages to happen after the avatar animation is complete.
- Example 1: Putting InsertKiHand into both fields will cause an action to play mid-animation, such as the Nexus terminal symbol glowing when the KI is inserted.
- Example 2: Putting DoorButtonTouch into the Anim field but leaving the Marker field blank will make things function like a journey cloth (animation after the avatar is finished).
- Drivable - checking this lets the player keep control of the avatar during the One Shot. Needed for Reversable.
- Reversable - player can reverse the One Shot. Check this if you want the avatar to be able to "cancel" the One Shot when moved.
- Position - The name of the object to which the avatar will walk (usually an Empty).
- Seek - how the avatar makes its way to the One Shot. Warp will instantly place the avatar at the One Shot, Seek will cause the avatar to "glide" along the shortest path, and Smart Seek will cause the avatar to walk and find the best path.
Example:
Send To Object
The Send To Object node connects to an Enable/Disable node to send an enable or disable message to a specific scene object.
Sound
The Sound node triggers an audio clip via an empty object.
- Go To: Plays the sound from the beginning or a specific time.
- Time: Point to go to in the sound file (in seconds).
- Action: Tells the sound to play, stop, or toggle between play and stop.
- Volume Level (Only if Custom volume selected below): Sets the volume of the sound.
- Looping: Determines whether the sound should loop or not (Yes or No).
- Volume: Sets the volume of the sound (see Volume Level above) or mutes it entirely.
For a detailed explanation on using sound nodes (and the associated modifier), see the sounds tutorial
Timed Callback
This node will add a delay between action(s) in a responder (in seconds).
Trigger Multistage
Triggers a multistage behavior node branch.
Conditions
These nodes are used to properly set up a clickable or region sensor.
Clickables
For various setups of clickables, see the associated tutorial.
These nodes set an object up as a clickable.
The clickable node is set to the clickable object while the clickable region settings node is set to your clickable's region.
Your clickable node will be connected to your responder node while your clickable region settings node is connected to the clickable.
Facing Target
The facing target node can be attached to the clickable node. It tells the game that the avatar has to be facing the clickable at a certain angle in order for the hotspot to appear. This is useful if you have a lot of clickables in a small space.
Note 1: The recommended maximum angle is 57 degrees.
Note 2: The facing target node is optional. You can simply check the option on the clickable node for a default 45 degrees or leave it unchecked if you'd prefer the avatar can face any direction.
Region Sensor
These nodes set an object up as a region sensor, meaning it will trigger the responder when you enter and exit the region.
Prime examples include when an avatar walks up to an imager to post, or when the museum door in Ae'gura opens and closes.
The region sensor is set to the region you would like to enter or exit. Choosing Avatars will trigger the responder when an avatar enters the region while Dynamics will trigger the responder when a kickable enters the region.
For Bounds, Convex Hull is best for simpler shapes while Triange Mesh is for more complicated shapes.
The region trigger settings tells the region what it needs to trigger enter or exit.
- Population will activate the responder when a certain number of avatars/kickables enter the region (number is set by the Threshold field).
- First Event will activate the responder when the first avatar/kickable enters the region, but not for subsequent avatars/kickables.
- Each Event will activate the responder when any avatar/kickable enters the region.
Note: the region trigger settings node is optional. You can simply check Trigger on Enter/Exit in the region sensor for a default of Each Event.
Example:
Avatar
These types of nodes cause the avatar to perform a certain action.
Animation Stage
For details on this node, visit the Multistage Behavior tutorial.
Animation Stage Settings
For details on this node, visit the Multistage Behavior tutorial.
Multistage Behavior
For details on this node, visit the Multistage Behavior tutorial.
Seek Target
For details on this node, visit the Multistage Behavior tutorial.
Sitting Behavior
This node will determine the directions from which an avatar can approach a sitting modifier.
For instructions on how to properly set up a sitting mod, please use the clickables tutorial.
Alternatively, you can use a sitting mod.
Python
These nodes will setup and command URU's various Python scripts, both with Cyan's default scripts and other custom scripts. For the various types of Python node trees, see the accompanying tutorial.
Applying the Node Tree
Our final step will be to apply our node tree into the Age itself.
Select any object (usually one of the related objects is best for organizational purposes, but any will do), press the Physics button in the Properties window.
Next, click on Add Modifier and choose Advanced.
In the modifier that appears, click the + to add a new item. Double click on it to rename it.
In the bottom right, click on the field and choose the node tree you want to use.
In the Version drop down menu, you can choose specific versions of URU. There are some differences between Path of the Shell and Myst Online as far as coding. Unless you have multiple versions of node trees for one object, it's best to leave this at default (all selected).
Your node tree logic should now export!