Increase shields on space-ships

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

User avatar
linksith
Command Sergeant Major
Command Sergeant Major
Posts: 284
Joined: Mon Jul 12, 2010 12:19 pm
Projects :: Waaay too many projects
Games I'm Playing :: too many
xbox live or psn: me has no xbox
Location: looking for a wifi connection

Re: Increase shields on space-ships

Post by linksith »

I still can't seem to find a way to get the new ship shielded. I added it in the LUA and deleted the objects that I removed. Here is what my clone wars assault LUA looks like.
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPAX - Clone Wars Template Assault File
--
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("CSBc_cmn")

ScriptCB_DoFile("ObjectiveSpaceAssault")
ScriptCB_DoFile("LinkedShields")
ScriptCB_DoFile("LinkedDestroyables")

myGameMode = "CSB_CW-Assault"

function myScriptInit()
SetMemoryPoolSize("CommandFlyer", 2)
end


function ScriptPostLoad()
SetupObjectives()

SetupShields()
SetupDestroyables()
SetupTurrets()

AddAIGoal(REP, "Deathmatch", 100)
AddAIGoal(CIS, "Deathmatch", 100)

DisableSmallMapMiniMap()
end

function SetupObjectives()
assault = ObjectiveSpaceAssault:New{
teamATT = REP, teamDEF = CIS,
multiplayerRules = true
}

local repTargets = {
engines = { "cis_drive_1", "cis_drive_2" },
lifesupport = "cis-life-ext",
bridge = "cis-bridge",
comm = "cis-comms",
sensors = "cis-sensors",
frigates = "cis-frigate",
internalSys = { "cis-life-int", "cis-engines" },
}

local cisTargets = {
engines = "rep_drive_1",
lifesupport = "rep-life-ext",
bridge = "rep-bridge",
comm = "rep-comms",
sensors = "rep-sensors",
frigates = "rep-frigate",
internalSys = { "rep-life-int", "rep-engines" },
}

assault:SetupAllCriticalSystems( "rep", repTargets, true )
assault:SetupAllCriticalSystems( "cis", cisTargets, false )

assault:Start()
end

function SetupShields()
-- CIS Shielded objects
local linkedShieldObjectsCIS = { "cis_ship_1",
"cis-bridge", "cis-comms", "cis-life-ext", "cis-sensors",
"cis_drive_1", "cis_drive_2"}
shieldStuffCIS = LinkedShields:New{objs = linkedShieldObjectsCIS, controllerObject = "cis-shield"}
shieldStuffCIS:Init()

function shieldStuffCIS:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", REP)
ShowMessageText("level.spa.hangar.shields.def.down", CIS)

BroadcastVoiceOver( "ROSMP_obj_16", REP )
BroadcastVoiceOver( "COSMP_obj_17", CIS )
end
function shieldStuffCIS:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", REP)
ShowMessageText("level.spa.hangar.shields.def.up", CIS)

BroadcastVoiceOver( "ROSMP_obj_18", REP )
BroadcastVoiceOver( "COSMP_obj_19", CIS )
end

-- REP Shielded objects
local linkedShieldObjectsREP = { "rep_ship_1", "rep_ship_2", "rep_ship_3", "rep_ship_4",
"rep-bridge", "rep-comms", "rep-life-ext", "rep-sensors",
"rep_drive_1"}
shieldStuffREP = LinkedShields:New{objs = linkedShieldObjectsREP, controllerObject = "rep-shield"}
shieldStuffREP:Init()

function shieldStuffREP:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", CIS)
ShowMessageText("level.spa.hangar.shields.def.down", REP)

BroadcastVoiceOver( "ROSMP_obj_17", REP )
BroadcastVoiceOver( "COSMP_obj_16", CIS )
end
function shieldStuffREP:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", CIS)
ShowMessageText("level.spa.hangar.shields.def.up", REP)

BroadcastVoiceOver( "ROSMP_obj_19", REP )
BroadcastVoiceOver( "COSMP_obj_18", CIS )
end
end
I'm not sure if I did something wrong or what so if something needs corrected, please help.

NOTE: I will hopefully be adding more ships later (a lot more ships) that will need they're own shields as well. Please give me an answer on how to do this as well.
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Re: Increase shields on space-ships

Post by MercuryNoodles »

Which ship is using the ZE name cis_ship_1, now? If it hasn't changed, I'd say you now have a Providence that's only shielded on the front quarter. Either way, you have just one ship shielded, according to your script.

Before I go further, I have to mention again that doing this will not allow the shielding you want for the TradeFed battleship without special scripting, if it's possible.

Now, so far two people have told you exactly how to do this with examples, so I'm going to try to say this another way. You need a third section inside the SetupShields function.
Hidden/Spoiler:
-- CIS Shielded objects
local linkedShieldObjectsCIS = { "cis_ship_1", "cis_ship_2", "cis_ship_3", "cis_ship_4",
"cis-bridge", "cis-comms", "cis-life-ext", "cis-sensors",
"cis_drive_1", "cis_drive_2", "cis-drive-3"}
shieldStuffCIS = LinkedShields:New{objs = linkedShieldObjectsCIS, controllerObject = "cis-shield"}
shieldStuffCIS:Init()

function shieldStuffCIS:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", REP)
ShowMessageText("level.spa.hangar.shields.def.down", CIS)

BroadcastVoiceOver( "ROSMP_obj_16", REP )
BroadcastVoiceOver( "COSMP_obj_17", CIS )
end
function shieldStuffCIS:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", REP)
ShowMessageText("level.spa.hangar.shields.def.up", CIS)

BroadcastVoiceOver( "ROSMP_obj_18", REP )
BroadcastVoiceOver( "COSMP_obj_19", CIS )
end
That bit of code is for just one ship. You need to have a third, fourth, or however many you need for all of your ships. They also need to be properly renamed, with their own list of objects, and you can refer to my earlier reply or DarthD.U.C.K.'s on how to deal with that.
User avatar
linksith
Command Sergeant Major
Command Sergeant Major
Posts: 284
Joined: Mon Jul 12, 2010 12:19 pm
Projects :: Waaay too many projects
Games I'm Playing :: too many
xbox live or psn: me has no xbox
Location: looking for a wifi connection

Re: Increase shields on space-ships

Post by linksith »

I'm still a beginner modder so this stuff isn't making things easy for me to understand. cis_ship_1 is my first ship I'm making for my mod which is the droid battleship/controlship. I have separated the bridge from the entire object in Blender and named that object cis_ship_1. So cis_ship_1 is the battleship but without the destroyable objects. I've also come across a problem with the shield generator, whenever I destroy the generator the shields stay up. I'm starting to think that the map may not be worth the trouble, but I'm gonna try for it.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Increase shields on space-ships

Post by DarthD.U.C.K. »

make shure you label the objects exactly as you call them in your lua 8and make shure to label the shieldgen exactly as youve called it as controller-object
User avatar
linksith
Command Sergeant Major
Command Sergeant Major
Posts: 284
Joined: Mon Jul 12, 2010 12:19 pm
Projects :: Waaay too many projects
Games I'm Playing :: too many
xbox live or psn: me has no xbox
Location: looking for a wifi connection

Re: Increase shields on space-ships

Post by linksith »

Well it turns out that I named them correctly but still no shield. I just came across another problem, I saw a floating little life support console but in ZE none of the consoles showed up. Also, I added the modified hangar to the battleship, would that stop the shields from working?

EDIT: I'm not sure about this but just a thought; could the reason that the cap ships are in 4 parts be because shields don't support big objects?
User avatar
sim-al2
2nd Lieutenant
2nd Lieutenant
Posts: 412
Joined: Mon Jul 06, 2009 10:26 pm
Projects :: Mapping on occasion
Games I'm Playing :: SWBFII + MW4 + SC4
Location: In the cockpit of some vehicle...

Re: Increase shields on space-ships

Post by sim-al2 »

The object's size doesn't matter much for most stuff in the game.
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Re: Increase shields on space-ships

Post by MercuryNoodles »

whenever I destroy the generator the shields stay up
Well it turns out that I named them correctly but still no shield.
So which is it? Does it have a shield, or not? You need to be specific about what's happening, or you're going to make this as confusing for those helping as they are in trying to explain.

The game is rather case sensitive. Make sure the controllerObject's name in the lua has the same capitalization as the name given in ZE.


As far as being new to modding goes, if you really want to learn, there's no better time than now, right? :P
User avatar
linksith
Command Sergeant Major
Command Sergeant Major
Posts: 284
Joined: Mon Jul 12, 2010 12:19 pm
Projects :: Waaay too many projects
Games I'm Playing :: too many
xbox live or psn: me has no xbox
Location: looking for a wifi connection

Re: Increase shields on space-ships

Post by linksith »

Ok, I guess I did need to be more specific so sorry. The object had no shield and it was typed correctly, including the case. To be more specific for the shield generator thing, whenever I destroy the shield-gen (the generator which works for the shields on the bridge, communications, engines, etc.), the shields on those objects stay up. So now I'm wondering if there is another LUA in which I have to add the object name in as well, unless I have something incorrect in my LUA that I posted earlier.

EDIT: Oh, and what is conrolerobject anyway?
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Increase shields on space-ships

Post by DarthD.U.C.K. »

*facepalm*
if you read my last post in this thread and in the other thread about the same topic you may find it out
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Re: Increase shields on space-ships

Post by MercuryNoodles »

Ok, well, I have an answer on the battleship not having a shield, after trying to set it up myself. cis_cap_fedcoreship.odf has a classlabel of prop, which doesn't support shielding. Change the classlabel to armedbuilding, and I think it may also need a health value. I gave mine the same health parameters as the stock ships, just to be sure. Just beware that the ship model has some odd collision, so the shield looks weird (effect playing partially within the ship due to its orientation) when firing at different areas.
User avatar
linksith
Command Sergeant Major
Command Sergeant Major
Posts: 284
Joined: Mon Jul 12, 2010 12:19 pm
Projects :: Waaay too many projects
Games I'm Playing :: too many
xbox live or psn: me has no xbox
Location: looking for a wifi connection

Re: Increase shields on space-ships

Post by linksith »

Thank you so much! That explains a bit. But the shield-gen problem is still there. Every time I destroy the shield-gen the for the CIS the CIS shields stay up, but when I repair the CIS shield-gen the CIS shields come back up. It makes no sense why the shields will come back up but won't go down (except for when I destroy them from the outside).

EDIT: Is there a tutorial for placing plans and barriers in a space map? And is there a way to elevate barriers?
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Re: Increase shields on space-ships

Post by MercuryNoodles »

Sadly, I don't have that problem. I have difficulties of my own! :P In my attempt at getting a separate shield by following my own logic, I got one, but now I can't destroy it externally or internally while the stock ships lose shielding normally. I'm of the belief that it's isolated to the scripting, but I can't quite figure out why it would increase the shield regeneration, or why my simplistic attempts to override this effect do nothing. I currently can't even do more than scratch the battleship's shields before they go back to full strength, and that's while using a bomber.

We may need a better look at what you've done to see what exactly is the problem. I'm especially curious, since you're getting an entirely different result from myself.

Planning and barriers are the same for both map types. They have infinite height, and there should be an option labelled "height" in the toolbar on the left side of the ZE window, which will allow you to change how high they are displayed.
User avatar
linksith
Command Sergeant Major
Command Sergeant Major
Posts: 284
Joined: Mon Jul 12, 2010 12:19 pm
Projects :: Waaay too many projects
Games I'm Playing :: too many
xbox live or psn: me has no xbox
Location: looking for a wifi connection

Re: Increase shields on space-ships

Post by linksith »

Right now my plan is to make this map bigger and far better than Battle over Coruscant. Also, is an object labeled as an armed builing destroyable when the regenerate and health numbers are changed?
MercuryNoodles
Jedi
Jedi
Posts: 1003
Joined: Sun Mar 12, 2006 7:16 pm
Projects :: Space - Boarding Action
xbox live or psn: No gamertag set

Re: Increase shields on space-ships

Post by MercuryNoodles »

Theoretically, yes. I don't see any reason for there to be a problem with making them destructible. However, making a destructible mothership isn't exactly simple, since you also have to link the destructible parts, deactivate associated regions, and kill any non-destructible parts through the script. It's been discussed several times here, so try a search on that to see if there's any useful info, though I wouldn't recommend it for a beginner.
User avatar
linksith
Command Sergeant Major
Command Sergeant Major
Posts: 284
Joined: Mon Jul 12, 2010 12:19 pm
Projects :: Waaay too many projects
Games I'm Playing :: too many
xbox live or psn: me has no xbox
Location: looking for a wifi connection

Re: Increase shields on space-ships

Post by linksith »

Ok, I re-did the entire map and now the shield-gen problem is gone. I am able to disable the shield internally and externally on both CIS ships. Here is my LUA.
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPAX - Clone Wars Template Assault File
--
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ISBc_cmn")

ScriptCB_DoFile("ObjectiveSpaceAssault")
ScriptCB_DoFile("LinkedShields")
ScriptCB_DoFile("LinkedDestroyables")

myGameMode = "ISB_CW-Assault"

function myScriptInit()
SetMemoryPoolSize("CommandFlyer", 2)
end


function ScriptPostLoad()
SetupObjectives()

SetupShields()
SetupDestroyables()
SetupTurrets()

AddAIGoal(REP, "Deathmatch", 100)
AddAIGoal(CIS, "Deathmatch", 100)

DisableSmallMapMiniMap()
end

function SetupObjectives()
assault = ObjectiveSpaceAssault:New{
teamATT = REP, teamDEF = CIS,
multiplayerRules = true
}

local repTargets = {
engines = { "cis_drive_1", "cis_drive_2", "cis_drive1", "cis_drive2", },
lifesupport = "cis-life-ext", "cis-life-ext2",
bridge = "cis-bridge", "cis-bridge2",
comm = "cis-comms", "cis-comms2",
sensors = "cis-sensors", "cis-sensors2",
frigates = "cis-frigate", "cis-frigate2",
internalSys = { "cis-life-int", "cis-life-int2", "cis-engines", "cis-engines2", },
}

local cisTargets = {
engines = "rep_drive_1",
lifesupport = "rep-life-ext",
bridge = "rep-bridge",
comm = "rep-comms",
sensors = "rep-sensors",
frigates = "rep-frigate",
internalSys = { "rep-life-int", "rep-engines" },
}

assault:SetupAllCriticalSystems( "rep", repTargets, true )
assault:SetupAllCriticalSystems( "cis", cisTargets, false )

assault:Start()
end

function SetupShields()
-- CIS Shielded objects
local linkedShieldObjectsCIS = { "cis_ship_1", "cis_ship_2", "cis_ship_3", "cis_ship_4",
"cis-bridge", "cis-comms", "cis-life-ext", "cis-sensors",
"cis_drive_1", "cis_drive_2"}
shieldStuffCIS = LinkedShields:New{objs = linkedShieldObjectsCIS, controllerObject = "cis-shield"}
shieldStuffCIS:Init()

local linkedShieldObjectsCIS = { "cis_mothership",
"cis-bridge2", "cis-comms2", "cis-life-ext2", "cis-sensors2",
"cis_drive1", "cis_drive2"}
shieldStuffCIS = LinkedShields:New{objs = linkedShieldObjectsCIS, controllerObject = "cis-shield2"}
shieldStuffCIS:Init()

function shieldStuffCIS:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", REP)
ShowMessageText("level.spa.hangar.shields.def.down", CIS)

BroadcastVoiceOver( "ROSMP_obj_16", REP )
BroadcastVoiceOver( "COSMP_obj_17", CIS )
end
function shieldStuffCIS:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", REP)
ShowMessageText("level.spa.hangar.shields.def.up", CIS)

BroadcastVoiceOver( "ROSMP_obj_18", REP )
BroadcastVoiceOver( "COSMP_obj_19", CIS )
end



-- REP Shielded objects
local linkedShieldObjectsREP = { "rep_ship_1", "rep_ship_2", "rep_ship_3", "rep_ship_4",
"rep-bridge", "rep-comms", "rep-life-ext", "rep-sensors",
"rep_drive_1"}
shieldStuffREP = LinkedShields:New{objs = linkedShieldObjectsREP, controllerObject = "rep-shield"}
shieldStuffREP:Init()

function shieldStuffREP:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", CIS)
ShowMessageText("level.spa.hangar.shields.def.down", REP)

BroadcastVoiceOver( "ROSMP_obj_17", REP )
BroadcastVoiceOver( "COSMP_obj_16", CIS )
end
function shieldStuffREP:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", CIS)
ShowMessageText("level.spa.hangar.shields.def.up", REP)

BroadcastVoiceOver( "ROSMP_obj_19", REP )
BroadcastVoiceOver( "COSMP_obj_18", CIS )
end
end


function SetupDestroyables()
--CIS destroyables
lifeSupportLinkageCIS = LinkedDestroyables:New{ objectSets = {{"cis-life-int"}, {"cis-life-ext"}} }
lifeSupportLinkageCIS:Init()

engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"cis_drive_1", "cis_drive_2"}, {"cis-engines"}} }
engineLinkageCIS:Init()

--REP destroyables
lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep-life-int"}, {"rep-life-ext"}} }
lifeSupportLinkageREP:Init()

engineLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep_drive_1"}, {"rep-engines"}} }
engineLinkageREP:Init()
end
I'm gonna need to find out how to modify it so I can change the strength of the shield; although I think you're right, it may just be integrated into the game. But if anyone can find a way to change it, that would be great. Now I got to find a way to add more things to the mission and get rid of the 9 life support consoles in the rep ship as one is floating in the air.
Post Reply