Re: Fwd: Newsgroup article + OBCIRCLE + OFFTOPIC

From: Phillip A Ames (kirk47@juno.com)
Date: 09/24/99


On Fri, 24 Sep 1999 16:59:40 -0500 Patrick Dughi <dughi@IMAXX.NET>
writes:
[snip]
>         For example, say you want to add new aggro states,
corresponding
> to each class, or race (if you have them).  Well, about this time,
you'll
[snip]

Something you might want to save bitvectors and all sorts of other things
for races/classes(I'm using races in this example) is, say each of your
races has some special ability/flag.  Rather than declare a new flag for
each of the races' special ability/flag, just create generic thing(such
as RACE_SPECIAL_FLAG_1) or something similar...  Then you just use the
RACE_SPECIAL_FLAG_1 and check what race the player is to see how it
affects them.  Just a suggestion as to how to save limited things such as
bitvectors.

[REALLY OFFTOPIC]

I'm currently in the process of making a web page for my MUD, and have
encountered a stumbling block that I need some HTML/Javascript gurus to
help me out with :)  What I want to do, is whenever an image is clicked,
play a wav file.  However, I haven't the slightest clue how to play it.
If you know of a place to point me or think you can help out, please
e-mail me(not the list) at kirk47@juno.com.  Thanks in advance, and just
because I feel bad I'll put an ObCircle in too.

[OBCIRCLE]

I'm having a bit of trouble with some new code I've added to my MUD.  The
code is for empires(like clans), and the problem is that I get
gibberish/nothing at all for certain parts.

Here's a snip from where I read the data from the file to set all the
variables in the structure.

if((fl = fopen(fl, "r")) != NULL){
  for(i = 0; i < NUM_EMPS; i++){
  fscanf(fl, "#%d~\n", &number);
  emp[i].id = number;
  fscanf(fl, "%s~\n", name);
  emp[i].name = namebuf;
  fscanf(fl, "%s~\n", plan); // plan = empire MOTD
  emp[i].plan = plan;
  fscanf(fl, "%d %d %d~\n", &allybit, &peacebit, &warbit);
  emp[i].allies = allybit;
  emp[i].norelat = peacebit;
  emp[i].wars = warbit;
  fscanf(fl, "%d %d~\n", &treasury, &leaderid);
  emp[i].leader = leaderid;

Here's a snip from where I send the 'status' of the empire to a character
with the other info you'll need...

CREATE(emp, struct empire_data, NUM_EMPS);
#define GET_EMP_NAME(empire) (emp[(empire)].name)
#define GET_LEADER(empire) (get_name_by_id(emp[(empire)].leader))

void emp_status(struct char_data *ch, int empire){
empire_name = GET_EMP_NAME(empire);
sprintf(buf, "*** Empire Status: %s ***\r\n", empire_name);
sprintf(buf2, "Leader: %s\r\n", GET_LEADER(empire));
strcat(buf, buf2);
sprintf(buf2, "Members: %d\r\n", GET_MEMBERS(empire));
strcat(buf, buf2);
...


Snip from the empire file(it continues and contains data for all the
empires)...

#0~
Federation~
This is the Federation players Message Of The Day.~
0 0 0~
0 1~
...

And here's the empire structure

struct empire_data {
        int id; // Numerical ID of Empire
        int leader; // Player ID of leader
        int members; // Number of members in empire
        int number; // unused for now
        int treasury; // Credits in treasury for emp. spending
        int ships; // Number of ships owned
        int planets; // Number of planets owned
        long allies; // Bitvector of alliances, and with who
        long norelat; // Bitvector of empires which they have no
relationship
        long wars; // Bitvector of empires which they are having a war
with
        char *plan; // Empire motd(for players to know whats going on)
        char *name; // Empire Name
        char allystr[512]; // String of allies
        char peacestr[512]; // String of peace
        char warstr[512]; // String of war
        int tech[3]; // Computer, Propulsion, Weapons
};

Lastly, here's a snip from whenever you type 'empire status'

> empire status
*** Empire Status:  ***
Leader: gowron
Members: 1
Treasury: 0
Alliances: None
Peace Treaties: None
Wars: None

Now, the first problem is that it doesn't display the empire's name...  I
think the problem there might be that it's an * and it might need to be
char name[128] or similar...  Secondly, to the best of my knowledge,
get_name_by_id doesn't LOWER() the text it returns, yet this is all
lowercase...  Can anyone see what I'm doing wrong?  Thanks alot!


Phillip Ames    | Implementor of Apocalypse MUD
kirk47@juno.com | telnet://startrek.circlemud.net:1701
ICQ: 8778335    | AOL IM: Grathol
"Now this is what it's like when worlds collide!"
___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: http://dl.www.juno.com/dynoget/tagj.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST