How to reference an actor created by another actor...

Game Editor comments and discussion.

How to reference an actor created by another actor...

Postby yttermayn » Mon Jan 21, 2008 8:14 pm

The situation is this: I have a MOB that moves around and I want to display some status information that floats over it. The MOB is created by script, and when that MOB is created, it creates a text actor (in its create actor event) with the event actor as the parent,so that it will follow the MOB. Trouble is, if I just reference the text actor in the script that updates the value it displays, then only the original actor that sits off to the side of the game, not visible, gets updated. How do I reference the one that was created by the MOB?
yttermayn
 
Posts: 48
Joined: Sun Nov 25, 2007 4:10 pm
Score: 2 Give a positive score

Re: How to reference an actor created by another actor...

Postby Thanx » Sun Feb 03, 2008 8:22 am

Type in the code where you update that
floatingtext.text = someinfo.text;
Or if it's numbers then use the textNumber, if it is more than one info, then add them up into a string. (as if you were adding numbers, with the + operator.)
That should do the trick. Though I'm not exactly sure wether I understood you the right way.
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron