And after uncovering all this, I played the map to see what it was all about...
Well he just took the video clip, converted it into a one dimensional array of pixels stored frame-by-frame, then wrote a quick function that displays the pixels. Rather disappointing. The music isn't even synced to the video.
The majority of the script is just data storage. The actual part responsible for playing back the stored data is in here:
Code: Select all
globals
// User-defined
real udg_x=0
real udg_y=0
location udg_p=null
real udg_d=0
integer udg_c1=0
image array udg_img1
image array udg_img2
integer udg_c2=0
integer array udg_Data
filterfunc array udg_datafunc
integer array udg_stats1
integer array udg_stats2
force udg_f=null
integer udg_curframe=0
integer udg_mpx=0
integer udg_long=0
integer udg_width=0
timer udg_t=null
// Generated
string gg_snd_BadApple
trigger gg_trg_Start=null
trigger gg_trg_x1=null
trigger gg_trg_x2=null
trigger gg_trg_y=null
trigger gg_trg_t2=null
endglobals
Code: Select all
function InitGlobals takes nothing returns nothing
local integer i=0
set udg_x=-960.00
set udg_y=720.00
set udg_d=16.00
set udg_c1=0
set udg_c2=0
set i=0
loop
exitwhen(i>1)
set udg_Data[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>1)
set udg_stats1[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>1)
set udg_stats2[i]=0
set i=i+1
endloop
set udg_f=bj_FORCE_PLAYER[0]
set udg_curframe=-1
set udg_mpx=0
set udg_long=120
set udg_width=45
set udg_t=CreateTimer()
endfunction
Code: Select all
function Trig_t1_Actions takes nothing returns nothing
local integer i=0
local integer j
local integer x
local integer y
local integer value
set udg_curframe=(udg_curframe+1)
if(udg_datafunc[udg_curframe]==null)then
return
endif
call ForceEnumPlayersCounted(udg_f,udg_datafunc[udg_curframe],1)
call DestroyFilter(udg_datafunc[udg_curframe])
loop
exitwhen i>udg_mpx
set j=0
set value=udg_Data[i/30]
loop
exitwhen j>29
if value!=0 then
set x=value/2
set y=value-x*2
if(y!=udg_stats1[i])then
call ShowImage(udg_img1[i],y==1)
set udg_stats1[i]=y
endif
set value=x
else
call ShowImage(udg_img1[i],false)
set udg_stats1[i]=0
endif
set j=j+1
set i=i+1
endloop
endloop
call TriggerExecute(gg_trg_t2)
endfunction
Code: Select all
function WorldsEnd takes nothing returns nothing
call DisplayTimedTextToForce(GetPlayersAll(),30,"下次再见:)")
call EndGame(false)
endfunction
function InitData takes nothing returns nothing
endfunction
// native CreateImage takes string file,real sizeX,real sizeY,real sizeZ,real posX,real posY,real posZ,real originX,real originY,real originZ,integer imageType returns image
function Trig_x1_Actions takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=120
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set udg_img1[udg_c1]=CreateImage("px.tga",32,32,32,udg_x,udg_y,0,0,0,0,2)
call SetImageRenderAlways(udg_img1[udg_c1],true)
call ShowImage(udg_img1[udg_c1],false)
set udg_x=(udg_x+udg_d)
set udg_c1=(udg_c1+1)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function InitTrig_x1 takes nothing returns nothing
set gg_trg_x1=CreateTrigger()
call TriggerAddAction(gg_trg_x1,function Trig_x1_Actions)
endfunction
Code: Select all
function Trig_x2_Actions takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=120
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set udg_img2[udg_c2]=CreateImage("px.tga",32,32,32,udg_x,udg_y,0,0,0,0,2)
call SetImageRenderAlways(udg_img2[udg_c2],true)
call ShowImage(udg_img2[udg_c2],false)
set udg_x=(udg_x+udg_d)
set udg_c2=(udg_c2+1)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function InitTrig_x2 takes nothing returns nothing
set gg_trg_x2=CreateTrigger()
call TriggerAddAction(gg_trg_x2,function Trig_x2_Actions)
endfunction
Code: Select all
function Trig_y_Func014A takes nothing returns nothing
call TriggerRegisterPlayerEventEndCinematic(gg_trg_Start,GetEnumPlayer())
endfunction
function Trig_y_Actions takes nothing returns nothing
call Preload("px.tga")
set bj_forLoopBIndex=1
set bj_forLoopBIndexEnd=45
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call TriggerExecute(gg_trg_x1)
set udg_y=(udg_y - udg_d)
set udg_x=-960.00
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
set bj_forLoopBIndex=1
set bj_forLoopBIndexEnd=45
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call TriggerExecute(gg_trg_x2)
set udg_y=(udg_y - udg_d)
set udg_x=-960.00
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
call InitData()
set udg_mpx=(udg_long * udg_width)
call ClearMapMusicBJ()
call EnableDawnDusk(false)
call VolumeGroupSetVolumeBJ(SOUND_VOLUMEGROUP_AMBIENTSOUNDS,0.00)
call VolumeGroupSetVolumeBJ(SOUND_VOLUMEGROUP_MUSIC,100.00)
call TriggerSleepAction(0.00)
call UseTimeOfDayBJ(false)
call DisplayTextToForce(GetPlayersAll(),"TRIGSTR_026")
call DisplayTextToForce(GetPlayersAll(),"TRIGSTR_028")
call ForForce(GetPlayersAll(),function Trig_y_Func014A)
call DisplayTimedTextToForce(GetPlayersAll(),30,"TRIGSTR_027")
endfunction
function InitTrig_y takes nothing returns nothing
set gg_trg_y=CreateTrigger()
call TriggerAddAction(gg_trg_y,function Trig_y_Actions)
endfunction
Code: Select all
function Trig_t2_Actions takes nothing returns nothing
local integer i=0
local integer j
local integer x
local integer y
local integer value
loop
exitwhen i>udg_mpx
set j=0
set value=udg_Data[(udg_mpx+i)/30]
loop
exitwhen j>29
if value!=0 then
set x=value/2
set y=value-x*2
if(y!=udg_stats2[i])then
call ShowImage(udg_img2[i],y==1)
set udg_stats2[i]=y
endif
set value=x
else
call ShowImage(udg_img2[i],false)
set udg_stats2[i]=0
endif
set j=j+1
set i=i+1
endloop
endloop
endfunction
function InitTrig_t2 takes nothing returns nothing
set gg_trg_t2=CreateTrigger()
call TriggerAddAction(gg_trg_t2,function Trig_t2_Actions)
endfunction
Code: Select all
function InitCustomTriggers takes nothing returns nothing
call InitTrig_Start()
call InitTrig_x1()
call InitTrig_x2()
call InitTrig_y()
call InitTrig_t2()
endfunction
function RunInitializationTriggers takes nothing returns nothing
call ConditionalTriggerExecute(gg_trg_y)
endfunction
(It took my computer over 2 minutes to remove the data storage blocks from the script (I did a couple RegEx search&replace operations with Notepad++). Everything above is the part that is NOT data storage. A mere 219 lines. 0.051% of the script.)