Aller au contenu

Photo

Get stored data on oObject?


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
Buddywarrior

Buddywarrior
  • Members
  • 256 messages
 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?))

#2
Shadooow

Shadooow
  • Members
  • 4 474 messages
object oDevice1 = GetObjectByTag("device1");
int something = GetLocalInt(oDevice1, "ACTIVATED_STATE");

#3
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

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. 

#4
Buddywarrior

Buddywarrior
  • Members
  • 256 messages

ShaDoOoW wrote...

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


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

#5
Buddywarrior

Buddywarrior
  • Members
  • 256 messages

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?

#6
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
You can use GetNearestObjectByTag.

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

#7
Buddywarrior

Buddywarrior
  • Members
  • 256 messages
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 .