Korman:Logic Nodes

Revision as of 20:05, 26 June 2016 by Doobes (Talk | contribs)

Disambig gray.png

This is a tutorial page.
 
KorNodeExample01.jpg

This tutorial will cover Blender's Node Editor and the basic functions of each type in Korman.

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.

KorNodeMenuBar01.jpg

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. Important: Click the F button next to the + sign or the node tree won't save to the blend file after you exit.

Click Add on the menu bar and choose the type of node you would like.

Types of Nodes

Soft Volume Nodes

Python Nodes

For a full tutorial on Python nodes, see this tutorial.

Responder Nodes

Responder nodes are where you want to start with your tree. They are essentially the "brain" of the node tree. Other nodes will stretch outward from them.

Responder State

KorNodeResp03.jpg

This is the node with which you want to start. 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.

NOTE: Only ONE responder state should have Default State checked or things won't work properly.

Responder

KorNodeResp01.jpg

This node will tell URU that it needs to detect a clickable or a region sensor. Generally, Detect Trigger is the only thing checked.

It only needs to be connected to the Default State.

Detect UnTrigger will stop the responder to which it's connected.

Don't F-Fwd Sounds

Responder Command

KorNodeResp02.jpg

These nodes are used for every action you want URU to perform. You can connect multiple responder commands to each other, but you can only have one message connected to each.

With this method, you can cause actions to happen step-by-step instead of all at once.

KorNodeExample02.jpg

In this example, the message from the yellow responder command will happen first, then once it's complete, it will go the next steps connected to the cyan and red responder commands, then once those are complete, it will finally finish with the steps connected to the green and purple responder commands.

Responder Tree Examples

KorNodeExample06.jpg KorNodeExample07.jpg KorNodeExample08.jpg

Message Nodes

KorNodeExample03.jpg

Message nodes, each one connected to a responder command, will tell URU what action it should do.

Animation Messages

KorNodeAnim01.jpg KorNodeAnim02.jpg

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:

KorNodeExample10.jpg

Enable/Disable

KorNodeMessage01.jpg

The Enable/Disable node is activated by a responder command node and links to a clickable node or a region sensor node. It can enable or disable audio, physical attributes or the visibility of a clickable or region sensor, or a combination on all three.

Exclude Region

KorNodeMessage03.jpg

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.

The Clear option will move the avatar within the region to a safe point. Using the Release option will let the avatar back out again.

Footstep Sound

KorNodeStep01.jpg

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.

Link To Age

KorNodeMessage05.jpg

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.
  • 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

KorNodeShot01.jpg

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 responder commands to happen in the middle of the avatar animation. Leaving this blank will cause the commands 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:

KorNodeExample09.jpg

Send To Object

KorNodeMessage04.jpg

The Send To Object node connects to an Enable/Disable node above 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.

Timed Callback

KorNodeMessage06.jpg

This node will add a delay between action(s) in a responder (in seconds).

Conditions

These nodes are used to properly set up a clickable or region sensor.

Clickables

For various setups of clickables, see the associated tutorial.

KorNodeClick01.jpg KorNodeClick02.jpg

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.

KorNodeExample04.jpg

Facing Target

KorNodeFacing01.jpg

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

KorNodeSensor01.jpg KorNodeSensor02.jpg

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:

KorNodeExample11.jpg

Avatar

These types of nodes cause the avatar to perform a certain action.

Sitting Behavior

KorNodeSit01.jpg

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.

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 works best, but any will do), press the Physics button in the Properties window.

KorStart03.jpg

Next, click on Add Modifier and choose Advanced.

KorNodeModifier.jpg

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!