Help getting 3d unit in game

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

tim1966
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 161
Joined: Sat Jul 31, 2010 7:15 pm
Location: Brighton, UK
Contact:

Help getting 3d unit in game

Post by tim1966 »

Ok - I've made a Greyhound and exported with the script. I'm trying to add to the Normandy campaign. So I copied the Normandy folders to my games/BBCBA/Campaigns. I've added the greyhound to squads.csv but when I open the editor I get Missing_Unit_ID. The Greyhound model shows up. I had to add _0 to the file name for s3f.

I think I need to add the UNITID to a text file but I can't see where. Any help appreciated.

I haven't done animations yet - just wanted to see if I could get it in game - all the frames are there but there is just no movement.

Image
Models from Tim's Surplus Store ... Established 1966 ... Open 24/7 ... closed for TEA TIME
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

EDIT : copy/paste the Text1.txt (from the Battlefield Academy\Data\Text folder ) to your campaign folder \Data\Text

Open the text1 file

Add the name of your new unit ...eg IDS_UNITNAME99,"M8 Greyhound",

the unit name ## is obviously one greater than the last entry.

Rob
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

There are two places on the text1 for units.
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Actually your campaign text files go in the root of the folder, where the initial one gets written. There is no need to copy existing files in, as anything you add or replace in your files will be used rather than the ones from the main install - so you only need to create a file including new text.

As has been said, create an IDS_UNITNAME# entry where the # is the value you put into the squads file under the ID tag.

Hope that helps

Looks awesome!

Cheers

Pip
tim1966
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 161
Joined: Sat Jul 31, 2010 7:15 pm
Location: Brighton, UK
Contact:

Post by tim1966 »

Thanks everyone - I'm within an ace now - I have it in game with the right name - the only problem is the unit info shows Missing Unit ID. I added the IDS_UNITIF100,"Greyhound~~Blah blah along with the IDS_UNITNAME100,"Greyhound". Its in text1 in Data (along with a load of other stuff from the original campaign.
EDIT - sorted - I mistook a o for a zero... doh!
Models from Tim's Surplus Store ... Established 1966 ... Open 24/7 ... closed for TEA TIME
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

In the squad cvs, the item number on the left is not the same as the unit number, just a FYI, it is off by two. Make sure that the 100 is to the right of the unit name in the first entry and that both text entries match that number and spelling.

the first entry in text has different spaces than the second. I'm at work and can't check now. Make sure you have a comma at the end of the line.

You need to create the UI icons for the purchase screen and the bottom of the in game screen. You could probably substitute something else for this.
Amaz_Ed
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 240
Joined: Wed Feb 10, 2010 11:22 am
Location: Shropshire, UK

Post by Amaz_Ed »

Failed to load required asset file JEEP_0.* (0)
Any idea what I have done wrong? I can see the Jeep in the list of assets in the editor, but whenever I try to place it I get this error message and the game crashes.
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

Double check your entries in the cvs and text1 for spelling, O vs 0, unit number, quotes commas spaces underscores.
Amaz_Ed
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 240
Joined: Wed Feb 10, 2010 11:22 am
Location: Shropshire, UK

Post by Amaz_Ed »

Everything sees to be ok there, but I noticed that in Tim's Greyhound's Unit's folder there is an .s4f file (GREYHOUND_0.s4f). I do not have such a file and don't know what it is. When I copied this file to my own units folder I was able to add my unit to the game, but it looked like a black Greyhound with writing on it...... :o :lol: :oops:

EDIT: Ok, I see this in the documentation:

[Note: when you run the game it will recode any S3F files into S4F files, the binary
equivalent, which are much faster to load. It will then load this file from then on. So if you are
tweaking the S3F file, you will need to ensure you delete the S4F to see changes in the
game. A batch file can be helpful here.]


So why didn't the game produce an s4f file for me?
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Where was the file living? In a custom campaign?

Cheers

Pip
Amaz_Ed
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 240
Joined: Wed Feb 10, 2010 11:22 am
Location: Shropshire, UK

Post by Amaz_Ed »

Yes, I exported it to a copy of the Bulge campaign. I am certain I have done something totally n00bish.....
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

It should create the S4F for you. Although ideally content creators would send out the S4F rather than the S3F, if only for speed of loading the asset.

If it is loading the S3F then it should be created. Is this not happening?

Cheers

Pip
Amaz_Ed
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 240
Joined: Wed Feb 10, 2010 11:22 am
Location: Shropshire, UK

Post by Amaz_Ed »

No. I exported the model from Max 2011 and an s3f file was created. I followed the instructions in the editor guide to add the model to the game. When I launch the editor the Jeep is listed as a unit, but every time I try to place it the editor crashes. There is no s4f file created by the exporter or by the game.
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Ah - I see. Hmm - it sounds then like the model is crashing the game for some reason. Are you running in a window? Is there an error message?

If not, can you post the last 40 lines or so of the error.log file (in My Docs\My Games\BBCBA) immediately after a crash.

Cheers

Pip
Amaz_Ed
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 240
Joined: Wed Feb 10, 2010 11:22 am
Location: Shropshire, UK

Post by Amaz_Ed »

Full screen mode and the error message is Failed to load required asset file JEEP_0.* (0) followed by:

Image
Removing script: C:\Program Files (x86)\Slitherine\Battlefield Academy\CORE\AI\AI.BSF
Removing script: C:\Program Files (x86)\Slitherine\Battlefield Academy\DATA\BATTLE\SCRIPTS\HELPERS.BSF
Removing script: C:\Program Files (x86)\Slitherine\Battlefield Academy\CORE\BONUS\P47.BSF
Removing script: C:\Program Files (x86)\Slitherine\Battlefield Academy\CORE\BONUS\ME262.BSF
Removing script: C:\Program Files (x86)\Slitherine\Battlefield Academy\DATA\BATTLE\SCRIPTS\$DEFAULT.BSF
Playing as: 0
SIDE 0
ERROR
Failed to load required asset file JEEP_0.*
(0) : Failed
ERROR

######## EXCEPTION: 0x80000003 at address: 0x769222A1
C:\Program Files (x86)\Slitherine\Battlefield Academy;C:\Program Files (x86)\Slitherine\Battlefield Academy;C:\Windows
DebugBreak
0: SymGetSymFromAddr64(): GetLastError = 126
0: SymGetLineFromAddr(): GetLastError = 126
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Where exactly have you placed the jeep file? It's failing to find it, which should be simple enough to fix :).

And what name have you used in the AssetFilename entry in the squads file?

Cheers

Pip
Amaz_Ed
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 240
Joined: Wed Feb 10, 2010 11:22 am
Location: Shropshire, UK

Post by Amaz_Ed »

C:\Users\Paul\Documents\My Games\BBCBA\CAMPAIGNS\3Bulge\DATA\Battle\Units
jeep
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Hmmm - I just tried out replicating here and it seems to work fine.

Double check there is no space or anything around the entry in the assetfilename slot of the squads file.

If you still can't work out the issue, then zip up the whole dir and let me have the link and I will take a look. It might be quite large though if it is the whole bulge campaign, so perhaps try putting the unit into a small custom campaign to make it simpler to test.

Cheers

Pip
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Worked it out - all unit S3F files need to have _0 appended to their name, so rename the jeep.s3f to be jeep_0.s3f. This is a historical loading requirement (basically we sometimes have LODs that we need to load). This isn't stated in the document, I will update it now.

Sorry for the confusion.

Cheers

Pip
Amaz_Ed
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 240
Joined: Wed Feb 10, 2010 11:22 am
Location: Shropshire, UK

Post by Amaz_Ed »

HAHAHAHAHAHA!!!!!!

Sorry....

Thanks for that, it works beautifully. ;)

Image

Now I need to sort out the animation and I'm done.
Post Reply

Return to “Battle Academy : Modders Corner ”