Page 1 of 1

Invalid component property: rangedattack.pierce

Posted: Tue Mar 17, 2015 7:48 am
by David Ward
The following code works:

Code: Select all

			class = "RangedAttack",
			attackPower = 16,
			pierce = 10,
			accuracy = 10,
			cooldown = 7,
			attackSound = "swipe_bow",
			ammo = "arrow",
...except that the "pierce = 10" component shows up as an invalid component property when the game starts.

Is there a way to have a RangedAttack have a "pierce" component, or is there something I'm missing here with the use of ammo (i.e. the arrow is what needs to have the pierce component, not say the bow that has the RangedAttack class)?

Re: Invalid component property: rangedattack.pierce

Posted: Tue Mar 17, 2015 8:27 am
by Dr.Disaster
David Ward wrote:Is there a way to have a RangedAttack have a "pierce" component, or is there something I'm missing here with the use of ammo (i.e. the arrow is what needs to have the pierce component, not say the bow that has the RangedAttack class)?
I think you are on the right track. Looking at ItemActionComponent it seems the "pierce" component needs to be on the ammo.

Re: Invalid component property: rangedattack.pierce

Posted: Mon Mar 23, 2015 7:55 pm
by David Ward
Hey Dr. Disaster. Maybe you can help me with this, please.

In FirearmAttackComponent, there is a FirearmAttackComponent:setPierce(number), but I'm not sure how to implement that for a ranged weapon...not for a firearm, but for a bow.

We were on track to put pierce in the ammo's definition, but I couldn't figure out how to do that either. For example, this did not work:

Code: Select all

		{
			class = "AmmoItem",
			ammoType = "arrow",
			Pierce = 30,
		},
How can FirearmAttackComponent:setPierce(number) be implemented?

Re: Invalid component property: rangedattack.pierce

Posted: Mon Mar 23, 2015 8:37 pm
by minmay
There does not exist a single component with a "Pierce" field. There are some components with a "pierce" field:
FirearmAttackComponent
MeleeAttackComponent
MonsterAttackComponent
MonsterMoveAttackComponent
ThrowAttackComponent

I don't know of any other components with it.

Re: Invalid component property: rangedattack.pierce

Posted: Mon Mar 23, 2015 9:41 pm
by David Ward
How does "FirearmAttackComponent:setPierce(number)" work then? I just saw it on the scripting reference page, was all.

Re: Invalid component property: rangedattack.pierce

Posted: Mon Mar 23, 2015 10:04 pm
by minmay
It works by changing the FirearmComponent's pierce field to the number that you pass to it. There's no way to get pierce on RangedAttackComponent attacks (or anything similar) as far as I know, except with the piercing_arrows character trait which is just a hardcoded 20 pierce.

Re: Invalid component property: rangedattack.pierce

Posted: Tue Mar 24, 2015 1:32 am
by David Ward
That's unfortunate. So....other than using "piercing_arrows" trait, there is no way to set an armor pierce rating for a "Ranged Attack"? Pierce works for "MeleeAttack" only?

Re: Invalid component property: rangedattack.pierce

Posted: Tue Mar 24, 2015 2:06 am
by minmay
For the third time: pierce works for melee attacks, firearm attacks, throwing attacks, monster attacks, and monster move attacks. It does not work for missile attacks.

Re: Invalid component property: rangedattack.pierce

Posted: Tue Mar 24, 2015 4:47 am
by David Ward
Well that's silly. Was there a particular reason why ranged attacks don't allow for that? They allow for "accuracy", but not "pierce"?

Re: Invalid component property: rangedattack.pierce

Posted: Tue Mar 24, 2015 5:55 am
by minmay
I assume it wasn't needed for the main game and didn't have enough apparent modding potential to be worth adding.