Work with Socials

Socials are a simple way to allow your players expression without having to emote a particular action. 

Add a New Social

Adding or editing an existing social is very easy, just follow these simple steps:

  1. Open the file pp/lib/text/actions on your active server
  2. Edit your new social in to the file (make sure you do not insert it in an existing social)
  3. Save your work
  4. Reboot the server (SHUTDOWN REBOOT)
  5. Test the new social

 

 

General Information about Socials

  • Managing your socials is extremely important. If the file gets messed up with sloppy additions the use of socials can crash your mud and you'll be extremely unhappy. Fortunately socials are very easy. Follow a few simple rules and you'll have no problems.
  • Socials are ALWAYS either 5 lines or 10 lines long. Code is not very forgiving when it comes to this, so it's important to keep track of what's what.
  • A trick to help you make sure everything will work is to scroll down to the bottom of your text file where you store your socials and make sure that the command for the very last social is on a line that ends with 1 or 6. (All commands should land on lines that end in 1 or 6). If they don't, scroll back up through the list and find out where you went wrong and fix the issue by adding a line.
  • If you don't want to send an echo, just enter a '#' sign (without the quotes) as in the example at the bottom of this page.
  • Socials are stored in pp/lib/text/actions. Currently their number is limited to 200. You can change this in commands.cpp, around line 1548. Look for: #define MAX_SOCIALS 200 - Socials don't use up very much space or memory, so having lots of them isn't a major problem. The one bad thing about them is that when they are used code has to start at the top of the list and search downwards, one at a time, until it either finds the social or doesn't. Since it's all in RAM, this doesn't take too much time, but it does eat up a little, and every little bit counts.

 

Social structure is extremely strict.  Following is the line structure that must be followed.

Social Line Usage
laugh // command
0 0 // hidden - minimum position
You laugh. // return to player with no arg
$n laughs. // return to others with no arg
You laugh at $N. // return to player with target arg
$n laughs at $N. // return to others with target arg
$n laughs at you. // retun to target 
What good would that do? // return to player if target not found
You laugh at yourself. // return to player when targeting themselves
$n laughs at $mself. // return to others when targeting themselves

 

Variables within socials are the same as you'll find in crafts:

Targeting Variables
$n - sdesc of actor
$N - sdesc of victim
$m - him / her / it - actor
$M - him / her / it - victim
$s - his / her / its - actor
$S - his / her / its - victim
$e - he / she / it - actor
$E - he / she / it - victim

 


If a victim's position is less than that required, you won't be able to perform the social on them.

Positions
DEAD 0
MORTALLYW 1
UNCONSCIOUS 2
STUNNED 3
SLEEPING 4
RESTING 5
SITTING 6
FIGHTING 7
STANDING 8

 

Here's a sneaky little social that tries to get someone's attention without anyone else seeing. (Note that the lines that usually contain echoes to others in the room only contain the '#' character.

Psst Social
psst
1 5
Who's attention do you want to get?
#
You quietly try to draw $N's attention.
#
$n quietly tries to draw your attention.
You don't see that person.
You've got your attention.
#

 

 

 

Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.

Copyright 2015 Shadows of Isildur