Author Topic: Help please.  (Read 477 times)

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Help please.
« on: August 25, 2011, 04:15:50 am »


               Here is my rune plate script where you dial a code and poof. I would like to adjust it so you have to dial the waypoint tag so if tag is 1234 you have to dial 1234 .
right now you can dial these numbers in any order to port.

void main()
{   PlaySound("as_cv_brickscrp1");   
object oPlateEffector = GetNearestObjectByTag("plate_effector"); 
  int iCheck = GetLocalInt(oPlateEffector, "count");   
string sPlate = GetStringRight(GetTag(OBJECT_SELF), 1);   
SetLocalInt(OBJECT_SELF, "on", 1);    SetLocalInt(oPlateEffector, sPlate, 1);   
iCheck++;   
SetLocalInt(oPlateEffector, "count", iCheck);   
AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));   
if (iCheck == 4)     
{  object oPC = GetLastUsedBy();     
  object oPlateEffector = GetNearestObjectByTag("plate_effector");       
string s1 = IntToString(GetLocalInt(oPlateEffector, "1"));       
string s2 = IntToString(GetLocalInt(oPlateEffector, "2"));       
string s3 = IntToString(GetLocalInt(oPlateEffector, "3"));       
string s4 = IntToString(GetLocalInt(oPlateEffector, "4"));       
string s5 = IntToString(GetLocalInt(oPlateEffector, "5"));     
  string s6 = IntToString(GetLocalInt(oPlateEffector, "6"));     
  string s7 = IntToString(GetLocalInt(oPlateEffector, "7"));     
  string s8 = IntToString(GetLocalInt(oPlateEffector, "8"));       
string sWaypoint = s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8;       
 object oWaypoint = GetWaypointByTag(sWaypoint);       
 object oWaypointHere = GetNearestObjectByTag(sWaypoint,oPC,1);     
 if ((oWaypoint == OBJECT_INVALID)         || (GetIsObjectValid(oWaypointHere)))     
  {        if (oWaypoint == OBJECT_INVALID)    FloatingTextStringOnCreature("Warning Invalid Rune Code",oPC);        else if (GetIsObjectValid(oWaypointHere)) FloatingTextStringOnCreature("Warning This Rune Code Destination",oPC);   
object oPlateEffector = GetNearestObjectByTag("plate_effector");   
DelayCommand(0.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), oPC, 0.0));    AssignCommand(GetNearestObjectByTag("RUNEP_1", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));    AssignCommand(GetNearestObjectByTag("RUNEP_2", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));    AssignCommand(GetNearestObjectByTag("RUNEP_3", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));    AssignCommand(GetNearestObjectByTag("RUNEP_4", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));    AssignCommand(GetNearestObjectByTag("RUNEP_5", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));    AssignCommand(GetNearestObjectByTag("RUNEP_6", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));    AssignCommand(GetNearestObjectByTag("RUNEP_7", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));    AssignCommand(GetNearestObjectByTag("RUNEP_8", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));    SetLocalInt(GetNearestObjectByTag("RUNEP_1", oPC), "on", 0);    SetLocalInt(GetNearestObjectByTag("RUNEP_2", oPC), "on", 0);    SetLocalInt(GetNearestObjectByTag("RUNEP_3", oPC), "on", 0);    SetLocalInt(GetNearestObjectByTag("RUNEP_4", oPC), "on", 0);    SetLocalInt(GetNearestObjectByTag("RUNEP_5", oPC), "on", 0);    SetLocalInt(GetNearestObjectByTag("RUNEP_6", oPC), "on", 0);    SetLocalInt(GetNearestObjectByTag("RUNEP_7", oPC), "on", 0);    SetLocalInt(GetNearestObjectByTag("RUNEP_8", oPC), "on", 0);   
SetLocalInt(oPlateEffector, "1", 0);   
SetLocalInt(oPlateEffector, "2", 0);   
SetLocalInt(oPlateEffector, "3", 0);   
SetLocalInt(oPlateEffector, "4", 0);   
SetLocalInt(oPlateEffector, "5", 0);   
SetLocalInt(oPlateEffector, "6", 0);   
SetLocalInt(oPlateEffector, "7", 0);   
SetLocalInt(oPlateEffector, "8", 0);   
SetLocalInt(oPlateEffector, "count", 0);return;}     
  AssignCommand(GetNearestObjectByTag("RUNEP_1", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));        AssignCommand(GetNearestObjectByTag("RUNEP_2", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));        AssignCommand(GetNearestObjectByTag("RUNEP_3", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));        AssignCommand(GetNearestObjectByTag("RUNEP_4", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));        AssignCommand(GetNearestObjectByTag("RUNEP_5", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));        AssignCommand(GetNearestObjectByTag("RUNEP_6", oPC),        ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));        AssignCommand(GetNearestObjectByTag("RUNEP_7", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));        AssignCommand(GetNearestObjectByTag("RUNEP_8", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));        SetLocalInt(GetNearestObjectByTag("RUNEP_1", oPC), "on", 0);        SetLocalInt(GetNearestObjectByTag("RUNEP_2", oPC), "on", 0);        SetLocalInt(GetNearestObjectByTag("RUNEP_3", oPC), "on", 0);        SetLocalInt(GetNearestObjectByTag("RUNEP_4", oPC), "on", 0);        SetLocalInt(GetNearestObjectByTag("RUNEP_5", oPC), "on", 0);        SetLocalInt(GetNearestObjectByTag("RUNEP_6", oPC), "on", 0);        SetLocalInt(GetNearestObjectByTag("RUNEP_7", oPC), "on", 0);        SetLocalInt(GetNearestObjectByTag("RUNEP_8", oPC), "on", 0);     
  SetLocalInt(oPlateEffector, "1", 0);       
SetLocalInt(oPlateEffector, "2", 0);       
SetLocalInt(oPlateEffector, "3", 0);       
SetLocalInt(oPlateEffector, "4", 0);       
SetLocalInt(oPlateEffector, "5", 0);     
  SetLocalInt(oPlateEffector, "6", 0);       
SetLocalInt(oPlateEffector, "7", 0);       
SetLocalInt(oPlateEffector, "8", 0);       
SetLocalInt(oPlateEffector, "count", 0);       
SetCommandable(FALSE, oPC);     
  DelayCommand(4.9, SetCommandable(TRUE, oPC));     
  DelayCommand(5.0, AssignCommand(oPC, JumpToObject(oWaypoint)));       
DelayCommand(0.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE),oPC, 4.0));       
DelayCommand(1.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR_2),oPC, 2.5));       
DelayCommand(4.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1),oPC, 3.5));    }}
               
               

               


                     Modifié par Knight_Shield, 25 août 2011 - 03:59 .
                     
                  


            

Legacy_CID-78

  • Sr. Member
  • ****
  • Posts: 261
  • Karma: +0/-0
Help please.
« Reply #1 on: August 25, 2011, 04:48:16 am »


               don't expect people to read that chunk of script code.
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Help please.
« Reply #2 on: August 25, 2011, 04:54:52 am »


               Yeah not sure why it is posting like that.I tried to clean it up.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Help please.
« Reply #3 on: August 25, 2011, 05:02:14 am »


               Just a clean up of the above formating.

void main()
{  
    PlaySound("as_cv_brickscrp1");
    object oPlateEffector = GetNearestObjectByTag("plate_effector");
    int iCheck = GetLocalInt(oPlateEffector, "count");
    string sPlate = GetStringRight(GetTag(OBJECT_SELF), 1);
    SetLocalInt(OBJECT_SELF, "on", 1);
    SetLocalInt(oPlateEffector, sPlate, 1);
    iCheck++;
    SetLocalInt(oPlateEffector, "count", iCheck);
    AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
    if (iCheck == 4)
      {  object oPC = GetLastUsedBy();
        object oPlateEffector = GetNearestObjectByTag("plate_effector");
        string s1 = IntToString(GetLocalInt(oPlateEffector, "1"));
        string s2 = IntToString(GetLocalInt(oPlateEffector, "2"));
        string s3 = IntToString(GetLocalInt(oPlateEffector, "3"));
        string s4 = IntToString(GetLocalInt(oPlateEffector, "4"));
        string s5 = IntToString(GetLocalInt(oPlateEffector, "5"));
        string s6 = IntToString(GetLocalInt(oPlateEffector, "6"));
        string s7 = IntToString(GetLocalInt(oPlateEffector, "7"));
        string s8 = IntToString(GetLocalInt(oPlateEffector, "8"));
        string sWaypoint = s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8;
         object oWaypoint = GetWaypointByTag(sWaypoint);
         object oWaypointHere = GetNearestObjectByTag(sWaypoint,oPC,1);
       if ((oWaypoint == OBJECT_INVALID)  || (GetIsObjectValid(oWaypointHere)))
       {       
          if (oWaypoint == OBJECT_INVALID)
               FloatingTextStringOnCreature("Warning Invalid Rune Code",oPC);
          else if (GetIsObjectValid(oWaypointHere))
               FloatingTextStringOnCreature("Warning This Rune Code Destination",oPC);
          object oPlateEffector = GetNearestObjectByTag("plate_effector");
          DelayCommand(0.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), oPC, 0.0));
          AssignCommand(GetNearestObjectByTag("RUNEP_1", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_2", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_3", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_4", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_5", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_6", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_7", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_8", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          SetLocalInt(GetNearestObjectByTag("RUNEP_1", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_2", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_3", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_4", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_5", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_6", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_7", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_8", oPC), "on", 0);
          SetLocalInt(oPlateEffector, "1", 0);
          SetLocalInt(oPlateEffector, "2", 0);
          SetLocalInt(oPlateEffector, "3", 0);
          SetLocalInt(oPlateEffector, "4", 0);
          SetLocalInt(oPlateEffector, "5", 0);
          SetLocalInt(oPlateEffector, "6", 0);
          SetLocalInt(oPlateEffector, "7", 0);
          SetLocalInt(oPlateEffector, "8", 0);
          SetLocalInt(oPlateEffector, "count", 0);
          return;
        }       
        AssignCommand(GetNearestObjectByTag("RUNEP_1", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_2", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_3", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_4", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_5", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_6", oPC),        ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_7", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_8", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        SetLocalInt(GetNearestObjectByTag("RUNEP_1", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_2", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_3", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_4", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_5", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_6", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_7", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_8", oPC), "on", 0);
        SetLocalInt(oPlateEffector, "1", 0);
        SetLocalInt(oPlateEffector, "2", 0);
        SetLocalInt(oPlateEffector, "3", 0);
        SetLocalInt(oPlateEffector, "4", 0);
        SetLocalInt(oPlateEffector, "5", 0);
        SetLocalInt(oPlateEffector, "6", 0);
        SetLocalInt(oPlateEffector, "7", 0);
        SetLocalInt(oPlateEffector, "8", 0);
        SetLocalInt(oPlateEffector, "count", 0);
        SetCommandable(FALSE, oPC);
        DelayCommand(4.9, SetCommandable(TRUE, oPC));
        DelayCommand(5.0, AssignCommand(oPC, JumpToObject(oWaypoint)));
        DelayCommand(0.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE),oPC, 4.0));
        DelayCommand(1.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR_2),oPC, 2.5));
        DelayCommand(4.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1),oPC, 3.5));
    }
}
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Help please.
« Reply #4 on: August 25, 2011, 06:26:29 am »


               

Lightfoot8 wrote...

Just a clean up of the above formating.

void main()
{  
    PlaySound("as_cv_brickscrp1");
    object oPlateEffector = GetNearestObjectByTag("plate_effector");
    int iCheck = GetLocalInt(oPlateEffector, "count");
    string sPlate = GetStringRight(GetTag(OBJECT_SELF), 1);
    SetLocalInt(OBJECT_SELF, "on", 1);
    SetLocalInt(oPlateEffector, sPlate, 1);
    iCheck++;
    SetLocalInt(oPlateEffector, "count", iCheck);
    AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
    if (iCheck == 4)
      {  object oPC = GetLastUsedBy();
        object oPlateEffector = GetNearestObjectByTag("plate_effector");
        string s1 = IntToString(GetLocalInt(oPlateEffector, "1"));
        string s2 = IntToString(GetLocalInt(oPlateEffector, "2"));
        string s3 = IntToString(GetLocalInt(oPlateEffector, "3"));
        string s4 = IntToString(GetLocalInt(oPlateEffector, "4"));
        string s5 = IntToString(GetLocalInt(oPlateEffector, "5"));
        string s6 = IntToString(GetLocalInt(oPlateEffector, "6"));
        string s7 = IntToString(GetLocalInt(oPlateEffector, "7"));
        string s8 = IntToString(GetLocalInt(oPlateEffector, "8"));
        string sWaypoint = s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8;
         object oWaypoint = GetWaypointByTag(sWaypoint);
         object oWaypointHere = GetNearestObjectByTag(sWaypoint,oPC,1);
       if ((oWaypoint == OBJECT_INVALID)  || (GetIsObjectValid(oWaypointHere)))
       {       
          if (oWaypoint == OBJECT_INVALID)
               FloatingTextStringOnCreature("Warning Invalid Rune Code",oPC);
          else if (GetIsObjectValid(oWaypointHere))
               FloatingTextStringOnCreature("Warning This Rune Code Destination",oPC);
          object oPlateEffector = GetNearestObjectByTag("plate_effector");
          DelayCommand(0.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), oPC, 0.0));
          AssignCommand(GetNearestObjectByTag("RUNEP_1", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_2", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_3", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_4", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_5", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_6", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_7", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          AssignCommand(GetNearestObjectByTag("RUNEP_8", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
          SetLocalInt(GetNearestObjectByTag("RUNEP_1", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_2", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_3", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_4", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_5", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_6", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_7", oPC), "on", 0);
          SetLocalInt(GetNearestObjectByTag("RUNEP_8", oPC), "on", 0);
          SetLocalInt(oPlateEffector, "1", 0);
          SetLocalInt(oPlateEffector, "2", 0);
          SetLocalInt(oPlateEffector, "3", 0);
          SetLocalInt(oPlateEffector, "4", 0);
          SetLocalInt(oPlateEffector, "5", 0);
          SetLocalInt(oPlateEffector, "6", 0);
          SetLocalInt(oPlateEffector, "7", 0);
          SetLocalInt(oPlateEffector, "8", 0);
          SetLocalInt(oPlateEffector, "count", 0);
          return;
        }       
        AssignCommand(GetNearestObjectByTag("RUNEP_1", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_2", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_3", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_4", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_5", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_6", oPC),        ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_7", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        AssignCommand(GetNearestObjectByTag("RUNEP_8", oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
        SetLocalInt(GetNearestObjectByTag("RUNEP_1", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_2", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_3", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_4", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_5", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_6", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_7", oPC), "on", 0);
        SetLocalInt(GetNearestObjectByTag("RUNEP_8", oPC), "on", 0);
        SetLocalInt(oPlateEffector, "1", 0);
        SetLocalInt(oPlateEffector, "2", 0);
        SetLocalInt(oPlateEffector, "3", 0);
        SetLocalInt(oPlateEffector, "4", 0);
        SetLocalInt(oPlateEffector, "5", 0);
        SetLocalInt(oPlateEffector, "6", 0);
        SetLocalInt(oPlateEffector, "7", 0);
        SetLocalInt(oPlateEffector, "8", 0);
        SetLocalInt(oPlateEffector, "count", 0);
        SetCommandable(FALSE, oPC);
        DelayCommand(4.9, SetCommandable(TRUE, oPC));
        DelayCommand(5.0, AssignCommand(oPC, JumpToObject(oWaypoint)));
        DelayCommand(0.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE),oPC, 4.0));
        DelayCommand(1.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR_2),oPC, 2.5));
        DelayCommand(4.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1),oPC, 3.5));
    }
}


Should be the same as this, though I can only test compile it, not actually test it:

void main()
{
    int i;
    string sWaypoint;
    PlaySound("as_cv_brickscrp1");
    object oPlateEffector = GetNearestObjectByTag("plate_effector");
    int iCheck = GetLocalInt(oPlateEffector, "count");
    string sPlate = GetStringRight(GetTag(OBJECT_SELF), 1);
    SetLocalInt(OBJECT_SELF, "on", 1);
    SetLocalInt(oPlateEffector, sPlate, 1);
    iCheck++;
    SetLocalInt(oPlateEffector, "count", iCheck);
    AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
    if (iCheck == 4)
        {
         object oPC = GetLastUsedBy();
         for (i = 1; i <= 8; i++)
            {
             sWaypoint += IntToString(GetLocalInt(oPlateEffector, IntToString (i) ));
            }
         object oWaypoint = GetWaypointByTag(sWaypoint);
         object oWaypointHere = GetNearestObjectByTag (sWaypoint,oPC,1);
         if ((oWaypoint == OBJECT_INVALID)  || (GetIsObjectValid(oWaypointHere)))
            {
             if (oWaypoint == OBJECT_INVALID)
                FloatingTextStringOnCreature("Warning Invalid Rune Code",oPC);
             else if (GetIsObjectValid(oWaypointHere))
                FloatingTextStringOnCreature("Warning This Rune Code Destination",oPC);
             DelayCommand(0.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SMOKE_PUFF), oPC, 0.0));
             for (i = 1; i <= 8; i++)
                {
                 AssignCommand(GetNearestObjectByTag("RUNEP_" + IntToString (i) , oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
                 SetLocalInt  (GetNearestObjectByTag("RUNEP_" + IntToString (i), oPC), "on", 0);
                 SetLocalInt  (oPlateEffector, IntToString (i), 0);
                }
             SetLocalInt(oPlateEffector, "count", 0);
             return;
            }
         for (i = 1; i <= 8; i++)
                {
                 AssignCommand(GetNearestObjectByTag("RUNEP_" + IntToString (i) , oPC), ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
                 SetLocalInt  (GetNearestObjectByTag("RUNEP_" + IntToString (i), oPC), "on", 0);
                 SetLocalInt(oPlateEffector, IntToString (i), 0);
                }
        SetLocalInt(oPlateEffector, "count", 0);
        SetCommandable(FALSE, oPC);
        DelayCommand(4.9, SetCommandable(TRUE, oPC));
        DelayCommand(5.0, AssignCommand(oPC, JumpToObject(oWaypoint)));
        DelayCommand(0.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE),oPC, 4.0));
        DelayCommand(1.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_DUR_PROT_EPIC_ARMOR_2),oPC, 2.5));
        DelayCommand(4.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1),oPC, 3.5));
    }
}



edit:  I'm not sure why your code doesn't work, to be honest, though you do assign this variable twice:

object oPlateEffector = GetNearestObjectByTag("plate_effector");

  I just switched it into a form I could read through more easily in my version of it, I didn't make any changes aside from removing the double assigning.
               
               

               


                     Modifié par Failed.Bard, 25 août 2011 - 05:30 .
                     
                  


            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Help please.
« Reply #5 on: August 25, 2011, 04:04:54 pm »


               Too Many AssignCommand(s), action overflow most likely......

use fDelay maybe?
e.g.

float fDelay = 0.1;
for(i=0;i<X;i++)
{
 fDelay+=0.1;
 DelayCommand(fDelay, AssignCommand(???));
}
               
               

               


                     Modifié par _Guile, 25 août 2011 - 03:05 .
                     
                  


            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Help please.
« Reply #6 on: August 25, 2011, 04:54:01 pm »


               When you post a larger script use http://pastebin.com/

Really, there should be a sticky for this..
               
               

               


                     Modifié par Xardex, 25 août 2011 - 03:54 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Help please.
« Reply #7 on: August 25, 2011, 07:30:21 pm »


               If I'm understanding what you are trying to do correctly, you have 8 rune plates and you have to use 4 of them to create a combination that teleports you to the waypoint with a tag that matches that combination. If that is correct I have something that is very similar to what you have and are asking. I made it just to see if I could do the same thing another server had.

I did it a bit different than your script though. I gave all the rune plates the same tag. But I added a string variable to each one that contained that plates chunk of the combination. Then I retrieve that each time a rune is used. Each part is added to the combination string on an invisible object that I use as the controller (This helps with PW/multiplayer problems). I also used a specific naming convention for the waypoint tags. For example if the combination to a certain waypoint is "1234", the waypoint will have the tag "WP_1234".

I know you wanted someone to alter the script you posted, and I'm not trying to be mean, but  there is some stuff going on there that could be cleaned up, changed, etc. Not that mine couldn't be cleaned up a bit more.

If nothing else this might at least be able to help you get going in the direction you wanted:


void main()
{
    object oPC = GetLastUsedBy();
    object oController = GetNearestObjectByTag("PlateController", oPC);
    int iActive = GetLocalInt(OBJECT_SELF, "ACTIVE");
    if (iActive)
    {
        SendMessageToPC(oPC, "This rune is already active.");
        return;
    }
    string sComboPart = GetLocalString(OBJECT_SELF, "COMBO_PART");
    string sCombo = GetLocalString(oController, "RUNE_COMBO") + sComboPart;
    int iPlates = GetLocalInt(oController, "PLATES_ACTIVATED") + 1;

    ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
    SetLocalInt(OBJECT_SELF, "ACTIVE", TRUE);
    SetLocalString(oController, "RUNE_COMBO", sCombo);
    SetLocalInt(oController, "PLATES_ACTIVATED", iPlates);

    if (iPlates == 4)
    {
        object oWP = GetObjectByTag("WP_" + sCombo);
        if (GetIsObjectValid(oWP))
        {
            if (GetArea(OBJECT_SELF) == GetArea(oWP))
            {
                FloatingTextStringOnCreature("You are already at that location", oPC);
            }
            else
            {
                effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_2);
                location lPC = GetLocation(oPC);
                ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lPC);
                object oMember = GetFirstFactionMember(oPC);
                while (GetIsObjectValid(oMember))
                {
                    if (oMember == oPC || GetMaster(oMember) == oPC)
                    AssignCommand(oMember, ActionJumpToObject(oWP));
                    oMember = GetNextFactionMember(oPC);
                }
            }
        }
        else
        {
            FloatingTextStringOnCreature("That is an invalid code.", oPC);
        }

        DeleteLocalInt(oController, "PLATES_ACTIVATED");
        DeleteLocalString(oController, "RUNE_COMBO");

        string sTag = GetTag(OBJECT_SELF);
        int iRunes;
        for (iRunes = 0; iRunes <= 8; iRunes++)
        {
            object oRune = GetObjectByTag(sTag, iRunes);
            iActive = GetLocalInt(oRune, "ACTIVE");
            if (iActive)
            {
                AssignCommand(oRune, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
                SetLocalInt(oRune, "ACTIVE", FALSE);
            }
        }
    }
}
               
               

               


                     Modifié par GhostOfGod, 25 août 2011 - 06:45 .
                     
                  


            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Help please.
« Reply #8 on: August 25, 2011, 08:43:15 pm »


               <jumps up...>

Xardex wrote...

When you post a larger script use http://pastebin.com/

Really, there should be a sticky for this..


WooHOO! *That's* what I was looking for... couldn't remember who posted it, or where :-(

Thanks, X

Be nice to add it to Scripting tools sticky, maybe? First post you read, right?

<...and sits right back down>
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Help please.
« Reply #9 on: August 25, 2011, 09:31:53 pm »


               Yes several versions floating around.Mine came from the old forums then was adjusted by a guy named monrast who dissappeared.Then some more was added to check for if same location from these forums.It works great except it being binary it doesnt matter which way you type in the combination.

The way it works   8 rune plates with tag RUNE_1   , RUNE_2 , etc....
                          above script in onused
                           then the  invisible object called plate_effector on the middle of each gate.
                           then for your waypoints you do them in binary so if you wee to dial 1234 your                                                                                               waypoint tag would look like this 11110000          
                           Also can stick a trigger on the gate so if you walk off it resets the runes.

The only thing I take credit for is getting the effects timed correctly at the bottom and putting those 3 together lol they are pretty cool to see in action.


I would like to give yours a try GhostOfGod since it does a combination.I will try tonight or tommorrow .Been working alot so hope to do it this  weekend.Thanks for all the response.
               
               

               


                     Modifié par Knight_Shield, 26 août 2011 - 01:46 .
                     
                  


            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Help please.
« Reply #10 on: August 26, 2011, 02:41:26 am »


               Ok I am no scriptor let me see if I get this right?

Tag of invisble object= PlateController
Tag of runes = COMBO_PART
The variable on the rune = RUNE_COMBO       string           1
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Help please.
« Reply #11 on: August 26, 2011, 03:14:20 am »


               1.) Yes but you can change that in the script if you want something else.
2.) No. You can give the rune plates whatever tag you want so long as they are all the same.
3.) No. "COMBO_PART, string, 1".  But it doesn't have to be 1. That was just an example. You could also use just letters or other small words. However just leaving them as numbers does make it easier. So rune1 would have the string variable set to "1", rune 2 "2", etc... Then give your destination waypoints tags like "WP_1234", "WP_2341", "WP_1672", etc. Whatever code you want.

P.S. Just found a bug in my own script as usual. Fixed version:

void main()
{
    object oPC = GetLastUsedBy();
    object oController = GetNearestObjectByTag("PlateController", oPC);
    int iActive = GetLocalInt(OBJECT_SELF, "ACTIVE");
    if (iActive)
    {
        SendMessageToPC(oPC, "This rune is already active.");
        return;
    }
    string sComboPart = GetLocalString(OBJECT_SELF, "COMBO_PART");
    string sCombo = GetLocalString(oController, "RUNE_COMBO") + sComboPart;
    int iPlates = GetLocalInt(oController, "PLATES_ACTIVATED") + 1;

    ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
    SetLocalInt(OBJECT_SELF, "ACTIVE", TRUE);
    SetLocalString(oController, "RUNE_COMBO", sCombo);
    SetLocalInt(oController, "PLATES_ACTIVATED", iPlates);

    if (iPlates == 4)
    {
        object oWP = GetObjectByTag("WP_" + sCombo);
        if (GetIsObjectValid(oWP))
        {
            if (GetArea(OBJECT_SELF) == GetArea(oWP))
            {
                FloatingTextStringOnCreature("You are already at that location", oPC);
            }
            else
            {
                effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_2);
                location lPC = GetLocation(oPC);
                ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, lPC);
                object oMember = GetFirstFactionMember(oPC);
                while (GetIsObjectValid(oMember))
                {
                    if (oMember == oPC || GetMaster(oMember) == oPC)
                    AssignCommand(oMember, ActionJumpToObject(oWP));
                    oMember = GetNextFactionMember(oPC);
                }
            }
        }
        else
        {
            FloatingTextStringOnCreature("That is an invalid code.", oPC);
        }

        DeleteLocalInt(oController, "PLATES_ACTIVATED");
        DeleteLocalString(oController, "RUNE_COMBO");

        string sTag = GetTag(OBJECT_SELF);
        int iRunes;
        for (iRunes = 1; iRunes <= 8; iRunes++)
        {
            object oRune = GetNearestObjectByTag(sTag, oController, iRunes);
            iActive = GetLocalInt(oRune, "ACTIVE");
            if (iActive)
            {
                AssignCommand(oRune, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
                SetLocalInt(oRune, "ACTIVE", FALSE);
            }
        }
    }
}
               
               

               


                     Modifié par GhostOfGod, 26 août 2011 - 02:44 .
                     
                  


            

Legacy_Morbane

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-0
Help please.
« Reply #12 on: August 26, 2011, 04:10:55 am »


               I am mostly just curious - is this script for something like a Stargate Portal? Where you set the code and bamf! you go there...?
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
Help please.
« Reply #13 on: August 26, 2011, 04:20:15 am »


               Yes it looks like a dial .
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Help please.
« Reply #14 on: August 26, 2011, 05:20:11 am »


               

Morbane wrote...

I am mostly just curious - is this script for something like a Stargate Portal? Where you set the code and bamf! you go there...?


I'm not sure how Knight has it laid out. These are usually pressure plates, rune markings, etc.. layed out in a circle on the ground. You activate them and then you teleport when you activate the last rune (if it is a valid destination).

Although the startgate method would be fun too. Use a machine to punch in a 4 digit number. If number is valid stargate becomes activated, step through to your destination.
               
               

               


                     Modifié par GhostOfGod, 26 août 2011 - 04:29 .