Page 1 of 1

bolts without friendlyfire get eaten by friends

Posted: Mon Jan 02, 2012 10:34 am
by Dekar
Bolts with friendlyfire=false disappear instead of passing through friendlies.
I think this should be changed or at least a new projectile type added with this functionality.

Already located a possible fix:

In engine/target.lua line 264:

Code: Select all

				-- If we explode due to something other than terrain, then we should explode ON the tile, not before it
				elseif typ.stop_block then
					local nb = game.level.map:checkAllEntitiesCount(lx, ly, "block_move")
					if nb > 1 or (nb == 1 and game.level.map:checkAllEntities(lx, ly, "block_move") and not game.level.map:checkEntity(lx, ly, engine.Map.TERRAIN, "pass_projectile")) then
						if for_highlights then

If local nb = game.level.map:checkAllEntitiesCount(lx, ly, "block_move") gets changed to substract the amount of actors friendly to the source actor it should work.

Re: bolts without friendlyfire get eaten by friends

Posted: Wed Feb 15, 2012 6:04 am
by yufra
Yeah, friendlyfire isn't so friendly with Projectiles at the moment. This is on my todo list but feel free to bump it if you don't hear from me in a while...

Re: bolts without friendlyfire get eaten by friends

Posted: Thu Mar 01, 2012 7:50 am
by yufra
Tiger_eye and I put some time into this and have created a "friendlybock" branch on Gitorious. You can now add a "friendlyblock=false" flag to a target definition to allow friendly actors to not stop a bolt (or other things with the "stopblock=true" flag). Please test it out!

Re: bolts without friendlyfire get eaten by friends

Posted: Thu Mar 01, 2012 5:53 pm
by Dekar
Minor aesthetic bug: The path, when targeting, still shows tiles behind friendlies blocked in red.

But functionality seems to be ok. :D

Re: bolts without friendlyfire get eaten by friends

Posted: Fri Mar 02, 2012 9:49 pm
by Dekar
Coding mistake by me, everything seems to be fine so far. :D

Re: bolts without friendlyfire get eaten by friends

Posted: Fri Mar 02, 2012 10:57 pm
by yufra
I'll be pointing this out to DG soon, so keep testing!