Jump to content

VegaS™

Forum Moderator
  • Posts

    656
  • Joined

  • Last visited

  • Days Won

    187
  • Feedback

    100%

Everything posted by VegaS™

  1. As the title says, here's the simple method how you can skip the video without waiting until is finished, like official did long time ago. Here're the constants value for virtual-key codes (hexadecimal values), right now these are by default: VK_LBUTTON 0x01 - Left mouse button VK_ESCAPE 0x1B - ESC key VK_SPACE 0x20 - SPACEBAR Srcs/Client/UserInterface/Locale_inc.h Srcs/Client/UserInterface/MovieMan.cpp [Hidden Content]
  2. root/introLogo.py self.videoList = ["logo1.avi", "logo2.avi"] [....] self.playingVideo = app.OnLogoOpen(self.videoList[self.nextLogoIndex])
  3. Instead of repeating yourself in every reply that the code is bullshit, how about showing us your coding skills and let us criticize it too? I'm sure that i'll have a lot of fun, and not only me. ? Btw, is funny how you're talking about shit code and say to people 'learn how to code', when you do this:
  4. @cjunior2011 @Syriza @nonnorulez [Hidden Content]
  5. Thanks for release, the idea isn't bad, but there're some bad things. I'll show you the problems part and how can be improved, there're just advices, i hope you'll get them. def __del__(self): if len(self.eventList) > 0: self.eventList.clear() If you're using Python 2+ or Python 3.2 and below, you can't use the clear() method (allowed on 3.3+), also as i said in the second message you don't need to check the length of the list, already the clear() method doing that inside and there's no reason to put it to __del__ method, it will be called when the object is garbage collected. if you really want to use in future, something outside of this and want just to check the list if isn't empty, is enough to do it just with if some_list, like a normal boolean, there no need to check the length of the list if you don't use it in your code. if len(self.eventList) > 0: for j in xrange(len(self.eventList)): [...] You don't have to check the list if you already did a numeric range loop or iterator based loop. app.GetTime() + time I would say to use app.GetGlobalTimeStamp() instead of app.GetTime(), if you teleport while the event is running, the event function will run after 10 seconds like. While app.GetGlobalTimeStamp() will run after the specific time, because is the server timestamp and is updated on each enter in game. if i == 0: self.eventList[j].clear() I would put here an big exclamation, with this you creating 999999999 lines in syserr, what you do here is like: While Process() function is called in OnUpdate, so, your condition trying to get the returned value from an specific function, what means the next update time or 0 to destroy the event/clear it. Everything's fine until you return 0 and event should be stopped yes? But there is a problem, you clear the specific dictionary of event and still remained in the list [{}], and the Process() function will take your self.eventList with the items included, the empty dictionaries from your events, and of course even if you've [{}, {}, {}], that doesn't mean your list is empty, have 3 items, so, the loop will trying to read an empty dictionary and you'll get key errors in each milisecond. The method which you need is to delete the dictionary itself from the list after the result value from the function is 0, like this: _______________________________________ I wrote fast some self extensions, if somebody is interested i'll do another updates in the next days. You can use unlimited arguments on functions, now is using the apply method which returns the result of a function or class object called with supplied arguments, with the old structure you could use just one argument. You can lock/unlock an event for being processed, it's like a prevent in some actions, if the event is created and you want to do something, you should lock the event, do some actions then you can unlock it again and the process function will run where remained. Delete an event instantly and force it to stop the process. Adding return t.EXIT inside of the running function, will delete the event too. Functions to check if an event exists or is locked or not. Check if the function is a method type. Delete the events with a properly method. Using app.GetGlobalTimeStamp() now will give you the chance to run the event after teleport where timer remained instantly. _______________________________________ The code: [Hidden Content] PS: Don't quote this reply, will be updated.
  6. (2.4) Content Don't post commercial stuff others made and/or sell commercial stuff others made.
  7. @ReFresh You used a small extension which i did for you 3 years ago. If somebody still have this problem, you need to check the key of the dictionary like: [Hidden Content]
  8. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) I added two years ago a small function that allow you to make a struct like C++ for different purposes. # Example #1 pack = ui.RegisterStructClass('a b c')(15, {}, []) pack.a += 50 pack.b.update({0: 250}) pack.c.append(100) print (pack.a, pack.b, pack.c) # Example #2. def Transfer(self, p): print(p.szName, p.lX, p.lY) self.Transfer(ui.RegisterStructClass('szName lX lY')(GetName(), GetX(), GetY())) # Example #3. config = ui.RegisterStructClass('width height default_size_dict rank_list text')(450, 300, {'w': 400, 'h': 500}, [1, 2, 3], 'Metin2') print ( config.width, config.height, config.text, config.default_size_dict.get('w'), config.default_size_dict.get('h'), config.rank_list ) Repository: [Hidden Content]
  9. Updated v1.1 - Fixed limited string format
  10. No, you need to add the condition before inserting the entity. Don't forget: entity_view.cpp #include "OXEvent.h" service.h #define HIDDEN_OX
  11. [Hidden Content] if (m_pkMobData->m_table.dwVnum == 2493 || m_pkMobData->m_table.dwVnum == 2499)
  12. UserInterface/AbstractPlayer.h Try to include: #include "GameType.h"
  13. The idea isn't so bad, but the code has too many useless lines, here's what you can do to improve it. def RefreshPickupFilter(self): #Weapon if systemSetting.IsPickUpFilterWeapon(): self.PickUpFilterList[0].Down() else: self.PickUpFilterList[0].SetUp() #Armor if systemSetting.IsPickUpFilterArmor(): self.PickUpFilterList[1].Down() else: self.PickUpFilterList[1].SetUp() #Ear if systemSetting.IsPickUpFilterEar(): self.PickUpFilterList[2].Down() else: self.PickUpFilterList[2].SetUp() #Neck if systemSetting.IsPickUpFilterNeck(): self.PickUpFilterList[3].Down() else: self.PickUpFilterList[3].SetUp() #Foots if systemSetting.IsPickUpFilterFoots(): self.PickUpFilterList[4].Down() else: self.PickUpFilterList[4].SetUp() #Shield if systemSetting.IsPickUpFilterShield(): self.PickUpFilterList[5].Down() else: self.PickUpFilterList[5].SetUp() #Book if systemSetting.IsPickUpFilterBook(): self.PickUpFilterList[6].Down() else: self.PickUpFilterList[6].SetUp() #Stone if systemSetting.IsPickUpFilterStone(): self.PickUpFilterList[7].Down() else: self.PickUpFilterList[7].SetUp() #Etc if systemSetting.IsPickUpFilterEtc(): self.PickUpFilterList[8].Down() else: self.PickUpFilterList[8].SetUp() To: def RefreshPickupFilter(self): checkFilterList = ( systemSetting.IsPickUpFilterWeapon(), systemSetting.IsPickUpFilterArmor(), systemSetting.IsPickUpFilterEar(), systemSetting.IsPickUpFilterNeck(), systemSetting.IsPickUpFilterFoots(), systemSetting.IsPickUpFilterShield(), systemSetting.IsPickUpFilterBook(), systemSetting.IsPickUpFilterStone(), systemSetting.IsPickUpFilterEtc() ) for child, flag in zip(self.PickUpFilterList, checkFilterList): if flag: child.Down() else: child.SetUp() self.PickUpFilterList.append(GetObject("Pick_Up_FilterWeapon")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterArmor")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterEar")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterNeck")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterFoots")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterShield")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterBook")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterStone")) self.PickUpFilterList.append(GetObject("Pick_Up_FilterEtc")) To: for name in ('Weapon','Armor','Ear','Neck','Foots','Shield','Book','Stone','Etc'): self.PickUpFilterList.append(GetObject("Pick_Up_Filter{}".format(name))) self.PickUpFilterList[0].SetToggleUpEvent(self.__OnClickPickupFilterButtonWeapon) # Weapon self.PickUpFilterList[0].SetToggleDownEvent(self.__OnClickPickupFilterButtonWeapon) # Weapon self.PickUpFilterList[1].SetToggleUpEvent(self.__OnClickPickupFilterButtonArmor) # Armor self.PickUpFilterList[1].SetToggleDownEvent(self.__OnClickPickupFilterButtonArmor) # Armor self.PickUpFilterList[2].SetToggleUpEvent(self.__OnClickPickupFilterButtonEar) # Ear self.PickUpFilterList[2].SetToggleDownEvent(self.__OnClickPickupFilterButtonEar) # Ear self.PickUpFilterList[3].SetToggleUpEvent(self.__OnClickPickupFilterButtonNeck) # Neck self.PickUpFilterList[3].SetToggleDownEvent(self.__OnClickPickupFilterButtonNeck) # Neck self.PickUpFilterList[4].SetToggleUpEvent(self.__OnClickPickupFilterButtonFoots) # Foots self.PickUpFilterList[4].SetToggleDownEvent(self.__OnClickPickupFilterButtonFoots) # Foots self.PickUpFilterList[5].SetToggleUpEvent(self.__OnClickPickupFilterButtonShield) # Shield self.PickUpFilterList[5].SetToggleDownEvent(self.__OnClickPickupFilterButtonShield) # Shield self.PickUpFilterList[6].SetToggleUpEvent(self.__OnClickPickupFilterButtonBook) # Books self.PickUpFilterList[6].SetToggleDownEvent(self.__OnClickPickupFilterButtonBook) # Books self.PickUpFilterList[7].SetToggleUpEvent(self.__OnClickPickupFilterButtonStone) # Stone self.PickUpFilterList[7].SetToggleDownEvent(self.__OnClickPickupFilterButtonStone) # Stone self.PickUpFilterList[8].SetToggleUpEvent(self.__OnClickPickupFilterButtonEtc) # Etc self.PickUpFilterList[8].SetToggleDownEvent(self.__OnClickPickupFilterButtonEtc) # Etc To: eventFuncList = ( self.__OnClickPickupFilterButtonWeapon, self.__OnClickPickupFilterButtonArmor, self.__OnClickPickupFilterButtonEar, self.__OnClickPickupFilterButtonNeck, self.__OnClickPickupFilterButtonFoots, self.__OnClickPickupFilterButtonShield, self.__OnClickPickupFilterButtonBook, self.__OnClickPickupFilterButtonStone, self.__OnClickPickupFilterButtonEtc ) for child, event in zip(self.PickUpFilterList, eventFuncList): child.SetToggleUpEvent(event) child.SetToggleDownEvent(event)
  14. There's no check for victim pointer. // Replace: if (pkVictim->GetParty()) // With: if (pkVictim && pkVictim->GetParty())
  15. Let's don't kill the source with dozens of useless lines and duplicated. const bool bAttacking = (get_dword_time() - pkAttacker->GetLastAttackTime()) < pkAttacker->IsRiding() ? 800 : 700; if (!bAttacking) return BATTLE_NONE;
  16. Since already is a check for distance, is impossible that the entity to be in another map, so is enough to check if you're in the map. [Hidden Content]
  17. I didn't tested the bug, but you can try something like this: Srcs/Server/game/src/questmanager.cpp [Hidden Content]
  18. Check if passed 10 seconds after the action for: Safebox, exchange, shop, refine Check if the window is open: Exchange, shop, private shop, safebox, cube How-To-Use: (already a lot of metin2 quests using this)
  19. std::string g_strEffectName = "d:/ymir work/effect/etc/direction/direction_land.mse";
×
×
  • 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.