whitevo
Feeling good, thats what I do.
Code:
if table.changeTarget then
print("before "..monster:getFollowCreature():getName())
print("new targetName "..target:getName())
monster:removeTarget(monster:getFollowCreature())
monster:selectTarget(target)
monster:setTarget(target)
monster:setFollowCreature(target)
print("after "..monster:getFollowCreature():getName())
end
This is the statement what is executed only once.
I tried ALL of the functions invidually and in different combinations. I get Same Prints all the time(expect when i use setTarget ONLY)
The only thing what almost works is: monster:setTarget(target)
And if i don't put anything else then monster has new target, but he will keep following the old one.
Code:
print("Even later "..monster:getFollowCreature():getName())
print()
end
end
end
end
print("Last line of code "..monster:getFollowCreature():getName())
end
Prints come as follows:
before Druid
new targetName Knight
after Knight
Even later Knight
Last line of code Knight
But what visually happens is:
Monster still keeps following and attacking old target.
If I ONLY use monster:setTarget(target) then it will change the attack target, but follows the old one.
What I want to do is to change target so that he will follow AND attack the new target I give him?
Last edited: