PDA

View Full Version : [question] adding shields


FoŽSaken
11th Feb 08, 9:11 AM
I am currently working on a small keeper mod, and I thought that the Keepers should have some kind of platform defense, just like the other races.

Now for my question:
How do I add shields to ships / platforms?

I want to use a regular Hig Ion Turret as a base, since I do not use any custom model, so no need to worry about that. I have found some code lines regarding the shields of the defensefield frigate in the hgn_defensefieldfrigate.ship file, but I do not know which lines I should use for other ships / platforms and where in the file I should add them.

Can someone please help me? :confused:

ford6
11th Feb 08, 11:54 AM
to give a ship or turret sheilds use this line.
addShield(NewShipType,"EMP",1000,20)

I put it after the LoadModel line and before the weapons.

the other lines in the defense feild frig are the ones used to project a sheild in the area around the frig for other ships, but that leaves the projecting ship exposed.

exp: the bantusi core fragment mission, the D feild frigs are slowly killed by the radiation, even though the feild is up and protecting the movers.

FoŽSaken
11th Feb 08, 12:28 PM
So that is what those lines are for. Can you tell me which of those numbers you have to change to increase or decrease the shield size and the time it lasts?

b3h47pte
11th Feb 08, 12:31 PM
http://hw2wiki.net/wiki.hw2.info/FunctionaddShield.html

I have a question though, is it possible to make some weapons do less damage against teh shields?

FoŽSaken
11th Feb 08, 1:57 PM
Big thanks to the both of you. But I have one more question. I have read somewhere that you can make a shield to follow the shape of a ship instead of being orb shaped. Is that really possible? Also, can you change the color of a shield? I have thought about how to do that, and the only way I can think of on how to do it, is by creating a new shield type. However, I can not seem to find the file that takes care of the shield stuff.

b3h47pte
11th Feb 08, 2:04 PM
I think it's possible if you HOD it like you have 2 objects...one shield object that will be the same shape of the ship but slightly bigger, while the real ship will be underneath that shield and will only be hit when the shield is down. Possibly ;]

FoŽSaken
11th Feb 08, 2:15 PM
That sounds like a pretty difficult thing to do, especially for a beginner like me. But about the damage question of your previous post: the damage stuff should be in the file where the shield is coded in. But as I have said before, the location of that file is unknown to me.

FoŽSaken
12th Feb 08, 10:11 AM
*friendly bump*

No one knows a solution?

Quaetam
12th Feb 08, 7:36 PM
Well the HOD method isn't that hard; once you have one model just add it as a damageable subsystem with the same coordinates as the original ship and make it a little larger. Just be sure to place all weapons outside the shield so the ship doesn't shoot itself!

xxobot
12th Feb 08, 11:05 PM
The only problem I can say with the hod method is that if you have the subsystem destroyable you have to rebuild it manually, and repairable means that it always gets the damage (correct me if i'm wrong please) also, you end up with a selection problem because if you try to select the ship you simply get the subsystem, great (and indigenous) idea though

and what if you have the shield generator a subsystem and have two of them? shouldn't they cover each other?

FoŽSaken
13th Feb 08, 4:03 AM
I guess that should be possible. I will try that later. By the way, the new fx mod has an ability for the keeper that makes it invincible for a short amount of time, during that animation, the keeper sort of glows. It looks like a shield, so it should be possible.

MrSlinks
13th Feb 08, 2:39 PM
It's actually quite easy to have some weapons penetrating a shield / others not.
Shield penetration is set within the weapon file, so you can develop weapons with a high penetration, and others with little/none. Likewise - the projected shield can be focused around a smaller area as is defined on the shield line in the ship file. In BSG mod - we have a shield area equivilent to the ships CM area - meaning that it is just tight to the model.