Author Topic: Get stored data on oObject?  (Read 360 times)

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Get stored data on oObject?
« on: June 01, 2012, 07:38:46 am »


                How can I get the stored data on an object?

I have a device brilliantly named 'device1' and tagged the same. I'm trying to get the 0 or 1 from data stored on the object. The script stops on the second line here with an "Error parsing variable list".  I've googled and searched the Lexicon, so what am I doing wrong?



object oDevice1 = GetObjectByTag("device1");int GetLocalInt(oDevice1, "ACTIVATED_STATE");



((also, I am assuming that this only checks for tags of the same name within the area and not get a random variable from another 'device1' five areas away. Is that something I need to worry about?))
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Get stored data on oObject?
« Reply #1 on: June 01, 2012, 08:31:16 am »


               object oDevice1 = GetObjectByTag("device1");
int something = GetLocalInt(oDevice1, "ACTIVATED_STATE");
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Get stored data on oObject?
« Reply #2 on: June 01, 2012, 01:09:00 pm »


               

Buddywarrior wrote...

((also, I am assuming that this only checks for tags of the same name within the area and not get a random variable from another 'device1' five areas away. Is that something I need to worry about?))



Assumtion wrong,  It will get the object from somewhere in the module. 
               
               

               
            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Get stored data on oObject?
« Reply #3 on: June 01, 2012, 02:57:38 pm »


               

ShaDoOoW wrote...

object oDevice1 = GetObjectByTag("device1");
int something = GetLocalInt(oDevice1, "ACTIVATED_STATE");


Ha! Thanks 
ShaDoOoW...I knew I should have waited till morning. 
               
               

               
            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Get stored data on oObject?
« Reply #4 on: June 01, 2012, 03:00:39 pm »


               

Lightfoot8 wrote...

Assumtion wrong,  It will get the object from somewhere in the module. 


This is for teleporting devices arcoss the module, what should I use to narrow the search to only the are the object is in?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Get stored data on oObject?
« Reply #5 on: June 01, 2012, 03:11:25 pm »


               You can use GetNearestObjectByTag.  

What Event are you running the script from?   Is it running on the Device?
               
               

               
            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Get stored data on oObject?
« Reply #6 on: June 01, 2012, 06:23:51 pm »


               it's called from a conversation.

edit: the event that is setting the 0 or 1 on the device itself is called from the OnUsed event. In case that's what you're asking.
               
               

               


                     Modifié par Buddywarrior, 01 juin 2012 - 05:27 .