Aller au contenu

Photo

Tag based scripting


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

#1
Leurnid

Leurnid
  • Members
  • 271 messages
Can tag based scripting be used for non-inventory things, like doors and chairs?

#2
The Amethyst Dragon

The Amethyst Dragon
  • Members
  • 1 882 messages
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();
}

#3
henesua

henesua
  • Members
  • 3 883 messages
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));