weapon script questions

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

In onDamageArmor is aArmorSeg an item struct or the number of the armor segment?
Does sysCreateWeaponFire take a missile in the weapon UNID?

Does sysCreateWeaponFire return the shot if the weapons onFireWeapon return a nil? (assuming RC5)
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

bonus question
When sysFireWeapon fires a weapon that has onFireWeapon does it return what onFireWeapon returns (if not nil) and if not would that be reasonable to ask for in a ticket?
Crying is not a proper retort!
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Betelgeuse wrote:In onDamageArmor is aArmorSeg an item struct or the number of the armor segment?
Does sysCreateWeaponFire take a missile in the weapon UNID?

Does sysCreateWeaponFire return the shot if the weapons onFireWeapon return a nil? (assuming RC5)
aArmorSeg is the number of the armor segment.

sysCreateWeaponFire, unfortunately, does not take a missile as an UNID--but it sounds like a good (and relatively easy) feature request (though probably not for 1.0, since that's almost done).

Unfortunately, sysCreateWeaponFire does not call OnFireWeapon. sysCreateWeaponFire is supposed to be called from OnFireWeapon.
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Betelgeuse wrote:bonus question
When sysFireWeapon fires a weapon that has onFireWeapon does it return what onFireWeapon returns (if not nil) and if not would that be reasonable to ask for in a ticket?
Just out of curiosity, why do you need sysCreateWeaponFire to call OnFireWeapon? If you are running script, then you can do everything you want. Why rely on code inside OnFireWeapon?
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

the reason I asked is because I didn't know one way or the other. But it isn't a problem as we can call objFireItemEvent. (assuming you can call onFireWeapon with that)

Other than the missile thing these questions where more asking how you implemented it so I can work with that as I thought of ways of doing them in ether case (that is did or did not call the event).

Just to be clear when using sysCreateWeaponFire on a weapon with onFireWeapon it fires it normally ignoring onFireWeapon?

edit: just to answer your question I want to have all weapons have onFireWeapon and I want to avoid doubling the amount of weapons.
Crying is not a proper retort!
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Betelgeuse wrote:the reason I asked is because I didn't know one way or the other. But it isn't a problem as we can call objFireItemEvent. (assuming you can call onFireWeapon with that)

Other than the missile thing these questions where more asking how you implemented it so I can work with that as I thought of ways of doing them in ether case (that is did or did not call the event).

Just to be clear when using sysCreateWeaponFire on a weapon with onFireWeapon it fires it normally ignoring onFireWeapon?

edit: just to answer your question I want to have all weapons have onFireWeapon and I want to avoid doubling the amount of weapons.
Yes, sysCreateWeaponFire just creates the shot used by the given weapon (note, for example, that it doesn't honor dual shot weapons--because you can do that yourself).

So sysCreateWeaponFire does not call OnFireWeapon. And you're right, you can just use objFireItemEvent to call OnFireWeapon if you want to do that.
Post Reply