Forged Alliance Forever Forged Alliance Forever Forums 2014-10-22T09:02:31+02:00 /feed.php?f=2&t=8717 2014-10-22T09:02:31+02:00 2014-10-22T09:02:31+02:00 /viewtopic.php?t=8717&p=83951#p83951 <![CDATA[Re: Walls and friendly fire]]>
Thanks again for making my playing experience better. :)

Statistics: Posted by Krapougnak — 22 Oct 2014, 09:02


]]>
2014-10-22T01:09:25+02:00 2014-10-22T01:09:25+02:00 /viewtopic.php?t=8717&p=83940#p83940 <![CDATA[Re: Walls and friendly fire]]>
Krapougnak wrote:
It worked !!! Thanks a lot ! :D

Sheeo wrote:
Remember to return the value that UnitOld.OnCollisionCheck yields :)


What do you mean by that ?


I meant there was a difference between the snippet you posted and mine:

Code:
UnitOld.OnCollisionCheck(self, other, firingWeapon)


vs

Code:
return UnitOld.OnCollisionCheck(self, other, firingWeapon)



The return keyword is crucial to ensure everything else doesn't stop colliding :)

Statistics: Posted by Sheeo — 22 Oct 2014, 01:09


]]>
2014-10-21T22:58:31+02:00 2014-10-21T22:58:31+02:00 /viewtopic.php?t=8717&p=83935#p83935 <![CDATA[Re: Walls and friendly fire]]>

Sheeo wrote:
Remember to return the value that UnitOld.OnCollisionCheck yields :)


What do you mean by that ?

Statistics: Posted by Krapougnak — 21 Oct 2014, 22:58


]]>
2014-10-21T15:00:00+02:00 2014-10-21T15:00:00+02:00 /viewtopic.php?t=8717&p=83894#p83894 <![CDATA[Re: Walls and friendly fire]]> Statistics: Posted by IceDreamer — 21 Oct 2014, 15:00


]]>
2014-10-21T10:16:27+02:00 2014-10-21T10:16:27+02:00 /viewtopic.php?t=8717&p=83878#p83878 <![CDATA[Re: Walls and friendly fire]]>
If you just want walls to block everything, replace it with:

Code:
local UnitOld = Unit
Unit = Class(UnitOld) {
    OnCollisionCheck = function(self, other, firingWeapon)
        if EntityCategoryContains(categories.WALL, self) then
            return true
        end
        return UnitOld.OnCollisionCheck(self, other, firingWeapon)
    end,
}


Remember to return the value that UnitOld.OnCollisionCheck yields :)

Statistics: Posted by Sheeo — 21 Oct 2014, 10:16


]]>
2014-10-21T09:29:45+02:00 2014-10-21T09:29:45+02:00 /viewtopic.php?t=8717&p=83874#p83874 <![CDATA[Re: Walls and friendly fire]]>
I put the file in the mod "hook/lua/sim" folder correct ?

Code:
local UnitOld = Unit

Unit = Class(UnitOld) {

    OnCollisionCheck = function(self, other, firingWeapon)

        if EntityCategoryContains(categories.WALL, other) then
   return true

        end
            UnitOld.OnCollisionCheck(self, other, firingWeapon)
    end,
}

Statistics: Posted by Krapougnak — 21 Oct 2014, 09:29


]]>
2014-10-20T10:08:42+02:00 2014-10-20T10:08:42+02:00 /viewtopic.php?t=8717&p=83789#p83789 <![CDATA[Re: Walls and friendly fire]]>
I will try this as soon as I get home. :)

Statistics: Posted by Krapougnak — 20 Oct 2014, 10:08


]]>
2014-10-19T14:11:35+02:00 2014-10-19T14:11:35+02:00 /viewtopic.php?t=8717&p=83713#p83713 <![CDATA[Re: Walls and friendly fire]]> Statistics: Posted by IceDreamer — 19 Oct 2014, 14:11


]]>
2014-10-19T09:45:21+02:00 2014-10-19T09:45:21+02:00 /viewtopic.php?t=8717&p=83700#p83700 <![CDATA[Walls and friendly fire]]>
What files do I need to change to make a wall block friendly fire ?

(i'm using a mod with T2 and T3 walls and my units firing through them look ridiculous)

Thanks for your help.

Statistics: Posted by Krapougnak — 19 Oct 2014, 09:45


]]>