Jump to content

Casawir

Inactive Member
  • Posts

    51
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Casawir

  1. yes i did, but im not proud of my solution, and its not that short, u need to think about many cases what triggers and what can stop emotion ill post it later but its not quality code
  2. "c++11" code, a little bit optimised maybe someone will be interested; void CPythonPlayer::PickCloseItemVector() { CInstanceBase * pkInstMain = NEW_GetMainActorPtr(); if (!pkInstMain) return; TPixelPosition kPPosMain; pkInstMain->NEW_GetPixelPosition(&kPPosMain); CPythonItem& rkItem = CPythonItem::Instance(); std::vector<DWORD> itemlist{ rkItem.GetCloseItemVector(pkInstMain->GetNameString(), kPPosMain)}; if (itemlist.empty()) return; for (auto &i : itemlist) SendClickItemVectorPacket(i); } std::vector<DWORD> CPythonItem::GetCloseItemVector(const std::string & myName, const TPixelPosition & c_rPixelPosition) { DWORD dwCloseItemDistance = 1000 * 1000; std::vector<DWORD> itemlist; for (auto &i : m_GroundItemInstanceMap) { TGroundItemInstance * pInstance = i.second; DWORD dwxDistance = DWORD(c_rPixelPosition.x - pInstance->v3EndPosition.x); DWORD dwyDistance = DWORD(c_rPixelPosition.y - (-pInstance->v3EndPosition.y)); DWORD dwDistance = DWORD(dwxDistance*dwxDistance + dwyDistance * dwyDistance); if (dwDistance < dwCloseItemDistance && (pInstance->stOwnership == "" || pInstance->stOwnership == myName)) { itemlist.push_back(i.first); } } return itemlist; // moving vector not explicit } void CPythonPlayer::SendClickItemVectorPacket(DWORD dwIID) { if (IsObserverMode()) return; CPythonNetworkStream& rkNetStream = CPythonNetworkStream::Instance(); rkNetStream.SendItemPickUpPacket(dwIID); }
  3. 2 server attr doesnt match with client side map
  4. Addl aplha channel to you texture , do it properly u can see how.to make.it good, opening official armor textures in photoshop or.gimp
  5. He sold this for you he will fix it, if not make sure that noone will make deals with him again.
  6. How can i convert c++ map to python dictionary, for example std::map<std::string, int> mymap; mymap["key1"] = 50; mymap["key2"] = 20; mymap["key3"] = 100; i want to reclaim in python, self.mydictionary["key1"] = 50; self.mydictionary["key2"] = 20; self.mydictionary["key3"] = 100; Is this possible with metin2 included libraries? In worst case i would like to reclaim array as a list, not only get by loop.
  7. Hi how can i send vector with elements contained, to client using packets?
  8. Hi, i have got a problem, when i make alpha channel in my dds texture then my model is transparent in places where alpha channel is maximally black, any solution?
  9. Hi could someone send me their function item_select_cell beacouse mine is choosing 0
  10. With this changes i wrote in tutorial u dont need to change Makefile, but im not sure it might be depended on FreeBSD version. Maybe your problem with small changes is caused of not clearing,deleting .o files before compilation,
  11. Install ccache # cd /usr/ports/devel/ccache && make install clean or # pkg_add -r ccache THEN: # ee /etc/make.conf PASTE IN THIS: .if !defined(NO_CCACHE) CC= /usr/local/libexec/ccache/world-cc CXX= /usr/local/libexec/ccache/world-c++ .endif .if ${.CURDIR:M*/ports/devel/ccache} NO_CCACHE= yes .endif SAVE AND CLOSE. THEN: # ee /.cshrc PASTE IN THIS: # set ccache varibles setenv PATH /usr/local/libexec/ccache:$PATH setenv CCACHE_PATH /usr/bin:/usr/local/bin setenv CCACHE_DIR /var/tmp/ccache setenv CCACHE_LOGFILE /var/log/ccache.log # set ccache temp size to 512MB (default 1GB) if ( -x /usr/local/bin/ccache ) then /usr/local/bin/ccache -M 512M > /dev/null endif SAVE AND CLOSE. THEN: # source /.cshrc RESTART MAY BE REQUIRED With this command we can check usage of memory: # ccache -s MANUAL [Hidden Content]
  12. float time_calc = (time*pkVictim->GetPoint(POINT_IMMUNE_STUN))/100; pkVictim->ChatPacket(CHAT_TYPE_PARTY, "%f, %d", time_calc, pkVictim->GetPoint(POINT_IMMUNE_STUN)); For example: time = 4 - int POINT_IMMUNE_STUN = 90 - int so technically i should get on chat this one: 3.60000 , 90 but instead of this im getting: 3.00000 , 90 any solution? Im newbie in cpp
  13. Well im not good as tutorial maker, but u can ask for whatever u want and i will explain as good.as i can
  14. I want to change this part of code: to check if player got immune_fall - bonus( beacouse it doesnt work, maybe u got better solution to fix that bonus ? ) To do that thing i need to call function from PythonPlayer, but i cannot include header file because i get these errors: 1>d:serwersourcemainline_releaseduserinterfaceAbstractPlayer.h(42): error C2061: syntax error : identifier 'TItemPos' 1>d:serwersourcemainline_releaseduserinterfacePacket.h(608): error C2065: 'CHARACTER_NAME_MAX_LEN' : undeclared identifier 1>d:serwersourcemainline_releaseduserinterfacePacket.h(608): warning C4200: nonstandard extension used : zero-sized array in struct/union 1> Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array 1>d:serwersourcemainline_releaseduserinterfacePacket.h(615): error C2065: 'CHARACTER_NAME_MAX_LEN' : undeclared identifier 1>d:serwersourcemainline_releaseduserinterfacePacket.h(615): warning C4200: nonstandard extension used : zero-sized array in struct/union 1> Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array 1>d:serwersourcemainline_releaseduserinterfacePacket.h(632): error C2146: syntax error : missing ';' before identifier 'pos' 1>d:serwersourcemainline_releaseduserinterfacePacket.h(632): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>d:serwersourcemainline_releaseduserinterfacePacket.h(1785): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>d:serwersourcemainline_releaseduserinterfacePacket.h(1787): error C2065: 'ITEM_SOCKET_SLOT_MAX_NUM' : undeclared identifier 1>d:serwersourcemainline_releaseduserinterfacePacket.h(1788): error C2146: syntax error : missing ';' before identifier 'aAttr' and so on
  15. I get error, propably caused by circural dependency. I mean when i include PythonPlayer.h in ActorInstanceSync.cpp im getting weird errors
  16. Hi, is this possible to get function from another header file without inluding it, so i can avoid circural dependency.
  17. Hi, is this possible to get function from another header file without inluding it, so i can avoid circural dependency.
  18. Hi does anyone had/solved problem with crashing core after creating party? My problem is: when i create party after about 5 seconds my core crashes and im not sure if its just my editions or there was problem with dat. Im using mainline_released
  19. solved, if someone will have the same problem after changing python version, if nothing works just try removing last character ( replacing doesnt work) [:-1]
  20. As in topic for example: ida = self.idEditLine.GetText() pwd = self.pwdEditLine.GetText() f = open("IOPS/saved_accounts/account" + str(id) + ".cfg", "w") f.write (ida +"n") f.write (pwd) f.close() login = linecache.getline("IOPS/saved_accounts/account" + str(id) + ".cfg", 1) password = linecache.getline("IOPS/saved_accounts/account" + str(id) + ".cfg", 2) login.strip() password.strip() self.PopupNotifyMessage(password+login+password) we get message with spaces between.
  21. well i get, That these errors are useless shit, and doesnt matter. Something else must be wrong beacouse in relase mode errors dont appear client just crashes. But i will try that one with skilltable cos i forgot that error xD
  22. @refresh This is the syserr - short version ofc; I Can't work out whats up ;x 0303 15:09:05838 :: CResourceManager::GetResourcePointer: File not exist d:/ymir work/item/weapon/05120.gr2 0303 15:09:05840 :: CResourceManager::GetResourcePointer: File not exist d:/ymir work/item/weapon/05170.gr2 0303 15:09:05920 :: Polska Wersja(#2 ) cannot find icon file. setting to default. 0303 15:09:05929 :: Tarcza Ocalenia+0(#13070) cannot find icon file. setting to default. 0303 15:09:05929 :: Tarcza Ocalenia+1(#13071) cannot find icon file. setting to default. 0303 15:09:06581 :: CANNOT_FIND_PACK_FILE [sound/effect/etc/dust/dust.mss] 0303 15:09:06584 :: CANNOT_FIND_PACK_FILE [sound/effect/etc/dust/running_dust.mss] 0303 15:09:06596 :: CANNOT_FIND_PACK_FILE [sound/effect/etc/recuperation/drugup_red.mss] 0303 15:09:06601 :: CANNOT_FIND_PACK_FILE [sound/effect/etc/recuperation/drugup_blue.mss]
×
×
  • 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.