OnFireWeapon

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

Ticket 21 on the tracker relating to running script when a weapon is fired has been fixed. 8)

http://wiki.neurohack.com/transcendence/trac/ticket/21

Couple of questions for George.

How are configurations handled? (does each shot get its own event call?)
Does it return something or is there some way of stopping the default shot? (in case you want to fire a different shot)
Do you have access to the default shot to put data on it?

This is a great tool for modders.

Thank you George :D
Crying is not a proper retort!
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

just out of curiosity... :roll:
George, is the event onFireWeapon for spaceobj or for itemtypes ?

we can start thinking about how to use it at best if we know :D
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Betelgeuse wrote:Ticket 21 on the tracker relating to running script when a weapon is fired has been fixed. 8)

http://wiki.neurohack.com/transcendence/trac/ticket/21

Couple of questions for George.

How are configurations handled? (does each shot get its own event call?)
Does it return something or is there some way of stopping the default shot? (in case you want to fire a different shot)
Do you have access to the default shot to put data on it?

This is a great tool for modders.

Thank you George :D
A couple of answers:

1. Configurations are honored: each shot get its own call (with potentially a different aFireAngle).
2. The OnFireWeapon call is responsible for creating its own shot, using (sysCreateWeaponFire). You can use the return from that function to access the shot.

Glad you like it!
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

digdug wrote:just out of curiosity... :roll:
George, is the event onFireWeapon for spaceobj or for itemtypes ?

we can start thinking about how to use it at best if we know :D
This is only on <ItemTypes> for now. It is used to create custom weapons.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

This is only on <ItemTypes> for now. It is used to create custom weapons.
Yay! thank you thank you thank you, this is a very nice Xmas present :D
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

do configurations always go in order? (ie is there a way to interrupt them?)
The reason I ask is because I would like to be able to tell what shot I am on.

An example of where that would be needed is a weapon that fired three times forward in an alternating configuration. If those three shots where different you would need to know what shot you where on to properly shoot out the correct shot.
Crying is not a proper retort!
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Betelgeuse wrote:do configurations always go in order? (ie is there a way to interrupt them?)
The reason I ask is because I would like to be able to tell what shot I am on.

An example of where that would be needed is a weapon that fired three times forward in an alternating configuration. If those three shots where different you would need to know what shot you where on to properly shoot out the correct shot.
In that case, just go manual. Use a single-shot configuration and keep track of how many shots you've fired (in the gSource object). Each time through <OnFireWeapon> you can select a different shot to fire.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

what kind of overhead will OnFireWeapon have?

Will we be able to realistically make a weapon with a low fireRate so we could have variable fireRate in game?
Crying is not a proper retort!
User avatar
Arisaya
Fleet Admiral
Fleet Admiral
Posts: 5535
Joined: Tue Feb 05, 2008 1:10 am
Location: At the VSS Shipyards in the frontier, designing new ships.

onFire!?!?!? :D
YES!!!!!!!!! Thanks george!!!
I think that is all that is necessary to say. :D
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

Excellent.My nefarious plot can get back on schedule.
Post Reply