Yiv 321 Posted May 19, 2014 Share Posted May 19, 2014 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 Share on other sites More sharing options...
Remix 45 Posted May 19, 2014 Share Posted May 19, 2014 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 Share on other sites More sharing options...
Yiv 321 Posted May 19, 2014 Author Share Posted May 19, 2014 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 Share on other sites More sharing options...
Remix 45 Posted May 19, 2014 Share Posted May 19, 2014 Why should it be performance-heavy? Link to comment Share on other sites More sharing options...
Yiv 321 Posted May 19, 2014 Author Share Posted May 19, 2014 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 Share on other sites More sharing options...
Remix 45 Posted May 19, 2014 Share Posted May 19, 2014 No. Link to comment Share on other sites More sharing options...
Yiv 321 Posted May 19, 2014 Author Share Posted May 19, 2014 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 Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now