noob questions about action queues
ziplock9000
Member Posts: 2
The following random script example I pulled from the internet:
If the heartbeat in NWN is every 6 seconds, wont calling ActionRest(); ActionRandomWalk() every 6 seconds completely fill up the action queue because they take longer than 6 seconds to complete, or does the queue have a finite limit of 2 and they just push anything already there off?
Also wont ActionRandomWalk() immediately cancel ActionRest(), so effectively the NPC will always be walking and never resting?
void main() { int iUsrEvn = GetUserDefinedEventNumber(); if (iUsrEvn == 1001) /* OnHeartbeat */ { /* if wounded and no longer in combat then rest and wander */ if ((GetCurrentHitPoints() < GetMaxHitPoints()) && !GetIsInCombat()) { ActionRest(); ActionRandomWalk(); } } }My questions are these:
If the heartbeat in NWN is every 6 seconds, wont calling ActionRest(); ActionRandomWalk() every 6 seconds completely fill up the action queue because they take longer than 6 seconds to complete, or does the queue have a finite limit of 2 and they just push anything already there off?
Also wont ActionRandomWalk() immediately cancel ActionRest(), so effectively the NPC will always be walking and never resting?
0
Comments
I've never hit a limit to the length of the action queue, so it seems unwise to do stuff like that.
What this means is that the creature will instantly heal to full and start ActionRandomWalk(), but because the conditional checks for currentHP is less than maxHP, it won't call ActionRest/RandomWalk until it's injured again.