Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: How can I see the value of StateRoom from a entity script in the scene?  (Read 2457 times)

0 Members and 1 Guest are viewing this topic.

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile

Hi, I have an entity region in the scene with a script. I want that if is the first time that player enters at scene and look at this entity something happens, but if it isn't the first time that player enters in scene the action when look the entity will be different.

How can I see the value of StateRoom of that scene from the entity script?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site

We already solved this in IRC, but for the record: the StateXXX variables are declared as global, so they can be accessed from any script providing you declare them in that script too.

Code: WME Script
  1. global StateRoom;
  2.  
  3. // now I can access the global variable's contents
  4. if(StateRoom.Visited) SomeCodeHere();
  5.  
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.038 seconds with 19 queries.