• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Search results

  1. Non Sequitur

    Programmer Looking for Imbuiment System

    Do not trust the user @Lais Prad. This guy reached me to purchase my imbuing system, we agreed on a price and scheduled the exhange to happen yesterday (05/23). I helped him with some compilation errors and he thanked me for my services then left, never mentioning any problems. Today, barely 24...
  2. Non Sequitur

    Solved Lottery Ticket

    How come? I've written this simple program to count how many times each situation occurs out of 10e6 tests: local function test(n, out) for i = 1, n do local rand = math.random(100) out.total = out.total + 1 if rand <= 35 then -- won...
  3. Non Sequitur

    Simple Metamethods - lua

    You are using no metamethods at all. If you want more clarification, read the manual: http://www.lua.org/manual/5.1/manual.html#2.8 Your code is also semantically flawed, have you tried calling the second version of "getTasks" more than once? ghouls, slimes, necromancers, dwarves, amazons...
  4. Non Sequitur

    [TFS 1.2] Sending items to empty DP won't work

    The depot is only created when it's needed. You can force it to be created by calling getDepotChest(id, true). The true is the important piece you're missing.
  5. Non Sequitur

    Lua About Metatables

    You don't need to define the methods for every new object you create, you only need to do it once. I've made a helper function that you can use to implement the classes from TFS 1.2: function newClass(constructor) local methods = { } local MT = {__index = methods} local call =...
  6. Non Sequitur

    Regeneration Bug

    Add the following tags to your data/movements/movements.xml file: <movevent event="Equip" itemid="2542" slot="shield" level="75" function="onEquipItem"> <vocation name="Knight" /> <vocation name="Elite Knight" showInDescription="0" /> <vocation name="Paladin" /> <vocation...
  7. Non Sequitur

    Lua How to use global storage in TFS 1.2?

    If you are asking for help you should at least try to explain the problem you're facing. Simply stating that it "doesn't work" isn't helpful at all. Both the Game.getStorageValue and Game.setStorageValue are defined in the data\lib\core\game.lua file. However the values you set with them are...
  8. Non Sequitur

    Solved Function when remove all items remove the container

    I've just tested it and it works, are you sure the container is a backpack (id 1988)?
  9. Non Sequitur

    Solved Function when remove all items remove the container

    Try this: local parent = item:getParent() if fromPosition.x == CONTAINER_POSITION and parent.isContainer and parent:getId() == 1988 then if parent:getSize() <= 1 then parent:remove() end end
  10. Non Sequitur

    Lua Switch script

    walls should be local to onUse, otherwise you're indefinitely populating the same table over and over again, and walls[1] and walls[2] will always point to the same walls (the first ones to be inserted).
  11. Non Sequitur

    protocolgame in tfs 10.90

    msg.add<uint16_t>(std::ceil((static_cast<double>(player->getHealth()) / std::max<int32_t>(player->getPlayerInfo(PLAYERINFO_MAXHEALTH), 1)) * 100)); msg.add<uint16_t>(100);
  12. Non Sequitur

    protocolgame in tfs 10.90

    There is no official 10.9 TFS and you barely gave me any information, that is why I had to make assumptions - something that shouldn't happen in every single support thread that is made in this forum. Anyway, assuming - once again - that you're using djarek's cast system, you should have a...
  13. Non Sequitur

    protocolgame in tfs 10.90

    Try changing these lines: msg.add<uint16_t>(std::min<int32_t>(player->getHealth(), std::numeric_limits<uint16_t>::max())); msg.add<uint16_t>(std::min<int32_t>(player->getPlayerInfo(PLAYERINFO_MAXHEALTH), std::numeric_limits<uint16_t>::max())); To...
  14. Non Sequitur

    Lua TFS 1.2 Quest System Issue

    Yes, use "fromuid" and "touid".
  15. Non Sequitur

    Lua TFS 1.2 Quest System Issue

    It should print the player's name in the console as well, but it shouldn't appear in the text dialog, is that what is happening?
  16. Non Sequitur

    Lua TFS 1.2 Quest System Issue

    Can you use this line instead so we can see what is going on: local monsters = filter(Game.getSpectators(player:getPosition()), function(creature) print(creature:getName()); return creature:isMonster() end)
  17. Non Sequitur

    Solved 1.2 Actions script help, please

    local specs, spec = Game.getSpectators(config.centerRoomPosition, false, false, 20, 20, 20, 20) for i = 1, #specs do spec = specs[i] if spec:isPlayer() then player:sendTextMessage(MESSAGE_STATUS_SMALL, "A player is already inside the quest room.") return true end...
  18. Non Sequitur

    Lua TFS 1.2 Quest System Issue

    local function bind(func, ...) local args = {...} return function() return func(unpack(args)) end end local function filter(list, predicate) local ret = {} for _, v in ipairs(list) do if predicate(v) then table.insert(ret, v) end end...
  19. Non Sequitur

    Solved 1.2 Actions script help, please

    Why don't you try using the built-in Game.getSpectators? Game.getSpectators(position[, multifloor = false[, onlyPlayer = false[, minRangeX = 0[, maxRangeX = 0[, minRangeY = 0[, maxRangeY = 0]]]]]])
  20. Non Sequitur

    Compiling [TFS 1.2] Outifts and Mounts limit

    Well, in that case you need to find a way to edit this AVAILABLE_OUTFITS constant in the client. But even then I doubt it would work, the client is probably allocating an array with size 50, that is why the assertion is in place, if it tried to store more than 50 outfits, it would overflow the...
Back
Top