SkyBlock v3
#51
It is possible, although not too comfortable, to interact with the UI in the plugins - you can catch the PLAYER_USING_BLOCK hook and let it cancel the action, then let it simulate the chest opening by itself - Lua can open any kind of UI window with any items, using the cLuaWindow class. That one provides the callbacks you need that MCS calls when the player clicks inside the window.
Reply
Thanks given by:
#52
(07-20-2014, 05:21 PM)xoft Wrote: It is possible, although not too comfortable, to interact with the UI in the plugins - you can catch the PLAYER_USING_BLOCK hook and let it cancel the action, then let it simulate the chest opening by itself - Lua can open any kind of UI window with any items, using the cLuaWindow class. That one provides the callbacks you need that MCS calls when the player clicks inside the window.

Yes but how do you avoid that the player can take items out of the chest?
Reply
Thanks given by:
#53
Using the cLuaWindow:SetOnSlotChanged function. You give it a callback that gets called when a slot changes.
Reply
Thanks given by:
#54
(07-20-2014, 06:30 PM)STR_Warrior Wrote: Using the cLuaWindow:SetOnSlotChanged function. You give it a callback that gets called when a slot changes.

The callback is not cancel-able: "Any returned values are ignored."
Reply
Thanks given by:
#55
Seadragon nah just updating, and going to set it up on different port.
Should have time tomorrow to finish it up.
Reply
Thanks given by:
#56
Okay haven't found a nice way for creating a inventory for challenges. Have tought and tried a few different ideas, but the main problem is to disallow the player to take the items out, there I haven't found any way.

Will need to wait for a hook, where I can get the player and cancel the event.
Reply
Thanks given by:
#57
You could use these 2 hooks:
HOOK_PLAYER_TOSSING_ITEM
http://mc-server.xoft.cz/LuaAPI/OnPlayer...gItem.html
HOOK_PRE_CRAFTING
http://mc-server.xoft.cz/LuaAPI/OnPreCrafting.html
after that, player are only able to move items inside of thiere inventory.
Reply
Thanks given by:
#58
I will change the challenge system. Adding levels that contains the challenges and you need then to finish all or a configurable amount to unlock next level. Like in that way.

Level 1:
  1. Challenge 1
  2. Challenge 2
  3. ...
Level 2:
  1. Challenge 1
  2. ...
Level 3:
  1. Challenge 1
  2. ...
Reply
Thanks given by:
#59
-- removed --
Reply
Thanks given by:
#60
Whaaaa? What happened? So sudden!
Reply
Thanks given by: NiLSPACE , tigerw




Users browsing this thread: 2 Guest(s)