Patch #728

live Screenshots (webcam)

Added by Ammler about 7 years ago. Updated over 6 years ago.

Status:ClosedStart date:2010-01-28
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

It is possible to create screens with dedicated server, it needs a small patch for OpenTTD: http://openttdcoop.org/patches/keepBlitterForDedicated.p1.diff

the patch for Autopilot: http://ps.openttdcoop.org/public/makeScreenshot.p0.diff (by Fuco)

demo custom command:

#if {![::mod_irc::nickIsOp [who]]} {
#       say::public "you must be channel op to use [command]" 
#} else {
        # we are ops and have one argument that is an integer
if {![info exists ::lastscreenlocation] || $::lastactionlocation != $::lastscreenlocation} {
        file delete screenshot.png
        ::ap::game::console "scrollto 0x$::lastactionlocation\r" 
        set ::lastscreenlocation $::lastactionlocation
        ::ap::game::console "screenshot no_con\r" 
        ::ap::say::everywhere "*** [who] made screenshot at $::lastactionlocation: http://ps.openttdcoop.org/public/screenshot.png" 
        } else {
        ::ap::say::everywhere "*** [who] liked to make screenshot of last action, but nobody was working since. (http://ps.openttdcoop.org/public/screenshot.png)" 
        }
#}

History

#1 Updated by Osai about 7 years ago

How are screenshots saved to screenshot.png?
At my local machine they are always saved to something like "Unnamed, 1st Jan 2010.png"

#2 Updated by Ammler about 7 years ago

check your screenshot_format in the cfg, maybe you defined something there.

Else it should also be possible to give the file name as parameter...

#3 Updated by Osai about 7 years ago

Okay

screenshot no_con screenshot

does the job. :-)

#4 Updated by Ammler about 7 years ago

current version:

set ::lastactionlocation [string trim $::lastactionlocation]
if {![info exists ::lastscreenlocation] || $::lastactionlocation != $::lastscreenlocation} {
        #file delete screenshot.png
        ::ap::game::console "scrollto 0x$::lastactionlocation\r" 
        set ::lastscreenlocation $::lastactionlocation
        ::ap::game::console "screenshot\r" 
        file rename -force ./screenshot.png ./web/webcam/$::lastactionlocation.png
        exec ln -fs webcam/$::lastactionlocation.png ./web/screenshot.png
        ::mod_irc::say::public "*** [who] made screenshot at $::lastactionlocation: http://ps.openttdcoop.org/public/webcam/$::lastactionlocation.png" 
} else {
        if { [who] != "" } {
                ::mod_irc::say::public "*** [who]liked to make screenshot of last action, but nobody was working since. (http://ps.openttdcoop.org/public/screenshot.png)" 
        }
}

#5 Updated by Ammler over 6 years ago

patch is now in the official MQ.

Still not supported by OpenTTD so we need the blitter patch which you can find in the #openttdcoop server patch pack.

#6 Updated by Ammler over 6 years ago

  • Status changed from New to Closed

Also available in: Atom PDF