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?
Curious question on weapon
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Curious question on weapon
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.
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
Would we need to have specific scripts writen in the unit scripts(.bos/.cob) before the weapon can be run?
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Curious question on weapon
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)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.
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
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!
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!