Object Textures and Classes [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
MrMew
Private Third Class
Posts: 52
Joined: Tue Mar 29, 2016 10:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Object Textures and Classes [Solved]

Post by MrMew »

What files does an odf need to display it's texture? To minimise the size of the map I just imported the crate object from mustafar, mus_prop_crate.odf and mus_prop_crate.msh, however when I try and place the object in the map it has no texture. An older map I was playing around with I just imported all the odfs and mshs into and the texture was there.
Also is it possible with the scripts to change the amount of points it takes a class to be unlocked (Rail Arc Trooper for example)?
And can other custom maps be edited without starting with the original world creation file?
Last edited by MrMew on Sat Apr 02, 2016 2:36 am, edited 1 time in total.
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Object Textures and Classes

Post by AnthonyBF2 »

1) For objects, ensure that inside of MSH folder, you've got the .msh (object) and the textures (.tga) files it looks for. To know exactly what textures an .msh file looks for, simply open the .msh file in a hex editor and scan for all instances of .tga and you'll see texture names it wants. All you have to do then is copy those textures to your MSH folder.

2) You can make locked classes free by using an Lua function known as SetClassProperty. In your map Lua file, look for ScriptPostLoad() and just below that line, add this line - SetClassProperty("imp_inf_dark_trooper", "PointsToUnlock", "0") - Just replace the Dark Trooper name with the name of a character you want to be free.

3) You can't edit compiled maps unless you've got the source. There are very primitive things you can change in compiled maps but there isn't much you can do. You can hex edit things like how many vehicles may spawn from a vehicle spawn point at one time, or the health of an object, or the radius of a particular ammunition droid. And it isn't that simple, those things have to be done manually in a hex editing program, and then you've got to know what you're looking for and what to change because compiled data doesn't look like it's source counter part.
User avatar
MrMew
Private Third Class
Posts: 52
Joined: Tue Mar 29, 2016 10:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: Object Textures and Classes

Post by MrMew »

Thanks!
I was actually getting it to be eight points to be unlocked, haha.

Just a few more questions:

Can I rename the map?

Can I add a new game mode?

And what would you recommend to make the final map size smaller (file size)?
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Object Textures and Classes

Post by AnthonyBF2 »

You cannot rename a mod map but you can rename your own map. Just run the editlocalize.bat file found in the main mod project folder.
Navigate to mapname.description.abc and mapname.name.abc and you'll see map name and description spaces that you can change. (abc = your 3 mod letters) Just be sure to save changes.

You can add more modes to your own map, but it's not that simple for a new person. (and that you seem to be)
You can add more modes to compiled mod maps too but it's probably just as advanced. Best next thing for you is to look at the FAQ. It''s got everything you could possible need to change or make anything. I might go as far as to say you should pin the FAQ to your desktop via a shortcut.
User avatar
MrMew
Private Third Class
Posts: 52
Joined: Tue Mar 29, 2016 10:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: Object Textures and Classes

Post by MrMew »

I was guessing to add a new mode (hunt) I'd have to add a new layer in zero editor and copy over a script and any other relevant files.
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Object Textures and Classes

Post by AnthonyBF2 »

A new layer is not required. You can use the conquest layer as a hunt mode.

Let's say you only want 1 CP per team, you want CPs to not be visible and you want the CPs to use different paths and you currently have 4 CPs total, you'd do you this;

ScriptPostLoad()
-- double hyphens represent comments, these are not code. I'll be making comments as if this were my own mod.
KillObject("CP1") -- these are the two bases you don't want to be used in your hunt mode
KillObject("CP2")

SetProperty("CP3", "SpawnPath", "hunt_team1_spawn") -- you should add 2 extra paths in you conquest layer so these commands find them
SetProperty("CP4", "SpawnPath", "Hunt_team2_spawn") -- these commands tell these CPs to use different spawn paths rather than their defaults

-- If you want the CPs to be locked, you'd add some commands that look like this;
SetClassProperty("character_name", "CapturePosts", "0") -- repeat this command for all characters in your hunt mode

-- Alternatively you can just lock those bases without telling characters to not have a capture ability
SetProperty("CP3", "CaptureRegion", "nil") -- in Lua, nil means nothing
SetProperty("CP4", "CaptureRegion", "nil")

*your script continues here*

Apart from that I just have one more note. SetProperty and SetClassProperty are wonderful functions. You can change so many things with these functions alone, to the point where you wouldn't even need to make custom sides unless you wanted to.

Just note the differences between the 2 commands;
SetClassProperty is for classes - a class is anything that can be controlled - flyers, tanks, heroes, troops
SetProperty is for objects - anything that is a destructible entity can be manipulated with this command
User avatar
MrMew
Private Third Class
Posts: 52
Joined: Tue Mar 29, 2016 10:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: Object Textures and Classes

Post by MrMew »

The game mode isn't appearing in-game. This is in TKFg_eli.lua:


ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")
-- load the gametype script
-- Empire Attacking(attacker is always #1)
IMP = 1
ALL = 2
-- These variables do not change
ATT = 1
DEF = 2

---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
SetClassProperty("imp_inf_dark_trooper", "PointsToUnlock", "0")
KillObject("CP3")
KillObject("CP4")
SetProperty("CP1", "SpawnPath", "hunt_team1_spawn")
SetProperty("CP2", "SpawnPath", "Hunt_team2_spawn")
SetProperty("CP1", "CaptureRegion", "nil")
SetProperty("CP2", "CaptureRegion", "nil")

TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
pointsPerKillATT = 1, pointsPerKillDEF = 1,
textATT = "level.end1.objectives.hunt",
textDEF = "game.modes.hunt2", multiplayerRules = true}
TDM:Start()

AddAIGoal(ATT, "Deathmatch", 1000)
AddAIGoal(DEF, "Deathmatch", 1000)


end
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Object Textures and Classes

Post by AnthonyBF2 »

If you didn't check mark the Hero Assault option when making your mod map, you'll have to add it manually, which requires a bunch of little steps that I am unsure of. It's been too long since I messed making custom mods for the PC platform.

You may be confusing Hero Assault with Hunt. The eli extension stands for elite (I think) anyway it's the mode for hero assault. Hunt mode extension is hunt. Hunt mode isn't part of the mod tools options when making a mod map. You'll have to add it manually - definitely.
User avatar
MrMew
Private Third Class
Posts: 52
Joined: Tue Mar 29, 2016 10:44 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set

Re: Object Textures and Classes

Post by MrMew »

Yeah I might leave that one for a bit. Hero assault and hunt are very similar though, kill for points.
Post Reply