moveclasses array keys must have contiguous numbers

moveclasses array keys must have contiguous numbers

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

moveclasses array keys must have contiguous numbers

Post by TradeMark »

moveinfo.tdf wrote:[CLASS0]
{
name=KBOT1;
footprintx=1;
footprintz=1;
maxwaterdepth=5;
maxslope=36;
crushstrength=5;
}

[CLASS1]
{
name=KBOT2;
footprintx=2;
footprintz=2;
maxwaterdepth=22;
maxslope=36;
crushstrength=10;
}

[CLASS2]
{
name=AKBOT2;
footprintx=2;
footprintz=2;
maxwaterdepth=5000;
maxwaterslope=50;
maxslope=36;
crushstrength=50;
depthmod=0;
}

[CLASS9]
{
name=TANK3;
footprintx=3;
footprintz=3;
maxwaterdepth=22;
maxslope=18;
crushstrength=30;
}
This code wont work, you cant build the units that uses class TANK3, because the key name is CLASS9 instead of CLASS3

on older spring version this wasnt a problem.

i noticed this bug when i was unable to even build the units that didnt have movementclass detected by spring because of this bug.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: moveclasses array keys must have contiguous numbers

Post by jK »

use lua -_-
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: moveclasses array keys must have contiguous numbers

Post by TradeMark »

erm? how exactly lua fixes this?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: moveclasses array keys must have contiguous numbers

Post by zwzsg »

That means that the engine got broken but it won't get fixed since anyway you can easily Lua it. Pretty soon other TDF and FBI will stop working too, and you'll be told to use Lua. Then s3do won't be loaded anymore, but not a big deal as you can Lua your own graphic now. After that, the rest of the engine will crumble apart, but that won't be fixed since it can so easily be worked around with a few dozen thousands lines of Lua.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: moveclasses array keys must have contiguous numbers

Post by TradeMark »

yeah... lets fix every bug in engine with lua crap...
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: moveclasses array keys must have contiguous numbers

Post by Kloot »

TradeMark wrote: on older spring version this wasnt a problem.
Stop spreading bullshit ktxbye. The move-classes have been expected to be numbered consecutively FOR AT LEAST THREE YEARS, EVEN AFTER THE SWITCH TO THE LUA-BASED FBI PARSER. Just because your total lack of common sense made you encounter this for the first time NOW doesn't mean the engine "got broken", no matter what zwzsg's cute little stock response says.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: moveclasses array keys must have contiguous numbers

Post by TradeMark »

erm, my map is less than 3 years old, besides i played it less than year ago last time, and at this year i noticed i couldnt build those units anymore... i tested with older BA versions, no difference. so i suppose its engine changes.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: moveclasses array keys must have contiguous numbers

Post by Kloot »

Yes, there was an engine change. The change being that units with invalid or missing move-definitions (making them *useless*) are now removed from the game instead of leaving it in a logically inconsistent state as older versions did (but doubtlessly zwzsg will still think of said change as "breaking"). Combine that fact with the prior assumption of contiguity you didn't know was there all along which causes your CLASS9 block to be ignored so "movementclass=TANK3;" is an invalid reference and what do you get?
Last edited by Kloot on 08 Nov 2009, 03:01, edited 3 times in total.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: moveclasses array keys must have contiguous numbers

Post by FLOZi »

TradeMark wrote:erm? how exactly lua fixes this?
use a lua def, not a tdf.

(Or just fix your tdf lolol)

Spring's (lua) tdf parser is much stricter than OTA, and so it should be.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: moveclasses array keys must have contiguous numbers

Post by Argh »

Stop spreading bullshit ktxbye. The move-classes have been expected to be numbered consecutively FOR AT LEAST THREE YEARS, EVEN AFTER THE SWITCH TO THE LUA-BASED FBI PARSER.
This.
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: moveclasses array keys must have contiguous numbers

Post by TradeMark »

Kloot wrote:Yes, there was an engine change. The change being that units with invalid or missing move-definitions (making them *useless*) are now removed from the game instead of leaving it in a logically inconsistent state as older versions did (but doubtlessly zwzsg will still think of said change as "breaking"). Combine that fact with the prior assumption of contiguity you didn't know was there all along which causes your CLASS9 block to be ignored so "movementclass=TANK3;" is an invalid reference and what do you get?
so after all this raging there was an engine change after all...

its not nice to just disable the units (took long to find out wtf was going on). it was better back then, when they got some default movementclass, and you were still able to build them.

better solution would be to move the name variable as the array key, then there would be no problems and reading/modifying the files would be easier too. (for example if you want to remove a moveclass).

Like this:
[KBOT1]
{
footprintx=1;
footprintz=1;
maxwaterdepth=5;
maxslope=36;
crushstrength=5;
}

[KBOT2]
{
footprintx=2;
footprintz=2;
maxwaterdepth=22;
maxslope=36;
crushstrength=10;
}

[AKBOT2]
{
footprintx=2;
footprintz=2;
maxwaterdepth=5000;
maxwaterslope=50;
maxslope=36;
crushstrength=50;
depthmod=0;
}

[TANK3]
{
footprintx=3;
footprintz=3;
maxwaterdepth=22;
maxslope=18;
crushstrength=30;
}
This could be changed without breaking every mod: if the array has name variable in it, then the name would be taken from it, if it doesnt, then name would be taken from the array key name.
Post Reply

Return to “Help & Bugs”