Physical.c (cont…)
Okay so so far here’s the prototypes’s for physical.c, I won’t go into the code but a listing of the calls is a good thing too:
int SetEyeColor(string color);
int SetOrigHairColor(string color);
int SetHairColor(string color);
int SetOrigBuild(int build);
int SetHeight(int height);
int SetWeight(int weight);
int IncreaseHeight(int height);
int DecreaseHeight(int height);
int IncreaseWeight(int weight);
int DecreaseWeight(int weight);
string GetEyeColor();
string GetHairColor();
string GetOrigHairColor();
int GetHeight();
int GetWeight();
string GetDescBuild(int build);
string GetDescOrigBuild(int build);
Character Physical Stats
I’ve put aside the Weather System for a couple of days as I try to figure out all the intricacies in actually displaying the information. And Have begun working on physical.c which will be included in base.c (maybe player.c, I’ll have to check the inheritance tree!). My aim here is to allow players and wizards to set the ht, wt, hair color, build, eye color, and other physical non-combat/skill related stats that I want available.
I’ve built it specifically so that we can open up such fun things as food having nutirional values so that you can get fat or thin, you can have potions or magic that increases or decreases your size, areas that only allow certain heights to walk through with out being hampered. You will also be able to dye your hair, or shave your hair, etc….
I have hardcoded some intial ht/wt limits which won’t let a certain race start off as beyond a certain range, but I’ll have to take a look at the RACES_D and see if I can integrate it there, but that would make it a compat busters, and I was the one who hacked the 2.1.13r RACES_D for Craty and busted everyones compat, but made it much more dynamic.
Of course with the physical descriptions set up we get a step closer to having dynamic Descriptions for our players and npc’s.
Weather System
I’ve often come back to making a weather system because I really believe that a highly integrated well developed weather system adds a huge amount of immersion in the game, and really helps set the ‘mood’ of the game.
So in 2.1.18 of DS I rewrote the SEASON_D and added rain and wind, but it was just there. So I’ve spent the last day or two breaking down the system and really taking an indepth look at the way that the system works. I decided to break it out a little more and develop independent Daemons for each part of the whole.
PERCIPITATION_D obviously controls all of the Percipitation and the transitions between each stage. But it does not determine what is being Percipitated. It simply says we need to percipitate.
WIND_D, can’t get much simpler then this little Daemon. How strongly is the wind blowing and what direction is the wind blowing in. Since we’ve broken this out it can be used for a lot of other things! Like a Hot Air Balloon which is blown about by the wind!
TEMPERATURE_D simply just tracks the temp according to the day and season.
SEASON_D Changes
Well I am still converting my old 2.1.18 code to 3.0 and had to start hacking on the SEASONS_D
I’ve added the following time Sections: Evening, Afternoon and I had to put the weather changes aside until I have more time. To fix an issue that I had with one of my NPC’s I had to add some sefuns:
int query_noon() { return (SEASONS_D->GetTimeOfDay() == “noon”); }
int query_afternoon(){return (SEASONS_D->GetTimeOfDay() == “afternoon”); }
int query_evening() { return (SEASONS_D->GetTimeOfDay() == “evening”); }
int query_dawn() { return (SEASONS_D->GetTimeOfDay() == “dawn”); }
int query_morning() { return (SEASONS_D->GetTimeOfDay() == “morning”); }
int query_twilight(){ return (SEASONS_D->GetTimeOfDay() == “twilight”); }
int query_night() { return (SEASONS_D->GetTimeOfDay() == “night”); }
int query_midnight(){ return (SEASONS_D->GetTimeOfDay() == “midnight”) ; }
Old Code Converted To 3.0
So I imported my old domain from 2.1.18 all the way up to the current 3.0, but man there are some crazy little changes that occured. Like new verbs that upset the addactions that I had coded up. Here’s what I learned:
create an object that uses this code:
environment(this_player())->addaction_function();
OLD CODE: stage.c
static void create() {
room::create();
SetClimate(“indoors”);
SetAmbientLight(30);
SetTown(“Talos”);
SetShort(“White Dove Inn – Performers Stage”);
SetLong( (: LongDesc :) );
SetExits( ([
“east” : “/domains/talos/whitedoveinn/room/dancefloor2.c”
]) );
SetItems( ([
: “A pull rope to open and close the curtains.”
]) );add_action(“pull_rope”,”pull”);
}
New Code: stage.c
SetInventory(([
WDI_OBJ”stage_rope.c”: 1,
]) );
New Code: stage_rope.c
#include <lib.h>
#include “../whitedoveinn.h”inherit LIB_DUMMY;
inherit LIB_PULL;int pullRope(object who);
static void create()
{
dummy::create();
SetKeyName(“rope”);
SetId(({“rope”, “curtain rope” }));
SetShort(“a curtain rope”);
SetLong(“A rope used to open and close the curtain.”);
SetPull( (: pullRope :) );
}int pullRope(object who)
{
write(“Trying to ‘Pull Rope’\n”);
environment(this_player())->pull_rope();
return 1;
}
There are two very important facts here: on the object you need to have the LIB_DUMMY so that it doesn’t show up in the room inventory, and then all you have to do is have your item call the code alread created: environment(this_player())->pull_rope();
Shizam!
Streets
So streets are going to be the cornerstone of the urban setting of TalosMUD. Each Street is going to dynamically create the description of the ‘room’ based upon the street type, the buildings contained there. So Right Now we are adding the following functionality to the street_room.c:
//Prototypes:
//Sets:
void SetStreetName(string StreetName);
void SetStreetLights(int i);
void SetStreetWidth(int i);
void SetRoadType(int i);
void SetGuardRotation(int TimeInterval);
//Gets:
string GetStreetName();
int GetStreetLights();
int GetStreetWidth();
int GetRoadType();
int GetGuardRotation();
int DetermineWealth();
void AddBuilding(string Direction, string BuildingFileName);
void EstablishExits();
void GenerateDescription();
void EstablishLongs();
While we are on the topic of streets it is relevant to talk about what buildings are going to be. They are virtual constructs that will be the lifeblood of the city. The street will call the buildings to determine the descriptions and the longs of the ‘room’