[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]  MUDs
. -> [Folder]  General
. . -> [Subject]  Adding new room flag
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Adding new room flag

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


Posted by JamesTalon   Canada  (15 posts)  [Biography] bio
Date Wed 07 Oct 2009 10:59 PM (UTC)  quote  ]
Message
I'm trying to add in a shipyard flag to use instead of the import flag for engineers trying to build ships. I've added the ROOM_SHIPYARD into the mud.h file with the other room flags, as well as adding "shipyard" into the same place as the other room flags into build.c, and updated the designship.c file to reflect the new room flag requirement.

After re-compiling and trying it, it does not go through with the process of building the ship, however if I change it back to the original or a pre-existing flag, such as ROOM_BANK, it works fine, as well as removing the condition (obviously). So, either I am missing putting something else in for the shipyard flag, or it doesn't like me, not sure which lol

This is the Dark Warriors code as well.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Reply #1 on Thu 08 Oct 2009 03:38 AM (UTC)  quote  ]
Message
Maybe you could show us what you did in more detail so that we know what your code looks like? It sounds like you did the right things in general, but it's possible you forgot something small somewhere.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by JamesTalon   Canada  (15 posts)  [Biography] bio
Date Reply #2 on Thu 08 Oct 2009 06:50 AM (UTC)  quote  ]

Amended on Thu 08 Oct 2009 06:51 AM (UTC) by JamesTalon

Message
Alright, this is the start of the section I changed in the designship.c file, and there are 2 other identical pieces farther on in the file as well, I made sure to change all 3.


/*
                 * used import flag to avoid adding an extra shipyard flg. 
                 * it can be changed if you don't have my cargo snippet - Ortluk 
                 * Also if you're installing in swfote you can uncomment the first if statement 
                 * and comment the second one out to use the shipyard flag instead
                 */

                if (!xIS_SET(ch->in_room->room_flags, ROOM_IMPORT))
                {
                        send_to_char
                                ("You can't build that here!! Try a spaceport\r\n",
                                 ch);
                        return;
                }


I changed the ROOM_IMPORT to ROOM_SHIPYARD, and then in the mud.h file, I add ROOM_SHIPYARD into the following

/*
 * Room flags.           Holy cow!  Talked about stripped away..
 * Used in #ROOMS.       Those merc guys know how to strip code down.
 *			 Lets put it all back... ;)
 * Leave ROOM_RESERVED alone, its reserved for tracking.
 */
typedef enum
{
        ROOM_DARK, ROOM_RESERVED, ROOM_NO_MOB, ROOM_INDOORS, ROOM_CAN_LAND,
        ROOM_CAN_FLY, ROOM_NO_DRIVING, ROOM_NO_MAGIC, ROOM_BANK,
        ROOM_PRIVATE, ROOM_SAFE, ROOM_INSTALLATION, ROOM_PET_SHOP,
        ROOM_NO_HAIL_TO, ROOM_DONATION, ROOM_NODROPALL,
        ROOM_SILENCE, ROOM_LOGSPEECH, ROOM_NODROP, ROOM_CLANSTOREROOM,
        ROOM_PLR_HOME, ROOM_EMPTY_HOME, ROOM_NOTHING, ROOM_HOTEL,
        ROOM_NOFLOOR, ROOM_REFINERY, ROOM_FACTORY, ROOM_RECRUIT,
        ROOM_E_RECRUIT,
        ROOM_SPACECRAFT, ROOM_PROTOTYPE, ROOM_AUCTION, ROOM_BAR, ROOM_INN,
        ROOM_OFFICE, ROOM_CAFE, ROOM_KITCHEN, ROOM_EXECUTIVE, ROOM_BOARDROOM,
        ROOM_BACTA, ROOM_IMPORT, ROOM_BACTA_CHARGE, ROOM_ARENA, ROOM_BOUNTY,
        ROOM_TEMP_COCKPIT, ROOM_TEMP_TURRET1, ROOM_TEMP_TURRET2,
        ROOM_TEMP_HANGAR,
        ROOM_TEMP_ENGINEROOM, ROOM_TEMP_NAVSEAT, ROOM_TEMP_PILOTSEAT,
        ROOM_TEMP_COSEAT,
        ROOM_TEMP_GUNSEAT, ROOM_TEMP_CORRIDOR, ROOM_TEMP_BEDROOM,
        ROOM_TEMP_WORKSHOP,
        ROOM_TEMP_TURBOLIFT, ROOM_PLAYERSHOP, ROOM_MONITOR,
        ROOM_EMPTYPLOT, MAX_ROOM_FLAG
} roomflags;


and then I also added "shipyard" into the following from build.c file


char     *const r_flags[] = {
        "dark", "reserved", "nomob", "indoors", "can_land", "can_fly",
        "no_drive",
        "nomagic", "bank", "private", "safe", "installation", "petshop",
        "nohailto",
        "donation", "nodropall", "silence", "logspeech", "nodrop",
        "clanstoreroom",
        "plr_home", "empty_home", "r1", "hotel", "nofloor", "refinery",
        "factory",
        "recruit", "empire_recruit", "spacecraft", "prototype", "auction",
        "bar", "inn", "office", "cafe", "kitchen", "executive", "boardroom",
        "bacta", "import",
        "bacta_charge", "arena", "bounty", "cockpit", "turret1", "turret2",
        "hangar", "engineroom", "navseat", "pilotseat", "coseat", "gunseat",
        "corridor", "bedroom", "workshop", "turbolift", "playershop",
        "sysmonitor", "emptyplot"
};


EDIT: If you want the before and after edit files, let me know if that helps and I can send them to you
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #3 on Thu 08 Oct 2009 03:24 PM (UTC)  quote  ]
Message
Quote:
it does not go through with the process of building the ship


What does that mean? Are you getting a message? Is nothing happening?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by JamesTalon   Canada  (15 posts)  [Biography] bio
Date Reply #4 on Thu 08 Oct 2009 04:35 PM (UTC)  quote  ]
Message
Zeno said:

Quote:
it does not go through with the process of building the ship


What does that mean? Are you getting a message? Is nothing happening?


When I try to build the ship, it tells me "You can't build that here!! Try a spaceport", which would happen if the flag wasn't found in the room
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #5 on Thu 08 Oct 2009 05:08 PM (UTC)  quote  ]
Message
Can you show the array codes with the shipyard flag in it?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by JamesTalon   Canada  (15 posts)  [Biography] bio
Date Reply #6 on Thu 08 Oct 2009 05:14 PM (UTC)  quote  ]
Message
Zeno said:

Can you show the array codes with the shipyard flag in it?

array codes? I would gladly show you them if I knew what and where they were located. For the most part, I'm new to doing anything in the code of a mud, and I'm using this code to basically figure stuff out.
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #7 on Thu 08 Oct 2009 08:06 PM (UTC)  quote  ]
Message
The const r_flags and roomflags code you posted already, except with the additions you made.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by JamesTalon   Canada  (15 posts)  [Biography] bio
Date Reply #8 on Thu 08 Oct 2009 08:48 PM (UTC)  quote  ]

Amended on Thu 08 Oct 2009 08:49 PM (UTC) by JamesTalon

Message
Zeno said:

The const r_flags and roomflags code you posted already, except with the additions you made.

ooo, yea no problem, let me just quickly make the adjustment :)


if (!xIS_SET(ch->in_room->room_flags, ROOM_SHIPYARD))
                {
                        send_to_char
                                ("You can't build that here!! Try a spaceport\r\n",
                                 ch);
                        return;
                }


typedef enum
{
        ROOM_DARK, ROOM_RESERVED, ROOM_NO_MOB, ROOM_INDOORS, ROOM_CAN_LAND,
        ROOM_CAN_FLY, ROOM_NO_DRIVING, ROOM_NO_MAGIC, ROOM_BANK,
        ROOM_PRIVATE, ROOM_SAFE, ROOM_INSTALLATION, ROOM_PET_SHOP,
        ROOM_NO_HAIL_TO, ROOM_DONATION, ROOM_NODROPALL,
        ROOM_SILENCE, ROOM_LOGSPEECH, ROOM_NODROP, ROOM_CLANSTOREROOM,
        ROOM_PLR_HOME, ROOM_EMPTY_HOME, ROOM_NOTHING, ROOM_HOTEL,
        ROOM_NOFLOOR, ROOM_REFINERY, ROOM_FACTORY, ROOM_RECRUIT,
        ROOM_E_RECRUIT,
        ROOM_SPACECRAFT, ROOM_PROTOTYPE, ROOM_AUCTION, ROOM_BAR, ROOM_INN,
        ROOM_OFFICE, ROOM_CAFE, ROOM_KITCHEN, ROOM_EXECUTIVE, ROOM_BOARDROOM,
        ROOM_BACTA, ROOM_SHIPYARD, ROOM_IMPORT, ROOM_BACTA_CHARGE, ROOM_ARENA, ROOM_BOUNTY,
        ROOM_TEMP_COCKPIT, ROOM_TEMP_TURRET1, ROOM_TEMP_TURRET2,
        ROOM_TEMP_HANGAR,
        ROOM_TEMP_ENGINEROOM, ROOM_TEMP_NAVSEAT, ROOM_TEMP_PILOTSEAT,
        ROOM_TEMP_COSEAT,
        ROOM_TEMP_GUNSEAT, ROOM_TEMP_CORRIDOR, ROOM_TEMP_BEDROOM,
        ROOM_TEMP_WORKSHOP,
        ROOM_TEMP_TURBOLIFT, ROOM_PLAYERSHOP, ROOM_MONITOR,
        ROOM_EMPTYPLOT, MAX_ROOM_FLAG


char     *const r_flags[] = {
        "dark", "reserved", "nomob", "indoors", "can_land", "can_fly",
        "no_drive",
        "nomagic", "bank", "private", "safe", "installation", "petshop",
        "nohailto",
        "donation", "nodropall", "silence", "logspeech", "nodrop",
        "clanstoreroom",
        "plr_home", "empty_home", "r1", "hotel", "nofloor", "refinery",
        "factory",
        "recruit", "empire_recruit", "spacecraft", "prototype", "auction",
        "bar", "inn", "office", "cafe", "kitchen", "executive", "boardroom",
        "bacta", "import",
        "bacta_charge", "arena", "bounty", "cockpit", "turret1", "turret2",
        "hangar", "engineroom", "navseat", "pilotseat", "coseat", "gunseat",
        "corridor", "bedroom", "workshop", "turbolift", "playershop",
        "sysmonitor", "emptyplot", "shipyard"
};
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #9 on Thu 08 Oct 2009 09:23 PM (UTC)  quote  ]
Message
Yeah, that's why. You need to match those up. If you added it after ROOM_BACTA in one part, it needs to be after the bacta flag in the other.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by JamesTalon   Canada  (15 posts)  [Biography] bio
Date Reply #10 on Thu 08 Oct 2009 10:21 PM (UTC)  quote  ]

Amended on Thu 08 Oct 2009 11:34 PM (UTC) by JamesTalon

Message
Ooooh, go figure it was something simple like that. I shall give it a shot and let you know what happens.

EDIT: Alright, she works. After a little issue of not realizing my skill for it went to 0% and I began to look into why it stopped working lol

Thanks for the help :D
[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.


3,452 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]