[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Calling functions in other states
- From: "Tom Miles" <Tom@...>
- Date: Fri, 16 Nov 2007 09:02:10 -0000
>
> > I apologise if this is either a stupid question, or has been asked
> > before, but I was wondering if there was a way that I
> haven't found of
> > calling functions of one state from within a lua script of
> another? I
> > have several states all started with lua_newthread() all of
> which run
> > their own scripts.
>
> I'm probably missing something here, but if all Lua states
> descend from a single parent state (ie, have been created
> with lua_newthread), I see no problem calling functions
> across states. In C, you can simply use lua_xmove to send a
> function from one state to another.
> --lhf
>
Wow. There were some fantastic responses to this question. I'm not sure
that I would want to reverse 2 years of work to implement some of them,
but thanks anyway. I think the xmove answer was the one I want though
(I'm annoyed I didn't find that in the docs), so I'll be trying that
approach first :)
Thanks again,
Tom
----------------------------------------------------------------------------
DISCLAIMER
This email is sent by The Creative Assembly Limited company No. 03425917, registered in England &Wales registered office 27 Great West Road, Middlesex, TW8 9BW, England. The contents of this e-mail and any attachments are confidential to the intended recipient and may also be legally privileged. Unless you are the named addressee (or authorised to receive for the addressee) of this email you may not copy, disclose or distribute it to anyone else. If you have received this email in error, please notify us immediately by e-mail on postmaster@creative-assembly.co.uk and then delete the email and any copies. The Creative Assembly Limited have made all reasonable efforts to ensure that this e-mail and any attached documents or software are free from software viruses, but it is the recipient's responsibility to confirm this.