Improve The Third Person View with Zoom: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Created page with 'gamevar cameraonwall 0 1<br>gamevar camzoomcontrol 65536 1 onevent EVENT_LOOKUP<br>setvar RETURN -1<br>addvar camzoomcontrol -8192 //cam zoom in speed<br>ifvarl camzoomcontrol ...'
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
gamevar cameraonwall 0 1<br>gamevar camzoomcontrol 65536 1
Add this code to GAME.CON, after <code>include USER.CON</code>.


onevent EVENT_LOOKUP<br>setvar RETURN -1<br>addvar camzoomcontrol -8192 //cam zoom in speed<br>ifvarl camzoomcontrol 0 { setvar camzoomcontrol 0 } //cam max zoom in<br>endevent  
gamevar cameraonwall 0 1
 
gamevar camzoomcontrol 65536 1
onevent EVENT_LOOKDOWN<br>setvar RETURN -1<br>addvar camzoomcontrol 8192 //cam zoom out speed<br>ifvarg camzoomcontrol 1048576 { setvar camzoomcontrol 1048576 } //cam max zoom out<br>endevent  
 
onevent EVENT_LOOKUP
onevent EVENT_DISPLAYROOMS<br> setvar cameradist 0<br> updatesectorz camerax cameray cameraz cameraonwall<br> ifvarn cameraonwall -1<br> { addvarvar cameradist camzoomcontrol }<br> else<br> ifvare cameraonwall -1<br> { addvar camzoomcontrol -8192 addvarvar cameradist camzoomcontrol }<br> endevent<br>
    setvar RETURN -1
    addvar camzoomcontrol -8192 // cam zoom in speed
    ifvarl camzoomcontrol 0
        setvar camzoomcontrol 0 // cam max zoom in
endevent
onevent EVENT_LOOKDOWN
    setvar RETURN -1
    addvar camzoomcontrol 8192 // cam zoom out speed
    ifvarg camzoomcontrol 1048576
        setvar camzoomcontrol 1048576 // cam max zoom out
endevent
onevent EVENT_DISPLAYROOMS
    setvar [[cameradist]] 0
    updatesectorz [[camerax]] [[cameray]] [[cameraz]] cameraonwall
    ifvarn cameraonwall -1
        addvarvar cameradist camzoomcontrol
    else
    {
        addvar camzoomcontrol -8192
        addvarvar cameradist camzoomcontrol
    }
endevent

Latest revision as of 17:04, 14 July 2012

Add this code to GAME.CON, after include USER.CON.

gamevar cameraonwall 0 1
gamevar camzoomcontrol 65536 1

onevent EVENT_LOOKUP
    setvar RETURN -1
    addvar camzoomcontrol -8192 // cam zoom in speed
    ifvarl camzoomcontrol 0
        setvar camzoomcontrol 0 // cam max zoom in
endevent

onevent EVENT_LOOKDOWN
    setvar RETURN -1
    addvar camzoomcontrol 8192 // cam zoom out speed
    ifvarg camzoomcontrol 1048576
        setvar camzoomcontrol 1048576 // cam max zoom out
endevent

onevent EVENT_DISPLAYROOMS
    setvar cameradist 0
    updatesectorz camerax cameray cameraz cameraonwall
    ifvarn cameraonwall -1
        addvarvar cameradist camzoomcontrol
    else
    {
        addvar camzoomcontrol -8192
        addvarvar cameradist camzoomcontrol
    }
endevent