TOKEN DOORWAYS
Page 1 of 1
TOKEN DOORWAYS
TOKEN DOORWAYS
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?"
Answer:
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?"
Answer:
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:
- Code:
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));
}
}
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|