Author Topic: Tag based scripting  (Read 316 times)

Legacy_Leurnid

  • Sr. Member
  • ****
  • Posts: 473
  • Karma: +0/-0
Tag based scripting
« on: April 24, 2012, 01:47:42 am »


               Can tag based scripting be used for non-inventory things, like doors and chairs?
               
               

               
            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Tag based scripting
« Reply #1 on: April 24, 2012, 02:07:50 am »


               Yes.  You can have a generic script, say onopened for doors, and have checks for specific tags within that script.

sDoorTag = GetTag(OBJECT_SELF);
if (sDoorTag == "door0001a")
{
DoSomethingHere();
}
else if (sDoorTag == "door0001b")
{
DoSomethingElseHere();
}
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Tag based scripting
« Reply #2 on: April 24, 2012, 03:06:54 am »


               The basic idea behind tag based scripting is that there is a built in activation script that the generic "use" item properties execute, and this is basically a framework that leads to the tag based script.

So if you wanted to have a tag based approach to other events on placeables etc... you'd need to set up a framework yourself, and then add the first script to every resource that you want to follow it. Because the ultimate result of a tag based script is to have a statement to the extent of:

ExecuteScript(STANDARD_PREFIX+GetTag(OBJECT_SELF));