How would one create custom space destroyables?

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
WoodenViking
Recruit Womprat Killer
Posts: 10
Joined: Tue Oct 10, 2017 11:55 pm
Projects :: Messing around...
Games I'm Playing :: Battlefront II
xbox live or psn: WoodenViking

How would one create custom space destroyables?

Post by WoodenViking »

The title basically says it all.
User avatar
Oceans14
Command Sergeant Major
Command Sergeant Major
Posts: 296
Joined: Mon Apr 27, 2015 7:09 pm
Projects :: Athenova Campaign
Games I'm Playing :: SWBF2
Location: Planet 4546b

Re: How would one create custom space destroyables?

Post by Oceans14 »

Well, assuming by "custom" you mean a completely new prop from scratch, you're going to have to model it in some kind of 3d design software. You'd have to make the prop itself, a destroyed version, and possibly some chunks if it's big enough. The 3d modeling section and this tutorial are good places to start. In terms of the odf, you'd need something like this very basic setup:

Code: Select all

[GameObjectClass]		

ClassLabel		=	"destructablebuilding"
GeometryName	=	"my_prop.msh"


[Properties]		

GeometryName	=	"my_prop"
DestroyedGeometryName 	= "my_prop_dest"
MaxHealth       = 100

ExplosionName = "my_prop_exp" //or some other explosion you like the look of 
You can test this by substituting in stock props for the geometries, or by looking at how stock destroyables are set up (try yav_prop_blastdoor for example).


Nice avatar btw, that was mine for a while :)
WoodenViking
Recruit Womprat Killer
Posts: 10
Joined: Tue Oct 10, 2017 11:55 pm
Projects :: Messing around...
Games I'm Playing :: Battlefront II
xbox live or psn: WoodenViking

Re: How would one create custom space destroyables?

Post by WoodenViking »

Oceans14 wrote:Well, assuming by "custom" you mean a completely new prop from scratch, you're going to have to model it in some kind of 3d design software. You'd have to make the prop itself, a destroyed version, and possibly some chunks if it's big enough. The 3d modeling section and this tutorial are good places to start. In terms of the odf, you'd need something like this very basic setup:

Code: Select all

[GameObjectClass]		

ClassLabel		=	"destructablebuilding"
GeometryName	=	"my_prop.msh"


[Properties]		

GeometryName	=	"my_prop"
DestroyedGeometryName 	= "my_prop_dest"
MaxHealth       = 100

ExplosionName = "my_prop_exp" //or some other explosion you like the look of 
You can test this by substituting in stock props for the geometries, or by looking at how stock destroyables are set up (try yav_prop_blastdoor for example).


Nice avatar btw, that was mine for a while :)

Hmm, well I probably should have specified my intentions first. My goal is to make a “space” map wher the REP is defending a city on the ground and the CIS is attacking from the air. The problem isn’t me actually creating a model. It’s making it to where when you destroy enough buildings in the city, depending on what faction you choose, you win the game.

So my question is how you would make an object, when you destroy it, add points to your team score... like in space assault when you destroy the life support it adds like 18 points to your team score :)

And thanks :D I chose it because it looks like he’s about to do the hardest nae nae ever.
User avatar
Oceans14
Command Sergeant Major
Command Sergeant Major
Posts: 296
Joined: Mon Apr 27, 2015 7:09 pm
Projects :: Athenova Campaign
Games I'm Playing :: SWBF2
Location: Planet 4546b

Re: How would one create custom space destroyables?

Post by Oceans14 »

So that's a scripting thing, then. Check out the scripts in the space_template folder, specifically the assault ones. You need to load the ObjectiveSpaceAssault script (check that one out too, it'll be in MOD_data/common/scripts) because that loads the code for adding points after destroying objects. In fact, I think it would make sense to just replace MODc_con with one of the space assault scripts and set up the level that way, since your mode is going to revolve around points and not cp captures. The quick and easy way to get this going is to just name your destructible buildings after the ship parts (shield generator, engines, whatever) because then you don't have to go in and specify new destructible objects with their own point values and stuff (just don't forget to rename the localizations, otherwise it'll still say "Our shields have been disabled" when you blow up a house).

Also I feel I should mention that A) there are probably a few ways to do what you want, and B) I have never actually done any space/points scripting - but I've poked around with the files plenty of times and am reasonably confident you'll have luck doing it this way.
WoodenViking
Recruit Womprat Killer
Posts: 10
Joined: Tue Oct 10, 2017 11:55 pm
Projects :: Messing around...
Games I'm Playing :: Battlefront II
xbox live or psn: WoodenViking

Re: How would one create custom space destroyables?

Post by WoodenViking »

Oceans14 wrote:So that's a scripting thing, then. Check out the scripts in the space_template folder, specifically the assault ones. You need to load the ObjectiveSpaceAssault script (check that one out too, it'll be in MOD_data/common/scripts) because that loads the code for adding points after destroying objects. In fact, I think it would make sense to just replace MODc_con with one of the space assault scripts and set up the level that way, since your mode is going to revolve around points and not cp captures. The quick and easy way to get this going is to just name your destructible buildings after the ship parts (shield generator, engines, whatever) because then you don't have to go in and specify new destructible objects with their own point values and stuff (just don't forget to rename the localizations, otherwise it'll still say "Our shields have been disabled" when you blow up a house).

Also I feel I should mention that A) there are probably a few ways to do what you want, and B) I have never actually done any space/points scripting - but I've poked around with the files plenty of times and am reasonably confident you'll have luck doing it this way.

Okay, thanks. This was exactly what I was looking for. Judging by how complex the ObjectiveSpaceAssualt.LUA looks it’ll be incredibly time consuming to write my own point systems and such. So I’ll probably go with renaming the already existing critical systems.
Post Reply