SSK - Generating Behaviors

From RGWiki

Jump to: navigation, search

Using The Behaviors Generator

Fresh Install
Fresh Install

In a fresh install, you will have a view that looks something like the image to the right.

In this example, we're going to create a game object that, when clicked, will change its bitmap. We will do this by generating a behavior that does the work an then attaching it to a game object.

To do this, follow these steps (illustrated below):

  1. Place a player object in the scene.
  2. Select the player object, switch to the Edit toolbar, and open the Behaviors pull-down menu.
    • Note: At this point, there are only two behaviors (templates) in the list.
  3. Open the behavior generator by selecting Behavior Generator... in the Roaming Gamer menu, or by pressing CTRL G.
  4. Generate a new behavior that will change the player object's bitmap when it is clicked using these steps:
    • In the Action Atoms / Full Behaviors column, select the top (event group) pull-down menu and select the Behavior Callbacks option.
    • In the Action Atoms / Full Behaviors column, select the lower (event sub-group) pull-down menu and select the Mouse (over object) option.
    • In the list that appears in the Action Atoms / Full Behaviors column, select the onMouseDown behavior atom.
    • In the Action Atoms / Full Behaviors column, select the top (action group) pull-down menu and select the t2dStaticSprite option.
    • Notice, that in the Action Atoms / Full Behaviors column, the lower (action sub-group) pull-down is hidden. This is because the t2dStaticSprite group has no sub-groups.
    • In the list that appears in the Action Atoms / Full Behaviors column, select the setImageMap behavior atom.
    • Now, click the Slurp Details button.
    • Click the Generate button.
      • Notice that after clicking Generate, a red message shows up, stating (behavior exists!). This is a safety feature to keep you from generating behaviors with duplicate names, but you can override it by selecting the Allow Overwrite option.
    • Click the Close button.
  5. Open the behavior list under the Edit toolbar and you should see a new behavior named "onMouseDown() (over object) -> setImageMap".
    • Select this behavior and apply it to the player object.
    • Note: Normally you would probably make the behavior name shorter, but we didn't do so to keep this example as short as possible.
  6. In the behavior details pane, select protEnemies as the imageMapDB
  7. Save your changes.
  8. Press F5 to run the game.
  9. Click on the player and if you've done everything right, the image will change to E0.


This example probably took several minutes to do. However, I'm sure that you can see, with a little experience, a similar effort would only take a few seconds. Pretty cool, huh? Also, in this example we generated only one behavior. In theory, as released, the current atoms can be combined to make up to 7,037 unique behaviors.

Personal tools