Codul sursa de la Direct++.
DarkSide_Set_File_Requester_Extension ".Z3D"
DarkSide_Set_File_Requester_Extension_Pattern "1"
DarkSide_Open_File_Requester
DarkSide_Return_File_Requester_Full
do
scr$=get clipboard$()
interfisier(scr$)
InterLinie(Line$)
if escapekey() = 1 then end
sync
loop
function InterLinie(Line$)
dim Parametru(9)
dim Parametru$(9)
TypeOfData=1
AuFostGasiteGhilimele=0
StringTemporar$="";
IndicePS=1
IndiceP=1
AFostGasitParametru=0
length=len(Line$)
i=1
Command$="";
while i<=length
Char$=Mid$(Line$,i)
if Char$="/" and i<length
if Mid$(Line$,i+1) = "/" then ok=1
endif
if ok=1 then exit
if Char$<>";" and Char$<>" " and AFostGasitParametru=0 and Char$<>"("
Command$=Command$+Char$
endif
if Char$="("
AFostGasitParametru=1
endif
if AFostGasitParametru=1 and Char$<>";" and Char$<>"("
if Char$="," or Mid$(Line$,i+1)=")"
if TypeOfData=1
Parametru(IndiceP)=val(StringTemporar$)
IndiceP=IndiceP+1
endif
if TypeOfData=2
Parametru$(IndicePS)=StringTemporar$
IndicePS=IndicePS+1
endif
StringTemporar$=""
endif
if Char$="'" then AuFostGasiteGhilimele=AuFostGasiteGhilimele+1
if AuFostGasiteGhilimele=1 then TypeOfData=2
if AuFostGasiteGhilimele=2
AuFostGasiteGhilimele=0
TypeOfData=1
endif
if Char$<>"," and Char$<>"'"
StringTemporar$=StringTemporar$+Char$
endif
endif
if Char$=")"
AFostGasitParametru=0
endif
if Char$=";"
Command$=Upper$(Command$)
Select Command$
Case "MAKE_CUBE"
make object cube Parametru(1),Parametru(2)
endcase
Case "SCREENOUT"
text Parametru(1),Parametru(2),Parametru$(1)
EndCase
Case "LOAD_OBJECT"
load object Parametru$(1),Parametru(1)
EndCase
Case "POSITION_WINDOW"
set window position Parametru(1),Parametru(2)
EndCase
Case "WINDOW_TITLE"
set window title Parametru$(1)
EndCase
Case "WINDOW_SIZE"
set window size Parametru(1),Parametru(2)
EndCase
Case "WINDOW_ON"
SET WINDOW ON
EndCase
Case "WINDOW_OFF"
SET WINDOW OFF
EndCase
Case "MAXIMIZE_WINDOW"
MAXIMIZE WINDOW
EndCase
Case "MINIMIZE_WINDOW"
MINIMIZE WINDOW
EndCase
Case "HIDE_WNIDOW"
hide window
EndCase
Case "SHOW_WINDOW"
show window
EndCase
Case "DISPLAY_MODE"
set display mode Parametru(1),Parametru(2),Parametru(2)
EndCase
Case "SYNC_ON"
sync on
EndCase
Case "SYNC_OFF"
sync off
EndCase
Case "CLEAR_SCREEN"
cls
EndCase
Case "HOLD_MOUSE"
wait mouse
EndCase
Case "HOLD_KEY"
wait key
EndCase
Case "EXIT"
exit
EndCase
Case "SYNC"
sync
EndCase
Case "SET_SYNC_RATE"
sync rate Parametru(1)
EndCase
Case "FONT_TEXT"
set text font Parametru$(1)
EndCase
Case "SET_TRANSPARENT_TEXT"
set text transparent
EndCase
Case "TEXT_SIZE"
set text size Parametru(1)
EndCase
Case "TEXT_COLOR"
ink rgb(Parametru(1),Parametru(2),Parametru(3)),0
EndCase
Case "MAKE_BOX"
box Parametru(1),Parametru(2),Parametru(3),Parametru(4)
EndCase
Case "LOCK_PIXELS"
lock pixels
EndCase
Case "UNLOCK_PIXELS"
unlock pixels
EndCase
Case "MAKE_CIRCLE"
circle Parametru(1),Parametru(2),Parametru(3)
EndCase
Case "MAKE_ELLIPSE"
ellipse Parametru(1),Parametru(2),Parametru(3),Parametru(4)
EndCase
Case "LOAD_SOUND"
load sound Parametru$(1),Parametru(2)
EndCase
Case "PLAY_SOUND"
play sound Parametru(1)
EndCase
Case "STOP_SOUND"
stop sound Parametru(1)
EndCase
Case "PAUSE_SOUND"
pause sound Parametru(1)
EndCase
Case "RESUME_SOUND"
resume sound Parametru(1)
EndCase
Case "DELETE_SOUND"
delete sound Parametru(1)
EndCase
Case "LOOP_SOUND"
loop sound Parametru(1)
EndCase
Case "SAVE_SOUND"
save sound Parametru$(1),Parametru(1)
EndCase
Case "RECORD_SOUND"
record sound Parametru(1)
EndCase
Case "STOP_RECORD_SOUND"
stop recording sound
EndCase
Case "SOUND_SPEED"
set sound speed Parametru(1),Parametru(2)
EndCase
Case "SOUND_VOLUME"
set sound volume Parametru(1),Parametru(2)
EndCase
Case "ESCAPEKEY_OFF"
DISABLE ESCAPEKEY
EndCase
Case "ESCAPEKEY_ON"
ENABLE ESCAPEKEY
EndCase
Case "SYSTEMKEYS_OFF"
DISABLE SYSTEMKEYS
EndCase
Case "SYSTEMKEYS_ON"
ENABLE SYSTEMKEYS
EndCase
Case "EXIT_PROMPT"
exit prompt Parametru$(1),Parametru$(2)
EndCase
Case "LOAD_MUSIC"
load music Parametru$(1),Parametru(1)
EndCase
Case "DELETE_MUSIC"
delete music Parametru(1)
EndCase
Case "PLAY_MUSIC"
play music Parametru(1)
EndCase
Case "LOOP_MUSIC"
loop music Parametru(1)
EndCase
Case "STOP_MUSIC"
stop music Parametru(1)
EndCase
Case "PAUSE_MUSIC"
pause music Parametru(1)
EndCase
Case "RESUME_MUSIC"
resume music Parametru(1)
EndCase
Case "MUSIC_SPEED"
set music speed Parametru(1),Parametru(2)
EndCase
Case "MUSIC_VOLUME"
set music volume Parametru(1),Parametru(2)
EndCase
rem UpDate 1
Case "LOAD_IMAGE"
load image Parametru$(1),Parametru(1)
EndCase
Case "DELETE_IMAGE"
delete image Parametru(1)
EndCase
Case "SAVE_IMAGE"
save image Parametru$(1),Parametru(1)
EndCase
Case "GET_IMAGE"
get image Parametru(1),Parametru(2),Parametru(3),Parametru(4),Parametru(5)
EndCase
Case "PASTE_IMAGE"
paste image Parametru(1),Parametru(2),Parametru(3)
EndCase
Case "MAKE_CAMERA"
make camera Parametru(1)
EndCase
Case "DELETE_CAMERA"
delete camera Parametru(1)
EndCase
Case "MOVE_CAMERA"
move camera Parametru(1)
EndCase
Case "POSITION_CAMERA"
position camera Parametru(1),Parametru(2),Parametru(3)
EndCase
Case "ROTATE_CAMERA"
rotate camera Parametru(1),Parametru(2),Parametru(3)
EndCase
Case "XROTATE_CAMERA"
xrotate camera Parametru(1)
EndCase
Case "YROTATE_CAMERA"
yrotate camera Parametru(1)
EndCase
Case "ZROTATE_CAMERA"
zrotate camera Parametru(1)
EndCase
Case "TURN_CAMERA_LEFT"
turn camera left Parametru(1)
EndCase
Case "TURN_CAMERA_RIGHT"
turn camera right Parametru(1)
EndCase
Case "PITCH_CAMERA_UP"
PITCH CAMERA UP Parametru(1)
EndCase
Case "PITCH_CAMERA_DOWN"
PITCH CAMERA down Parametru(1)
EndCase
Case "ROLL_CAMERA_LEFT"
ROLL CAMERA LEFT Parametru(1)
EndCase
Case "ROLL_CAMERA_RIGHT"
ROLL CAMERA RIGHT Parametru(1)
EndCase
Case "SET_CURRENT_CAMERA"
SET CURRENT CAMERA Parametru(1)
EndCase
Case "CLEAR_CAMERA_VIEW"
CLEAR CAMERA VIEW Parametru(1)
EndCase
Case "AUTOCAM_ON"
AUTOCAM ON
EndCase
Case "AUTOCAM_OFF"
AUTOCAM OFF
EndCase
Case "BACKDROP_ON"
BACKDROP ON
EndCase
Case "BACKDROP_OFF"
BACKDROP OFF
EndCase
Case "TEXTURE_BACKDROP"
TEXTURE BACKDROP Parametru(1)
EndCase
Case "BOMB_PORTICLES"
bomb_particles()
EndCase
Case "MAKE_PARTICLES"
make_particles()
EndCase
Case "MAKE_PARTICLES_FOUNTAIN"
make_particles_fountain()
EndCase
Case "MAKE_PARTICLE_FIRE"
make_particle_fire();
EndCase
Case "SET_CAMERA_FOV"
SET CAMERA FOV Parametru(1)
EndCase
Case "SET_CAMERA_RANGE"
SET CAMERA RANGE Parametru(1),Parametru(2)
EndCase
Case "SET_CAMERA_VIEW"
SET CAMERA VIEW Parametru(1),Parametru(2),Parametru(3),Parametru(4)
EndCase
Case "SET_CAMERA_ASPECT"
SET CAMERA ASPECT Parametru(1)
EndCase
Case "CONTROL_CAMERA_USING_ARROWKEYS "
CONTROL CAMERA USING ARROWKEYS Parametru(1),Parametru(2),Parametru(3)
EndCase
Case "SHOW_MOUSE"
show mouse
EndCase
Case "HIDE_MOUSE"
hide mouse
EndCase
Case "POSITION_MOUSE"
position mouse Parametru(1),Parametru(2)
EndCase
Case "MAKE_MWORLD"
MAKE MATRIX Parametru(1),Parametru(2),Parametru(3),5,5
EndCase
Case "DELETE_MWORLD"
DELETE MATRIX Parametru(1)
EndCase
Case "TEXTURE_MWORLD"
PREPARE MATRIX TEXTURE Parametru(1),Parametru(2),1,1
EndCase
Case "POSITION_MWORLD"
POSITION MATRIX Parametru(1),Parametru(2),Parametru(3),Parametru(4)
EndCase
Case "RANDOMIZE_MWORLD "
RANDOMIZE MATRIX Parametru(1),Parametru(2)
EndCase
Case "GHOST_MWORLD_ON "
GHOST MATRIX ON Parametru(1)
EndCase
Case "GHOST_MWORLD_OFF"
GHOST MATRIX OFF Parametru(1)
EndCase
Case "SET_MWORLD_WIREFRAME_ON"
SET MATRIX WIREFRAME ON Parametru(1)
EndCase
Case "SET_MWORLD_WIREFRAME_OFF"
SET MATRIX WIREFRAME OFF Parametru(1)
EndCase
CASE "UPDATE_MWORLD"
update matrix Parametru(1)
endcase
Case "DELETE_OBJECT"
delete object Parametru(1)
EndCase
Case "SHOW_OBJECT"
show object Parametru(1)
EndCase
Case "HIDE_OBJECT"
hide object Parametru(1)
EndCase
Case "POSITION_OBJECT "
POSITION OBJECT Parametru(1),Parametru(2),Parametru(3),Parametru(4)
EndCase
`Case "SCALE_OBJECT"
`SCALE OBJECT Parametru(1),Prametru(2),Parametru(3),Parametru(4)
`EndCase
`Case "ROTATE_OBJECT"
`ROTATE OBJECT Parametru(1),Prametru(2),Parametru(3),Parametru(4)
`EndCase
Case "MOVE_OBJECT"
MOVE OBJECT Parametru(1),Parametru(2)
EndCase
Case "XROTATE_OBJECT "
XROTATE OBJECT Parametru(1),Parametru(2)
EndCase
Case "YROTATE_OBJECT"
YROTATE OBJECT Parametru(1),Parametru(2)
EndCase
Case "ZROTATE_OBJECT"
ZROTATE OBJECT Parametru(1),Parametru(2)
EndCase
Case "CONTROL_OBJECT"
ctr_obj()
endcase
Case "MAKE_CONE"
make_cone()
endcase
CASE "MAKE_SPHERE"
make_sphere()
endcase
Case "LOOP_ROTATE"
loop_rotate()
endcase
Case "TEXTURE_OBJECT"
texture_object()
endcase
Case ""
EndCase
EndSelect
Command$=""
j=1
while j<=9
Parametru(j)=0;
Parametru$(j)="";
j=j+1
endwhile
AFostGasitParametru=0
endif
i=i+1
endwhile
endfunction
FUNCTION InterFisier(scr$)
open to read 1, scr$
do
read string 1, MyText$
If MyText$ = "END" then exitfunction
interlinie(MyText$)
if escapekey() = 1 then end
loop
close file 1
ENDFUNCTION
function ctr_obj()
s#=Parametru(2)
a#=Parametru(3)
dist#=Parametru(4)
height#=Parametru(5)
smooth=Parametru(6)
do
if upkey() then move object Parametru(1),s#
if downkey() then move object Parametru(1),-s#
if leftkey() then yrotate object Parametru(1),wrapvalue(object angle y(1)-a#)
if rightkey() then yrotate object Parametru(1),wrapvalue(object angle y(1)+a#)
set camera to follow object position x(Parametru(1)),object position y(Parametru(1)),object position z(Parametru(1)),object angle y(Parametru(1)),dist#,height#,smooth,0
if escapekey() = 1 then end
loop
endfunction
function make_cube()
make object cube Parametru(1),Parametru(2)
endfunction
function load_tworld()
if file open(7) then close file 7
open to read 7,"library/a_scripts/load_tworld.txt"
read string 7,tworld$
close file 7
make terrain 1,tworld$
endfunction
function make_mworld()
make matrix Parametru(1),Parametru(2),Parametru(3),Parametru(4),Parametru(5)
endfunction
function load_object()
load object Parametru$(1),Parametru(1)
endfunction
function window_on()
set window on
endfunction
function window_title()
set window title Parametru$(1)
endfunction
function load_tworld_texture()
if file open(8) then close file 8
open to read 8,"library/a_scripts/load_tworld_texture.txt"
read string 8,tworld_texture$
close file 8
load image tworld_texture$,700
texture terrain 1,700
endfunction
function frame_rate_on()
sync on
endfunction
function set_frame_rate()
if file open(9) then close file 9
open to read 9,"library/a_scripts/set_frame_rate.txt"
read string 9,sfr$
close file 9
sync rate val(sfr$)
endfunction
function object_collision()
if object exist(1) then automatic object collision 1,1,1
endfunction
function texture_mworld()
if file open(10) then close file 10
open to read 10,"library/a_scripts/texture_mworld.txt"
read string 10,texture$
close file 10
load image texture$,9499
if matrix exist(1) then prepare matrix texture 1,9499,1,1
endfunction
function screenout()
text Parametru(1),Parametru(2),Parametru$(1)
endfunction
function bomb_particles()
for p=123456 to 123460
make particles p,0,Parametru(4),Parametru(5)
color particles p,rnd(255)*tan(12),rnd(255)*tan(7),rnd(255)*tan(22)
rotate particles p,rnd(5000)*htan(6),rnd(5000)*htan(12),rnd(5000)
set particle emissions p,rnd(255)
set particle floor p,rnd(200)
set particle gravity p,15*hsin(10)
position particles p,Parametru(1),Parametru(2),Parametru(3)
next p
endfunction
function make_particles()
make particles Parametru(1),Parametru(2),Parametru(3),Parametru(4)
color particles 1,255,0,0
rotate particles 1,90,0,0
Set particle life 1,75
Set particle speed 1,0.004
endfunction
function make_particles_fountain()
MAKE PARTICLES Parametru(1),0,1000,Parametru(5)
SET PARTICLE GRAVITY Parametru(1),0
color particles Parametru(1),0,0,500
Position Particles Parametru(1),Parametru(2),Parametru(3),Parametru(4)
endfunction
function make_particle_fire()
MAKE PARTICLES Parametru(1),0,1000,Parametru(2)
SET PARTICLE GRAVITY Parametru(1),3
SET PARTICLE CHAOS Parametru(1),5
SET PARTICLE EMISSIONS Parametru(1),10000
SET PARTICLE SPEED Parametru(1),0.001
color particles Parametru(1),200,10,0
set particle life Parametru(1),10
endfunction
function make_cone()
make object cone Parametru(1),Parametru(2)
endfunction
function make_sphere()
make object sphere Parametru(1),Parametru(2)
endfunction
Function Hide_Window()
Hide Window
endfunction
Function Show_Window()
show window
endfunction
function Window_size()
set window size Parametru(1),Parametru(2)
endfunction
function loop_rotate()
do
if spacekey() = 1 then yrotate object 1,object angle y(1) + 0.4
loop
endfunction
function texture_object()
texture object Parametru(1),Parametru(2_
endfunction