objFireEvent able to pass arguments ?

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Mutos
Militia Lieutenant
Militia Lieutenant
Posts: 218
Joined: Thu Aug 14, 2008 3:31 am
Location: Near Paris, France
Contact:

Hi all,


I was thinking about objFireEvent for replacing an event that isn't builtin but would have been useful to me : OnObjAttacked on the same template as OnObjDestroyed.

A shortfall of this function is that it dosen't seem to allow arguments to be passed to the event. Would someone have an hint about getting around that ?
@+

Benoît 'Mutos' ROBIN
Hoshikaze 2250 Project
F50
Fleet Officer
Fleet Officer
Posts: 1004
Joined: Sat Mar 11, 2006 5:25 pm

easy,

(objSetData gSource "name" vartopass)

and then

(setq vartorecieve (objGetData gSource "name"))

Depending on what you intend to "pass" you may need to objSetObjRefData, or if you need to save a list of references, then I can give you a function for that as well.

This assumes the event is located on gSource.
User avatar
Mutos
Militia Lieutenant
Militia Lieutenant
Posts: 218
Joined: Thu Aug 14, 2008 3:31 am
Location: Near Paris, France
Contact:

Hi F50, hi all,


Indeed, why didn't I think of this ^-^ Thanks !!!
@+

Benoît 'Mutos' ROBIN
Hoshikaze 2250 Project
Post Reply