Possible bug when adding new units

I don't know what it is, but I thought to post my problem here and see if someone has an idea. Ok, so I want to add a new unit to my new race. I have already done this with several other units without an issue. I have prepared: -the new mesh file -the new .entity file, which is (for testing purposes) *identical* to the vanilla file except for the String entries for name and description and the mesh entry -changed the appropriate entry in the player .entity file to point to the new .entity file for the unit -added the new strings to the english.str file at the end As I said, the process is exactly the same as with other three ships I have already replaced successfully. But when it comes to the Frigate_PhaseLongRange, I get a minidump. I've checked and double-checked *everything*... spelling, syntax, I've even renamed the files using the exact same convention used by the vanilla game... nothing works. I'm starting to think there is some bug associated with the long range frigs which crashes the game if anything is changed. Hell, I copy-pasted the new 1.03 reference .entity file and only changed the mesh call, and I still get a mini-dump...
4,811 views 10 replies
Reply #1 Top
Try it without the mesh change, just a straight copy/paste into an empty frigate factory slot, see if it still crashes.

If it doesn't, try changing basic stats or something. If it still doesn't, it's gotta be something in the mesh file.
Reply #2 Top
I found it, and its got to be a bug. The game crashes when I enter "FrigateXinLongRange" in the PlayerXin.entity file. If I enter "FrigatePhaseLongRange" and change all the string ID entries and mesh calls in the corresponding file, it works. If I change it to "FrigatePhasLongRange" with the same as above, it works. Why it finds the "FrigateXinLongRange" so offensive is beyond me, especially since three other units use the same naming convention without a problem.

So for now I got the workaround, but I would really like to know how can a simple string cause a minidump, especially when I *know* I didn't make any typos in the filenames etc.
Reply #3 Top
Wow, that's really weird. You got me, I can't even begin to guess what it might be :P
Reply #4 Top
I ended up calling the entity "FrigateXinaLongRange" and it works. Go figure. And to think I wasted allmost an hour on this... :(
Reply #5 Top
Then it probably has something to do with the word 'Xin', lol. Try testing it out with other entity files if you find the time to do so, it's quite puzzling.
Reply #6 Top
I thought that, but he's got PlayerXin.entity working fine, and mentioned 3 other files that work.

My first thought was that some combination there is restricted by the game for internal use, but I don't see how that's possible since the file name shouldn't be parsed at all.. but in any case :P
Reply #8 Top
I thought, maybe it has a problem with "xinl" or something like that. But even "FrigateXinlLongRange" works. And no, it can't be the "Xin" part since I have "FrigateXinScout", "FrigateXinLight" and "FrigateXinAntiFighter" working just fine.

I do think it has something to do with the parsing. Its just annoying, wasting time hunting such elusive and illogical bugs as this... I don't mind debugging, but its damn hard when you have to look in the most illogical of places.
Reply #9 Top
The problem turned out to be a case problem. The entity file was named FrigateXinLongrange.entity (note the lower case r in range) while the entity wanted was FrigateXinLongRange (note the upper case R in range).

The next patch will have case insensitive searches.
Reply #10 Top
Ahha, thank you :P That makes sense :)