Aller au contenu

Photo

Set Creature Walk Rate via Script (Mostly Resolved)


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

#1
Morbane

Morbane
  • Members
  • 1 883 messages
 Is there a way to set a creatures walk rate through script?

To be honest I havent really searched all the NWN2 resources available but I thought I would start here.

Modifié par Morbane, 28 avril 2012 - 03:58 .


#2
Morbane

Morbane
  • Members
  • 1 883 messages
Ok I found SetMovementRateFactor()

//RWT-OEI 04/22/08
//Given a valid creature ID and a new movement factor, sets the creature's movement factor to
//that value. This movement factor is also modified by effects, encumberance, etc.
void SetMovementRateFactor( object oCreature, float fFactor );

Is fFactor a set constant ?

#3
Morbane

Morbane
  • Members
  • 1 883 messages
Ok, I am guessing that the fFactor variable can be from 0.0 to x.x

Does anyone know the range of fFactor?

#4
Morbane

Morbane
  • Members
  • 1 883 messages
Ok I tried to set the fFactor to 0.0 and the creature could still move - albeit slowly - I will try a negative float next.


EDIT: I set the fFactor to -100.0f and the creature could still move.

Does anyone know how to immobilize the creature then if the condition is there set it to move away?

Thanks...

Modifié par Morbane, 27 avril 2012 - 07:21 .


#5
Morbane

Morbane
  • Members
  • 1 883 messages
Ok EffectCutSceneImmobilize() does the trick - but I am having trouble removing the effect when I need to.

Anyone know the function calls? I knew them at one time but it has been a while and I dont know where I used them to get the code I need.

#6
Shaughn78

Shaughn78
  • Members
  • 637 messages
I have used the EffectCutScene.. functions only a couple of times and they were in cutscenes. I did have some trouble with these but by using the SetCutSceneMode function it seems to clear it up a bit.

Another function to try is:
SupernaturalEffect(EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION));

This is what I use to turn NPCs in statues

#7
Morbane

Morbane
  • Members
  • 1 883 messages
Well - I am designing an encounter that involves a creature whos main attack is an AOE - so I want it to simply function on that level until it becomes injured enough then it will run away, kind of thing. So SetCutsceneMode() sounds like a good way to go - I will test it and see.

Ok - SetCutSceneMode() doesnt work that way - I just used the good old fashioned RemoveEffect()

Modifié par Morbane, 28 avril 2012 - 03:57 .