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

Live stream players from temple/depot on www! [TFS 1.0]

Gesior.pl

Mega Noob&LOL 2012
Senator
Joined
Sep 18, 2007
Messages
2,966
Solutions
99
Reaction score
3,383
Location
Poland
GitHub
gesior
It's http://otland.net/threads/stream-live-from-your-website.175351/ by Printer, updated to TFS 1.0 and bug fixed by Gesior.pl and tested with WibbenZ and Imran.

This script does not require any part of Gesior acc. maker (only skulls images, but I can work without them). You can install it in any other acc. maker. You just need to add page content in place where are pages in your acc. maker (in Gesior2012 it's folder 'pages').

In files are many comments with descriptions what values you should set.

In globalevents/globalevents.xml add this line:
(IMPORTANT: if your 'server save globalevent' interval is like 3600000 [milions!] then use interval 1000 for this script, NOT 1)
PHP:
<globalevent name="stream" interval="1" script="stream_temple.lua"/>
In globalevents/scripts/ create new file and name it stream_temple.lua and paste:
http://paste.ots.me/560742/text

In acc. maker pages/ create file streamtemple.php and paste:
http://paste.ots.me/560741/text

1. Now create folder streamtemple in acc. maker folder and make sure it's writeable (linux) and OTS can create file in it.
2. In this folder place your temple image (like thais depot image below), use name temple.png
Image must have tiles width/height = 32 px or it will generate players on wrong positions!

(You can edit that file name in .php file)
3. In .php file find 'DO NOT FORGET TO EDIT THIS PART OF LINE BELOW' and edit size of image to your image size.
4. Now you must download:
http://outfit-images.ots.me/outfit-images.zip
and unpack to main folder in your acc. maker (when it asks 'do you want to replace index.php' click NO)
4. In .php file is part to correct position of players on tiles:
Default it moves all players 2 px to the right and 4 px to the bottom of image:
PHP:
    var imageCorrectionX = 2;
    var imageCorrectionY = 4;
Look at your website stream, compare it with screen in game and adjust these values to make players stand at same pixel as in game :)

How to configure positions?
What positions you should use in scripts configurations:
stream.png


I could write another 1000 lines about configuration of this script, but some people won't understand. If you just can't make it work on your OTS ask some advanced user. I'm sure there are many people that can configure it for 5 euro for you.
 
Last edited:
Nice! This will be a cool feature to add to the website! :D

You can view a sample here: Live Stream
 
Last edited:
Can you make it for TFS 0.4 client 8.6 ?
 
Can you make it for TFS 0.4 client 8.6 ?
The lua script I wrote is for a server im working on, since gesior helped me with the javascript I sent him the files, its @Printer 's credit for the first lua script, you should use that insted the diffrence is mainly that the new one uses meta tags insted of the old system.

With the javascript script credits its @TGYoshi and then edited by gesior as I just said.
 
But I still don't see any need for it.
I was messing around with it just for the nostalgia, it used to be present on almost every ot a few years ago

indeed it does looks ugly and can be improved a lot, and the usage I would give to it in my ot is to show a "live" preview of ot temple and some of its features, so people looking for an ot would have a small idea without the need to register/download/login anything

yes I could use a video or image or whatever, but I always liked this because it is different 😅
 
A server with 300 players online, all streaming IO to a file. This would be pure overkill
So this "streams" 1 certain area? Not following around the player?
I ran version that stream all players on Kasteria with 1000+ online. It's not exactly 'steaming', it just dumps all players positions once a second.

Script:

Map view with whole map, all players and option to select player to 'follow':

Config to enable players stream:
 
Back
Top