Page 1 of 2

Increase shields on space-ships

Posted: Sat Aug 14, 2010 9:57 pm
by linksith
Hi, I'm making a space map with a very large spaceship so I need to increase the shields on it. Is there any way to do this? Thanks for the help.

Re: Increase shields on space-ships

Posted: Sat Aug 14, 2010 10:45 pm
by PilotX
MaxShield =
AddShield =

Re: Increase shields on space-ships

Posted: Sat Aug 14, 2010 10:59 pm
by linksith
Where may I find those?

Re: Increase shields on space-ships

Posted: Sat Aug 14, 2010 11:45 pm
by acryptozoo
linksith wrote:Where may I find those?
in its odf :D

Re: Increase shields on space-ships

Posted: Sun Aug 15, 2010 12:02 am
by sim-al2
For a cap-ship shield...? :?

LinkedShields.lua in your common\scripts folder would be a good place to start, although I haven't tried space maps yet so I don't know if that would be the only thing to change.

Re: Increase shields on space-ships

Posted: Mon Aug 16, 2010 10:06 pm
by linksith
Ok, it took me a while but I found that it will increase the shields on both ships. Is there a way to only modify one of those ships?

Re: Increase shields on space-ships

Posted: Mon Aug 16, 2010 10:28 pm
by PilotX
If both ships use the same odf, then you need to make a new odf without the shield and use that as the second ship.

Re: Increase shields on space-ships

Posted: Tue Aug 17, 2010 12:29 pm
by linksith
They're different files. I'm Trying to replace the Federation cruiser with a droid control ship (AKA droid battleship). I looked in it's odf file but there was (of course) no shield properties. So I looked in the Linked shields LUA like sim said. but I figured out that that would change both shield properties. And yes, I told my LUA to shield the battleship as well.

Re: Increase shields on space-ships

Posted: Wed Aug 18, 2010 4:33 am
by MercuryNoodles
You can't just add the new ship to the template copy of the linkedShieldObjects*** part of the mission lua without it treating it as part of the same overall object. You'll need to make a renamed copy of that part of the function and add the other ship separately. They're separated by teams, yes, but that's because stock maps use one cruiser. The names are local, so it shouldn't be a problem to add another block of code similar to the others within the SetupShields function. That will also mean changing the controllerObject name, as that's the name of the shield internal system within ZE.

Re: Increase shields on space-ships

Posted: Mon Aug 23, 2010 3:18 pm
by linksith
Ok, I guess what I'm really asking is how can I make shields more powerful for one ship, and on the same team for a second ship have the shields at default. Also for the second ship I would like a separate shield generator.

Re: Increase shields on space-ships

Posted: Mon Aug 23, 2010 3:53 pm
by MercuryNoodles
I'm pretty sure the max hp for a shield (or anything else, really) is 999,999. The easiest thing you could do is change the sheildscale so that weapons do less damage to shields, thus giving the illusion of a ship with a more powerful shield, while lowering the shield value of the stock ships so that the normal gameplay is relatively unchanged.

As for the separate shields, that's what my above post was all about. Basically, you'll have to copy and rename that aforementioned piece of the SetupShields function so your new ship geometry is treated as separate from the other ships.

Lemme see if I can make a quick example without screwing up..

Code: Select all

    local linkedShieldObjectsExecutor = { "imp_ship_1", "imp_ship_2", "imp_ship_3", "imp_ship_4", "imp_ship_5", "imp_ship_6",
    							"imp-bridge", "imp-comms", "imp-life-ext", "imp-sensors",
    							"imp_drive_1", "imp_drive_2", "imp_drive_3", "imp_tur1", "imp_tur2", "imp_tur3", "imp_tur4", "imp_cap_stardestroyer_shield1", "imp_bulb"}
    shieldStuffIMP2 = LinkedShields:New{objs = linkedShieldObjectsExecutor, controllerObject = "imp-shield"}    
    shieldStuffIMP2:Init()
linkedShieldObjectsExecutor can really be any name, but it appears twice, and must be exactly the same in each instance. Same goes for shieldStuffIMP2. You can throw in the VO and text functions for the shield status, so long as they reference the name used at the start of the last two lines of this block of code, which is shieldStuffIMP2 in this case. The various ZE names referring to the ship's geometry should obviously be changed to those of the new ship's geometry. (Those listed are the only objects protected by the shield.) The name after controllerobject (imp-shield) on the second to last line is the name of your shield internal system as given in ZE, which should be changed to something else, like the name of the new ship's internal shield generator, which can actually be a second instance of the stock shield generator object.

Hopefully that's a little more clear.

*mumbles something about the Hobbits*

Re: Increase shields on space-ships

Posted: Tue Aug 24, 2010 12:05 pm
by linksith
So does that mean that I cannot make the shields on one ship more powerful than the other shields?

Re: Increase shields on space-ships

Posted: Tue Aug 24, 2010 12:50 pm
by MercuryNoodles
I told you how to make that work in the previous post. Shields are already maxed out in the stock game, so you have to scale down the damage done to them by all applicable weapons, and lower the shields of the less shielded ships (the stock cruisers) accordingly. That preserves the relationship between the weapons and shielding you normally see. Then, you can have the better shielded ship maxed out at 999999 (or whatever value up to that number), which will make it appear to have better shielding ingame.

It's a limitation of the engine that we can't simply raise the shield value to one million or more, so you must work within the means you're given to get the desired result. I can't really get more specific, because I simply don't know exactly what you want. Depending on how powerful the shielding of the new ship is, it's going to change the numbers for everything else you have to edit to make it work. Throwing in a ship with double the shielding of, say, the ISD, would mean halving damage against shields as well as halving the ISD shield value. However, if you want the shields four times as strong, then you'd have to quarter damage to shields, and quarter the ISD shields.

Am I making sense, yet? :lol:

Re: Increase shields on space-ships

Posted: Tue Aug 24, 2010 7:02 pm
by linksith
So how do I lower shields on other ships to give the effect of a more powerful shield? I have added pictures to show what I'm doing.

Hidden/Spoiler:
Image
Image
Currently I'm still working on the model. I've also been unable to walk up and down the stairs from the CIS hangar that I moded. Also, I could only use two of the many turrets that I could get into from the inside of the ship. I'm not sure how long I will be working on this map but I also plan to put in a few other cruisers for each team. Hopefully my situation is made more clear.

Re: Increase shields on space-ships

Posted: Wed Aug 25, 2010 4:53 am
by MercuryNoodles
If you want to change the shield's hp, you have to alter the MaxShield value in the odfs for that ship. If that parameter is not there, it shouldn't have a shield, but you could add the line in, so long as the odf is of the proper classlabel.

Also note that I'm not even touching the shield regeneration, but that shouldn't really require explanation.

Re: Increase shields on space-ships

Posted: Thu Aug 26, 2010 9:17 am
by linksith
I can't find any odfs with a maxshield line in it. I've also tried to look in stock space ships but I couldn't find anything. I've also found that the republic and federation cruisers are in four parts (that does not include the bridge, sensors, life support, etc.). So if a shield protects all of the items mentioned in the LUA, then where is the shield information stored? :?

Re: Increase shields on space-ships

Posted: Thu Aug 26, 2010 11:40 am
by DarthD.U.C.K.
the shieldinformation is stored in the LinkedShields.lua, if you want to have a custom shield you have to edit it, but dont ask me how it must look like, or maybe you can use the maxshield command for the indivisual shields in spacelua, i dunno

Re: Increase shields on space-ships

Posted: Thu Aug 26, 2010 1:12 pm
by MercuryNoodles
Ok, it appears I made a major mistake here. (I was looking at MaxHealth in the odfs. Oh bother.) The maxshield and addshield parameters are in the LinkedShields lua (maxShield = 200000), but they're also odf parameters. That nullifies the whole need to change weapon damage against shields, unless you're going for shielding that's more than 5 times the shield capacity of the stock game. Since they're set in that lua, that changes things. You could try setting the parameters within the odfs of the new ship to see if they override the values given in the LinkedShields script, though I somehow doubt it'll be as easy as that.

Re: Increase shields on space-ships

Posted: Thu Aug 26, 2010 1:34 pm
by DarthD.U.C.K.
but in this case the odflines have nothing to do with lua, the luashield is a single shield shielding a list of objects until a certain object is destroyed, the odfshield is a shield on a single object

Re: Increase shields on space-ships

Posted: Thu Aug 26, 2010 1:41 pm
by MercuryNoodles
You're right. I keep forgetting that he wants an internal system included. In that case, it's going to require some brand new scripting, I think, but I'm having trouble working through how to get the higher shield capacity for the battleship.