Help needed - statseditor

For code related discussions and questions
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: Help needed - statseditor

Post by Duha »

Per wrote:
NoQ wrote:I'm trying to design it away from relying on names.txt, but we're not quite there yet.
Do you need script that add name field to ini files from names.txt?

Some questions about gettext:

Did game show vals from names.txt or gettext(val)? #

Did modding system has own *.mo files? #
http://addons.wz2100.net/ developer
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: Help needed - statseditor

Post by Duha »

weapons.ini and weaponsounds.ini has same section names: This files can be merged.
http://addons.wz2100.net/ developer
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: Help needed - statseditor

Post by Duha »

weapons.ini
ecm.ini
weapons.ini
"body" may be should be renamed to hitPoints

sensor.ini
construction.ini
"bodypoints" may be should be renamed to hitPoints
http://addons.wz2100.net/ developer
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Help needed - statseditor

Post by Per »

Good ideas. As for translation, gettext() is run on the values read from names.txt (at the moment). There is at the moment no way for mods to supply their own .mo files.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Help needed - statseditor

Post by Per »

Duha wrote:Do you need script that add name field to ini files from names.txt?
If you could make a script to do the above changes, and send me the modified files, I'll update the code to match. Thanks!
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: Help needed - statseditor

Post by Duha »

Per wrote:If you could make a script to do the above changes, and send me the modified files, I'll update the code to match. Thanks!
package content:
add_name.py python script to add files (you need specify full paths to files and folders before run)
*.patches (May be they will work may be not, I cant clone wz repo because my internet connection)
mp and base files.

PS. Script add blank line to the end of file.

If warzone make script accept python files, I can make script that parses ini and create file for gettext.
I can make script that remove names used in ini from names.txt
Attachments
stats_patch.zip
(37.66 KiB) Downloaded 217 times
http://addons.wz2100.net/ developer
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Help needed - statseditor

Post by Per »

Thanks. Committed.

No need to modify names.txt now. We'll remove it when it is no longer in use.
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: Help needed - statseditor

Post by Duha »

Order of options in sections does not affect loading but I suggest to order them in alphabetic order.
This prevent diff chaos if using different editors.
http://addons.wz2100.net/ developer
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: Help needed - statseditor

Post by Duha »

body.ini
psStats->weaponSlots = ini.value("weaponSlots").toInt();
That max value of it? (in outdated docs is 2)
http://addons.wz2100.net/ developer
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: Help needed - statseditor

Post by Duha »

in body.ini hitpoints are required
in other places is not (default = 0)

May be hitpoints should be required in all places?
http://addons.wz2100.net/ developer
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Help needed - statseditor

Post by Per »

Max number of weapons is currently 2. Hitpoints should be required for all components.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: Help needed - statseditor

Post by aubergine »

Sure max weapons is 2? Ultimate Scavs AI mod has some lorries with 3 turrets.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Help needed - statseditor

Post by Per »

The maximum possible is 3. If you manage to figure out solutions to the various problems that arise (clipping etc) you are welcome to try that. You can even put more weapons on buildings, if you are really brave (and want fresh bugs - and want to fix them yourself).
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: Help needed - statseditor

Post by Duha »

@Per Cant you split threads to editor and stats discussion?

in loadPropulsionStats weight, buildPower, buildPoints does not have default vals but in other it is 0
in weaporn.ini almost all vals has no defaults.

If you has strategy to save files space and hide some options with default vals may be it will be good to add defalt vals to maximum places.

propulsionsounds.ini
if change
(!statsGetAudioIDFromString(list.toUtf8().constData(), ini.value("szStart").toString().toUtf8().constData(), &startID))
to
...ini.value("szStart", "-1")... some options with default values can be removed



how match in integer:
DEG(1)/3
DEG(3)/4
UWORD_MAX
UBYTE_MAX



In propulsion sounds is only 4 section ("Hover", "Tracked", "Lift", "Wheeled")
in propulsiontypes there are more types "Hover", "Tracked", "Half-Tracked", "Legged", "Lift", "Propellor", "Wheeled", "Ski", "Jump"
May be this files should be joined together?


else if (strcmp(weaponEffect, "ANTI AIRCRAFT") == 0 || strcmp(weaponEffect, "ALL ROUNDER") == 0)
Looks like "ALL ROUNDER" should be renamed to "ANTI AIRCRAFT" in ini files.


In docs said:
minElevation (-90, 0)
maxElevation (0, 90)
is it true?

Code: Select all

if (minElevation > SBYTE_MAX || minElevation < SBYTE_MIN)
		{
			ASSERT( false,"loadWeaponStats: minElevation is outside of limits for weapon %s",
				getStatName(psStats) );
			return false;
		}
		psStats->minElevation = (SBYTE)minElevation;

		//set the maxElevation
		if (maxElevation > UBYTE_MAX)
		{
			ASSERT( false,"loadWeaponStats: maxElevation is outside of limits for weapon %s",
				getStatName(psStats) );
			return false;
		}
http://addons.wz2100.net/ developer
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Help needed - statseditor

Post by Per »

Defaults is a double edged sword. On the one hand you save space, on the other they show new people what fields to fill out (ie work as documentation). I think in particular weapons.ini needs more defaults.

"ALL ROUNDER" and "ANTI AIRCRAFT" are the same. (Unfortunately.)

I'll look into merging the propulsion files.

DEG(d) = ((d) * 8192 / 45)
UWORD_MAX = 65535
UBYTE_MAX = 255
Post Reply