Aller au contenu

Photo

Teleport/Blink type script


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

#1
Tyes

Tyes
  • Members
  • 9 messages
Hey everyone.
Looking for any potential assistance with my latest toolset dilemma.
I have been building a module for a few people, that has been requested by them, and one of the most commonly used scripts needed by players seems to be misfiring.
I'm no scripter myself, and I can't even remember how I had the original script set up, but any help would be appreciated.
The script is meant to be a blink/teleportation type script, and by using the item it is activated from, it will send the user to that spot, much like the dm quick jump. The issue I was having before was that it only ran on the last instance of the item spawned, and none of the others. I would like it to run from each item without an issue. I believe it's possible... I just have no idea how to do it myself.

Here is the script as it currently is, being run from the module onactivateitem event script.

object oStone = GetObjectByTag(br_blink);
object oActivated = GetItemActivated();
object oUser = OBJECT_SELF;

if (oActivated == oStone)
{
vector vVector = GetPosition(oUser);
float fZ = GetFacing(oUser);
location lLocat = GetItemActivatedTargetLocation();
vector vVectorb = GetPositionFromLocation(lLocat);
object oArea = GetArea(oUser);
location lBlink = Location(oArea, vVectorb, fZ);
effect eVis = EffectVisualEffect(VFX_IMP_PULSE_HOLY);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oUser);
AssignCommand(oUser, JumpToLocation(lBlink));
}

#2
Invisig0th

Invisig0th
  • Members
  • 170 messages
Remove the first line (object oStone = ....) and change this:

if (oActivated == oStone)

To this:

if (GetTag(oActivated) == "br_blink")

GetObjectByTag() isn't useful here. In cases where there are multiple objects with that same tag, it just grabs the first one it finds -- which often is not the one you wanted.

Hope this helps!

Modifié par Invisig0th, 14 septembre 2010 - 03:34 .


#3
Tyes

Tyes
  • Members
  • 9 messages
Thanks, that was just the ticket, works like a charm now. :)