Author Topic: Kinda confused with this  (Read 451 times)

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Kinda confused with this
« on: June 13, 2011, 08:39:16 pm »


               Okay I have a Female Drow who is suposse to be whipping a slave. The slaves script works fine.. He does all the animation that hes suppose to do. But the Drow just stand their as if she is gazing in darkness. Also she should be whipping the slave if and when a player enters the area.

//:: Whipper On_HeartBeat script
void main()
{
    object oArea = GetArea(OBJECT_SELF);
    int sPCINAREA = FALSE;
    object oObject = GetFirstObjectInArea(oArea);
    while(GetIsObjectValid(oObject))
    {
        if(GetIsPC(oObject))
        {
            sPCINAREA = TRUE;
        }
        oObject = GetNextObjectInArea(oArea);
    }

    if(sPCINAREA == TRUE)
    {
        string sWhippy = "WHIPPY";
        object oWhippy = GetObjectByTag(sWhippy);
        if(GetIsObjectValid(oWhippy))
        {
           AssignCommand (OBJECT_SELF, ActionAttack(oWhippy));
            //ActionAttack(oWhippy);
            //ClearAllActions(TRUE);
        }
    }
}

Yes, I double and triple check to make sure that the slave has the correct TAG. Gotta be a simple fix but I'm  kinda working on a bunch of things at once which I may have looked over something.

Thanks in advance. 'B)'
               
               

               
            

Legacy__Knightmare_

  • Full Member
  • ***
  • Posts: 191
  • Karma: +0/-0
Kinda confused with this
« Reply #1 on: June 13, 2011, 09:06:38 pm »


               Is the drow a member of a Faction that is allowed to attack the slave's Faction? Are you sure the script is firing at all? Might put in a feedback string just to make sure it is.
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Kinda confused with this
« Reply #2 on: June 13, 2011, 09:28:00 pm »


               I have this in a test mod; which doesn't have any factions setup in it.
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Kinda confused with this
« Reply #3 on: June 13, 2011, 09:48:17 pm »


               Just tested it and its firing..
               
               

               


                     Modifié par Taino, 13 juin 2011 - 08:48 .
                     
                  


            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Kinda confused with this
« Reply #4 on: June 13, 2011, 10:27:57 pm »


               Okay when I debugged the script I placed it right below the object oObject = GetFirstObjectInArea(oArea);

Then I went ahead and placed it in this function of the script and it didn't work. So I guess theirs my problem.
if(sPCINAREA == TRUE)
   {
       string sWhippy = "WHIPPY";
       object oWhippy = GetObjectByTag(sWhippy);
       if(GetIsObjectValid(oWhippy))
       {
          AssignCommand (OBJECT_SELF, ActionAttack(oWhippy));
           //ActionAttack(oWhippy);
           //ClearAllActions(TRUE);
       }
   }
}
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Kinda confused with this
« Reply #5 on: June 13, 2011, 11:55:30 pm »


               Use   
Function - SetIsTemporaryEnemy
And use a ClearAllActions before you assign the command.


AssignCommand (OBJECT_SELF, ActionAttack(oWhippy));
There is no reason to assign this.  Just use.


ClearAllActions(); 
SetIsTemporaryEnemy(oWhippy);
ActionAttack(oWhippy);
  
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Kinda confused with this
« Reply #6 on: June 14, 2011, 02:08:56 am »


               while(GetIsObjectValid(oObject))
   {
    if(GetIsPC(oObject))
      {
       sPCINAREA = TRUE;
      }
    oObject = GetNextObjectInArea(oArea);
   }

I would change the first line of that to:

while(GetIsObjectValid(oObject) && !sPCINAREA)

There's no sense in continuing to check objects once a PC is found.
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Kinda confused with this
« Reply #7 on: June 18, 2011, 11:54:57 am »


               Sorry for the late delay, I don't have a air-card for my laptop and I can't always get wifi over the road.

I will look into these two suggestions and will reply with the results. Thanks!!
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Kinda confused with this
« Reply #8 on: June 18, 2011, 04:51:16 pm »


               Sweet works, thanks!!!

Now need to a bit more realistic to the whipping. Like making her stop within a certain time and maybe have her heal the prisoner. Then go back at it.