Thread: NPC collision
View Single Post
  #5  
Old 08-25-2011, 11:43 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by Tricxta View Post
Could always place a constant firing triggeraction in front of the npc:
PHP Code:
triggeractionplayerx.+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.
Reply With Quote