Aller au contenu

Photo

Kinda confused with this


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

#1
Taino

Taino
  • Members
  • 139 messages
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)

#2
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
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.

#3
Taino

Taino
  • Members
  • 139 messages
I have this in a test mod; which doesn't have any factions setup in it.

#4
Taino

Taino
  • Members
  • 139 messages
Just tested it and its firing..

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


#5
Taino

Taino
  • Members
  • 139 messages
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);
}
}
}

#6
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
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);
  

#7
Failed.Bard

Failed.Bard
  • Members
  • 774 messages
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.

#8
Taino

Taino
  • Members
  • 139 messages
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!!

#9
Taino

Taino
  • Members
  • 139 messages
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.