View Single Post
  #5  
Old 06-19-2012, 03:13 AM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
Quote:
Originally Posted by Stefan View Post
I don't exactly understand what the problem is.
showcharacter() makes the npc have a blocking behaviour like the a player, which means a rectangle of (0.5,1,2,2) (starts at x+0.5, y+1 and is 2x2 tiles wide)
triggeraction() is rounding the x and y values down to the next multiply of 0.5, which means 0.6 will become 0.5, 1.4 will become 1.
His problem is that the client and server have different positions. He moves the NPC clientside and because of that the trigger can no longer be sent from the server to the client. The only solution I can think of for this is either placing an NPC at the origin of the NPC's spawn in the onCreated event which would relay the triggeraction to the appropriate NPC, or creating a whole NPC ID'ing system would would make it position-independent.
Reply With Quote