Author Topic: Question about "flat-footed"  (Read 361 times)

Legacy_Guest_Scrotok_*

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Question about "flat-footed"
« on: November 25, 2012, 07:06:28 pm »


               Hi all!

Is there a way to determine whether someone is "flat-footed" via scripting?

http://nwn.wikia.com/wiki/Flat-foot

Thanks!
JP
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Question about "flat-footed"
« Reply #1 on: November 25, 2012, 08:03:25 pm »


               good question.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Question about "flat-footed"
« Reply #2 on: November 26, 2012, 12:52:17 am »


               in vanilla nwn all you can do is to check if the current action is ACTION_INVALID, character who does nothing is likely being flatfooted

action_invalid is returned alsoi in case of using healers kit, but that makes char flatfooted so no prob, question is what is the return of this function when character is walking via keyboard and not mouse (which makes no action in queve)

it is cetainly not reliable, but without NWNX you hardly can do better

NWNX related, I have developd both function getisflatfooted and getisflanked, sent source to the Terra777 as I added it into his nwnx_funcs, don't know if he already released a new version though
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Question about "flat-footed"
« Reply #3 on: November 29, 2012, 01:32:26 am »


               

int GetIsFlatfooted(object oCreature=OBJECT_SELF)
{
 if(GetHasFeat(FEAT_UNCANNY_REFLEX,oCreature))
 {
 return FALSE;
 }
 switch(GetCurrentAction(oCreature))
 {
 case ACTION_DISABLETRAP:
 case ACTION_EXAMINETRAP:
 case ACTION_FLAGTRAP:
 case ACTION_INVALID:
 case ACTION_LOCK:
 case ACTION_OPENLOCK:
 case ACTION_RECOVERTRAP:
 case ACTION_REST:
 case ACTION_SETTRAP:
 case ACTION_SIT:
 case ACTION_TAUNT:
 case ACTION_WAIT:
    return TRUE;
 }
int bBlindFight = GetHasFeat(FEAT_BLIND_FIGHT,oCreature);
effect e = GetFirstEffect(oCreature);
 while(GetIsEffectValid(e))
 {
  switch(GetEffectType(e))
  {
  case EFFECT_TYPE_ENTANGLE:
  case EFFECT_TYPE_CUTSCENEIMMOBILIZE:
      return TRUE;
  case EFFECT_TYPE_BLINDNESS:
      if(!bBlindFight) return TRUE;
  break;
  }
 e = GetNextEffect(oCreature);
 }
return GetMovementRate(oCreature) < 2;
}

there is a custom function inside NWScript. Its definitely not 100% reliable and there might be some other circumstances I have missed or misinterpreted.

Im unsure whether the creature is already flatfooted when she has the action to open lock assigned, but she is running towards locked object. As well I dont even know if its ACTION_OPENLOCK returned in such moment. Also I dont know whether cutscene immobilize effect type ID is correctly returned by the function GetEffectType - lexicon says nothing about any weirdness so I guess it does.
               
               

               


                     Modifié par ShaDoOoW, 01 décembre 2012 - 09:15 .