| DustyPorViva |
08-25-2011 11:43 PM |
Quote:
Originally Posted by Tricxta
(Post 1665473)
Could always place a constant firing triggeraction in front of the npc:
PHP Code:
triggeraction( playerx.+1.5+(vecx(player.dir)), player.y+2+(vecy(player.dir)), "npctouchedme", NULL);
Then in the receiving npc just find out when the triggeraction is called and your rolling. Im only suggesting this because Thors method is a bit daunting for some people. So unless you understand what his done theres always a second more easier to understand approach. Its just a bit less stable lol.
It might not be the most elegant solution but it sure is straight forward ;)
|
Not only is it not elegant but running triggeraction loops is horribly inefficient and taxing on the server.
NPCs, if given a shape(via setshape() or showcharacter()) are considered walls via onwall(). Instead, he could check for walls and only when they collide with a wall, check for an NPC in front of them... if you want to do something simple. However, this requires NPCs to block which may not be desired, and will end up emulating almost exactly what Thor is doing anyways... he could fall back on triggeraction when it hits a wall but I don't like to recommend triggeraction.
|