Jump to content

HueHue

Member
  • Posts

    19
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by HueHue

  1. Hi,
    My game crashes while being on the devils catacomb and I have this error:

    0418 11:42:25494 :: CEffectManager::RegisterEffect - LoadScript(d:/ymir work/effect/background/tent_s_lamp.mse) Error
    0418 11:42:25494 :: CArea::SetEffect effect register error d:/ymir work/effect/background/tent_s_lamp.mse

    From what can I see I'm missing a file called tent_s_lamp.mse.
    Does anyone have it or are there any other ways to fix it?

  2. Hi,
    Is there a way to create a small chat window that is separate from the main one (like next to it) that shows the amount of Yang that we received and the amount of experience that we gained from the mob.
    I mean probably there is but is it really difficult or has there been already a topic that has both Yang and exp.

  3. 4 hours ago, Owsap said:

    Although I'm not entirely sure why you would want something like this, I will leave you an example for items.

    Python Method Only

      Reveal hidden contents
    ''' 1. @ root/game.py '''
    # Search
    		onPressKeyDict[app.DIK_F] = lambda : self.__PressFKey()
    
    # Add below
    		onPressKeyDict[app.DIK_TAB] = lambda : self.__PressTABKey()
    
    # Search
    	def __PressFKey(self):
    
    # Add below
    	def __PressTABKey(self):
    		if self.interface:
    			self.interface.UseInventoryItem(50053)
    
    ''' 2. @ root/interfaceModule.py '''
    # Search
    if __name__ == "__main__":
    
    # Add above
    	def UseInventoryItem(self, itemVNum):
    		self.wndInventory.UseItem(itemVNum)
    
    ''' 3. @ root/uiInventory.py '''
    # Search
    	def UseItemSlot(self, slotIndex):
    
    # Add above
    	def UseItem(self, itemVNum):
    		if player.GetItemCountByVnum(itemVNum) <= 0:
    			return
    
    		getItemVNum = player.GetItemIndex
    		for i in xrange(player.INVENTORY_PAGE_SIZE):
    			slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
    			if getItemVNum(slotNumber) == itemVNum:
    				self.UseItemSlot(slotNumber)
    				break

     

    Python & C++ Method

      Reveal hidden contents
    ''' 1. @ root/game.py '''
    # Search
    		onPressKeyDict[app.DIK_F] = lambda : self.__PressFKey()
    
    # Add below
    		onPressKeyDict[app.DIK_TAB] = lambda : self.__PressTABKey()
    
    # Search
    	def __PressFKey(self):
    
    # Add below
    	def __PressTABKey(self):
    		net.SendChatPacket("/use_item_vnum 50053")
    /// 2. @ game/src/cmd.cpp
    // Search
    ACMD(do_use_item);
    
    // Add below
    ACMD(do_use_item_vnum);
    
    // Search
    	{ "use_item", do_use_item, 0, POS_DEAD, GM_LOW_WIZARD },
    
    // Add below
    	{ "use_item_vnum", do_use_item, 0, POS_DEAD, GM_PLAYER },
    
    /// 3. @ game/src/cmd_general.cpp
    // Add to the bottom of the document
    ACMD(do_use_item_vnum)
    {
    	char szArg[256];
    	one_argument(argument, szArg, sizeof(szArg));
    
    	DWORD dwVNum = 0;
    	str_to_number(dwVNum, szArg);
    
    	LPITEM pItem = ch->FindSpecifyItem(dwVNum);
    	if (pItem == nullptr)
    		return;
    
    	if (pItem->GetCount() > 0)
    		ch->UseItem(TItemPos(INVENTORY, pItem->GetCell()));
    }

     

    I did not test before posting, excuse me if something goes wrong.

    Oh man that "Python Method Only" works PERFECTLY!
    Thank you soooo much i really appreciate it!

    5 hours ago, Owsap said:

    Although I'm not entirely sure why you would want something like this, I will leave you an example for items.

    Python Method Only

      Reveal hidden contents
    ''' 1. @ root/game.py '''
    # Search
    		onPressKeyDict[app.DIK_F] = lambda : self.__PressFKey()
    
    # Add below
    		onPressKeyDict[app.DIK_TAB] = lambda : self.__PressTABKey()
    
    # Search
    	def __PressFKey(self):
    
    # Add below
    	def __PressTABKey(self):
    		if self.interface:
    			self.interface.UseInventoryItem(50053)
    
    ''' 2. @ root/interfaceModule.py '''
    # Search
    if __name__ == "__main__":
    
    # Add above
    	def UseInventoryItem(self, itemVNum):
    		self.wndInventory.UseItem(itemVNum)
    
    ''' 3. @ root/uiInventory.py '''
    # Search
    	def UseItemSlot(self, slotIndex):
    
    # Add above
    	def UseItem(self, itemVNum):
    		if player.GetItemCountByVnum(itemVNum) <= 0:
    			return
    
    		getItemVNum = player.GetItemIndex
    		for i in xrange(player.INVENTORY_PAGE_SIZE):
    			slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i)
    			if getItemVNum(slotNumber) == itemVNum:
    				self.UseItemSlot(slotNumber)
    				break

     

    Python & C++ Method

      Reveal hidden contents
    ''' 1. @ root/game.py '''
    # Search
    		onPressKeyDict[app.DIK_F] = lambda : self.__PressFKey()
    
    # Add below
    		onPressKeyDict[app.DIK_TAB] = lambda : self.__PressTABKey()
    
    # Search
    	def __PressFKey(self):
    
    # Add below
    	def __PressTABKey(self):
    		net.SendChatPacket("/use_item_vnum 50053")
    /// 2. @ game/src/cmd.cpp
    // Search
    ACMD(do_use_item);
    
    // Add below
    ACMD(do_use_item_vnum);
    
    // Search
    	{ "use_item", do_use_item, 0, POS_DEAD, GM_LOW_WIZARD },
    
    // Add below
    	{ "use_item_vnum", do_use_item, 0, POS_DEAD, GM_PLAYER },
    
    /// 3. @ game/src/cmd_general.cpp
    // Add to the bottom of the document
    ACMD(do_use_item_vnum)
    {
    	char szArg[256];
    	one_argument(argument, szArg, sizeof(szArg));
    
    	DWORD dwVNum = 0;
    	str_to_number(dwVNum, szArg);
    
    	LPITEM pItem = ch->FindSpecifyItem(dwVNum);
    	if (pItem == nullptr)
    		return;
    
    	if (pItem->GetCount() > 0)
    		ch->UseItem(TItemPos(INVENTORY, pItem->GetCell()));
    }

     

    I did not test before posting, excuse me if something goes wrong.

    Just one more thing the "Python Method Only" works only on the 1st inventory page.
    How to change it so that it will work on all 4 inventory pages.

  4. 8 hours ago, xTryhard said:

    yes you can do this go to game.py create a function with your key send this to the server check if you have this item id in your inventory and if you have it do what you want and send it back to the client

    Ok that's great but could you or someone help me to write the code for this as I have never done something like this before.
    All i know is that i need to use this command in game.py

    onPressKeyDict[app.DIK_TAB]	= lambda : self?????

    So basically what I want to have is when i press Tab key an item 50053 is being used.
    Thank you in advance.

×
×
  • 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.