Summoners occasionaly get stuck with summoner as target

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
paboperfecto
Wyrmic
Posts: 216
Joined: Tue Mar 31, 2009 7:45 pm
Location: New Mexico

Summoners occasionaly get stuck with summoner as target

#1 Post by paboperfecto »

Many summoners have died to bring us this information....

Following my discussion in the general thread I went ahead and dug into the code. I still have no idea why this was more prevalent in the Sand Worm Lair than anywhere else that I've been. When a summoned creature doesn't find a target it sets its target to the summoner in order to follow it. Now when a new target comes along there is some small chance that the summoned creature can ditch its target, otherwise it keeps the same target. When the target is the summoner this causes a problem because the summoned creature will then just follow you around instead of attacking. It could be that the line of sight craziness in the sand lair just highlights the problem more than other places. I'm not sure if this is the best way to fix since I don't know all the code but I added one line the following to game/modules/tome/ai/summon.lua:

Code: Select all

-- Do the normal AI, otherwise follows summoner
	if self.ai_target.actor == self.summoner then self.ai_target.actor = nil end
	if self:runAI("target_simple") then
		return self:runAI(self.ai_real)
	else
		self.ai_target.actor = self.summoner
		local ret = self:runAI(self.ai_real)
		self.ai_target.actor = nil
		return ret
	end
The first actual line of code is the one I added (sorry, I don't have it checked out so I can submit a patch, just the files that I have for playing the game) which sets the target to nothing if the summoned creature has me as a target, forcing "target_simple" to choose a new hostile target if available.

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Summoners occasionaly get stuck with summoner as target

#2 Post by darkgod »

fixed thanks!
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply