Jump to content
  • 0

[C++] Checking current coordinates


Yiv

Question

Dear community,

 

for a quest I'm currently writing I need a new quest event which is thrown if the character is around a special position. The position can be fixed but the thing is that I don't know how to solve this without a even function (C++) which is checking the current position every second. I don't think that this is good for performance so is there any other possibillity? How is it done at portals, for example?

 

Regards

Link to comment
  • Answers 6
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

6 answers to this question

Recommended Posts

  • 0
int get_x() { return CQuestManager::instance().GetCurrentCharacterPtr()->GetX(); }
int get_y() { return CQuestManager::instance().GetCurrentCharacterPtr()->Get>(); }

For the timer you can look how it's defined at the timer functions in the questlua codes.

Link to comment
  • 0

I search for an other way. The way with the timer is, of course, a way to the solution but it's a bad one and I search for a better solution which is not as that performance-heavy.

 

Regards

Link to comment
  • 0

Because if you check e.g. for 500 players every second the position this should be performance-heavy, doesn't it?

 

Regards

Link to comment
  • 0

I will give a try but I thought this would be very performance-heavy if I check every second for ~500 players the coordinates (one time get them and check them to 8 other coordinates and use a DISTAMCE_APPROX for this). But okay. I will give a try :)

Regards

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Read our Rules
  • Activity

    1. 8

      WaveSystem

    2. 0

      error: unable to find library

    3. 19

      Race Height of Actors

    4. 2

      How to add Chromium Embedded Browser ?

    5. 2

      How to add Chromium Embedded Browser ?

    6. 2

      How to add Chromium Embedded Browser ?

    7. 1

      Fish stack catch

  • Recently Browsing

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.