Sometimes the party is hard to move around. I click, but the circles won't appear. It takes a few tries, and the characters keep halting mid-way. I've learned that this is a sure sign of some AI commands constantly being issued. When the party AI is off, and if I know that nothing in the overarching scripts is sending ActionOverrides in their direction, this means that creature scripts are to blame. Something confusing is going on there, and it usually has to do with Range. For example, if you write
Range(Player1,7)
in a creature's script, followed by some action, it's going to attempt it forever, never move from the spot and so always in range (unless Player1 does a reverse Muhammad moonwalk and gets away first). This issue comes up rarely, but it's come up again now, scripting certain inhabitants of a village to move to their doors and vanish nearby, imitating an entry. The creatures stumble under an almost visible stream of shouting from the AI. I don't know if this sort of thing - imitating realistic comings and goings - has been done in other mods and I can't download every thing made since Noah to look, but I could use some advice from those who have run into the range problem.
I'm going to put the code for the override script here, and I should mention that there is quite a bit of other code on top of this.
IF
!Allegiance(Myself,EVILCUTOFF) /// When not an enemy
!Global("XVARTS_MAD","GLOBAL",1) /// And not angered
Global("NEXLIT_OKAY","GLOBAL",1) /// And the chief approves
NearLocation(Myself,2477,1865,5) /// And close enough to the entrance of one of the huts
THEN
RESPONSE #100
ClearAllActions()
MoveToPointNoInterrupt([2477.1865]) /// The actual place, "rug," before the door. They are not doors in the technical sense
CreateCreatureOffScreen("kxvar1_#",S) // Spawn another xvart off-screen as a replacement
DestroySelf() /// And dive in. Repeated below for different doorways
END
IF
!Allegiance(Myself,EVILCUTOFF)
!Global("XVARTS_MAD","GLOBAL",1)
Global("NEXLIT_OKAY","GLOBAL",1)
NearLocation(Myself,2655,1668,5)
THEN
RESPONSE #100
ClearAllActions()
MoveToPointNoInterrupt([2655.1668])
CreateCreatureOffScreen("kxvar1_#",N) // Xvart
DestroySelf()
END
IF
!Allegiance(Myself,EVILCUTOFF)
!Global("XVARTS_MAD","GLOBAL",1)
Global("NEXLIT_OKAY","GLOBAL",1)
NearLocation(Myself,3045,1784,5)
THEN
RESPONSE #100
ClearAllActions()
MoveToPointNoInterrupt([3045.1784])
CreateCreatureOffScreen("kxvar1_#",N) // Xvart
DestroySelf()
END
IF
!Allegiance(Myself,EVILCUTOFF)
!Global("XVARTS_MAD","GLOBAL",1)
Global("NEXLIT_OKAY","GLOBAL",1)
NearLocation(Myself,3294,1696,5)
THEN
RESPONSE #100
ClearAllActions()
MoveToPointNoInterrupt([3294.1696])
CreateCreatureOffScreen("kxvar1_#",N) // Xvart
DestroySelf()
END
IF
!Allegiance(Myself,EVILCUTOFF)
!Global("XVARTS_MAD","GLOBAL",1)
Global("NEXLIT_OKAY","GLOBAL",1)
NearLocation(Myself,3578,1716,5)
THEN
RESPONSE #100
ClearAllActions()
MoveToPointNoInterrupt([3578.1716])
CreateCreatureOffScreen("kxvar1_#",W) // Xvart
DestroySelf()
END
IF
!Allegiance(Myself,EVILCUTOFF)
!Global("XVARTS_MAD","GLOBAL",1)
Global("NEXLIT_OKAY","GLOBAL",1)
NearLocation(Myself,4245,944,5)
THEN
RESPONSE #100
ClearAllActions()
MoveToPointNoInterrupt([4245.944])
CreateCreatureOffScreen("kxvar1_#",W) // Xvart
DestroySelf()
END
/// The following actions are what the xvarts should do when not near those door rugs. By itself (without the blocks above) the code works and they move about smoothly. With them they walk a few steps and stop, hovering, so there must be some conflict between the two.
IF
!Allegiance(Myself,EVILCUTOFF)
!Global("XVARTS_MAD","GLOBAL",1)
Global("NEXLIT_OKAY","GLOBAL",1)
!NearLocation(Myself,2477,1865,5)
!NearLocation(Myself,4245,944,5)
!NearLocation(Myself,3578,1716,5)
!NearLocation(Myself,3294,1696,5)
!NearLocation(Myself,3045,1784,5)
THEN
RESPONSE #2
RandomWalk() /// A smallish chance of moving about - and hopefully passing within Range above to be snatched by homesickness
RESPONSE #20
NoAction() /// Mostly standing around
RESPONSE #1
CreateCreatureOffScreen("kxvar1_#",S) // And a small chance of leaving a replacement
EscapeAreaDestroy(10) /// Before running off
END
What do you think I could do to get this running smoothly?