Adding new room flag

Posted by JamesTalon on Wed 07 Oct 2009 10:59 PM — 11 posts, 41,022 views.

Canada #0
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.
USA #1
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.
Canada #2
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
Amended on Thu 08 Oct 2009 06:51 AM by JamesTalon
USA #3
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?
Canada #4
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
USA #5
Can you show the array codes with the shipyard flag in it?
Canada #6
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.
USA #7
The const r_flags and roomflags code you posted already, except with the additions you made.
Canada #8
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"
};
Amended on Thu 08 Oct 2009 08:49 PM by JamesTalon
USA #9
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.
Canada #10
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