Creating a Stance Command

From Multiverse

Jump to: navigation, search
Contributed by: BrianinFairOaks Last Tested: 01 Apr 08 Tested By: Brianinfairoaks Tested With: 1.1

Overview

/stance is a way to have the player change the character's mode from walk to run or sit, or any other modes that you may think of. This code is more complex than just setting the player's speed on the client because I wanted the "stance" to interact with the player's stats and status. There are likely optimizations that could be made to this. At this time it does not change anything graphically. I've removed some implementation specific details from this.

Design

The player will enter /stance 'stance' to set their stance. The valid stances in this tutorial are sit, walk, and run. Other possibilities are duck, crouch, and crawl. Once you have the basics implemented you can expand it to include your design specific details.

Part 1. The slash command goes to mvhome/config/yourworldname/extensions_proxy.py. This runs in the proxy plugin and mvhome/logs/yourworldname/proxy.out is the log file.

Part 2. This involves passing the request from the proxy plugin to the combat plugin. The combat plugin contains most of the player's stats.

Part 3. Demonstrates how to detect the changed "stance" back on the client and to set the player's speed.

Tutorials

  1. Create Slash command
  2. Pass the command to the Combat Plugin
  3. Detect the changed command on the client
Personal tools