cortex-command-community / Cortex-Command-Community-Project-Source

[ARCHIVED] Cortex Command - Open Source under GNU AGPL v3 (no game data included)
https://cortex-command-community.github.io/
GNU Affero General Public License v3.0
204 stars 42 forks source link

ThrowPrepTime should be a ThrownDevice property #360

Open pawnishoovy opened 3 years ago

pawnishoovy commented 3 years ago

Describe the Problem and Suggested Improvement ThrowPrepTime is currently a hardcoded (at 1000ms) property of AHumans, making every grenade and throwable take that long to charge up to their maximum ThrowVel.

It should instead be made an ini-settable property for ThrownDevices. If functionality for AHumans is desperately wanted, a ThrowPrepTimeMultiplier property could be added to them instead.

Describe Additional Work Required Before Improvement Can be Made Should be relatively clear-cut, just shifting and adding properties around. AHuman already grabs the throwvels and throwoffsets from the device, having it grab a preptime too should be no issue.

garethyr commented 3 years ago

I'm wondering if it makes more sense to keep the actual prep time on AHumans, and instead have ThrowPrepTimeMultiplier on TDs. Functionally it ends up much the same, but it just seems a bit more logically correct to me I think.

pawnishoovy commented 3 years ago

tomato tomato, i guess that way would be less shuffling of stuff about for the would-be coder.

nickflik0934 commented 2 years ago

working on it tomorrow, looks like a good issue to start with. my question for this is: do we have something that grabs stuff from ini files already? or do I have to find some way to do that?

garethyr commented 2 years ago

Most things in the game have ReadProperty and Save. ReadProperty handles reading from INI, and Save handles writing to it. I think it should be fairly straightforward once you look at them. When adding a new property, you'll also need to have lua bindings, those live in the appropriate LuaBindings file, in this case LuaBindingsEntities.

Also, for this issue, go with what I mentioned in my August comment, i.e. adding and utilising m_ThrowPreptimeMultiplier on ThrownDevices.

nickflik0934 commented 2 years ago

yeah so i will just have to add the property to ThrownDevices, remove it from the player and make it so that the property can be read from ini files.

nickflik0934 commented 2 years ago

afbeelding added this include to AHuman.h not sure if there is another thing for this

garethyr commented 2 years ago

yeah so i will just have to add the property to ThrownDevices, remove it from the player and make it so that the property can be read from ini files.

What do you mean remove it from the player??

As for the include, you probably don't need it in the header file. The less we include in header files the better, generally, since it means less dependencies and less code needing rebuilding when things change. ThrownDevice is probably already included in the cpp file, which I assume is where you'll want to use it. I may be wrong on this though, maybe you do need it in the header.