[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  Programming
. -> [Folder]  General
. . -> [Subject]  Creating A Monster Index

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Creating A Monster Index

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Daniel Spain   (15 posts)  [Biography] bio
Date Tue 22 May 2012 12:19 AM (UTC)  quote  ]

Amended on Tue 22 May 2012 12:20 AM (UTC) by Daniel Spain

Message
hello all, in my game i have been listing monsters like so:

There is a dragon, a dragon, and a minotaur here.

to do this i use the following code:


void shwmon(int room)
{
   int i,mn[10],m,c=0;

   for(i = 0 ; i < NMON ; i++)
   {
     if((arnmar.active) && (arnmar.loc==room))
     {
       mn[c++] = arnmar.id;
     }
   }

   if(c)
   {
      sendplayer(p,BRRED,"\r\nThere is ");
      
      for(i = 0 ; i < c ; i++)
      {
        m = mn;

        if((mon < NMON) && (mon[i+1] < NMON) && (i<(NMRMMN-1)))
        {
           if(!i) sendplayer(p,BRRED," %s %s",
                  prefix[monsters[m].prefix],
                  monsters[m].name);
           else   
           sendplayer(p,BRRED,", %s %s",
                     prefix[monsters[m].prefix],
                     monsters[m].name);
        } 
        else
        {
           if(!i) sendplayer(p,BRRED," %s %s",
                  prefix[monsters[m].prefix],
                  monsters[m].name); 
           else
           sendplayer(p,BRRED,", and %s %s",
           prefix[monsters[m].prefix],
           monsters[m].name);
        }
      }

      sendplayer(p,BREED," here.");
      sendplayer(p,WHITE,"\r\n");
   }
}


what i want to accomplish next is to index em differently
so it would come out:

There are two dragons, and a minotaur here.

i been trying it so many different ways and i keep coming up emptyhanded, any help would be appreciated.
the problem i am having is how to store em.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


459 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]