Knuckle Cracker

Particle Fleet => Feedback, Features, and Suggestions => Topic started by: GoodMorning on January 05, 2017, 09:05:56 PM

Title: [Suggestion] Unit type case conversion/consistency
Post by: GoodMorning on January 05, 2017, 09:05:56 PM
Currently we have "LandEnergyPod" and "PRPLCORE". Could the case become consistent?

Also, could CreateUnit become case-insensitive?
Title: Re: [Suggestion] Unit type case conversion/consistency
Post by: knucracker on January 06, 2017, 12:48:14 PM
You can also use "CommonUnit" instead of "PRPLCORE".  Everything else uses camel case.  The code looks at exact string matches currently and I'd rather not change it.  There's a really good chance I'd miss something somewhere and it would create a bug that would be hard to find in the future.
Title: Re: [Suggestion] Unit type case conversion/consistency
Post by: Karsten75 on January 06, 2017, 01:07:31 PM
Quote from: virgilw on January 06, 2017, 12:48:14 PM
You can also use "CommonUnit" instead of "PRPLCORE".  Everything else uses camel case.  The code looks at exact string matches currently and I'd rather not change it.  There's a really good chance I'd miss something somewhere and it would create a bug that would be hard to find in the future.

You *could* double up on the case statements for those Unit types that are inconsistent... :)

That would be compatible, but provide another layer of inconsistency where some units can be recognized as PRPLCORE and PRPLCore (or is that PrplCore?) ...
Title: Re: [Suggestion] Unit type case conversion/consistency
Post by: Sorrontis on January 06, 2017, 05:36:22 PM
We do need a list of the unit types... but maybe it's there already and I'm blind  8)
Title: Re: [Suggestion] Unit type case conversion/consistency
Post by: Stickman on January 06, 2017, 05:38:36 PM
Quote from: Sorrontis on January 06, 2017, 05:36:22 PM
We do need a list of the unit types... but maybe it's there already and I'm blind  8)

Wiki Link (http://knucklecracker.com/wiki/doku.php?id=prpl:unittypelist) - is that what you seek?
Title: Re: [Suggestion] Unit type case conversion/consistency
Post by: Sorrontis on January 06, 2017, 05:47:54 PM
Quote from: Stickman on January 06, 2017, 05:38:36 PM
Quote from: Sorrontis on January 06, 2017, 05:36:22 PM
We do need a list of the unit types... but maybe it's there already and I'm blind  8)

Wiki Link (http://knucklecracker.com/wiki/doku.php?id=prpl:unittypelist) - is that what you seek?

Apparently I'm very blind.... very very blind.
Title: Re: [Suggestion] Unit type case conversion/consistency
Post by: GoodMorning on January 06, 2017, 07:20:59 PM
I was thinking of wrapping GetStringFromStack() in String.ToLowerCase() before doing the comparison in CreateUnit. Just a suggestion, and only made because I thought it was approximately a one-line change.
Title: Re: [Suggestion] Unit type case conversion/consistency
Post by: Sorrontis on January 08, 2017, 05:26:47 PM
Talking about this. Is  there a list of the scriptvariables for each unit? For example, so I can change the damage a ticon gun does over time?
Title: Re: [Suggestion] Unit type case conversion/consistency
Post by: GoodMorning on January 08, 2017, 08:15:08 PM
Not yet, that will have to wait for V's personal attention, as he is the one with the source code.