Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: entities and variables  (Read 2873 times)

0 Members and 1 Guest are viewing this topic.

fireside

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 211
    • View Profile
entities and variables
« on: March 27, 2007, 11:28:35 PM »

I'm going to have multiple entities in a scene that are really the same entity like:
global ent1 = Scene.LoadEntity("entities\lift\thing.entity");
global ent2 = Scene.LoadEntity("entities\lift\thing.entity");

In the script, is there a way to find out which variable compares to the entity like:

if (this == ent1)
{ do something;}

edit:  Hmm.  I think it might just be simpler to use separate scene entities.  The logic is kind of complicated.
« Last Edit: March 28, 2007, 02:36:55 AM by fireside »
Logged

sharkbait

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 13
    • View Profile
Re: entities and variables
« Reply #1 on: March 28, 2007, 11:21:50 AM »

I stand to be corrected, but I think you should be able to do such a comparison because the object variables are really references, so you could have two or more variables pointing to the same object, and you can compare any two (or use the 'this' reference) to compare whether they are the same object instance.
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: entities and variables
« Reply #2 on: March 28, 2007, 01:26:07 PM »

You could use different entities pointing to the same graphic files. It's cleaner and it doesn't make the project any bigger.
Logged
fl*p

fireside

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 211
    • View Profile
Re: entities and variables
« Reply #3 on: March 28, 2007, 05:35:23 PM »

Quote
You could use different entities pointing to the same graphic files. It's cleaner and it doesn't make the project any bigger.

Yeah, I'm going to do that with scene entities.  I can always check the name that way, even if I use the same script.
Logged
 

Page created in 0.035 seconds with 21 queries.