Derpduck / L4D2-Comp-Stripper-Rework

Reworking Stripper:Source map changes for competitive L4D2 from scratch.
32 stars 8 forks source link

c5m3 alarm cars wrong color on 2nd round #12

Closed Derpduck closed 3 years ago

Derpduck commented 3 years ago

Remove it for now until fixed

Derpduck commented 3 years ago

I suspect this has to do with the plugin that makes alarms consistent between teams. Need to find a better implementation of changing the car colors

Derpduck commented 3 years ago

Re-opened until the new colors are re-implemented

jensewe commented 3 years ago

l4d_equalise_alarm_cars does the job, but it features both EnableCar and DisableCar. Maybe reversing the changes when -relay_caralarm_on is triggered can help. 😃

jensewe commented 3 years ago

https://github.com/Target5150/MoYu_Server_Stupid_Plugins/commit/863126085fa17e48191dc9627f68231a997130c0 give it a try? Seems work for me. Still unaware of whether there's side effect and what it is,

Derpduck commented 3 years ago

For plugins you should try https://github.com/SirPlease/L4D2-Competitive-Rework or contacting server owners, I don't have any control over which versions of plugins servers use so I can't test this. I might have a solution to fix this, but it would be good to fix that plugin if there is an issue with it also.

Derpduck commented 3 years ago

Should be fixed now, needs testing on a Zonemod server though.

jensewe commented 3 years ago

Round 1

20210208032841

Round 2

20210208032848

Derpduck commented 3 years ago

Were the alarmed cars the same (correct colors)? I see the far left one might not be, but the colours will be different each round.

jensewe commented 3 years ago

Nope. Those not painted red (orange) were consistent off-alarm cars. Al least, on 1st round the middle and the left ones are on, and the next round they were disabled.

Edit: The config "purely" bases Competitive Rework and your repo (as well as some customized plugins).

Derpduck commented 3 years ago

Opened again as this isssue is still not fixed, in the meantime this feature has been removed (again). Using logic_versus_random COULD fix the issue but sadly does not has it doesn't support PickRandomShuffle, so that we can ensure there are always 4 alarm cars. This works fine for vanilla without using l4d_equalise_alarm_cars, but with that plugin the wrong cars get colored, even though the correct cars are alarmed. This isn't the plugin's fault (though if it hooked in a slightly different way it might bypass the issue), the way the map determines which cars are alarmed is quite unique and happens slightly after the round starts.

Derpduck commented 3 years ago

My solution would be this:

; --- Make both teams have the same alarms
modify:
{
    match:
    {
        "targetname" "case_random_alarm_disable"
    }
    replace:
    {
        "classname" "logic_versus_random"
    }
    delete:
    {
        "OnCase01" "alarm1-relay_caralarm_offTrigger0-1"
        "OnCase02" "alarm2-relay_caralarm_offTrigger0-1"
        "OnCase03" "alarm3-relay_caralarm_offTrigger0-1"
        "OnCase04" "alarm4-relay_caralarm_offTrigger0-1"
        "OnCase05" "alarm5-relay_caralarm_offTrigger0-1"
        "OnCase06" "alarm6-relay_caralarm_offTrigger0-1"
        "OnCase07" "alarm7-relay_caralarm_offTrigger0-1"
        "OnCase08" "alarm8-relay_caralarm_offTrigger0-1"
    }
    insert:
    {
        "OnRandom01" "alarm1-relay_caralarm_off,Trigger,,0,-1"
        "OnRandom02" "alarm2-relay_caralarm_off,Trigger,,0,-1"
        "OnRandom03" "alarm3-relay_caralarm_off,Trigger,,0,-1"
        "OnRandom04" "alarm4-relay_caralarm_off,Trigger,,0,-1"
        "OnRandom05" "alarm5-relay_caralarm_off,Trigger,,0,-1"
        "OnRandom06" "alarm6-relay_caralarm_off,Trigger,,0,-1"
        "OnRandom07" "alarm7-relay_caralarm_off,Trigger,,0,-1"
        "OnRandom08" "alarm8-relay_caralarm_off,Trigger,,0,-1"
    }
}

To get this to work without the support of PickRandomShuffle on logic_versus_random, the info_gamemode entity that fires these random events would need to be modified to use PickRandom instead. However this wouldn't guarantee that 4 cars are always active, as the same random value could be picked more than once, producing fewer alarm cars.

jensewe commented 3 years ago

Tried debugging the plugin, and found it failing to actually enable disabled cars, even no error occurs during the whole process.

As it seems struggling via Stripper, how about script a plugin replacing this? Added that even though the previous solution had worked, the colors of disabled cars would have varied between rounds (tiny but here it is).

A few advantages are:

Derpduck commented 3 years ago

I would like to avoid creating plugins for solving problems on specific maps like this where Stripper can and should be used instead, as this is one of the goals of this repo to remove some of those plugins.

I think the current alarm car plugin could just store the rendercolor of the alarm cars when it checks them on the first round, then apply them on the 2nd round.

These specific cars get set AFTER round_start is called I think though, I'm not too sure what the issue is. But regardless this is something I'm not going to come back to for a while, but if you want to try making a plugin feel free.

Mart-User commented 3 years ago

That case car color logic is on almost every map that has a car alarm. Maybe should be better to set a default color to all cars and remove all logic cases, both on stripper.