• 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!

Whi World - Open Source Server with Configurable Features

I have NEVER seen or heard of a modern language (that had if statements) that didn't have short-circuit evaluation, so this:
Code:
if cond1 then
    if cond2 then
        doSth()
    end
end

is EXACTLY IDENTICAL to this:

Code:
if cond1 and cond2 then
    doSth()
end
no its not.

function cond1() print("NOT") return false end
function cond2() print("REALLY") end
function doSth() print("BRAH!") end

Code:
if cond1 then
    if cond2 then
        doSth()
    end
end
print: NOT

Code:
if cond1 and cond2 then
doSth()
end
print: NOT, REALLY
 
The whole "cone-shaped script" could most likely be shortened while doing the same exact thing from the script, but if you keep it "cone-shaped" with a ton of ifs, I would think it would be a little easier to add new things into the script, or remove certain parts of it since the large amount of ifs in it make each line of the script very easy to see what that line is doing in the script.

Though it's most likely possible to shorten the script by quite a bit and still be able to add/remove/edit everything that the script is doing with having the same results. This would, of course, ease the load on the server reading such a long script.
 
no its not.

function cond1() print("NOT") return false end
function cond2() print("REALLY") end
function doSth() print("BRAH!") end

Code:
if cond1 then
    if cond2 then
        doSth()
    end
end
print: NOT

Code:
if cond1 and cond2 then
doSth()
end
print: NOT, REALLY

There is a difference between cond1 and cond1(). The former evaluates to a value of type `function` which can be treated as true and the former calls the function that returns false. So your example fails to prove short-circuit evaluation doesn't work in lua.
 
There is a difference between cond1 and cond1(). The former evaluates to a value of type `function` which can be treated as true and the former calls the function that returns false. So your example fails to prove short-circuit evaluation doesn't work in lua.
oh cool.
Didn't know that.
Seemed kind of logical that it will execute entire line at once xD
Guess not :D
 
Whi World PATCH 0.1.4.4.5

SkillTree:
thunderstruck: nerfed formula from [(base physical damage - 300) * [stack]] to [(base physical damage - 333) * [stack]]

Spells:
Almost all spells cooldowns have been increased by 1 or 2 seconds

NPC's:
Liam:
Testing new NPC system
Peeter: Testing new NPC system

Monsters:
Cyclops: increase small stone drop chance
Big Daddy: increase small stone drop chance

Damage System:
some monsters now have minimum damage. Even if you gear or spells block the damage to point you should take no dmg, monsters with minimum damage will still deal the minimum damage value

Tasks:
fixed bug where sometimes players in team got task twice

BUG FIXES:
Fixed major bug where players couldn't continue tutorial because rails were broken.
 
yeah, as i said. slow slow slow xD.
Well making QuestCreating System.

Making all the current quests I have in game, on a single table and with similar functions.
This is also required for Lore System.

Positive is that: No longer amazing quest making will take an ENTIRE DAY if not 2!!
If I get this system down right, what I WILL! I can pump out über cool quests in pace of 1 per 2 hours!!

BTW:
When new players who still follow this forum and waiting another good patch when to try this server.
Then wait for Patch 0.1.4.4.6
Then npc's will give hints how to do quests. Right now it can be hard to understand how to make a quest.

What you think about these quests? (Forest Quest, Bandit Quest, Cyclops Quest, Hehemi Quest)
These example quest I could do in ~20mins with QuestCreating System.

But if you want to start with big blast with friends and competition then wait for patch 0.1.5.1
Then i will start making South of Forgotten Village which is roamed by skeletons.
Almost like dummy's but about twice as hard. AND SEVERAL AT ONCE :D
Anywho. In South Forgotten Village there is dungeon: "Rooted Catombs"
This dungeon will contain 5 quests and lore-boss if quests completed.

Mages will get huge rework (no longer multiple energy and death spells) instead the distance and reach can be manipulated in skillTree and with items (some current items will get improvements)
Knights formulas will be changed around a bit.
Other than that: new and most likely last basic spells will be added to game.
Inane amount new items: each new monster will drop 8 items!!
New monsters: Skeleton, Ghoul, Warrior Skeleton, Ghost, noIdeaxD, and last but not least the solo-Boss: Demon Skeleton

After that, well Archer class and pvp :3
 
I have NEVER seen or heard of a modern language (that had if statements) that didn't have short-circuit evaluation, so this:
Code:
if cond1 then
    if cond2 then
        doSth()
    end
end

is EXACTLY IDENTICAL to this:

Code:
if cond1 and cond2 then
    doSth()
end

No it is not.

At least in LUA:
Code:
if cond1 then -- If this is false
    if cond2 then -- It will not check condition 2 (saving cpu usage)
        doSth()
    end
end

Code:
if cond1 and cond2 then -- It will check both functions every time
    doSth()
end

In Whitevo's function, This is the difference between doing 11 functions on multiple IDs, or doing only the necessary functions..

That can be the difference of thousands of lines of code being run each time he calls that function.
 
No it is not.

At least in LUA:
Code:
if cond1 then -- If this is false
    if cond2 then -- It will not check condition 2 (saving cpu usage)
        doSth()
    end
end

Code:
if cond1 and cond2 then -- It will check both functions every time
    doSth()
end

In Whitevo's function, This is the difference between doing 11 functions on multiple IDs, or doing only the necessary functions..

That can be the difference of thousands of lines of code being run each time he calls that function.

OMG, how hard is it to tell the difference between evaluating the function as a value and evaluating the return value of the function call? The code in your post calls neither cond1 nor cond2. If you run this:
Code:
function cond1(val)
  print("cond1")
  return val
end

function cond2(val)
  print("cond2")
  return val
end

function doSth()
  print("doSTH!")
end

if cond1 and cond2 then
  doSth()
end

if cond1 ~= nil and cond1 ~= false then
  print("Function values evaluate to true")
end

if cond1(false) and cond2(true) then
  doSth()
end
You will see that cond2 is NOT called in the last conditional.
 
OMG, how hard is it to tell the difference between evaluating the function as a value and evaluating the return value of the function call? The code in your post calls neither cond1 nor cond2. If you run this:
Code:
function cond1(val)
  print("cond1")
  return val
end

function cond2(val)
  print("cond2")
  return val
end

function doSth()
  print("doSTH!")
end

if cond1 and cond2 then
  doSth()
end

if cond1 ~= nil and cond1 ~= false then
  print("Function values evaluate to true")
end

if cond1(false) and cond2(true) then
  doSth()
end
You will see that cond2 is NOT called in the last conditional.

So your saying for example if I had:
Code:
local function isPlayersStorageOver50(cid, storage)
  local storage = getPlayerStorageValue(cid, storage)
  if storage > 50 then
     return true
  end
  return false
end

local function isPlayerStorageUnder100(cid, storage)
  local storage = getPlayerStorageValue(cid, storage)
  if storage < 100 then
     return true
  end
  return false
end

local function isPlayerStorageWithinRange(cid, storage)
  if isPlayerStorageOver50(cid, storage) and isPlayerStorageUnder100(cid, storage) then -- If first function returns false, 2nd function will not run??
     return true
  end
return false
end

Because I know for a FACT that I can do the following and the 2nd check will run every single time no matter what the 1st thing is.
Code:
if (isPlayer(cid) and "sandwich" == 25) then
  return true
end

I call bullshit. But i'll test it myself, and if it is bullshit, i'm going to call you on your bullshit. and then laugh at you for spouting bullshit at me.
If I am wrong (I don't think I am), I will apologize and say "Hey, I was wrong for once".

But again, I doubt it, because I have had hundreds of times where I had to use multiple If lines to avoid errors caused by checking multiple functions true/false values.
An example would be a function that can have both monsters and players run through.
So you'd do:
Code:
if isPlayer(cid) and isKnight(cid) then
  return true
end
But, calling the function "isKnight" causes errors because it is calling the function made for Players on a Monster giving you an error exported to your console. EVEN if isPlayer(cid) is false, it will still do the isKnight(cid) function and cause errors. FORCING you to two separate If statements to avoid constant LUA errors posting to your console.

PS: Sorry for being off topic of the thread! Just hate it that any time any person on all of OT-Land posts a script, there are always a few people calling them an idiot, instead of encouraging them to keep going.
 
Last edited:
So your saying for example if I had:

[...]
Because I know for a FACT that I can do the following and the 2nd check will run every single time no matter what the 1st thing is.
[...]
I call bullshit. But i'll test it myself, and if it is bullshit, i'm going to call you on your bullshit. and then laugh at you for spouting bullshit at me.
If I am wrong (I don't think I am), I will apologize and say "Hey, I was wrong for once".

But again, I doubt it, because I have had hundreds of times where I had to use multiple If lines to avoid errors caused by checking multiple functions true/false values.
An example would be a function that can have both monsters and players run through.
So you'd do:
Code:
if isPlayer(cid) and isKnight(cid) then
  return true
end
But, calling the function "isKnight" causes errors because it is calling the function made for Players on a Monster giving you an error exported to your console. EVEN if isPlayer(cid) is false, it will still do the isKnight(cid) function and cause errors. FORCING you to two separate If statements to avoid constant LUA errors posting to your console.

PS: Sorry for being off topic of the thread! Just hate it that any time any person on all of OT-Land posts a script, there are always a few people calling them an idiot, instead of encouraging them to keep going.
I find it funny that you accuse me of spreading bullshit, yet, you haven't taken the time to refute my claims by running the code on something more reliable than your brain.
I guess you should go to the lua mailing lists and tell them that their compiler spouts bullshit, because both discussed language constructs compile to EXACTLY the same bytecode. I'd also prefer if you didn't put words into my mouth - I've never used the word "idiot" anywhere in this thread. All I did was ask if the author knew that he could make the code more readable by using short-circuit evaluation. It's the last post I'm going to make here about this one particular topic. And for future reference - this code:
function cond1(val)
print("cond1")
return val
end

function cond2(val)
print("cond2")
return val
end

function doSth()
print("doSTH!")
end

function test_sce()
if cond1(false) and cond2(true) then
doSth()
end
end

function test_no_sce()
if cond1(false) then
if cond2(true) then
doSth()
end
end
end
compiles to this bytecode:
0002 KSTR 2 1 ; "cond2"
0003 CALL 1 1 2
0004 RET1 0 2

-- BYTECODE -- test_sce.lua:11-13
0001 GGET 0 0 ; "print"
0002 KSTR 1 1 ; "doSTH!"
0003 CALL 0 1 2
0004 RET0 0 1

-- BYTECODE -- test_sce.lua:15-19
0001 GGET 0 0 ; "cond1"
0002 KPRI 1 1
0003 CALL 0 2 2
0004 ISF 0
0005 JMP 1 => 0013
0006 GGET 0 1 ; "cond2"
0007 KPRI 1 2
0008 CALL 0 2 2
0009 ISF 0
0010 JMP 1 => 0013
0011 GGET 0 2 ; "doSth"
0012 CALL 0 1 1
0013 => RET0 0 1

-- BYTECODE -- test_sce.lua:21-27
0001 GGET 0 0 ; "cond1"
0002 KPRI 1 1
0003 CALL 0 2 2
0004 ISF 0
0005 JMP 1 => 0013
0006 GGET 0 1 ; "cond2"
0007 KPRI 1 2
0008 CALL 0 2 2
0009 ISF 0
0010 JMP 1 => 0013
0011 GGET 0 2 ; "doSth"
0012 CALL 0 1 1
0013 => RET0 0 1

-- BYTECODE -- test_sce.lua:0-28
0001 FNEW 0 0 ; test_sce.lua:1
0002 GSET 0 1 ; "cond1"
0003 FNEW 0 2 ; test_sce.lua:6
0004 GSET 0 3 ; "cond2"
0005 FNEW 0 4 ; test_sce.lua:11
0006 GSET 0 5 ; "doSth"
0007 FNEW 0 6 ; test_sce.lua:15
0008 GSET 0 7 ; "test_sce"
0009 FNEW 0 8 ; test_sce.lua:21
0010 GSET 0 9 ; "test_no_sce"
0011 RET0 0 1
As you can see test_sce() and test_no_sce() compile to the same bytecode.
 
Omy that knowledge bomb I did not understand.

Both you are true.
On singular line if previous is faul it will not execute the other function. However it looks to me that it will run through every line because it will realize every logical error. It won't return or change anything, but sure seems to check it.
 
Meh, I wont be able to complete Quest Systems. Not enough free time in this week :/

Forest Quest and and Bandit quest rework was made.
I will update server when Cyclops Quest and Hehemi rework has been done trough quest system too.
+ npc hints for all quests.
 
Well then.
Pretty busy weeks.
I haven't even seen the scripts past 5 days xD
But I will continue soon. Currently plans without scripting go as far as 04.09

Cya next week.
(I will keep server open, so your playing still will help, but the bug fixes will happen after I'm done with my own things.)
 
LoL, funny bug.
15qp2r7.jpg
 
Some changes will come regarding to this server. Put more of that on later date.

As of right now, going to skip making lore system and pushing it to patch 0.1.7 or even later (after pvp)
I just don't feel like making 3 dimensional database using SQL queries. Nor making system what I know will take weeks to perfect.

This is why Patch 0.1.4.5 will come out around 12.06 (you would know that if you check my post 1 or the website)

Anyway, today the npc's are now finished!! wohoo!
Now making 1 last fancy system, QuestLog!
This will be new command what opens up questlog and will give good information about your quests, missions, tasks and bosskills.

When its done, I will:
Improve balance of my game.
knights will get changed.
mages will get changed.
some items might be changed.
talent tree will be updated. measuring soul will replaced with new talent what is useful for mages. (for now)
fix all the reported bugs.
 
Last edited:
Amazing day today.
I was able to finish questlog AND changed mage death and spark spell.
Improved The nami boots, added new talent to talent tree ("spell power")
added 2 new stones to game what replace sparkii, sparkiii, deathii and deathiii drops.
 
Whi World PATCH 0.1.4.5

Huge makeover to quests, missions and all to its related objects has been improved. You can expect to see more quality quests and missions, because making them is 10 times faster :D

SkillTree:
measuring soul: moved to tier 3
spell power: added to tier 2. death and spark spell radius is improved by 1. stacks 3 times.

Spells:
Deathii, Sparkii, Deahiii and Spakiii has been removed from game.
death, spark: Effect is now: "Deals [type] damage, damage is increased by 10% the further it reaches"
buff: The spell text is improved
opaldef, rubydef, sapphdef: heal Formula changed from [heal: (30+mL*10)] to [heal cap: (30+sLs*10)]
opaldef, rubydef, sapphdef: Effect is now: "gives [type] resistance for 5sec and heals 2 times the amount resisted if [type] damage taken"

NPC's:
All NPC's can give hints about quests.
Secret added to game.

Loot System:
Unused spellScrolls are replaced with new wand stones

Items:
death stone: new upgrade item for wands
energy stone: new upgrade item for wands
expedition backpack and bag: both have been improved
gems and stones: Added description to item, what are they used for
The Nami Boots: additional effect added

Questlog:
Long waited questlog has been added to game.
You can now see your progress with command !questlog

Map:
Now some items will respawn inside the containers.

BUG FIXES:
fixed bug where *crit* text was appearing on player.
fixed bug where cookbook did not show learned spice recipes. (unfortunately you have to relearn them)

Didn't add feature where NPC talk to eachother and talk about best players or their achievements. Definitely going to add it one day, but not yet.
Also I was suggested to add chunk option for skilltree. Sadly its not possible, without reworking entire skilltree.
We simply have to wait until I get to start using OTC, because I built skillTree keeping in mind that it would be extremely effective in OTC.
 
Whi World PATCH 0.1.4.5.1

Some simple fixes and improvements to current content.

NPC's:
All:
Your question what you asked is also included in the local chat to improve reading the chat.
Tonka: Gives some additional text to point out his unique features. (Have noticed that some players do not notice the new buttons, after they complete the mission for Tonka)

Loot:
Apple: Reduced drop count on regular bandits by 1 (bandit mage,-knight,-hunter,-druid)
energy/death stone: Increased drop chance by 2%, everywhere.

Items:
reward bag: Can now hold another EMPTY bag. (So if you loot another bag and you have reward bag, you don't have to decide between changing your current bag)

Quests:
Bandit Mountain Quest has been fixed. Shows message "searching under tree.." again

Map:
Tutorial room doors are fixed. My map was not up to date with new key system.
Chests has been improved. Now if you have completed quest or have a key, you can always open the chest (doesn't mean you will get items again)

BUG FIXES:
Fixed spicing food. No longer duplicates food when spicing food what is on the floor.
 
Back
Top