Jump to content

Recommended Posts

Posted

Two ways to do that:

One method would be my earlier example of moving the script to the player and listening for when they pick up the object the first time.

 

The other method would be to add a global variable property with a comparison check to the script that goes on the object. By using a global variable and changing the value you can cause future instances of the object to skip processing even if the script is on the base object.

 

Since the one already has an example posted earlier, I'll just add an example of the second one. Adapting maxarturo's example:

 

  Reveal hidden contents

 

FYI - I should have thought of adding the global variable the first time around. Oh well, we all have our off days.

Posted
As IsharaMeradin already said, posted before i could.



By "locally" i mean into the object's Reference menu (in the script tab - add script - make NEW Script) to the object selected in the Render window (add the script to only ONE object). That means "Do NOT edit Base".

Here is a simpliest version of the same script that will fire only ONCE uppon picking up the object then will go to a state that will do nothing :

  Reveal hidden contents




"so wherever an instance of it is found in the world, player gets the message and knows what to do with it ONCE."


If you want the message to appear every time the player finds and picks up the item, then (assuming you have made your own object and you are not using a default vanilla object) edit BASE and place the script there, now it will fire every time you find the particular object



Posted

Thank you both for your help. Got it working now. Believe it or not I used to know all of this 4-5 years ago. I can compare it to taking night classes to learn German - I spoke decent basic German but after a while of not having anybody to speak German with - I forgot 90%+ of it. it is coming back to me as I see more scripts.

@IsharaMeradin In two of the scripts you wrote for me you have a typo error on the same line...

 

  Reveal hidden contents

 

 

Not to worry, it was pointed out to me.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...