Go down


Post  DM Ramen on Sat Dec 13, 2008 1:26 pm


Question: "In a few single player mods I have seen doorways were you had to have a token to walk through it, usually the doorway would have a lightning effect on it and if you didnt have the proper item it would shock you and prevent passage, if you had the proper item you walked through as if it as a normal doorway. Have any of you seen this and if so do you know how to do it?"


Galruthe wrote:
[1:39:29 PM] R.K. says: put down a trigger in the doorway and make an on enter event script for the triger, have it do whatever you want, teleport the pc back a few steps, shoot lightening whatever
[2:05:50 PM] R.K. says: something like this as a sample, when they enter check the token, if they dont have it, paralyze them, teleport them back a step or so, and zap them with lightening
[2:05:54 PM] R.K. says:

int nInt;
location lTarget;
effect eEffect;
object oTarget;

void main()

object oPC = GetEnteringObject();

if (!GetIsPC(oPC)) return;

if (GetItemPossessedBy(oPC, "insert tag of required token to pass here")== OBJECT_INVALID)
  oTarget = oPC;

  eEffect = EffectCutsceneParalyze();

  ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 10.0f);

  oTarget = GetWaypointByTag("insert tag of waypoint to teleport pc back to here");

  lTarget = GetLocation(oTarget);

  if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;

  AssignCommand(oPC, ClearAllActions());

  AssignCommand(oPC, ActionJumpToLocation(lTarget));

  oTarget = oPC;

  nInt = GetObjectType(oTarget);

  if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_M), oTarget);
  else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_LIGHTNING_M), GetLocation(oTarget));

DM Ramen

Male Number of posts : 354
Registration date : 2008-12-04

View user profile

Back to top Go down

Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum