ReGameDLL_CS icon indicating copy to clipboard operation
ReGameDLL_CS copied to clipboard

Add CVar `mp_plant_c4_delay`

Open wopox1337 opened this issue 3 years ago • 12 comments

mp_plant_c4_delay <float> 

And don't forget to implement API member in CSPlayer()->*

wopox1337 avatar Oct 28 '21 01:10 wopox1337

Due to the naming, the question is, should be CVar work for "Plant Anywhere only", or for whole gameplay? I am just asking this to make sure about the exact feature, to avoid possible confusion, since this follow the "anywhere feature". Because if, for the normal gameplay it should be active (without "anywhere" in the name it makes sense if it is not for it by the way), players who will try to plant on bomb site will not be able to, and here an information message will be welcomed, even more important than for the "Plant Anywhere" feature. So if in case this is only to work in conjunction of "mp_plant_c4_anywhere", better is to name it "mp_plant_c4_anywhere_delay".

StevenKal avatar Oct 28 '21 18:10 StevenKal

Totally not. This CVar should be independent from plant_c4_anywhere. Flexibility 😎

wopox1337 avatar Oct 28 '21 18:10 wopox1337

Yes, better this way, so we can set up a minimum delay for normal planting, but as I said, player carrying the C4 on a bomb site and not having the C4 icon blinks red is gonna ask himself what the hell is going on here! So that's why a new message for this telling him to wait x second(s) before planting is strongly recommended, but no localizations... Except if we can use another way to inform him.

Meantime, about the API member of the "Plant C4 Anywhere", this should be changed into "m_iCanPlantC4Anywhere" with "-1" as default value, and, in the condition, be like this: if (m_bHasC4 && ((plant_c4_anywhere.value >= 1 && CSPlayer()->m_iCanPlantC4Anywhere <= -1) || CSPlayer()->m_iCanPlantC4Anywhere >= 1) Same thing for this new API member related to the delay, where "<= -1.0" will be considered as "skipped" (use of the CVar value instead), which is better for customization per client.

If mine got closed at least add this will be good for per-client setting, but this idea of delay outside plant anywhere is a good thing and I agree well, I just think an information message is almost mandatory.

StevenKal avatar Oct 28 '21 18:10 StevenKal

@StevenKal We can’t set default value because don’t know all maps in gameplay moments.

wopox1337 avatar Oct 28 '21 18:10 wopox1337

I was refering to the feature (ability to restrict players from planting below X seconds, no matter the value of the "mp_plant_c4_anywhere"). Of course this "mp_plant_c4_delay" should be 0 by default!

StevenKal avatar Oct 28 '21 18:10 StevenKal

I completely agree with you on the point of misunderstanding the player and the missing necessary message. Unfortunately, I have not yet found a solution to correct this situation. In search...

Regarding API - CVar should not regulate (influence, interfere with) the work of API. That's why the logic is implemented in a simpler way.

wopox1337 avatar Oct 30 '21 05:10 wopox1337

As I said on the other topic #694, I made a draft of it & by respecting your actual desires. Meantime, I can see a problem with the current system desired (more a limit actually), which is, the fact we can not fully customize the "delay" per bombsite/anywhere. In other terms, with actual design, if you want to plant anywhere, but only from 30 seconds after round start, but also plant on bomb site, but without delay (like if you reach the site in 20 seconds), you can not, you must wait those famous 30 seconds of "mp_plant_c4_delay". So to allow full control of this, we must have CVars like: mp_plant_c4_site_delay -1 (default value, -1 for no limit, 0 to disable planting on site, haha!, < delay > for our delay). mp_plant_c4_anywhere_delay 0 (default value, -1 for no limit, 0 to disable planting anywhere!, < delay > for our delay). But knowing they work the reverse of a CVar like "mp_buytime", I think -1 should in fact acts like restricted, and 0 fully allowed (so "-1" to disable planting on site or anywhere, "0" for enable it as "no restrictive delay" is set).

So the question is, should I try to change the whole code to handle like I suggest in order to be more enhanced, or should I keep the actual behavior wanted? That's you who can valid the features, so that's you who decide! Hehe!

StevenKal avatar Oct 30 '21 11:10 StevenKal

Hi! I am still waiting for your decision regarding my suggestion right above, because this last will provide more customization (check explanations). Besides, this will not be a problem for me to rework my actual code to handle it like I suggested, I just do not want to code this if in case you disagree & refuse to merge such design (no need I waste time huh!).

However, I have a pre-finalized & fully workable code here, get the "Lara Croft's artifacts" related to the PR I have opened on my repository to test. I will just need to add the CVar in readme & game.cfg files, that's all!

End words: Bringing features from CS:GO or other things can be interesting, but why just limit ourselves to let them as they are when they could be better? People ask for features they know & they would like to see in the original CS, but usually do not think to submit "improvements" to them. This sounds a bit "dumb" to me when we can extend them for the sake of the users & make them able to enjoy "more"!

By the way, I have tested the current "Plant C4 Anywhere" feature on my classic server, and I have to admit that, without delay, this is a bit abusing as gameplay, as we can directly plant on spawn, I saw CTs got mad! Even if this is fun, we can see all CTs rushing T spawn like an army! For me my suggestion about having two CVars working respectively via delay will be the best.

StevenKal avatar Nov 01 '21 11:11 StevenKal

zZzZz! I just would like to know if in case I work on a code with "mp_plant_c4_site_delay" & "mp_plant_c4_anywhere_delay" to behave like I suggested on my post of 2021-10-30, if you will be favorable to merge it if I submit, or totally against. This is as simple as that! My first guessing is "you will be against", but a confirmation will be appreciated! Thanks!

StevenKal avatar Nov 05 '21 10:11 StevenKal

Thank you for your explanation. Yes, your arguments about the gameplay part are quite logical, as I said before - the "delay" adjustment is a necessity. Also, control in API without depending on CVar itself - looks better than now.

wopox1337 avatar Nov 16 '21 10:11 wopox1337

Oh! Cute wopox is there! I though you were gone into oblivion! Hehehe! I can see a "up" in my post of the 2021-10-30, but this does not really tell me if you are fully O.K. if I work & submit a new code like I have explained with the new CVars "mp_plant_c4_<site|anywhere>_delay", etc.? Just say "yes" if you are O.K., or "no" if you are not! Thanks in advance!

StevenKal avatar Nov 16 '21 21:11 StevenKal

I don't have a lot of time to do these projects. But, sometimes I will be able to help with some things. I'M OK.

Yes, you can suggest a PR and we'll look into it (review).

wopox1337 avatar Nov 17 '21 09:11 wopox1337