Tibia Tibiando - Audio API for tibia

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Best answers
0
Reaction score
101
Location
Brazil
Hello! Today i will release my project. Tibiando.
If you play K.A you see it on version 1.0 apha in client with audio.
Well now i will release version 2.0 how as Open source! :thumbup:

This API use an script on your server and the client on player PC.
You add the musics on player client (in dir audio) and config on server script how it will play.
by outfit? By position? by storage? :D

Its a bit hard to set it to work so some newbies server owner will not understand how to config etc, but its just read the manual (with the files)

Check Tibiando here: https://sourceforge.net/projects/tibiando/files/

Remenber it folows the GNU general public license.

Now a bit about config your audio API (server)

Lua:
--Play by pos
{formpos,topos,{'music,mp3'},type=1},
{{x=299,y=232,z=7},{x=309,y=242,z=7},{'a touch of blessing.mp3'},type=1}, -- play in position
--Play in PZ
{0,0,{'music.mp3'},type=2},
{0,0,{'omg.mp3'},type=2},
--Play by player storage value
{0,0,{'music.mp3'},type=3,storage=storage},
{0,0,{'prologue.mp3'},type=3,storage=4820},
-- By global storage
{0,0,{'omg.ogg'},type=4,storage=storage},
{0,0,{'x1nb.ogg'},type=4,storage=5050},
-- If function return true
{0,0,{'x1nb.ogg'},type=5,f=function,
{0,0,{'x1nb.ogg'},type=5,f=function(cid)
 return getCreatureOutfit(cid).lookType == 16
end},
unfortunately TFS and open tibia lua states is shared, one state to actions, one to movements, one to creaturescripts etc.

Its better use audio API in creaturescripts.
so add it in some file (or data/creaturescripts/lib)
Lua:
if not dj then
	dj = startAPI(7173) -- Here start the audio
end
And to play some effect when player logout:
Lua:
for i,b in pairs(dj.online) do
		if b.cid == cid then
			addEvent(function(b) b:send('EF=logout.wav\n') end,500,b[1])
		end
	end
More explanations in files on https://sourceforge.net/projects/tibiando/files/

Video Guide:
http://www.youtube.com/watch?v=3b0VVkyARs8
 
Last edited by a moderator:

Znote

<?php echo $title; ?>
Staff member
Global Moderator
Premium User
Joined
Feb 14, 2008
Messages
6,661
Best answers
201
Reaction score
1,372
Location
Norway, Oslo
Approved.

This is very great :p Open Tibia servers are developing faster than Original Tibia ajajaj :D Thanks Mock!
 
Last edited:

cbrm

Top Class brunet scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,585
Best answers
3
Reaction score
851
Location
Caribbean Sea
:( release one of those spell that pirsuit the target
 
OP
Mock

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Best answers
0
Reaction score
101
Location
Brazil
@Znote
thx by aprove it :D
if some on find a bug PLEASE MSG ME!
@Cybershot
??? ._.
 
OP
Mock

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Best answers
0
Reaction score
101
Location
Brazil
Hello! Today i will release my project. Tibiando.
If you play K.A you see it on version 1.0 apha in client with audio.
Well now i will release version 2.0 how as Open source! :thumbup:

This API use an script on your server and the client on player PC.
You add the musics on player client (in dir audio) and config on server script how it will play.
by outfit? By position? by storage? :D

Its a bit hard to set it to work so some newbies server owner will not understand how to config etc, but its just read the manual (with the files)

Check Tibiando here: https://sourceforge.net/projects/tibiando/files/

Remenber it folows the GNU general public license.

Now a bit about config your audio API (server)

Lua:
--Play by pos
{formpos,topos,{'music,mp3'},type=1},
{{x=299,y=232,z=7},{x=309,y=242,z=7},{'a touch of blessing.mp3'},type=1}, -- play in position
--Play in PZ
{0,0,{'music.mp3'},type=2},
{0,0,{'omg.mp3'},type=2},
--Play by player storage value
{0,0,{'music.mp3'},type=3,storage=storage},
{0,0,{'prologue.mp3'},type=3,storage=4820},
-- By global storage
{0,0,{'omg.ogg'},type=4,storage=storage},
{0,0,{'x1nb.ogg'},type=4,storage=5050},
-- If function return true
{0,0,{'x1nb.ogg'},type=5,f=function,
{0,0,{'x1nb.ogg'},type=5,f=function(cid)
 return getCreatureOutfit(cid).lookType == 16
end},
unfortunately TFS and open tibia lua states is shared, one state to actions, one to movements, one to creaturescripts etc.

Its better use audio API in creaturescripts.
so add it in some file (or data/creaturescripts/lib)
Lua:
if not dj then
	dj = startAPI(7173) -- Here start the audio
end
And to play some effect when player logout:
Lua:
for i,b in pairs(dj.online) do
		if b.cid == cid then
			addEvent(function(b) b:send('EF=logout.wav\n') end,500,b[1])
		end
	end
More explanations in files on https://sourceforge.net/projects/tibiando/files/


To add on YOUR SERVER download: tibiando-server-api.rar
to add on YOUR CLIENT download tibiando client or source
 

Appzyt

Excellent OT User
Joined
Jun 1, 2008
Messages
92
Best answers
0
Reaction score
0
This looks great Mock! Few questions tho.

1. If I am to use sound on my SERVER and place creaturescripts and the audio api.lua in correct positions then where sould I place my sound files login.waw, logout.waw and bum.waw files for the server to know what to play?

2. Not really sure about the audio api.lua file. First is the "config" part.

Code:
 	--Config
	dj.ip = port or 7173
	-- Ip to listen
	dj.bind = "*"
	-- delay to check players location.
	dj.delay = 100
	-- print all received messages on console
	dj.print = false
	-- Dj mode 1- play by player posittion 2- play like radio
	dj.mode = 1 -- mode 2 dont work
	-- Dj] channel ID
What is to be replaced with my servers IP adress? is it
Code:
 	-- Ip to listen
?

Rest of the configuration is a bit vague to my eyes if you got a spare moment please do explain them to me. :)

Other than that this looks really sweet, good job!
 
OP
Mock

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Best answers
0
Reaction score
101
Location
Brazil
@Appzyt
where you put sounds? ;D
in client/audio
server only say to client what file to play and client check on audio/

dj.bind = "*" -- DO NOT TOUCH ON THIS
 

Ava3D

New Member
Joined
Jan 10, 2009
Messages
6
Best answers
0
Reaction score
0
Mock i ahve one question ;] U can record mowie for this script build in client. My english is so bad ^^ and sorry for my words. Plz record mowie when this scribt is runing. xD and pm xD
 
Joined
Oct 22, 2007
Messages
41
Best answers
0
Reaction score
1
Great use of lua sockets.
You should write some tutorial on how to create such a things.
Very useful for custom clients.
 

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Best answers
0
Reaction score
72
Location
Poland
Add like a damage sound. Spells/Hit
 

Jafab

Learning Graphic Design
Joined
Jun 30, 2010
Messages
339
Best answers
0
Reaction score
5
Location
Miami, FL
nice! xD i just liked it

oots growing more faster than Tibia RL xD
 

Karpio

New Member
Joined
Jun 14, 2008
Messages
9
Best answers
0
Reaction score
3
How add new sound effect?
If I put file sound.mp3 to folder audio and in logout i change
b:send('EF=logout.wav\n') to
b:send('EF=sound.mp3\n') it's not working :(

How do it?

#Sorry for my bad english :/
 

Ormin

New Member
Joined
Aug 4, 2007
Messages
29
Best answers
0
Reaction score
0
Gratz , it surely involved some work.
 
OP
Mock

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Best answers
0
Reaction score
101
Location
Brazil
Hello! Today i will release my project. Tibiando.
If you play K.A you see it on version 1.0 apha in client with audio.
Well now i will release version 2.0 how as Open source! :thumbup:

This API use an script on your server and the client on player PC.
You add the musics on player client (in dir audio) and config on server script how it will play.
by outfit? By position? by storage? :D

Its a bit hard to set it to work so some newbies server owner will not understand how to config etc, but its just read the manual (with the files)

Check Tibiando here: https://sourceforge.net/projects/tibiando/files/

Remenber it folows the GNU general public license.

Now a bit about config your audio API (server)

Lua:
--Play by pos
{formpos,topos,{'music,mp3'},type=1},
{{x=299,y=232,z=7},{x=309,y=242,z=7},{'a touch of blessing.mp3'},type=1}, -- play in position
--Play in PZ
{0,0,{'music.mp3'},type=2},
{0,0,{'omg.mp3'},type=2},
--Play by player storage value
{0,0,{'music.mp3'},type=3,storage=storage},
{0,0,{'prologue.mp3'},type=3,storage=4820},
-- By global storage
{0,0,{'omg.ogg'},type=4,storage=storage},
{0,0,{'x1nb.ogg'},type=4,storage=5050},
-- If function return true
{0,0,{'x1nb.ogg'},type=5,f=function,
{0,0,{'x1nb.ogg'},type=5,f=function(cid)
 return getCreatureOutfit(cid).lookType == 16
end},
unfortunately TFS and open tibia lua states is shared, one state to actions, one to movements, one to creaturescripts etc.

Its better use audio API in creaturescripts.
so add it in some file (or data/creaturescripts/lib)
Lua:
if not dj then
	dj = startAPI(7173) -- Here start the audio
end
And to play some effect when player logout:
Lua:
for i,b in pairs(dj.online) do
		if b.cid == cid then
			addEvent(function(b) b:send('EF=logout.wav\n') end,500,b[1])
		end
	end
More explanations in files on https://sourceforge.net/projects/tibiando/files/

How to install:
YouTube - How to install Tibiando (audio) in your OTserv
 
Top