Page 1 of 1

Curious question on weapon

Posted: 31 Mar 2011, 10:21
by Von66341
hey!

From my understanding for a weapon to work we need the following:

unitdef .fbi, .lua (declare which weapon is equiped)
weapondef .tdf (declare weapon properties)
scripts .cob/.bos (contains how the weapon is aim or fired)

For example, I have unit A, which fires weapon 1, 2 and 3.
And unit B which has weapon 4, 5 and 6.

If I want weapon 4 to be equip on unit A without making changes to the scripts will it be possible?

I tried doing a small scale testing and found out that if the weapons come of the same category of unit it will work. but if we for e.g. place a ship weapon to a tank it will never be possible to fire.

Is this true? Anyone have experiences with the weapon to share?

Re: Curious question on weapon

Posted: 31 Mar 2011, 17:34
by Forboding Angel
Shared weapons are used all the time. Generally in death explosions. As an example, evo units share death explosions by category (size, role etc).

All you do is define the weapon tdf or lua and put it in the weapons folder. That weapon will then be accessible by name to all units.

Re: Curious question on weapon

Posted: 31 Mar 2011, 18:29
by Von66341
Would we need to have specific scripts writen in the unit scripts(.bos/.cob) before the weapon can be run?

Re: Curious question on weapon

Posted: 01 Apr 2011, 06:39
by Forboding Angel
no.

Re: Curious question on weapon

Posted: 01 Apr 2011, 06:57
by knorke
I tried doing a small scale testing and found out that if the weapons come of the same category of unit it will work. but if we for e.g. place a ship weapon to a tank it will never be possible to fire.
i guess that might be true for some weapons. I can imagine that ground units probally can not drop aircraft bombs or shot torpedos (unless in water, see xta amphi tanks)
But I see no reason why lets say a missile weapon would not work on ground, sea, air, building? Are you sure it is the weapondef and not something in model or script ie different aim+fire points?

Re: Curious question on weapon

Posted: 07 Apr 2011, 05:23
by Von66341
Yup, i did some more further testing.

Things like missle/rockets works fine for inter element units.

Hmm..i guess we need to know a knowledge of which weapon works for which units before we could do an interchange?

Thanks!