Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the mod manager functional? #5551

Closed
VampyreLord opened this issue Jan 15, 2014 · 8 comments

Comments

Projects
None yet
5 participants
@VampyreLord
Copy link
Contributor

commented Jan 15, 2014

It's in the world gen but can we add mods yet?

@i2amroy

This comment has been minimized.

Copy link
Member

commented Jan 15, 2014

Mods should work if you add them, we just don't have any added yet! :P

Some guidelines about how to make a mod should be found here #5405.

@VampyreLord

This comment has been minimized.

Copy link
Contributor Author

commented Jan 16, 2014

OK, so what is the difference between CORE and SUPPLEMENTAL?

and can you mod the monsters.json so that only dogs spawns for example? Do I need to delete monsters from other json files aswell?

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented Jan 16, 2014

OK, so what is the difference between CORE and SUPPLEMENTAL?

There can only be one CORE mod per world, but any amount of SUPPLEMENTAL mods.

Most data from the json files replaces existing definitions. This happens based on the id of the object.
That means a mod can define an item with id "2x4" with properties different from the original two by four and the new properties will be used.

Monster groups: If the mod contains something like this, it will only spawn dogs (in fields and forests):
{ "type":"monstergroup", "name" : "GROUP_FOREST", "default" : "mon_dog" }
The previously loaded monster group is completely erased and replaced by the new entry.

Only difference I can currently think of:

  • the item group definitions append to existing item groups. This makes tv sets spawn in fields:

{ "type" : "item_group", "id" : "field", "items":[ ["television", 30] ] }

Do I need to delete monsters from other json files aswell?

Some monster spawns might be hard coded to a specif type.

@VampyreLord

This comment has been minimized.

Copy link
Contributor Author

commented Jan 16, 2014

There can only be one CORE mod per world, but any amount of SUPPLEMENTAL mods.

So, what if I assigned a mod that adds a new profession as "mod-type": "CORE" instead of "mod-type": "SUPPLEMENTAL" , what would happen?

Monster groups: If the mod contains something like this, it will only spawn dogs (in fields and forests):
{
"type":"monstergroup",
"name" : "GROUP_FOREST",
"default" : "mon_dog"
}
The previously loaded monster group is completely erased and replaced by the new entry.

So if I need to remove dogs only from a world, I should just remove "default" : "mon_dog" from all groups and create a mod with the list of other monsters as they are? Would that mod be "mod-type": "CORE" or "mod-type": "SUPPLEMENTAL" ?

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented Jan 16, 2014

So, what if I assigned a mod that adds a new profession as "mod-type": "CORE" instead of "mod-type": "SUPPLEMENTAL" , what would happen?

The mod manager allows only one CORE mod for each world be selected (during world creation) and that's actually the only place where the mod-type matters. If you have two mods that are typed as CORE, you can not have them both in the same world, that's all (and changing the type to SUPPLEMENTAL would remove that restriction).

I think this was made to allow different core data sets:

  • standard
  • desert (mutated cactus instead of poppy), sand instead of grass...
  • classic zombies only (no labs?, no portals, ...)

But this requires that all worlds have exactly one CORE mod and currently there is no other CORE mod available so transferring the standard data set into a CORE mod would be meaningless.

So if I need to remove dogs only from a world,

Copy monstergroups.json to data/mods/data/no-dogs/monstergroups.json, replace "mon_zombie_fast" with "mon_null" in that new file, create a file "data/mods/no-dogs/modinfo.json" with

{
    "type": "MOD_INFO",
    "ident": "no-dogs",
    "name": "no dogs"
    "path": "data"
}

Or (even better, actually): overwrite the definition of "mon_zombie_fast" to be the same as "mon_zombie". Zombie dogs will still spawn as usual, but they are in every aspect equal to normal zombies (same stats, same appearance), they will only be listed separately in most situations.

It seems I have to add the functionality to remove things, question is: how should a removal of something be represented in json?

{
    "type": "monstergroup", "name" : "GROUP_DOMESTIC",
    "exclude-monsters" : [ "mon_zombie_fast" ]
}

Something like this?

@VampyreLord

This comment has been minimized.

Copy link
Contributor Author

commented Jan 17, 2014

Copy monstergroups.json to data/mods/data/no-dogs/monstergroups.json

Is the second 'data' file necessary? data/mods/data/no-dogs/monstergroups.json

It seems I have to add the functionality to remove things, question is: how should a removal of something be represented in json?

To be honest, removing and add monsters should be a feature in world generation instead of people creating separate mods for it.

replace "mon_zombie_fast" with "mon_null"

I did successfully manage to remove normal zombies from the game by replacing "mon_zombie_fast" with "mon_null" but before the start of the game it generate annoying DEBUG messages stating that "mon_null" is unknown:"
src/mongroupdef.cpp[420]: monster group GROUP_MAYBE_ZOMBIE contains unknown monster mon_null src/mongroupdef.cpp[420]: monster group GROUP_PUBLICWORKERS contains unknown monster mon_null src/mongroupdef.cpp[420]: monster group GROUP_ZOMBIE contains unknown monster mon_null src/mongroupdef.cpp[420]: monster group GROUP_ZOMBIE contains unknown monster mon_null src/mongroupdef.cpp[420]: monster group GROUP_ZOMBIE contains unknown monster mon_null

Here, you can try it yourself: download

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented Jan 17, 2014

Is the second 'data' file necessary? data/mods/data/no-dogs/monstergroups.json

The mod manager looks for MOD_INFO entries in modinfo.json files only, so it doesn't need to go through all json files to find all the mods.

Self contained mods are possible (use "modinfo.json" as path entry):

[
    {
        "type": "MOD_INFO", ...
        "path": "modinfo.json"
    },
    {
        "type": "monstergroup", ...
    },
    {
        "type": "profession", ...
    },
    ...
]

src/mongroupdef.cpp[420]: monster group GROUP_MAYBE_ZOMBIE contains unknown monster mon_null

Yes, I forgot the json consistency checker. mon_null is not defined anywhere so it thinks it's a spelling mistake or similar.

@moist-zombie

This comment has been minimized.

Copy link

commented Jan 19, 2014

Sorry I'm not all that active around the community lately, but I had to hop on and throw in a capital THANKS for wrapping this up (though it looks like you did quite a bit of extra work on it!).. The community shall appreciate it :>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.