I added a model in WED named somemodel_mdl_001. I have an event function that is called on EVENT_IMPACT. In my event function, how can I find the name of the model (i.e., somemodel_mdl_001)? (I know that "me" points to the entity, but I want access to the name used in WED. Something like me.name?)
Thanks!
Steve
Re: How do I get a model's name in C-Lite
[Re: SteveA]
#153596 09/12/0703:3109/12/0703:31
I handle the impact event like this. It does get called when another model runs into it. However, when I try to access string1 (I really want it from "me", the model being hit), string1 is always null. I also tried to access you.string1 (just for the heck of it), and it is also null. The "behaviour" page for both models has "String 1" set to a recognizeable value.
I've been having the same problem with ent_for_name. Perhaps it's a bug? If anyone figures it out could you post your code and results here? Thanks in advance...
Just Because Your Paranoid Doesn't Mean They Aren't After You...Because They Really Are
It appears to be a bug. If I only set "String 1" in WED (and leave "String 2" empty), entity.string1 is always NULL when accessed from SED. However, if I set "String 2" to any non-blank value in WED, I can then access entity.string1 from WED.
Steve
Re: How do I get a model's name in C-Lite
[Re: SteveA]
#153601 09/12/0719:2809/12/0719:28
Well, I'm a noob too, so I can only give the instructions as I understand them:
1. Insert a model in WED (Object | Add Model). 2. Double-click on the model in the Level list (on the left of the screen). 3. Select the "behaviour" tab (lower left of screen). 4. Specify a string for "String 1" 5. Specify a string for "String 2". This is needed (in my experience) or you can't access "String 1".
Then when you have access to that entity, you can retrieve "String 1" like this:
str_cpy(sEntityName, me.string1);
Again, if I don't set "String 2", then me.string1 will always be null.