Curious question on weapon

Curious question on weapon

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
Von66341
Posts: 111
Joined: 10 Feb 2011, 03:00

Curious question on weapon

Post 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?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Curious question on weapon

Post 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.
Von66341
Posts: 111
Joined: 10 Feb 2011, 03:00

Re: Curious question on weapon

Post by Von66341 »

Would we need to have specific scripts writen in the unit scripts(.bos/.cob) before the weapon can be run?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Curious question on weapon

Post by Forboding Angel »

no.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Curious question on weapon

Post 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?
Von66341
Posts: 111
Joined: 10 Feb 2011, 03:00

Re: Curious question on weapon

Post 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!
Post Reply

Return to “Game Development”