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

Config.lua problem (a little issue)

Rafael Hamdan

OT Developer
Joined
Dec 12, 2007
Messages
98
Reaction score
1
Location
Brasil - Minas Gerais
Config.lua problem AND revision 872

Revision 872 problem

Well, I've just updated my project to revision 872, and I'm getting an error which says: "Memory could not be "read"".

PS: It happens when someone tries to log in the game, so, when a character is being loaded. I'm going to compile my project on revision 871 and try to execute it, I'll answer what have happenned in the last post.

CONFIG.LUA problem

Well, some days ago, I was trying to change to players get just one day of banishment instead of seven days when they get banished because of excessive player killing.

Well, I changed "banLenght" option of config.lua from :

Code:
banLenght = 7 * 24 * 60 * 60

to:

Code:
banLenght = 1 * 24 * 60 * 60

So, I reloaded config.lua, but it didn't change anything. So I thought it was something wrong at sources, but I dind't find anything wrong.

So, I saw that in configmanager.cpp, we have:

Code:
	m_confNumber[BAN_LENGTH] = getGlobalNumber(L, "banLength", 7 * 24 * 60 * 60);
	m_confNumber[FINALBAN_LENGTH] = getGlobalNumber(L, "finalBanLength", 30 * 24 * 60 * 60);

If you see, it looks for "banLength", and "finalBanLength", while we have banLenght, finalBanLenght at config.lua, they're differente from each other.

banLength != banLenght
finalBanLength != finalBanLenght

Hope you fix that, or, a lot of people will have problem with that

Yours,
Rafael Hamdan;
 
Last edited:
This was 0.3 I guess? If it was, you can't report bugs for it because it isnt released yet.
 
He can report at the project board xD but not as 0.2 he report it as 0.3 alpha.
 
If I may suggest something: STOP CREATING NEW THREADS FOR EACH BUG.
You've already created one thread, you could post it THERE.
Anyway, thanks for report, was almost sure I've fixed and commited it, but seems not.
 
@master-m
Can't I post bugs of the newest revisions? Sure I can, I think, anh? I'm just helping for future releasings, and I use that releasings, I don't use stable versions (as they call 0.2, etc).

@Elf
Sorry, you can close this topic if you want.

I've just compiled my server on revision 871, and everything is working fine, I'm having no errors. I suggest you to take a look at revision 872, there's something wrong with that.

Yours,
Rafael Hamdan;
 
Last edited by a moderator:
Using Windows or Linux? Please post some crash log.
For Windows compile with: -D__EXCEPTION_TRACER__
For Linux:
- install GNU DEBUG TOOL
- write: ulimit -c unlimited
- start your server
- gdb BINARY CORE.XXXX (xxx will be PID, ls the folder)
- type: bt

and post result.
 
That's really strange, now I compiled 873 and everything worked fine.

Anyway, thanks for fix the problems I said before.

PS: /reports does not work here. (reporting inserts at table server_reports normally, but talk action just does not do nothing)

Yours,
Rafael Hamdan;
 
Nothing? No error?
Thats mine /reports:
Code:
02:32 New reports:
02:32 # 1, by God Elf.
02:32 # 3, by God Elf.
02:32 # 4, by God Elf.
02:32 # 5, by God Elf.
 
No, I don't have errors at Revision 873, but, /reports does not work. I don't know why, but it doesn't work, it's like it's a normal message.

Yours,
Rafael Hamdan
 
Sure I did. Maybe there's something wrong in somewhere.

Look:

talkactions.xml:

Code:
´<?xml version="1.0" encoding="UTF-8"?>
<talkactions>
	<!-- Gods -->
	<talkaction filter="word" log="yes" access="5" words="/shutdown" script="shutdown.lua" />
	<talkaction filter="word" log="yes" access="5" words="/pvp" script="pvp.lua" />

	<!-- Community Managers -->
	<talkaction filter="word" access="4" words="!z" script="magiceffect.lua" />
	<talkaction filter="word" access="4" words="!x" script="animationeffect.lua" />
	<talkaction filter="word" access="4" words="!y" script="animatedtext.lua" />
	<talkaction filter="word" log="yes" access="4" words="/bc" script="broadcastclass.lua" />

	<!-- Game Masters -->
	<talkaction filter="word" log="yes" access="3" words="/save" script="save.lua" />
	<talkaction filter="word" log="yes" access="3" words="/clean" script="clean.lua" />
	<talkaction filter="word" log="yes" access="3" words="/reports" script="reports.lua" />

	<!-- Senior Tutors -->
	<talkaction filter="word" log="yes" access="2" words="/b" script="broadcast.lua" />

	<!-- Tutors -->
	<talkaction log="yes" access="1" words="!pos" script="position.lua" />

	<!-- Players -->
	<talkaction filter="word" words="!buypremium" script="buyprem.lua" />
	<talkaction words="!leavehouse" script="leavehouse.lua" />
	<talkaction words="!online" script="online.lua" />
	<talkaction words="!changesex" script="changender.lua" />
	<talkaction words="/uptime" script="uptime.lua" />
	<talkaction filter="word" words="/deathlist" script="deathlist.lua" />
	<talkaction words="/mode" script="mode.lua" />
	<talkaction words="!q" script="money.lua" />
	<talkaction words="/serverinfo" script="serverinfo.lua" />
</talkactions>

My reports.lua:

Code:
local config = {
	reportReadsToExpire = 1
}

function onSay(cid, words, param)
	if(isNumber(param) == TRUE) then
		local reportId = tonumber(param)
		local report = db.getResult("SELECT * FROM `server_reports` WHERE `id` = " .. reportId)
		if(report:getID() ~= -1) then
			db.executeQuery("UPDATE `server_reports` SET `reads` = `reads` + 1 WHERE `id` = " .. reportId)
			doPlayerPopupFYI(cid, "Report # " .. reportId .. "\n\nName: " .. getPlayerNameByGUID(report:getDataInt("player_id")) .. "\nPosition: [X: " .. report:getDataInt("posx") .. " | Y: " .. report:getDataInt("posy") .. " | Z: " .. report:getDataInt("posz") .. "]\nDate: " .. os.date("%c", report:getDataInt("timestamp")) .. "\nReport:\n" .. report:getDataString("report"))
			report:free()
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Report with ID: " .. reportId .. " does not exists.")
		end
	else
		local list = db.getResult("SELECT `id`, `player_id` FROM `server_reports` WHERE `reads` < " .. config.reportReadsToExpire)
		if(list:getID() ~= -1) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "New reports:")
			while(true) do
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "# " .. list:getDataInt("id") .. ", by " .. getPlayerNameByGUID(list:getDataInt("player_id")) .. ".")
				if not(list:next()) then
					break
				end
			end
			list:free()
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There are no active reports.")
		end
	end
	return FALSE
end

I think there's nothing wrong. I really don't know what's happening.

PS: I'll try hardly to find where the error is. Anyway, I'd like to ask you another thing, are you (the developers of TFS) trying to fix the problem of actions? (we can't shoot spears/distance weapons while shooting sd's and using uhs, we can't walk/use uhs and potions, and we can't walk / shoot sudden deaths, and that's not right, cause I've already tested it in tibia global, and there, it's not like that.)

Yours,
Rafael Hamdan;
 
Last edited:
Looks like you didn't did a very good job testing then because if you played Tibia you would know there was a technique to playing a paladin where you always shoot runes just after shooting to not delay the arrow/bolt/burst arrow, the delay is minor (around 100-200 ms) or so but its there.

And no you can't do walk and shoot/use a rune/open a backpack at the *same* time, thats how Tibia is made, if your already doing an action the next action is delayed until the previous is complete.

Try it yourself, I guess you already did if you did your research, but take a normal low level player (around 8-16) and let him get paralyzed, then start walking then use a healing rune and see what happens, or try shoot at a target while being paralyzed...
 
But you can shoot runes and bolts at the same time. If you've already played Tibia Global, you'd know that. We can shoot sudden deaths and bolts at the same time, I'm sure about that.

TFS uses the same EXHAUSTION condition for weapons and spells. So, if you shoot a sudden death now, and continue shooting, you won't shoot ANY bolt. That's clealy bugged. Just try to fix it.

Yours,
Rafael Hamdan;
 
No you can't shoot runes and bolts at the *same* time, you can shoot it within a 100 ms to eachother, the default action delay is 1000 ms, and that is a bit to high, if you change it to 100-200 ms then you'll probably think it's the same time, even if its not.

If you ask any serious paladin they will tell you that when hunting they always shoot their spell runes just after the bolt/arrow to minimize that x->200 ms delay, but most people will probably not even notice such small delay.
 
Last edited:
I don't think the action delay matters in this case, it's about the combat exhaustion being used for both weapons and aggressive runes, with a default value of 2000 in OpenTibia. Doesn't this mean that everytime you fire a sudden death rune the variable increase by 2000 and the weapon is not used before this variable is back to 0. The weapon itself seem to add the same ticks once it's used. It seems to me like there's 2 seconds of delay before you can use the weapon again, so I've separated the weapon/aggressive-rune exhaust in TFS.

I've added comments to explain how I think it's working.
After using a weapon (weapons.cpp):
Code:
	if(!player->hasFlag(PlayerFlag_HasNoExhaustion)){
		if(exhaustion){ //weapon has exhaustion enabled
			player->addCombatExhaust(g_game.getFightExhaustionTicks()); //2000 (or another value if it's changed) is added to the combat exhaust, no rune or weapon can be used within this time.
		}
	}

When trying to use the weapon (player.cpp):
Code:
			else if(!hasCondition(CONDITION_EXHAUST_COMBAT)){ //doesn't let us use the weapon before the exhaustion is back to 0.
				result = weapon->useWeapon(this, tool, attackedCreature);
			}

When using a aggressive rune (spells.cpp):
Code:
				if(isAggressive){
					player->addCombatExhaust(g_game.getFightExhaustionTicks()); //just like a weapon, variable is increased by 2000 (unless it's configured to something else).
				}

Correct me if I'm wrong but this is how I understood the code.
 
That was what I was trying to explain him. That's it! It's using the same exhaustion for weapons and spell attacking runes. I noticed that you've separated it on newest revision.

Thanks.

Yours,
Rafael Hamdan;
 
Back
Top Bottom