Adding new funnels (unable to get it working)

So, I’ve been trying and failing to add an additional funnel trap for something someone suggested ( http://smf.cataclysmdda.com/index.php?topic=11037.0 ).

I’ve looked at the source and it seems all I SHOULD need is to enure the trap has a funnel radius, and ensure that the terrain it’s constructed on isn’t indoors. But so far I’ve been utterly unable to get it to fill containers, and side-by-side testing with a regular funnel tells me it isn’t the weather but something I’m doing wrong.

Construction entry:

},{
    "type" : "construction",
    "skill" : "survival",
    "description" : "Build Tarp Rain-Catcher",
    "category" : "CONSTRUCT",
    "difficulty" : 1,
    "time" : 45,
    "qualities": [
        { "id": "HAMMER", "level": 1 }
    ],
    "components" : [
        [ [ "pointy_stick", 3 ] ],
        [ [ "string_36", 1 ], [ "string_6", 3 ] ],
        [ [ "tarp", 1 ] ]
    ],
    "pre_flags" : [ "DIGGABLE", "FLAT" ],
    "post_terrain" : "t_raincatcher"
}

Terrain entry:

},{
“type” : “terrain”,
“id” : “t_raincatcher”,
“name”: “tarp raincatcher”,
“symbol”: “0”,
“color”: “brown”,
“move_cost”: 10,
“trap”: “tr_raincatcher”,
“flags”: [
“TRANSPARENT”, “FLAMMABLE”
],
“deconstruct”: {
“ter_set”: “t_dirt”,
“items”: [
{ “item”: “pointy_stick”, “amount”: 3 },
{ “item”: “string_6”, “amount”: 3 },
{ “item”: “tarp”, “amount”: 1 }
]
},
“bash”: {
“str_min”: 6, “str_max”: 12,
“sound”: “crash!”,
“sound_fail”: “whack!”,
“ter_set”: “t_dirt”,
“items”: [
{ “item”: “stick”, “amount”: 1, “minamount”: 0 },
{ “item”: “splinter”, “amount”: 3, “minamount”: 1 },
{ “item”: “plastic_chunk”, “amount”: 8, “minamount”: 4 }
]
}
}

Trap entry:

{
    "type" : "trap",
    "id": "tr_raincatcher",
    "identstring" : "FUNNEL",
    "legacy_id": 4,
    "name" : "raincatcher",
    "color" : "blue",
    "symbol" : "V",
    "visibility" : -1,
    "avoidance" : 0,
    "difficulty" : 99,
    "action" : "none",
    "drops" : ["funnel"],
    "benign" : true,
    "funnel_radius": 380
},

This doesn’t work because: only traps that are explicitly added are registered as possible funnels and only those registered traps are later filled. This is to avoid having to go through the whole map on each turn to check each tile for a possible funnel trap. Instead the game can go through the list of registered traps only.

Traps from terrain are implicitly there, they are not actually added and are therefor not registered.

I’ll see what I can do about this.

I see. Uncertain how to go about fixing that, admittedly. I’m assuming that requires a source tweak to add the funnel to the list of traps referenced by the source, which would be good for if we were mainlining constructed funnels but wouldn’t work for adding them in a mod.

Told you a ready solution in the other thread. Pretty sure just copy+paste+adjust would be enough. The function in question has a very similar line just above where you’d put yours.

Hmm. I see. Will look into it and try and ensure I can get it right then…