Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

New guns via XML/FLMM issue... SOLVED

The general place to discuss MOD''ing Freelancer!

Post Thu Dec 02, 2004 6:22 am

New guns via XML/FLMM issue... SOLVED

EDIT: This problem is now solved. Please see entry at the bottom for the solution. The rest of the post (minus some code chunks) will be preserved for posterity.

Howdy folks... Argh here, with another pain-in-the-rear problem.

It should be very simple: I need to create custom weapons for my mod. I've already developed the custom weapons, their behavior and sounds, etc., in previous versions, using the good ol' Liberty Justices. But now it's time to get rid of the old weapons (not coincidentally, removing Cloak and about 400 other useless entries in weapon_equip.ini, that I don't plan to use in the mod, along with all of the Loadouts I don't want... but that's after I figure out what's going wrong here)

First off, here's the error message I'm getting:

E:\FL\Scratch\Source\Common\Archetype.cpp(60) : *** ERROR: ArchDB::Get(3164109194) failed
E:\FL\Scratch\Source\Common\Archetype.cpp(60) : *** ERROR: ArchDB::Get(30) failed

At one point, I was even getting CTD, but I cleaned everything up, and now I don't get that... just a stubborn refusal to cooperate and play nice. I can *buy* this new weapon, and it works just fine in the game... but if I try to put it in an AI aircraft's Loadout... it fails to appear, and FLServer spits that error message up every time an aircraft armed with that weapon is spawned. It'll appear if I *buy* it, mind you- but putting it there as an equip = operation doesn't work, period.

Worse, putting it into the player's Loadout doesn't work right, either. So obviously this error isn't minor or ignorable, and I've gotta conquer it before I go on my wild looting spree among the Loadouts and weapon_equip.ini, cleaning out the deadwood.

Now, here's the code I'm using to implement the "test weapon", both as a weapon and as a Good:

<script>
<data file="DATA\EQUIPMENT\weapon_equip.ini" method="append">
<source>
[Munition
nickname = 30_cal_ammo

....more code went here, but is no longer needed, as this is where the problem was.

Oh yeah.. and I should note, for the record... it's NOT the custom CMP file I'm using, or the sounds, or any of that. All of those have been functioning flawlessly for the last 3 Alphas. It's definately a coding issue here...

Edited by - Argh on 12/3/2004 2:55:07 AM

Post Thu Dec 02, 2004 6:53 am

While I'm on this rampage... I don't suppose one of our more informed members could help me with another issue...

Basically, I'd like a list of all of the things that MUST stay in the game to keep it from CTD.

I want to strip *everything* else. Every System, every Weapon, every piece of Equipment. Everything. I've been working on this "sandbox" for quite awhile, but in a very haphazard fashion. And the results would be well-worth it for everybody- if I can get it working, then... we'd have the door wide-open to a lot more TC mods with fewer bugs. But I'm getting stumped over and over again by the game engine's stubborn refusal to let me remove things.

For example... strip out mbases.ini down to just one System (non-buggy and previously working, and the system that newplayer.ini points to) ... CTD. Same with Universe.ini. Same with weapon_equip.ini. What the heck?!? I can strip out misc_goods.ini completely, but I can't strip out the Systems I'm not using? Why? Do I need to blank every System's INI, every Room, and every Mission to get rid of these stupid errors where the engine's refusing to just fail gracefully?

Anybody know where I can find this information? I'm getting tired of having FL crash all the time, in my quest to remove the redundant or irrelevant, especially as the crashes are rarely helpful (i.e., there isn't a clue left in Spew, if you'll pardon the rhyme).

Post Thu Dec 02, 2004 8:09 am

units_per_container i`ve noticed to be entry for the ammunition part ..

i don`t know if that`s a problem tho, just what i found

Post Thu Dec 02, 2004 8:11 am

Dunno either... it wasn't causing a problem before, but lemme see if dumping it helps...

Post Thu Dec 02, 2004 8:24 am

No dice. Put the 30_cal back into the MP_ge_loadout ... CTD. What in the name of good graciousness is going on here... I also see references to the game engine looking for (and not finding) things like Lights in Spew, and I got the following from Spew that might help... maybe... ish...

E:\FL\Scratch\Source\Client\LoginMgr.cpp(351) : NOTICE:General:Starting single player game.
E:\FL\Scratch\Source\Client\Gf\LocationController.cpp(1029) : *** WARNING: Failed to get start location
E:\FL\Scratch\Source\DALib\DALib.cpp(376) : WARNING:General:******* DA SYSTEM: trailing references *******
E:\FL\Scratch\Source\DALib\DALib.cpp(376) : WARNING:General:******* DA SYSTEM: trailing references *******

Now, I have the OpenSP hack installed... why am I seeing this just before CTD?!? And everything works perfectly, until I add that new weapon to the starting Loadout. Switching in li_gun01_mark01... it's just fine.

I'm also getting a ton of Spew about the bad SURs I currently have in place... Anton's newest Beta FLModel Tool is supposed to fix that... I'm going to re-do all of the SURs and then come back to this problem...

Post Thu Dec 02, 2004 9:03 am

and you have been checking if all entries are at there place after activating the mod?

because you have 2 script open/close commands, did you really intend that? i`m assuming you know what you`re doing ..

just a thought

EDIT: ok forget it, non sense .. i remember you said that you can buy it with no probs ..

Edited by - RimShot on 12/2/2004 9:03:59 AM

Post Thu Dec 02, 2004 9:17 am

Sure, I have two <script> tags... these are two pieces of XML. The current Beta of my mod has over 10 different XML scripts in it... and they're all opened and closed with <script> </script>, just like they should be. And all of them except for these are working just fine... it's just these ones that aren't :-P

OK... now I just went back and added that weapon_good line in the old-fashioned way (minus the id_name stuff, obviously), and tried that out... CTD.

Tried renaming everything to 30_cal01_mark01... etc... CTD.

Removed the IDS tags... CTD... so it's not that the XML's naming is doing it. Same darn error from Spew:

*** WARNING: StarSystem::exit(): CLI(1) System(FP7_system)
E:\FL\Scratch\Source\Common\Archetype.cpp(60) : *** ERROR: ArchDB::Get(30) failed


Edited by - Argh on 12/2/2004 9:31:21 AM

Post Thu Dec 02, 2004 9:42 am

Switched back to li_gun01_mark01 ... no problem. And guess where all those stats, the CMP reference and everything else in my spiffy XML came from??? So it ain't the stats, the weapon_good reference, the market_misc... something's really strange and annoying here...

I mean, it even shows up with the proper NAME and it even had a DESCRIPTION, before I cut all of that out... but it won't go on a Loadout, period. You can buy it, it'll work as advertised, and it's no longer generating server-side spew, but if you try to give it to a player at the start of the game... CTD

I'll see whether I can give it to 'em as Cargo. Better than nothin', I guess... hopefully that won't CTD too... and the AI's already using different guns than players (for game-balance purposes)... so that's no big deal, either... unlike most mods, I don't have to worry about that issue, as the AI's never going to use the same guns as players anyhow... so I'll just ... ugh... re-use existing guns, whereever I need to have AI-equipable weapons. Sheesh... at least I only have about 15 weapons planned, so this won't become a total nightmare.

Here, let's take a look at somebody else's code. Maybe I missed something so basic, so fundamental.. that it should be obvious...



<data file="DATA\EQUIPMENT\weapon_equip.ini" method="append">
<source>
;///////////////////////////////////////////////
[Munition
nickname = prometheus_gun_ammo

Note... that this Nickname does NOT start with a number... and mine does.

Edited by - Argh on 12/3/2004 2:47:19 AM

Post Thu Dec 02, 2004 10:27 am

Ugh. I don't see anything here, either. Of course, the Promethius mod doesn't have this weapon in AI Loadouts, either... and every mod I've seen with weapons used by the AI... doesn't use XML/FLMM to do these sorts of things. So maybe FLMM just can't do this reliably... or I needed to do this in a more subtle fashion.

I sent off an email to IGx89 about this... maybe he'll tell me where I've gone wrong here. I haven't yet found a code example where somebody else has done this, though... of course, I haven't seen any mods that are doing some of the other weird things I've been doing, either, so maybe I just out-weirded myself

Post Thu Dec 02, 2004 1:26 pm

Argh, the problem is most likely in loadouts.ini. Archetype errors occur when there is false equipment designated in loadouts.ini. When the game looks for it, it doesnt find it, and causes a crash. If you email me some files I can try to help you out. If the problem is in your weaponry, I would need access to weapon_equip.ini, weapon_good.ini, and loadouts.ini. If you'd like, I could email you my MSN address, and we could talk via that. Your choice

Also, trailing references means that there are spaces after text somewhere in your files. They can cause errors as well

-Para

Edited by - parabolix on 12/2/2004 1:38:28 PM

Post Thu Dec 02, 2004 2:05 pm

"Ugh. I don't see anything here, either. Of course, the Promethius mod doesn't have this weapon in AI Loadouts, either"

Erm... Please spell Prometheus right.
Did you try version 1.1 of my mod? Hehe, now go out and fight those NPCs with exactly the same loadouts as the player. Crash-free.

Anyway, I assume while cleaning up old, unsused stuff, it might be very likely that somewhere there could still be a hidden reference to anything not in existence now, or changed. The safest method is to simply add stuff, then you have limited possibility of crash causes to search through.

btw: Somehow I feel proud to get my code quoted.

Post Thu Dec 02, 2004 3:17 pm

Argh,

One of my biggest bugbears is trailing references, as they often pop up as the last lines in flspew after a crash.... My theory is that if there are enough of them then they will cause a crash by accumulation, if nothing else. the problem is that one single space in the wrong place ie at the end of a line of code is enough...

Freelancer is very picky...

Harrier.


Retreat[![! ---- I'm too badly messed up now[![!

Post Thu Dec 02, 2004 11:36 pm

Mephistopheles:

Erm, sorry 'bout that... I was typing rather hastily at that point

At any rate, I've mailed what I've got to Parabolix, and I'll look over your current code.

The whole "quest to remove everything" is another issue entirely. Based on early experiments, it seems that content.dll is involved, and is calling things... which if they do not exist, cause the game to hang. So I'm probably going to have to look around in there and see what, exactly, needs to be kept- or learn how to delete such references from content.dll, so that they never get called in the first place. Just removing entries wholesale from the INIs does zero good... the game just CTD's on start, and so does the server. Which is rather annoying, since the game will tolerate removing some things, but not others... and it's not quite clear where this dividing line is.

The reason why I want to do this (but probably won't get anywhere near doing for Beta 1) is simple: if you could strip the codebase of everything FL-related, then building new mods would be a snap. No more worrying about CTD related to the NY System... because it'd be gone, for example. And the drop in memory usage on the server and client end would be huge! Let's face it- the FL engine loads up tons of things that it's never, ever going to use. And if modders could start with a blank slate, then they'd be better off.

Edited by - Argh on 12/2/2004 11:42:44 PM

Post Fri Dec 03, 2004 2:40 am

EEEEEEUREKA.

The problem is solved... and guess what? Like most coding mistakes, it was both:

A. Blindingly obvious, once discovered.
B. A problem of perception.

I was obsessive about the ArchDB error involving "30".

Guess what, folks... that "30" was the "30" at the start of the nickname... NOT an IDS reference. Once I'd gotten to the point where I realised that it wasn't an ID issue, I went caroming through everything. I removed every excess line-break I found in my code (even where they hadn't been causing problems previously)... and what I needed to do was re-write my code like this:

<script>
<data file="DATA\EQUIPMENT\weapon_equip.ini" method="append">
<source>

[Munition
nickname = thirty_cal_ammo
hp_type = hp_gun
requires_ammo = false
hit_pts = 2
hull_damage = 200
energy_damage = 0
weapon_type = W_Laser01
one_shot_sound = machinegun1
munition_hit_effect = li_laser_02_impact
const_effect = machinegun1_proj
lifetime = 0.800000
force_gun_ori = true
mass = 1
volume = 0.000100

[Gun
nickname = thirty_cal
ids_name = 0 ;GENERATESTRRES("30 Cal. Machinegun" )
ids_info = 0 ;GENERATEXMLRES("<xml></xml>" )
DA_archetype = equipment\models\agt\chaingun.cmp
material_library = equipment\models\agt\chaingun.cmp
HP_child = HPConnect
hit_pts = 400
explosion_resistance = 1.000000
debris_type = debris_normal
parent_impulse = 20
child_impulse = 80
volume = 3
mass = 10
hp_gun_type = hp_gun_special_1
damage_per_fire = 0
power_usage = 10
refire_delay = 0.1
muzzle_velocity = 1200
use_animation = Sc_fire
toughness = 1.300000
flash_particle_name = li_laser_01_flash
flash_radius = 15
light_anim = l_gun01_flash
projectile_archetype = thirty_cal_ammo
separation_explosion = sever_debris
auto_turret = false
turn_rate = 0
lootable = true
LODranges = 0, 200
</source>
</data>
</script>

See? Changed the "30_cal" to "thirty_cal"... and problem solved!

Sooooo... now we know. Start the nickname of a thing with a number... and the FL engine doesn't like it. This has been tested with MP and SP starting Loadouts, as well as with the AI. The problem is totally gone, and I'm not seeing errors in Spew. Kewl... now, where was I? Oh yeah, I was building a mod...

Edited by - Argh on 12/3/2004 2:49:18 AM

Post Fri Dec 03, 2004 7:48 am

lol, interesting stuff ..

and good luck with ur mod again

Return to Freelancer General Editing Forum