Author Topic: tno.SetOwner  (Read 2208 times)

voncarp

  • Jr. Member
  • **
  • Thank You
  • -Given: 13
  • -Receive: 2
  • Posts: 91
    • View Profile
tno.SetOwner
« on: February 21, 2015, 02:55:52 AM »
I am trying to do what you talked about in your last post on this prior thread:

http://www.tasharen.com/forum/index.php?topic=5440.0

But I don't see SetOwner anywhere.  Has this been changed?

voncarp

  • Jr. Member
  • **
  • Thank You
  • -Given: 13
  • -Receive: 2
  • Posts: 91
    • View Profile
Re: tno.SetOwner
« Reply #1 on: February 21, 2015, 04:53:18 AM »
This answer here seems to work:

http://www.tasharen.com/forum/index.php?topic=4002.0


In a prior thread you talked about:

"Yup, and you can also change the ownership of objects if you need, so say a player that goes far away can "take over" the ownership of nearby NPCs, thus completely removing the need for the host to do any kind of logic (since they are so far away)."

I've had some success and performance boosts with players online not within range not sending any logic to each other except for occasional position updates.

With the enemies not so much.  What I am trying to do is when the enemies are out of range of all players then destroy them.  However, since the enemy only knows about the player on one device, what would you suggest how I would alert the enemy of all players on different devices/computers are out of range?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: tno.SetOwner
« Reply #2 on: February 21, 2015, 08:35:50 AM »
Assuming each client has a list of all the players with their positions, it would be as simple as looping through that list and doing distance calculations, wouldn't it?