Jump to content

Recommended Posts

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
https://metin2.dev/topic/1318-c-checking-current-coordinates/
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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.

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

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.