Invalid component property: rangedattack.pierce

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Invalid component property: rangedattack.pierce

Post 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)?
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: Invalid component property: rangedattack.pierce

Post 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.
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Re: Invalid component property: rangedattack.pierce

Post 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?
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Invalid component property: rangedattack.pierce

Post 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.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Re: Invalid component property: rangedattack.pierce

Post by David Ward »

How does "FirearmAttackComponent:setPierce(number)" work then? I just saw it on the scripting reference page, was all.
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Invalid component property: rangedattack.pierce

Post 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.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Re: Invalid component property: rangedattack.pierce

Post 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?
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Invalid component property: rangedattack.pierce

Post 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.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Re: Invalid component property: rangedattack.pierce

Post 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"?
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Invalid component property: rangedattack.pierce

Post by minmay »

I assume it wasn't needed for the main game and didn't have enough apparent modding potential to be worth adding.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply