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

doSendAnimatedText doesn't work anymore

Fermantor

Active Member
Joined
Dec 16, 2009
Messages
209
Solutions
4
Reaction score
33
Location
Germany
I have found a 9.6 TFS Server and Updated my old 8.62 and started to test all my scripts, for errors. Everything worked fine except those two.
I have a movement function, when you step on a field a "lever" is pulled, and "click" apears.

gittertür.lua
Lua:
function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) == TRUE then
		if getGlobalStorageValue(item.actionid) ~= 1 then
			doSendAnimatedText(position, 'Click', TEXTCOLOR_ORANGE)
			setGlobalStorageValue(item.actionid, 1)
		end
	end
	return TRUE
end
But then comes this error
Code:
[07/10/2012 16:08:02] Lua Script Error: [MoveEvents Interface] 
[07/10/2012 16:08:02] data/movements/scripts/quests/Pantra/Befreiung/gittertür.lua:onStepIn
[07/10/2012 16:08:02] LuaScriptInterface::luaDoSendAnimatedText(). Deprecated function.
[07/10/2012 16:08:02] stack traceback:
[07/10/2012 16:08:02] 	[C]: in function 'doSendAnimatedText'
[07/10/2012 16:08:02] 	.../movements/scripts/quests/Pantra/Befreiung/gittertür.lua:4: in function <.../movements/scripts/quests/Pantra/Befreiung/gittertür.lua:1>

And my second problem is, that a npc doesn't want to sell an item anymore.
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Toxina" script="data/npc/scripts/Pantra/magic.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="138" head="79" body="119" legs="81" feet="115" addons="1"/>
	<parameters>
		<parameter key="module_shop" value="3"/>

		<parameter key="shop_buyable" value="small health potion,8704,40;antidote potion,8474,50;vial,2006,100"/>

		<parameter key="shop_sellable" value="empty potion flask,7636,5;empty vial,2006,5;flask,8205,150,tarantula poison"/>
		<parameter key="message_farewell" value="Auf Wiedersehen, |PLAYERNAME|.Ich muss wieder an meine Arbeit! Also, zwei Bonelord Eyes, drei Fish Fins, acht...!"/>
	</parameters>
</npc>
This npc doesn't sell vial anymore :/

I hope someone can help me, with one of this problems, thank you :)
 
doSendAnimatedText function was removed on 9.0 I think, its not possible to let it work again on normal client because cipsoft removed it.
but there are 2 solutions:
1. replace it with doCreatureSay(it will work the same but with orange color only)
2. use custom client(8.71) and add all sprites of 9.6 :p
 
Haha, okay thanks :)
I think, I will use creaturesay.
But when an NPC adds Exp to a player, it looks stupid when I use the creatureSay function :/
 
Untrue. If you want an NPC to give players experience and have it look like it would if you gained it from a monster, use the doPlayerAddExpEx instead of the doPlayerAddExperience function.
Code:
doPlayerAddExpEx(cid, amount)

It's in 050-function.lua
Red
 
Untrue. If you want an NPC to give players experience and have it look like it would if you gained it from a monster, use the doPlayerAddExpEx instead of the doPlayerAddExperience function.
Code:
doPlayerAddExpEx(cid, amount)

It's in 050-function.lua
Red

Hmm, on my server, this doesn't work :/
 
uh, this is only good for numeric values
my attempt at backwards compatibility
Lua:
function doSendAnimatedText(pos, text, color, cid)
	if tonumber(text) then
		text = tonumber(text)
		if cid and isPlayer(cid) then
			doPlayerSendTextMessage(cid, MESSAGE_EXPERIENCE_OTHERS, '', text, color, pos)
		else
			local t = getSpectators(pos, 7, 5, false)
			if t then
				for _, cid in ipairs(t) do
					if isPlayer(cid) then
						doPlayerSendTextMessage(cid, MESSAGE_EXPERIENCE_OTHERS, '', text, color, pos)
					end
				end
			end
		end
	else
		if cid and isCreature(cid) then
			doCreatureSay(cid, text, TALKTYPE_ORANGE_1)
		else
			local t = getSpectators(pos, 7, 5, false)
			if t then
				for _, cid in ipairs(t) do
					if isPlayer(cid) then
						doCreatureSay(cid, text, TALKTYPE_ORANGE_1, false, cid, pos)
					end
				end
			end
		end
	end
end
 
Back
Top