MUSHCode for Moe's Mushkode Manual - Writing an IC time system. Select Content

~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*

|\ /| |\ /| |\ /|

| \ / | | \ / | | \ / |

| \/ |oe's | \/ |ushkode | \/ |anual

~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*


LESSON 6 - WHAT TIME IS IT?


In our previous five lessons, we have spent a lot of time

establishing some basic guidelines for how to code. How to approach the

construction of a command, how to store data, how to retrieve it, and how

to cope with a set of commands that all work on the same data have been

covered in this series of tutorials. What I'm going to do now is give you

one method for how to make an IC time system.

Previously, we'd done a multiple-item vendor, which is for many

coders the jumping-off point as far as skills and projects go. Once you

have something that works locally, the next logical step is to make things

that work globally. While I don't think I'll get to every standard code

system that is used in these lessons, I want to show you some of the

things I can do and hope that from there, you'll know enough to go out on

your own and do your own stuff.

This lesson is going to be written a trifle differently than the

previous five, because if you have read them, worked through the examples,

and understood what I was talking about(no small task, particularly the

last part.), you are going to have a more than functional lexicon of code

knowledge. This lets me skim over a few of the general elements of the

code logic I will present, and focus on some of the more precise details.

What this means for you is that if you either a) don't have a

solid grasp of what mushcode is, b) found this link in a websearch, or c)

you're currently quite chemically inconvenienced...this is going to make

little to no sense to you. I suggest that you read at least lessons one,

two, and three, as those lay out the fundamental principles by which I

code, and give you a sense of how I build commands and u-functions.

The topic of this lesson is going to be the construction of an IC

time system, that works on a faster-than-RL time scale. The one I am going

to show you how to build has been used, successfully, on ten mushes so

far, and easily accomodates a 2:1, 3:1, or higher(yipes) timescale. This

particular system uses the vector math functions present in all of the

major codebases, and is both easy to understand, and very easy to

configure.


VECTOR? THAT'S A CEREAL!!


What follows is going to be a very brief, very informal, and quite

likely imprecise definition of what vector math is. The purpose of this

tutorial is to teach you to code, not to teach you higher math. The vector

functions are used in this system because they facilitate the result. The

end justifies the means.

In science, specifically physics, there are two main kinds of

physical quantities: Scalars and Vectors. A scalar is a quantity that is

completely specified by a number with appropriate units. 10 degrees

Fahrenheit. 4 inches. 100ml. Those are all scalar values. They completely

specify the measurement. No direction is required.

Vectors are not just a current state. They are the displacement of

a thing, defined as a change in position. A plane, flying at 500mph, is

going in a direction. Because of its state, its position is changing from

one place to another. The cumulative description of both its speed and

direction is a vector.

How does this apply to time? Well, what we are going to do in our

IC time system is establish a starting point, from which all IC time is

calculated