'PRO 'By Dano Wilson 'Mako studios 2005 'POLITICAL 'This is where loading, saving of maps happens etc, sorting, game rules 'constants Global Const MAX_TEXTURES = 20 'always players+10, so that there are enough avatar textures, unless this is a custom non-avatar client Global Const MAX_SPRITES = 30 Global Const MAX_PLAYERS = 10 Global Const MAX_MISSILES = 200 Global Const PLAYER_START_TEXTURE = 11 'the first texture where our database of avatars begin 'security clearance for loading maps Global SECURITY_CODE, SECURITY_MATCH 'console typing Global glCinput$ 'official map data Global Const MaxBlocks = 200 Global Const MaxSpawns = 20 Global Const MaxAreas = 50 Global Const MaxSpheres = 50 Public Type BLOCK_TYPE x As Double y As Double z As Double xd As Double yd As Double zd As Double t As Integer texture1 As Integer texture2 As Integer texture3 As Integer texture4 As Integer texture5 As Integer texture6 As Integer End Type Public Type SPAWN_TYPE x As Double y As Double z As Double hor As Double bar As Double ver As Double t As Integer gravity As Integer End Type Public Type AREA_TYPE x As Double y As Double z As Double xd As Double yd As Double zd As Double t As Integer value As Integer End Type Public Type SPHERE_TYPE x As Double y As Double z As Double radius As Double texture As Integer End Type Public block(MaxBlocks) As BLOCK_TYPE Public spawn(MaxSpawns) As SPAWN_TYPE Public area(MaxAreas) As AREA_TYPE Public sphere(MaxSpheres) As SPHERE_TYPE Public MapName$ Public MapInfo$ 'knowledge of maximum to scan Global BLOCKS, AREAS, SPHERES, SPAWNS 'button currents, for ease of use Global KEY_FORWARD Global KEY_BACK Global KEY_LEFT Global KEY_RIGHT Global KEY_JUMP Global KEY_FIRE Global KEY_ROCKET Global KEY_FAN Global KEY_PLASMA Global KEY_SHOTGUN Global KEY_MACHINEGUN Global KEY_RAIL Global KEY_GRENADE Global KEY_SPECIAL Global KEY_NEXT Global KEY_PREV Global KEY_RIFLE Global KEY_NOGUN 'client database Public Type PERSON_TYPE Name As String Score As Integer Team As Integer Avatar As String PAC As String AvatarState As Integer End Type Global person(MAX_PLAYERS) As PERSON_TYPE Global MaxPeople As Integer 'work out the maximum people for drawing and scanning, to save cpu Global MaxMissiles As Integer 'work out maximum missiles to save cpu 'match Global MATCH_COUNTDOWN 'how many seconds left until the match begins Global MATCH_STATE 'same as server, 0 is none, 1 is countdown, 2 is playing, 3 is aftermath 'rail colors Global RailRed(9) Global RailGreen(9) Global RailBlue(9) 'scumbag - last person to hit us! Global SCUMBAG$ Global SCUMBAGGUN$ Global SCUMBAGVARIATION$ Global SCUMBAGSPECIAL$ Global SCUMBAGID 'the id of the scumbag, so we know where his avatar is and stuff Global SCUMBAGAVATAR 'the avatar texture id of the scumbag 'stuff Global MESSAGE$ Global AutoComplete$ Global AutoSuggestion$ Global gunname$, gunvariation$, gunshortname$ Public Sub GetMaxValues() 'get the maximum values of blocks etc so that we dont have to scan or draw them all in the loop to make it faster BLOCKS = 0 For x = 0 To MaxBlocks If block(x).t <> 0 Then BLOCKS = x Next x AREAS = 0 For x = 0 To MaxAreas If area(x).t <> 0 Then AREAS = x Next x SPHERES = 0 For x = 0 To MaxSpheres If sphere(x).radius <> 0 Then SPHERES = x Next x SPAWNS = 0 For x = 0 To MaxSpawns If spawn(x).t <> 0 Then SPAWNS = x Next x End Sub Public Sub LOAD_MAP(filename As String) On Error GoTo ErrLoad 'load the map filename = LCase$(filename) If Right$(filename, 4) <> ".pro" Then filename = filename & ".pro" Open "map/" & filename For Input As #1 Do While Not EOF(1) Input #1, MapName$ Input #1, MapInfo$ For A = 0 To MaxBlocks Input #1, block(A).x, block(A).y, block(A).z, block(A).xd, block(A).yd, block(A).zd, block(A).t, block(A).texture1, block(A).texture2, block(A).texture3, block(A).texture4, block(A).texture5, block(A).texture6 Next A For A = 0 To MaxSpawns Input #1, spawn(A).x, spawn(A).y, spawn(A).z, spawn(A).hor, spawn(A).ver, spawn(A).bar, spawn(A).t, spawn(A).gravity Next A For A = 0 To MaxAreas Input #1, area(A).x, area(A).y, area(A).z, area(A).xd, area(A).yd, area(A).zd, area(A).t, area(A).value Next A For A = 0 To MaxSpheres Input #1, sphere(A).x, sphere(A).y, sphere(A).z, sphere(A).radius, sphere(A).texture Next A Loop Close #1 AddConsole "Loaded map " & Chr(34) & filename & Chr(34) & "" 'work out the totals for faster scanning GetMaxValues Exit Sub ErrLoad: AddError "Could not load map " & Chr(34) & filename & Chr(34) & "" LAST_STATUS$ = LAST_CONSOLE$ End Sub Public Sub QUIT_PEACEFULLY() 'quit in a peaceful way (disconnect properly) If CONNECTION >= 1 Then DISCONNECT End Sub Public Sub BEGIN_GAME() PLAY = 0 CONNECTION = 0 GAME = 1 IDLE = 0 PLAYER_TEAM = 0 PLAYER_ID = -1 COLORPAC$ = "12345" SEL_INST = 0 REMOTE_CONSOLE = 0 MOUSE_ON = 1 PLAYER_SCORE = 0 PLAYER_AVATAR = "" MATCH_COUNTDOWN = 0 MATCH_STATE = 0 MaxPeople = 0 InMagnaBeam = 0 PACKETS_RECEIVED = 0 PACKETS_SENT = 0 TOTAL_PACKETS_RECEIVED = 0 TOTAL_PACKETS_SENT = 0 PLAYER_RELOAD = 0 PLAYER_HEALTH = 100 OUT_OF_AMMO = 0 ECHO = 1 'set pro colors x = 0: ProRed(x) = 255: ProGreen(x) = 0: ProBlue(x) = 0 x = 1: ProRed(x) = 0: ProGreen(x) = 0: ProBlue(x) = 255 x = 2: ProRed(x) = 0: ProGreen(x) = 255: ProBlue(x) = 0 x = 3: ProRed(x) = 255: ProGreen(x) = 255: ProBlue(x) = 0 x = 4: ProRed(x) = 255: ProGreen(x) = 0: ProBlue(x) = 255 x = 5: ProRed(x) = 175: ProGreen(x) = 100: ProBlue(x) = 255 x = 6: ProRed(x) = 10: ProGreen(x) = 10: ProBlue(x) = 10 x = 7: ProRed(x) = 255: ProGreen(x) = 255: ProBlue(x) = 255 x = 8: ProRed(x) = 140: ProGreen(x) = 110: ProBlue(x) = 50 x = 9: ProRed(x) = 128: ProGreen(x) = 128: ProBlue(x) = 128 x = 10: ProRed(x) = 150: ProGreen(x) = 255: ProBlue(x) = 0 x = 11: ProRed(x) = 64: ProGreen(x) = 64: ProBlue(x) = 64 x = 12: ProRed(x) = 192: ProGreen(x) = 192: ProBlue(x) = 192 x = 13: ProRed(x) = 255: ProGreen(x) = 175: ProBlue(x) = 235 x = 14: ProRed(x) = 247: ProGreen(x) = 232: ProBlue(x) = 205 x = 15: ProRed(x) = 150: ProGreen(x) = 0: ProBlue(x) = 0 x = 16: ProRed(x) = 0: ProGreen(x) = 255: ProBlue(x) = 235 x = 17: ProRed(x) = 0: ProGreen(x) = 150: ProBlue(x) = 0 x = 18: ProRed(x) = 0: ProGreen(x) = 0: ProBlue(x) = 150 x = 19: ProRed(x) = 90: ProGreen(x) = 60: ProBlue(x) = 0 x = 20: ProRed(x) = 255: ProGreen(x) = 0: ProBlue(x) = 185 'set rail colors x = 0: RailRed(x) = 255: RailGreen(x) = 30: RailBlue(x) = 30 x = 1: RailRed(x) = 30: RailGreen(x) = 30: RailBlue(x) = 255 x = 2: RailRed(x) = 30: RailGreen(x) = 255: RailBlue(x) = 30 x = 3: RailRed(x) = 255: RailGreen(x) = 255: RailBlue(x) = 30 x = 4: RailRed(x) = 255: RailGreen(x) = 30: RailBlue(x) = 255 x = 5: RailRed(x) = 175: RailGreen(x) = 100: RailBlue(x) = 255 x = 6: RailRed(x) = 255: RailGreen(x) = 235: RailBlue(x) = 0 x = 7: RailRed(x) = 30: RailGreen(x) = 255: RailBlue(x) = 255 x = 8: RailRed(x) = 90: RailGreen(x) = 150: RailBlue(x) = 255 x = 9: RailRed(x) = 30: RailGreen(x) = 80: RailBlue(x) = 255 'erase client data For x = 0 To MAX_PLAYERS person(x).Avatar = "" person(x).Name = "" person(x).PAC = "" person(x).Score = 0 person(x).Team = 0 person(x).AvatarState = 0 Next x 'erase config lines For x = 0 To 100 ConsoleLine(x) = "" ConsoleColor(x) = 0 Next x 'default config and rules SET_CONFIG SetCursorPos centerx, centery OnlyJustBegun = 1 'this is pro, start off in the console by default CONSOLE = 1 SMALL_CONSOLE = 0 glCinput$ = "" 'first boot preparing before the loop happens AddConsole "Pro Client " & VERSION$ Call DEFAULT_CONFIG LOAD_CONFIG "start.conf" 'get picmap picmap = 1 If CONF(CONF_PICMAP).value = 1 Then picmap = 1 If CONF(CONF_PICMAP).value = 2 Then picmap = 2 If CONF(CONF_PICMAP).value = 3 Then picmap = 4 If CONF(CONF_PICMAP).value = 4 Then picmap = 8 If CONF(CONF_PICMAP).value = 5 Then picmap = 16 If CONF(CONF_PICMAP).value = 6 Then picmap = 32 If CONF(CONF_PICMAP).value = 7 Then picmap = 64 If CONF(CONF_PICMAP).value = 8 Then picmap = 128 If CONF(CONF_PICMAP).value = 9 Then picmap = 256 'particles For x = 0 To MAX_SPARKS spark(x).orbit = 0 Next x 'get screen center centerx = CONF(CONF_SCREENMODEX).value / 2: centery = CONF(CONF_SCREENMODEY).value / 2 If gl_resx > 0 And gl_resy > 0 Then centerx = Int(gl_resx / 2): centery = Int(gl_resy / 2) 'load default map LOAD_MAP "a" RESET_MOVEMENT START_VALUES SCUMBAG$ = "": SCUMBAGID = -1: SCUMBAGAVATAR = 0 'load sprites SET_SPRITES 'er I forgot what this is CENTERED.x = 0: CENTERED.y = 0: CENTERED.z = 0 'start the socket BEGIN_SOCKET AddConsole "Socket started on port " & PRO.SOCKET.LocalPort & "." End Sub Public Sub RESET_MOVEMENT() 'this will generally stop movement for someone who has just respawned. It will set default values 'because this sets defaults, you might want to override and set things again after, such as matrix, angles etc MATRIX = 1 FLOOR = 0 SPEED_HOR = 0 SPEED_VER = 0 SPEED_BAR = 0 FACING.x = 0: FACING.y = 0: FACING.z = 0: FACING.hor = 0: FACING.bar = 0: FACING.ver = 0 TRAVEL.x = 0: TRAVEL.y = 0: TRAVEL.z = 0: TRAVEL.hor = 0: TRAVEL.bar = 0: TRAVEL.ver = 0 PLAYER_X = 0 PLAYER_Y = 0.35 PLAYER_Z = 0 OLD_X = PLAYER_X OLD_Y = PLAYER_Y OLD_Z = PLAYER_Z PLAYER_GUN = 4 PLAYER_VARIATION = 1 PLAYER_SPECIAL = 1 PLAYER_TAIL_HOR = 0 PLAYER_TAIL_VER = 0 PLAYER_TAIL_BAR = 0 PLAYER_RELOAD = 0 RECOIL = 0 RecoilSpeed = 0 RecoilSide = 0 'get roster score ROSTER_SCORE = 0 GetRosterScore SmoothMouseX = 0: SmoothMouseY = 0 SlideX = 0: SlideY = 0 'reset the guns from the roster ResetGuns CHANGING_GUN = 0 CHANGE_TO_GUN = 0 GUN_SPRING = 0 SPRING_SPEED = 0 SPRING_GRAVITY = 0 End Sub Public Sub ResetGuns() 'reset all the guns and ammo according to our roster and settings ROCKET_LAUNCHER = CONF(R_ROCKET_LAUNCHER).value FAN_CANNON = CONF(R_FAN_CANNON).value FORK_GUN = CONF(R_FORK_GUN).value SHOTGUN = CONF(R_SHOTGUN).value RIFLE = CONF(R_RIFLE).value RAIL_GUN = CONF(R_RAIL_GUN).value MACHINEGUN = CONF(R_MACHINEGUN).value GRENADE_LAUNCHER = CONF(R_GRENADE_LAUNCHER).value SPECIAL_GUN = CONF(R_SPECIAL_GUN).value ROCKETS = CONF(R_ROCKETS).value FANS = CONF(R_FANS).value PLASMA = CONF(R_PLASMA).value SHELLS = CONF(R_SHELLS).value SUPERBULLETS = CONF(R_SUPERBULLETS).value SLUGS = CONF(R_SLUGS).value BULLETS = CONF(R_BULLETS).value GRENADES = CONF(R_GRENADES).value LIGHTNING = CONF(R_LIGHTNING).value End Sub Public Sub GetRosterScore() 'work out how many points we've spent on guns and equipment! ROSTER_SCORE = 0 'fan cannons If CONF(R_FAN_CANNON).value = 1 Then ROSTER_SCORE = ROSTER_SCORE + 275 'modern If CONF(R_FAN_CANNON).value = 2 Then ROSTER_SCORE = ROSTER_SCORE + 250 'hymene If CONF(R_FAN_CANNON).value = 3 Then ROSTER_SCORE = ROSTER_SCORE + 200 'vintage 'fan type A = 0 If CONF(R_FAN_TYPE).value = 1 Then A = 6 'modern fans If CONF(R_FAN_TYPE).value = 2 Then A = 5 'hymene fans If CONF(R_FAN_TYPE).value = 3 Then A = 4 'vintage fans 'fans If CONF(R_FANS).value >= 1 And CONF(R_FAN_CANNON).value >= 1 Then ROSTER_SCORE = ROSTER_SCORE + (CONF(R_FANS).value * A) 'rocket launchers If CONF(R_ROCKET_LAUNCHER).value = 1 Then ROSTER_SCORE = ROSTER_SCORE + 250 'modern If CONF(R_ROCKET_LAUNCHER).value = 2 Then ROSTER_SCORE = ROSTER_SCORE + 250 'mac-1 If CONF(R_ROCKET_LAUNCHER).value = 3 Then ROSTER_SCORE = ROSTER_SCORE + 225 'vintage brawl 'rocket type A = 0 If CONF(R_ROCKET_TYPE).value = 1 Then A = 4 'rockets If CONF(R_ROCKETS).value >= 1 And CONF(R_ROCKET_LAUNCHER).value >= 1 Then ROSTER_SCORE = ROSTER_SCORE + (CONF(R_ROCKETS).value * A) 'shotguns If CONF(R_SHOTGUN).value = 1 Then ROSTER_SCORE = ROSTER_SCORE + 120 'pump action If CONF(R_SHOTGUN).value = 2 Then ROSTER_SCORE = ROSTER_SCORE + 80 'double barrel 'shotgun shell type (matches shotgun) A = 0 If CONF(R_SHOTGUN).value = 1 Then A = 2 'for pump action If CONF(R_SHOTGUN).value = 2 Then A = 3 'for double barrel 'shells If CONF(R_ROCKETS).value >= 1 And CONF(R_ROCKET_LAUNCHER).value >= 1 Then ROSTER_SCORE = ROSTER_SCORE + (CONF(R_ROCKETS).value * A) 'scopes If CONF(R_SCOPE_GUN1).value >= 1 Then If CONF(R_SCOPE_TYPE1).value = 1 Then ROSTER_SCORE = ROSTER_SCORE + 30 If CONF(R_SCOPE_TYPE1).value = 2 Then ROSTER_SCORE = ROSTER_SCORE + 50 If CONF(R_SCOPE_TYPE1).value = 3 Then ROSTER_SCORE = ROSTER_SCORE + 75 If CONF(R_SCOPE_TYPE1).value = 4 Then ROSTER_SCORE = ROSTER_SCORE + 110 If CONF(R_SCOPE_TYPE1).value = 5 Then ROSTER_SCORE = ROSTER_SCORE + 150 End If If CONF(R_SCOPE_GUN2).value >= 1 Then If CONF(R_SCOPE_TYPE2).value = 1 Then ROSTER_SCORE = ROSTER_SCORE + 30 If CONF(R_SCOPE_TYPE2).value = 2 Then ROSTER_SCORE = ROSTER_SCORE + 50 If CONF(R_SCOPE_TYPE2).value = 3 Then ROSTER_SCORE = ROSTER_SCORE + 75 If CONF(R_SCOPE_TYPE2).value = 4 Then ROSTER_SCORE = ROSTER_SCORE + 110 If CONF(R_SCOPE_TYPE2).value = 5 Then ROSTER_SCORE = ROSTER_SCORE + 150 End If If CONF(R_SCOPE_GUN3).value >= 1 Then If CONF(R_SCOPE_TYPE3).value = 1 Then ROSTER_SCORE = ROSTER_SCORE + 30 If CONF(R_SCOPE_TYPE3).value = 2 Then ROSTER_SCORE = ROSTER_SCORE + 50 If CONF(R_SCOPE_TYPE3).value = 3 Then ROSTER_SCORE = ROSTER_SCORE + 75 If CONF(R_SCOPE_TYPE3).value = 4 Then ROSTER_SCORE = ROSTER_SCORE + 110 If CONF(R_SCOPE_TYPE3).value = 5 Then ROSTER_SCORE = ROSTER_SCORE + 150 End If 'stability If CONF(R_STABILITY).value >= 1 Then If CONF(R_STABILITY_LEVEL).value >= 1 Then A = CONF(R_STABILITY_LEVEL).value * 10 A = A + 10 ROSTER_SCORE = ROSTER_SCORE + A 'this means 10 base price, and 10 for each level of stability all the way up to 10, so this costs between 20 and 110 points End If End If End Sub Public Sub START_VALUES() 'reset databases of missiles, and players, etc For x = 0 To MAX_MISSILES With missile(x) .bar = 0 .curve = 0 .hor = 0 .orbit = 0 .power = 0 .special = 0 .speed = 0 .t = 0 .variation = 0 .ver = 0 .weight = 0 .x = 0 .y = 0 .z = 0 .owner = "" .spin = 0 .speedx = 0 .speedy = 0 .speedz = 0 End With Next x MaxMissiles = 0 'erase client data For x = 0 To MAX_PLAYERS person(x).Avatar = "" person(x).Name = "" person(x).PAC = "" person(x).Score = 0 person(x).Team = 0 person(x).AvatarState = 0 Next x MaxPeople = 0 For x = 0 To MAX_SLUGS slug(x).t = 0 slug(x).orbit = 0 Next x End Sub Public Sub GetGunType() 'work out the name of your gun, for a laugh gunname$ = "N/A" gunvariation$ = "N/A" gunshortname$ = "N/A" If PLAYER_GUN = 1 Then If PLAYER_VARIATION = 1 Then gunname$ = "Rocket Launcher": gunvariation$ = "Standard": gunshortname$ = "Rocket" If PLAYER_VARIATION = 2 Then gunname$ = "Rocket Launcher": gunvariation$ = "MAC-1": gunshortname$ = "Mac-1" If PLAYER_VARIATION = 3 Then gunname$ = "Rocket Launcher": gunvariation$ = "Brawl": gunshortname$ = "Brawl Rocket" End If If PLAYER_GUN = 2 Then If PLAYER_VARIATION = 1 Then gunname$ = "Fan Cannon": gunvariation$ = "Modern Standard": gunshortname$ = "Pro Fan" If PLAYER_VARIATION = 1 Then gunname$ = "Fan Cannon": gunvariation$ = "Hymene Classic": gunshortname$ = "Hymene Fan" If PLAYER_VARIATION = 1 Then gunname$ = "Fan Cannon": gunvariation$ = "Antique Vintage": gunshortname$ = "Antique" If PLAYER_VARIATION = 1 Then gunname$ = "Fan Cannon": gunvariation$ = "Mochopilan": gunshortname$ = "Mochilop" End If If PLAYER_GUN = 3 Then If PLAYER_VARIATION = 1 Then gunname$ = "Fork Gun": gunvariation$ = "": gunshortname$ = "Fork" If PLAYER_VARIATION = 2 Then gunname$ = "Plasma Gun": gunvariation$ = "": gunshortname$ = "Plasma" End If If PLAYER_GUN = 4 Then If PLAYER_VARIATION = 1 Then gunname$ = "Shotgun": gunvariation$ = "Pump Action": gunshortname$ = "Shotty" If PLAYER_VARIATION = 1 Then gunname$ = "Shotgun": gunvariation$ = "Double Barrel": gunshortname$ = "Shotty" End If If PLAYER_GUN = 5 Then If PLAYER_VARIATION = 1 Then gunname$ = "Rifle": gunvariation$ = "Standard": gunshortname$ = "Rifle" End If If PLAYER_GUN = 6 Then If PLAYER_VARIATION = 1 Then gunname$ = "Grenade Launcher": gunvariation$ = "Standard": gunshortname$ = "Grenade" End If If PLAYER_GUN = 7 Then If PLAYER_VARIATION = 1 Then gunname$ = "Machinegun": gunvariation$ = "Standard": gunshortname$ = "Machine" End If If PLAYER_GUN = 8 Then If PLAYER_VARIATION = 1 Then gunname$ = "Rail Gun": gunvariation$ = "Standard": gunshortname$ = "Rail" End If If PLAYER_GUN = 9 Then If PLAYER_VARIATION = 1 Then gunname$ = "Special Gun": gunvariation$ = "Lightning": gunshortname$ = "Lightning" End If End Sub 'Pro Client 'Socket Code 'By Chalcedony 2008 'for download avatars Public Declare Function URLDownloadToFile Lib "urlmon" Alias _ "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, _ ByVal szFileName As String, ByVal dwReserved As Long, _ ByVal lpfnCB As Long) As Long Global PAC$ 'the packet to send Global COLORPAC$ 'the 5-char section of colors for the pac line Global PACKET As String 'for building packets Global sRemoteIP As String 'temps... Global sRemoteHost As String Global sRemotePort Global sLocalPort Global OTHER 'for classic packet chopper-upper 'important server variables that we must know before becoming officially connected Global SERVER_NAME As String Global SERVER_MAP As String Global SERVER_GAMETYPE As String Global SERVER_SCORELIMIT As Integer Global SERVER_MAXPOINTS As Integer Global SERVER_SECURITYCODE As Double 'other stuff Global SERVER_NO_PASSWORD_NEEDED '=0 by default, =1 if we know theres no password, =2 if we need a password! Global NextPacket 'for knowing when to send the next PAC line Global THEAVATAR$ Global URL$ 'current ping Global PING 'statistics Global TOTAL_PACKETS_RECEIVED Global TOTAL_PACKETS_SENT Global PACKETS_RECEIVED Global PACKETS_SENT 'remote console Global REMOTE_CONSOLE '=1 means that we are sending the server all our output Public Sub ADD_AVATAR(AvatarName As String, AvatarURL As String) 'add this to the database in a pac-line fashion 'read the team line BUFFER 'TEAM:1:Chalcedony:23 Dim WhatName As String Dim lastbloke As Integer WhatName = AvatarName 'now add the data or the person in the same way we'd add a pac line 'do we already have this name in our database? A = -1 lastbloke = -1 MaxPeople = 0 For x = 0 To MAX_PLAYERS 'work out MaxPeople here If person(x).Name <> "" Then MaxPeople = x If LCase(person(x).Name) = LCase(WhatName) And WhatName <> "" Then 'found it A = x End If 'work out where to add if we need to add him If person(x).Name = "" And lastbloke = -1 Then lastbloke = x Next x 'not found? add him If lastbloke = -1 Then lastbloke = MAX_PLAYERS: MaxPeople = MAX_PLAYERS If A = -1 Then A = lastbloke 'set state to 1 if avatar is new If person(A).Avatar <> AvatarURL Then person(A).AvatarState = 1 'add the avatar url and name! person(A).Name = WhatName person(A).Avatar = AvatarURL 'if we're idle and we have DOWNLOAD ON, try to download this avatar right now If IDLE = 1 And CONNECTION = 1 And PLAY = 0 And CONF(DOWNLOAD_AVATARS).value = 1 Then DOWNLOAD_AVATAR (A) End If End Sub Public Sub BEGIN_SOCKET() 'reset statistics PACKETS_RECEIVED = 0 PACKETS_SENT = 0 'start the socket, get all the shit out the way PRO.SOCKET.Close PRO.SOCKET.LocalPort = CONF(CONF_LOCAL_PORT).value PRO.SOCKET.Bind PRO.SOCKET.LocalPort 'send the dummy packet thing that starts it off On Local Error GoTo DummyPacket BUFFER = "Nap time for all has been declared!" PRO.SOCKET.SendData BUFFER DummyPacket: End Sub Public Sub BUILD_PAC_LINE() 'build the pac line depending on our player info '@500005000050000500500500505050123412345John '----------------------------------------------------- '@ Indicate it is a PAC line '50000 x position '50000 y position '50000 z position '500 hor rotation '500 ver rotation '500 bar rotation '50 hor TAIL '50 ver TAIL '50 bar TAIL '1 GUN TYPE '2 GUN VARIATION '3 SPECIAL (usually 0, lightning/rail etc) '4 TEAM (0 for none, 1 for blue, 2 for red) '1 SKIN colour '2 BODY colour '3 HORN & SPIKE colour '4 ARM colour '5 TAIL colour 'John Name '----------------------------------------------------- Dim v As Double Dim p As String PAC$ = "@" 'X co-ordinate v = Int(PLAYER_X * 100): v = v + 50000 'If DEAD = 1 Then v = 2 If v >= 99999 Then Let v = 99999 If v <= 0 Then Let v = 0 p = v If v < 10000 Then Let p = "0" & p If v < 1000 Then Let p = "0" & p If v < 100 Then Let p = "0" & p If v < 10 Then Let p = "0" & p PAC$ = PAC$ + p 'Y co-ordinate v = Int(PLAYER_Y * 100): v = v + 50000 'If DEAD = 1 Then v = 3 If v >= 99999 Then Let v = 99999 If v <= 0 Then Let v = 0 p = v If v < 10000 Then Let p = "0" & p If v < 1000 Then Let p = "0" & p If v < 100 Then Let p = "0" & p If v < 10 Then Let p = "0" & p PAC$ = PAC$ + p 'Z co-ordinate v = Int(PLAYER_Z * 100): v = v + 50000 If v >= 99999 Then Let v = 99999 If v <= 0 Then Let v = 0 p = v If v < 10000 Then Let p = "0" & p If v < 1000 Then Let p = "0" & p If v < 100 Then Let p = "0" & p If v < 10 Then Let p = "0" & p PAC$ = PAC$ + p 'hor v = Int((FACING.hor / 3.6) * 10) If v >= 999 Then v = 999 If v <= 0 Then v = 0 p = v If v < 100 Then Let p = "0" & p If v < 10 Then Let p = "0" & p PAC$ = PAC$ + p 'ver v = Int((FACING.ver / 3.6) * 10) If v >= 999 Then v = 999 If v <= 0 Then v = 0 p = v If v < 100 Then Let p = "0" & p If v < 10 Then Let p = "0" & p PAC$ = PAC$ + p 'bar v = Int((FACING.bar / 3.6) * 10) If v >= 999 Then v = 999 If v <= 0 Then v = 0 p = v If v < 100 Then Let p = "0" & p If v < 10 Then Let p = "0" & p PAC$ = PAC$ + p 'tail hor v = Int((PLAYER_TAIL_HOR / 3.6) * 1) If v >= 99 Then v = 99 If v <= 0 Then v = 0 p = v If v < 10 Then Let p = "0" & p PAC$ = PAC$ + p 'tail ver v = Int((PLAYER_TAIL_VER / 3.6) * 1) If v >= 99 Then v = 99 If v <= 0 Then v = 0 p = v If v < 10 Then Let p = "0" & p PAC$ = PAC$ + p 'tail bar v = Int((PLAYER_TAIL_BAR / 3.6) * 1) If v >= 99 Then v = 99 If v <= 0 Then v = 0 p = v If v < 10 Then Let p = "0" & p PAC$ = PAC$ + p 'gun PAC$ = PAC$ & Int(PLAYER_GUN) 'gun variation PAC$ = PAC$ & Int(PLAYER_VARIATION) 'special PAC$ = PAC$ & Int(PLAYER_SPECIAL) 'team PAC$ = PAC$ & Int(PLAYER_TEAM) 'colors PAC$ = PAC$ & COLORPAC$ 'name PAC$ = PAC$ & WCONF(PLAYER_NAME).CHAR End Sub Public Sub CHECK_CONNECTION() 'we have received some server data. Check to see if we have it all, and if we can connect. CanDo = 1 If SERVER_NAME = "" Then CanDo = 0 If SERVER_MAP = "" Then CanDo = 0 If SERVER_GAMETYPE = "" Then CanDo = 0 If SERVER_SCORELIMIT = -1 Then CanDo = 0 If SERVER_MAXPOINTS = -1 Then CanDo = 0 If SERVER_SECURITYCODE = -1 Then CanDo = 0 If CanDo = 1 Then 'got everything? try to become idle, unless we haven't sent the password If CONNECTION = 2 And SERVER_NO_PASSWORD_NEEDED = 1 Then SEND_PACKET "CLIENT_IDLE" End If If CONNECTION = 3 Or SERVER_NO_PASSWORD_NEEDED = 2 Then SEND_PACKET "PRIVATE_PASSWORD:" & WCONF(PASSWORD).CHAR End If End If End Sub Public Sub CONNECT_TO_SERVER(WhatHost As String, WhatPort) 'attempt to connect to the server On Local Error GoTo ConnectServerError 'firstly, disconnect if we are already connected If CONNECTION >= 1 Then DISCONNECT 'message AddConsole "Connecting to " & WhatHost & ":" & WhatPort & "" LAST_STATUS$ = LAST_CONSOLE$ 'set the socket PRO.SOCKET.RemoteHost = WCONF(REMOTE_HOST).CHAR PRO.SOCKET.RemotePort = CONF(CONF_REMOTE_PORT).value BEGIN_SOCKET 'set default game values GAME = 1 IDLE = 0 CONNECTION = 2 REMOTE_CONSOLE = 0 START_VALUES ResetGuns SCUMBAG$ = "": SCUMBAGID = -1: SCUMBAGAVATAR = 0 'reset server info SERVER_NAME = "" SERVER_MAP = "" SERVER_GAMETYPE = "" SERVER_SCORELIMIT = -1 SERVER_MAXPOINTS = -1 SERVER_SECURITYCODE = -1 SERVER_NO_PASSWORD_NEEDED = 0 'other data to reset PLAYER_TEAM = 0 PLAYER_SCORE = 0 PLAYER_AVATAR = "" MATCH_COUNTDOWN = 0 MATCH_STATE = 0 'send the first packet PACKET = "PRO:" & GAME_PROTOCOL$ & ":" & WCONF(PLAYER_NAME).CHAR 'AddConsole PACKET SEND_PACKET PACKET Exit Sub ConnectServerError: AddError "Error connecting to server." LAST_STATUS$ = LAST_CONSOLE$ End Sub Public Sub DISCONNECT() CONNECTION = 0 IDLE = 0 PLAY = 0 REMOTE_CONSOLE = 0 SERVER_NAME = "" SERVER_MAP = "" SERVER_GAMETYPE = "" SERVER_SCORELIMIT = -1 SERVER_MAXPOINTS = -1 SERVER_SECURITYCODE = -1 SERVER_NO_PASSWORD_NEEDED = 0 PLAYER_TEAM = 0 PLAYER_SCORE = 0 PLAYER_AVATAR = "" MATCH_COUNTDOWN = 0 MATCH_STATE = 0 'send quit line SEND_PACKET "QUIT:Leaving" 'erase client data For x = 0 To MAX_PLAYERS person(x).Avatar = "" person(x).Name = "" person(x).PAC = "" person(x).Score = 0 person(x).Team = 0 person(x).AvatarState = 0 Next x LAST_STATUS$ = "Disconnected." RemoteScript "DISCONNECTED" End Sub Public Sub DOWNLOAD_AVATAR(AvatarID) Dim errcode As Long Dim avurl As String Dim localFileName As String 'attempt to download the avatar If AvatarID >= 0 And AvatarID <= MAX_PLAYERS And person(AvatarID).Avatar <> "" Then avurl = person(AvatarID).Avatar localFileName = WCONF(RESOURCE_FOLDER).CHAR & "/texture/avatar" & AvatarID & ".bmp" errcode = URLDownloadToFile(0, avurl, localFileName, 0, 0) If errcode = 0 Then 'AddCustom "Downloaded avatar for " & person(AvatarID).Name & ".", 1 TextureBMP(PLAYER_START_TEXTURE + AvatarID) = localFileName REPLACE_TEXTURE (PLAYER_START_TEXTURE + AvatarID) Else 'AddCustom "Could not download avatar for " & person(AvatarID).Name & ".", 1 End If End If End Sub Public Sub DOWNLOAD_MY_AVATAR() Dim errcode As Long Dim avurl As String Dim localFileName As String 'attempt to download the avatar If PLAYER_AVATAR <> "" Then avurl = PLAYER_AVATAR localFileName = WCONF(RESOURCE_FOLDER).CHAR & "/texture/personal_avatar.bmp" DoEvents errcode = URLDownloadToFile(0, avurl, localFileName, 0, 0) If errcode = 0 Then 'AddCustom "Downloaded personal avatar.", 1 TextureBMP(MAX_TEXTURES) = localFileName 'load the sprite If CONF(LOAD_AVATARS).value = 1 Then REPLACE_TEXTURE MAX_TEXTURES End If Else 'AddCustom "Could not download personal avatar.", 1 End If End If End Sub Public Sub NET_PHYSICS() 'send pac lines If PLAY = 1 And IDLE = 0 Then NextPacket = NextPacket + NL If NextPacket >= CONF(CONF_RATE).value Then SEND_PACKET PAC$ NextPacket = 0 End If End If 'send tickover lines every two seconds If PLAY = 0 And IDLE = 1 Then NextPacket = NextPacket + NL If NextPacket >= 2000 Then SEND_PACKET "TICKOVER" NextPacket = 0 End If End If End Sub Public Sub READ_BUFFER() 'where BUFFER is the raw buffer TOTAL_PACKETS_RECEIVED = TOTAL_PACKETS_RECEIVED + 1 PACKETS_RECEIVED = PACKETS_RECEIVED + 1 'see the raw buffer 'AddConsole "BUFFER: " & BUFFER 'connection-------------------------------------------> 'NO_PASSWORD_NEEDED If BUFFER = "NO_PASSWORD_NEEDED" Then SERVER_NO_PASSWORD_NEEDED = 1 End If 'GREET: If Left(BUFFER, 6) = "GREET:" Then AddCustom Mid(BUFFER, 7), 1 End If 'SERVER: If Left(BUFFER, 7) = "SERVER:" Then SERVER_NAME = Mid(BUFFER, 8) AddCustom "Connected to " & SERVER_NAME & ".", 1 CHECK_CONNECTION End If 'MAXPOINTS: If Left(BUFFER, 10) = "MAXPOINTS:" Then SERVER_MAXPOINTS = Int(Mid(BUFFER, 11)) AddCustom "Max points: " & SERVER_MAXPOINTS, 1 CHECK_CONNECTION End If 'SCORELIMIT: If Left(BUFFER, 11) = "SCORELIMIT:" Then SERVER_SCORELIMIT = Int(Mid(BUFFER, 12)) AddCustom "Frag limit: " & SERVER_SCORELIMIT, 1 CHECK_CONNECTION End If 'MAP: If Left(BUFFER, 4) = "MAP:" Then SERVER_MAP = Mid(BUFFER, 5) AddCustom "Map: " & SERVER_MAP, 1 CHECK_CONNECTION End If 'SECURITYCODE: If Left(BUFFER, 13) = "SECURITYCODE:" Then SERVER_SECURITYCODE = Int(Mid(BUFFER, 14)) AddCustom "Got security code.", 1 CHECK_CONNECTION End If 'GAMETYPE: If Left(BUFFER, 9) = "GAMETYPE:" Then SERVER_GAMETYPE = Mid(BUFFER, 10) AddCustom "Gametype: " & SERVER_GAMETYPE, 1 CHECK_CONNECTION End If '------------------------------------------------------> 'MESSAGE: If Left(BUFFER, 8) = "MESSAGE:" Then AddCustom Mid(BUFFER, 9), 1 End If 'REQUEST_PRIVATE_PASSWORD If BUFFER = "REQUEST_PRIVATE_PASSWORD" And CONNECTION <> 0 Then SERVER_NO_PASSWORD_NEEDED = 2 SEND_PACKET "PRIVATE_PASSWORD:" & WCONF(PASSWORD).CHAR CONNECTION = 3 IDLE = 0 End If 'PASSWORD_OK If BUFFER = "PASSWORD_OK" And CONNECTION >= 2 And CONNECTION <= 3 Then If CONNECTION <> 1 Then CONNECTION = 2 SERVER_NO_PASSWORD_NEEDED = 1 AddCustom "Password OK.", 1 CHECK_CONNECTION End If 'CONNECTION_OK If BUFFER = "CONNECTION_OK" And CONNECTION >= 2 And CONNECTION <= 3 Then CONNECTION = 1 IDLE = 1 SCUMBAG$ = "": SCUMBAGID = -1: SCUMBAGAVATAR = 0 AddCustom "Connection OK.", 1 'now is a good time to request the avatar If CONF(REQUEST_AVATAR).value = 1 Then PACKET = "REQUEST_AVATAR:" & WCONF(AVATAR_PASSWORD).CHAR SEND_PACKET PACKET End If LAST_STATUS$ = "Connected." RemoteScript "CONNECTED" End If 'PASSWORD_FAILED If BUFFER = "PASSWORD_FAILED" And CONNECTION >= 2 And CONNECTION <= 3 Then AddCustom "Wrong password. Please enter the correct password using /PASSWORD [password]", 1 End If 'REMOTE_CONSOLE_ON If BUFFER = "REMOTE_CONSOLE_ON" Then AddConsole "An admin has turned your remote console on." REMOTE_CONSOLE = 1 End If 'REMOTE_CONSOLE_OFF If BUFFER = "REMOTE_CONSOLE_OFF" Then AddConsole "An admin has turned your remote console off." REMOTE_CONSOLE = 0 End If 'MATCH_COUNTDOWN: If Left(BUFFER, 16) = "MATCH_COUNTDOWN:" Then MATCH_COUNTDOWN = Int(Mid(BUFFER, 17)) MATCH_STATE = 1 AddCustom "The next match will begin in " & MATCH_COUNTDOWN & " seconds!", 1 End If 'MATCH_STARTED If BUFFER = "MATCH_STARTED" Then MATCH_STATE = 2 AddCustom "Match started!", 1 LAST_STATUS$ = LAST_CONSOLE$ RemoteScript "MATCH_STARTED" End If 'MATCH_ENDED If BUFFER = "MATCH_ENDED" Then MATCH_STATE = 3 AddCustom "Match has ended!", 1 LAST_STATUS$ = LAST_CONSOLE$ RemoteScript "MATCH_ENDED" End If 'JOIN_TEAM: If Left(BUFFER, 10) = "JOIN_TEAM:" Then PLAYER_TEAM = Int(Mid(BUFFER, 11)) PLAYER_SCORE = 0 PLAY = 1 IDLE = 0 AddConsole "You have joined team #" & PLAYER_TEAM & "!" LAST_STATUS$ = LAST_CONSOLE$ RemoteScript "JOIN_TEAM" End If 'TEAM_DENIED If BUFFER = "TEAM_DENIED" Then AddConsole "You failed to join the team." LAST_STATUS$ = LAST_CONSOLE$ End If 'JOIN_IDLE If BUFFER = "JOIN_IDLE" Then PLAYER_TEAM = 0 PLAY = 0 IDLE = 1 AddConsole "You are now idle." LAST_STATUS$ = LAST_CONSOLE$ RemoteScript "JOIN_IDLE" End If 'IDLE_DENIED If BUFFER = "IDLE_DENIED" Then AddConsole "You failed to go idle." LAST_STATUS$ = LAST_CONSOLE$ End If 'PAC line If Left(BUFFER, 1) = "@" Then READ_PAC_LINE End If 'TEAM: If Left(BUFFER, 5) = "TEAM:" Then READ_TEAM_LINE End If 'REMOTE_INPUT: If Left(BUFFER, 13) = "REMOTE_INPUT:" Then i$ = Mid(BUFFER, 14) CONSOLE_COMMAND End If 'HIT: If Left(BUFFER, 4) = "HIT:" Then SCUMBAG$ = Mid(BUFFER, 9) SCUMBAGGUN = Int(Mid(BUFFER, 5, 1)) SCUMBAGVARIATION = Int(Mid(BUFFER, 6, 1)) SCUMBAGSPECIAL = Int(Mid(BUFFER, 7, 1)) 'work out the scumbags ID SCUMBAGID = -1 For x = 0 To MaxPeople If SCUMBAGID = -1 And SCUMBAG$ <> "" And LCase(person(x).Name) = LCase(SCUMBAG$) Then SCUMBAGID = x Next x SCUMBAGAVATAR = PLAYER_START_TEXTURE + SCUMBAGID 'react GOT_HIT End If '---------------------------------------------------------------------- 'put avatar at the end coz its dodgy as fuck, and error bypasses it? 'AVATAR: If Left(BUFFER, 7) = "AVATAR:" Then 'find first colon THEAVATAR$ = Mid(BUFFER, 8) A = -1 For x = 1 To Len(THEAVATAR$) If A = -1 And Mid(THEAVATAR$, x, 1) = ":" Then A = x Next x 'colon found? good If A >= 1 Then 'get the url# URL$ = Mid(THEAVATAR$, (A + 1)) 'get the name THEAVATAR$ = Left(THEAVATAR$, (A - 1)) 'is it our name? If LCase(THEAVATAR$) = LCase$(WCONF(PLAYER_NAME).CHAR) Then PLAYER_AVATAR = URL$ If IDLE = 1 And CONNECTION = 1 And PLAY = 0 And CONF(DOWNLOAD_AVATARS).value = 1 Then DOWNLOAD_MY_AVATAR End If End If 'is it someone elses? If LCase(THEAVATAR$) <> LCase$(WCONF(PLAYER_NAME).CHAR) Then ADD_AVATAR THEAVATAR$, URL$ End If End If End If End Sub Public Sub READ_MIS_LINE() 'where BUFFER is the line 'EG: M500005000050000500500500123456John 'we want char 32, where the name is Dim WhatName As String Dim lastbloke As Integer 'find empty slot in missile database A = -1 For x = 0 To MAX_MISSILES If missile(x).owner = "" And A = -1 Then A = x: MaxMissiles = A 'while we're here, work out the new current MaxMissiles If missile(x).owner <> "" Then MaxMissiles = x Next x 'not found? add it to a random slot If A = -1 Then A = Int(Rnd * MAX_MISSILES) MaxMissiles = MAX_MISSILES End If With missile(A) 'get regular values .owner = Mid(BUFFER, 32) .x = (Int(Mid$(BUFFER, 2, 5)) - 50000) / 100 .y = (Int(Mid$(BUFFER, 7, 5)) - 50000) / 100 .z = (Int(Mid$(BUFFER, 12, 5)) - 50000) / 100 .hor = 180 + (Int(Mid$(BUFFER, 17, 3)) / 10) * 3.6 .ver = 0 - (Int(Mid$(BUFFER, 20, 3)) / 10) * 3.6 .bar = (Int(Mid$(BUFFER, 23, 3)) / 10) * 3.6 .t = Int(Mid(BUFFER, 26, 1)) .variation = Int(Mid(BUFFER, 27, 1)) .special = Int(Mid(BUFFER, 28, 1)) .spin = 0 .speedx = 0 .speedy = 0 .speedz = 0 'set defaults depending on gun GetBaseGunValues .t, .variation, .special 'set the base gun values to the missile database .power = GunPower .weight = GunWeight .speed = GunSpeed .orbit = GunOrbit .curve = GunCurve 'set the projectile modifier for rockets fans and grenades If .t = 1 Then 'standard rocket If .special = 1 Then .power = .power + 0 .orbit = .orbit + 0 End If End If If .t = 2 Then 'modern standard black fan If .special = 1 Then .weight = .weight - 10 End If 'hymene fan If .special = 2 Then .curve = .curve + 10 .orbit = .orbit + 3000 End If 'vintage fan If .special = 3 Then .weight = .weight + 20 End If End If If .t = 6 Then 'standard grenade If .special = 1 Then End If End If 'apply modifiers from the packet depending on the gun type 'you can also adjust how much difference the modifiers make here) 'notice I have deducted 5, making it range from -4 to 5, meaning the standard 555 makes no modification) If .t = 1 Then .speed = .speed + ((Int(Mid(BUFFER, 29, 1)) - 5) * 9) .power = .power + ((Int(Mid(BUFFER, 30, 1)) - 5) * 9) .curve = .curve + ((Int(Mid(BUFFER, 31, 1)) - 5) * 9) End If If .t = 2 Then .speed = .speed + ((Int(Mid(BUFFER, 29, 1)) - 5) * 9) .weight = .weight + ((Int(Mid(BUFFER, 30, 1)) - 5) * 9) .curve = .curve + ((Int(Mid(BUFFER, 31, 1)) - 5) * 9) End If If .t = 3 Then .speed = .speed + ((Int(Mid(BUFFER, 29, 1)) - 5) * 9) .power = .power + ((Int(Mid(BUFFER, 30, 1)) - 5) * 9) .orbit = .orbit + ((Int(Mid(BUFFER, 31, 1)) - 5) * 9) End If If .t = 4 Then .power = .power + ((Int(Mid(BUFFER, 29, 1)) - 5) * 9) .orbit = .orbit + ((Int(Mid(BUFFER, 30, 1)) - 5) * 9) End If If .t = 5 Then .power = .power + ((Int(Mid(BUFFER, 29, 1)) - 5) * 9) .orbit = .orbit + ((Int(Mid(BUFFER, 30, 1)) - 5) * 9) End If If .t = 6 Then .speed = .speed + ((Int(Mid(BUFFER, 29, 1)) - 5) * 9) .curve = .curve + Int(Mid(BUFFER, 30, 1)) 'bounces, 0 means infinate .orbit = .orbit + ((Int(Mid(BUFFER, 31, 1)) - 5) * 9) End If If .t = 7 Then .power = .power + ((Int(Mid(BUFFER, 29, 1)) - 5) * 9) .orbit = .orbit + ((Int(Mid(BUFFER, 30, 1)) - 5) * 9) End If If .t = 8 Then .orbit = .orbit + ((Int(Mid(BUFFER, 29, 1)) - 5) * 9) .weight = .weight + ((Int(Mid(BUFFER, 30, 1)) - 5) * 9) .curve = .curve + Int(Mid(BUFFER, 31, 1)) 'slug color End If If .t = 9 Then 'custom, lets assume lightning gun .orbit = .orbit + ((Int(Mid(BUFFER, 29, 1)) - 5) * 9) .power = .power + ((Int(Mid(BUFFER, 30, 1)) - 5) * 9) .curve = .curve + ((Int(Mid(BUFFER, 31, 1)) - 5) * 9) End If 'set the speed directions from where it begun 'this gives us a lot more independent control, and a sense of gravity (i forgot about gravity, it'll have to be like, land 1 for all projectiles) .speedz = 0 + .speed Rotate .speedx, .speedy, .bar Rotate .speedz, .speedy, .ver Rotate .speedx, .speedz, .hor 'record the outgoing speed? If CONF(CLOCK_MISSILE_SPEED).value = 1 Then MissileClockType = .t MissileClockOwner = .owner GetMissileMPH .speedx, .speedy, .speedz, .hor, .bar, .ver End If End With 'instant projectile? deal with it right now If missile(A).t = 4 Or missile(A).t = 5 Or missile(A).t >= 7 Then INSTANT_PROJECTILE A End If End Sub Public Sub READ_PAC_LINE() 'where BUFFER is the line '@500005000050000500500500505050123412345John 'we want char 41, where the name is Dim WhatName As String Dim lastbloke As Integer 'get the name WhatName = Mid$(BUFFER$, 41) 'do we already have this name in our database? A = -1 lastbloke = -1 MaxPeople = 0 For x = 0 To MAX_PLAYERS 'work out MaxPeople here If person(x).Name <> "" Then MaxPeople = x If LCase(person(x).Name) = LCase(WhatName) And WhatName <> "" Then 'found it A = x End If 'work out where to add if we need to add him If person(x).Name = "" And lastbloke = -1 Then lastbloke = x Next x 'not found? add him If lastbloke = -1 Then lastbloke = MAX_PLAYERS: MaxPeople = MAX_PLAYERS If A = -1 Then A = lastbloke 'add the pac line and name! person(A).Name = WhatName person(A).PAC = BUFFER '<<>> 'thats it End Sub Public Sub READ_TEAM_LINE() 'read the team line BUFFER 'TEAM:1:Chalcedony:23 Dim WhatTeam As Integer Dim WhatScore As Integer Dim WhatName As String Dim lastbloke As Integer WhatScore = 0 WhatName = ":Unknown:" WhatTeam = 0 'get team WhatTeam = Int(Mid(BUFFER, 6, 1)) 'get name and score WhatName = Mid(BUFFER, 8) A = -1 For z = 1 To Len(WhatName) If A = -1 And Mid(WhatName, z, 1) = ":" Then A = z Next z If A >= 0 Then WhatScore = Int(Mid(WhatName, (A + 1))) If A >= 0 Then WhatName = Left(WhatName, (A - 1)) 'now add the data or the person in the same way we'd add a pac line 'do we already have this name in our database? A = -1 lastbloke = -1 MaxPeople = 0 For x = 0 To MAX_PLAYERS 'work out MaxPeople here If person(x).Name <> "" Then MaxPeople = x If LCase(person(x).Name) = LCase(WhatName) And WhatName <> "" Then 'found it A = x End If 'work out where to add if we need to add him If person(x).Name = "" And lastbloke = -1 Then lastbloke = x Next x 'not found? add him If lastbloke = -1 Then lastbloke = MAX_PLAYERS: MaxPeople = MAX_PLAYERS If A = -1 Then A = lastbloke 'add the pac line and name! person(A).Name = WhatName person(A).Score = WhatScore person(A).Team = WhatTeam End Sub Public Sub SEND_PACKET(WhatPacket As String) On Local Error GoTo SendPacketError 'If CONNECTION = 1 Or Left(WhatPacket, 4) = "PRO:" Then TOTAL_PACKETS_SENT = TOTAL_PACKETS_SENT + 1 PACKETS_SENT = PACKETS_SENT + 1 PRO.SOCKET.SendData WhatPacket & vbCrLf 'End If Exit Sub SendPacketError: If Left(WhatPacket, 1) <> "@" Then AddError "Packet send error: " & WhatPacket End Sub Public Sub BUILD_MIS_LINE() 'build the missile line using our current variations and our personal gun 'EG: M500005000050000500500500123456John Dim v As Double Dim p As String BUFFER = "M" 'important hack: set the co-ordinate using the same formula as the CAMERA, to get the right alignment 'center the camera with the nudge CameraX = 0 CameraY = 0 + GUN_NUDGE CameraZ = 0 'rotate the camera so the angle is perfect for crosshair alignment Rotate CameraX, CameraY, FACING.bar Rotate CameraZ, CameraY, FACING.ver Rotate CameraX, CameraZ, FACING.hor 'add the player co-ordinates to the camera CameraX = CameraX + PLAYER_X CameraY = CameraY + PLAYER_Y CameraZ = CameraZ + PLAYER_Z 'X co-ordinate v = Int(CameraX * 100): v = v + 50000 'If DEAD = 1 Then v = 2 If v >= 99999 Then Let v = 99999 If v <= 0 Then Let v = 0 p = v If v < 10000 Then Let p = "0" & p If v < 1000 Then Let p = "0" & p If v < 100 Then Let p = "0" & p If v < 10 Then Let p = "0" & p BUFFER = BUFFER + p 'Y co-ordinate v = Int(CameraY * 100): v = v + 50000 'If DEAD = 1 Then v = 3 If v >= 99999 Then Let v = 99999 If v <= 0 Then Let v = 0 p = v If v < 10000 Then Let p = "0" & p If v < 1000 Then Let p = "0" & p If v < 100 Then Let p = "0" & p If v < 10 Then Let p = "0" & p BUFFER = BUFFER + p 'Z co-ordinate v = Int(CameraZ * 100): v = v + 50000 If v >= 99999 Then Let v = 99999 If v <= 0 Then Let v = 0 p = v If v < 10000 Then Let p = "0" & p If v < 1000 Then Let p = "0" & p If v < 100 Then Let p = "0" & p If v < 10 Then Let p = "0" & p BUFFER = BUFFER + p 'hor v = Int((FACING.hor / 3.6) * 10) If v >= 999 Then v = 999 If v <= 0 Then v = 0 p = v If v < 100 Then Let p = "0" & p If v < 10 Then Let p = "0" & p BUFFER = BUFFER + p 'ver v = Int((FACING.ver / 3.6) * 10) If v >= 999 Then v = 999 If v <= 0 Then v = 0 p = v If v < 100 Then Let p = "0" & p If v < 10 Then Let p = "0" & p BUFFER = BUFFER + p 'bar v = Int((FACING.bar / 3.6) * 10) If v >= 999 Then v = 999 If v <= 0 Then v = 0 p = v If v < 100 Then Let p = "0" & p If v < 10 Then Let p = "0" & p BUFFER = BUFFER + p 'gun type BUFFER = BUFFER & "" & PLAYER_GUN 'gun variation BUFFER = BUFFER & "" & PLAYER_VARIATION 'gun special BUFFER = BUFFER & "" & PLAYER_SPECIAL 'variant 1 BUFFER = BUFFER & "" & GunVariant1 'variant 2 BUFFER = BUFFER & "" & GunVariant2 'variant 3 BUFFER = BUFFER & "" & GunVariant3 'name BUFFER = BUFFER & "" & WCONF(PLAYER_NAME).CHAR End Sub Public Sub SEND_HIT_LINE(HitMissile, HitWho) 'build and send a hit line depending on HitWho (player in database) and HitMissile as the missile number in the database that hit him PACKET = "HIT:" & missile(HitMissile).t & missile(HitMissile).variation & missile(HitMissile).special & ":" & person(HitWho).Name 'AddConsole "temporary, we hit and sent: " & PACKET SEND_PACKET PACKET End Sub Public Sub LOCAL_SOUND(SoundFile As String) 'play a local sound, which will come from you, and everyone else will hear it too Beep End Sub Option Explicit Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If CONSOLE = 1 Then 'up arrow skillz If GetAsyncKeyState(vbKeyUp) < -1 Then glCinput$ = UpArrowSkills End If 'down arrow skillz If GetAsyncKeyState(vbKeyDown) < -1 Then glCinput$ = "" End If End If End Sub Private Sub Form_KeyPress(KeyAscii As Integer) 'open GL console input If CONSOLE = 1 Then If KeyAscii <> 13 And KeyAscii <> 8 And KeyAscii <> 9 Then glCinput$ = glCinput$ & Chr(KeyAscii) KeyAscii = 0 End If 'delete If KeyAscii = 8 Then If glCinput$ <> "" Then glCinput$ = Left$(glCinput$, (Len(glCinput$) - 1)) End If 'press tab If KeyAscii = 9 Then i$ = glCinput$ CONSOLE_SUGGEST KeyAscii = 0 End If 'auto suggest is on? If CONF(AUTO_SUGGEST).value = 1 Then CONSOLE_AUTOSUGGEST End If 'press enter If KeyAscii = 13 And glCinput$ <> "" Then i$ = glCinput$ UpArrowSkills = i$ 'quit hack, close gl window If LCase$(i$) = "/quit" Then QUIT_PEACEFULLY: KillGLWindow: End glCinput$ = "" KeyAscii = 0 'do it 'If Left$(i$, 1) = "/" Or Left$(i$, 1) = "-" Or Left$(i$, 1) = "." Then AddConsole "# " & i$: Call CONSOLE_COMMAND Else Call CONSOLE_TALK CONSOLE_COMMAND End If If KeyAscii = 27 Then Let KeyAscii = 0 End If End Sub Private Sub Form_Unload(Cancel As Integer) On Error Resume Next KillGLWindow End Sub Private Sub SOCKET_DataArrival(ByVal bytesTotal As Long) On Local Error GoTo DataError 'get it SOCKET.GetData BUFFER, vbString 'get details sRemoteIP = SOCKET.RemoteHostIP sRemoteHost = SOCKET.RemoteHost sRemotePort = SOCKET.RemotePort 'chop it up for the dreaded crlf... OTHER = "" again: YYY = 0 For XXX = 1 To Len(BUFFER) If YYY = 0 And Mid$(BUFFER, XXX, 2) = vbCrLf Then OTHER = Mid(BUFFER, (XXX + 2)): BUFFER = Mid(BUFFER, 1, XXX - 1): YYY = 1 Next XXX '--------------------------------------------------------------------- READ_BUFFER '--------------------------------------------------------------------- 'is there anymore that was cut off? If OTHER <> "" Then Let BUFFER = OTHER: Let OTHER = "": GoTo again DataError: GoTo DataErrorSkip 'run away! DataErrorSkip: End Sub 'PRO 'By Chalcedony 2008 'Config and Console Public Const MAX_CONFS = 400 Public Const MAX_WCONFS = 80 Public Const MAX_COMMS = 50 Public Const MAX_INSTS = 2000 Public Const MAX_REMOTES = 100 'CONFS (VALUES) ----------------------------> Public Const CONF_SCREENMODEX = 1 Public Const CONF_SCREENMODEY = 2 Public Const CONF_COLORBITS = 3 Public Const CONF_DEPTHBITS = 4 Public Const CONF_PICMAP = 5 Public Const CONF_FULLSCREEN = 6 Public Const CONF_FOV = 7 Public Const CONF_REALTIME = 8 Public Const CONF_SCALE = 9 Public Const CONF_TEXTURERATIO = 10 Public Const CONF_FLASHSPEED = 11 Public Const CONF_FLASHSWITCH = 12 Public Const CONF_CONSOLEFONTSET = 13 Public Const CONSOLE_RED = 14 Public Const CONSOLE_GREEN = 15 Public Const CONSOLE_BLUE = 16 Public Const TALK_RED = 17 Public Const TALK_GREEN = 18 Public Const TALK_BLUE = 19 Public Const ERROR_RED = 20 Public Const ERROR_GREEN = 21 Public Const ERROR_BLUE = 22 Public Const INPUT_RED = 23 Public Const INPUT_GREEN = 24 Public Const INPUT_BLUE = 25 Public Const DATA_RED = 26 Public Const DATA_GREEN = 27 Public Const DATA_BLUE = 28 Public Const AUTO_SUGGEST = 29 Public Const SUGGEST_FONTSET = 30 Public Const FONT_MODEX = 31 Public Const FONT_MODEY = 32 Public Const CONSOLE_CHARWIDTH = 33 Public Const CONSOLE_MAXLINES = 34 Public Const SMALLCONSOLE_MAXLINES = 35 Public Const CONSOLE_OFFSET = 36 Public Const SMALLCONSOLE_OFFSET = 37 Public Const CONSOLE_MARGIN = 38 Public Const SMALLCONSOLE_MARGIN = 39 Public Const INPUT_MARGIN = 40 Public Const SMALLINPUT_MARGIN = 41 Public Const INPUT_Y = 42 Public Const SMALLINPUT_Y = 43 Public Const CONSOLE_ECHO = 44 Public Const ECHO_COLOR = 45 Public Const CONSOLE_BACKDROP = 46 Public Const BACKDROP_RED = 47 Public Const BACKDROP_GREEN = 48 Public Const BACKDROP_BLUE = 49 Public Const BACKDROP_LEFT = 50 Public Const BACKDROP_RIGHT = 51 Public Const BACKDROP_TOP = 52 Public Const BACKDROP_BOTTOM = 53 Public Const SMALLCONSOLE_BACKDROP = 54 Public Const SMALLBACKDROP_LEFT = 55 Public Const SMALLBACKDROP_RIGHT = 56 Public Const SMALLBACKDROP_TOP = 57 Public Const SMALLBACKDROP_BOTTOM = 58 Public Const DEBUG_INSTRUMENTS = 59 Public Const SENSIVITY_X = 60 Public Const SENSIVITY_Y = 61 Public Const INVERT_MOUSE = 62 Public Const MOUSE_EQ = 63 Public Const MOUSE_REFRESH = 64 Public Const MOUSE_TRUE = 65 Public Const MOUSE_GATE = 66 Public Const MOUSE_CAPMIN = 67 Public Const MOUSE_CAPMAX = 68 Public Const SMOOTH_MOUSE = 69 Public Const SLIDE_MOUSE = 70 Public Const CONF_PLANE_SHADING = 71 Public Const PLANE_MAINSHADING = 72 Public Const PLANE_LIGHT_TOPRED = 73 Public Const PLANE_LIGHT_TOPGREEN = 74 Public Const PLANE_LIGHT_TOPBLUE = 75 Public Const PLANE_LIGHT_BOTTOMRED = 76 Public Const PLANE_LIGHT_BOTTOMGREEN = 77 Public Const PLANE_LIGHT_BOTTOMBLUE = 78 Public Const PLANE_LIGHT_EASTRED = 79 Public Const PLANE_LIGHT_EASTGREEN = 80 Public Const PLANE_LIGHT_EASTBLUE = 81 Public Const PLANE_LIGHT_WESTRED = 82 Public Const PLANE_LIGHT_WESTGREEN = 83 Public Const PLANE_LIGHT_WESTBLUE = 84 Public Const PLANE_LIGHT_NORTHRED = 85 Public Const PLANE_LIGHT_NORTHGREEN = 86 Public Const PLANE_LIGHT_NORTHBLUE = 87 Public Const PLANE_LIGHT_SOUTHRED = 88 Public Const PLANE_LIGHT_SOUTHGREEN = 89 Public Const PLANE_LIGHT_SOUTHBLUE = 90 Public Const PLANE_RANDOM_SHADING = 91 Public Const PLANE_RANDOM_CORNERSONLY = 92 Public Const THIRD_PERSON = 93 Public Const THIRD_DISTANCE = 94 Public Const THIRD_SPEED = 95 Public Const HEAD_COLOR = 96 Public Const TAIL_COLOR = 97 Public Const BODY_COLOR = 98 Public Const ARM_COLOR = 99 Public Const HORN_COLOR = 100 Public Const DRAW_GUN = 101 Public Const GUN_X = 102 Public Const GUN_Y = 103 Public Const GUN_Z = 104 Public Const GUN_HOR = 105 Public Const GUN_BAR = 106 Public Const GUN_VER = 107 Public Const GUN_RECOIL = 108 Public Const GUN_SCALE = 109 Public Const GUN_TEXTURE = 110 Public Const MODEL_SHADING1 = 111 Public Const MODEL_SHADING2 = 112 Public Const MODEL_SHADING3 = 113 Public Const MODEL_SHADING4 = 114 Public Const CONF_WEIGHT = 115 Public Const speed = 116 Public Const ACCELERATION = 117 Public Const FRICTION = 118 Public Const AIR_RESISTANCE = 119 Public Const CONF_GRAVITY = 120 Public Const TERMINAL_VELOCITY = 121 Public Const BOWIE_PHYSICS = 122 Public Const OUTRUN_GRAVITY = 123 Public Const BRAKES = 124 Public Const AUTOMATIC_BRAKE = 125 Public Const SLITHER = 126 Public Const GRIP = 127 Public Const SLITHER_BOOST = 128 Public Const ANGULAR_TRAVEL = 129 Public Const AERODYNAMICS = 130 Public Const JUMP = 131 Public Const SLITHER_GAIN = 132 Public Const SLITHER_BANK = 133 Public Const BANK_SPEED = 134 Public Const BANK_LIMIT = 135 Public Const DRAW_INSTRUMENTS = 136 Public Const R_ROCKET_LAUNCHER = 137 Public Const R_FAN_CANNON = 138 Public Const R_SHOTGUN = 139 Public Const R_MACHINEGUN = 140 Public Const R_GRENADE_LAUNCHER = 141 Public Const R_RAIL_GUN = 142 Public Const R_FORK_GUN = 143 Public Const R_RIFLE = 144 Public Const R_SPECIAL_GUN = 145 Public Const R_ROCKETS = 146 Public Const R_FANS = 147 Public Const R_SHELLS = 148 Public Const R_BULLETS = 149 Public Const R_SLUGS = 150 Public Const R_PLASMA = 151 Public Const R_GRENADES = 152 Public Const R_SUPERBULLETS = 153 Public Const R_LIGHTNING = 154 Public Const R_FAN_TYPE = 155 Public Const R_ROCKET_TYPE = 156 Public Const CONF_REMOTE_PORT = 157 Public Const CONF_LOCAL_PORT = 158 Public Const CONF_RATE = 159 Public Const TEAM_COLOR1 = 160 Public Const TEAM_COLOR2 = 161 Public Const TEAM_COLOR3 = 162 Public Const TEAM_COLOR4 = 163 Public Const TEAM_COLORIDLE = 164 Public Const TABS_LEFT = 165 Public Const TABS_TOP = 166 Public Const TABS_FONTX = 167 Public Const TABS_FONTY = 168 Public Const TABS_SPACING = 169 Public Const TABS_SCORESPACING = 170 Public Const TABS_AVATAR = 171 Public Const TABS_FONTSET = 172 Public Const MAGNA_SPEED = 173 Public Const MAGNA_LIMIT = 174 Public Const MAGNA_RED = 175 Public Const MAGNA_GREEN = 176 Public Const MAGNA_BLUE = 177 Public Const MAGNA_MARGIN = 178 Public Const MAGNA_TEXTURE = 179 Public Const MAGNA_TEXTURERATIO = 180 Public Const DOWNLOAD_AVATARS = 181 Public Const REQUEST_AVATAR = 182 Public Const LOAD_AVATARS = 183 Public Const DRAW_AVATARS = 184 Public Const IGNORE_UNKNOWN_AVATARS = 185 Public Const AVATAR_LEFT = 186 Public Const AVATAR_TOP = 187 Public Const AVATAR_WIDTH = 188 Public Const AVATAR_HEIGHT = 189 Public Const AVATAR_SPACING = 190 Public Const AVATAR_RED = 191 Public Const AVATAR_GREEN = 192 Public Const AVATAR_BLUE = 193 Public Const AVATAR_ZDEPTH = 194 Public Const SPHERE_SLICES = 195 Public Const SPHERE_STACKS = 196 Public Const DRAW_SPHERES = 197 Public Const SPHERE_RED = 198 Public Const SPHERE_GREEN = 199 Public Const SPHERE_BLUE = 200 Public Const R_SCOPE_GUN1 = 201 Public Const R_SCOPE_GUN2 = 202 Public Const R_SCOPE_GUN3 = 203 Public Const R_SCOPE_TYPE1 = 204 Public Const R_SCOPE_TYPE2 = 205 Public Const R_SCOPE_TYPE3 = 206 Public Const R_STABILITY = 207 Public Const R_STABILITY_LEVEL = 208 Public Const SPARK_FORCE_MULTIPLY = 209 Public Const SPARK_FORCE_MIN = 210 Public Const SPARK_FORCE_MAX = 211 Public Const SPARK_PARTICLE_MIN = 212 Public Const SPARK_PARTICLE_MULTIPLY = 213 Public Const SPARK_PARTICLE_MAX = 214 Public Const SPARK_PARTICLE_ADD = 215 Public Const SPARK_PLASMA = 216 Public Const SPARK_USE_MAX = 217 Public Const DRAW_ROCKET_TRAILS = 218 Public Const ROCKET_TRAIL_FORCE = 219 Public Const ROCKET_TRAIL_PARTICLES = 220 Public Const SPARK_RED = 221 Public Const SPARK_GREEN = 222 Public Const SPARK_BLUE = 223 Public Const ROCKET_TRAIL_RED = 224 Public Const ROCKET_TRAIL_GREEN = 225 Public Const ROCKET_TRAIL_BLUE = 226 Public Const ROCKET_TRAIL_FADESPEED = 227 Public Const ROCKET_TRAIL_SIZE = 228 Public Const SPARK_PARTICLE_SIZE = 229 Public Const SPARK_PARTICLE_FADESPEED = 230 Public Const PLASMA_SPARK_SIZE = 231 Public Const PLASMA_SPARK_AMOUNT = 232 Public Const FAN_SPARK_SIZE = 233 Public Const FAN_SPARK_AMOUNT = 234 Public Const DRAW_PLASMA_SPARKS = 235 Public Const DRAW_FAN_SPARKS = 236 Public Const FAN_SPARK_FADESPEED = 237 Public Const FAN_SPARK_RED = 238 Public Const FAN_SPARK_GREEN = 239 Public Const FAN_SPARK_BLUE = 240 Public Const PLASMA_SPARK_FADESPEED = 241 Public Const PLASMA_SPARK_RED = 242 Public Const PLASMA_SPARK_GREEN = 243 Public Const PLASMA_SPARK_BLUE = 244 Public Const CLOCK_MISSILE_SPEED = 245 Public Const SHOTGUN_SPARK_FADESPEED = 246 Public Const SHOTGUN_SPARK_AMOUNT = 247 Public Const SHOTGUN_SPARK_SIZE = 248 Public Const BULLET_SPARK_FADESPEED = 249 Public Const BULLET_SPARK_AMOUNT = 250 Public Const BULLET_SPARK_SIZE = 251 Public Const BULLET_SPARK_RED = 252 Public Const BULLET_SPARK_GREEN = 253 Public Const BULLET_SPARK_BLUE = 254 Public Const SHOTGUN_SPARK_FORCE = 255 Public Const BULLET_SPARK_FORCE = 256 Public Const SHOTGUN_SPARK_VARY_POWER = 257 Public Const SHOTGUN_SPARK_DEDUCT = 258 Public Const RECOIL_POWER = 259 Public Const RECOIL_X = 260 Public Const RECOIL_Y = 261 Public Const RECOIL_Z = 262 Public Const RECOIL_HOR = 263 Public Const RECOIL_VER = 264 Public Const RECOIL_BAR = 265 Public Const RECOIL_RESISTANCE = 266 Public Const RECOIL_SQUIDGE = 267 Public Const RECOIL_NEG_SQUIDGE = 268 Public Const RECOIL_MAX = 269 Public Const RECOIL_GATING = 270 Public Const RAIL_SPARK_AMOUNT = 271 Public Const RAIL_SPARK_SIZE = 272 Public Const RAIL_SPARK_MATCH_COLORS = 273 Public Const RAIL_SPARK_FORCE = 274 Public Const RAIL_FORCE_TEAM_COLOR = 275 Public Const RAIL_FORCE_ENEMY_COLOR = 276 Public Const RAIL_COLOR = 277 Public Const RAIL_ORBIT = 278 Public Const RAIL_SPARK_FADESPEED = 279 Public Const RAIL_SLUG_FADESPEED = 280 Public Const RAIL_SLUG_FADESTART = 281 Public Const RAIL_SLUG_CHASE = 282 Public Const SLUG_X = 283 Public Const SLUG_Y = 284 Public Const SLUG_Z = 285 Public Const CHANGE_GUN_HOR = 286 Public Const CHANGE_GUN_VER = 287 Public Const CHANGE_GUN_BAR = 288 Public Const CHANGE_GUN_X = 289 Public Const CHANGE_GUN_Y = 290 Public Const CHANGE_GUN_Z = 291 Public Const GRENADE_BOUNCES = 292 Public Const INSTRUMENT_ZDEPTH = 293 'WCONFS (CHARS) ----------------------------> Public Const SCRIPT_NAME = 1 Public Const CONSOLE_ARROW = 2 Public Const CONSOLE_INPUT = 3 Public Const PLAYER_NAME = 4 Public Const RESOURCE_FOLDER = 5 Public Const ECHO_ARROW = 6 Public Const REMOTE_HOST = 7 Public Const PASSWORD = 8 Public Const AVATAR_PASSWORD = 9 Public Const BUTTON_CONSOLE = 20 Public Const BUTTON_SMALLCONSOLE = 21 Public Const BUTTON_FORWARD = 22 Public Const BUTTON_BACK = 23 Public Const BUTTON_LEFT = 24 Public Const BUTTON_RIGHT = 25 Public Const BUTTON_JUMP = 26 Public Const BUTTON_SCORES = 27 Public Const BUTTON_FIRE = 28 Public Const BUTTON_ROCKET = 29 Public Const BUTTON_FAN = 30 Public Const BUTTON_PLASMA = 31 Public Const BUTTON_SHOTGUN = 32 Public Const BUTTON_RIFLE = 33 Public Const BUTTON_MACHINEGUN = 34 Public Const BUTTON_GRENADE = 35 Public Const BUTTON_RAIL = 36 Public Const BUTTON_SPECIAL = 37 Public Const BUTTON_NOGUN = 38 Public Const BUTTON_NEXT = 39 Public Const BUTTON_PREV = 40 Public Const BUTTON_CLUTCH = 41 'COMMS (COMMANDS) --------------------------> Public Const COMM_VERSION = 1 Public Const COMM_QUIT = 2 Public Const COMM_INITGL = 3 Public Const COMM_COMPILEINFO = 4 Public Const COMM_LOADCONFIG = 5 Public Const COMM_WRITECONFIG = 6 Public Const COMM_GOTOCONSOLE = 7 Public Const COMM_GOTOWORLD = 8 Public Const COMM_CLS = 9 Public Const COMM_ECHO = 10 Public Const COMM_CECHO = 11 Public Const COMM_MAN = 12 Public Const COMM_HELP = 13 Public Const COMM_DELETE = 14 Public Const COMM_EDIT = 15 Public Const COMM_INSTRUMENTS = 16 Public Const COMM_CODE = 17 Public Const COMM_CLEAR_INSTRUMENTS = 18 Public Const COMM_CONNECT = 19 Public Const COMM_JOIN = 20 Public Const COMM_IDLE = 21 Public Const COMM_INCLUDE = 22 Public Const COMM_ROSTER = 23 Public Const COMM_ADD_REMOTE = 24 Public Const COMM_CLEAR_REMOTES = 25 Public Const COMM_REMOTES = 26 Public Const COMM_MAIN_ECHO_ON = 27 Public Const COMM_MAIN_ECHO_OFF = 28 '-------------------------------------------- Public Type CONF_TYPE value As Double Name As String ValType As Integer Min As Double Max As Double Locked As Integer DefaultValue As Double End Type Public Type WCONF_TYPE CHAR As String Name As String Locked As Integer DefaultChar As String End Type Public Type COMM_TYPE Name As String Locked As Integer CommType As Integer '=0 means no value, just normal command like /quit =1 means input a value Help As String 'help of what it does, or what to input End Type 'buttons Global BUTTON(MAX_WCONFS) 'instruments Global INST(MAX_INSTS) As String Global MaxInstruments As Integer 'current max Global CODE As String 'commands & settings Global CONF(MAX_CONFS) As CONF_TYPE Global WCONF(MAX_WCONFS) As WCONF_TYPE Global COMM(MAX_COMMS) As COMM_TYPE 'remotes Global REMOTE_SITUATION(MAX_REMOTES) As String Global REMOTE_SCRIPT(MAX_REMOTES) As String Public Sub ADD_INSTRUMENT() 'add the instrument of CODE CanDo = 1 'no such code? If CODE = "" Then CanDo = 2 'comment? If Left(CODE, 2) = "//" Then CanDo = 2 'comb out tabs and spaces A = 0 x = Len(CODE) Do Until A = x If Left(CODE, 1) = " " Then CODE = Mid(CODE, 2): A = A + 1 If Left(CODE, 1) = Chr$(9) Then CODE = Mid(CODE, 2): A = A + 1 If Left(CODE, 1) <> " " And Left(CODE, 1) <> Chr$(9) Then A = x Loop 'find the spare slot A = -1 For x = 0 To MAX_INSTS If A = -1 And INST(x) = "" Then A = x Next x 'not found? If A = -1 Then CanDo = 0: MESSAGE$ = "All code slots used up!" 'do it If A >= 0 And CanDo = 1 Then INST(A) = CODE AddConsole "Added instrument #" & A & ": " & CODE SEL_INST = A End If 'can't do it? If CanDo = 0 Then AddError "Could not add instrument code: " & MESSAGE$ End Sub Public Sub RemoteScript(Situation As String) 'see if we need to excecute a remote script depending on the SITUATION in our remote scripts list. Dim rscan As Integer Dim Found As Integer Found = -1 For rscan = 0 To MAX_REMOTES If Found = -1 And UCase(REMOTE_SITUATION(rscan)) = UCase(Situation) And REMOTE_SCRIPT(rscan) <> "" Then Found = rscan End If Next rscan 'found one? execute it If Found >= 0 Then LOAD_REMOTE (REMOTE_SCRIPT(Found)) ECHO = 1 End Sub Public Sub SET_CONFIG() 'prepare and set the config, including defaults For x = 0 To MAX_CONFS CONF(x).Name = "" CONF(x).Locked = 0 CONF(x).Min = 0 CONF(x).Max = 1 CONF(x).ValType = 0 CONF(x).value = 0 Next x For x = 0 To MAX_WCONFS WCONF(x).CHAR = "" WCONF(x).Locked = 0 WCONF(x).Name = "" Next x For x = 0 To MAX_COMMS COMM(x).Name = "" COMM(x).Locked = 0 COMM(x).CommType = 0 COMM(x).Help = "" Next x For x = 0 To MAX_INSTS INST(x) = "" Next x MaxInstruments = 0 'confs With CONF(CONF_SCREENMODEX): .Name = "MODEX": .value = 800: .ValType = 1: .Locked = 0: .Min = 1: .Max = 5000: End With With CONF(CONF_SCREENMODEY): .Name = "MODEY": .value = 600: .ValType = 1: .Locked = 0: .Min = 1: .Max = 5000: End With With CONF(CONF_COLORBITS): .Name = "COLOR_BITS": .value = 32: .ValType = 1: .Locked = 0: .Min = 0: .Max = 256: End With With CONF(CONF_DEPTHBITS): .Name = "DEPTH_BITS": .value = 16: .ValType = 1: .Locked = 0: .Min = 0: .Max = 256: End With With CONF(CONF_PICMAP): .Name = "PICMAP": .value = 1: .ValType = 1: .Locked = 1: .Min = 1: .Max = 9: End With With CONF(CONF_FULLSCREEN): .Name = "FULL_SCREEN": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(CONF_FOV): .Name = "FOV": .value = 90: .ValType = 0: .Locked = 0: .Min = 45: .Max = 150: End With With CONF(CONF_REALTIME): .Name = "REALTIME": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 1: End With With CONF(CONF_SCALE): .Name = "SCALE": .value = 1: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(CONF_TEXTURERATIO): .Name = "TEXTURE_RATIO": .value = 1: .ValType = 0: .Locked = 1: .Min = 0: .Max = 512: End With With CONF(CONF_FLASHSPEED): .Name = "FLASH_SPEED": .value = 500: .ValType = 0: .Locked = 0: .Min = 0: .Max = 10000: End With With CONF(CONF_FLASHSWITCH): .Name = "FLASH_SWITCH": .value = 250: .ValType = 0: .Locked = 0: .Min = 0: .Max = 10000: End With With CONF(CONF_CONSOLEFONTSET): .Name = "CONSOLE_FONTSET": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(CONSOLE_RED): .Name = "CONSOLE_RED": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(CONSOLE_GREEN): .Name = "CONSOLE_GREEN": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(CONSOLE_BLUE): .Name = "CONSOLE_BLUE": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(TALK_RED): .Name = "TALK_RED": .value = 0: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(TALK_GREEN): .Name = "TALK_GREEN": .value = 0.5: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(TALK_BLUE): .Name = "TALK_BLUE": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(ERROR_RED): .Name = "ERROR_RED": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(ERROR_GREEN): .Name = "ERROR_GREEN": .value = 0.3: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(ERROR_BLUE): .Name = "ERROR_BLUE": .value = 0: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(INPUT_RED): .Name = "INPUT_RED": .value = 0.5: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(INPUT_GREEN): .Name = "INPUT_GREEN": .value = 0.5: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(INPUT_BLUE): .Name = "INPUT_BLUE": .value = 0.5: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(DATA_RED): .Name = "DATA_RED": .value = 0.3: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(DATA_GREEN): .Name = "DATA_GREEN": .value = 0.7: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(DATA_BLUE): .Name = "DATA_BLUE": .value = 0.7: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(AUTO_SUGGEST): .Name = "AUTO_SUGGEST": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(SUGGEST_FONTSET): .Name = "SUGGEST_FONTSET": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(FONT_MODEX): .Name = "FONT_MODEX": .value = 800: .ValType = 1: .Locked = 0: .Min = 1: .Max = 5000: End With With CONF(FONT_MODEY): .Name = "FONT_MODEY": .value = 600: .ValType = 1: .Locked = 0: .Min = 1: .Max = 5000: End With With CONF(CONSOLE_CHARWIDTH): .Name = "CONSOLE_CHARWIDTH": .value = 79: .ValType = 1: .Locked = 0: .Min = 1: .Max = 1000: End With With CONF(CONSOLE_MAXLINES): .Name = "CONSOLE_MAXLINES": .value = 35: .ValType = 1: .Locked = 0: .Min = 1: .Max = 1000: End With With CONF(SMALLCONSOLE_MAXLINES): .Name = "SMALLCONSOLE_MAXLINES": .value = 13: .ValType = 1: .Locked = 0: .Min = 1: .Max = 1000: End With With CONF(CONSOLE_OFFSET): .Name = "CONSOLE_OFFSET": .value = 0: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(SMALLCONSOLE_OFFSET): .Name = "SMALLCONSOLE_OFFSET": .value = 0: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(CONSOLE_MARGIN): .Name = "CONSOLE_MARGIN": .value = 1: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(SMALLCONSOLE_MARGIN): .Name = "SMALLCONSOLE_MARGIN": .value = 1: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(INPUT_MARGIN): .Name = "INPUT_MARGIN": .value = 1: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(SMALLINPUT_MARGIN): .Name = "SMALLINPUT_MARGIN": .value = 1: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(INPUT_Y): .Name = "INPUT_Y": .value = 36: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(SMALLINPUT_Y): .Name = "SMALLINPUT_Y": .value = 14: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(CONSOLE_ECHO): .Name = "CONSOLE_ECHO": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 5: End With With CONF(ECHO_COLOR): .Name = "ECHO_COLOR": .value = 0: .ValType = 1: .Locked = 0: .Min = 0: .Max = 10: End With With CONF(CONSOLE_BACKDROP): .Name = "CONSOLE_BACKDROP": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(BACKDROP_RED): .Name = "BACKDROP_RED": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(BACKDROP_GREEN): .Name = "BACKDROP_GREEN": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(BACKDROP_BLUE): .Name = "BACKDROP_BLUE": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(BACKDROP_LEFT): .Name = "BACKDROP_LEFT": .value = -2.8: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(BACKDROP_RIGHT): .Name = "BACKDROP_RIGHT": .value = 2.8: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(BACKDROP_TOP): .Name = "BACKDROP_TOP": .value = 2.08: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(BACKDROP_BOTTOM): .Name = "BACKDROP_BOTTOM": .value = -2.08: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(SMALLCONSOLE_BACKDROP): .Name = "SMALLCONSOLE_BACKDROP": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(SMALLBACKDROP_LEFT): .Name = "SMALLBACKDROP_LEFT": .value = -6.8: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(SMALLBACKDROP_RIGHT): .Name = "SMALLBACKDROP_RIGHT": .value = 6.8: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(SMALLBACKDROP_TOP): .Name = "SMALLBACKDROP_TOP": .value = 12.5: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(SMALLBACKDROP_BOTTOM): .Name = "SMALLBACKDROP_BOTTOM": .value = 0.7: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(DEBUG_INSTRUMENTS): .Name = "DEBUG_INSTRUMENTS": .value = 0: .ValType = 1: .Locked = 0: .Min = 0: .Max = 3: End With With CONF(SENSIVITY_X): .Name = "SENSIVITY_X": .value = 100: .ValType = 0: .Locked = 0: .Min = 0: .Max = 200: End With With CONF(SENSIVITY_Y): .Name = "SENSIVITY_Y": .value = 100: .ValType = 0: .Locked = 0: .Min = 0: .Max = 200: End With With CONF(INVERT_MOUSE): .Name = "INVERT_MOUSE": .value = 0: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(MOUSE_EQ): .Name = "MOUSE_EQ": .value = 100: .ValType = 0: .Locked = 0: .Min = 0.001: .Max = 1000: End With With CONF(MOUSE_REFRESH): .Name = "MOUSE_REFRESH": .value = 0: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1000: End With With CONF(MOUSE_TRUE): .Name = "MOUSE_TRUE": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(MOUSE_GATE): .Name = "MOUSE_GATE": .value = 0: .ValType = 0: .Locked = 0: .Min = 0: .Max = 500: End With With CONF(MOUSE_CAPMIN): .Name = "MOUSE_CAPMIN": .value = 0: .ValType = 0: .Locked = 0: .Min = 0: .Max = 500: End With With CONF(MOUSE_CAPMAX): .Name = "MOUSE_CAPMAX": .value = 0: .ValType = 0: .Locked = 0: .Min = 0: .Max = 5000: End With With CONF(SMOOTH_MOUSE): .Name = "SMOOTH_MOUSE": .value = 0: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(SLIDE_MOUSE): .Name = "SLIDE_MOUSE": .value = 0: .ValType = 0: .Locked = 0: .Min = 0: .Max = 500: End With With CONF(CONF_PLANE_SHADING): .Name = "PLANE_SHADING": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(PLANE_MAINSHADING): .Name = "PLANE_MAINSHADING": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_TOPRED): .Name = "PLANE_LIGHT_TOPRED": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_TOPGREEN): .Name = "PLANE_LIGHT_TOPGREEN": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_TOPBLUE): .Name = "PLANE_LIGHT_TOPBLUE": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_BOTTOMRED): .Name = "PLANE_LIGHT_BOTTOMRED": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_BOTTOMGREEN): .Name = "PLANE_LIGHT_BOTTOMGREEN": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_BOTTOMBLUE): .Name = "PLANE_LIGHT_BOTTOMBLUE": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_EASTRED): .Name = "PLANE_LIGHT_EASTRED": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_EASTGREEN): .Name = "PLANE_LIGHT_EASTGREEN": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_EASTBLUE): .Name = "PLANE_LIGHT_EASTBLUE": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_WESTRED): .Name = "PLANE_LIGHT_WESTRED": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_WESTGREEN): .Name = "PLANE_LIGHT_WESTGREEN": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_WESTBLUE): .Name = "PLANE_LIGHT_WESTBLUE": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_NORTHRED): .Name = "PLANE_LIGHT_NORTHRED": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_NORTHGREEN): .Name = "PLANE_LIGHT_NORTHGREEN": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_NORTHBLUE): .Name = "PLANE_LIGHT_NORTHBLUE": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_SOUTHRED): .Name = "PLANE_LIGHT_SOUTHRED": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_SOUTHGREEN): .Name = "PLANE_LIGHT_SOUTHGREEN": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_LIGHT_SOUTHBLUE): .Name = "PLANE_LIGHT_SOUTHBLUE": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_RANDOM_SHADING): .Name = "PLANE_RANDOM_SHADING": .value = 0: .ValType = 0: .Locked = 0: .Min = -255: .Max = 255: End With With CONF(PLANE_RANDOM_CORNERSONLY): .Name = "PLANE_RANDOM_CORNERSONLY": .value = 0: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(THIRD_PERSON): .Name = "THIRD_PERSON": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 5: End With With CONF(THIRD_DISTANCE): .Name = "THIRD_DISTANCE": .value = 0: .ValType = 0: .Locked = 1: .Min = 0: .Max = 1000: End With With CONF(THIRD_SPEED): .Name = "THIRD_SPEED": .value = 0: .ValType = 0: .Locked = 1: .Min = 0: .Max = 1000: End With With CONF(HEAD_COLOR): .Name = "HEAD_COLOR": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = MAX_COLORS: End With With CONF(TAIL_COLOR): .Name = "TAIL_COLOR": .value = 4: .ValType = 1: .Locked = 1: .Min = 0: .Max = MAX_COLORS: End With With CONF(BODY_COLOR): .Name = "BODY_COLOR": .value = 1: .ValType = 1: .Locked = 1: .Min = 0: .Max = MAX_COLORS: End With With CONF(ARM_COLOR): .Name = "ARM_COLOR": .value = 3: .ValType = 1: .Locked = 1: .Min = 0: .Max = MAX_COLORS: End With With CONF(HORN_COLOR): .Name = "HORN_COLOR": .value = 2: .ValType = 1: .Locked = 1: .Min = 0: .Max = MAX_COLORS: End With With CONF(DRAW_GUN): .Name = "DRAW_GUN": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(GUN_X): .Name = "GUN_X": .value = 0.4: .ValType = 0: .Locked = 0: .Min = -10: .Max = 10: End With With CONF(GUN_Y): .Name = "GUN_Y": .value = -0.5: .ValType = 0: .Locked = 0: .Min = -10: .Max = 10: End With With CONF(GUN_Z): .Name = "GUN_Z": .value = 0.5: .ValType = 0: .Locked = 0: .Min = -10: .Max = 10: End With With CONF(GUN_HOR): .Name = "GUN_HOR": .value = 0: .ValType = 0: .Locked = 0: .Min = -180: .Max = 180: End With With CONF(GUN_BAR): .Name = "GUN_BAR": .value = 0: .ValType = 0: .Locked = 0: .Min = -180: .Max = 180: End With With CONF(GUN_VER): .Name = "GUN_VER": .value = 10: .ValType = 0: .Locked = 0: .Min = -180: .Max = 180: End With With CONF(GUN_RECOIL): .Name = "GUN_RECOIL": .value = 0: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(GUN_SCALE): .Name = "GUN_SCALE": .value = 3.5: .ValType = 0: .Locked = 0: .Min = 0: .Max = 10: End With With CONF(GUN_TEXTURE): .Name = "GUN_TEXTURE": .value = 5: .ValType = 1: .Locked = 0: .Min = 0: .Max = MAX_TEXTURES: End With With CONF(MODEL_SHADING1): .Name = "MODEL_SHADING1": .value = 0: .ValType = 0: .Locked = 0: .Min = -20: .Max = 20: End With With CONF(MODEL_SHADING2): .Name = "MODEL_SHADING2": .value = 0: .ValType = 0: .Locked = 0: .Min = -20: .Max = 20: End With With CONF(MODEL_SHADING3): .Name = "MODEL_SHADING3": .value = 0: .ValType = 0: .Locked = 0: .Min = -20: .Max = 20: End With With CONF(MODEL_SHADING4): .Name = "MODEL_SHADING4": .value = 0: .ValType = 0: .Locked = 0: .Min = -20: .Max = 20: End With With CONF(CONF_WEIGHT): .Name = "WEIGHT": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(speed): .Name = "SPEED": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(ACCELERATION): .Name = "ACCELERATION": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(FRICTION): .Name = "FRICTION": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(AIR_RESISTANCE): .Name = "AIR_RESISTANCE": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(CONF_GRAVITY): .Name = "GRAVITY": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(TERMINAL_VELOCITY): .Name = "TERMINAL_VELOCITY": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(BOWIE_PHYSICS): .Name = "BOWIE_PHYSICS": .value = 0: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(OUTRUN_GRAVITY): .Name = "OUTRUN_GRAVITY": .value = 0: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(BRAKES): .Name = "BRAKES": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(AUTOMATIC_BRAKE): .Name = "AUTOMATIC_BRAKE": .value = 0: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(SLITHER): .Name = "SLITHER": .value = 0: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(GRIP): .Name = "GRIP": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(SLITHER_BOOST): .Name = "SLITHER_BOOST": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(ANGULAR_TRAVEL): .Name = "ANGULAR_TRAVEL": .value = 0: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(AERODYNAMICS): .Name = "AERODYNAMICS": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(JUMP): .Name = "JUMP": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(SLITHER_GAIN): .Name = "SLITHER_GAIN": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(SLITHER_BANK): .Name = "SLITHER_BANK": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(BANK_SPEED): .Name = "BANK_SPEED": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(BANK_LIMIT): .Name = "BANK_LIMIT": .value = 50: .ValType = 0: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(DRAW_INSTRUMENTS): .Name = "DRAW_INSTRUMENTS": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(R_ROCKET_LAUNCHER): .Name = "R_ROCKET_LAUNCHER": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 3: End With With CONF(R_FAN_CANNON): .Name = "R_FAN_CANNON": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 4: End With With CONF(R_SHOTGUN): .Name = "R_SHOTGUN": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 2: End With With CONF(R_MACHINEGUN): .Name = "R_MACHINEGUN": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 1: End With With CONF(R_GRENADE_LAUNCHER): .Name = "R_GRENADE_LAUNCHER": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 1: End With With CONF(R_RAIL_GUN): .Name = "R_RAIL_GUN": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 1: End With With CONF(R_FORK_GUN): .Name = "R_FORK_GUN": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 2: End With With CONF(R_RIFLE): .Name = "R_RIFLE": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 1: End With With CONF(R_SPECIAL_GUN): .Name = "R_SPECIAL_GUN": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 1: End With With CONF(R_ROCKETS): .Name = "R_ROCKETS": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 100: End With With CONF(R_FANS): .Name = "R_FANS": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 50: End With With CONF(R_SHELLS): .Name = "R_SHELLS": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 300: End With With CONF(R_BULLETS): .Name = "R_BULLETS": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 500: End With With CONF(R_SLUGS): .Name = "R_SLUGS": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 50: End With With CONF(R_PLASMA): .Name = "R_PLASMA": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 500: End With With CONF(R_GRENADES): .Name = "R_GRENADES": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 50: End With With CONF(R_SUPERBULLETS): .Name = "R_SUPERBULLETS": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 50: End With With CONF(R_LIGHTNING): .Name = "R_LIGHTNING": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 500: End With With CONF(R_FAN_TYPE): .Name = "R_FAN_TYPE": .value = 1: .ValType = 1: .Locked = 1: .Min = 1: .Max = 4: End With With CONF(R_ROCKET_TYPE): .Name = "R_ROCKET_TYPE": .value = 1: .ValType = 1: .Locked = 1: .Min = 1: .Max = 3: End With With CONF(CONF_REMOTE_PORT): .Name = "REMOTE_PORT": .value = 5002: .ValType = 1: .Locked = 1: .Min = 1: .Max = 50000: End With With CONF(CONF_LOCAL_PORT): .Name = "LOCAL_PORT": .value = 5100: .ValType = 1: .Locked = 1: .Min = 1: .Max = 50000: End With With CONF(CONF_RATE): .Name = "RATE": .value = 50: .ValType = 1: .Locked = 1: .Min = 25: .Max = 100: End With With CONF(TEAM_COLOR1): .Name = "TEAM_COLOR1": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = MAX_COLORS: End With With CONF(TEAM_COLOR2): .Name = "TEAM_COLOR2": .value = 0: .ValType = 1: .Locked = 0: .Min = 0: .Max = MAX_COLORS: End With With CONF(TEAM_COLOR3): .Name = "TEAM_COLOR3": .value = 2: .ValType = 1: .Locked = 0: .Min = 0: .Max = MAX_COLORS: End With With CONF(TEAM_COLOR4): .Name = "TEAM_COLOR4": .value = 3: .ValType = 1: .Locked = 0: .Min = 0: .Max = MAX_COLORS: End With With CONF(TEAM_COLORIDLE): .Name = "TEAM_COLORIDLE": .value = 7: .ValType = 1: .Locked = 0: .Min = 0: .Max = MAX_COLORS: End With With CONF(TABS_LEFT): .Name = "TABS_LEFT": .value = 5: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(TABS_TOP): .Name = "TABS_TOP": .value = 5: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(TABS_FONTX): .Name = "TABS_FONTX": .value = 800: .ValType = 1: .Locked = 0: .Min = 0: .Max = 5000: End With With CONF(TABS_FONTY): .Name = "TABS_FONTY": .value = 600: .ValType = 1: .Locked = 0: .Min = 0: .Max = 5000: End With With CONF(TABS_SPACING): .Name = "TABS_SPACING": .value = 1.5: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(TABS_SCORESPACING): .Name = "TABS_SCORESPACING": .value = 15: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(TABS_AVATAR): .Name = "TABS_AVATAR": .value = 0: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(TABS_FONTSET): .Name = "TABS_FONTSET": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(MAGNA_SPEED): .Name = "MAGNA_SPEED": .value = 20: .ValType = 0: .Locked = 0: .Min = -100: .Max = 100: End With With CONF(MAGNA_LIMIT): .Name = "MAGNA_LIMIT": .value = 20: .ValType = 0: .Locked = 0: .Min = -100: .Max = 100: End With With CONF(MAGNA_RED): .Name = "MAGNA_RED": .value = 0.5: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(MAGNA_GREEN): .Name = "MAGNA_GREEN": .value = 0.5: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(MAGNA_BLUE): .Name = "MAGNA_BLUE": .value = 0.5: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(MAGNA_MARGIN): .Name = "MAGNA_MARGIN": .value = 0.05: .ValType = 0: .Locked = 0: .Min = -1: .Max = 1: End With With CONF(MAGNA_TEXTURE): .Name = "MAGNA_TEXTURE": .value = 4: .ValType = 0: .Locked = 0: .Min = 0: .Max = MAX_TEXTURES: End With With CONF(MAGNA_TEXTURERATIO): .Name = "MAGNA_TEXTURERATIO": .value = 1: .ValType = 0: .Locked = 0: .Min = -100: .Max = 100: End With With CONF(DOWNLOAD_AVATARS): .Name = "DOWNLOAD_AVATARS": .value = 1: .ValType = 1: .Locked = 1: .Min = 0: .Max = 1: End With With CONF(REQUEST_AVATAR): .Name = "REQUEST_AVATAR": .value = 1: .ValType = 1: .Locked = 1: .Min = 0: .Max = 1: End With With CONF(LOAD_AVATARS): .Name = "LOAD_AVATARS": .value = 1: .ValType = 1: .Locked = 1: .Min = 0: .Max = 1: End With With CONF(DRAW_AVATARS): .Name = "DRAW_AVATARS": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(IGNORE_UNKNOWN_AVATARS): .Name = "IGNORE_UNKNOWN_AVATARS": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(AVATAR_LEFT): .Name = "AVATAR_LEFT": .value = -5: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(AVATAR_TOP): .Name = "AVATAR_TOP": .value = 4: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(AVATAR_WIDTH): .Name = "AVATAR_WIDTH": .value = 0.4: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(AVATAR_HEIGHT): .Name = "AVATAR_HEIGHT": .value = 0.4: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(AVATAR_SPACING): .Name = "AVATAR_SPACING": .value = 0.1: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(AVATAR_RED): .Name = "AVATAR_RED": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(AVATAR_GREEN): .Name = "AVATAR_GREEN": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(AVATAR_BLUE): .Name = "AVATAR_BLUE": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(AVATAR_ZDEPTH): .Name = "AVATAR_ZDEPTH": .value = -4.2: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(SPHERE_SLICES): .Name = "SPHERE_SLICES": .value = 16: .ValType = 0: .Locked = 0: .Min = 1: .Max = 512: End With With CONF(SPHERE_STACKS): .Name = "SPHERE_STACKS": .value = 16: .ValType = 0: .Locked = 0: .Min = 1: .Max = 512: End With With CONF(DRAW_SPHERES): .Name = "DRAW_SPHERES": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(SPHERE_RED): .Name = "SPHERE_RED": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(SPHERE_GREEN): .Name = "SPHERE_GREEN": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(SPHERE_BLUE): .Name = "SPHERE_BLUE": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(R_SCOPE_GUN1): .Name = "R_SCOPE_GUN1": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 9: End With With CONF(R_SCOPE_GUN2): .Name = "R_SCOPE_GUN2": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 9: End With With CONF(R_SCOPE_GUN3): .Name = "R_SCOPE_GUN3": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 9: End With With CONF(R_SCOPE_TYPE1): .Name = "R_SCOPE_TYPE1": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 5: End With With CONF(R_SCOPE_TYPE2): .Name = "R_SCOPE_TYPE2": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 5: End With With CONF(R_SCOPE_TYPE3): .Name = "R_SCOPE_TYPE3": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 5: End With With CONF(R_STABILITY): .Name = "R_STABILITY": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 9: End With With CONF(R_STABILITY_LEVEL): .Name = "R_STABILITY_LEVEL": .value = 0: .ValType = 1: .Locked = 1: .Min = 0: .Max = 10: End With With CONF(SPARK_FORCE_MULTIPLY): .Name = "SPARK_FORCE_MULTIPLY": .value = 1: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(SPARK_FORCE_MIN): .Name = "SPARK_FORCE_MIN": .value = 10: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(SPARK_FORCE_MAX): .Name = "SPARK_FORCE_MAX": .value = 100: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(SPARK_PARTICLE_MIN): .Name = "SPARK_PARTICLE_MIN": .value = 1: .ValType = 1: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(SPARK_PARTICLE_MULTIPLY): .Name = "SPARK_PARTICLE_MULTIPLY": .value = 1: .ValType = 0: .Locked = 0: .Min = -50: .Max = 50: End With With CONF(SPARK_PARTICLE_MAX): .Name = "SPARK_PARTICLE_MAX": .value = 100: .ValType = 1: .Locked = 0: .Min = 1: .Max = 1000: End With With CONF(SPARK_PARTICLE_ADD): .Name = "SPARK_PARTICLE_ADD": .value = 0: .ValType = 1: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(SPARK_PLASMA): .Name = "SPARK_PLASMA": .value = 10: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(SPARK_USE_MAX): .Name = "SPARK_USE_MAX": .value = MAX_SPARKS: .ValType = 0: .Locked = 0: .Min = 0: .Max = MAX_SPARKS: End With With CONF(DRAW_ROCKET_TRAILS): .Name = "DRAW_ROCKET_TRAILS": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(ROCKET_TRAIL_FORCE): .Name = "ROCKET_TRAIL_FORCE": .value = 50: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(ROCKET_TRAIL_PARTICLES): .Name = "ROCKET_TRAIL_PARTICLES": .value = 50: .ValType = 1: .Locked = 0: .Min = 0: .Max = 2000: End With With CONF(SPARK_RED): .Name = "SPARK_RED": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(SPARK_GREEN): .Name = "SPARK_GREEN": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(SPARK_BLUE): .Name = "SPARK_BLUE": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(ROCKET_TRAIL_RED): .Name = "ROCKET_TRAIL_RED": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(ROCKET_TRAIL_GREEN): .Name = "ROCKET_TRAIL_GREEN": .value = 0.7: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(ROCKET_TRAIL_BLUE): .Name = "ROCKET_TRAIL_BLUE": .value = 0.3: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(ROCKET_TRAIL_FADESPEED): .Name = "ROCKET_TRAIL_FADESPEED": .value = 300: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 8000: End With With CONF(ROCKET_TRAIL_SIZE): .Name = "ROCKET_TRAIL_SIZE": .value = 75: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(SPARK_PARTICLE_SIZE): .Name = "SPARK_PARTICLE_SIZE": .value = 75: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(SPARK_PARTICLE_FADESPEED): .Name = "SPARK_PARTICLE_FADESPEED": .value = 200: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 8000: End With With CONF(PLASMA_SPARK_SIZE): .Name = "PLASMA_SPARK_SIZE": .value = 75: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(PLASMA_SPARK_AMOUNT): .Name = "PLASMA_SPARK_AMOUNT": .value = 5: .ValType = 0: .Locked = 0: .Min = 0: .Max = 200: End With With CONF(FAN_SPARK_SIZE): .Name = "FAN_SPARK_SIZE": .value = 50: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(FAN_SPARK_AMOUNT): .Name = "FAN_SPARK_AMOUNT": .value = 5: .ValType = 0: .Locked = 0: .Min = 0: .Max = 200: End With With CONF(DRAW_PLASMA_SPARKS): .Name = "DRAW_PLASMA_SPARKS": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(DRAW_FAN_SPARKS): .Name = "DRAW_FAN_SPARKS": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(FAN_SPARK_FADESPEED): .Name = "FAN_SPARK_FADESPEED": .value = 500: .ValType = 0: .Locked = 0: .Min = 0: .Max = 10000: End With With CONF(FAN_SPARK_RED): .Name = "FAN_SPARK_RED": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(FAN_SPARK_GREEN): .Name = "FAN_SPARK_GREEN": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(FAN_SPARK_BLUE): .Name = "FAN_SPARK_BLUE": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(PLASMA_SPARK_FADESPEED): .Name = "PLASMA_SPARK_FADESPEED": .value = 300: .ValType = 0: .Locked = 0: .Min = 0: .Max = 10000: End With With CONF(PLASMA_SPARK_RED): .Name = "PLASMA_SPARK_RED": .value = 0: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(PLASMA_SPARK_GREEN): .Name = "PLASMA_SPARK_GREEN": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(PLASMA_SPARK_BLUE): .Name = "PLASMA_SPARK_BLUE": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(CLOCK_MISSILE_SPEED): .Name = "CLOCK_MISSILE_SPEED": .value = 0: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(SHOTGUN_SPARK_FADESPEED): .Name = "SHOTGUN_SPARK_FADESPEED": .value = 200: .ValType = 0: .Locked = 0: .Min = 0: .Max = 10000: End With With CONF(SHOTGUN_SPARK_AMOUNT): .Name = "SHOTGUN_SPARK_AMOUNT": .value = 15: .ValType = 0: .Locked = 0: .Min = 0: .Max = 200: End With With CONF(SHOTGUN_SPARK_SIZE): .Name = "SHOTGUN_SPARK_SIZE": .value = 50: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(BULLET_SPARK_FADESPEED): .Name = "BULLET_SPARK_FADESPEED": .value = 300: .ValType = 0: .Locked = 0: .Min = 0: .Max = 10000: End With With CONF(BULLET_SPARK_AMOUNT): .Name = "BULLET_SPARK_AMOUNT": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 200: End With With CONF(BULLET_SPARK_SIZE): .Name = "BULLET_SPARK_SIZE": .value = 40: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(BULLET_SPARK_RED): .Name = "BULLET_SPARK_RED": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(BULLET_SPARK_GREEN): .Name = "BULLET_SPARK_GREEN": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(BULLET_SPARK_BLUE): .Name = "BULLET_SPARK_BLUE": .value = 1: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(SHOTGUN_SPARK_FORCE): .Name = "SHOTGUN_SPARK_FORCE": .value = 50: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(BULLET_SPARK_FORCE): .Name = "BULLET_SPARK_FORCE": .value = 50: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(SHOTGUN_SPARK_VARY_POWER): .Name = "SHOTGUN_SPARK_VARY_POWER": .value = 2: .ValType = 0: .Locked = 0: .Min = 0: .Max = 50: End With With CONF(SHOTGUN_SPARK_DEDUCT): .Name = "SHOTGUN_SPARK_DEDUCT": .value = 50: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(RECOIL_POWER): .Name = "RECOIL_POWER": .value = 1.5: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With With CONF(RECOIL_X): .Name = "RECOIL_X": .value = 0: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With With CONF(RECOIL_Y): .Name = "RECOIL_Y": .value = -0.5: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With With CONF(RECOIL_Z): .Name = "RECOIL_Z": .value = 1: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With With CONF(RECOIL_HOR): .Name = "RECOIL_HOR": .value = 0: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With With CONF(RECOIL_VER): .Name = "RECOIL_VER": .value = 0: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With With CONF(RECOIL_BAR): .Name = "RECOIL_BAR": .value = 0: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With With CONF(RECOIL_RESISTANCE): .Name = "RECOIL_RESISTANCE": .value = 1000: .ValType = 0: .Locked = 0: .Min = 0: .Max = 5000: End With With CONF(RECOIL_SQUIDGE): .Name = "RECOIL_SQUIDGE": .value = 0.5: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(RECOIL_NEG_SQUIDGE): .Name = "RECOIL_NEG_SQUIDGE": .value = 0.5: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(RECOIL_MAX): .Name = "RECOIL_MAX": .value = 0.5: .ValType = 0: .Locked = 0: .Min = 0: .Max = 1000: End With With CONF(RECOIL_GATING): .Name = "RECOIL_GATING": .value = 10: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(RAIL_SPARK_AMOUNT): .Name = "RAIL_SPARK_AMOUNT": .value = 8: .ValType = 0: .Locked = 0: .Min = 0: .Max = 500: End With With CONF(RAIL_SPARK_SIZE): .Name = "RAIL_SPARK_SIZE": .value = 300: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 2000: End With With CONF(RAIL_SPARK_MATCH_COLORS): .Name = "RAIL_SPARK_MATCH_COLORS": .value = 0: .ValType = 0: .Locked = 0: .Min = -1000: .Max = 1000: End With With CONF(RAIL_SPARK_FORCE): .Name = "RAIL_SPARK_FORCE": .value = 30: .ValType = 0: .Locked = 0: .Min = -500: .Max = 500: End With With CONF(RAIL_FORCE_TEAM_COLOR): .Name = "RAIL_FORCE_TEAM_COLOR": .value = -1: .ValType = 1: .Locked = 0: .Min = -1: .Max = 9: End With With CONF(RAIL_FORCE_ENEMY_COLOR): .Name = "RAIL_FORCE_ENEMY_COLOR": .value = -1: .ValType = 1: .Locked = 0: .Min = -1: .Max = 9: End With With CONF(RAIL_COLOR): .Name = "RAIL_COLOR": .value = 0: .ValType = 0: .Locked = 0: .Min = 0: .Max = 9: End With With CONF(RAIL_ORBIT): .Name = "RAIL_ORBIT": .value = 1000: .ValType = 0: .Locked = 0: .Min = 0: .Max = 30000: End With With CONF(RAIL_SPARK_FADESPEED): .Name = "RAIL_SPARK_FADESPEED": .value = 100: .ValType = 0: .Locked = 0: .Min = 0: .Max = 10000: End With With CONF(RAIL_SLUG_FADESPEED): .Name = "RAIL_SLUG_FADESPEED": .value = 0.4: .ValType = 0: .Locked = 0: .Min = 0: .Max = 100: End With With CONF(RAIL_SLUG_FADESTART): .Name = "RAIL_SLUG_FADESTART": .value = 700: .ValType = 0: .Locked = 0: .Min = 0: .Max = 30000: End With With CONF(RAIL_SLUG_CHASE): .Name = "RAIL_SLUG_CHASE": .value = 0: .ValType = 0: .Locked = 0: .Min = 0: .Max = 100: End With With CONF(CHAT_KEY_STYLE): .Name = "CHAT_KEY_STYLE": .value = 1: .ValType = 1: .Locked = 0: .Min = 0: .Max = 1: End With With CONF(SLUG_X): .Name = "SLUG_X": .value = 0: .ValType = 0: .Locked = 0: .Min = -5: .Max = 5: End With With CONF(SLUG_Y): .Name = "SLUG_Y": .value = 0: .ValType = 0: .Locked = 0: .Min = -5: .Max = 5: End With With CONF(SLUG_Z): .Name = "SLUG_Z": .value = 0: .ValType = 0: .Locked = 0: .Min = -5: .Max = 5: End With With CONF(CHANGE_GUN_HOR): .Name = "CHANGE_GUN_HOR": .value = 0: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With With CONF(CHANGE_GUN_VER): .Name = "CHANGE_GUN_VER": .value = -400: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With With CONF(CHANGE_GUN_BAR): .Name = "CHANGE_GUN_BAR": .value = 0: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With With CONF(CHANGE_GUN_X): .Name = "CHANGE_GUN_X": .value = 0: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With With CONF(CHANGE_GUN_Y): .Name = "CHANGE_GUN_Y": .value = -5: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With With CONF(CHANGE_GUN_Z): .Name = "CHANGE_GUN_Z": .value = 5: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With With CONF(GRENADE_BOUNCES): .Name = "GRENADE_BOUNCES": .value = 3: .ValType = 1: .Locked = 0: .Min = 0: .Max = 9: End With With CONF(INSTRUMENT_ZDEPTH): .Name = "INSTRUMENT_ZDEPTH": .value = -4.2: .ValType = 0: .Locked = 0: .Min = -5000: .Max = 5000: End With 'wconfs With WCONF(SCRIPT_NAME): .Name = "SCRIPT_NAME": .CHAR = "Pro Script": .Locked = 0: End With With WCONF(CONSOLE_ARROW): .Name = "CONSOLE_ARROW": .CHAR = "$ ": .Locked = 0: End With With WCONF(CONSOLE_INPUT): .Name = "CONSOLE_INPUT": .CHAR = "_ ": .Locked = 0: End With With WCONF(PLAYER_NAME): .Name = "NAME": .CHAR = "Noob": .Locked = 2: End With With WCONF(RESOURCE_FOLDER): .Name = "RESOURCE_FOLDER": .CHAR = "main": .Locked = 0: End With With WCONF(ECHO_ARROW): .Name = "ECHO_ARROW": .CHAR = "> ": .Locked = 0: End With With WCONF(REMOTE_HOST): .Name = "REMOTE_HOST": .CHAR = "localhost": .Locked = 1: End With With WCONF(PASSWORD): .Name = "PASSWORD": .CHAR = "password": .Locked = 0: End With With WCONF(AVATAR_PASSWORD): .Name = "AVATAR_PASSWORD": .CHAR = "default": .Locked = 1: End With With WCONF(BUTTON_CONSOLE): .Name = "BUTTON_CONSOLE": .CHAR = "ESCAPE": .Locked = 0: End With With WCONF(BUTTON_SMALLCONSOLE): .Name = "BUTTON_SMALLCONSOLE": .CHAR = "KEY 223": .Locked = 0: End With With WCONF(BUTTON_FORWARD): .Name = "BUTTON_FORWARD": .CHAR = "W": .Locked = 0: End With With WCONF(BUTTON_BACK): .Name = "BUTTON_BACK": .CHAR = "S": .Locked = 0: End With With WCONF(BUTTON_LEFT): .Name = "BUTTON_LEFT": .CHAR = "A": .Locked = 0: End With With WCONF(BUTTON_RIGHT): .Name = "BUTTON_RIGHT": .CHAR = "D": .Locked = 0: End With With WCONF(BUTTON_JUMP): .Name = "BUTTON_JUMP": .CHAR = "SPACE": .Locked = 0: End With With WCONF(BUTTON_SCORES): .Name = "BUTTON_SCORES": .CHAR = "TAB": .Locked = 0: End With With WCONF(BUTTON_FIRE): .Name = "BUTTON_FIRE": .CHAR = "MOUSE1": .Locked = 0: End With With WCONF(BUTTON_ROCKET): .Name = "BUTTON_ROCKET": .CHAR = "1": .Locked = 0: End With With WCONF(BUTTON_FAN): .Name = "BUTTON_FAN": .CHAR = "2": .Locked = 0: End With With WCONF(BUTTON_PLASMA): .Name = "BUTTON_PLASMA": .CHAR = "3": .Locked = 0: End With With WCONF(BUTTON_SHOTGUN): .Name = "BUTTON_SHOTGUN": .CHAR = "4": .Locked = 0: End With With WCONF(BUTTON_RIFLE): .Name = "BUTTON_RIFLE": .CHAR = "5": .Locked = 5: End With With WCONF(BUTTON_MACHINEGUN): .Name = "BUTTON_MACHINEGUN": .CHAR = "7": .Locked = 0: End With With WCONF(BUTTON_GRENADE): .Name = "BUTTON_GRENADE": .CHAR = "6": .Locked = 0: End With With WCONF(BUTTON_RAIL): .Name = "BUTTON_RAIL": .CHAR = "8": .Locked = 0: End With With WCONF(BUTTON_SPECIAL): .Name = "BUTTON_SPECIAL": .CHAR = "9": .Locked = 0: End With With WCONF(BUTTON_NOGUN): .Name = "BUTTON_NOGUN": .CHAR = "0": .Locked = 0: End With With WCONF(BUTTON_NEXT): .Name = "BUTTON_NEXT": .CHAR = "E": .Locked = 0: End With With WCONF(BUTTON_PREV): .Name = "BUTTON_PREV": .CHAR = "Q": .Locked = 0: End With With WCONF(BUTTON_CLUTCH): .Name = "BUTTON_CLUTCH": .CHAR = "C": .Locked = 0: End With 'comms With COMM(COMM_VERSION): .Name = "VERSION": .Locked = 0: .CommType = 0: .Help = "View client version.": End With With COMM(COMM_QUIT): .Name = "QUIT": .Locked = 0: .CommType = 0: .Help = "Exit the game.": End With With COMM(COMM_INITGL): .Name = "INITGL": .Locked = 1: .CommType = 0: .Help = "Restart the OpenGL graphics engine.": End With With COMM(COMM_COMPILEINFO): .Name = "COMPILEINFO": .Locked = 0: .CommType = 0: .Help = "View the client compile information.": End With With COMM(COMM_LOADCONFIG): .Name = "LOADCONFIG": .Locked = 1: .CommType = 1: .Help = "filename": End With With COMM(COMM_WRITECONFIG): .Name = "WRITECONFIG": .Locked = 0: .CommType = 1: .Help = "filename": End With With COMM(COMM_GOTOCONSOLE): .Name = "GOTOCONSOLE": .Locked = 0: .CommType = 0: .Help = "Go to the big console.": End With With COMM(COMM_GOTOWORLD): .Name = "GOTOWORLD": .Locked = 0: .CommType = 0: .Help = "Go to the world screen (no console).": End With With COMM(COMM_CLS): .Name = "CLS": .Locked = 0: .CommType = 0: .Help = "Clear all console text.": End With With COMM(COMM_ECHO): .Name = "ECHO": .Locked = 0: .CommType = 1: .Help = "text": End With With COMM(COMM_CECHO): .Name = "CECHO": .Locked = 0: .CommType = 1: .Help = "integer, then space, then text": End With With COMM(COMM_MAN): .Name = "MAN": .Locked = 0: .CommType = 1: .Help = "command or subject": End With With COMM(COMM_HELP): .Name = "HELP": .Locked = 0: .CommType = 1: .Help = "command or subject": End With With COMM(COMM_DELETE): .Name = "DELETE": .Locked = 0: .CommType = 1: .Help = "instrument code line number": End With With COMM(COMM_EDIT): .Name = "EDIT": .Locked = 0: .CommType = 1: .Help = "line number": End With With COMM(COMM_INSTRUMENTS): .Name = "INSTRUMENTS": .Locked = 0: .CommType = 0: .Help = "List all instruments in use.": End With With COMM(COMM_CODE): .Name = "CODE": .Locked = 0: .CommType = 1: .Help = "instrument code": End With With COMM(COMM_CLEAR_INSTRUMENTS): .Name = "CLEAR_INSTRUMENTS": .Locked = 0: .CommType = 0: .Help = "Clear all instruments.": End With With COMM(COMM_CONNECT): .Name = "CONNECT": .Locked = 1: .CommType = 1: .Help = "host:port": End With With COMM(COMM_JOIN): .Name = "JOIN": .Locked = 0: .CommType = 1: .Help = "team number": End With With COMM(COMM_IDLE): .Name = "IDLE": .Locked = 0: .CommType = 0: .Help = "Join the idle team or spectate.": End With With COMM(COMM_INCLUDE): .Name = "INCLUDE": .Locked = 0: .CommType = 1: .Help = "raw config sub-file": End With With COMM(COMM_ROSTER): .Name = "ROSTER": .Locked = 0: .CommType = 0: .Help = "View your equipment roster and points spent.": End With With COMM(COMM_ADD_REMOTE): .Name = "ADD_REMOTE": .Locked = 0: .CommType = 1: .Help = "[situation] [script raw path/filename]": End With With COMM(COMM_CLEAR_REMOTES): .Name = "CLEAR_REMOTES": .Locked = 0: .CommType = 0: .Help = "Erase all remote scripts.": End With With COMM(COMM_REMOTES): .Name = "REMOTES": .Locked = 0: .CommType = 0: .Help = "View remote scripts.": End With With COMM(COMM_MAIN_ECHO_ON): .Name = "MAIN_ECHO_ON": .Locked = 0: .CommType = 0: .Help = "Turn all console output on.": End With With COMM(COMM_MAIN_ECHO_OFF): .Name = "MAIN_ECHO_OFF": .Locked = 0: .CommType = 0: .Help = "Turn all console output off.": End With 'set defaults For x = 0 To MAX_CONFS CONF(x).DefaultValue = CONF(x).value Next x For x = 0 To MAX_WCONFS WCONF(x).DefaultChar = WCONF(x).CHAR Next x 'apply values REFRESH_CONFIG End Sub Public Sub REFRESH_CONFIG() Dim p As String 'set buttons! For x = 0 To MAX_WCONFS If Left(WCONF(x).Name, 7) = "BUTTON_" Then With WCONF(x) If UCase$(.CHAR) = "A" Then BUTTON(x) = vbKeyA If UCase$(.CHAR) = "B" Then BUTTON(x) = vbKeyB If UCase$(.CHAR) = "C" Then BUTTON(x) = vbKeyC If UCase$(.CHAR) = "D" Then BUTTON(x) = vbKeyD If UCase$(.CHAR) = "E" Then BUTTON(x) = vbKeyE If UCase$(.CHAR) = "F" Then BUTTON(x) = vbKeyF If UCase$(.CHAR) = "G" Then BUTTON(x) = vbKeyG If UCase$(.CHAR) = "H" Then BUTTON(x) = vbKeyH If UCase$(.CHAR) = "I" Then BUTTON(x) = vbKeyI If UCase$(.CHAR) = "J" Then BUTTON(x) = vbKeyJ If UCase$(.CHAR) = "K" Then BUTTON(x) = vbKeyK If UCase$(.CHAR) = "L" Then BUTTON(x) = vbKeyL If UCase$(.CHAR) = "M" Then BUTTON(x) = vbKeyM If UCase$(.CHAR) = "N" Then BUTTON(x) = vbKeyN If UCase$(.CHAR) = "O" Then BUTTON(x) = vbKeyO If UCase$(.CHAR) = "P" Then BUTTON(x) = vbKeyP If UCase$(.CHAR) = "Q" Then BUTTON(x) = vbKeyQ If UCase$(.CHAR) = "R" Then BUTTON(x) = vbKeyR If UCase$(.CHAR) = "S" Then BUTTON(x) = vbKeyS If UCase$(.CHAR) = "T" Then BUTTON(x) = vbKeyT If UCase$(.CHAR) = "U" Then BUTTON(x) = vbKeyU If UCase$(.CHAR) = "V" Then BUTTON(x) = vbKeyV If UCase$(.CHAR) = "W" Then BUTTON(x) = vbKeyW If UCase$(.CHAR) = "X" Then BUTTON(x) = vbKeyX If UCase$(.CHAR) = "Y" Then BUTTON(x) = vbKeyY If UCase$(.CHAR) = "Z" Then BUTTON(x) = vbKeyZ If UCase$(.CHAR) = "CONTROL" Then BUTTON(x) = vbKeyControl If UCase$(.CHAR) = "SPACE" Then BUTTON(x) = vbKeySpace If UCase$(.CHAR) = "RETURN" Then BUTTON(x) = vbKeyReturn If UCase$(.CHAR) = "TAB" Then BUTTON(x) = vbKeyTab If UCase$(.CHAR) = "1" Then BUTTON(x) = vbKey1 If UCase$(.CHAR) = "2" Then BUTTON(x) = vbKey2 If UCase$(.CHAR) = "3" Then BUTTON(x) = vbKey3 If UCase$(.CHAR) = "4" Then BUTTON(x) = vbKey4 If UCase$(.CHAR) = "5" Then BUTTON(x) = vbKey5 If UCase$(.CHAR) = "6" Then BUTTON(x) = vbKey6 If UCase$(.CHAR) = "7" Then BUTTON(x) = vbKey7 If UCase$(.CHAR) = "8" Then BUTTON(x) = vbKey8 If UCase$(.CHAR) = "9" Then BUTTON(x) = vbKey9 If UCase$(.CHAR) = "0" Then BUTTON(x) = vbKey0 If UCase$(.CHAR) = "SHIFT" Then BUTTON(x) = vbKeyShift If UCase$(.CHAR) = "BACK" Then BUTTON(x) = vbKeyBack If UCase$(.CHAR) = "DELETE" Then BUTTON(x) = vbKeyDelete If UCase$(.CHAR) = "HOME" Then BUTTON(x) = vbKeyHome If UCase$(.CHAR) = "END" Then BUTTON(x) = vbKeyEnd If UCase$(.CHAR) = "INSERT" Then BUTTON(x) = vbKeyInsert If UCase$(.CHAR) = "PAGEUP" Then BUTTON(x) = vbKeyPageUp If UCase$(.CHAR) = "PAGEDOWN" Then BUTTON(x) = vbKeyPageDown If UCase$(.CHAR) = "UP" Then BUTTON(x) = vbKeyUp If UCase$(.CHAR) = "DOWN" Then BUTTON(x) = vbKeyDown If UCase$(.CHAR) = "LEFT" Then BUTTON(x) = vbKeyLeft If UCase$(.CHAR) = "RIGHT" Then BUTTON(x) = vbKeyRight If UCase$(.CHAR) = "ADD" Then BUTTON(x) = vbKeyAdd If UCase$(.CHAR) = "SUBTRACT" Then BUTTON(x) = vbKeySubtract If UCase$(.CHAR) = "MULTIPLY" Then BUTTON(x) = vbKeyMultiply If UCase$(.CHAR) = "ESCAPE" Then BUTTON(x) = vbKeyEscape If UCase$(.CHAR) = "CANCEL" Then BUTTON(x) = vbKeyCancel If UCase$(.CHAR) = "MOUSE1" Then BUTTON(x) = vbKeyLButton If UCase$(.CHAR) = "MOUSE2" Then BUTTON(x) = vbKeyRButton If UCase$(.CHAR) = "MOUSE3" Then BUTTON(x) = vbKeyMButton If UCase$(.CHAR) = "CLEAR" Then BUTTON(x) = vbKeyClear If UCase$(.CHAR) = "CAPSLOCK" Then BUTTON(x) = vbKeyCapital If UCase$(.CHAR) = "SNAPSHOT" Then BUTTON(x) = vbKeySnapshot If UCase$(.CHAR) = "HELP" Then BUTTON(x) = vbKeyHelp If UCase$(.CHAR) = "NUMLOCK" Then BUTTON(x) = vbKeyNumlock If UCase$(.CHAR) = "PAD0" Then BUTTON(x) = vbKeyNumpad0 If UCase$(.CHAR) = "PAD1" Then BUTTON(x) = vbKeyNumpad1 If UCase$(.CHAR) = "PAD2" Then BUTTON(x) = vbKeyNumpad2 If UCase$(.CHAR) = "PAD3" Then BUTTON(x) = vbKeyNumpad3 If UCase$(.CHAR) = "PAD4" Then BUTTON(x) = vbKeyNumpad4 If UCase$(.CHAR) = "PAD5" Then BUTTON(x) = vbKeyNumpad5 If UCase$(.CHAR) = "PAD6" Then BUTTON(x) = vbKeyNumpad6 If UCase$(.CHAR) = "PAD7" Then BUTTON(x) = vbKeyNumpad7 If UCase$(.CHAR) = "PAD8" Then BUTTON(x) = vbKeyNumpad8 If UCase$(.CHAR) = "PAD9" Then BUTTON(x) = vbKeyNumpad9 If UCase$(.CHAR) = "DOT" Then BUTTON(x) = vbKeyDecimal If UCase$(.CHAR) = "DIVIDE" Then BUTTON(x) = vbKeyDivide If UCase$(.CHAR) = "F1" Then BUTTON(x) = vbKeyF1 If UCase$(.CHAR) = "F2" Then BUTTON(x) = vbKeyF2 If UCase$(.CHAR) = "F3" Then BUTTON(x) = vbKeyF3 If UCase$(.CHAR) = "F4" Then BUTTON(x) = vbKeyF4 If UCase$(.CHAR) = "F5" Then BUTTON(x) = vbKeyF5 If UCase$(.CHAR) = "F6" Then BUTTON(x) = vbKeyF6 If UCase$(.CHAR) = "F7" Then BUTTON(x) = vbKeyF7 If UCase$(.CHAR) = "F8" Then BUTTON(x) = vbKeyF8 If UCase$(.CHAR) = "F9" Then BUTTON(x) = vbKeyF9 If UCase$(.CHAR) = "F10" Then BUTTON(x) = vbKeyF10 If UCase$(.CHAR) = "F11" Then BUTTON(x) = vbKeyF11 If UCase$(.CHAR) = "F12" Then BUTTON(x) = vbKeyF12 If UCase$(.CHAR) = "F13" Then BUTTON(x) = vbKeyF13 If UCase$(.CHAR) = "F14" Then BUTTON(x) = vbKeyF14 If UCase$(.CHAR) = "F15" Then BUTTON(x) = vbKeyF15 If UCase$(.CHAR) = "F16" Then BUTTON(x) = vbKeyF16 If UCase$(.CHAR) = "SEPARATOR" Then BUTTON(x) = vbKeySeparator If Left$(UCase$(.CHAR), 3) = "KEY" Then BUTTON(x) = Int(Mid$(.CHAR, 4)) End With End If Next x gl_scale = CONF(CONF_SCALE).value 'sort out colors for packet part---> COLORPAC$ = "" 'skin color p = Int(CONF(HEAD_COLOR).value) If p = "10" Then p = "A" If p = "11" Then p = "B" If p = "12" Then p = "C" If p = "13" Then p = "D" If p = "14" Then p = "E" If p = "15" Then p = "F" If p = "16" Then p = "G" If p = "17" Then p = "H" If p = "18" Then p = "I" If p = "19" Then p = "J" If p = "20" Then p = "K" COLORPAC$ = COLORPAC$ & p 'body color p = Int(CONF(BODY_COLOR).value) If p = "10" Then p = "A" If p = "11" Then p = "B" If p = "12" Then p = "C" If p = "13" Then p = "D" If p = "14" Then p = "E" If p = "15" Then p = "F" If p = "16" Then p = "G" If p = "17" Then p = "H" If p = "18" Then p = "I" If p = "19" Then p = "J" If p = "20" Then p = "K" COLORPAC$ = COLORPAC$ & p 'horn color p = Int(CONF(HORN_COLOR).value) If p = "10" Then p = "A" If p = "11" Then p = "B" If p = "12" Then p = "C" If p = "13" Then p = "D" If p = "14" Then p = "E" If p = "15" Then p = "F" If p = "16" Then p = "G" If p = "17" Then p = "H" If p = "18" Then p = "I" If p = "19" Then p = "J" If p = "20" Then p = "K" COLORPAC$ = COLORPAC$ & p 'arm color p = Int(CONF(ARM_COLOR).value) If p = "10" Then p = "A" If p = "11" Then p = "B" If p = "12" Then p = "C" If p = "13" Then p = "D" If p = "14" Then p = "E" If p = "15" Then p = "F" If p = "16" Then p = "G" If p = "17" Then p = "H" If p = "18" Then p = "I" If p = "19" Then p = "J" If p = "20" Then p = "K" COLORPAC$ = COLORPAC$ & p 'tail color p = Int(CONF(TAIL_COLOR).value) If p = "10" Then p = "A" If p = "11" Then p = "B" If p = "12" Then p = "C" If p = "13" Then p = "D" If p = "14" Then p = "E" If p = "15" Then p = "F" If p = "16" Then p = "G" If p = "17" Then p = "H" If p = "18" Then p = "I" If p = "19" Then p = "J" If p = "20" Then p = "K" COLORPAC$ = COLORPAC$ & p 'work out max instruments MaxInstruments = 0 For x = 0 To MAX_INSTS If INST(x) <> "" Then MaxInstruments = x Next x 'work out roster score GetRosterScore End Sub Global CanDo Global AlreadyDone Global reason$ Global bb$ Global ConfigName$, IncludeName$ Global FNAME$ Global UpArrowSkills As String 'previous input for up arrow skillz Global SEL_INST 'current selected instrument Global ProLynMode As Integer '=1 means we're in automatic pro-lyn mode, so we don't need @ to add a command. Good for loading prolyn scripts. Global ECHO '=1 means its ON. remember this kids! Public Sub AddConsole(text As String) 'exit if echo is off, lol! If ECHO = 0 Then Exit Sub 'remember last line LAST_CONSOLE$ = text 'remote console here first If REMOTE_CONSOLE = 1 Then SEND_PACKET "OUTPUT:" & text End If '-------------------------------------------------------------------- 'trim the line if its too long DoMore: domoretext = 0 maxlen = CONF(CONSOLE_CHARWIDTH).value If Len(text) > maxlen Then 'attempt to find a previous space up to 30 spaces back pspacefound = 0 For ploop = 1 To 30 pspace = maxlen - ploop If pspace <= 1 Then pspace = 1 If pspacefound = 0 And Mid$(text, pspace, 1) = " " And pspace >= 5 Then pspacefound = 1: maxlen = pspace Next ploop bb$ = Mid$(text, maxlen + 1) text = Left$(text, maxlen) domoretext = 1 'eliminate space if we begin with it, to make it more tidy If Left(text, 1) = " " Then text = Mid(text, 2) End If '-------------------------------------------------------------------- 'shift up lines for graphic displayed console For wanker = 1 To 100 ConsoleLine$(wanker - 1) = ConsoleLine$(wanker) ConsoleColor(wanker - 1) = ConsoleColor(wanker) Next wanker ConsoleLine$(100) = text ConsoleColor(100) = 0 '-------------------------------------------------------------------- If domoretext = 1 Then text = bb$: GoTo DoMore '-------------------------------------------------------------------- End Sub Public Sub AddCustom(text As String, textType) 'exit if echo is off, lol! If ECHO = 0 Then Exit Sub '0=normal, 1=talk, 2=error, 3=data 'remote console here first If REMOTE_CONSOLE = 1 And textType <> 1 Then SEND_PACKET "OUTPUT:" & text End If '-------------------------------------------------------------------- 'trim the line if its too long DoMore2: domoretext = 0 maxlen = CONF(CONSOLE_CHARWIDTH).value If Len(text) > maxlen Then 'attempt to find a previous space up to 30 spaces back pspacefound = 0 For ploop = 1 To 30 pspace = maxlen - ploop If pspace <= 1 Then pspace = 1 If pspacefound = 0 And Mid$(text, pspace, 1) = " " And pspace >= 5 Then pspacefound = 1: maxlen = pspace Next ploop bb$ = Mid$(text, maxlen + 1) text = Left$(text, maxlen) domoretext = 1 'eliminate space if we begin with it, to make it more tidy If Left(text, 1) = " " Then text = Mid(text, 2) End If '-------------------------------------------------------------------- 'shift up lines for graphic displayed console For wanker = 1 To 100 ConsoleLine$(wanker - 1) = ConsoleLine$(wanker) ConsoleColor(wanker - 1) = ConsoleColor(wanker) Next wanker ConsoleLine$(100) = text ConsoleColor(100) = textType '-------------------------------------------------------------------- If domoretext = 1 Then text = bb$: GoTo DoMore2 '-------------------------------------------------------------------- End Sub Public Sub AddError(text As String) 'remote console here first If REMOTE_CONSOLE = 1 Then SEND_PACKET "OUTPUT:" & text End If '-------------------------------------------------------------------- 'trim the line if its too long DoMore3: domoretext = 0 maxlen = CONF(CONSOLE_CHARWIDTH).value If Len(text) > maxlen Then 'attempt to find a previous space up to 30 spaces back pspacefound = 0 For ploop = 1 To 30 pspace = maxlen - ploop If pspace <= 1 Then pspace = 1 If pspacefound = 0 And Mid$(text, pspace, 1) = " " And pspace >= 5 Then pspacefound = 1: maxlen = pspace Next ploop bb$ = Mid$(text, maxlen + 1) text = Left$(text, maxlen) domoretext = 1 'eliminate space if we begin with it, to make it more tidy If Left(text, 1) = " " Then text = Mid(text, 2) End If '-------------------------------------------------------------------- 'shift up lines for graphic displayed console For wanker = 1 To 100 ConsoleLine$(wanker - 1) = ConsoleLine$(wanker) ConsoleColor(wanker - 1) = ConsoleColor(wanker) Next wanker ConsoleLine$(100) = text ConsoleColor(100) = 2 '-------------------------------------------------------------------- If domoretext = 1 Then text = bb$: GoTo DoMore3 '-------------------------------------------------------------------- End Sub Public Sub CONSOLE_AUTOSUGGEST() Dim leng As Integer Dim WhatCommand As String 'automatically suggest the first command found in a bar and display at the bottom, but do not autocomplete WhatCommand = glCinput$ If Left$(WhatCommand, 1) = "\" Then WhatCommand = "/" & Mid$(WhatCommand, 2) If Left$(WhatCommand, 1) <> "/" And Left$(WhatCommand, 1) <> "?" Then WhatCommand = "/" & WhatCommand 'get command and length WhatCommand = Mid$(WhatCommand, 2) leng = Len(WhatCommand) MESSAGE$ = "" AutoComplete$ = "" AutoSuggestion$ = "" 'only bother if its len over 0 If WhatCommand <> "" Then '--------------------------------------------------------------------------------------------- 'if there is only one suggestion then we can go with it suggestions = 0 'words For x = 0 To MAX_WCONFS If Left$(LCase$(WCONF(x).Name), leng) = LCase$(WhatCommand) Then suggestions = suggestions + 1 If suggestions = 1 Then AutoSuggestion$ = WCONF(x).Name & " [char]" End If End If Next x 'numbers For x = 0 To MAX_CONFS If Left$(LCase$(CONF(x).Name), leng) = LCase$(WhatCommand) Then suggestions = suggestions + 1 If suggestions = 1 Then AutoSuggestion$ = CONF(x).Name If CONF(x).ValType = 0 Then AutoSuggestion$ = AutoSuggestion$ & " [number between " & CONF(x).Min & " and " & CONF(x).Max & "]" If CONF(x).ValType = 1 Then AutoSuggestion$ = AutoSuggestion$ & " [integer between " & CONF(x).Min & " and " & CONF(x).Max & "]" End If End If Next x 'commands For x = 0 To MAX_COMMS If Left$(LCase$(COMM(x).Name), leng) = LCase$(WhatCommand) Then suggestions = suggestions + 1 If suggestions = 1 Then AutoSuggestion$ = COMM(x).Name If COMM(x).CommType = 1 And COMM(x).Help <> "" Then AutoSuggestion$ = AutoSuggestion$ & " [" & COMM(x).Help & "]" If COMM(x).CommType = 0 And COMM(x).Help <> "" Then AutoSuggestion$ = AutoSuggestion$ & " - " & COMM(x).Help & "" End If End If Next x '--------------------------------------------------------------------------------------------- End If 'special addition: script command If WhatCommand = "." Then AutoSuggestion$ = ".[script name]" 'special addition: instrument command If WhatCommand = "@" Then AutoSuggestion$ = "@[add instrument code]" End Sub Public Sub CONSOLE_COMMAND() On Error GoTo CommandError 'read the potential command entered in the console of i$ AlreadyDone = 0 'echo=2+? If CONF(CONSOLE_ECHO).value >= 2 Then AddCustom WCONF(ECHO_ARROW).CHAR & i$, CONF(ECHO_COLOR).value 'convert ? to man/help If Left$(i$, 1) = "?" And Len(i$) >= 2 Then i$ = "/HELP " & Mid$(i$, 2) If Right$(i$, 1) = " " Then i$ = Left$(i$, (Len(i$) - 1)) End If 'config command If Left$(i$, 1) = "/" Or Left$(i$, 1) = "." Or Left$(i$, 1) = "&" Or Left$(i$, 1) = "@" Then 'remote console here first, IF we have echo off (otherwise it'll double) If REMOTE_CONSOLE = 1 And CONF(CONSOLE_ECHO).value = 0 Then SEND_PACKET "OUTPUT: > " & i$ End If 'echo on? If CONF(CONSOLE_ECHO).value = 1 Then AddCustom WCONF(ECHO_ARROW).CHAR & i$, CONF(ECHO_COLOR).value 'is it a conf or wconf? If Left$(i$, 1) = "/" Then CONSOLE_CONFIG AutoSuggestion$ = "" 'commands If AlreadyDone = 0 Then '------------------------------------------------------------------------- '/version If LCase$(Left$(i$, 8)) = "/version" Then AddConsole "VERSION: " & VERSION$ & " SCRIPT: " & WCONF(SCRIPT_NAME).CHAR End If '/initgl If LCase$(Left$(i$, 7)) = "/initgl" Then If PLAY <> 1 Then InitGL If PLAY = 1 Then AddConsole "Can't INITGL during game time." End If '/compileinfo If LCase$(Left$(i$, 12)) = "/compileinfo" Then AddConsole "Compile info:" AddConsole "Version " & VERSION$ AddConsole "Game MAX_TEXTURES: " & MAX_TEXTURES & " MAX_PLAYERS: " & MAX_PLAYERS & " MAX_MISSILES: " & MAX_MISSILES AddConsole " MAX_SPARKS: " & MAX_SPARKS AddConsole "Confs MAX_CONFS: " & MAX_CONFS & " MAX_WCONFS: " & MAX_WCONFS AddConsole " MAX_COMMS: " & MAX_COMMS & " MAX_INSTS: " & MAX_INSTS & " MAX_REMOTES: " & MAX_REMOTES AddConsole "Sprites MAX_SPRITES: " & MAX_SPRITES & " MAX_SHAPES: " & MAX_SHAPES AddConsole "Map MaxBlocks: " & MaxBlocks & " MaxAreas: " & MaxAreas & " MaxSpawns: " & MaxSpawns & " MaxSpheres: " & MaxSpheres End If '/loadconfig [filename] If LCase$(Left$(i$, 12)) = "/loadconfig " Then 'get name of config ConfigName$ = "conf/" & Mid$(i$, 13) If Len(ConfigName$) >= 1 Then LOAD_CONFIG ConfigName$ End If '/include [filename.whatever] If LCase$(Left$(i$, 9)) = "/include " Then 'get name of config IncludeName$ = Mid$(i$, 10) If Len(IncludeName$) >= 1 Then LOAD_INCLUDE IncludeName$ End If '/writeconfig [filename] If LCase$(Left$(i$, 13)) = "/writeconfig " Then 'get name of config ConfigName$ = Mid$(i$, 14) If Len(ConfigName$) >= 1 Then SAVE_CONFIG ConfigName$ End If '.[scriptname] If Left$(i$, 1) = "." Then 'get name of config ConfigName$ = "conf/" & Mid$(i$, 2) If Len(ConfigName$) >= 1 Then LOAD_CONFIG ConfigName$ End If '@[code] If Left$(i$, 1) = "@" Then CODE = Mid$(i$, 2) ADD_INSTRUMENT End If '/delete [code line] If LCase$(Left$(i$, 8)) = "/delete " Then x = Int(Mid$(i$, 9)) CODE = INST(x) INST(x) = "" AddConsole "Deleted instrument #" & x & " [" & CODE & "]." End If '/edit [code line] If LCase$(Left$(i$, 6)) = "/edit " Then A = Int(Mid$(i$, 7)) SEL_INST = A AddConsole "Selected instrument #" & SEL_INST & "." End If '/code [code line] If LCase$(Left$(i$, 6)) = "/code " Then CODE = Mid$(i$, 7) INST(SEL_INST) = CODE AddConsole "Set instrument #" & SEL_INST & " code as: " & INST(SEL_INST) End If '/instruments If LCase$(i$) = "/instruments" Then A = 0 For x = 0 To MAX_INSTS If INST(x) <> "" Then AddConsole "Instrument #" & x & ": " & INST(x) A = A + 1 End If Next x AddConsole "Total: " & A & " instruments." End If '/clear_instruments If LCase$(i$) = "/clear_instruments" Then For x = 0 To MAX_INSTS INST(x) = "" Next x MaxInstruments = 0 AddConsole "All instruments cleared." End If '/gotoconsole If LCase$(i$) = "/gotoconsole" Then CONSOLE = 1: SMALL_CONSOLE = 0: SetNewFOV '/gotoworld If LCase$(i$) = "/gotoworld" Then CONSOLE = 0: SMALL_CONSOLE = 0: SetNewFOV '/cls If LCase$(i$) = "/cls" Then For x = 0 To 100 ConsoleLine$(x) = "" ConsoleColor(x) = 0 Next x End If '/echo [text] If LCase$(Left$(i$, 6)) = "/echo " Then AddConsole Mid$(i$, 7) End If '/decho [text] If LCase$(Left$(i$, 7)) = "/cecho " Then whatfontcolor = Int(Mid$(i$, 8, 1)) AddCustom Mid$(i$, 10), whatfontcolor End If '/man [text] or /help [text] If LCase$(Left$(i$, 5)) = "/man " Or LCase$(Left$(i$, 6)) = "/help " Then 'get text If LCase$(Left$(i$, 5)) = "/man " Then B$ = Mid$(i$, 6) If LCase$(Left$(i$, 6)) = "/help " Then B$ = Mid$(i$, 7) 'no text? make it a plain /help or /man command If B$ = "" Then i$ = Left$(i$, Len(i$) - 1) 'got text? If B$ <> "" Then AddCustom "Help: " & UCase$(B$), 3 bb$ = "#" & B$ 'open man.lyn reading = 0 Open "man.lyn" For Input As #2 Do While Not EOF(2) Line Input #2, cm$ 'stop reading If reading = 1 And Left$(cm$, 1) = "#" Then reading = 0 'find the command? If reading = 0 And LCase$(Left$(cm$, Len(bb$) + 1)) = LCase$(bb$) Then 'found the command, begin reading reading = 1 End If 'read it If reading = 1 And Left$(cm$, 1) <> "#" And cm$ <> "" And Left$(cm$, 2) <> "//" Then AddCustom cm$, 3 Loop Close #2 'extra CONF info? For x = 0 To MAX_CONFS If LCase$(B$) = LCase$(CONF(x).Name) Then AddCustom "Current value: " & CONF(x).value & ".", 3 bbb$ = "Min: " & CONF(x).Min & ". Max: " & CONF(x).Max & ". Default: " & CONF(x).DefaultValue & ". " If CONF(x).ValType = 0 Then bbb$ = bbb$ & "Value type: Decimal number. " If CONF(x).ValType = 1 Then bbb$ = bbb$ & "Value type: Integer. " If CONF(x).Locked = 1 Then bbb$ = bbb$ & "This variable is locked during play. " AddCustom bbb$, 3 End If Next x 'extra WCONF info? For x = 0 To MAX_WCONFS If LCase$(B$) = LCase$(WCONF(x).Name) Then AddCustom "Current value: " & WCONF(x).CHAR & ".", 3 bbb$ = "Default: " & WCONF(x).DefaultChar & ". " If WCONF(x).Locked = 1 Then bbb$ = bbb$ & "This variable is locked during play. " AddCustom bbb$, 3 End If Next x 'extra COMM info? For x = 0 To MAX_COMMS If LCase$(B$) = LCase$(COMM(x).Name) Then If COMM(x).Locked = 1 Then AddCustom "This variable is locked during play. ", 3 End If Next x End If End If '/help or /man alone If LCase$(i$) = "/help" Or LCase(i$) = "/man" Then AddConsole "Use the /help or /man function to find information on commands, variables, and other related topics." AddConsole "You can also type '?topic' so that you can tab things and see suggestions." AddConsole "To do this type: /HELP [TOPIC] or /MAN [TOPIC] or ?[TOPIC]. Example: ?NAME " End If '/connect (alone) If LCase$(i$) = "/connect" Or LCase$(i$) = "/connect " Then CONNECT_TO_SERVER WCONF(REMOTE_HOST).CHAR, CONF(CONF_REMOTE_PORT).value End If '/connect [host:ip] If LCase$(Left$(i$, 9)) = "/connect " And Len(i$) > 9 Then B$ = Mid$(i$, 10) A = -1 'find colon For x = 1 To Len(B$) If Mid$(B$, x, 1) = ":" Then A = x Next x 'found colon? If A >= 1 Then 'get the port CONF(CONF_REMOTE_PORT).value = Int(Mid$(B$, (A + 1))) 'cut it off, leave us with the host/ip B$ = Left$(B$, A - 1) End If 'set the host If B$ <> "" Then WCONF(REMOTE_HOST).CHAR = B$ CONNECT_TO_SERVER WCONF(REMOTE_HOST).CHAR, CONF(CONF_REMOTE_PORT).value End If '/join idle (bounce) If LCase(i$) = "/join idle" Then i$ = "/idle" '/join [team number] If LCase$(Left$(i$, 6)) = "/join " Then A = Int(Mid$(i$, 7)) 'trying to join idle? If A = 0 Then i$ = "/idle" 'join the team If A >= 1 And A <= 9 Then AddConsole "Attempting to join team #" & A & "..." SEND_PACKET "JOIN_TEAM:" & A End If End If '/idle If LCase$(i$) = "/idle" Then AddConsole "Attempting to go idle..." SEND_PACKET "JOIN_IDLE" End If '/roster If LCase(i$) = "/roster" Then AddConsole "Total points spent: " & ROSTER_SCORE End If '/clear_remotes If LCase(i$) = "/clear_remotes" Then For x = 0 To MAX_REMOTES REMOTE_SITUATION(x) = "" REMOTE_SCRIPT(x) = "" Next x AddConsole "Remote script list cleared." End If '/add remote [situation]=[scriptfile] (example: /REMOTE CHANGE_GUN=conf/changegun.lyn) If Left(LCase(i$), 12) = "/add_remote " Then B$ = Mid(LCase$(i$), 13) MESSAGE$ = "Reason unknown, lol!" CanDo = 0 A = -1 For x = 1 To Len(B$) If Mid$(B$, x, 1) = "=" And A = -1 Then A = x Next x situ$ = "": scri$ = "" If A >= 1 Then situ$ = Left(B$, A - 1): scri$ = Mid$(B$, A + 1) If situ$ <> "" And scri$ <> "" And A <> -1 Then CanDo = 1 If CanDo = 0 Then MESSAGE$ = "Mistyped command." If CanDo = 1 Then 'do it AddConsole "SITU=[" & situ$ & "] SCRIPT=[" & scri$ & "]" 'find slot A = -1 For x = 0 To MAX_REMOTES If A = -1 And REMOTE_SITUATION(x) = "" Then A = x Next x 'not found? If A = -1 Then CanDo = 0: MESSAGE$ = "Already used all " & MAX_REMOTES & " remotes!" 'do it! If A >= 0 Then REMOTE_SITUATION(A) = UCase$(situ$) REMOTE_SCRIPT(A) = scri$ AddConsole "Added new remote script #" & A & ": On " & REMOTE_SITUATION(A) & " exectute '" & REMOTE_SCRIPT(A) & "'." End If End If 'fail? If CanDo = 0 Then AddConsole "Could not add remote: " & MESSAGE$ End If '/remotes If LCase(i$) = "/remotes" Then totalremotes = 0 For x = 0 To MAX_REMOTES If REMOTE_SITUATION(x) <> "" Or REMOTE_SCRIPT(x) <> "" Then totalremotes = totalremotes + 1 AddConsole "Remote script #" & x & ": On [" & REMOTE_SITUATION(x) & "] load '" & REMOTE_SCRIPT(x) & "'" End If Next x AddConsole "Total: " & totalremotes & " remotes." End If '/main_echo_on If LCase$(i$) = "/main_echo_on" Then ECHO = 1 '/main_echo_off If LCase$(i$) = "/main_echo_off" Then ECHO = 0 '------------------------------------------------------------------------- End If End If 'talk If Left$(i$, 1) <> "/" And Left$(i$, 1) <> "." And Left$(i$, 1) <> "?" And Left$(i$, 1) <> "@" And i$ <> "" Then CONSOLE_TALK 'refresh config (set buttons etc) REFRESH_CONFIG 'test for config tweak 'BUFFER$ = Mid$(i$, 2) 'Call READ_CONFIG_LINE i$ = "" Exit Sub CommandError: AddError "Command error: " & i$ End Sub Public Sub CONSOLE_CONFIG() AlreadyDone = 0 '------------------------------------------------------------ 'view a config value '------------------------------------------------------------ 'numbers For x = 0 To MAX_CONFS Found = 0 If LCase$(CONF(x).Name) = LCase$(Mid$(i$, 2)) And Found = 0 Then Found = 1 If LCase$(CONF(x).Name & " ") = LCase$(Mid$(i$, 2)) And Found = 0 Then Found = 1 If CONF(x).Name = "" Then Found = 0 If Found = 1 Then 'view it AddConsole CONF(x).Name & " is: " & CONF(x).value & "" AlreadyDone = 1 End If Next x 'words For x = 0 To MAX_WCONFS Found = 0 If LCase$(WCONF(x).Name) = LCase$(Mid$(i$, 2)) And Found = 0 Then Found = 1 If LCase$(WCONF(x).Name & " ") = LCase$(Mid$(i$, 2)) And Found = 0 Then Found = 1 If WCONF(x).Name = "" Then Found = 0 If Found = 1 Then 'view it AddConsole WCONF(x).Name & " is " & Chr$(34) & WCONF(x).CHAR & Chr$(34) & "" AlreadyDone = 1 End If Next x '------------------------------------------------------------ 'set a config value '------------------------------------------------------------ If AlreadyDone = 0 Then 'numbers For x = 0 To MAX_CONFS Found = 0 If Left$(LCase$(CONF(x).Name & " "), Len(CONF(x).Name & " ")) = Left$(LCase$(Mid$(i$ & " ", 2)), Len(CONF(x).Name & " ")) And Found = 0 Then Found = 1 If CONF(x).Name = "" Then Found = 0 If Found = 1 Then 'set it AlreadyDone = 1 CanDo = 1 reason$ = "" 'get the value A = 0 On Error GoTo ConfigSetError If CONF(x).ValType = 0 Then A = Val(Mid$(i$, (Len(CONF(x).Name) + 3))) If CONF(x).ValType = 1 Then A = Int(Mid$(i$, (Len(CONF(x).Name) + 3))) 'is it too low? If A < CONF(x).Min Then CanDo = 0: reason$ = "Must be between " & CONF(x).Min & " and " & CONF(x).Max & "." 'is it too high? If A > CONF(x).Max Then CanDo = 0: reason$ = "Must be between " & CONF(x).Min & " and " & CONF(x).Max & "." 'is it locked? If CONF(x).Locked = 1 And PLAY = 1 Then CanDo = 0: reason$ = "This property is locked during play." 'is it super locked? If CONF(x).Locked = 2 And CONNECTION = 1 Then CanDo = 0: reason$ = "This property is locked during server connection." 'no? If CanDo = 0 Then AddConsole "Can't set " & CONF(x).Name & ": " & reason$ 'yes? If CanDo = 1 Then CONF(x).value = A AddConsole CONF(x).Name & " has been set to: " & CONF(x).value End If End If Next x 'words For x = 0 To MAX_WCONFS Found = 0 If Left$(LCase$(WCONF(x).Name & " "), Len(WCONF(x).Name & " ")) = Left$(LCase$(Mid$(i$ & " ", 2)), Len(WCONF(x).Name & " ")) And Found = 0 Then Found = 1 If WCONF(x).Name = "" Then Found = 0 If Found = 1 Then 'set it AlreadyDone = 1 CanDo = 1 reason$ = "" 'get the char N$ = "" On Error GoTo ConfigSetError N$ = Mid$(i$, (Len(WCONF(x).Name) + 3)) 'is it null? If N$ = "" Then CanDo = 0: reason$ = "No value specified." 'is it locked? If WCONF(x).Locked = 1 And PLAY = 1 Then CanDo = 0: reason$ = "This property is locked during play." 'is it super locked? If WCONF(x).Locked = 2 And CONNECTION = 1 Then CanDo = 0: reason$ = "This property is locked during server connection." 'no? If CanDo = 0 Then AddConsole "Can't set " & WCONF(x).Name & ": " & reason$ 'yes? If CanDo = 1 Then WCONF(x).CHAR = N$ AddConsole WCONF(x).Name & " has been set to " & Chr$(34) & WCONF(x).CHAR & Chr$(34) End If End If Next x End If 'special custom reactions If Left$(LCase$(i$), 5) = "/fov " Then SetNewFOV '/password [password] If LCase$(Left$(i$, 10)) = "/password " And CONNECTION >= 2 And CONNECTION <= 3 Then SEND_PACKET "PRIVATE_PASSWORD:" & WCONF(PASSWORD).CHAR End If 'errors--------------> GoTo ConfigSetError2 ConfigSetError: AddError "Invalid command." ConfigSetError2: End Sub Public Sub CONSOLE_SUGGEST() Dim leng As Integer Dim WhatCommand As String Dim CommandType As Integer 'list suggestions of what the client is typing 'this is for when they press tab for suggestions 'use i$ for the command even though it is incomplete 'modify \ to / If Left$(i$, 1) = "\" Then i$ = "/" & Mid$(i$, 2) 'add a / if its not there If Left$(i$, 1) <> "/" And Left$(i$, 1) <> "?" Then i$ = "/" & i$ 'is it a ? help request? CommandType = 0 If Left$(i$, 1) = "?" Then CommandType = 1 'get command and length WhatCommand = Mid$(i$, 2) leng = Len(WhatCommand) MESSAGE$ = "" AutoComplete$ = "" 'only bother if its len over 0 If WhatCommand <> "" Then '--------------------------------------------------------------------------------------------- 'if there is only one suggestion then we can go with it suggestions = 0 'words For x = 0 To MAX_WCONFS If Left$(LCase$(WCONF(x).Name), leng) = LCase$(WhatCommand) Then 'add it to suggestions string MESSAGE$ = MESSAGE$ & WCONF(x).Name & " " suggestions = suggestions + 1 If suggestions = 1 Then AutoComplete$ = WCONF(x).Name End If Next x 'numbers For x = 0 To MAX_CONFS If Left$(LCase$(CONF(x).Name), leng) = LCase$(WhatCommand) Then 'add it to suggestions string MESSAGE$ = MESSAGE$ & CONF(x).Name & " " suggestions = suggestions + 1 If suggestions = 1 Then AutoComplete$ = CONF(x).Name End If Next x 'commands For x = 0 To MAX_COMMS If Left$(LCase$(COMM(x).Name), leng) = LCase$(WhatCommand) Then 'add it to suggestions string MESSAGE$ = MESSAGE$ & COMM(x).Name & " " suggestions = suggestions + 1 If suggestions = 1 Then AutoComplete$ = COMM(x).Name End If Next x 'flush at the end if needed, only if there are at least 2 suggestions If MESSAGE$ <> "" And suggestions >= 2 Then AddCustom MESSAGE$, 3 MESSAGE$ = "" End If 'one suggestion? autocomplete it If suggestions = 1 And AutoComplete$ <> "" Then If CommandType = 0 Then glCinput$ = "/" & AutoComplete$ & " " If CommandType = 1 Then glCinput$ = "?" & AutoComplete$ & " " 'special hack - if theres a space added on a COMM which is type 1, eliminate the space For x = 0 To MAX_COMMS If ("/" & COMM(x).Name & " ") = glCinput$ And COMM(x).CommType = 0 Then glCinput$ = Left$(glCinput$, Len(glCinput$) - 1) Next x End If '--------------------------------------------------------------------------------------------- End If End Sub Public Sub CONSOLE_TALK() 'talk to the people on the server with the i$ buffer of text 'for now, display output to test the color talk$ = i$ 'filter anything here 'offline? If CONNECTION <> 1 Then AddCustom "Not connected to server.", 1 End If 'online and talkable? If CONNECTION = 1 Then SEND_PACKET "MESSAGE:<" & WCONF(PLAYER_NAME).CHAR & "> " & talk$ End If End Sub Public Sub DEFAULT_CONFIG() 'set the default config End Sub Public Sub LOAD_CONFIG(FNAME As String) 'echo is always 1 when loading a normal config in this way. ECHO = 1 'load the config file called FILE$ On Error GoTo ConfigLoadError 'prolyn mode is 0 by default ProLynMode = 0 If LCase$(Right$(FNAME, 5)) <> ".conf" Then FNAME = FNAME & ".conf" AddConsole "Excecuting " & Chr(34) & LCase$(FNAME) & Chr(34) & "..." Open FNAME For Input As #1 Do While Not EOF(1) Line Input #1, BUFFER$ If Left$(BUFFER$, 2) <> "//" And BUFFER$ <> "" Then 'start prolyn mode If UCase$(BUFFER$) = "PROLYN" Then ProLynMode = 1 'stop prolyn mode If UCase$(BUFFER$) = "END" Then ProLynMode = 0 'prolyn mode only If ProLynMode = 1 And UCase$(BUFFER$) <> "PROLYN" Then CODE = BUFFER ADD_INSTRUMENT End If If Left$(BUFFER$, 1) = "/" Or Left$(BUFFER$, 1) = "." Or Left$(BUFFER$, 1) = "@" Then i$ = BUFFER$ 'normal If ProLynMode = 0 Then CONSOLE_COMMAND End If End If Loop Close #1 Exit Sub ConfigLoadError: AddError "Could not open " & Chr(34) & FNAME & Chr(34) 'prolyn mode goes back to 0 at the end ProLynMode = 0 End Sub Public Sub LOAD_INCLUDE(INCLUDE_NAME As String) Dim INCLUDE_BUFFER As String 'load the config file called INCLUDE_NAME 'this is the same as loading a config, apart from the full extension must be specified, and an INCLUDE load can be loaded 'within another config loading. This is the only time you're allowed to do this On Error GoTo IncludeLoadError 'prolyn mode is 0 by default ProLynMode = 0 AddConsole "Including " & Chr(34) & LCase$(INCLUDE_NAME) & Chr(34) & "..." Open INCLUDE_NAME For Input As #2 Do While Not EOF(2) Line Input #2, INCLUDE_BUFFER If Left$(INCLUDE_BUFFER, 2) <> "//" And INCLUDE_BUFFER <> "" Then 'start prolyn mode If UCase$(INCLUDE_BUFFER) = "PROLYN" Then ProLynMode = 1 'stop prolyn mode If UCase$(INCLUDE_BUFFER) = "END" Then ProLynMode = 0 'prolyn mode only If ProLynMode = 1 And UCase$(INCLUDE_BUFFER) <> "PROLYN" Then CODE = INCLUDE_BUFFER ADD_INSTRUMENT End If If Left$(INCLUDE_BUFFER, 1) = "/" Or Left$(INCLUDE_BUFFER, 1) = "." Or Left$(INCLUDE_BUFFER, 1) = "@" Then i$ = INCLUDE_BUFFER 'normal If ProLynMode = 0 Then CONSOLE_COMMAND End If End If Loop Close #2 Exit Sub IncludeLoadError: AddError "Could not open " & Chr(34) & INCLUDE_NAME & Chr(34) 'prolyn mode goes back to 0 at the end ProLynMode = 0 End Sub Public Sub LOAD_REMOTE(REMOTE_NAME As String) 'load the config file called REMOTE_NAME Dim REMOTE_BUFFER As String 'turn echo OFF straight away ECHO = 0 On Error GoTo RemoteLoadError 'prolyn mode is 0 by default ProLynMode = 0 AddConsole "Remote executing: " & Chr(34) & LCase$(REMOTE_NAME) & Chr(34) & "..." Open REMOTE_NAME For Input As #3 Do While Not EOF(3) Line Input #3, REMOTE_BUFFER If Left$(REMOTE_BUFFER, 2) <> "//" And REMOTE_BUFFER <> "" Then 'start prolyn mode If UCase$(REMOTE_BUFFER) = "PROLYN" Then ProLynMode = 1 'stop prolyn mode If UCase$(REMOTE_BUFFER) = "END" Then ProLynMode = 0 'prolyn mode only If ProLynMode = 1 And UCase$(REMOTE_BUFFER) <> "PROLYN" Then CODE = REMOTE_BUFFER ADD_INSTRUMENT End If If Left$(REMOTE_BUFFER, 1) = "/" Or Left$(REMOTE_BUFFER, 1) = "." Or Left$(REMOTE_BUFFER, 1) = "@" Then i$ = REMOTE_BUFFER 'normal If ProLynMode = 0 Then CONSOLE_COMMAND End If End If Loop Close #3 Exit Sub RemoteLoadError: AddError "Could not open " & Chr(34) & REMOTE_NAME & Chr(34) 'prolyn mode goes back to 0 at the end ProLynMode = 0 'turn echo back on by default afterwards ECHO = 1 End Sub Public Sub SAVE_CONFIG(FNAME As String) 'save the config file called FILE$, by going through all confs and wconfs On Error GoTo ConfigSaveError FNAME = "conf/" & FNAME If LCase$(Right$(FNAME, 5)) <> ".conf" Then FNAME = FNAME & ".conf" Open FNAME For Output As #1 Print #1, " " Print #1, "// Config written by PRO version: " & VERSION$ & " -- script: " & WCONF(SCRIPT_NAME).CHAR Print #1, " " Print #1, "// numbers" 'confs For x = 0 To MAX_CONFS If CONF(x).Name <> "" Then BUFFER$ = "/" & CONF(x).Name & " " & CONF(x).value Print #1, BUFFER$ End If Next x Print #1, " " Print #1, "// chars" 'wconfs For x = 0 To MAX_WCONFS If WCONF(x).Name <> "" Then BUFFER$ = "/" & WCONF(x).Name & " " & WCONF(x).CHAR Print #1, BUFFER$ End If Next x 'instruments Print #1, " " Print #1, "// instruments" Print #1, "/CLEAR_INSTRUMENTS" For x = 0 To MAX_INSTS If INST(x) <> "" Then Print #1, "@" & INST(x) End If Next x 'remotes Print #1, " " Print #1, "// remotes" Print #1, "/CLEAR_REMOTES" For x = 0 To MAX_REMOTES If REMOTE_SITUATION(x) <> "" Then Print #1, "/REMOTE " & REMOTE_SITUATION(x) & "=" & REMOTE_SCRIPT(x) End If Next x Close #1 AddConsole "Written " & Chr(34) & FNAME & Chr(34) & " OK." Exit Sub ConfigSaveError: AddError "Could not write " & Chr(34) & FNAME & Chr(34) End Sub 'PRO 'By Dano Wilson 'Mako studios 2005 'DRAWING Global Const MAX_SHAPES = 30 Global Const MAX_COLORS = 20 Global Const MAX_SPARKS = 500 Global Const MAX_SLUGS = 20 Global Const PI = 3.141592654 'sprites Public Type SPRITE_TYPE x1(MAX_SHAPES) As Double x2(MAX_SHAPES) As Double x3(MAX_SHAPES) As Double x4(MAX_SHAPES) As Double x5(MAX_SHAPES) As Double x6(MAX_SHAPES) As Double x7(MAX_SHAPES) As Double x8(MAX_SHAPES) As Double y1(MAX_SHAPES) As Double y2(MAX_SHAPES) As Double y3(MAX_SHAPES) As Double y4(MAX_SHAPES) As Double y5(MAX_SHAPES) As Double y6(MAX_SHAPES) As Double y7(MAX_SHAPES) As Double y8(MAX_SHAPES) As Double z1(MAX_SHAPES) As Double z2(MAX_SHAPES) As Double z3(MAX_SHAPES) As Double z4(MAX_SHAPES) As Double z5(MAX_SHAPES) As Double z6(MAX_SHAPES) As Double z7(MAX_SHAPES) As Double z8(MAX_SHAPES) As Double red(MAX_SHAPES) As Double green(MAX_SHAPES) As Double blue(MAX_SHAPES) As Double t(MAX_SHAPES) As Integer special(MAX_SHAPES) As Integer texture(MAX_SHAPES) As Integer maxshapes As Integer Name As String notes As String End Type 'sprite library Global sprite(MAX_SPRITES) As SPRITE_TYPE 'sprite scale information Global SPRITESCALE(MAX_SPRITES) 'current sprite for drawing Global GRAB As SPRITE_TYPE 'a sprite library for reference points Global REFERENCE As SPRITE_TYPE Global corner, AyeMatey Global red, green, blue Global x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4 Global cx, cy, cz Global NewSprite$, NewSpriteMask$ Global CursorFlash 'goes to 1000ms then restarts Global MAN As String Global eva 'temps for drawing a man Global manX Global manY Global manZ Global manHor Global manVer Global manBar Global manTailHor Global manTailVer Global manTailBar Global manGun Global manVariation Global manSpecial Global manTeam Global manColorSet$ Global manName$ Global ManHeadColor Global ManBodyColor Global ManArmColor Global ManHornColor Global ManTailColor Global GunX Global GunY Global GunZ Global manSprite Global LocalGun 'character colors Global ProRed(MAX_COLORS) Global ProGreen(MAX_COLORS) Global ProBlue(MAX_COLORS) 'instruments Global iX As Double Global iY As Double Global iX1, iX2, iX3, iX4 As Double Global iY1, iY2, iY3, iY4 As Double Global iWord As String Global iValue As Double Global iChar As String Global iSpare As String Global iFontX As Double Global iFontY As Double Global iRed As Double Global iGreen As Double Global iBlue As Double Global iTexture As Integer Global iPivotX As Double Global iPivotY As Double Global iShade1 As Double Global iShade2 As Double Global iShade3 As Double Global iShade4 As Double Global iFontSet As Integer Global iAngle Global iRatioX1, iRatioY1 Global iRatioX2, iRatioY2 Global iCircleSize Global iSlices, iStacks As Integer Global i_if As Integer Global iCurrentIf As Integer Global iTemp As Double Global IfPassed(10) As Integer 'magna beam animation Global MAGNA 'current magna scroll addition 'particles Public Type PARTICLE_TYPE x As Double y As Double z As Double speedx As Double speedy As Double speedz As Double power As Double 'starts at 100 for brightest, then fades out orbit As Double '=0 means doesn't exist size As Double fadespeed As Double 'speed of which it fades t As Integer '=0 is actually normal here, lol, where 1 is blood red As Double '0-1 color value green As Double blue As Double End Type Global spark(MAX_SPARKS) As PARTICLE_TYPE Global MaxSparks 'current max to save cpu 'slugs (for slugs, and lightning, maybe other effects) Public Type SLUG_TYPE x1 As Double 'start point y1 As Double z1 As Double x2 As Double 'end point y2 As Double z2 As Double red As Double 'color (from 0 to 255) green As Double blue As Double orbit As Double 'total life in ms. fadeouts and stuff are dictated elsewhere to save information here t As Integer '0=none (empty slot), 1=railgun slug owner As String 'name of person who owns it, in case we need to continue on lightning etc later End Type Global slug(MAX_SLUGS) As SLUG_TYPE Global MaxSlugs 'current max to save cpu 'visual recoil Global RECOIL 'current recoil amount Global RecoilSpeed 'current speed of which it is moving Global RecoilSide '1 means positive side, 2 means negative for squidge Global SlugColor, SlugRed, SlugGreen, SlugBlue 'last status, this is a label that you can print on the screen as a status like, you died, or loading, or whatever. Global LAST_STATUS$ Global LAST_CONSOLE$ 'the last console line added Public Sub CreateSlug(WhatMIS) 'create a visual slug from the projectile number WhatMis Dim WHATSLUG As Integer WHATSLUG = -1 'find empty slot in slug database MaxSlugs = MAX_SLUGS For x = 0 To MAX_SLUGS If slug(x).t <> 0 Then MaxSlugs = x If slug(x).t = 0 And WHATSLUG = -1 Then WHATSLUG = x: MaxSlugs = x Next x 'no slots? pick at random If WHATSLUG = -1 Then Randomize Timer WHATSLUG = Int(Rnd * MAX_SLUGS) End If 'create the slug slug(WHATSLUG).x1 = missile(WhatMIS).x slug(WHATSLUG).y1 = missile(WhatMIS).y slug(WHATSLUG).z1 = missile(WhatMIS).z slug(WHATSLUG).x2 = EndX slug(WHATSLUG).y2 = EndY slug(WHATSLUG).z2 = EndZ slug(WHATSLUG).owner = missile(WhatMIS).owner slug(WHATSLUG).orbit = CONF(RAIL_ORBIT).value slug(WHATSLUG).t = 1 'special hack - make it come out of the nozzle because it's visual, instead off out of nowhere 'tune nudge for seeing others NozzleX = -0.05 NozzleY = -0.02 NozzleZ = 0.26 'tune nudge if its third person 0 and we own it (so it goes under our gun and looks better) If CONF(THIRD_PERSON).value = 0 And LCase(WCONF(PLAYER_NAME).CHAR) = LCase(missile(WhatMIS).owner) Then 'hack point 1 to our co-ordinate to make it super-true NozzleX = CONF(SLUG_X).value NozzleY = CONF(SLUG_Y).value NozzleZ = CONF(SLUG_Z).value slug(WHATSLUG).x1 = PLAYER_X slug(WHATSLUG).y1 = PLAYER_Y slug(WHATSLUG).z1 = PLAYER_Z End If Rotate NozzleX, NozzleY, missile(WhatMIS).bar Rotate NozzleZ, NozzleY, missile(WhatMIS).ver Rotate NozzleX, NozzleZ, missile(WhatMIS).hor 'add onto original co-ordinate slug(WHATSLUG).x1 = slug(WHATSLUG).x1 + NozzleX slug(WHATSLUG).y1 = slug(WHATSLUG).y1 + NozzleY slug(WHATSLUG).z1 = slug(WHATSLUG).z1 + NozzleZ 'work out color depending on WhatMIS GetSlugColor WhatMIS 'work out the RGB of the pro colors. Note: we use RAIL colors, not pro, these go up to 0-9 slug(WHATSLUG).red = RailRed(SlugColor) slug(WHATSLUG).green = RailGreen(SlugColor) slug(WHATSLUG).blue = RailBlue(SlugColor) 'any explosion sparks go here '--> End Sub Public Sub DrawPeople() 'draw all the people apart from yourself depending on their pac-line Dim WhichPerson As Integer Dim PersonPAC As String For WhichPerson = 0 To MaxPeople If person(WhichPerson).Name <> "" And person(WhichPerson).PAC <> "" And person(WhichPerson).Team >= 1 Then PersonPAC = person(WhichPerson).PAC DrawCharacter PersonPAC End If Next WhichPerson End Sub Public Sub DrawShape() 'draw the shape of GRAB, number X, using red green and blue. 'add shading here too if you like 'NOTE: this is where you would set the customized texture in other games, but pro will have the same texture for the whole player. 'remember this for future games, where the texture property can actually be used 'for now we just use texture 5, which we binded earlier 'set shading defaults here shading1 = CONF(MODEL_SHADING1).value shading2 = CONF(MODEL_SHADING2).value shading3 = CONF(MODEL_SHADING3).value shading4 = CONF(MODEL_SHADING4).value 'do any shading here 'divide colors back to 0-1 red = red / 255 green = green / 255 blue = blue / 255 'line If GRAB.t(x) = 2 Then glBegin GL_LINES glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x1(x) / gl_scale, GRAB.y1(x) / gl_scale, GRAB.z1(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x2(x) / gl_scale, GRAB.y2(x) / gl_scale, GRAB.z2(x) / gl_scale glEnd End If 'triangle If GRAB.t(x) = 3 Then glBegin GL_TRIANGLES glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x1(x) / gl_scale, GRAB.y1(x) / gl_scale, GRAB.z1(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x2(x) / gl_scale, GRAB.y2(x) / gl_scale, GRAB.z2(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x3(x) / gl_scale, GRAB.y3(x) / gl_scale, GRAB.z3(x) / gl_scale glEnd End If 'square If GRAB.t(x) = 4 Then glBegin GL_QUADS glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x1(x) / gl_scale, GRAB.y1(x) / gl_scale, GRAB.z1(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x2(x) / gl_scale, GRAB.y2(x) / gl_scale, GRAB.z2(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x3(x) / gl_scale, GRAB.y3(x) / gl_scale, GRAB.z3(x) / gl_scale glColor3f red - shading4, green - shading4, blue - shading4 glTexCoord2f 0, 1: glVertex3f GRAB.x4(x) / gl_scale, GRAB.y4(x) / gl_scale, GRAB.z4(x) / gl_scale glEnd End If 'prism If GRAB.t(x) = 5 Then glBegin GL_TRIANGLES glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x1(x) / gl_scale, GRAB.y1(x) / gl_scale, GRAB.z1(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x2(x) / gl_scale, GRAB.y2(x) / gl_scale, GRAB.z2(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x3(x) / gl_scale, GRAB.y3(x) / gl_scale, GRAB.z3(x) / gl_scale glEnd glBegin GL_TRIANGLES glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x1(x) / gl_scale, GRAB.y1(x) / gl_scale, GRAB.z1(x) / gl_scale glColor3f red - shading4, green - shading4, blue - shading4 glTexCoord2f 1, 0: glVertex3f GRAB.x2(x) / gl_scale, GRAB.y2(x) / gl_scale, GRAB.z2(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 1: glVertex3f GRAB.x4(x) / gl_scale, GRAB.y4(x) / gl_scale, GRAB.z4(x) / gl_scale glEnd glBegin GL_TRIANGLES glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x1(x) / gl_scale, GRAB.y1(x) / gl_scale, GRAB.z1(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x3(x) / gl_scale, GRAB.y3(x) / gl_scale, GRAB.z3(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x4(x) / gl_scale, GRAB.y4(x) / gl_scale, GRAB.z4(x) / gl_scale glEnd glBegin GL_TRIANGLES glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x2(x) / gl_scale, GRAB.y2(x) / gl_scale, GRAB.z2(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x3(x) / gl_scale, GRAB.y3(x) / gl_scale, GRAB.z3(x) / gl_scale glColor3f red - shading4, green - shading4, blue - shading4 glTexCoord2f 1, 1: glVertex3f GRAB.x4(x) / gl_scale, GRAB.y4(x) / gl_scale, GRAB.z4(x) / gl_scale glEnd End If 'toblerone If GRAB.t(x) = 6 Then 'ends glBegin GL_TRIANGLES glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x1(x) / gl_scale, GRAB.y1(x) / gl_scale, GRAB.z1(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x2(x) / gl_scale, GRAB.y2(x) / gl_scale, GRAB.z2(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x3(x) / gl_scale, GRAB.y3(x) / gl_scale, GRAB.z3(x) / gl_scale glEnd glBegin GL_TRIANGLES glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x4(x) / gl_scale, GRAB.y4(x) / gl_scale, GRAB.z4(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x5(x) / gl_scale, GRAB.y5(x) / gl_scale, GRAB.z5(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x6(x) / gl_scale, GRAB.y6(x) / gl_scale, GRAB.z6(x) / gl_scale glEnd 'outsides glBegin GL_QUADS glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x1(x) / gl_scale, GRAB.y1(x) / gl_scale, GRAB.z1(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x4(x) / gl_scale, GRAB.y4(x) / gl_scale, GRAB.z4(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x5(x) / gl_scale, GRAB.y5(x) / gl_scale, GRAB.z5(x) / gl_scale glColor3f red - shading4, green - shading4, blue - shading4 glTexCoord2f 0, 1: glVertex3f GRAB.x2(x) / gl_scale, GRAB.y2(x) / gl_scale, GRAB.z2(x) / gl_scale glEnd glBegin GL_QUADS glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x2(x) / gl_scale, GRAB.y2(x) / gl_scale, GRAB.z2(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x5(x) / gl_scale, GRAB.y5(x) / gl_scale, GRAB.z5(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x6(x) / gl_scale, GRAB.y6(x) / gl_scale, GRAB.z6(x) / gl_scale glColor3f red - shading4, green - shading4, blue - shading4 glTexCoord2f 0, 1: glVertex3f GRAB.x3(x) / gl_scale, GRAB.y3(x) / gl_scale, GRAB.z3(x) / gl_scale glEnd glBegin GL_QUADS glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x6(x) / gl_scale, GRAB.y6(x) / gl_scale, GRAB.z6(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x3(x) / gl_scale, GRAB.y3(x) / gl_scale, GRAB.z3(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x1(x) / gl_scale, GRAB.y1(x) / gl_scale, GRAB.z1(x) / gl_scale glColor3f red - shading4, green - shading4, blue - shading4 glTexCoord2f 0, 1: glVertex3f GRAB.x4(x) / gl_scale, GRAB.y4(x) / gl_scale, GRAB.z4(x) / gl_scale glEnd End If 'rectangle hollow (or part of the solid outsides) If GRAB.t(x) = 7 Or GRAB.t(x) = 8 Then 'outsides glBegin GL_QUADS glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x1(x) / gl_scale, GRAB.y1(x) / gl_scale, GRAB.z1(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x5(x) / gl_scale, GRAB.y5(x) / gl_scale, GRAB.z5(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x8(x) / gl_scale, GRAB.y8(x) / gl_scale, GRAB.z8(x) / gl_scale glColor3f red - shading4, green - shading4, blue - shading4 glTexCoord2f 0, 1: glVertex3f GRAB.x4(x) / gl_scale, GRAB.y4(x) / gl_scale, GRAB.z4(x) / gl_scale glEnd glBegin GL_QUADS glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x1(x) / gl_scale, GRAB.y1(x) / gl_scale, GRAB.z1(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x2(x) / gl_scale, GRAB.y2(x) / gl_scale, GRAB.z2(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x6(x) / gl_scale, GRAB.y6(x) / gl_scale, GRAB.z6(x) / gl_scale glColor3f red - shading4, green - shading4, blue - shading4 glTexCoord2f 0, 1: glVertex3f GRAB.x5(x) / gl_scale, GRAB.y5(x) / gl_scale, GRAB.z5(x) / gl_scale glEnd glBegin GL_QUADS glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x2(x) / gl_scale, GRAB.y2(x) / gl_scale, GRAB.z2(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x6(x) / gl_scale, GRAB.y6(x) / gl_scale, GRAB.z6(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x7(x) / gl_scale, GRAB.y7(x) / gl_scale, GRAB.z7(x) / gl_scale glColor3f red - shading4, green - shading4, blue - shading4 glTexCoord2f 0, 1: glVertex3f GRAB.x3(x) / gl_scale, GRAB.y3(x) / gl_scale, GRAB.z3(x) / gl_scale glEnd glBegin GL_QUADS glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x3(x) / gl_scale, GRAB.y3(x) / gl_scale, GRAB.z3(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x4(x) / gl_scale, GRAB.y4(x) / gl_scale, GRAB.z4(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x8(x) / gl_scale, GRAB.y8(x) / gl_scale, GRAB.z8(x) / gl_scale glColor3f red - shading4, green - shading4, blue - shading4 glTexCoord2f 0, 1: glVertex3f GRAB.x7(x) / gl_scale, GRAB.y7(x) / gl_scale, GRAB.z7(x) / gl_scale glEnd End If 'rectangle solid (just the plug ends, we already drew the outsides) If GRAB.t(x) = 8 Then glBegin GL_QUADS glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x1(x) / gl_scale, GRAB.y1(x) / gl_scale, GRAB.z1(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x2(x) / gl_scale, GRAB.y2(x) / gl_scale, GRAB.z2(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x3(x) / gl_scale, GRAB.y3(x) / gl_scale, GRAB.z3(x) / gl_scale glColor3f red - shading4, green - shading4, blue - shading4 glTexCoord2f 0, 1: glVertex3f GRAB.x4(x) / gl_scale, GRAB.y4(x) / gl_scale, GRAB.z4(x) / gl_scale glEnd glBegin GL_QUADS glColor3f red - shading1, green - shading1, blue - shading1 glTexCoord2f 0, 0: glVertex3f GRAB.x5(x) / gl_scale, GRAB.y5(x) / gl_scale, GRAB.z5(x) / gl_scale glColor3f red - shading2, green - shading2, blue - shading2 glTexCoord2f 1, 0: glVertex3f GRAB.x6(x) / gl_scale, GRAB.y6(x) / gl_scale, GRAB.z6(x) / gl_scale glColor3f red - shading3, green - shading3, blue - shading3 glTexCoord2f 1, 1: glVertex3f GRAB.x7(x) / gl_scale, GRAB.y7(x) / gl_scale, GRAB.z7(x) / gl_scale glColor3f red - shading4, green - shading4, blue - shading4 glTexCoord2f 0, 1: glVertex3f GRAB.x8(x) / gl_scale, GRAB.y8(x) / gl_scale, GRAB.z8(x) / gl_scale glEnd End If End Sub Public Sub DrawVariations() 'draw extra features on the end of the gun, depending on the ManVariation, ManGun and ManSpecial 'this sub might actually work for the local draw_gun 'we have remembered reference points in the REFERENCE library for anything we need, as it was last draw in the gun just now Dim ReferencePoint As Integer 'work out what sprite we want to draw, if any, and on which reference manSprite = -1 ReferencePoint = -1 'draw fan on the end? If manGun = 2 Then 'fan types If manSpecial = 1 Then manSprite = 3 If manSpecial = 2 Then manSprite = 9 If manSpecial = 3 Then manSprite = 11 If manSpecial = 4 Then manSprite = 18 'reference on fan guns If manVariation = 1 Then ReferencePoint = 5 If manVariation = 2 Then ReferencePoint = 8 If manVariation = 3 Then ReferencePoint = 9 If manVariation = 4 Then ReferencePoint = 4 End If 'only draw if a sprite AND reference point are found If manSprite >= 0 And ReferencePoint >= 0 Then GRAB = sprite(manSprite) 'scale it ScaleSprite SPRITESCALE(manSprite) 'scale it again by the customized gun scale IF its a localgun If LocalGun = 1 Then ScaleSprite CONF(GUN_SCALE).value For x = 0 To GRAB.maxshapes 'flip vertical GRAB.y1(x) = 0 - GRAB.y1(x) GRAB.y2(x) = 0 - GRAB.y2(x) GRAB.y3(x) = 0 - GRAB.y3(x) GRAB.y4(x) = 0 - GRAB.y4(x) GRAB.y5(x) = 0 - GRAB.y5(x) GRAB.y6(x) = 0 - GRAB.y6(x) GRAB.y7(x) = 0 - GRAB.y7(x) GRAB.y8(x) = 0 - GRAB.y8(x) 'bar Rotate GRAB.x1(x), GRAB.y1(x), manBar Rotate GRAB.x2(x), GRAB.y2(x), manBar Rotate GRAB.x3(x), GRAB.y3(x), manBar Rotate GRAB.x4(x), GRAB.y4(x), manBar Rotate GRAB.x5(x), GRAB.y5(x), manBar Rotate GRAB.x6(x), GRAB.y6(x), manBar Rotate GRAB.x7(x), GRAB.y7(x), manBar Rotate GRAB.x8(x), GRAB.y8(x), manBar 'ver Rotate GRAB.z1(x), GRAB.y1(x), manVer Rotate GRAB.z2(x), GRAB.y2(x), manVer Rotate GRAB.z3(x), GRAB.y3(x), manVer Rotate GRAB.z4(x), GRAB.y4(x), manVer Rotate GRAB.z5(x), GRAB.y5(x), manVer Rotate GRAB.z6(x), GRAB.y6(x), manVer Rotate GRAB.z7(x), GRAB.y7(x), manVer Rotate GRAB.z8(x), GRAB.y8(x), manVer 'hor Rotate GRAB.x1(x), GRAB.z1(x), manHor Rotate GRAB.x2(x), GRAB.z2(x), manHor Rotate GRAB.x3(x), GRAB.z3(x), manHor Rotate GRAB.x4(x), GRAB.z4(x), manHor Rotate GRAB.x5(x), GRAB.z5(x), manHor Rotate GRAB.x6(x), GRAB.z6(x), manHor Rotate GRAB.x7(x), GRAB.z7(x), manHor Rotate GRAB.x8(x), GRAB.z8(x), manHor 'move to reference point GRAB.x1(x) = GRAB.x1(x) + REFERENCE.x1(ReferencePoint) GRAB.x2(x) = GRAB.x2(x) + REFERENCE.x1(ReferencePoint) GRAB.x3(x) = GRAB.x3(x) + REFERENCE.x1(ReferencePoint) GRAB.x4(x) = GRAB.x4(x) + REFERENCE.x1(ReferencePoint) GRAB.x5(x) = GRAB.x5(x) + REFERENCE.x1(ReferencePoint) GRAB.x6(x) = GRAB.x6(x) + REFERENCE.x1(ReferencePoint) GRAB.x7(x) = GRAB.x7(x) + REFERENCE.x1(ReferencePoint) GRAB.x8(x) = GRAB.x8(x) + REFERENCE.x1(ReferencePoint) GRAB.y1(x) = GRAB.y1(x) + REFERENCE.y1(ReferencePoint) GRAB.y2(x) = GRAB.y2(x) + REFERENCE.y1(ReferencePoint) GRAB.y3(x) = GRAB.y3(x) + REFERENCE.y1(ReferencePoint) GRAB.y4(x) = GRAB.y4(x) + REFERENCE.y1(ReferencePoint) GRAB.y5(x) = GRAB.y5(x) + REFERENCE.y1(ReferencePoint) GRAB.y6(x) = GRAB.y6(x) + REFERENCE.y1(ReferencePoint) GRAB.y7(x) = GRAB.y7(x) + REFERENCE.y1(ReferencePoint) GRAB.y8(x) = GRAB.y8(x) + REFERENCE.y1(ReferencePoint) GRAB.z1(x) = GRAB.z1(x) + REFERENCE.z1(ReferencePoint) GRAB.z2(x) = GRAB.z2(x) + REFERENCE.z1(ReferencePoint) GRAB.z3(x) = GRAB.z3(x) + REFERENCE.z1(ReferencePoint) GRAB.z4(x) = GRAB.z4(x) + REFERENCE.z1(ReferencePoint) GRAB.z5(x) = GRAB.z5(x) + REFERENCE.z1(ReferencePoint) GRAB.z6(x) = GRAB.z6(x) + REFERENCE.z1(ReferencePoint) GRAB.z7(x) = GRAB.z7(x) + REFERENCE.z1(ReferencePoint) GRAB.z8(x) = GRAB.z8(x) + REFERENCE.z1(ReferencePoint) 'get real color red = GRAB.red(x): green = GRAB.green(x): blue = GRAB.blue(x) 'draw this individual shape in OpenGL DrawShape Next x End If LocalGun = 0 End Sub Public Sub GetConditions(Conditions) 'work out the conditions of drawing an instrument or not depending on the CONDITIONS number '0 means draw no matter what '1 play screen '2 play, small console '3 small console only '4 big console only '5 big and small console 'we will return CanDo as the result. CanDo = 0 If Conditions = 0 Then CanDo = 1 If Conditions = 1 And CONSOLE = 0 And GAME = 1 Then CanDo = 1 If Conditions = 2 Then If CONSOLE = 0 Then CanDo = 1 If CONSOLE = 1 And SMALL_CONSOLE = 1 Then CanDo = 1 End If If Conditions = 3 Then If CONSOLE = 1 And SMALL_CONSOLE = 1 Then CanDo = 1 If Conditions = 4 Then If CONSOLE = 1 And SMALL_CONSOLE = 0 Then CanDo = 1 If Conditions = 5 Then If CONSOLE = 1 Then CanDo = 1 If Conditions = 6 And CONSOLE = 0 And GAME = 1 And HOLD_TAB_SCORES = 1 Then CanDo = 1 If Conditions = 7 And CONSOLE = 0 And GAME = 1 And HOLD_TAB_SCORES = 0 Then CanDo = 1 If Conditions = 8 And GAME = 1 And HOLD_TAB_SCORES = 0 Then If CONSOLE = 0 Then CanDo = 1 If CONSOLE = 1 And SMALL_CONSOLE = 1 Then CanDo = 1 End If End Sub Public Sub GetGunSprite(WhatGun, WhatVariation, WhatSpecial) 'work out what gun sprite to draw depending on these 3 variables 'return manSprite as the sprite 'return as -1 if no gun is found manSprite = -1 'rocket launchers If WhatGun = 1 Then If WhatVariation = 1 Then manSprite = 4 If WhatVariation = 2 Then manSprite = 13 If WhatVariation = 3 Then manSprite = 14 End If 'fan guns If WhatGun = 2 Then If WhatVariation = 1 Then manSprite = 2 If WhatVariation = 2 Then manSprite = 8 If WhatVariation = 3 Then manSprite = 10 If WhatVariation = 4 Then manSprite = 17 End If 'fork guns If WhatGun = 3 Then If WhatVariation = 1 Then manSprite = 15 If WhatVariation = 2 Then manSprite = 21 End If 'shotguns If WhatGun = 4 Then If WhatVariation = 1 Then manSprite = 6 If WhatVariation = 2 Then manSprite = 12 End If 'rail guns If WhatGun = 8 Then If WhatVariation = 1 Then manSprite = 16 End If 'grenade launchers If WhatGun = 6 Then If WhatVariation = 1 Then manSprite = 23 End If 'machine guns If WhatGun = 7 Then If WhatVariation = 1 Then manSprite = 25 End If 'rifles If WhatGun = 5 Then If WhatVariation = 1 Then manSprite = 7 End If End Sub Public Sub GetManColorset() 'get the colorset from the ManColorSet variable On Local Error Resume Next Dim p As String 'skin/head p = Mid$(manColorSet$, 1, 1) If Int(p) <= 9 Then ManHeadColor = p If p = "A" Then ManHeadColor = 10 If p = "B" Then ManHeadColor = 11 If p = "C" Then ManHeadColor = 12 If p = "D" Then ManHeadColor = 13 If p = "E" Then ManHeadColor = 14 If p = "F" Then ManHeadColor = 15 If p = "G" Then ManHeadColor = 16 If p = "H" Then ManHeadColor = 17 If p = "I" Then ManHeadColor = 18 If p = "J" Then ManHeadColor = 19 If p = "K" Then ManHeadColor = 20 'body p = Mid$(manColorSet$, 2, 1) If Int(p) <= 9 Then ManBodyColor = p If p = "A" Then ManBodyColor = 10 If p = "B" Then ManBodyColor = 11 If p = "C" Then ManBodyColor = 12 If p = "D" Then ManBodyColor = 13 If p = "E" Then ManBodyColor = 14 If p = "F" Then ManBodyColor = 15 If p = "G" Then ManBodyColor = 16 If p = "H" Then ManBodyColor = 17 If p = "I" Then ManBodyColor = 18 If p = "J" Then ManBodyColor = 19 If p = "K" Then ManBodyColor = 20 'horn p = Mid$(manColorSet$, 3, 1) If Int(p) <= 9 Then ManHornColor = p If p = "A" Then ManHornColor = 10 If p = "B" Then ManHornColor = 11 If p = "C" Then ManHornColor = 12 If p = "D" Then ManHornColor = 13 If p = "E" Then ManHornColor = 14 If p = "F" Then ManHornColor = 15 If p = "G" Then ManHornColor = 16 If p = "H" Then ManHornColor = 17 If p = "I" Then ManHornColor = 18 If p = "J" Then ManHornColor = 19 If p = "K" Then ManHornColor = 20 'arm p = Mid$(manColorSet$, 4, 1) If Int(p) <= 9 Then ManArmColor = p If p = "A" Then ManArmColor = 10 If p = "B" Then ManArmColor = 11 If p = "C" Then ManArmColor = 12 If p = "D" Then ManArmColor = 13 If p = "E" Then ManArmColor = 14 If p = "F" Then ManArmColor = 15 If p = "G" Then ManArmColor = 16 If p = "H" Then ManArmColor = 17 If p = "I" Then ManArmColor = 18 If p = "J" Then ManArmColor = 19 If p = "K" Then ManArmColor = 20 'tail p = Mid$(manColorSet$, 5, 1) If Int(p) <= 9 Then ManTailColor = p If p = "A" Then ManTailColor = 10 If p = "B" Then ManTailColor = 11 If p = "C" Then ManTailColor = 12 If p = "D" Then ManTailColor = 13 If p = "E" Then ManTailColor = 14 If p = "F" Then ManTailColor = 15 If p = "G" Then ManTailColor = 16 If p = "H" Then ManTailColor = 17 If p = "I" Then ManTailColor = 18 If p = "J" Then ManTailColor = 19 If p = "K" Then ManTailColor = 20 End Sub Public Sub GetSlugColor(SlugM) 'set the slug color of the missile MIS 'go through force colors etc 'return SlugRed, SlugGreen and SlugBlue, and SlugColor (for pro color) 'set the color from the CURVE value, a little hack for rails SlugColor = missile(SlugM).curve 'any force team/enemy colors go here If PLAYER_TEAM <> 0 And WCONF(PLAYER_NAME).CHAR <> LCase(missile(SlugM).owner) Then If CONF(RAIL_FORCE_TEAM_COLOR).value >= 0 Then 'find name of slug owner in database y = -1 For x = 0 To MaxPeople If missile(SlugM).owner = person(x).Name Then y = x If y >= 0 And PLAYER_TEAM = person(y).Team Then SlugColor = CONF(RAIL_FORCE_TEAM_COLOR).value Next x End If If CONF(RAIL_FORCE_ENEMY_COLOR).value >= 0 Then 'find name of slug owner in database y = -1 For x = 0 To MaxPeople If missile(SlugM).owner = person(x).Name Then y = x If y >= 0 And PLAYER_TEAM <> person(y).Team Then SlugColor = CONF(RAIL_FORCE_ENEMY_COLOR).value Next x End If End If SlugRed = RailRed(SlugColor) SlugGreen = RailGreen(SlugColor) SlugBlue = RailBlue(SlugColor) End Sub Public Sub LoadSprite(spritenumber, spritefilename As String, scale_of_sprite) 'load the sprite into the library, and set the scale too If LCase$(Right$(spritefilename, 7)) <> ".sprite" Then spritefilename = spritefilename & ".sprite" spritefilename = WCONF(RESOURCE_FOLDER).CHAR & "/sprite/" & LCase$(spritefilename) 'set scale SPRITESCALE(spritenumber) = scale_of_sprite 'load sprite On Error GoTo SpriteLoadError Open spritefilename For Input As #1 Do While Not EOF(1) Input #1, sprite(spritenumber).Name, sprite(spritenumber).notes, sprite(spritenumber).maxshapes For x = 0 To MAX_SHAPES Input #1, sprite(spritenumber).x1(x), sprite(spritenumber).y1(x), sprite(spritenumber).z1(x) Input #1, sprite(spritenumber).x2(x), sprite(spritenumber).y2(x), sprite(spritenumber).z2(x) Input #1, sprite(spritenumber).x3(x), sprite(spritenumber).y3(x), sprite(spritenumber).z3(x) Input #1, sprite(spritenumber).x4(x), sprite(spritenumber).y4(x), sprite(spritenumber).z4(x) Input #1, sprite(spritenumber).x5(x), sprite(spritenumber).y5(x), sprite(spritenumber).z5(x) Input #1, sprite(spritenumber).x6(x), sprite(spritenumber).y6(x), sprite(spritenumber).z6(x) Input #1, sprite(spritenumber).x7(x), sprite(spritenumber).y7(x), sprite(spritenumber).z7(x) Input #1, sprite(spritenumber).x8(x), sprite(spritenumber).y8(x), sprite(spritenumber).z8(x) Input #1, sprite(spritenumber).red(x), sprite(spritenumber).green(x), sprite(spritenumber).blue(x), sprite(spritenumber).texture(x), sprite(spritenumber).special(x), sprite(spritenumber).t(x) Next x Loop Close #1 'work out the maxshapes of that sprite For x = 0 To MAX_SHAPES If sprite(spritenumber).t(x) <> 0 Then sprite(spritenumber).maxshapes = x Next x AddConsole "Loaded sprite " & Chr(34) & spritefilename & Chr(34) & " [" & sprite(spritenumber).maxshapes & " shapes]" GoTo SLERR2 SpriteLoadError: AddError "Could not load sprite " & Chr(34) & spritefilename & Chr(34) SLERR2: End Sub Public Sub PLANE_SHADING() 'shade the red green blue of the plane manually 'they must be returned 0-1, not 0-255 'pn is the point of 1-4 in the hymene vertical shading method 'fc is the face number, 1-6, t,b,w,e,n,s 'default is full color, with main shading deducted red = 255 - CONF(PLANE_MAINSHADING).value green = 255 - CONF(PLANE_MAINSHADING).value blue = 255 - CONF(PLANE_MAINSHADING).value 'tint by individual face shading If fc = 1 Then red = red + CONF(PLANE_LIGHT_TOPRED).value If fc = 1 Then green = green + CONF(PLANE_LIGHT_TOPGREEN).value If fc = 1 Then blue = blue + CONF(PLANE_LIGHT_TOPBLUE).value If fc = 2 Then red = red + CONF(PLANE_LIGHT_BOTTOMRED).value If fc = 2 Then green = green + CONF(PLANE_LIGHT_BOTTOMGREEN).value If fc = 2 Then blue = blue + CONF(PLANE_LIGHT_BOTTOMBLUE).value If fc = 3 Then red = red + CONF(PLANE_LIGHT_WESTRED).value If fc = 3 Then green = green + CONF(PLANE_LIGHT_WESTGREEN).value If fc = 3 Then blue = blue + CONF(PLANE_LIGHT_WESTBLUE).value If fc = 4 Then red = red + CONF(PLANE_LIGHT_EASTRED).value If fc = 4 Then green = green + CONF(PLANE_LIGHT_EASTGREEN).value If fc = 4 Then blue = blue + CONF(PLANE_LIGHT_EASTBLUE).value If fc = 5 Then red = red + CONF(PLANE_LIGHT_NORTHRED).value If fc = 5 Then green = green + CONF(PLANE_LIGHT_NORTHGREEN).value If fc = 5 Then blue = blue + CONF(PLANE_LIGHT_NORTHBLUE).value If fc = 6 Then red = red + CONF(PLANE_LIGHT_SOUTHRED).value If fc = 6 Then green = green + CONF(PLANE_LIGHT_SOUTHGREEN).value If fc = 6 Then blue = blue + CONF(PLANE_LIGHT_SOUTHBLUE).value 'random shading? doit = 1 If CONF(PLANE_RANDOM_CORNERSONLY).value = 1 Then If pn = 1 Or pn = 3 Then doit = 1 Else doit = 0 If CONF(PLANE_RANDOM_SHADING).value <> 0 And doit = 1 Then A = Int(Rnd * CONF(PLANE_RANDOM_SHADING).value) red = red - A blue = blue - A green = green - A End If 'convert the 0-255 to 0-1 red = red / 255 green = green / 255 blue = blue / 255 End Sub Public Sub DRAW_WORLD() 'draw the world using whatever engine needed 'if the engine is changed make sure to change this to dictate where and how you draw everything 'instead of config, do this manually 'this sub is the link from the PRO engine to the OPENGL engine glLoadIdentity 'stop hackers exploiting transparency glDisable glcBlend 'large console If CONSOLE = 1 And SMALL_CONSOLE = 0 Then GL_DRAW_CONSOLE End If 'in game view If CONSOLE = 0 Or SMALL_CONSOLE = 1 Then 'set the camera view Call GL_CAMERA 'draw world------> 'world blocks glEnable glcDepthTest If CONF(CONF_REALTIME).value = 0 Then glCallList TheWorld If CONF(CONF_REALTIME).value = 1 Then GL_DRAW_WORLD 'spheres If CONF(DRAW_SPHERES).value = 1 Then GL_DRAW_SPHERES 'third person? If CONF(THIRD_PERSON).value >= 1 Then DrawCharacter PAC$ 'people DrawPeople 'missiles GL_DRAW_MISSILES 'sparks GL_DRAW_SPARKS 'slugs GL_DRAW_SLUGS 'draw magna means and teleporters GL_DRAW_AREAS 'draw gun If CONF(THIRD_PERSON).value = 0 And CONF(DRAW_GUN).value = 1 Then GL_DRAW_GUN glDisable glcDepthTest 'labels and 2-D stuff glLoadIdentity 'debug instruments If CONF(DEBUG_INSTRUMENTS).value >= 1 Then GL_DEBUG_INSTRUMENTS 'tab scores If HOLD_TAB_SCORES = 1 Then GL_DRAW_TAB_SCORES End If 'small console If SMALL_CONSOLE = 1 And CONSOLE = 1 Then GL_DRAW_SMALLCONSOLE 'instruments (able to over-ride all) If CONF(DRAW_INSTRUMENTS).value = 1 Then PROCESS_INSTRUMENTS End Sub Public Sub DrawCharacter(MAN As String) 'draw the character based on the information provided by MAN which is a PAC line. 'this can be you, or another player, or a video playback visual. 'get information from the packet manX = (Int(Mid$(MAN, 2, 5)) - 50000) / 100 manY = (Int(Mid$(MAN, 7, 5)) - 50000) / 100 manZ = (Int(Mid$(MAN, 12, 5)) - 50000) / 100 manHor = 180 + (Int(Mid$(MAN, 17, 3)) / 10) * 3.6 manVer = 0 - (Int(Mid$(MAN, 20, 3)) / 10) * 3.6 manBar = (Int(Mid$(MAN, 23, 3)) / 10) * 3.6 manTailHor = 180 + Int(Mid$(MAN, 26, 2)) * 3.6 manTailVer = 0 - Int(Mid$(MAN, 28, 2)) * 3.6 manTailBar = Int(Mid$(MAN, 30, 2)) * 3.6 manGun = Int(Mid$(MAN, 32, 1)) manVariation = Int(Mid$(MAN, 33, 1)) manSpecial = Int(Mid$(MAN, 34, 1)) manTeam = Int(Mid$(MAN, 35, 1)) manColorSet$ = Mid$(MAN, 36, 5) manName$ = Mid$(MAN, 41) LocalGun = 0 'get the colors from the colorset GetManColorset 'bind the texture glBindTexture GL_TEXTURE_2D, texture(5) 'body----------------------------------------------------------------------------------------------> GRAB = sprite(0) 'scale it ScaleSprite SPRITESCALE(0) For x = 0 To GRAB.maxshapes 'flip vertical GRAB.y1(x) = 0 - GRAB.y1(x) GRAB.y2(x) = 0 - GRAB.y2(x) GRAB.y3(x) = 0 - GRAB.y3(x) GRAB.y4(x) = 0 - GRAB.y4(x) GRAB.y5(x) = 0 - GRAB.y5(x) GRAB.y6(x) = 0 - GRAB.y6(x) GRAB.y7(x) = 0 - GRAB.y7(x) GRAB.y8(x) = 0 - GRAB.y8(x) 'bar Rotate GRAB.x1(x), GRAB.y1(x), manBar Rotate GRAB.x2(x), GRAB.y2(x), manBar Rotate GRAB.x3(x), GRAB.y3(x), manBar Rotate GRAB.x4(x), GRAB.y4(x), manBar Rotate GRAB.x5(x), GRAB.y5(x), manBar Rotate GRAB.x6(x), GRAB.y6(x), manBar Rotate GRAB.x7(x), GRAB.y7(x), manBar Rotate GRAB.x8(x), GRAB.y8(x), manBar 'ver Rotate GRAB.z1(x), GRAB.y1(x), manVer Rotate GRAB.z2(x), GRAB.y2(x), manVer Rotate GRAB.z3(x), GRAB.y3(x), manVer Rotate GRAB.z4(x), GRAB.y4(x), manVer Rotate GRAB.z5(x), GRAB.y5(x), manVer Rotate GRAB.z6(x), GRAB.y6(x), manVer Rotate GRAB.z7(x), GRAB.y7(x), manVer Rotate GRAB.z8(x), GRAB.y8(x), manVer 'hor Rotate GRAB.x1(x), GRAB.z1(x), manHor Rotate GRAB.x2(x), GRAB.z2(x), manHor Rotate GRAB.x3(x), GRAB.z3(x), manHor Rotate GRAB.x4(x), GRAB.z4(x), manHor Rotate GRAB.x5(x), GRAB.z5(x), manHor Rotate GRAB.x6(x), GRAB.z6(x), manHor Rotate GRAB.x7(x), GRAB.z7(x), manHor Rotate GRAB.x8(x), GRAB.z8(x), manHor 'move to co-ordinates GRAB.x1(x) = GRAB.x1(x) + manX GRAB.x2(x) = GRAB.x2(x) + manX GRAB.x3(x) = GRAB.x3(x) + manX GRAB.x4(x) = GRAB.x4(x) + manX GRAB.x5(x) = GRAB.x5(x) + manX GRAB.x6(x) = GRAB.x6(x) + manX GRAB.x7(x) = GRAB.x7(x) + manX GRAB.x8(x) = GRAB.x8(x) + manX GRAB.y1(x) = GRAB.y1(x) + manY GRAB.y2(x) = GRAB.y2(x) + manY GRAB.y3(x) = GRAB.y3(x) + manY GRAB.y4(x) = GRAB.y4(x) + manY GRAB.y5(x) = GRAB.y5(x) + manY GRAB.y6(x) = GRAB.y6(x) + manY GRAB.y7(x) = GRAB.y7(x) + manY GRAB.y8(x) = GRAB.y8(x) + manY GRAB.z1(x) = GRAB.z1(x) + manZ GRAB.z2(x) = GRAB.z2(x) + manZ GRAB.z3(x) = GRAB.z3(x) + manZ GRAB.z4(x) = GRAB.z4(x) + manZ GRAB.z5(x) = GRAB.z5(x) + manZ GRAB.z6(x) = GRAB.z6(x) + manZ GRAB.z7(x) = GRAB.z7(x) + manZ GRAB.z8(x) = GRAB.z8(x) + manZ 'get reference point 11 for the gun If x = 11 Then GunX = GRAB.x1(11) GunY = GRAB.y1(11) GunZ = GRAB.z1(11) End If 'get real color red = GRAB.red(x): green = GRAB.green(x): blue = GRAB.blue(x) 'hack color for this body sprite colored = 0 'skin color If colored = 0 And red = 0 And green = 255 And blue = 0 Then red = ProRed(ManHeadColor): green = ProGreen(ManHeadColor): blue = ProBlue(ManHeadColor): colored = 1 'body color If colored = 0 And red = 255 And green = 0 And blue = 0 Then red = ProRed(ManBodyColor): green = ProGreen(ManBodyColor): blue = ProBlue(ManBodyColor): colored = 1 'arm color If colored = 0 And red = 255 And green = 0 And blue = 255 Then red = ProRed(ManArmColor): green = ProGreen(ManArmColor): blue = ProBlue(ManArmColor): colored = 1 'horn color If colored = 0 And red = 0 And green = 255 And blue = 255 Then red = ProRed(ManHornColor): green = ProGreen(ManHornColor): blue = ProBlue(ManHornColor): colored = 1 'draw this individual shape in OpenGL DrawShape Next x 'tail----------------------------------------------------------------------------------------------> GRAB = sprite(1) 'scale it ScaleSprite SPRITESCALE(1) For x = 0 To GRAB.maxshapes 'flip vertical GRAB.y1(x) = 0 - GRAB.y1(x) GRAB.y2(x) = 0 - GRAB.y2(x) GRAB.y3(x) = 0 - GRAB.y3(x) GRAB.y4(x) = 0 - GRAB.y4(x) GRAB.y5(x) = 0 - GRAB.y5(x) GRAB.y6(x) = 0 - GRAB.y6(x) GRAB.y7(x) = 0 - GRAB.y7(x) GRAB.y8(x) = 0 - GRAB.y8(x) 'bar Rotate GRAB.x1(x), GRAB.y1(x), manTailBar Rotate GRAB.x2(x), GRAB.y2(x), manTailBar Rotate GRAB.x3(x), GRAB.y3(x), manTailBar Rotate GRAB.x4(x), GRAB.y4(x), manTailBar Rotate GRAB.x5(x), GRAB.y5(x), manTailBar Rotate GRAB.x6(x), GRAB.y6(x), manTailBar Rotate GRAB.x7(x), GRAB.y7(x), manTailBar Rotate GRAB.x8(x), GRAB.y8(x), manTailBar 'ver Rotate GRAB.z1(x), GRAB.y1(x), manTailVer Rotate GRAB.z2(x), GRAB.y2(x), manTailVer Rotate GRAB.z3(x), GRAB.y3(x), manTailVer Rotate GRAB.z4(x), GRAB.y4(x), manTailVer Rotate GRAB.z5(x), GRAB.y5(x), manTailVer Rotate GRAB.z6(x), GRAB.y6(x), manTailVer Rotate GRAB.z7(x), GRAB.y7(x), manTailVer Rotate GRAB.z8(x), GRAB.y8(x), manTailVer 'hor Rotate GRAB.x1(x), GRAB.z1(x), manTailHor Rotate GRAB.x2(x), GRAB.z2(x), manTailHor Rotate GRAB.x3(x), GRAB.z3(x), manTailHor Rotate GRAB.x4(x), GRAB.z4(x), manTailHor Rotate GRAB.x5(x), GRAB.z5(x), manTailHor Rotate GRAB.x6(x), GRAB.z6(x), manTailHor Rotate GRAB.x7(x), GRAB.z7(x), manTailHor Rotate GRAB.x8(x), GRAB.z8(x), manTailHor 'move to co-ordinates GRAB.x1(x) = GRAB.x1(x) + manX GRAB.x2(x) = GRAB.x2(x) + manX GRAB.x3(x) = GRAB.x3(x) + manX GRAB.x4(x) = GRAB.x4(x) + manX GRAB.x5(x) = GRAB.x5(x) + manX GRAB.x6(x) = GRAB.x6(x) + manX GRAB.x7(x) = GRAB.x7(x) + manX GRAB.x8(x) = GRAB.x8(x) + manX GRAB.y1(x) = GRAB.y1(x) + manY GRAB.y2(x) = GRAB.y2(x) + manY GRAB.y3(x) = GRAB.y3(x) + manY GRAB.y4(x) = GRAB.y4(x) + manY GRAB.y5(x) = GRAB.y5(x) + manY GRAB.y6(x) = GRAB.y6(x) + manY GRAB.y7(x) = GRAB.y7(x) + manY GRAB.y8(x) = GRAB.y8(x) + manY GRAB.z1(x) = GRAB.z1(x) + manZ GRAB.z2(x) = GRAB.z2(x) + manZ GRAB.z3(x) = GRAB.z3(x) + manZ GRAB.z4(x) = GRAB.z4(x) + manZ GRAB.z5(x) = GRAB.z5(x) + manZ GRAB.z6(x) = GRAB.z6(x) + manZ GRAB.z7(x) = GRAB.z7(x) + manZ GRAB.z8(x) = GRAB.z8(x) + manZ 'get real color red = GRAB.red(x): green = GRAB.green(x): blue = GRAB.blue(x) 'hack color for this body sprite colored = 0 'tail color If colored = 0 And red = 255 And green = 0 And blue = 0 Then red = ProRed(ManTailColor): green = ProGreen(ManTailColor): blue = ProBlue(ManTailColor): colored = 1 'horn color If colored = 0 And red = 0 And green = 0 And blue = 255 Then red = ProRed(ManHornColor): green = ProGreen(ManHornColor): blue = ProBlue(ManHornColor): colored = 1 'draw this individual shape in OpenGL DrawShape Next x 'gun----------------------------------------------------------------------------------------------> 'decide what sprite to draw depending on his GUN and VARIATION GetGunSprite manGun, manVariation, manSpecial 'only draw if a sprite is found If manSprite >= 0 Then GRAB = sprite(manSprite) 'scale it ScaleSprite SPRITESCALE(manSprite) For x = 0 To GRAB.maxshapes 'flip vertical GRAB.y1(x) = 0 - GRAB.y1(x) GRAB.y2(x) = 0 - GRAB.y2(x) GRAB.y3(x) = 0 - GRAB.y3(x) GRAB.y4(x) = 0 - GRAB.y4(x) GRAB.y5(x) = 0 - GRAB.y5(x) GRAB.y6(x) = 0 - GRAB.y6(x) GRAB.y7(x) = 0 - GRAB.y7(x) GRAB.y8(x) = 0 - GRAB.y8(x) 'bar Rotate GRAB.x1(x), GRAB.y1(x), manBar Rotate GRAB.x2(x), GRAB.y2(x), manBar Rotate GRAB.x3(x), GRAB.y3(x), manBar Rotate GRAB.x4(x), GRAB.y4(x), manBar Rotate GRAB.x5(x), GRAB.y5(x), manBar Rotate GRAB.x6(x), GRAB.y6(x), manBar Rotate GRAB.x7(x), GRAB.y7(x), manBar Rotate GRAB.x8(x), GRAB.y8(x), manBar 'ver Rotate GRAB.z1(x), GRAB.y1(x), manVer Rotate GRAB.z2(x), GRAB.y2(x), manVer Rotate GRAB.z3(x), GRAB.y3(x), manVer Rotate GRAB.z4(x), GRAB.y4(x), manVer Rotate GRAB.z5(x), GRAB.y5(x), manVer Rotate GRAB.z6(x), GRAB.y6(x), manVer Rotate GRAB.z7(x), GRAB.y7(x), manVer Rotate GRAB.z8(x), GRAB.y8(x), manVer 'hor Rotate GRAB.x1(x), GRAB.z1(x), manHor Rotate GRAB.x2(x), GRAB.z2(x), manHor Rotate GRAB.x3(x), GRAB.z3(x), manHor Rotate GRAB.x4(x), GRAB.z4(x), manHor Rotate GRAB.x5(x), GRAB.z5(x), manHor Rotate GRAB.x6(x), GRAB.z6(x), manHor Rotate GRAB.x7(x), GRAB.z7(x), manHor Rotate GRAB.x8(x), GRAB.z8(x), manHor 'move to co-ordinates AND reference point GRAB.x1(x) = GRAB.x1(x) + GunX GRAB.x2(x) = GRAB.x2(x) + GunX GRAB.x3(x) = GRAB.x3(x) + GunX GRAB.x4(x) = GRAB.x4(x) + GunX GRAB.x5(x) = GRAB.x5(x) + GunX GRAB.x6(x) = GRAB.x6(x) + GunX GRAB.x7(x) = GRAB.x7(x) + GunX GRAB.x8(x) = GRAB.x8(x) + GunX GRAB.y1(x) = GRAB.y1(x) + GunY GRAB.y2(x) = GRAB.y2(x) + GunY GRAB.y3(x) = GRAB.y3(x) + GunY GRAB.y4(x) = GRAB.y4(x) + GunY GRAB.y5(x) = GRAB.y5(x) + GunY GRAB.y6(x) = GRAB.y6(x) + GunY GRAB.y7(x) = GRAB.y7(x) + GunY GRAB.y8(x) = GRAB.y8(x) + GunY GRAB.z1(x) = GRAB.z1(x) + GunZ GRAB.z2(x) = GRAB.z2(x) + GunZ GRAB.z3(x) = GRAB.z3(x) + GunZ GRAB.z4(x) = GRAB.z4(x) + GunZ GRAB.z5(x) = GRAB.z5(x) + GunZ GRAB.z6(x) = GRAB.z6(x) + GunZ GRAB.z7(x) = GRAB.z7(x) + GunZ GRAB.z8(x) = GRAB.z8(x) + GunZ 'remember all points in case of reference later REFERENCE.x1(x) = GRAB.x1(x) REFERENCE.y1(x) = GRAB.y1(x) REFERENCE.z1(x) = GRAB.z1(x) 'get real color red = GRAB.red(x): green = GRAB.green(x): blue = GRAB.blue(x) 'draw this individual shape in OpenGL DrawShape Next x 'draw VARIATION or SPECIAL stuff (like the fan on the end of the gun) DrawVariations End If End Sub Public Sub PROCESS_INSTRUMENTS() On Local Error GoTo InstrumentError 'all instruments processed and draw here, lol 'this is actually an openGL feature, but mixed with political, so I put it under this drawing sub Dim q As Integer 'defaults iX = 0: iY = 0 iX1 = 0: iX2 = 0: iX3 = 0: iX4 = 0 iY1 = 0: iY2 = 0: iY3 = 0: iY4 = 0 iWord = "" iValue = 0 iChar = "" iSpare = "" iFontX = CONF(FONT_MODEX).value iFontY = CONF(FONT_MODEY).value iRed = 1 iGreen = 1 iBlue = 1 iTexture = 0 iPivotX = 0 iPivotY = 0 iShade1 = 0 iShade2 = 0 iShade3 = 0 iShade4 = 0 iFontSet = 0 iAngle = 0 iRatioX1 = 0 iRatioY1 = 0 iRatioX2 = 1 iRatioY2 = 1 iCircleSize = 0.25 iSlices = 2 iStacks = 32 i_if = 0 iCurrentIf = 0 iTemp = 0 For x = 0 To 10 IfPassed(x) = 0 Next x IfPassed(0) = 1 glLoadIdentity glDisable glcDepthTest glClear GL_DEPTH_BUFFER_BIT For q = 0 To MaxInstruments If INST(q) <> "" Then CODE = UCase$(INST(q)) If IfPassed(iCurrentIf) = 1 Then '----------------------------------------------------------------------------------------------- If CODE = "WORD NEW" Then iWord = "" If Left$(CODE, 9) = "SET WORD " Then iWord = Mid$(INST(q), 10) If Left$(CODE, 9) = "WORD ADD " Then iWord = iWord & Mid$(INST(q), 10) If Left$(CODE, 9) = "WORD LEN " Then A = Int(Mid$(CODE, 10)) If Len(iWord) > A Then iWord = Left$(iWord, A) End If If Left$(CODE, 9) = "WORD PRE " Then iWord = Mid$(INST(q), 10) & iWord If Left$(CODE, 11) = "WORD RIGHT " Then A = Int(Mid$(CODE, 12)) If Len(iWord) > A Then iWord = Right$(iWord, A) End If If CODE = "WORD UPPER" Then iWord = UCase(iWord) If CODE = "WORD LOWER" Then iWord = LCase(iWord) If CODE = "WORD CHAR" Then iWord = iWord & iChar If CODE = "WORD VALUE" Then iWord = iWord & iValue If CODE = "WORD PREVALUE" Then iWord = "" & iValue & iWord If CODE = "WORD PRECHAR" Then iWord = iChar & iWord If Left$(CODE, 11) = "WORD SPACE " Then A = Int(Mid$(CODE, 12)) For x = 1 To A iWord = iWord & " " Next x End If If Left$(CODE, 14) = "WORD PRESPACE " Then A = Int(Mid$(CODE, 15)) For x = 1 To A iWord = " " & iWord Next x End If If CODE = "WORD SPARE" Then iWord = iWord & iSpare If CODE = "WORD PRESPARE" Then iWord = iSpare & iWord If CODE = "VALUE=TEMP" Then iValue = iTemp If CODE = "TEXTURE=VALUE" Then iTexture = iValue If CODE = "TEMP=VALUE" Then iTemp = iValue If CODE = "SPARE WORD" Then iSpare = iSpare & iWord If CODE = "SPARE NEW" Then iSpare = "" If Left$(CODE, 10) = "CHAR CODE " Then 'char customs here! B$ = Mid$(CODE, 11) If B$ = "VERSION" Then iChar = VERSION If B$ = "SCRIPT" Then iChar = WCONF(SCRIPT_NAME).CHAR If B$ = "NAME" Then iChar = WCONF(PLAYER_NAME).CHAR If B$ = "MISSILE_CLOCK_OWNER" Then iChar = MissileClockOwner If B$ = "GUN_NAME" Then GetGunType: iChar = gunname$ If B$ = "GUN_VARIATION" Then GetGunType: iChar = gunvariation$ If B$ = "GUN_SHORT_NAME" Then GetGunType: iChar = gunshortname$ If B$ = "SCUMBAG" Then GetGunType: iChar = SCUMBAG$ If B$ = "LAST_STATUS" Then iChar = LAST_STATUS$ If B$ = "LAST_CONSOLE" Then iChar = LAST_CONSOLE$ If Left(B$, 8) = "CONSOLE_" Then A = Int(Mid(B$, 9)): iChar = ConsoleLine$(A) End If If Left$(CODE, 9) = "SET CHAR " Then iChar = Mid$(INST(q), 10) If Left$(CODE, 9) = "CHAR ADD " Then iChar = iChar & Mid$(INST(q), 10) If Left$(CODE, 9) = "CHAR PRE " Then iChar = Mid$(INST(q), 10) & iChar If Left$(CODE, 11) = "CHAR RIGHT " Then A = Int(Mid$(CODE, 12)) If Len(iChar) > A Then iChar = Right$(iChar, A) End If If CODE = "CHAR UPPER" Then iChar = UCase(iChar) If CODE = "CHAR LOWER" Then iChar = LCase(iChar) If Left$(CODE, 9) = "CHAR LEN " Then A = Int(Mid$(CODE, 10)) If Len(iChar) > A Then iChar = Left$(iChar, A) End If If CODE = "CHAR VALUE" Then iChar = iValue If Left$(CODE, 11) = "VALUE CODE " Then 'value customs here! B$ = Mid$(CODE, 12) If B$ = "HEALTH" Then iValue = PLAYER_HEALTH If B$ = "MPH" Then iValue = MPH If B$ = "KPH" Then iValue = KPH If B$ = "RAWSPEED" Then iValue = RawSpeed If B$ = "FPS" Then iValue = Fps If B$ = "LPS" Then iValue = Lps If B$ = "NL" Then iValue = NL If B$ = "FACING.X" Then iValue = FACING.x If B$ = "FACING.Y" Then iValue = FACING.y If B$ = "FACING.Z" Then iValue = FACING.z If B$ = "FACING.HOR" Then iValue = FACING.hor If B$ = "FACING.BAR" Then iValue = FACING.bar If B$ = "FACING.VER" Then iValue = FACING.ver If B$ = "MOVING.X" Then iValue = MOVING.x If B$ = "MOVING.Y" Then iValue = MOVING.y If B$ = "MOVING.Z" Then iValue = MOVING.z If B$ = "MOVING.HOR" Then iValue = MOVING.hor If B$ = "MOVING.BAR" Then iValue = MOVING.bar If B$ = "MOVING.VER" Then iValue = MOVING.ver If B$ = "TRAVEL.X" Then iValue = TRAVEL.x If B$ = "TRAVEL.Y" Then iValue = TRAVEL.y If B$ = "TRAVEL.Z" Then iValue = TRAVEL.z If B$ = "TRAVEL.HOR" Then iValue = TRAVEL.hor If B$ = "TRAVEL.BAR" Then iValue = TRAVEL.bar If B$ = "TRAVEL.VER" Then iValue = TRAVEL.ver If B$ = "SLITHERPOWER" Then iValue = SlitherPower If B$ = "SLITHERGAIN" Then iValue = SlitherGain If B$ = "CONNECTION" Then iValue = CONNECTION If B$ = "IDLE" Then iValue = IDLE If B$ = "PLAY" Then iValue = PLAY If B$ = "GAME" Then iValue = GAME If B$ = "PING" Then iValue = PING If B$ = "TOTAL_PACKETS_RECEIVED" Then iValue = TOTAL_PACKETS_RECEIVED If B$ = "TOTAL_PACKETS_SENT" Then iValue = TOTAL_PACKETS_SENT If B$ = "PACKETS_RECEIVED" Then iValue = PACKETS_RECEIVED If B$ = "PACKETS_SENT" Then iValue = PACKETS_SENT If B$ = "SMALL_CONSOLE" Then iValue = SMALL_CONSOLE If B$ = "CONSOLE" Then iValue = CONSOLE If B$ = "FLOOR" Then iValue = FLOOR If B$ = "ROCKET_LAUNCHER" Then iValue = ROCKET_LAUNCHER If B$ = "FAN_CANNON" Then iValue = FAN_CANNON If B$ = "FORK_GUN" Then iValue = FORK_GUN If B$ = "SHOTGUN" Then iValue = SHOTGUN If B$ = "RIFLE" Then iValue = RIFLE If B$ = "RAIL_GUN" Then iValue = RAIL_GUN If B$ = "MACHINEGUN" Then iValue = MACHINEGUN If B$ = "GRENADE_LAUNCHER" Then iValue = GRENADE_LAUNCHER If B$ = "SPECIAL_GUN" Then iValue = SPECIAL_GUN If B$ = "ROCKETS" Then iValue = ROCKETS If B$ = "FANS" Then iValue = FANS If B$ = "PLASMA" Then iValue = PLASMA If B$ = "SHELLS" Then iValue = SHELLS If B$ = "SUPERBULLETS" Then iValue = SUPERBULLETS If B$ = "SLUGS" Then iValue = SLUGS If B$ = "BULLETS" Then iValue = BULLETS If B$ = "GRENADES" Then iValue = GRENADES If B$ = "LIGHTNING" Then iValue = LIGHTNING If B$ = "AMMO" Then If PLAYER_GUN = 0 Then iValue = 0 If PLAYER_GUN = 1 Then iValue = ROCKETS If PLAYER_GUN = 2 Then iValue = FANS If PLAYER_GUN = 3 Then iValue = PLASMA If PLAYER_GUN = 4 Then iValue = SHELLS If PLAYER_GUN = 5 Then iValue = SUPERBULLETS If PLAYER_GUN = 6 Then iValue = GRENADES If PLAYER_GUN = 7 Then iValue = BULLETS If PLAYER_GUN = 8 Then iValue = SLUGS If PLAYER_GUN = 9 Then iValue = LIGHTNING End If If B$ = "ROSTER_SCORE" Then iValue = ROSTER_SCORE If B$ = "PLAYER_SCORE" Then iValue = PLAYER_SCORE If B$ = "MISSILE_CLOCK_SPEED" Then iValue = MissileClockSpeed If B$ = "MISSILE_CLOCK_TYPE" Then iValue = MissileClockType If B$ = "SCUMBAG_ID" Then iValue = SCUMBAGID If B$ = "SCUMBAG_AVATAR" Then iValue = SCUMBAGAVATAR End If If Left$(CODE, 10) = "VALUE ADD " Then A = Val(Mid$(CODE, 11)): iValue = iValue + A If Left$(CODE, 15) = "VALUE SUBTRACT " Then A = Val(Mid$(CODE, 16)): iValue = iValue - A If Left$(CODE, 15) = "VALUE MULTIPLY " Then A = Val(Mid$(CODE, 16)): iValue = iValue * A If Left$(CODE, 13) = "VALUE DIVIDE " Then A = Val(Mid$(CODE, 14)): iValue = iValue / A If CODE = "VALUE INT" Then iValue = Int(iValue) If Left$(CODE, 14) = "VALUE DECIMAL " Then A = Int(Mid$(CODE, 15)) iValue = Int(iValue * A) / A End If If Left$(CODE, 10) = "VALUE MAX " Then A = Val(Mid$(CODE, 11)): If iValue >= A Then iValue = A If Left$(CODE, 10) = "VALUE MIN " Then A = Val(Mid$(CODE, 11)): If iValue <= A Then iValue = A If CODE = "VALUE ABS" Then iValue = Abs(iValue) If CODE = "VALUE INVERT" Then iValue = 0 - iValue If Left$(CODE, 9) = "LOCATE X " Then iX = Val(Mid$(CODE, 10)) If Left$(CODE, 9) = "LOCATE Y " Then iY = Val(Mid$(CODE, 10)) If Left$(CODE, 7) = "FONT X " Then iFontX = Val(Mid$(CODE, 8)) If Left$(CODE, 7) = "FONT Y " Then iFontY = Val(Mid$(CODE, 8)) If Left$(CODE, 4) = "RED " Then iRed = Val(Mid$(CODE, 5)) If Left$(CODE, 6) = "GREEN " Then iGreen = Val(Mid$(CODE, 7)) If Left$(CODE, 5) = "BLUE " Then iBlue = Val(Mid$(CODE, 6)) If Left$(CODE, 9) = "FONT SET " Then iFontSet = Int(Mid$(CODE, 10)) If Left$(CODE, 11) = "PRINT CHAR " Then A = Int(Mid$(CODE, 12)) GetConditions A If CanDo = 1 Then glColor3f iRed, iGreen, iBlue glPrintCustom iX, iY, iChar, iFontSet, iFontX, iFontY End If End If If Left$(CODE, 11) = "PRINT WORD " Then A = Int(Mid$(CODE, 12)) GetConditions A If CanDo = 1 Then glColor3f iRed, iGreen, iBlue glPrintCustom iX, iY, iWord, iFontSet, iFontX, iFontY End If End If If Left$(CODE, 12) = "PRINT VALUE " Then A = Int(Mid$(CODE, 13)) GetConditions A B$ = "" & iValue If CanDo = 1 Then glColor3f iRed, iGreen, iBlue glPrintCustom iX, iY, B$, iFontSet, iFontX, iFontY End If End If If Left$(CODE, 8) = "TEXTURE " Then iTexture = Int(Mid$(CODE, 9)) If Left$(CODE, 3) = "X1 " Then iX1 = Val(Mid$(CODE, 4)) If Left$(CODE, 3) = "X2 " Then iX2 = Val(Mid$(CODE, 4)) If Left$(CODE, 3) = "X3 " Then iX3 = Val(Mid$(CODE, 4)) If Left$(CODE, 3) = "X4 " Then iX4 = Val(Mid$(CODE, 4)) If Left$(CODE, 3) = "Y1 " Then iY1 = Val(Mid$(CODE, 4)) If Left$(CODE, 3) = "Y2 " Then iY2 = Val(Mid$(CODE, 4)) If Left$(CODE, 3) = "Y3 " Then iY3 = Val(Mid$(CODE, 4)) If Left$(CODE, 3) = "Y4 " Then iY4 = Val(Mid$(CODE, 4)) If CODE = "SET X1" Then iX1 = iValue If CODE = "SET X2" Then iX2 = iValue If CODE = "SET X3" Then iX3 = iValue If CODE = "SET X4" Then iX4 = iValue If CODE = "SET Y1" Then iY1 = iValue If CODE = "SET Y2" Then iY2 = iValue If CODE = "SET Y3" Then iY3 = iValue If CODE = "SET Y4" Then iY4 = iValue If Left$(CODE, 7) = "PIVOTX " Then iPivotX = Val(Mid$(CODE, 8)) If Left$(CODE, 7) = "PIVOTY " Then iPivotY = Val(Mid$(CODE, 8)) If Left$(CODE, 7) = "ROTATE " Then iAngle = Val(Mid$(CODE, 8)) RotateOverPivot iX1, iY1, iPivotX, iPivotY, iAngle RotateOverPivot iX2, iY2, iPivotX, iPivotY, iAngle RotateOverPivot iX3, iY3, iPivotX, iPivotY, iAngle RotateOverPivot iX4, iY4, iPivotX, iPivotY, iAngle End If If Left$(CODE, 8) = "ROTATE1 " Then iAngle = Val(Mid$(CODE, 9)) RotateOverPivot iX1, iY1, iPivotX, iPivotY, iAngle End If If Left$(CODE, 8) = "ROTATE2 " Then iAngle = Val(Mid$(CODE, 9)) RotateOverPivot iX2, iY2, iPivotX, iPivotY, iAngle End If If Left$(CODE, 8) = "ROTATE3 " Then iAngle = Val(Mid$(CODE, 9)) RotateOverPivot iX3, iY3, iPivotX, iPivotY, iAngle End If If Left$(CODE, 8) = "ROTATE4 " Then iAngle = Val(Mid$(CODE, 9)) RotateOverPivot iX4, iY4, iPivotX, iPivotY, iAngle End If If CODE = "ROTATE VALUE" Then iAngle = iValue RotateOverPivot iX1, iY1, iPivotX, iPivotY, iAngle RotateOverPivot iX2, iY2, iPivotX, iPivotY, iAngle RotateOverPivot iX3, iY3, iPivotX, iPivotY, iAngle RotateOverPivot iX4, iY4, iPivotX, iPivotY, iAngle End If If CODE = "ROTATE VALUE1" Then iAngle = iValue RotateOverPivot iX1, iY1, iPivotX, iPivotY, iAngle End If If CODE = "ROTATE VALUE2" Then iAngle = iValue RotateOverPivot iX2, iY2, iPivotX, iPivotY, iAngle End If If CODE = "ROTATE VALUE3" Then iAngle = iValue RotateOverPivot iX3, iY3, iPivotX, iPivotY, iAngle End If If CODE = "ROTATE VALUE4" Then iAngle = iValue RotateOverPivot iX4, iY4, iPivotX, iPivotY, iAngle End If If Left$(CODE, 9) = "RATIO X1 " Then iRatioX1 = Val(Mid$(CODE, 10)) If Left$(CODE, 9) = "RATIO Y1 " Then iRatioY1 = Val(Mid$(CODE, 10)) If Left$(CODE, 9) = "RATIO X2 " Then iRatioX2 = Val(Mid$(CODE, 10)) If Left$(CODE, 9) = "RATIO Y2 " Then iRatioY2 = Val(Mid$(CODE, 10)) If Left$(CODE, 10) = "DRAW LINE " Then A = Int(Mid$(CODE, 11)) GetConditions A If CanDo = 1 Then 'ooooooooooooooh! End If End If If Left$(CODE, 12) = "DRAW CIRCLE " Then A = Int(Mid$(CODE, 13)) GetConditions A If CanDo = 1 Then glBindTexture GL_TEXTURE_2D, texture(iTexture) glColor3f iRed, iGreen, iBlue glTranslatef iX1, iY1, -1 glRotatef (90), 1, 0, 0 gluSphere quadratic, iCircleSize, iSlices, iStacks glRotatef (0 - 90), 1, 0, 0 glTranslatef 0 - iX1, 0 - iY1, 1 'glEnd End If End If If Left$(CODE, 12) = "DRAW SQUARE " Then A = Int(Mid$(CODE, 13)) GetConditions A If CanDo = 1 Then glBindTexture GL_TEXTURE_2D, texture(iTexture) glBegin GL_QUADS glColor3f iRed - iShade1, iGreen - iShade1, iBlue - iShade1 glTexCoord2f iRatioX1, iRatioY1: glVertex3f iX1, iY1, CONF(INSTRUMENT_ZDEPTH).value glColor3f iRed - iShade2, iGreen - iShade2, iBlue - iShade2 glTexCoord2f iRatioX2, iRatioY1: glVertex3f iX2, iY2, CONF(INSTRUMENT_ZDEPTH).value glColor3f iRed - iShade3, iGreen - iShade3, iBlue - iShade3 glTexCoord2f iRatioX2, iRatioY2: glVertex3f iX3, iY3, CONF(INSTRUMENT_ZDEPTH).value glColor3f iRed - iShade4, iGreen - iShade4, iBlue - iShade4 glTexCoord2f iRatioX1, iRatioY2: glVertex3f iX4, iY4, CONF(INSTRUMENT_ZDEPTH).value glEnd End If End If If CODE = "DEPTH ON" Then glEnable glcDepthTest If CODE = "DEPTH OFF" Then glDisable glcDepthTest If CODE = "MASK ON" Then glEnable glcBlend glBlendFunc sfDstColor, dfZero End If If CODE = "MASK MIDDLE" Then glBlendFunc sfOne, dfOne End If If CODE = "MASK OFF" Then glDisable glcBlend End If If CODE = "SET RED" Then iRed = iValue If CODE = "SET GREEN" Then iGreen = iValue If CODE = "SET BLUE" Then iBlue = iValue If Left$(CODE, 7) = "SHADE1 " Then iShade1 = Val(Mid$(CODE, 8)) If Left$(CODE, 7) = "SHADE2 " Then iShade2 = Val(Mid$(CODE, 8)) If Left$(CODE, 7) = "SHADE3 " Then iShade3 = Val(Mid$(CODE, 8)) If Left$(CODE, 7) = "SHADE4 " Then iShade4 = Val(Mid$(CODE, 8)) If Left$(CODE, 12) = "CIRCLE SIZE " Then iCircleSize = Val(Mid$(CODE, 13)) If Left$(CODE, 7) = "SLICES " Then iSlices = Int(Mid$(CODE, 8)) If Left$(CODE, 7) = "STACKS " Then iStacks = Int(Mid$(CODE, 8)) If CODE = "RESET COLOR" Then iRed = 1: iGreen = 1: iBlue = 1 iShade1 = 0: iShade2 = 0: iShade3 = 0: iShade4 = 0 End If If Left$(CODE, 7) = "MOVE X " Then A = Val(Mid$(CODE, 8)) iX1 = iX1 + A iX2 = iX2 + A iX3 = iX3 + A iX4 = iX4 + A End If If Left$(CODE, 7) = "MOVE Y " Then A = Val(Mid$(CODE, 8)) iY1 = iY1 + A iY2 = iY2 + A iY3 = iY3 + A iY4 = iY4 + A End If If Left$(CODE, 9) = "IF VALUE=" Then A = Val(Mid$(CODE, 10)) IfPassed(iCurrentIf + 1) = 0 If iValue = A Then IfPassed(iCurrentIf + 1) = 1 End If If Left$(CODE, 9) = "IF VALUE<" Then A = Val(Mid$(CODE, 10)) IfPassed(iCurrentIf + 1) = 0 If iValue < A Then IfPassed(iCurrentIf + 1) = 1 End If If Left$(CODE, 9) = "IF VALUE>" Then A = Val(Mid$(CODE, 10)) IfPassed(iCurrentIf + 1) = 0 If iValue > A Then IfPassed(iCurrentIf + 1) = 1 End If If Left$(CODE, 10) = "IF VALUE!=" Then A = Val(Mid$(CODE, 11)) IfPassed(iCurrentIf + 1) = 0 If iValue <> A Then IfPassed(iCurrentIf + 1) = 1 End If If Left$(CODE, 8) = "IF CHAR=" Then B$ = Mid$(CODE, 9) IfPassed(iCurrentIf + 1) = 0 If iChar = B$ Then IfPassed(iCurrentIf + 1) = 1 End If If Left$(CODE, 9) = "IF CHAR!=" Then B$ = Mid$(CODE, 9) IfPassed(iCurrentIf + 1) = 0 If iChar <> B$ Then IfPassed(iCurrentIf + 1) = 1 End If '----------------------------------------------------------------------------------------------- End If If CODE = "}" Then If IfPassed(iCurrentIf) = 1 Then IfPassed(iCurrentIf) = 0 i_if = i_if - 1 If i_if <= 0 Then i_if = 0 End If iCurrentIf = iCurrentIf - 1 If iCurrentIf <= 0 Then iCurrentIf = 0 End If If CODE = "{" Then iCurrentIf = iCurrentIf + 1 End If '----------------------------------------------------------------------------------------------- 'emergency limits If i_if >= 9 Then i_if = 9 If i_if <= 0 Then i_if = 0 If iCurrentIf >= 9 Then iCurrentIf = 9 If iCurrentIf <= 0 Then iCurrentIf = 0 End If Next q Exit Sub InstrumentError: AddError "Instrument error on line " & q & ": " & CODE End Sub Public Sub Rotate(rotatex, rotatey, rotateangle) 'rotate rotatex and rotatey by the rotateangle in DEGREES angleTemp = rotateangle / 57.298 If rotatex <> 0 Then AyeMatey = Atn((rotatey) / (rotatex)) Else AyeMatey = Atn((rotatey) / -0.000001) If rotatex <= 0 Then AyeMatey = AyeMatey + PI AyeMatey = AyeMatey + angleTemp r = Sqr((rotatex * rotatex) + (rotatey * rotatey)) rotatex = r * Cos(AyeMatey) rotatey = r * Sin(AyeMatey) End Sub Public Sub RotateOverPivot(rotatex, rotatey, pivotx, pivoty, rotateangle) 'rotate rotatex and rotatey by the rotateangle in DEGREES rotatex = rotatex - pivotx rotatey = rotatey - pivoty angleTemp = rotateangle / 57.298 If rotatex <> 0 Then Let AyeMatey = Atn((rotatey) / (rotatex)) Else Let AyeMatey = Atn((rotatey) / -0.000001) If rotatex <= 0 Then Let AyeMatey = AyeMatey + PI Let AyeMatey = AyeMatey + angleTemp Let r = Sqr((rotatex * rotatex) + (rotatey * rotatey)) Let rotatex = r * Cos(AyeMatey) Let rotatey = r * Sin(AyeMatey) rotatex = rotatex + pivotx rotatey = rotatey + pivoty End Sub Public Sub CURSOR_FLASH() CursorFlash = CursorFlash + NL If CursorFlash >= CONF(CONF_FLASHSPEED).value Then CursorFlash = 0 End Sub Public Sub ScaleSprite(multiplication) 'scale the GRAB sprite by this amount of multiplication Dim poo As Integer For poo = 0 To GRAB.maxshapes GRAB.x1(poo) = GRAB.x1(poo) * multiplication GRAB.x2(poo) = GRAB.x2(poo) * multiplication GRAB.x3(poo) = GRAB.x3(poo) * multiplication GRAB.x4(poo) = GRAB.x4(poo) * multiplication GRAB.x5(poo) = GRAB.x5(poo) * multiplication GRAB.x6(poo) = GRAB.x6(poo) * multiplication GRAB.x7(poo) = GRAB.x7(poo) * multiplication GRAB.x8(poo) = GRAB.x8(poo) * multiplication GRAB.y1(poo) = GRAB.y1(poo) * multiplication GRAB.y2(poo) = GRAB.y2(poo) * multiplication GRAB.y3(poo) = GRAB.y3(poo) * multiplication GRAB.y4(poo) = GRAB.y4(poo) * multiplication GRAB.y5(poo) = GRAB.y5(poo) * multiplication GRAB.y6(poo) = GRAB.y6(poo) * multiplication GRAB.y7(poo) = GRAB.y7(poo) * multiplication GRAB.y8(poo) = GRAB.y8(poo) * multiplication GRAB.z1(poo) = GRAB.z1(poo) * multiplication GRAB.z2(poo) = GRAB.z2(poo) * multiplication GRAB.z3(poo) = GRAB.z3(poo) * multiplication GRAB.z4(poo) = GRAB.z4(poo) * multiplication GRAB.z5(poo) = GRAB.z5(poo) * multiplication GRAB.z6(poo) = GRAB.z6(poo) * multiplication GRAB.z7(poo) = GRAB.z7(poo) * multiplication GRAB.z8(poo) = GRAB.z8(poo) * multiplication Next poo End Sub Public Sub SET_SPRITES() 'load all the sprites and set all the scales LoadSprite 0, "body", 0.0019 LoadSprite 1, "tail", 0.0027 LoadSprite 2, "fan_cannon", 0.00165 LoadSprite 3, "fan_modern", 0.0015 LoadSprite 4, "rocket_launcher", 0.0015 LoadSprite 5, "rocket", 0.0004 LoadSprite 6, "pump_action", 0.0011 LoadSprite 7, "sniper", 0.0008 LoadSprite 8, "fan_cannon_hymene", 0.0015 LoadSprite 9, "fan_hymene", 0.00165 LoadSprite 10, "horseshoe_gun", 0.0011 LoadSprite 11, "horseshoe", 0.0011 LoadSprite 12, "double_barrel", 0.0012 LoadSprite 13, "rocket_mac1", 0.0016 LoadSprite 14, "rocket_vintage", 0.0015 LoadSprite 15, "fork_gun", 0.0019 LoadSprite 16, "rail_gun", 0.0006 LoadSprite 17, "mochilop_cannon", 0.0018 LoadSprite 18, "mochilop_fan", 0.0009 LoadSprite 19, "fork_gun", 0.0009 LoadSprite 20, "fork", 0.0009 LoadSprite 21, "plasma_gun", 0.0015 LoadSprite 22, "plasma", 0.0009 LoadSprite 23, "grenade_launcher", 0.0015 LoadSprite 24, "grenade", 0.0009 LoadSprite 25, "machine_gun", 0.0015 End Sub Public Sub VisualRecoil() 'apply the visual recoil depending on our current player gun settings 'get recoil base value RecoilSpeed = CONF(RECOIL_POWER).value 'reset side to 0 RecoilSide = 0 If RECOIL <= 0 Then RECOIL = 0 End Sub 'PRO 'By Dano Wilson 'Mako studios 2005 'Main Client Engine Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Public Declare Function GetTickCount& Lib "kernel32" () Public Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long Global Const VERSION$ = "0.20 scumbag avatars and remote scripting" Global Const GAME_PROTOCOL$ = "PR1" 'engine Global fpsCount, OldFps$, Fps, lpsCount, OldLps$, Lps Global NL, OldNL Global OnlyJustBegun 'general Global B$, BUFFER$, x, y, z, xx, yy, zz, XXX, YYY, zzz, xxxx, yyyy, zzzz, N$ Global FILE$, A, i$ Global ConsoleLine$(100) 'console line data Global ConsoleColor(100) 'color of the line, 0 being default color, 1 being say, talking, 2 being error. Global ConsoleInput$ 'current console input text buffer Global CONSOLE '=1 means we are typing at the console Global SMALL_CONSOLE '=1 means we are at a small console Global PressEscape, PressSmallConsole Global MOUSEX, MOUSEY 'last recorded raw mouse travel Global MouseRefresh 'current timer until next mouse refresh Global SmoothMouseX, SmoothMouseY 'stuff for smoothing mouse Global result Global SlideX, SlideY 'for mouse_slide 'mouse Global MOUSE_ON As Integer '=1 is normal, but if we alt tab or something, it might turn off and become 0 'tab scores Global HOLD_TAB_SCORES '=1 means we are holding them down 'currents Global PLAYER_MAP$ 'the players current map he is on at the moment Public Sub BUTTONS() '------------------------------------------------------------- 'controls regardless of game or console '------------------------------------------------------------- 'Console If GetAsyncKeyState(BUTTON(BUTTON_CONSOLE)) < -1 And PressEscape = 0 Then PressEscape = 1 If GetAsyncKeyState(BUTTON(BUTTON_CONSOLE)) >= -1 Then PressEscape = 0 If PressEscape = 1 Then PressEscape = 2 If CONSOLE = 1 Then CONSOLE = 0 Else CONSOLE = 1 SMALL_CONSOLE = 0 glCinput$ = "" SetNewFOV End If 'small console If GetAsyncKeyState(BUTTON(BUTTON_SMALLCONSOLE)) < -1 And PressSmallConsole = 0 Then PressSmallConsole = 1 If GetAsyncKeyState(BUTTON(BUTTON_SMALLCONSOLE)) >= -1 Then PressSmallConsole = 0 If PressSmallConsole = 1 Then 'chat key style twiddle (press to go in, but not to get out) If CONF(CHAT_KEY_STYLE).value = 1 And CONSOLE = 0 Then PressSmallConsole = 2 If CONSOLE = 1 Then CONSOLE = 0 Else CONSOLE = 1 SMALL_CONSOLE = 1 glCinput$ = "" SetNewFOV End If 'console style twiddle, (press to get in and to get out) If CONF(CHAT_KEY_STYLE).value = 0 Then PressSmallConsole = 2 If CONSOLE = 1 Then CONSOLE = 0 Else CONSOLE = 1 SMALL_CONSOLE = 1 glCinput$ = "" SetNewFOV End If End If 'alt-tab will force you to go to big console If GetAsyncKeyState(vbKeyTab) < -1 And GetAsyncKeyState(18) < -1 Then If CONSOLE = 0 Or SMALL_CONSOLE = 1 Then SMALL_CONSOLE = 0 CONSOLE = 1 glCinput$ = "" SetNewFOV End If End If 'no tabscores held by default HOLD_TAB_SCORES = 0 '------------------------------------------------------------- 'controls you can only use in-game '------------------------------------------------------------- If CONSOLE = 0 Then 'keys and releases KEY_FORWARD = 0: If GetAsyncKeyState(BUTTON(BUTTON_FORWARD)) < -1 Then KEY_FORWARD = 1 KEY_BACK = 0: If GetAsyncKeyState(BUTTON(BUTTON_BACK)) < -1 Then KEY_BACK = 1 KEY_LEFT = 0: If GetAsyncKeyState(BUTTON(BUTTON_LEFT)) < -1 Then KEY_LEFT = 1 KEY_RIGHT = 0: If GetAsyncKeyState(BUTTON(BUTTON_RIGHT)) < -1 Then KEY_RIGHT = 1 KEY_JUMP = 0: If GetAsyncKeyState(BUTTON(BUTTON_JUMP)) < -1 Then KEY_JUMP = 1 KEY_FIRE = 0: If GetAsyncKeyState(BUTTON(BUTTON_FIRE)) < -1 Then KEY_FIRE = 1 If GetAsyncKeyState(BUTTON(BUTTON_ROCKET)) >= -1 Then KEY_ROCKET = 0 If GetAsyncKeyState(BUTTON(BUTTON_FAN)) >= -1 Then KEY_FAN = 0 If GetAsyncKeyState(BUTTON(BUTTON_PLASMA)) >= -1 Then KEY_PLASMA = 0 If GetAsyncKeyState(BUTTON(BUTTON_SHOTGUN)) >= -1 Then KEY_SHOTGUN = 0 If GetAsyncKeyState(BUTTON(BUTTON_MACHINEGUN)) >= -1 Then KEY_MACHINEGUN = 0 If GetAsyncKeyState(BUTTON(BUTTON_RAIL)) >= -1 Then KEY_RAIL = 0 If GetAsyncKeyState(BUTTON(BUTTON_GRENADE)) >= -1 Then KEY_GRENADE = 0 If GetAsyncKeyState(BUTTON(BUTTON_SPECIAL)) >= -1 Then KEY_SPECIAL = 0 If GetAsyncKeyState(BUTTON(BUTTON_RIFLE)) >= -1 Then KEY_RIFLE = 0 If GetAsyncKeyState(BUTTON(BUTTON_NEXT)) >= -1 Then KEY_NEXT = 0 If GetAsyncKeyState(BUTTON(BUTTON_PREV)) >= -1 Then KEY_PREV = 0 If GetAsyncKeyState(BUTTON(BUTTON_NOGUN)) >= -1 Then KEY_NOGUN = 0 If PLAYER_RELOAD <= 0 Then KEY_ROCKET = 0: If GetAsyncKeyState(BUTTON(BUTTON_ROCKET)) < -1 And KEY_ROCKET = 0 Then KEY_ROCKET = 1 KEY_FAN = 0: If GetAsyncKeyState(BUTTON(BUTTON_FAN)) < -1 And KEY_FAN = 0 Then KEY_FAN = 1 KEY_PLASMA = 0: If GetAsyncKeyState(BUTTON(BUTTON_PLASMA)) < -1 And KEY_PLASMA = 0 Then KEY_PLASMA = 1 KEY_SHOTGUN = 0: If GetAsyncKeyState(BUTTON(BUTTON_SHOTGUN)) < -1 And KEY_SHOTGUN = 0 Then KEY_SHOTGUN = 1 KEY_MACHINEGUN = 0: If GetAsyncKeyState(BUTTON(BUTTON_MACHINEGUN)) < -1 And KEY_MACHINEGUN = 0 Then KEY_MACHINEGUN = 1 KEY_RAIL = 0: If GetAsyncKeyState(BUTTON(BUTTON_RAIL)) < -1 And KEY_RAIL = 0 Then KEY_RAIL = 1 KEY_GRENADE = 0: If GetAsyncKeyState(BUTTON(BUTTON_GRENADE)) < -1 And KEY_GRENADE = 0 Then KEY_GRENADE = 1 KEY_SPECIAL = 0: If GetAsyncKeyState(BUTTON(BUTTON_SPECIAL)) < -1 And KEY_SPECIAL = 0 Then KEY_SPECIAL = 1 KEY_RIFLE = 0: If GetAsyncKeyState(BUTTON(BUTTON_RIFLE)) < -1 And KEY_RIFLE = 0 Then KEY_RIFLE = 1 KEY_NEXT = 0: If GetAsyncKeyState(BUTTON(BUTTON_NEXT)) < -1 And KEY_NEXT = 0 Then KEY_NEXT = 1 KEY_PREV = 0: If GetAsyncKeyState(BUTTON(BUTTON_PREV)) < -1 And KEY_PREV = 0 Then KEY_PREV = 1 KEY_NOGUN = 0: If GetAsyncKeyState(BUTTON(BUTTON_NOGUN)) < -1 And KEY_NOGUN = 0 Then KEY_NOGUN = 1 End If 'hold tab scores If GetAsyncKeyState(BUTTON(BUTTON_SCORES)) < -1 Then HOLD_TAB_SCORES = 1 'out of ammo click reset If KEY_FIRE = 0 Then OUT_OF_AMMO = 0 'change guns If KEY_ROCKET = 1 Then CHANGE_GUN 1 If KEY_FAN = 1 Then CHANGE_GUN 2 If KEY_PLASMA = 1 Then CHANGE_GUN 3 If KEY_SHOTGUN = 1 Then CHANGE_GUN 4 If KEY_MACHINEGUN = 1 Then CHANGE_GUN 7 If KEY_RAIL = 1 Then CHANGE_GUN 8 If KEY_GRENADE = 1 Then CHANGE_GUN 6 If KEY_SPECIAL = 1 Then CHANGE_GUN 9 If KEY_RIFLE = 1 Then CHANGE_GUN 5 If KEY_NOGUN = 1 Then CHANGE_GUN 0 End If End Sub Public Sub CORE() ' ^^ @@@@@@@@@ ' ^^ ^^ @@@@@@@@@@@@@@@ ' @@@@@@@@@@@@@@@@@@ ^^ ' @@@@@@@@@@@@@@@@@@@@ ' ~~~~ ~~ ~~~~~ ~~~~~~~~ ~~ &&&&&&&&&&&&&&&&&&&& ~~~~~~~ ~~~~~~~~~~~ ~~~ ' ~ ~~ ~ ~ ~~~~~~~~~~~~~~~~~~~~ ~ ~~ ~~ ~ ' ~ ~~ ~~ ~~ ~~ ~~~~~~~~~~~~~ ~~~~ ~ ~~~ ~ ~~~ ~ ~~ ' ~ ~~ ~ ~ ~~~~~~ ~~ ~~~ ~~ ~ ~~ ~~ ~ ' ~ ~ ~ ~ ~ ~~ ~~~~~~ ~ ~~ ~ ~~ ' ~ ~ ~ ~ ~~ ~ ~ ' ~ CORE ~ 'only just begun? If OnlyJustBegun = 1 Then OnlyJustBegun = 0: OldNL = GetTickCount() NL = GetTickCount() - OldNL 'remember old tick OldNL = GetTickCount() If GetAsyncKeyState(vbKeyZ) < -1 Then NL = NL * 0.1 'get over-all FPS fpsCount = fpsCount + 1 If Time$ <> OldFps$ Then Let OldFps$ = Time$: Fps = fpsCount: fpsCount = 0 'get LPS lpsCount = lpsCount + NL If Time$ <> OldLps$ Then Let OldLps$ = Time$: Lps = lpsCount: lpsCount = 0 'physics PHYSICS 'drawing DRAW_WORLD End Sub Public Sub PHYSICS() 'controls MOUSE BUTTONS 'physics BUILD_PAC_LINE SET_TAIL_ANGLE MOVEMENT WEAPONS MISSILES DO_AREAS ANIMATIONS 'net If CONNECTION = 1 Then NET_PHYSICS End Sub Public Sub MOUSE() 'move the mouse around the screen speedz = 0 'for now, until matrices 'update mouse info updatemouse = 0 MouseRefresh = MouseRefresh + NL If MouseRefresh >= CONF(MOUSE_REFRESH).value Then updatemouse = 1 MouseRefresh = 0 GetCursorPos Pnt 'decide if mouse is on or off MOUSE_ON = 1 If CONSOLE = 1 And SMALL_CONSOLE = 0 Then MOUSE_ON = 0 'mouse on? If MOUSE_ON = 1 Then xmove = centerx - Pnt.x ymove = centery - Pnt.y SetCursorPos centerx, centery End If 'mouse off? If MOUSE_ON = 0 Then xmove = 0 ymove = 0 End If 'gating If CONF(MOUSE_GATE).value > 0 And Abs(xmove) <= CONF(MOUSE_GATE).value Then xmove = 0 If CONF(MOUSE_GATE).value > 0 And Abs(ymove) <= CONF(MOUSE_GATE).value Then ymove = 0 If updatemouse = 1 Then 'matrix 1 '(temporary) If MATRIX <= 1 Then MOUSEX = 0 - (xmove * (CONF(SENSIVITY_X).value * 0.001)) If CONF(INVERT_MOUSE).value = 1 Then MOUSEY = 0 + (ymove * (CONF(SENSIVITY_Y).value * 0.001)) If CONF(INVERT_MOUSE).value = 0 Then MOUSEY = 0 - (ymove * (CONF(SENSIVITY_Y).value * 0.001)) End If 'matrix 2 If MATRIX = 2 Then MOUSEX = 0 + (xmove * (CONF(SENSIVITY_X).value * 0.001)) If CONF(INVERT_MOUSE).value = 1 Then MOUSEY = 0 + (ymove * (CONF(SENSIVITY_Y).value * 0.001)) If CONF(INVERT_MOUSE).value = 0 Then MOUSEY = 0 - (ymove * (CONF(SENSIVITY_Y).value * 0.001)) End If End If End If 'mouse_true If CONF(MOUSE_TRUE).value = 1 And updatemouse = 0 Then MOUSEX = 0: MOUSEY = 0 'cap min If CONF(MOUSE_CAPMIN).value <> 0 Then If speedx > 0 And speedx < CONF(MOUSE_CAPMIN).value Then speedx = CONF(MOUSE_CAPMIN).value If speedy > 0 And speedy < CONF(MOUSE_CAPMIN).value Then speedx = CONF(MOUSE_CAPMIN).value If speedz > 0 And speedz < CONF(MOUSE_CAPMIN).value Then speedz = CONF(MOUSE_CAPMIN).value If speedx < 0 And speedx > (0 - CONF(MOUSE_CAPMIN).value) Then speedx = 0 - CONF(MOUSE_CAPMIN).value If speedy < 0 And speedy > (0 - CONF(MOUSE_CAPMIN).value) Then speedx = 0 - CONF(MOUSE_CAPMIN).value If speedz < 0 And speedz > (0 - CONF(MOUSE_CAPMIN).value) Then speedz = 0 - CONF(MOUSE_CAPMIN).value End If 'smooth_mouse If CONF(SMOOTH_MOUSE).value > 0 Then A = 0 If xmove > SmoothMouseX Then result = (xmove - SmoothMouseX) * CONF(SMOOTH_MOUSE).value result = result + SmoothMouseX xmove = result A = 1 End If If xmove < SmoothMouseX And A = 0 Then result = (SmoothMouseX - xmove) * (1 - CONF(SMOOTH_MOUSE).value) result = result + xmove xmove = result End If A = 0 If ymove > SmoothMouseY Then result = (ymove - SmoothMouseY) * CONF(SMOOTH_MOUSE).value result = result + SmoothMouseY ymove = result A = 1 End If If ymove < SmoothMouseY And A = 0 Then result = (SmoothMouseY - ymove) * (1 - CONF(SMOOTH_MOUSE).value) result = result + ymove ymove = result End If End If SmoothMouseX = xmove SmoothMouseY = ymove 'mouse_slide If CONF(SLIDE_MOUSE).value <> 0 Then If xmove > SlideX Then SlideX = SlideX + (CONF(SLIDE_MOUSE).value * NL): If SlideX > xmove Then SlideX = xmove If xmove < SlideX Then SlideX = SlideX - (CONF(SLIDE_MOUSE).value * NL): If SlideX < xmove Then SlideX = xmove xmove = SlideX If ymove > SlideY Then SlideY = SlideY + (CONF(SLIDE_MOUSE).value * NL): If SlideY > ymove Then SlideY = ymove If ymove < SlideY Then SlideY = SlideY - (CONF(SLIDE_MOUSE).value * NL): If SlideY < ymove Then SlideY = ymove ymove = SlideY End If 'we have the value of movement, now make it move towards the speed of our turning (equalize) If SPEED_HOR > MOUSEX Then SPEED_HOR = SPEED_HOR - (CONF(MOUSE_EQ).value * 0.0001 * NL): If SPEED_HOR < MOUSEX Then SPEED_HOR = MOUSEX If SPEED_HOR < MOUSEX Then SPEED_HOR = SPEED_HOR + (CONF(MOUSE_EQ).value * 0.0001 * NL): If SPEED_HOR > MOUSEX Then SPEED_HOR = MOUSEX If SPEED_VER > MOUSEY Then SPEED_VER = SPEED_VER - (CONF(MOUSE_EQ).value * 0.0001 * NL): If SPEED_VER < MOUSEY Then SPEED_VER = MOUSEY If SPEED_VER < MOUSEY Then SPEED_VER = SPEED_VER + (CONF(MOUSE_EQ).value * 0.0001 * NL): If SPEED_VER > MOUSEY Then SPEED_VER = MOUSEY 'mouse_true snap If CONF(MOUSE_TRUE).value = 1 Then SPEED_HOR = MOUSEX SPEED_VER = MOUSEY End If 'cap max If CONF(MOUSE_CAPMAX).value <> 0 Then If SPEED_HOR > CONF(MOUSE_CAPMAX).value Then SPEED_HOR = CONF(MOUSE_CAPMAX).value If SPEED_VER > CONF(MOUSE_CAPMAX).value Then SPEED_VER = CONF(MOUSE_CAPMAX).value If SPEED_BAR > CONF(MOUSE_CAPMAX).value Then SPEED_BAR = CONF(MOUSE_CAPMAX).value If SPEED_HOR < (0 - CONF(MOUSE_CAPMAX).value) Then SPEED_HOR = 0 - CONF(MOUSE_CAPMAX).value If SPEED_VER < (0 - CONF(MOUSE_CAPMAX).value) Then SPEED_VER = 0 - CONF(MOUSE_CAPMAX).value If SPEED_BAR < (0 - CONF(MOUSE_CAPMAX).value) Then SPEED_BAR = 0 - CONF(MOUSE_CAPMAX).value End If 'apply mouse movement to the players rotation FACING.hor = FACING.hor + SPEED_HOR FACING.ver = FACING.ver + SPEED_VER FACING.bar = FACING.bar + SPEED_BAR 'circle arounds, limits of angle If FACING.hor >= 360 Then FACING.hor = FACING.hor - 360 If FACING.ver >= 360 Then FACING.ver = FACING.ver - 360 If FACING.bar >= 360 Then FACING.bar = FACING.bar - 360 If FACING.hor < 0 Then FACING.hor = FACING.hor + 360 If FACING.ver < 0 Then FACING.ver = FACING.ver + 360 If FACING.bar < 0 Then FACING.bar = FACING.bar + 360 End Sub 'PRO 'Mako studios 2006 'GL_DRAWING 'drawing aids Global fx, fy, fz, pn, fc Global GLintValue As Integer Global TEX As GLuint Global gl_scale As GLfloat Global gl_textureratio As GLfloat Global ThirdPersonHor As Double 'current camera hor for third person for smoothness Public Sub DrawAvatar(aLeft, aTop, aWidth, aHeight, aTexture, aRed, aGreen, aBlue) 'draw custom avatar glBindTexture GL_TEXTURE_2D, texture(aTexture) glBegin GL_QUADS red = iRed green = iGreen blue = iBlue glColor3f red, green, blue glTexCoord2f 0, 0: glVertex3f aLeft, aTop, CONF(AVATAR_ZDEPTH).value glTexCoord2f 1, 0: glVertex3f (aLeft + aWidth), aTop, CONF(AVATAR_ZDEPTH).value glTexCoord2f 1, 1: glVertex3f (aLeft + aWidth), (aTop + aHeight), CONF(AVATAR_ZDEPTH).value glTexCoord2f 0, 1: glVertex3f aLeft, (aTop + aHeight), CONF(AVATAR_ZDEPTH).value glEnd End Sub Public Sub GL_CAMERA() 'set the camera angle in an opengl fashion glLoadIdentity 'center the camera with the nudge CameraX = 0 CameraY = 0 + GUN_NUDGE CameraZ = 0 CameraHor = FACING.hor CameraVer = FACING.ver CameraBar = FACING.bar 'rotate the camera so the angle is perfect for crosshair alignment Rotate CameraX, CameraY, CameraBar Rotate CameraZ, CameraY, CameraVer Rotate CameraX, CameraZ, CameraHor 'add the player co-ordinates to the camera CameraX = CameraX + PLAYER_X CameraY = CameraY + PLAYER_Y CameraZ = CameraZ + PLAYER_Z 'first person If CONF(THIRD_PERSON).value = 0 Then If MATRIX >= 0 Then glRotatef CameraBar, 0, 0, 1 glRotatef CameraVer, 1, 0, 0 glRotatef CameraHor, 0, 1, 0 End If 'move camera into position glTranslatef (0 - CameraX) / gl_scale, (0 - CameraY) / gl_scale, (0 - CameraZ) / gl_scale End If 'third person If CONF(THIRD_PERSON).value = 1 Then If MATRIX = 1 Or MATRIX = 2 Then glRotatef ThirdPersonHor, 0, 1, 0 'hor 'create temp instrument Dim CAM As PHYSICS_INSTRUMENT Dim GoalHor As Double GoalHor = TRAVEL.hor If MPH <= 2 Then GoalHor = FACING.hor CAM.z = 0 - (MPH * 0.05) If CAM.z >= -1 Then CAM.z = -1 If CAM.z <= -4 Then CAM.z = -4 CAM.y = 0 CAM.x = 0 Rotate CAM.x, CAM.z, (ThirdPersonHor + 180) 'work out camera position CameraX = CAM.x CameraY = CAM.y CameraZ = CAM.z 'flip angle 'camx = 0 - camx 'camz = 0 - camz 'camy = 0 - camy 'add co-ordinates CameraX = CameraX + PLAYER_X CameraY = CameraY + PLAYER_Y CameraZ = CameraZ + PLAYER_Z 'move camera into position glTranslatef (0 - CameraX) / gl_scale, (0 - CameraY) / gl_scale, (0 - CameraZ) / gl_scale CameraVer = 0: CameraBar = 0 CameraHor = ThirdPersonHor + 180 'do smooth adjustment of angle If ThirdPersonHor > (GoalHor + 180) Then ThirdPersonHor = ThirdPersonHor - 360 If ThirdPersonHor < (GoalHor - 180) Then ThirdPersonHor = ThirdPersonHor + 360 If ThirdPersonHor <= GoalHor Then ThirdPersonHor = ThirdPersonHor + (NL * 0.1): If ThirdPersonHor >= GoalHor Then ThirdPersonHor = GoalHor If ThirdPersonHor >= GoalHor Then ThirdPersonHor = ThirdPersonHor - (NL * 0.1): If ThirdPersonHor <= GoalHor Then ThirdPersonHor = GoalHor If ThirdPersonHor > 360 Then ThirdPersonHor = ThirdPersonHor - 360 If ThirdPersonHor < 0 Then ThirdPersonHor = ThirdPersonHor + 360 End If End If End Sub Public Sub GL_DEBUG_INSTRUMENTS() glColor3f 1, 1, 1 'mode 1 If CONF(DEBUG_INSTRUMENTS).value = 1 Then glPrint 1, 1, "" & Fps & " fps", 1 glPrint 1, 3, "FACING: " & FACING.x & ", " & FACING.y & ", " & FACING.z & " hor=" & FACING.hor & " ver=" & FACING.ver & " bar=" & FACING.bar, 1 glPrint 1, 4, "TRAVEL: " & TRAVEL.x & ", " & TRAVEL.y & ", " & TRAVEL.z & " hor=" & TRAVEL.hor & " ver=" & TRAVEL.ver & " bar=" & TRAVEL.bar, 1 glPrint 1, 5, "MOVING: " & MOVING.x & ", " & MOVING.y & ", " & MOVING.z & " hor=" & MOVING.hor & " ver=" & MOVING.ver & " bar=" & MOVING.bar, 1 glPrint 1, 6, "CO-ORDINATES: " & PLAYER_X & ", " & PLAYER_Y & ", " & PLAYER_Z & "", 1 glPrint 1, 7, "MOUSE SPEED hor=" & SPEED_HOR & " ver=" & SPEED_VER & " bar=" & SPEED_BAR, 1 glPrint 1, 8, "MOUSE RAW MOVEMENT " & xmove & ", " & ymove, 1 glPrint 1, 9, "CENTERX=" & centery & " CENTERY=" & centery, 1 glPrint 1, 10, "MATRIX: " & MATRIX, 1 glPrint 1, 11, "EG: @500005000050000500500500505050123412345John", 1 glPrint 1, 12, "PAC: " & PAC$, 1 glPrint 1, -5, "" & (Int(KPH * 1000) / 1000) & " kph | " & (Int(MPH * 1000) / 1000) & " mph", 1 End If 'mode 2 If CONF(DEBUG_INSTRUMENTS).value = 2 Then glPrint 1, 2, "FLOOR=" & FLOOR, 1 glPrint 1, 3, "eva=" & Int(eva * 1000) / 1000, 1 glPrint 1, 0, "SlitherDir=" & SlitherDir, 1 glPrint 1, -1, "pSlitherPower=" & PSLITHERPOWER, 1 glPrint 1, 11, "SlitherPower=" & SlitherPower, 1 glPrint 1, -3, "LastSlitherHor=" & LastSlitherHor, 1 glPrint 1, -5, "" & (Int(KPH * 1000) / 1000) & " kph | " & (Int(MPH * 1000) / 1000) & " mph", 1 glPrint 1, 10, "SlitherGain=" & Int(SlitherGain * 1000) / 1000, 1 glPrint 1, 13, "curve=" & Int(missile(0).curve * 1000) / 1000, 1 End If End Sub Public Sub GL_DRAW_AREAS() 'magnabeam scroll MAGNA = MAGNA + ((CONF(MAGNA_SPEED).value * 0.00004) * NL) If MAGNA >= CONF(MAGNA_LIMIT).value Then MAGNA = MAGNA - CONF(MAGNA_LIMIT).value 'draw all areas such as magna beams and teleporters For x = 0 To MaxAreas If area(x).t = 1 Then 'magna beam GL_DRAW_MAGNA_BEAM End If If area(x).t = 4 Then 'teleporter End If Next x End Sub Public Sub GL_DRAW_CONSOLE() glLoadIdentity 'backdrop If CONF(CONSOLE_BACKDROP).value = 1 Then glBindTexture GL_TEXTURE_2D, texture(8) glBegin GL_QUADS red = CONF(BACKDROP_RED).value green = CONF(BACKDROP_GREEN).value blue = CONF(BACKDROP_BLUE).value glColor3f red, green, blue glTexCoord2f 0, 0: glVertex3f CONF(BACKDROP_LEFT).value, CONF(BACKDROP_BOTTOM).value, -4.2 glTexCoord2f 1, 0: glVertex3f CONF(BACKDROP_RIGHT).value, CONF(BACKDROP_BOTTOM).value, -4.2 glTexCoord2f 1, 1: glVertex3f CONF(BACKDROP_RIGHT).value, CONF(BACKDROP_TOP).value, -4.2 glTexCoord2f 0, 1: glVertex3f CONF(BACKDROP_LEFT).value, CONF(BACKDROP_TOP).value, -4.2 glEnd End If GLintValue = CONF(CONF_CONSOLEFONTSET).value 'previous writing zz = CONF(CONSOLE_MAXLINES).value For fern = 1 To zz shane = fern If ConsoleColor(shane + (100 - zz)) = 0 Then red = CONF(CONSOLE_RED).value: green = CONF(CONSOLE_GREEN).value: blue = CONF(CONSOLE_BLUE).value If ConsoleColor(shane + (100 - zz)) = 1 Then red = CONF(TALK_RED).value: green = CONF(TALK_GREEN).value: blue = CONF(TALK_BLUE).value If ConsoleColor(shane + (100 - zz)) = 2 Then red = CONF(ERROR_RED).value: green = CONF(ERROR_GREEN).value: blue = CONF(ERROR_BLUE).value If ConsoleColor(shane + (100 - zz)) = 3 Then red = CONF(DATA_RED).value: green = CONF(DATA_GREEN).value: blue = CONF(DATA_BLUE).value If ConsoleColor(shane + (100 - zz)) = 4 Then red = CONF(INPUT_RED).value: green = CONF(INPUT_GREEN).value: blue = CONF(INPUT_BLUE).value glColor3f red, green, blue shane2 = shane + CONF(CONSOLE_OFFSET).value shanex = CONF(CONSOLE_MARGIN).value glPrint shanex, shane2, (ConsoleLine$(shane + (100 - zz)) & " "), GLintValue Next fern 'typing area red = CONF(INPUT_RED).value: green = CONF(INPUT_GREEN).value: blue = CONF(INPUT_BLUE).value glColor3f red, green, blue curs$ = WCONF(CONSOLE_INPUT).CHAR: If CursorFlash > CONF(CONF_FLASHSWITCH).value Then curs$ = " " shanex = CONF(INPUT_MARGIN).value shaney = CONF(INPUT_Y).value glPrint shanex, shaney, WCONF(CONSOLE_ARROW).CHAR & glCinput$ & curs$, GLintValue 'suggestion bar If CONF(AUTO_SUGGEST).value = 1 Then red = CONF(DATA_RED).value: green = CONF(DATA_GREEN).value: blue = CONF(DATA_BLUE).value glColor3f red, green, blue GLintValue = CONF(SUGGEST_FONTSET).value shanex = CONF(INPUT_MARGIN).value shaney = CONF(INPUT_Y).value + 1 glPrint shanex, shaney, AutoSuggestion$, GLintValue End If 'cursor flash CURSOR_FLASH End Sub Public Sub GL_DRAW_MAGNA_BEAM() 'draw the magna beam of x Dim tArea As AREA_TYPE 'set glass glEnable glcBlend glBlendFunc sfOne, dfOne red = CONF(MAGNA_RED).value green = CONF(MAGNA_GREEN).value blue = CONF(MAGNA_BLUE).value margin = CONF(MAGNA_MARGIN).value 'to shrink it all slightly so it doesnt rub against other textures tArea.x = area(x).x + margin tArea.y = area(x).y + margin tArea.z = area(x).z + margin tArea.xd = area(x).xd - (margin * 2) tArea.yd = area(x).yd - (margin * 2) tArea.zd = area(x).zd - (margin * 2) gl_scale = CONF(CONF_SCALE).value gl_textureratio = CONF(MAGNA_TEXTURERATIO).value glBindTexture GL_TEXTURE_2D, texture(CONF(MAGNA_TEXTURE).value) 'set texture ratios HERE for custom movement directions 'default (pointless dummy) If area(x).value = 0 Then topx = 0: topy = 0 bottomx = 0: bottomy = 0 northx = 0: northy = 0 southx = 0: southy = 0 eastx = 0: easty = 0 westx = 0: westy = 0 End If 'downward If area(x).value = 1 Then topx = 0: topy = 0 bottomx = 0: bottomy = 0 northx = 0: northy = 0 + MAGNA southx = 0: southy = 0 + MAGNA eastx = 0: easty = 0 + MAGNA westx = 0: westy = 0 + MAGNA End If 'upward If area(x).value = 2 Then topx = 0: topy = 0 bottomx = 0: bottomy = 0 northx = 0: northy = 0 - MAGNA southx = 0: southy = 0 - MAGNA eastx = 0: easty = 0 - MAGNA westx = 0: westy = 0 - MAGNA End If 'northward If area(x).value = 3 Then topx = 0: topy = 0 + MAGNA bottomx = 0: bottomy = 0 + MAGNA northx = 0: northy = 0 southx = 0: southy = 0 eastx = 0 - MAGNA: easty = 0 westx = 0 + MAGNA: westy = 0 End If 'southward If area(x).value = 4 Then topx = 0: topy = 0 - MAGNA bottomx = 0: bottomy = 0 - MAGNA northx = 0: northy = 0 southx = 0: southy = 0 eastx = 0 + MAGNA: easty = 0 westx = 0 - MAGNA: westy = 0 End If 'eastward If area(x).value = 5 Then topx = 0 - MAGNA: topy = 0 bottomx = 0 + MAGNA: bottomy = 0 northx = 0 + MAGNA: northy = 0 southx = 0 - MAGNA: southy = 0 eastx = 0: easty = 0 westx = 0: westy = 0 End If 'westward If area(x).value = 6 Then topx = 0 + MAGNA: topy = 0 bottomx = 0 - MAGNA: bottomy = 0 northx = 0 - MAGNA: northy = 0 southx = 0 + MAGNA: southy = 0 eastx = 0: easty = 0 westx = 0: westy = 0 End If 'top roof glBegin GL_QUADS fc = 1 'corner 1 fx = tArea.x fy = tArea.y fz = tArea.z glColor3f red, green, blue glTexCoord2f (0 / gl_textureratio) + topx, (0 / gl_textureratio) + topy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 2 fx = tArea.x + tArea.xd fy = tArea.y fz = tArea.z glColor3f red, green, blue glTexCoord2f (area(x).xd / gl_textureratio) + topx, (0 / gl_textureratio) + topy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 3 fx = tArea.x + tArea.xd fy = tArea.y fz = tArea.z + tArea.zd glColor3f red, green, blue glTexCoord2f (area(x).xd / gl_textureratio) + topx, (area(x).zd / gl_textureratio) + topy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 4 fx = tArea.x fy = tArea.y fz = tArea.z + tArea.zd glColor3f red, green, blue glTexCoord2f (0 / gl_textureratio) + topx, (area(x).zd / gl_textureratio) + topy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale glEnd 'bottom floor glBegin GL_QUADS fc = 2 'corner 1 fx = tArea.x fy = tArea.y + tArea.yd fz = tArea.z glColor3f red, green, blue glTexCoord2f (0 / gl_textureratio) + bottomx, (0 / gl_textureratio) + bottomy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 2 fx = tArea.x + tArea.xd fy = tArea.y + tArea.yd fz = tArea.z glColor3f red, green, blue glTexCoord2f ((0 - area(x).xd) / gl_textureratio) + bottomx, (0 / gl_textureratio) + bottomy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 3 fx = tArea.x + tArea.xd fy = tArea.y + tArea.yd fz = tArea.z + tArea.zd glColor3f red, green, blue glTexCoord2f ((0 - area(x).xd) / gl_textureratio) + bottomx, (area(x).zd / gl_textureratio) + bottomy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 4 fx = tArea.x fy = tArea.y + tArea.yd fz = tArea.z + tArea.zd glColor3f red, green, blue glTexCoord2f (0 / gl_textureratio) + bottomx, (area(x).zd / gl_textureratio) + bottomy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale glEnd 'west wall glBegin GL_QUADS fc = 3 'corner 1 fx = tArea.x fy = tArea.y fz = tArea.z + tArea.zd glColor3f red, green, blue glTexCoord2f (0 / gl_textureratio) + westx, (0 / gl_textureratio) + westy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 2 fx = tArea.x fy = tArea.y fz = tArea.z glColor3f red, green, blue glTexCoord2f ((0 - area(x).zd) / gl_textureratio) + westx, (0 / gl_textureratio) + westy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 3 fx = tArea.x fy = tArea.y + tArea.yd fz = tArea.z glColor3f red, green, blue glTexCoord2f ((0 - area(x).zd) / gl_textureratio) + westx, (area(x).yd / gl_textureratio) + westy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 4 fx = tArea.x fy = tArea.y + tArea.yd fz = tArea.z + tArea.zd glColor3f red, green, blue glTexCoord2f (0 / gl_textureratio) + westx, (area(x).yd / gl_textureratio) + westy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale glEnd 'east wall glBegin GL_QUADS fc = 4 'corner 1 fx = tArea.x + tArea.xd fy = tArea.y fz = tArea.z + tArea.zd glColor3f red, green, blue glTexCoord2f (0 / gl_textureratio) + eastx, (0 / gl_textureratio) + easty glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 2 fx = tArea.x + tArea.xd fy = tArea.y fz = tArea.z glColor3f red, green, blue glTexCoord2f (area(x).zd / gl_textureratio) + eastx, (0 / gl_textureratio) + easty glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 3 fx = tArea.x + tArea.xd fy = tArea.y + tArea.yd fz = tArea.z glColor3f red, green, blue glTexCoord2f (area(x).zd / gl_textureratio) + eastx, (area(x).yd / gl_textureratio) + easty glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 4 fx = tArea.x + tArea.xd fy = tArea.y + tArea.yd fz = tArea.z + tArea.zd glColor3f red, green, blue glTexCoord2f (0 / gl_textureratio) + eastx, (area(x).yd / gl_textureratio) + easty glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale glEnd 'north wall glBegin GL_QUADS fc = 5 'corner 1 fx = tArea.x fy = tArea.y fz = tArea.z glColor3f red, green, blue glTexCoord2f (0 / gl_textureratio) + northx, (0 / gl_textureratio) + northy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 2 fx = tArea.x + tArea.xd fy = tArea.y fz = tArea.z glColor3f red, green, blue glTexCoord2f ((0 - area(x).xd) / gl_textureratio) + northx, (0 / gl_textureratio) + northy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 3 fx = tArea.x + tArea.xd fy = tArea.y + tArea.yd fz = tArea.z glColor3f red, green, blue glTexCoord2f ((0 - area(x).xd) / gl_textureratio) + northx, (area(x).yd / gl_textureratio) + northy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 4 fx = tArea.x fy = tArea.y + tArea.yd fz = tArea.z glColor3f red, green, blue glTexCoord2f (0 / gl_textureratio) + northx, (area(x).yd / gl_textureratio) + northy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale glEnd 'south wall glBegin GL_QUADS fc = 6 'corner 1 fx = tArea.x fy = tArea.y fz = tArea.z + tArea.zd glColor3f red, green, blue glTexCoord2f (0 / gl_textureratio) + southx, (0 / gl_textureratio) + southy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 2 fx = tArea.x + tArea.xd fy = tArea.y fz = tArea.z + tArea.zd glColor3f red, green, blue glTexCoord2f (area(x).xd / gl_textureratio) + southx, (0 / gl_textureratio) + southy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 3 fx = tArea.x + tArea.xd fy = tArea.y + tArea.yd fz = tArea.z + tArea.zd glColor3f red, green, blue glTexCoord2f (area(x).xd / gl_textureratio) + southx, (area(x).yd / gl_textureratio) + southy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 4 fx = tArea.x fy = tArea.y + tArea.yd fz = tArea.z + tArea.zd glColor3f red, green, blue glTexCoord2f (0 / gl_textureratio) + southx, (area(x).yd / gl_textureratio) + southy glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale glEnd 'end glass glDisable glcBlend End Sub Public Sub GL_DRAW_MISSILES() 'draw all the missiles from the database For A = 0 To MaxMissiles If missile(A).owner <> "" And missile(A).t >= 1 Then '-------------------------------------------------------------------------------------------------------- 'we will now draw standard projectiles, only half the guns require this 'we'll get the sprite, and if we cant find a sprite, we wont bother drawing it '0 here will mean don't draw it manSprite = 0 'is this a sprite we wish to draw? 'rockets depend on specials, not the gun If missile(A).t = 1 And missile(A).special = 1 Then manSprite = 5 'fans depend on specials, not the gun If missile(A).t = 2 And missile(A).special = 1 Then manSprite = 3 If missile(A).t = 2 And missile(A).special = 2 Then manSprite = 9 If missile(A).t = 2 And missile(A).special = 3 Then manSprite = 11 If missile(A).t = 2 And missile(A).special = 4 Then manSprite = 18 'grenades depend on gun If missile(A).t = 6 And missile(A).variation = 1 Then manSprite = 24 'forks and plasma, depend on gun If missile(A).t = 3 And missile(A).variation = 1 Then manSprite = 20 If missile(A).t = 3 And missile(A).variation = 2 Then manSprite = 22 'draw it? If manSprite >= 1 Then '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 'get information manX = missile(A).x manY = missile(A).y manZ = missile(A).z manHor = missile(A).hor manVer = missile(A).ver manBar = missile(A).bar manGun = missile(A).t manVariation = missile(A).variation manSpecial = missile(A).special 'bind the texture glBindTexture GL_TEXTURE_2D, texture(5) GRAB = sprite(manSprite) 'scale it ScaleSprite SPRITESCALE(manSprite) For x = 0 To GRAB.maxshapes 'flip vertical GRAB.y1(x) = 0 - GRAB.y1(x) GRAB.y2(x) = 0 - GRAB.y2(x) GRAB.y3(x) = 0 - GRAB.y3(x) GRAB.y4(x) = 0 - GRAB.y4(x) GRAB.y5(x) = 0 - GRAB.y5(x) GRAB.y6(x) = 0 - GRAB.y6(x) GRAB.y7(x) = 0 - GRAB.y7(x) GRAB.y8(x) = 0 - GRAB.y8(x) 'bar Rotate GRAB.x1(x), GRAB.y1(x), manBar Rotate GRAB.x2(x), GRAB.y2(x), manBar Rotate GRAB.x3(x), GRAB.y3(x), manBar Rotate GRAB.x4(x), GRAB.y4(x), manBar Rotate GRAB.x5(x), GRAB.y5(x), manBar Rotate GRAB.x6(x), GRAB.y6(x), manBar Rotate GRAB.x7(x), GRAB.y7(x), manBar Rotate GRAB.x8(x), GRAB.y8(x), manBar 'ver Rotate GRAB.z1(x), GRAB.y1(x), manVer Rotate GRAB.z2(x), GRAB.y2(x), manVer Rotate GRAB.z3(x), GRAB.y3(x), manVer Rotate GRAB.z4(x), GRAB.y4(x), manVer Rotate GRAB.z5(x), GRAB.y5(x), manVer Rotate GRAB.z6(x), GRAB.y6(x), manVer Rotate GRAB.z7(x), GRAB.y7(x), manVer Rotate GRAB.z8(x), GRAB.y8(x), manVer 'hor Rotate GRAB.x1(x), GRAB.z1(x), manHor Rotate GRAB.x2(x), GRAB.z2(x), manHor Rotate GRAB.x3(x), GRAB.z3(x), manHor Rotate GRAB.x4(x), GRAB.z4(x), manHor Rotate GRAB.x5(x), GRAB.z5(x), manHor Rotate GRAB.x6(x), GRAB.z6(x), manHor Rotate GRAB.x7(x), GRAB.z7(x), manHor Rotate GRAB.x8(x), GRAB.z8(x), manHor 'move to co-ordinates GRAB.x1(x) = GRAB.x1(x) + manX GRAB.x2(x) = GRAB.x2(x) + manX GRAB.x3(x) = GRAB.x3(x) + manX GRAB.x4(x) = GRAB.x4(x) + manX GRAB.x5(x) = GRAB.x5(x) + manX GRAB.x6(x) = GRAB.x6(x) + manX GRAB.x7(x) = GRAB.x7(x) + manX GRAB.x8(x) = GRAB.x8(x) + manX GRAB.y1(x) = GRAB.y1(x) + manY GRAB.y2(x) = GRAB.y2(x) + manY GRAB.y3(x) = GRAB.y3(x) + manY GRAB.y4(x) = GRAB.y4(x) + manY GRAB.y5(x) = GRAB.y5(x) + manY GRAB.y6(x) = GRAB.y6(x) + manY GRAB.y7(x) = GRAB.y7(x) + manY GRAB.y8(x) = GRAB.y8(x) + manY GRAB.z1(x) = GRAB.z1(x) + manZ GRAB.z2(x) = GRAB.z2(x) + manZ GRAB.z3(x) = GRAB.z3(x) + manZ GRAB.z4(x) = GRAB.z4(x) + manZ GRAB.z5(x) = GRAB.z5(x) + manZ GRAB.z6(x) = GRAB.z6(x) + manZ GRAB.z7(x) = GRAB.z7(x) + manZ GRAB.z8(x) = GRAB.z8(x) + manZ 'get real color red = GRAB.red(x): green = GRAB.green(x): blue = GRAB.blue(x) 'draw this individual shape in OpenGL DrawShape Next x '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% End If '-------------------------------------------------------------------------------------------------------- End If Next A End Sub Public Sub GL_DRAW_SLUGS() 'draw all the slugs for rail gun and possibly other stuff. 'set glass glBlendFunc dfOne, dfOne glEnable glcBlend glDisable glcDepthTest For x = 0 To MaxSlugs If slug(x).t = 1 Then '---------------------------------------------------------------------------- 'rail slug red = slug(x).red / 255 green = slug(x).green / 255 blue = slug(x).blue / 255 'draw it glBindTexture GL_TEXTURE_2D, texture(0) glBegin GL_LINES glColor3f red, green, blue glTexCoord2f 0, 0: glVertex3f slug(x).x1 / gl_scale, slug(x).y1 / gl_scale, slug(x).z1 / gl_scale glColor3f red, green, blue glTexCoord2f 1, 0: glVertex3f slug(x).x2 / gl_scale, slug(x).y2 / gl_scale, slug(x).z2 / gl_scale glEnd '---------------------------------------------------------------------------- End If Next x 'end glass glDisable glcBlend glEnable glcDepthTest End Sub Public Sub GL_DRAW_SMALLCONSOLE() glLoadIdentity glDisable glcDepthTest 'backdrop If CONF(SMALLCONSOLE_BACKDROP).value = 1 Then glBindTexture GL_TEXTURE_2D, texture(8) glBegin GL_QUADS red = CONF(BACKDROP_RED).value green = CONF(BACKDROP_GREEN).value blue = CONF(BACKDROP_BLUE).value glColor3f red, green, blue glTexCoord2f 0, 0: glVertex3f CONF(SMALLBACKDROP_LEFT).value, CONF(SMALLBACKDROP_BOTTOM).value, -4.2 glTexCoord2f 1, 0: glVertex3f CONF(SMALLBACKDROP_RIGHT).value, CONF(SMALLBACKDROP_BOTTOM).value, -4.2 glTexCoord2f 1, 1: glVertex3f CONF(SMALLBACKDROP_RIGHT).value, CONF(SMALLBACKDROP_TOP).value, -4.2 glTexCoord2f 0, 1: glVertex3f CONF(SMALLBACKDROP_LEFT).value, CONF(SMALLBACKDROP_TOP).value, -4.2 glEnd End If GLintValue = CONF(CONF_CONSOLEFONTSET).value 'previous writing zz = CONF(SMALLCONSOLE_MAXLINES).value For fern = 1 To zz shane = fern If ConsoleColor(shane + (100 - zz)) = 0 Then red = CONF(CONSOLE_RED).value: green = CONF(CONSOLE_GREEN).value: blue = CONF(CONSOLE_BLUE).value If ConsoleColor(shane + (100 - zz)) = 1 Then red = CONF(TALK_RED).value: green = CONF(TALK_GREEN).value: blue = CONF(TALK_BLUE).value If ConsoleColor(shane + (100 - zz)) = 2 Then red = CONF(ERROR_RED).value: green = CONF(ERROR_GREEN).value: blue = CONF(ERROR_BLUE).value If ConsoleColor(shane + (100 - zz)) = 3 Then red = CONF(DATA_RED).value: green = CONF(DATA_GREEN).value: blue = CONF(DATA_BLUE).value If ConsoleColor(shane + (100 - zz)) = 4 Then red = CONF(INPUT_RED).value: green = CONF(INPUT_GREEN).value: blue = CONF(INPUT_BLUE).value glColor3f red, green, blue shane2 = shane + CONF(SMALLCONSOLE_OFFSET).value shanex = CONF(SMALLCONSOLE_MARGIN).value glPrint shanex, shane2, (ConsoleLine$(shane + (100 - zz)) & " "), GLintValue Next fern 'typing area red = CONF(INPUT_RED).value: green = CONF(INPUT_GREEN).value: blue = CONF(INPUT_BLUE).value glColor3f red, green, blue curs$ = WCONF(CONSOLE_INPUT).CHAR: If CursorFlash > CONF(CONF_FLASHSWITCH).value Then curs$ = " " shanex = CONF(SMALLINPUT_MARGIN).value shaney = CONF(SMALLINPUT_Y).value glPrint shanex, shaney, WCONF(CONSOLE_ARROW).CHAR & glCinput$ & curs$, GLintValue 'suggestion bar If CONF(AUTO_SUGGEST).value = 1 Then red = CONF(DATA_RED).value: green = CONF(DATA_GREEN).value: blue = CONF(DATA_BLUE).value glColor3f red, green, blue GLintValue = CONF(SUGGEST_FONTSET).value shanex = CONF(SMALLINPUT_MARGIN).value shaney = CONF(SMALLINPUT_Y).value + 1 glPrint shanex, shaney, AutoSuggestion$, GLintValue End If 'cursor flash CURSOR_FLASH End Sub Public Sub BUILD_WORLD_LIST() TheWorld = glGenLists(1) glNewList TheWorld, lstCompile 'glLoadIdentity glBindTexture GL_TEXTURE_2D, texture(0) GetMaxValues GL_DRAW_WORLD glEndList End Sub Public Sub GL_DRAW_SPHERES() 'draw the spheres Dim GL_SPHERESLICES As GLint Dim GL_SPHERESTACKS As GLint GL_SPHERESLICES = CONF(SPHERE_SLICES).value GL_SPHERESTACKS = CONF(SPHERE_STACKS).value For x = 0 To MaxSpheres 'texture glBindTexture GL_TEXTURE_2D, texture(sphere(x).texture) 'color red = CONF(SPHERE_RED).value green = CONF(SPHERE_GREEN).value blue = CONF(SPHERE_BLUE).value glColor3f red, green, blue 'scale gl_scale = CONF(CONF_SCALE).value 'draw it glTranslatef sphere(x).x / gl_scale, sphere(x).y / gl_scale, sphere(x).z / gl_scale glRotatef (90), 1, 0, 0 gluSphere quadratic, (sphere(x).radius / 2) / gl_scale, GL_SPHERESLICES, GL_SPHERESTACKS glRotatef (0 - 90), 1, 0, 0 glTranslatef 0 - (sphere(x).x / gl_scale), 0 - (sphere(x).y / gl_scale), 0 - (sphere(x).z / gl_scale) glEnd NEWBLOCK = 0 Next x End Sub Public Sub GL_DRAW_TAB_SCORES() 'draw the tab scores when we hold the scores key, which is usually TAB Dim TextX As GLdouble Dim TextXscore As GLdouble Dim TextY As GLdouble Dim TEA As Integer Dim TeamColor As Integer Dim TotalPersons As Integer Dim iAvatarTop As Double Dim iAvatarLeft As Double iX = 0 iY = 0 iWord = "" iFontSet = 0 iFontX = 0 iFontY = 0 'TEMPORARY PLAYER_AVATAR = "main/texture/personal_avatar.jpg" 'and avatar listing defaults iAvatarLeft = CONF(AVATAR_LEFT).value iAvatarTop = CONF(AVATAR_TOP).value 'set the top left start point TextX = CONF(TABS_LEFT).value TextY = CONF(TABS_TOP).value TextXscore = CONF(TABS_LEFT).value + CONF(TABS_SCORESPACING).value 'set the fontset as an integer iFontSet = CONF(TABS_FONTSET).value iFontX = CONF(TABS_FONTX).value iFontY = CONF(TABS_FONTY).value TotalPersons = 0 'start a loop to draw teams 1-4 For TEA = 1 To 4 'count persons per team 'get color If TEA = 1 Then TeamColor = CONF(TEAM_COLOR1).value If TEA = 2 Then TeamColor = CONF(TEAM_COLOR2).value If TEA = 3 Then TeamColor = CONF(TEAM_COLOR3).value If TEA = 4 Then TeamColor = CONF(TEAM_COLOR4).value 'are you in this team? If PLAYER_TEAM = TEA Then 'write you glColor3f ProRed(TeamColor) / 255, ProGreen(TeamColor) / 255, ProBlue(TeamColor) / 255 iX = TextX: iY = TextY iWord = WCONF(PLAYER_NAME).CHAR glPrintCustom iX, iY, iWord, iFontSet, iFontX, iFontY iX = TextXscore: iY = TextY iWord = PLAYER_SCORE glPrintCustom iX, iY, iWord, iFontSet, iFontX, iFontY 'avatar? If CONF(DRAW_AVATARS).value = 1 Then If PLAYER_AVATAR <> "" Or CONF(IGNORE_UNKNOWN_AVATARS).value = 0 Then DrawAvatar iAvatarLeft, iAvatarTop, CONF(AVATAR_WIDTH).value, CONF(AVATAR_HEIGHT).value, MAX_TEXTURES, CONF(AVATAR_RED).value, CONF(AVATAR_GREEN).value, CONF(AVATAR_BLUE).value End If End If TextY = TextY + CONF(TABS_SPACING).value iAvatarTop = iAvatarTop + CONF(AVATAR_SPACING).value TotalPersons = TotalPersons + 1 End If For x = 0 To MaxPeople 'write this guy If person(x).Team = TEA Then glColor3f ProRed(TeamColor) / 255, ProGreen(TeamColor) / 255, ProBlue(TeamColor) / 255 iX = TextX: iY = TextY iWord = person(x).Name glPrintCustom iX, iY, iWord, iFontSet, iFontX, iFontY iX = TextXscore: iY = TextY iWord = person(x).Score glPrintCustom iX, iY, iWord, iFontSet, iFontX, iFontY 'avatar? If CONF(DRAW_AVATARS).value = 1 Then If person(x).Avatar <> "" Or CONF(IGNORE_UNKNOWN_AVATARS).value = 0 Then DrawAvatar iAvatarLeft, iAvatarTop, CONF(AVATAR_WIDTH).value, CONF(AVATAR_HEIGHT).value, (PLAYER_START_TEXTURE + x), CONF(AVATAR_RED).value, CONF(AVATAR_GREEN).value, CONF(AVATAR_BLUE).value End If End If TextY = TextY + CONF(TABS_SPACING).value iAvatarTop = iAvatarTop + CONF(AVATAR_SPACING).value TotalPersons = TotalPersons + 1 End If Next x Next TEA 'spacer here if someone is in a team If TotalPersons > 0 Then TextY = TextY + CONF(TABS_SPACING).value iAvatarTop = iAvatarTop + CONF(AVATAR_SPACING).value End If 'spectators and idle TEA = 0 TeamColor = CONF(TEAM_COLORIDLE).value 'are you in this team? If PLAYER_TEAM = TEA Then 'write you glColor3f ProRed(TeamColor) / 255, ProGreen(TeamColor) / 255, ProBlue(TeamColor) / 255 iX = TextX: iY = TextY iWord = WCONF(PLAYER_NAME).CHAR glPrintCustom iX, iY, iWord, iFontSet, iFontX, iFontY 'avatar? If CONF(DRAW_AVATARS).value = 1 Then If PLAYER_AVATAR <> "" Or CONF(IGNORE_UNKNOWN_AVATARS).value = 0 Then DrawAvatar iAvatarLeft, iAvatarTop, CONF(AVATAR_WIDTH).value, CONF(AVATAR_HEIGHT).value, MAX_TEXTURES, CONF(AVATAR_RED).value, CONF(AVATAR_GREEN).value, CONF(AVATAR_BLUE).value End If End If TextY = TextY + CONF(TABS_SPACING).value iAvatarTop = iAvatarTop + CONF(AVATAR_SPACING).value End If For x = 0 To MaxPeople 'write this guy If person(x).Team = TEA Then glColor3f ProRed(TeamColor) / 255, ProGreen(TeamColor) / 255, ProBlue(TeamColor) / 255 iX = TextX: iY = TextY iWord = person(x).Name glPrintCustom iX, iY, iWord, iFontSet, iFontX, iFontY 'avatar? If CONF(DRAW_AVATARS).value = 1 Then If person(x).Avatar <> "" Or CONF(IGNORE_UNKNOWN_AVATARS).value = 0 Then DrawAvatar iAvatarLeft, iAvatarTop, CONF(AVATAR_WIDTH).value, CONF(AVATAR_HEIGHT).value, (PLAYER_START_TEXTURE + x), CONF(AVATAR_RED).value, CONF(AVATAR_GREEN).value, CONF(AVATAR_BLUE).value End If End If TextY = TextY + CONF(TABS_SPACING).value iAvatarTop = iAvatarTop + CONF(AVATAR_SPACING).value End If Next x Exit Sub End Sub Public Sub GL_DRAW_GUN() 'draw your gun glLoadIdentity glClear GL_DEPTH_BUFFER_BIT 'bind the texture glBindTexture GL_TEXTURE_2D, texture(CONF(GUN_TEXTURE).value) 'local gun LocalGun = 1 'work out which sprite GetGunSprite PLAYER_GUN, PLAYER_VARIATION, PLAYER_SPECIAL 'draw it if it's found----------------------------------------> If manSprite > -1 Then 'grab it GRAB = sprite(manSprite) 'scale it ScaleSprite SPRITESCALE(manSprite) 'scale it again by the customized gun scale ScaleSprite CONF(GUN_SCALE).value For x = 0 To GRAB.maxshapes 'flip vertical GRAB.y1(x) = 0 - GRAB.y1(x) GRAB.y2(x) = 0 - GRAB.y2(x) GRAB.y3(x) = 0 - GRAB.y3(x) GRAB.y4(x) = 0 - GRAB.y4(x) GRAB.y5(x) = 0 - GRAB.y5(x) GRAB.y6(x) = 0 - GRAB.y6(x) GRAB.y7(x) = 0 - GRAB.y7(x) GRAB.y8(x) = 0 - GRAB.y8(x) 'bar (+ recoil) Rotate GRAB.x1(x), GRAB.y1(x), (CONF(GUN_BAR).value + (RECOIL * CONF(RECOIL_BAR).value) + (CONF(CHANGE_GUN_BAR).value * GUN_SPRING)) Rotate GRAB.x2(x), GRAB.y2(x), (CONF(GUN_BAR).value + (RECOIL * CONF(RECOIL_BAR).value) + (CONF(CHANGE_GUN_BAR).value * GUN_SPRING)) Rotate GRAB.x3(x), GRAB.y3(x), (CONF(GUN_BAR).value + (RECOIL * CONF(RECOIL_BAR).value) + (CONF(CHANGE_GUN_BAR).value * GUN_SPRING)) Rotate GRAB.x4(x), GRAB.y4(x), (CONF(GUN_BAR).value + (RECOIL * CONF(RECOIL_BAR).value) + (CONF(CHANGE_GUN_BAR).value * GUN_SPRING)) Rotate GRAB.x5(x), GRAB.y5(x), (CONF(GUN_BAR).value + (RECOIL * CONF(RECOIL_BAR).value) + (CONF(CHANGE_GUN_BAR).value * GUN_SPRING)) Rotate GRAB.x6(x), GRAB.y6(x), (CONF(GUN_BAR).value + (RECOIL * CONF(RECOIL_BAR).value) + (CONF(CHANGE_GUN_BAR).value * GUN_SPRING)) Rotate GRAB.x7(x), GRAB.y7(x), (CONF(GUN_BAR).value + (RECOIL * CONF(RECOIL_BAR).value) + (CONF(CHANGE_GUN_BAR).value * GUN_SPRING)) Rotate GRAB.x8(x), GRAB.y8(x), (CONF(GUN_BAR).value + (RECOIL * CONF(RECOIL_BAR).value) + (CONF(CHANGE_GUN_BAR).value * GUN_SPRING)) 'ver Rotate GRAB.z1(x), GRAB.y1(x), (CONF(GUN_VER).value + (RECOIL * CONF(RECOIL_VER).value) + (CONF(CHANGE_GUN_VER).value * GUN_SPRING)) Rotate GRAB.z2(x), GRAB.y2(x), (CONF(GUN_VER).value + (RECOIL * CONF(RECOIL_VER).value) + (CONF(CHANGE_GUN_VER).value * GUN_SPRING)) Rotate GRAB.z3(x), GRAB.y3(x), (CONF(GUN_VER).value + (RECOIL * CONF(RECOIL_VER).value) + (CONF(CHANGE_GUN_VER).value * GUN_SPRING)) Rotate GRAB.z4(x), GRAB.y4(x), (CONF(GUN_VER).value + (RECOIL * CONF(RECOIL_VER).value) + (CONF(CHANGE_GUN_VER).value * GUN_SPRING)) Rotate GRAB.z5(x), GRAB.y5(x), (CONF(GUN_VER).value + (RECOIL * CONF(RECOIL_VER).value) + (CONF(CHANGE_GUN_VER).value * GUN_SPRING)) Rotate GRAB.z6(x), GRAB.y6(x), (CONF(GUN_VER).value + (RECOIL * CONF(RECOIL_VER).value) + (CONF(CHANGE_GUN_VER).value * GUN_SPRING)) Rotate GRAB.z7(x), GRAB.y7(x), (CONF(GUN_VER).value + (RECOIL * CONF(RECOIL_VER).value) + (CONF(CHANGE_GUN_VER).value * GUN_SPRING)) Rotate GRAB.z8(x), GRAB.y8(x), (CONF(GUN_VER).value + (RECOIL * CONF(RECOIL_VER).value) + (CONF(CHANGE_GUN_VER).value * GUN_SPRING)) 'hor Rotate GRAB.x1(x), GRAB.z1(x), 180 + (CONF(GUN_HOR).value + (RECOIL * CONF(RECOIL_HOR).value) + (CONF(CHANGE_GUN_HOR).value * GUN_SPRING)) Rotate GRAB.x2(x), GRAB.z2(x), 180 + (CONF(GUN_HOR).value + (RECOIL * CONF(RECOIL_HOR).value) + (CONF(CHANGE_GUN_HOR).value * GUN_SPRING)) Rotate GRAB.x3(x), GRAB.z3(x), 180 + (CONF(GUN_HOR).value + (RECOIL * CONF(RECOIL_HOR).value) + (CONF(CHANGE_GUN_HOR).value * GUN_SPRING)) Rotate GRAB.x4(x), GRAB.z4(x), 180 + (CONF(GUN_HOR).value + (RECOIL * CONF(RECOIL_HOR).value) + (CONF(CHANGE_GUN_HOR).value * GUN_SPRING)) Rotate GRAB.x5(x), GRAB.z5(x), 180 + (CONF(GUN_HOR).value + (RECOIL * CONF(RECOIL_HOR).value) + (CONF(CHANGE_GUN_HOR).value * GUN_SPRING)) Rotate GRAB.x6(x), GRAB.z6(x), 180 + (CONF(GUN_HOR).value + (RECOIL * CONF(RECOIL_HOR).value) + (CONF(CHANGE_GUN_HOR).value * GUN_SPRING)) Rotate GRAB.x7(x), GRAB.z7(x), 180 + (CONF(GUN_HOR).value + (RECOIL * CONF(RECOIL_HOR).value) + (CONF(CHANGE_GUN_HOR).value * GUN_SPRING)) Rotate GRAB.x8(x), GRAB.z8(x), 180 + (CONF(GUN_HOR).value + (RECOIL * CONF(RECOIL_HOR).value) + (CONF(CHANGE_GUN_HOR).value * GUN_SPRING)) 'move to co-ordinates AND to recoil additions GRAB.x1(x) = GRAB.x1(x) + CONF(GUN_X).value + (RECOIL * CONF(RECOIL_X).value) + (CONF(CHANGE_GUN_X).value * GUN_SPRING) GRAB.x2(x) = GRAB.x2(x) + CONF(GUN_X).value + (RECOIL * CONF(RECOIL_X).value) + (CONF(CHANGE_GUN_X).value * GUN_SPRING) GRAB.x3(x) = GRAB.x3(x) + CONF(GUN_X).value + (RECOIL * CONF(RECOIL_X).value) + (CONF(CHANGE_GUN_X).value * GUN_SPRING) GRAB.x4(x) = GRAB.x4(x) + CONF(GUN_X).value + (RECOIL * CONF(RECOIL_X).value) + (CONF(CHANGE_GUN_X).value * GUN_SPRING) GRAB.x5(x) = GRAB.x5(x) + CONF(GUN_X).value + (RECOIL * CONF(RECOIL_X).value) + (CONF(CHANGE_GUN_X).value * GUN_SPRING) GRAB.x6(x) = GRAB.x6(x) + CONF(GUN_X).value + (RECOIL * CONF(RECOIL_X).value) + (CONF(CHANGE_GUN_X).value * GUN_SPRING) GRAB.x7(x) = GRAB.x7(x) + CONF(GUN_X).value + (RECOIL * CONF(RECOIL_X).value) + (CONF(CHANGE_GUN_X).value * GUN_SPRING) GRAB.x8(x) = GRAB.x8(x) + CONF(GUN_X).value + (RECOIL * CONF(RECOIL_X).value) + (CONF(CHANGE_GUN_X).value * GUN_SPRING) GRAB.y1(x) = GRAB.y1(x) + CONF(GUN_Y).value + (RECOIL * CONF(RECOIL_Y).value) + (CONF(CHANGE_GUN_Y).value * GUN_SPRING) GRAB.y2(x) = GRAB.y2(x) + CONF(GUN_Y).value + (RECOIL * CONF(RECOIL_Y).value) + (CONF(CHANGE_GUN_Y).value * GUN_SPRING) GRAB.y3(x) = GRAB.y3(x) + CONF(GUN_Y).value + (RECOIL * CONF(RECOIL_Y).value) + (CONF(CHANGE_GUN_Y).value * GUN_SPRING) GRAB.y4(x) = GRAB.y4(x) + CONF(GUN_Y).value + (RECOIL * CONF(RECOIL_Y).value) + (CONF(CHANGE_GUN_Y).value * GUN_SPRING) GRAB.y5(x) = GRAB.y5(x) + CONF(GUN_Y).value + (RECOIL * CONF(RECOIL_Y).value) + (CONF(CHANGE_GUN_Y).value * GUN_SPRING) GRAB.y6(x) = GRAB.y6(x) + CONF(GUN_Y).value + (RECOIL * CONF(RECOIL_Y).value) + (CONF(CHANGE_GUN_Y).value * GUN_SPRING) GRAB.y7(x) = GRAB.y7(x) + CONF(GUN_Y).value + (RECOIL * CONF(RECOIL_Y).value) + (CONF(CHANGE_GUN_Y).value * GUN_SPRING) GRAB.y8(x) = GRAB.y8(x) + CONF(GUN_Y).value + (RECOIL * CONF(RECOIL_Y).value) + (CONF(CHANGE_GUN_Y).value * GUN_SPRING) GRAB.z1(x) = GRAB.z1(x) + CONF(GUN_Z).value + (RECOIL * CONF(RECOIL_Z).value) + (CONF(CHANGE_GUN_Z).value * GUN_SPRING) GRAB.z2(x) = GRAB.z2(x) + CONF(GUN_Z).value + (RECOIL * CONF(RECOIL_Z).value) + (CONF(CHANGE_GUN_Z).value * GUN_SPRING) GRAB.z3(x) = GRAB.z3(x) + CONF(GUN_Z).value + (RECOIL * CONF(RECOIL_Z).value) + (CONF(CHANGE_GUN_Z).value * GUN_SPRING) GRAB.z4(x) = GRAB.z4(x) + CONF(GUN_Z).value + (RECOIL * CONF(RECOIL_Z).value) + (CONF(CHANGE_GUN_Z).value * GUN_SPRING) GRAB.z5(x) = GRAB.z5(x) + CONF(GUN_Z).value + (RECOIL * CONF(RECOIL_Z).value) + (CONF(CHANGE_GUN_Z).value * GUN_SPRING) GRAB.z6(x) = GRAB.z6(x) + CONF(GUN_Z).value + (RECOIL * CONF(RECOIL_Z).value) + (CONF(CHANGE_GUN_Z).value * GUN_SPRING) GRAB.z7(x) = GRAB.z7(x) + CONF(GUN_Z).value + (RECOIL * CONF(RECOIL_Z).value) + (CONF(CHANGE_GUN_Z).value * GUN_SPRING) GRAB.z8(x) = GRAB.z8(x) + CONF(GUN_Z).value + (RECOIL * CONF(RECOIL_Z).value) + (CONF(CHANGE_GUN_Z).value * GUN_SPRING) 'remember all points in case of reference later REFERENCE.x1(x) = GRAB.x1(x) REFERENCE.y1(x) = GRAB.y1(x) REFERENCE.z1(x) = GRAB.z1(x) 'get real color red = GRAB.red(x): green = GRAB.green(x): blue = GRAB.blue(x) 'draw this individual shape in OpenGL DrawShape Next x 'draw our variation, use the same sub as the character gun variation, to save code manGun = PLAYER_GUN manVariation = PLAYER_VARIATION manSpecial = PLAYER_SPECIAL manHor = CONF(GUN_HOR).value + 180 manVer = CONF(GUN_VER).value manBar = CONF(GUN_BAR).value DrawVariations End If End Sub Public Sub GL_DRAW_WORLD() For x = 0 To BLOCKS If block(x).t <> 0 Then red = 1: green = 1: blue = 1 gl_scale = CONF(CONF_SCALE).value gl_textureratio = CONF(CONF_TEXTURERATIO).value 'top roof glBindTexture GL_TEXTURE_2D, texture(block(x).texture6) glBegin GL_QUADS fc = 1 'corner 1 fx = block(x).x fy = block(x).y fz = block(x).z pn = 1: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f 0 / gl_textureratio, 0 / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 2 fx = block(x).x + block(x).xd fy = block(x).y fz = block(x).z pn = 1: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f block(x).xd / gl_textureratio, 0 / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 3 fx = block(x).x + block(x).xd fy = block(x).y fz = block(x).z + block(x).zd pn = 1: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f block(x).xd / gl_textureratio, block(x).zd / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 4 fx = block(x).x fy = block(x).y fz = block(x).z + block(x).zd pn = 1: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f 0 / gl_textureratio, block(x).zd / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale glEnd 'bottom floor glBindTexture GL_TEXTURE_2D, texture(block(x).texture5) glBegin GL_QUADS fc = 2 'corner 1 fx = block(x).x fy = block(x).y + block(x).yd fz = block(x).z pn = 0: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f 0 / gl_textureratio, 0 / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 2 fx = block(x).x + block(x).xd fy = block(x).y + block(x).yd fz = block(x).z pn = 0: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f (0 - block(x).xd) / gl_textureratio, 0 / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 3 fx = block(x).x + block(x).xd fy = block(x).y + block(x).yd fz = block(x).z + block(x).zd pn = 0: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f (0 - block(x).xd) / gl_textureratio, block(x).zd / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 4 fx = block(x).x fy = block(x).y + block(x).yd fz = block(x).z + block(x).zd pn = 0: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f 0 / gl_textureratio, block(x).zd / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale glEnd 'west wall glBindTexture GL_TEXTURE_2D, texture(block(x).texture1) glBegin GL_QUADS fc = 3 'corner 1 fx = block(x).x fy = block(x).y fz = block(x).z + block(x).zd pn = 1: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f 0 / gl_textureratio, 0 / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 2 fx = block(x).x fy = block(x).y fz = block(x).z pn = 2: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f (0 - block(x).zd) / gl_textureratio, 0 / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 3 fx = block(x).x fy = block(x).y + block(x).yd fz = block(x).z pn = 3: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f (0 - block(x).zd) / gl_textureratio, block(x).yd / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 4 fx = block(x).x fy = block(x).y + block(x).yd fz = block(x).z + block(x).zd pn = 4: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f 0 / gl_textureratio, block(x).yd / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale glEnd 'east wall glBindTexture GL_TEXTURE_2D, texture(block(x).texture3) glBegin GL_QUADS fc = 4 'corner 1 fx = block(x).x + block(x).xd fy = block(x).y fz = block(x).z + block(x).zd pn = 1: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f 0 / gl_textureratio, 0 / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 2 fx = block(x).x + block(x).xd fy = block(x).y fz = block(x).z pn = 2: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f block(x).zd / gl_textureratio, 0 / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 3 fx = block(x).x + block(x).xd fy = block(x).y + block(x).yd fz = block(x).z pn = 3: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f block(x).zd / gl_textureratio, block(x).yd / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 4 fx = block(x).x + block(x).xd fy = block(x).y + block(x).yd fz = block(x).z + block(x).zd pn = 4: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f 0 / gl_textureratio, block(x).yd / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale glEnd 'north wall glBindTexture GL_TEXTURE_2D, texture(block(x).texture2) glBegin GL_QUADS fc = 5 'corner 1 fx = block(x).x fy = block(x).y fz = block(x).z pn = 1: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f 0 / gl_textureratio, 0 / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 2 fx = block(x).x + block(x).xd fy = block(x).y fz = block(x).z pn = 2: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f (0 - block(x).xd) / gl_textureratio, 0 / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 3 fx = block(x).x + block(x).xd fy = block(x).y + block(x).yd fz = block(x).z pn = 3: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f (0 - block(x).xd) / gl_textureratio, block(x).yd / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 4 fx = block(x).x fy = block(x).y + block(x).yd fz = block(x).z pn = 4: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f 0 / gl_textureratio, block(x).yd / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale glEnd 'south wall glBindTexture GL_TEXTURE_2D, texture(block(x).texture4) glBegin GL_QUADS fc = 6 'corner 1 fx = block(x).x fy = block(x).y fz = block(x).z + block(x).zd pn = 1: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f 0 / gl_textureratio, 0 / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 2 fx = block(x).x + block(x).xd fy = block(x).y fz = block(x).z + block(x).zd pn = 2: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f block(x).xd / gl_textureratio, 0 / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 3 fx = block(x).x + block(x).xd fy = block(x).y + block(x).yd fz = block(x).z + block(x).zd pn = 3: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f block(x).xd / gl_textureratio, block(x).yd / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale 'corner 4 fx = block(x).x fy = block(x).y + block(x).yd fz = block(x).z + block(x).zd pn = 4: If CONF(CONF_PLANE_SHADING).value = 1 Then PLANE_SHADING glColor3f red, green, blue glTexCoord2f 0 / gl_textureratio, block(x).yd / gl_textureratio glVertex3f fx / gl_scale, fy / gl_scale, fz / gl_scale glEnd End If Next x End Sub Public Sub GL_DRAW_SPARKS() Dim sx1, sy1, sz1 As Double Dim sx2, sy2, sz2 As Double Dim sx3, sy3, sz3 As Double Dim sx4, sy4, sz4 As Double glBindTexture GL_TEXTURE_2D, texture(6) 'set glass glBlendFunc dfOne, dfOne glEnable glcBlend glDisable glcDepthTest For z = 0 To MaxSparks If spark(z).orbit > 0 Then col = spark(z).power * 0.01 If col >= 1 Then col = 1 If col <= 0 Then col = 0 red = col * spark(z).red green = col * spark(z).green blue = col * spark(z).blue sx1 = 0 - ((spark(z).size * 0.002) * 0.4) sx2 = 0 + ((spark(z).size * 0.002) * 0.4) sx3 = 0 + ((spark(z).size * 0.002) * 0.4) sx4 = 0 - ((spark(z).size * 0.002) * 0.4) sy1 = 0 + ((spark(z).size * 0.002) * 0.4) sy2 = 0 + ((spark(z).size * 0.002) * 0.4) sy3 = 0 - ((spark(z).size * 0.002) * 0.4) sy4 = 0 - ((spark(z).size * 0.002) * 0.4) sz1 = 0 sz2 = 0 sz3 = 0 sz4 = 0 'rotation here to make it face camera--> Rotate sz1, sy1, (0 + CameraVer) Rotate sx1, sz1, (0 + CameraHor) 'Rotate sx1, sy1, (0 + camerabar) Rotate sz2, sy2, (0 + CameraVer) Rotate sx2, sz2, (0 + CameraHor) Rotate sz3, sy3, (0 + CameraVer) Rotate sx3, sz3, (0 + CameraHor) Rotate sz4, sy4, (0 + CameraVer) Rotate sx4, sz4, (0 + CameraHor) 'add co-ordinates sx1 = sx1 + spark(z).x sx2 = sx2 + spark(z).x sx3 = sx3 + spark(z).x sx4 = sx4 + spark(z).x sy1 = sy1 + spark(z).y sy2 = sy2 + spark(z).y sy3 = sy3 + spark(z).y sy4 = sy4 + spark(z).y sz1 = sz1 + spark(z).z sz2 = sz2 + spark(z).z sz3 = sz3 + spark(z).z sz4 = sz4 + spark(z).z glColor3f red, green, blue glBegin GL_QUADS glTexCoord2f 0, 0: glVertex3f sx1 / gl_scale, sy1 / gl_scale, sz1 / gl_scale glTexCoord2f 1, 0: glVertex3f sx2 / gl_scale, sy2 / gl_scale, sz2 / gl_scale glTexCoord2f 1, 1: glVertex3f sx3 / gl_scale, sy3 / gl_scale, sz3 / gl_scale glTexCoord2f 0, 1: glVertex3f sx4 / gl_scale, sy4 / gl_scale, sz4 / gl_scale glEnd 'do physics here, to save more cpu With spark(z) .x = .x + (.speedx * NL) .y = .y + (.speedy * NL) .z = .z + (.speedz * NL) .power = .power - (.fadespeed * NL) If .power <= 0 Then orbit = 0 .orbit = .orbit - NL If .orbit <= 0 Then .orbit = 0 If z = MaxSparks Then MaxSparks = MaxSparks - 1 If MaxSparks <= 0 Then MaxSparks = 0 End If End With End If Next z 'end glass glDisable glcBlend glEnable glcDepthTest End SubOption Explicit 'PRO 'By Dano Wilson 'OPENGL ENGINE Private Declare Function EnumDisplaySettings Lib "user32" Alias "EnumDisplaySettingsA" (ByVal lpszDeviceName As Long, ByVal iModeNum As Long, lpDevMode As Any) As Boolean Private Declare Function ChangeDisplaySettings Lib "user32" Alias "ChangeDisplaySettingsA" (lpDevMode As Any, ByVal dwflags As Long) As Long Private Declare Function CreateIC Lib "gdi32" Alias "CreateICA" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, ByVal lpInitData As Long) As Long Private Const CCDEVICENAME = 32 Private Const CCFORMNAME = 32 Private Const DM_BITSPERPEL = &H40000 Private Const DM_PELSWIDTH = &H80000 Private Const DM_PELSHEIGHT = &H100000 Private Type DEVMODE dmDeviceName As String * CCDEVICENAME dmSpecVersion As Integer dmDriverVersion As Integer dmSize As Integer dmDriverExtra As Integer dmFields As Long dmOrientation As Integer dmPaperSize As Integer dmPaperLength As Integer dmPaperWidth As Integer dmScale As Integer dmCopies As Integer dmDefaultSource As Integer dmPrintQuality As Integer dmColor As Integer dmDuplex As Integer dmYResolution As Integer dmTTOption As Integer dmCollate As Integer dmFormName As String * CCFORMNAME dmUnusedPadding As Integer dmBitsPerPel As Integer dmPelsWidth As Long dmPelsHeight As Long dmDisplayFlags As Long dmDisplayFrequency As Long End Type Public Active As Boolean Private hrc As Long Private fullscreen As Boolean Public base As GLuint Public mloop As GLuint Public cnt1 As GLfloat Public cnt2 As GLfloat Public quadratic As GLUquadricObj Public mobject As GLuint 'texture data Public texture(MAX_TEXTURES) As GLuint Public TEX As Integer Global TextureBMP$(MAX_TEXTURES) Global picmap Private OldWidth As Long Private OldHeight As Long Private OldBits As Long Private OldVertRefresh As Long Private mPointerCount As Integer Global gl_modex As Integer 'screen res across Global gl_modey As Integer 'screen res down Global gl_colorbits As Integer 'color bits (16/32 usually) Global gl_depthbits As Integer 'depth bits (16 usually) Global gl_fontx As GLdouble Global gl_fonty As GLdouble Global Height, Width, FOV Global g_crosshairscreenx As GLdouble Global g_crosshairscreeny As GLdouble 'world list Global TheWorld As GLuint Public Sub BuildFont() Dim cx As Double Dim cy As Double Dim i As Integer base = glGenLists(256) glBindTexture glTexture2D, texture(7) For i = 0 To 255 cx = (i Mod 16) / 16# cy = (i \ 16) / 16# glNewList base + i, lstCompile glBegin bmQuads glTexCoord2f cx, 1 - cy - 0.0625 glVertex2i 0, 0 glTexCoord2f cx + 0.0625, 1 - cy - 0.0625 glVertex2i 16, 0 glTexCoord2f cx + 0.0625, 1 - cy glVertex2i 16, 16 glTexCoord2f cx, 1 - cy glVertex2i 0, 16 glEnd glTranslated 10, 0, 0 glEndList Next i End Sub Private Sub KillFont() glDeleteLists base, 256 End Sub Public Sub glPrint(fntx, fnty, s As String, sset As Integer) 'make it so that 1,1 is the top left corner, and 1,36 would be the bottom left fntx = fntx - 1: fnty = fnty - 1 fntx = fntx * 16 fnty = 36 - fnty fnty = fnty * 16 glEnable glcBlend If (sset > 1) Then sset = 1 End If glBindTexture GL_TEXTURE_2D, texture(7) glDisable GL_DEPTH_TEST glMatrixMode GL_PROJECTION glPushMatrix gl_fontx = CONF(FONT_MODEX).value gl_fonty = CONF(FONT_MODEY).value glLoadIdentity glOrtho 0, gl_fontx, 0, gl_fonty, -1, 1 glMatrixMode GL_MODELVIEW glPushMatrix glLoadIdentity glTranslated fntx, fnty, 0 glListBase base - 32 + 128 * sset Dim B() As Byte Dim i As Integer Dim length As Double ReDim B(Len(s)) For i = 1 To Len(s) B(i - 1) = Asc(Mid$(s, i, 1)) Next B(Len(s)) = 0 glCallLists Len(s), GL_BYTE, B(0) glMatrixMode GL_PROJECTION glPopMatrix glMatrixMode GL_MODELVIEW glPopMatrix glEnable GL_DEPTH_TEST glDisable glcBlend End Sub Public Sub glPrintCustom(fntx, fnty, s As String, sset As Integer, ScreenX, ScreenY) fntx = fntx - 1: fnty = fnty - 1 fntx = fntx * 16 fnty = 36 - fnty fnty = fnty * 16 glEnable glcBlend If (sset > 1) Then sset = 1 End If glBindTexture GL_TEXTURE_2D, texture(7) glDisable GL_DEPTH_TEST glMatrixMode GL_PROJECTION glPushMatrix gl_fontx = ScreenX gl_fonty = ScreenY glLoadIdentity glOrtho 0, gl_fontx, 0, gl_fonty, -1, 1 glMatrixMode GL_MODELVIEW glPushMatrix glLoadIdentity glTranslated fntx, fnty, 0 glListBase base - 32 + 128 * sset Dim BEE() As Byte Dim i As Integer Dim length As Double ReDim BEE(Len(s)) For i = 1 To Len(s) BEE(i - 1) = Asc(Mid$(s, i, 1)) Next BEE(Len(s)) = 0 glCallLists Len(s), GL_BYTE, BEE(0) glMatrixMode GL_PROJECTION glPopMatrix glMatrixMode GL_MODELVIEW glPopMatrix glEnable GL_DEPTH_TEST glDisable glcBlend End Sub Private Sub HidePointer() 'hide the cursor (mouse pointer) mPointerCount = ShowCursor(False) + 1 Do While ShowCursor(False) >= -1 Loop Do While ShowCursor(True) <= -1 Loop ShowCursor False End Sub Private Sub ShowPointer() 'show the cursor (mouse pointer) Do While ShowCursor(False) >= mPointerCount Loop Do While ShowCursor(True) <= mPointerCount Loop End Sub Private Function LoadBMP(ByVal filename As String, ByRef texture() As GLuint, ByRef Height As Long, ByRef Width As Long) As Boolean Dim intFileHandle As Integer Dim bitmapheight As Long Dim bitmapwidth As Long If filename = "" Then End End If If UCase(Right(filename, 3)) = "BMP" Then PRO.Picture1.Picture = LoadPicture(filename) CreateTextureMapFromImage PRO.Picture1, texture(), Height, Width ElseIf UCase(Right(filename, 3)) = "MOT" Then intFileHandle = FreeFile Open filename For Binary Access Read Lock Read Write As intFileHandle Get #intFileHandle, , Width Get #intFileHandle, , Height ReDim bitmapImage(2, Height - 1, Width - 1) Get #intFileHandle, , texture Close intFileHandle End If LoadBMP = True End Function Private Sub CreateTextureMapFromImage(pict As PictureBox, ByRef TextureImg() As GLbyte, ByRef Height As Long, ByRef Width As Long) Dim oldpicmap As Double oldpicmap = picmap If TEX = 0 Then picmap = 1 pict.ScaleMode = 3 Height = pict.ScaleHeight / picmap Width = pict.ScaleWidth / picmap ReDim TextureImg(2, Height - 1, Width - 1) Dim x As Long, y As Long Dim c As Long Dim yloc As Long For x = 0 To Width - 1 For y = 0 To Height - 1 c = pict.Point(x * picmap, y * picmap) yloc = Height - y - 1 'first red = c And &HFF green = (c \ 256) And &HFF blue = (c \ 65536) And &HFF 'final TextureImg(0, x, yloc) = red TextureImg(1, x, yloc) = green TextureImg(2, x, yloc) = blue Next y Next x picmap = oldpicmap End Sub Private Function LoadGLTextures() As Boolean Dim Status As Boolean Dim h As Long Dim w As Long Dim TextureImage() As GLbyte Status = False For TEX = 0 To MAX_TEXTURES DoEvents If LoadBMP(TextureBMP$(TEX), TextureImage(), h, w) Then Status = True glGenTextures 1, texture(TEX) glBindTexture glTexture2D, texture(TEX) glTexImage2D glTexture2D, 0, 3, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage(0, 0, 0) glTexParameteri glTexture2D, tpnTextureMinFilter, GL_LINEAR End If Erase TextureImage Next TEX Erase TextureImage LoadGLTextures = Status End Function Public Sub REPLACE_TEXTURE(spritenumber) 'replace the sprite SpriteNumber with whatever it's set to (TextureBMP) Dim Status As Boolean Dim h As Long Dim w As Long Dim TextureImage() As GLbyte Status = False TEX = spritenumber If LoadBMP(TextureBMP$(TEX), TextureImage(), h, w) Then Status = True glGenTextures 1, texture(TEX) glBindTexture glTexture2D, texture(TEX) glTexImage2D glTexture2D, 0, 3, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage(0, 0, 0) glTexParameteri glTexture2D, tpnTextureMinFilter, GL_LINEAR End If Erase TextureImage End Sub Public Sub ReSizeGLScene(ByVal Width As GLsizei, ByVal Height As GLsizei) If Height = 0 Then Height = 1 End If glViewport 0, 0, Width, Height glMatrixMode mmProjection glLoadIdentity If CONSOLE = 1 Then gluPerspective 45, Width / Height, 0.1, 100# If CONSOLE <> 1 Then gluPerspective CONF(CONF_FOV).value, Width / Height, 0.1, 100# glMatrixMode mmModelView glLoadIdentity End Sub Public Function InitGL() As Boolean 'load textures For x = 0 To MAX_TEXTURES TextureBMP$(x) = "" 'set default avatars If CONF(LOAD_AVATARS).value = 1 Then TextureBMP$(x) = WCONF(RESOURCE_FOLDER).CHAR & "/texture/default_avatar.bmp" Next x TextureBMP$(0) = WCONF(RESOURCE_FOLDER).CHAR & "/texture/white.bmp" TextureBMP$(1) = WCONF(RESOURCE_FOLDER).CHAR & "/texture/texture1.bmp" TextureBMP$(2) = WCONF(RESOURCE_FOLDER).CHAR & "/texture/texture2.bmp" TextureBMP$(3) = WCONF(RESOURCE_FOLDER).CHAR & "/texture/texture3.bmp" TextureBMP$(4) = WCONF(RESOURCE_FOLDER).CHAR & "/texture/texture4.bmp" TextureBMP$(5) = WCONF(RESOURCE_FOLDER).CHAR & "/texture/player.bmp" TextureBMP$(6) = WCONF(RESOURCE_FOLDER).CHAR & "/texture/spark.bmp" TextureBMP$(7) = WCONF(RESOURCE_FOLDER).CHAR & "/texture/font.bmp" TextureBMP$(8) = WCONF(RESOURCE_FOLDER).CHAR & "/texture/console.bmp" TextureBMP$(9) = WCONF(RESOURCE_FOLDER).CHAR & "/texture/spare1.bmp" TextureBMP$(10) = WCONF(RESOURCE_FOLDER).CHAR & "/texture/spare2.bmp" 'set your avatar If CONF(LOAD_AVATARS).value = 1 Then TextureBMP(MAX_TEXTURES) = WCONF(RESOURCE_FOLDER).CHAR & "/texture/local_avatar.bmp" If Not LoadGLTextures Then InitGL = False Exit Function End If 'build world list If CONF(CONF_REALTIME).value = 0 Then BUILD_WORLD_LIST BuildFont glClearColor 0, 0, 0, 0 glClearDepth 1# glDepthFunc cfLEqual glBlendFunc sfSrcAlpha, dfOne glShadeModel smSmooth glEnable glcTexture2D quadratic = gluNewQuadric() gluQuadricNormals quadratic, qnSmooth gluQuadricTexture quadratic, GL_TRUE glHint htPerspectiveCorrectionHint, hmNicest InitGL = True AddConsole "Initialized OpenGL engine." End Function Public Sub KillGLWindow() If fullscreen Then ResetDisplayMode ShowPointer End If If hrc Then If wglMakeCurrent(0, 0) = 0 Then MsgBox "Release Of DC And RC Failed.", vbInformation, "SHUTDOWN ERROR" End If If wglDeleteContext(hrc) = 0 Then MsgBox "Release Rendering Context Failed.", vbInformation, "SHUTDOWN ERROR" End If hrc = 0 End If KillFont End Sub Private Sub SaveCurrentScreen() Dim ret As Long ret = CreateIC("DISPLAY", "", "", 0&) OldWidth = GetDeviceCaps(ret, HORZRES) OldHeight = GetDeviceCaps(ret, VERTRES) OldBits = GetDeviceCaps(ret, BITSPIXEL) OldVertRefresh = GetDeviceCaps(ret, VREFRESH) ret = DeleteDC(ret) End Sub Private Function FindDEVMODE(ByVal Width As Integer, ByVal Height As Integer, ByVal Bits As Integer, Optional ByVal VertRefresh As Long = -1) As DEVMODE Dim ret As Boolean Dim i As Long Dim dm As DEVMODE i = 0 Do ret = EnumDisplaySettings(0&, i, dm) If dm.dmPelsWidth = Width And _ dm.dmPelsHeight = Height And _ dm.dmBitsPerPel = Bits And _ ((dm.dmDisplayFrequency = VertRefresh) Or (VertRefresh = -1)) Then Exit Do ' exit when we have a match i = i + 1 Loop Until (ret = False) FindDEVMODE = dm End Function Private Sub ResetDisplayMode() Dim dm As DEVMODE dm = FindDEVMODE(OldWidth, OldHeight, OldBits, OldVertRefresh) dm.dmFields = DM_BITSPERPEL Or DM_PELSWIDTH Or DM_PELSHEIGHT If OldVertRefresh <> -1 Then dm.dmFields = dm.dmFields Or DM_DISPLAYFREQUENCY End If If (ChangeDisplaySettings(dm, CDS_FULLSCREEN) <> DISP_CHANGE_SUCCESSFUL) Then MsgBox "This display mode isn't supported by your video card", , "Pro" End If End Sub Private Sub SetDisplayMode(ByVal Width As Integer, ByVal Height As Integer, ByVal Bits As Integer, ByRef fullscreen As Boolean, Optional VertRefresh As Long = -1) Dim dmScreenSettings As DEVMODE Dim p As Long SaveCurrentScreen dmScreenSettings = FindDEVMODE(Width, Height, Bits, VertRefresh) dmScreenSettings.dmBitsPerPel = Bits dmScreenSettings.dmPelsWidth = Width dmScreenSettings.dmPelsHeight = Height dmScreenSettings.dmFields = DM_BITSPERPEL Or DM_PELSWIDTH Or DM_PELSHEIGHT If VertRefresh <> -1 Then dmScreenSettings.dmDisplayFrequency = VertRefresh dmScreenSettings.dmFields = dmScreenSettings.dmFields Or DM_DISPLAYFREQUENCY End If If (ChangeDisplaySettings(dmScreenSettings, CDS_FULLSCREEN) <> DISP_CHANGE_SUCCESSFUL) Then If (MsgBox("This display mode isn't supported by your video card" & vbCr & "Use windowed mode instead?", vbYesNo + vbExclamation, "Pro") = vbYes) Then fullscreen = False Else MsgBox "Program Will Now Close.", vbCritical, "ERROR" End End If End If End Sub Public Function CreateGLWindow(frm As Form, Width As Integer, Height As Integer, Bits As Integer, fullscreenflag As Boolean) As Boolean Dim PixelFormat As GLuint Dim pfd As PIXELFORMATDESCRIPTOR fullscreen = fullscreenflag If (fullscreen) Then SetDisplayMode Width, Height, Bits, fullscreen End If If fullscreen Then HidePointer frm.WindowState = vbMaximized End If pfd.cColorBits = Bits pfd.cDepthBits = gl_depthbits pfd.dwflags = PFD_DRAW_TO_WINDOW Or PFD_SUPPORT_OPENGL Or PFD_DOUBLEBUFFER pfd.iLayerType = PFD_MAIN_PLANE pfd.iPixelType = PFD_TYPE_RGBA pfd.nSize = Len(pfd) pfd.nVersion = 1 PixelFormat = ChoosePixelFormat(frm.hDC, pfd) If PixelFormat = 0 Then KillGLWindow MsgBox "Can't Find A Suitable PixelFormat.", vbExclamation, "ERROR" CreateGLWindow = False End If If SetPixelFormat(frm.hDC, PixelFormat, pfd) = 0 Then KillGLWindow MsgBox "Can't Set The PixelFormat.", vbExclamation, "ERROR" CreateGLWindow = False End If hrc = wglCreateContext(frm.hDC) If (hrc = 0) Then KillGLWindow MsgBox "Can't Create A GL Rendering Context.", vbExclamation, "ERROR" CreateGLWindow = False End If If wglMakeCurrent(frm.hDC, hrc) = 0 Then KillGLWindow MsgBox "Can't Activate The GL Rendering Context.", vbExclamation, "ERROR" CreateGLWindow = False End If frm.Show SetForegroundWindow frm.hWnd frm.SetFocus ReSizeGLScene frm.ScaleWidth, frm.ScaleHeight If Not InitGL() Then KillGLWindow MsgBox "Initialization Failed.", vbExclamation, "ERROR" CreateGLWindow = False End If BuildFont CreateGLWindow = True End Function Sub Main() Dim Done As Boolean Dim frm As Form Done = False BEGIN_GAME fullscreen = CONF(CONF_FULLSCREEN).value ' MsgBox("Would You Like To Run In Fullscreen Mode?", vbYesNo + vbQuestion, "Start FullScreen?") = vbYes gl_modex = CONF(CONF_SCREENMODEX).value gl_modey = CONF(CONF_SCREENMODEY).value gl_colorbits = CONF(CONF_COLORBITS).value gl_depthbits = CONF(CONF_DEPTHBITS).value 'create form Set frm = New PRO 'set windowed mode dimensions If CONF(CONF_FULLSCREEN).value = 0 Then frm.Width = CONF(CONF_SCREENMODEX).value * 15 frm.Height = CONF(CONF_SCREENMODEY).value * 15 End If frm.ProLabel.Caption = "Loading Pro Slither Client - Version: " & VERSION$ & " | " & WCONF(SCRIPT_NAME).CHAR frm.ProLabel.Refresh If Not CreateGLWindow(frm, gl_modex, gl_modey, gl_colorbits, fullscreen) Then Done = True End If 'load the main config after all this stuff LOAD_CONFIG "conf/main.conf" Do While Not Done If (Not DrawGLScene Or GetAsyncKeyState(vbKeyF10) < -1) Then Unload frm Else SwapBuffers (frm.hDC) DoEvents End If Done = frm.Visible = False Loop 'shutdown Set frm = Nothing End End Sub Public Function DrawGLScene() As Boolean glClear clrColorBufferBit Or clrDepthBufferBit CORE DrawGLScene = True End Function Public Sub SetNewFOV() ' Resize And Initialize The GL Window Height = CONF(CONF_SCREENMODEY).value Width = CONF(CONF_SCREENMODEX).value If Height = 0 Then Height = 1 End If glViewport 0, 0, Width, Height glMatrixMode mmProjection glLoadIdentity FOV = CONF(CONF_FOV).value If CONSOLE = 1 And SMALL_CONSOLE = 0 Then FOV = 45 ' Calculate The Aspect Ratio Of The Window gluPerspective FOV, Width / Height, 0.1, 100# glMatrixMode mmModelView glLoadIdentity End Sub 'PRO 'Mako studios 2006 'PHYSICS 'mouse Public Declare Function GetCursorPos Lib "user32" (lpPoint As PointAPI) As Long Public Type PointAPI x As Long y As Long End Type Public Pnt As PointAPI Global Const FATNESS = 0.35 'fatness of character Global Const MISSILE_FATNESS = 0.05 'fatness of missiles Global Const MAGNA_BEAM_SPEED = 80 'speed of which a magna beam will move you Global Const GUN_NUDGE = 0.08 'the nudge upward the camera must look, and the projectile must come out 'this is also the nudge the missile will come out of Global Const HIT_FATNESS = 0.4 'the fatness of the guy that we can hit is independent of the fatness for his collision Global Const INSTANT_PROJECTILE_STEP = 0.5 'the step to move each loop when scanning an instant projectile journey. Make sure it does not 'skip the barriers of the hit area, or it might go through the guy and not hit him 'camera Global CameraX 'currents of camera Global CameraY Global CameraZ Global CameraHor Global CameraBar Global CameraVer 'general Global xmove, ymove 'how far the mouse has moved Global centerx, centery 'center of screen 'mouse cursor Global MOUSEX, MOUSEY 'important Global PLAY '=1 means we are IN GAME PLAY in the middle of a match Global CONNECTION '=1 means we are CONNECTED to a server Global GAME '=1 means we are in game environment (usually are) Global IDLE '=1 means that CONNECTION=1 and PLAY=0, and we cant move, but we can spectate 'physics instruments Public Type PHYSICS_INSTRUMENT hor As Double bar As Double ver As Double x As Double y As Double z As Double End Type 'main instruments Global FACING As PHYSICS_INSTRUMENT Global TRAVEL As PHYSICS_INSTRUMENT Global MOVING As PHYSICS_INSTRUMENT 'needed for the transfer between facing and travel, for strafing, backwards, etc Global CENTERED As PHYSICS_INSTRUMENT '0,0,0, as a dummy Global GRAVITY_PULL As PHYSICS_INSTRUMENT 'the instrument that holds the point of gravity direction and terminal velocity Global SLITHER_TURN As PHYSICS_INSTRUMENT 'used to know what direction we are slithering towards. It kinda overrides the facing Global FORWARD As PHYSICS_INSTRUMENT 'needed to have an idea of where the perfect forward would be 'mouse speed movement Global SPEED_VER Global SPEED_HOR Global SPEED_BAR 'matrix, 1-6, or 0 for zero gravity Global MATRIX 'player currents Global PLAYER_HEALTH Global PLAYER_X Global PLAYER_Y Global PLAYER_Z Global PLAYER_GUN 'the gun type Global PLAYER_VARIATION 'for the gun Global PLAYER_SPECIAL 'current state for packet building Global PLAYER_TEAM 'the team he is aware of being on, 0 being no team Global PLAYER_ID 'the ID that the server has told him he is on. -1 means he isn't aware of his server ID Global PLAYER_TAIL_HOR 'rotations for the visuals of the tail, since it is independent of the body Global PLAYER_TAIL_VER Global PLAYER_TAIL_BAR Global PLAYER_RELOAD 'time to wait til next reload in ms Global FLOOR 'this dictates if we are on a floor or not, like an inverted JUMP value. 0 for being in air Global OLD_X 'old values for collision return Global OLD_Y Global OLD_Z Global ROCKET_LAUNCHER 'actual physical currents for guns and ammo and stuff Global FAN_CANNON '... Global FORK_GUN Global SHOTGUN Global RIFLE Global RAIL_GUN Global MACHINEGUN Global GRENADE_LAUNCHER Global SPECIAL_GUN Global ROCKETS Global FANS Global PLASMA Global SHELLS Global SUPERBULLETS Global SLUGS Global BULLETS Global GRENADES Global LIGHTNING Global ROSTER_SCORE 'our total current roster score Global PLAYER_SCORE 'our total frag score Global PLAYER_AVATAR As String 'our avatar URL 'physics currents Global FaceSpeed 'the speed potential worked out for the face point to be plotted Global SlitherPower 'the slither power we have built up to add to the base speed Global KPH, MPH 'current speed Global RawSpeed 'current speed with no conversions Global MoveAccel 'the acceleration worked out depending on our variables Global SlitherDir '0 means none, 1 means moving towards left, 2 means moving towards right Global CrossoverPoint 'remember the angle we were travelling towards when we began the slither (hor) Global LastSlitherHor 'remember the last angle for slithering Global SLITHER_HOLD 'an override that becomes 1 when slithering, to hack our applied forces into the silther direction Global SlitherGain 'current gain of power during this slither, to work out if it exceeds the limit Global PSLITHERPOWER 'potential slither power Global BankGoal 'the goal of the facing.bar Only applies on land 1 and 2. Global InMagnaBeam 'greater than 0 means we're in a magna beam of type 1-6. 0 means we're not. 'for missiles Global GunPower Global GunWeight Global GunSpeed Global GunOrbit Global GunReload Global GunRecoil Global GunCurve Global GunVariant1 Global GunVariant2 Global GunVariant3 Global oldmisX, oldmisY, oldmisZ 'old co-ordinates for missile collision Global WHAMMY Global RocketTrailNL 'for remember when to draw the rocket trails 'missile database Public Type MISSILE_TYPE x As Double y As Double z As Double hor As Double ver As Double bar As Double t As Integer variation As Integer special As Integer power As Double weight As Double speed As Double orbit As Double curve As Double owner As String spin As Double speedx As Double speedy As Double speedz As Double End Type Global missile(MAX_MISSILES) As MISSILE_TYPE Global EndX, EndY, EndZ As Double Global OUT_OF_AMMO 'so we know when to do a click when you pull the trigger with no ammo 'for statistics of measuring missiles Global MissileClockSpeed As Double Global MissileClockOwner As String Global MissileClockType As Integer 'for drawing slugs that come out of the nozzle Global NozzleX Global NozzleY Global NozzleZ 'keep record for instant rail scanning so we only hit each person in a line once, up to 5 rails Global RailRecord(4) As String Global RailHits As Integer 'changing gun Global CHANGING_GUN 'the time in NL to countdown until the gun changes... Global CHANGE_TO_GUN '...to this gun Global GUN_SPRING 'the current animation push which goes from 0, to above 0, then springs back down with the right gravity Global SPRING_SPEED 'the speed of which the animation is moving. Global SPRING_GRAVITY 'the gravity which makes the speed change in the gun change spring animation Public Sub ANIMATIONS() 'this is for general animations and additions 'these are basically visual 'visual recoil If CONF(RECOIL_POWER).value <> 0 Then Dim GatingMin As Double Dim GatingMax As Double Dim PassDone As Integer PassDone = 0 'basically, the side is 0, until it returns and goes OVER its return point, then it squidges into side 1 'if it bounces back, it'll squidge into side 2, and so on through 1 and 2. 'each time it passes the center point, the squidge will absorb/stop the movement, allowing a flowing bouncy stop RECOIL = RECOIL + ((RecoilSpeed * 0.00002) * NL) 'work out gating range. the gating is the cut off when it crosses over, to stop tiny little bounces going on for ages GatingMin = 0 - CONF(RECOIL_GATING).value GatingMax = 0 + CONF(RECOIL_GATING).value 'squidge pass to negative If RECOIL < 0 And RecoilSide = 2 Then 'gating If RecoilSpeed >= GatingMin And RecoilSpeed <= GatingMax Then RECOIL = 0: RecoilSpeed = 0: RecoilSide = 3 'add squidge If CONF(RECOIL_SQUIDGE).value <> 0 Then RecoilSpeed = RecoilSpeed * CONF(RECOIL_SQUIDGE).value 'no squidge? make it stop If CONF(RECOIL_SQUIDGE).value = 0 Then RECOIL = 0: RecoilSpeed = 0: RecoilSide = 3 RecoilSide = 1 PassDone = 1 End If 'squidge pass back through positive If RECOIL > 0 And RecoilSide = 1 Then 'gating If RecoilSpeed >= GatingMin And RecoilSpeed <= GatingMax Then RECOIL = 0: RecoilSpeed = 0: RecoilSide = 3 'add neg squidge If CONF(RECOIL_NEG_SQUIDGE).value <> 0 Then RecoilSpeed = RecoilSpeed * CONF(RECOIL_NEG_SQUIDGE).value 'no squidge? make it stop (only if its a negative squidge If CONF(RECOIL_NEG_SQUIDGE).value = 0 Then RECOIL = 0: RecoilSpeed = 0: RecoilSide = 3 RecoilSide = 2 PassDone = 1 End If 'first time pass into squidge If RECOIL < 0 And RecoilSide = 0 And PassDone = 0 Then PassDone = 1 RecoilSide = 1 'add squidge If CONF(RECOIL_SQUIDGE).value <> 0 Then RecoilSpeed = RecoilSpeed * CONF(RECOIL_SQUIDGE).value 'no squidge? make it stop If CONF(RECOIL_SQUIDGE).value = 0 Then RECOIL = 0: RecoilSpeed = 0: RecoilSide = 3 End If 'recoil goes over maximum If RECOIL > CONF(RECOIL_MAX).value Then RECOIL = CONF(RECOIL_MAX).value: RecoilSpeed = 0 'recoil gravity CanDo = 1 If RECOIL = 0 And RecoilSpeed = 0 Then CanDo = 0 If RecoilSide = 3 Then CanDo = 0 If CanDo = 1 Then If RECOIL >= 0 Then RecoilSpeed = RecoilSpeed - ((CONF(RECOIL_RESISTANCE).value * 0.0005) * NL) If RECOIL < 0 Then RecoilSpeed = RecoilSpeed + ((CONF(RECOIL_RESISTANCE).value * 0.0005) * NL) End If End If 'slugs For x = 0 To MaxSlugs If slug(x).t >= 1 Then 'timeout slug(x).orbit = slug(x).orbit - NL If slug(x).orbit <= 0 Then slug(x).orbit = 0: slug(x).t = 0 If x = MaxSlugs Then MaxSlugs = MaxSlugs - 1 If MaxSlugs <= 0 Then MaxSlugs = 0 End If 'fadeout If CONF(RAIL_SLUG_FADESTART).value <> 0 And slug(x).orbit <= CONF(RAIL_SLUG_FADESTART).value Then slug(x).red = slug(x).red - (NL * CONF(RAIL_SLUG_FADESPEED).value) slug(x).green = slug(x).green - (NL * CONF(RAIL_SLUG_FADESPEED).value) slug(x).blue = slug(x).blue - (NL * CONF(RAIL_SLUG_FADESPEED).value) If slug(x).red <= 0 Then slug(x).red = 0 If slug(x).green <= 0 Then slug(x).green = 0 If slug(x).blue <= 0 Then slug(x).blue = 0 End If End If Next x End Sub Public Sub CHANGE_GUN(WhatGun As Integer) 'attempt to change to this gun, where 0 is put gun away, 1-9 are the guns. CanDo = 1 'work out if we can change the gun or not If WhatGun = 1 Then If ROCKETS <= 0 Or CONF(R_ROCKET_LAUNCHER).value = 0 Then CanDo = 0 If WhatGun = 2 Then If FANS <= 0 Or CONF(R_FAN_CANNON).value = 0 Then CanDo = 0 If WhatGun = 3 Then If PLASMA <= 0 Or CONF(R_FORK_GUN).value = 0 Then CanDo = 0 If WhatGun = 4 Then If SHELLS <= 0 Or CONF(R_SHOTGUN).value = 0 Then CanDo = 0 If WhatGun = 5 Then If SUPERBULLETS <= 0 Or CONF(R_RIFLE).value = 0 Then CanDo = 0 If WhatGun = 6 Then If GRENADES <= 0 Or CONF(R_GRENADE_LAUNCHER).value = 0 Then CanDo = 0 If WhatGun = 7 Then If BULLETS <= 0 Or CONF(R_MACHINEGUN).value = 0 Then CanDo = 0 If WhatGun = 8 Then If SLUGS <= 0 Or CONF(R_RAIL_GUN).value = 0 Then CanDo = 0 If WhatGun = 9 Then If LIGHTNING <= 0 Or CONF(R_SPECIAL_GUN).value = 0 Then CanDo = 0 'already changing? If CHANGING_GUN > 0 Then CanDo = 0 'already trying to reload? If PLAYER_RELOAD > 0 Then CanDo = 0 'do it? If CanDo = 1 Then CHANGING_GUN = 300 CHANGE_TO_GUN = WhatGun GUN_SPRING = 0 SPRING_SPEED = 0.001 SPRING_GRAVITY = 0.000007 End If End Sub Public Sub COLLISION() Dim o As Integer Dim oNorth, oSouth, oEast, oWest, oTop, oBottom As Double Dim inX, inY, inZ As Integer Dim HitFloor As Integer HitFloor = 0 For o = 0 To BLOCKS 'do collision for each block (o) inX = 0: inY = 0: inZ = 0 collide = 0 'get values oNorth = block(o).z oSouth = (block(o).z + block(o).zd) oWest = block(o).x oEast = (block(o).x + block(o).xd) oTop = ((0 + block(o).y)) + block(o).yd oBottom = 0 + block(o).y 'add our fatness oNorth = oNorth - FATNESS oSouth = oSouth + FATNESS oEast = oEast + FATNESS oWest = oWest - FATNESS oTop = oTop + FATNESS oBottom = oBottom - FATNESS 'work out the in's If PLAYER_X > oWest And PLAYER_X < oEast Then inX = 1 If PLAYER_Y > oBottom And PLAYER_Y < oTop Then inY = 1 If PLAYER_Z > oNorth And PLAYER_Z < oSouth Then inZ = 1 'entered top? If inX = 1 And inZ = 1 And OLD_Y >= oTop And PLAYER_Y <= oTop Then PLAYER_Y = oTop TRAVEL.y = 0 If MATRIX = 1 Then HitFloor = 1 End If 'entered north? If inX = 1 And inY = 1 And OLD_Z <= oNorth And PLAYER_Z >= oNorth Then PLAYER_Z = oNorth TRAVEL.z = 0 If MATRIX = 4 Then HitFloor = 1 End If 'entered south? If inX = 1 And inY = 1 And OLD_Z >= oSouth And PLAYER_Z <= oSouth Then PLAYER_Z = oSouth TRAVEL.z = 0 If MATRIX = 3 Then HitFloor = 1 End If 'entered west? If inZ = 1 And inY = 1 And OLD_X <= oWest And PLAYER_X >= oWest Then PLAYER_X = oWest TRAVEL.x = 0 If MATRIX = 5 Then HitFloor = 1 End If 'entered east? If inZ = 1 And inY = 1 And OLD_X >= oEast And PLAYER_X <= oEast Then PLAYER_X = oEast TRAVEL.x = 0 If MATRIX = 6 Then HitFloor = 1 End If 'entered bottom? (lol) If inX = 1 And inZ = 1 And OLD_Y <= oBottom And PLAYER_Y >= oBottom Then PLAYER_Y = oBottom TRAVEL.y = 0 If MATRIX = 2 Then HitFloor = 1 End If Next o 'hit the floor? FLOOR = 0 If HitFloor = 1 Then FLOOR = 1 End Sub Public Sub CREATE_EXPLOSION(eX, eY, eZ, eStrength, eForce, eOwner As String, eType, eVariation, eSpecial) 'create an explosion HERE, with the eStrength as the general power of the explosion 'this power will range from 0 (non existant) to 100 (most powerful) 'you can change the particles and sizes etc later for this 'the eForce however, is the magnatude of sheer force, which influences speed more than qty. This will be 1 to 100 'we also have the type variation and special, for custom stuff 'missile data from missile number A Dim Particles As Double Dim parloop As Integer Dim par As Integer Dim eSIZE As Double Dim eFADESPEED As Double Dim eRed, eGreen, eBlue As Double 'work out force eForce = eForce * CONF(SPARK_FORCE_MULTIPLY).value If eForce <= CONF(SPARK_FORCE_MIN).value Then eForce = CONF(SPARK_FORCE_MIN).value If eForce >= CONF(SPARK_FORCE_MAX).value Then eForce = CONF(SPARK_FORCE_MAX).value 'work out how many particles to produce & set defaults Particles = CONF(SPARK_PARTICLE_MIN).value eStrength = eStrength * CONF(SPARK_PARTICLE_MULTIPLY).value Particles = Particles + eStrength Particles = Particles + CONF(SPARK_PARTICLE_ADD).value Particles = Int(Particles) If Particles >= CONF(SPARK_PARTICLE_MAX).value Then Particles = CONF(SPARK_PARTICLE_MAX).value If Particles <= 0 Then Particles = 0 Randomize Timer eFADESPEED = CONF(SPARK_PARTICLE_FADESPEED).value eSIZE = CONF(SPARK_PARTICLE_SIZE).value eRed = CONF(SPARK_RED).value eGreen = CONF(SPARK_GREEN).value eBlue = CONF(SPARK_BLUE).value 'plasma custom (3) If eType = 3 And eVariation = 2 Then If eForce >= CONF(SPARK_PLASMA).value Then eForce = CONF(SPARK_PLASMA).value Particles = CONF(PLASMA_SPARK_AMOUNT).value eSIZE = CONF(PLASMA_SPARK_SIZE).value eFADESPEED = CONF(PLASMA_SPARK_FADESPEED).value eRed = CONF(PLASMA_SPARK_RED).value eGreen = CONF(PLASMA_SPARK_GREEN).value eBlue = CONF(PLASMA_SPARK_BLUE).value End If 'eType=21 for fan chips If eType = 21 Then Particles = CONF(FAN_SPARK_AMOUNT).value eSIZE = CONF(FAN_SPARK_SIZE).value eFADESPEED = CONF(FAN_SPARK_FADESPEED).value eRed = CONF(FAN_SPARK_RED).value eGreen = CONF(FAN_SPARK_GREEN).value eBlue = CONF(FAN_SPARK_BLUE).value End If 'eType=20 means rocket trail If eType = 20 Then eForce = CONF(ROCKET_TRAIL_FORCE).value Particles = 1 eFADESPEED = CONF(ROCKET_TRAIL_FADESPEED).value eSIZE = CONF(ROCKET_TRAIL_SIZE).value 'the particles variable is actually the interval and will call this sub whenever the time is right eRed = CONF(ROCKET_TRAIL_RED).value eGreen = CONF(ROCKET_TRAIL_GREEN).value eBlue = CONF(ROCKET_TRAIL_BLUE).value End If 'shotgun custom If eType = 4 Then eForce = CONF(SHOTGUN_SPARK_FORCE).value Particles = CONF(SHOTGUN_SPARK_AMOUNT).value eFADESPEED = CONF(SHOTGUN_SPARK_FADESPEED).value eSIZE = CONF(SHOTGUN_SPARK_SIZE).value If CONF(SHOTGUN_SPARK_VARY_POWER).value >= 1 Then 'exagerate power powah = CONF(SHOTGUN_SPARK_VARY_POWER).value Particles = Int(Particles + (eStrength * powah)) Particles = Int(Particles - CONF(SHOTGUN_SPARK_DEDUCT).value) If Particles <= 1 Then Particles = 1 End If End If 'machinegun/rifle custom If eType = 5 Or eType = 7 Then eForce = CONF(BULLET_SPARK_FORCE).value Particles = CONF(BULLET_SPARK_AMOUNT).value eFADESPEED = CONF(BULLET_SPARK_FADESPEED).value eSIZE = CONF(BULLET_SPARK_SIZE).value End If 'general bullet customs If eType = 4 Or eType = 5 Or eType = 7 Then eRed = CONF(BULLET_SPARK_RED).value eGreen = CONF(BULLET_SPARK_GREEN).value eBlue = CONF(BULLET_SPARK_BLUE).value End If 'rail custom If eType = 8 Then eForce = CONF(RAIL_SPARK_FORCE).value Particles = CONF(RAIL_SPARK_AMOUNT).value eSIZE = CONF(RAIL_SPARK_SIZE).value eFADESPEED = CONF(RAIL_SPARK_FADESPEED).value If CONF(RAIL_SPARK_MATCH_COLORS).value = 1 Then eRed = SlugRed / 255 eGreen = SlugGreen / 255 eBlue = SlugBlue / 255 End If End If '--------------------------------------------------------------- For parloop = 1 To Particles 'find a slot for the particle par = -1 For z = 0 To CONF(SPARK_USE_MAX).value If par = -1 And spark(z).orbit = 0 Then par = z Next z 'not found? pick one at random If par = -1 Then par = Int(Rnd * CONF(SPARK_USE_MAX).value) 'create the spark With spark(par) .x = (Int(Rnd * 100) - 50) * 0.0001 .y = (Int(Rnd * 100) - 50) * 0.0001 .z = (Int(Rnd * 100) - 50) * 0.0001 .x = .x + eX .y = .y + eY .z = .z + eZ .speedx = (Int(Rnd * 1000) - 500) * (eForce * 0.00000007) .speedy = (Int(Rnd * 1000) - 500) * (eForce * 0.00000007) .speedz = (Int(Rnd * 1000) - 500) * (eForce * 0.00000007) 'speed hack for trails If eType = 20 Then .speedx = .speedx - (missile(A).speedx * 0.00001) .speedy = .speedy - (missile(A).speedy * 0.00001) .speedz = .speedz - (missile(A).speedz * 0.00001) End If .fadespeed = (0.0002 * eFADESPEED) + Int(Rnd * 100) * 0.0005 .orbit = 9000 .size = Int(Rnd * eSIZE) + 25 .power = 100 .t = 0 .red = eRed .green = eGreen .blue = eBlue End With Next parloop '--------------------------------------------------------------- 'work out max sparks, for cpu saving MaxSparks = CONF(SPARK_USE_MAX).value For z = 0 To MAX_SPARKS If spark(z).orbit <> 0 Then MaxSparks = z Next z End Sub Public Sub DEATH() 'we died :( AddConsole "You died." PLAYER_HEALTH = 100 RemoteScript "DEATH" End Sub Public Sub DO_AREAS() 'not in a magna beam by default InMagnaBeam = 0 'physics within areas For x = 0 To MaxAreas If PLAYER_X >= area(x).x And PLAYER_X <= (area(x).x + area(x).xd) And PLAYER_Y >= area(x).y And PLAYER_Y <= (area(x).y + area(x).yd) And PLAYER_Z >= area(x).z And PLAYER_Z <= (area(x).z + area(x).zd) Then 'we're in this area 'magna beam? If area(x).t = 1 Then InMagnaBeam = area(x).value End If Next x End Sub Public Sub DO_JUMP() Dim JumpBoost As Double 'the player has tried to jump, and he was on the floor 'work out jump boost JumpBoost = 100 + CONF(JUMP).value JumpBoost = JumpBoost - (CONF(CONF_WEIGHT).value * 0.4) JumpBoost = JumpBoost * 0.5 If MATRIX = 1 Then TRAVEL.y = 0 + JumpBoost End If If MATRIX = 2 Then TRAVEL.y = 0 - JumpBoost End If 'do sound here 'set it so we're no longer on the floor FLOOR = 0 End Sub Public Sub FIRE_GUN() 'fire the gun based on what you have now, and do it all here 'customized properties if missile (even though it says gun!) GunPower = 0 GunWeight = 0 GunSpeed = 0 GunOrbit = 0 GunReload = 5000 GunRecoil = 0 GunCurve = 0 GunVariant1 = 0 GunVariant2 = 0 GunVariant3 = 0 'set base values. These values will then be modified through different stages GetBaseGunValues PLAYER_GUN, PLAYER_VARIATION, PLAYER_SPECIAL 'stability to stop recoil If CONF(R_STABILITY).value = PLAYER_GUN And CONF(R_STABILITY_LEVEL).value >= 1 Then GunRecoil = GunRecoil - (CONF(R_STABILITY_LEVEL).value * 5) End If 'other adjustments go here ----------> '<------------------------------------ 'set default variants as averages (all 5's) GunVariant1 = 5 GunVariant2 = 5 GunVariant3 = 5 'variant adjustments go here --------> 'rail gun color If PLAYER_GUN = 8 Then GunVariant3 = CONF(RAIL_COLOR).value 'grenade launcher bounces If PLAYER_GUN = 6 Then GunVariant2 = CONF(GRENADE_BOUNCES).value '<------------------------------------ 'set reload PLAYER_RELOAD = GunReload 'deduct ammo If PLAYER_GUN = 1 Then ROCKETS = ROCKETS - 1 If PLAYER_GUN = 2 Then FANS = FANS - 1 If PLAYER_GUN = 3 Then PLASMA = PLASMA - 1 If PLAYER_GUN = 4 Then SHELLS = SHELLS - 1 If PLAYER_GUN = 5 Then SUPERBULLETS = SUPERBULLETS - 1 If PLAYER_GUN = 6 Then GRENADES = GRENADES - 1 If PLAYER_GUN = 7 Then BULLETS = BULLETS - 1 If PLAYER_GUN = 8 Then SLUGS = SLUGS - 1 If PLAYER_GUN = 9 Then LIGHTNING = LIGHTNING - 1 'do recoil If CONF(RECOIL_POWER).value <> 0 Then VisualRecoil 'build the missile packet based on these properties and our gun BUILD_MIS_LINE 'sent the packet out If CONNECTION = 1 Then SEND_PACKET BUFFER 'send it to ourself! READ_MIS_LINE 'take away the fan on the end of the gun until it reloads If PLAYER_GUN = 2 Then PLAYER_SPECIAL = 0 End Sub Public Sub GetBaseGunValues(wType, wVariation, wSpecial) 'set the base gun values for gun type wType with variation wVariation 'this is where you will adjust the properties of each TYPE OF GUN 'for some guns, the gun will have a base property influence and the SPECIAL will be additional 'so basically certain fan guns for example, might have more power in general, in addition to the fan 'rockets If wType = 1 Then 'standard If wVariation = 1 Then GunPower = 50 GunWeight = 0 GunSpeed = 40 GunOrbit = 3000 GunReload = 1200 GunRecoil = 50 GunCurve = 0 End If 'mac-1 If wVariation = 2 Then GunPower = 35 GunWeight = 0 GunSpeed = 65 GunOrbit = 3000 GunReload = 1000 GunRecoil = 40 GunCurve = 0 End If 'brawl classic If wVariation = 3 Then GunPower = 45 GunWeight = 0 GunSpeed = 35 GunOrbit = 3000 GunReload = 1400 GunRecoil = 70 GunCurve = 0 End If 'the projectile-------------> 'standard If wSpecial = 1 Then GunPower = GunPower + 0 GunWeight = GunWeight + 0 GunSpeed = GunSpeed + 20 GunOrbit = GunOrbit + 6000 GunReload = GunReload + 0 GunRecoil = GunRecoil + 0 GunCurve = GunCurve + 0 End If 'mac-1 If wSpecial = 2 Then GunPower = GunPower + 0 GunWeight = GunWeight + 0 GunSpeed = GunSpeed + 0 GunOrbit = GunOrbit + 4000 GunReload = GunReload + 0 GunRecoil = GunRecoil + 0 GunCurve = GunCurve + 0 End If 'brawl classic If wSpecial = 3 Then GunPower = GunPower + 0 GunWeight = GunWeight + 0 GunSpeed = GunSpeed + 0 GunOrbit = GunOrbit + 0 GunReload = GunReload + 0 GunRecoil = GunRecoil + 0 GunCurve = GunCurve + 0 End If End If 'fan cannon If wType = 2 Then 'the gun---------------------> 'modern standard If wVariation = 1 Then GunPower = 45 GunWeight = 0 GunSpeed = 25 GunOrbit = 0 GunReload = 1500 GunRecoil = 0 GunCurve = 0 End If 'classic hymene If wVariation = 2 Then GunPower = 30 GunWeight = 0 GunSpeed = 20 GunOrbit = 0 GunReload = 1500 GunRecoil = 0 GunCurve = 0 End If 'antique vintage If wVariation = 3 Then GunPower = 15 GunWeight = 0 GunSpeed = 5 GunOrbit = 0 GunReload = 1500 GunRecoil = 0 GunCurve = 0 End If 'mochilop If wVariation = 4 Then GunPower = 35 GunWeight = 0 GunSpeed = 15 GunOrbit = 0 GunReload = 1500 GunRecoil = 0 GunCurve = 0 End If 'the projectile-------------> 'modern standard If wSpecial = 1 Then GunPower = GunPower + 30 GunWeight = GunWeight + 20 GunSpeed = GunSpeed + 45 GunOrbit = GunOrbit + 9000 GunReload = GunReload + 0 GunRecoil = GunRecoil + 0 GunCurve = GunCurve + 20 End If 'classic hymene If wSpecial = 2 Then GunPower = GunPower + 30 GunWeight = GunWeight + 30 GunSpeed = GunSpeed + 40 GunOrbit = GunOrbit + 12000 GunReload = GunReload + 0 GunRecoil = GunRecoil + 0 GunCurve = GunCurve + 30 End If 'antique vintage If wSpecial = 3 Then GunPower = GunPower + 30 GunWeight = GunWeight + 80 GunSpeed = GunSpeed + 30 GunOrbit = GunOrbit + 6000 GunReload = GunReload + 0 GunRecoil = GunRecoil + 0 GunCurve = GunCurve + 20 End If 'mochilop If wSpecial = 4 Then GunPower = GunPower + 30 GunWeight = GunWeight + 10 GunSpeed = GunSpeed + 33 GunOrbit = GunOrbit + 15000 GunReload = GunReload + 0 GunRecoil = GunRecoil + 0 GunCurve = GunCurve + 20 End If End If 'plasma and forks If wType = 3 Then 'fork If wVariation = 1 Then GunPower = 10 GunWeight = 0 GunSpeed = 40 GunOrbit = 3000 GunReload = 200 GunRecoil = 10 GunCurve = 0 End If 'plasma If wVariation = 2 Then GunPower = 10 GunWeight = 0 GunSpeed = 70 GunOrbit = 5000 GunReload = 120 GunRecoil = 15 GunCurve = 0 End If End If 'grenade launchers If wType = 6 Then 'grenade launcher 1 If wVariation = 1 Then GunPower = 50 GunWeight = 50 GunSpeed = 30 GunOrbit = 7000 GunReload = 1500 GunRecoil = 50 GunCurve = 0 End If End If 'shotguns If wType = 4 Then 'pump action If wVariation = 1 Then GunPower = 30 GunWeight = 0 GunSpeed = 0 GunOrbit = 50 GunReload = 500 GunRecoil = 10 GunCurve = 1 End If 'double barrel If wVariation = 2 Then GunPower = 45 GunWeight = 0 GunSpeed = 0 GunOrbit = 50 GunReload = 800 GunRecoil = 15 GunCurve = 1 End If End If 'rifles If wType = 5 Then '? If wVariation = 1 Then GunPower = 50 GunWeight = 0 GunSpeed = 50 GunOrbit = 200 GunReload = 2000 GunRecoil = 40 GunCurve = 0 End If End If 'machineguns If wType = 7 Then '? If wVariation = 1 Then GunPower = 10 GunWeight = 0 GunSpeed = 90 GunOrbit = 50 GunReload = 80 GunRecoil = 10 GunCurve = 0 End If End If 'railguns If wType = 8 Then 'a quake rail that stops at the first wall, gun dependent If wVariation = 1 Then GunPower = 80 GunWeight = 0 GunSpeed = 40 GunOrbit = 150 GunReload = 1500 GunRecoil = 10 GunCurve = 0 End If 'this rail will go through all walls, gun dependent If wVariation = 2 Then GunPower = 80 GunWeight = 0 GunSpeed = 40 GunOrbit = 150 GunReload = 1500 GunRecoil = 10 GunCurve = 0 End If End If 'specials If wType = 9 Then 'lightning If wVariation = 1 Then GunPower = 10 GunWeight = 0 GunSpeed = 40 GunOrbit = 25 GunReload = 200 GunRecoil = 10 GunCurve = 0 End If End If End Sub Public Sub GOT_HIT() 'we got hit by the person SCUMBAG and the SCUMBAG gun conditions (gun,variation,special) 'deductions! deduct = 0 'rocket direct hit If SCUMBAGGUN = 1 Then deduct = 150 'fan If SCUMBAGGUN = 2 Then deduct = 150 'fork If SCUMBAGGUN = 3 And SCUMBAGVARIATION = 1 Then deduct = 12 'plasma If SCUMBAGGUN = 3 And SCUMBAGVARIATION = 2 Then deduct = 10 'shotgun If SCUMBAGGUN = 4 Then deduct = 35 'rifle If SCUMBAGGUN = 5 Then deduct = 150 'grenade eat If SCUMBAGGUN = 6 Then deduct = 150 'machine gun If SCUMBAGGUN = 7 Then deduct = 5 'rail If SCUMBAGGUN = 8 Then deduct = 150 'lightning/specials? If SCUMBAGGUN = 9 Then deduct = 10 'deduct it PLAYER_HEALTH = PLAYER_HEALTH - deduct 'death? If PLAYER_HEALTH <= 0 Then DEATH 'send out a GUT line PACKET = "GUT:" & SCUMBAGGUN & SCUMBAGVARIATION & SCUMBAGSPECIAL & ":" & WCONF(PLAYER_NAME).CHAR SEND_PACKET PACKET End Sub Public Sub GRENADE_EXPLOSION(grenade) 'the grenade number GRENADE has exploded With missile(grenade) 'harm on someone '---> 'visual explosion CREATE_EXPLOSION .x, .y, .z, .power, 100, .owner, .t, .variation, .special End With 'kill the missile missile(grenade).orbit = 0 missile(grenade).owner = "" End Sub Public Sub INSTANT_PROJECTILE(MIS) 'deal with missile number MIS right now Dim DealWithIt As Integer Dim jX, jY, jZ As Double Dim jStep As Double Dim jJourney As Double Dim j As Integer Dim jSpeedX, jSpeedY, jSpeedZ As Double Dim JourneyEnd Dim pla As Integer Dim HitSomething As Integer Dim CanHit As Integer 'erase rail records For x = 0 To 4 RailRecord(x) = "" Next x RailHits = 0 DealWithIt = 0 JourneyEnd = 0 'becomes one when the missile is exterminated, like hitting a wall etc. HitSomething = 0 If missile(MIS).t = 4 Then DealWithIt = 1 If missile(MIS).t = 5 Then DealWithIt = 1 If missile(MIS).t = 7 Then DealWithIt = 1 If missile(MIS).t = 8 Then DealWithIt = 1 If missile(MIS).t = 9 Then 'special guns here? lightning for type 1 If missile(MIS).variation = 1 Then DealWithIt = 1 End If If DealWithIt = 1 Then '------------------------------------------------------------------------------------- 'rail gun? work out the colour of the slug now so we can match the explosion colour if needed If missile(MIS).t = 8 Then GetSlugColor MIS 'set start point of journey jX = missile(MIS).x jY = missile(MIS).y jZ = missile(MIS).z 'set the scan speed. no NL needed here jStep = INSTANT_PROJECTILE_STEP 'set the beginning of the journey. It ends when it exceeds the orbit. This means the orbit means distance. jJourney = 0 'work out the speeds. normal speed is ignored, it depends on the step jSpeedX = 0 jSpeedY = 0 jSpeedZ = 0 + jStep Rotate jSpeedX, jSpeedY, missile(MIS).bar Rotate jSpeedZ, jSpeedY, missile(MIS).ver Rotate jSpeedX, jSpeedZ, missile(MIS).hor 'do the journey Do While JourneyEnd = 0 'out of orbit? If jJourney >= missile(MIS).orbit Then JourneyEnd = 1 If JourneyEnd = 0 Then 'have we hit a player? For pla = 0 To MaxPeople If person(pla).Name <> "" And person(pla).PAC <> "" And person(pla).Team <> 0 Then 'get player info MAN = person(pla).PAC manX = (Int(Mid$(MAN, 2, 5)) - 50000) / 100 manY = (Int(Mid$(MAN, 7, 5)) - 50000) / 100 manZ = (Int(Mid$(MAN, 12, 5)) - 50000) / 100 manName$ = Mid$(MAN, 41) 'create hitbox bx1 = manX - HIT_FATNESS bx2 = manX + HIT_FATNESS by1 = manY - HIT_FATNESS by2 = manY + HIT_FATNESS bz1 = manZ - HIT_FATNESS bz2 = manZ + HIT_FATNESS CanHit = 1 'already hit him with rail? (you can only hit up to 5 people with one rail shot) If missile(MIS).t = 8 Then If RailHits >= 5 Then CanHit = 0 If RailRecord(RailHits) = manName$ Then CanHit = 0: If RailRecord(RailHits) = "" Then RailHits = RailHits + 1 End If 'did we hit him? If jX >= bx1 And jX <= bx2 And jY >= by1 And jY <= by2 And jZ >= bz1 And jZ <= bz2 And CanHit = 1 Then 'hit the guy CREATE_EXPLOSION jX, jY, jZ, 30, 30, missile(MIS).owner, missile(MIS).t, missile(MIS).variation, missile(MIS).special 'end the sequence unless its a rail slug If missile(MIS).t <> 8 Then JourneyEnd = 1: HitSomething = 1 'if its a rail, keep a record that we have hit this guy once and move to the next guy If missile(MIS).t = 8 Then RailRecord(RailHits) = manName$ 'do we own this missile? send a hit line If LCase(missile(MIS).owner) = LCase(WCONF(PLAYER_NAME).CHAR) Then 'send hit line here SEND_HIT_LINE MIS, pla End If End If End If Next pla 'did we hit a wall? (only if its not rail type 2) scanit = 1 If missile(MIS).t = 8 And missile(MIS).variation = 2 Then scanit = 0 If scanit = 1 Then For x = 0 To MaxBlocks If block(x).t = 1 And JourneyEnd = 0 Then 'get block box bx1 = block(x).x bx2 = block(x).x + block(x).xd by1 = block(x).y by2 = block(x).y + block(x).yd bz1 = block(x).z bz2 = block(x).z + block(x).zd 'are we inside the box? If jX >= bx1 And jX <= bx2 And jY >= by1 And jY <= by2 And jZ >= bz1 And jZ <= bz2 Then 'hit the wall CREATE_EXPLOSION jX, jY, jZ, missile(MIS).power, missile(MIS).speed, missile(MIS).owner, missile(MIS).t, missile(MIS).variation, missile(MIS).special 'end the journey if its NOT rail type 2 endit = 1 If missile(MIS).t = 8 And missile(MIS).variation = 2 Then endit = 0: HitSomething = 1 If endit = 1 Then JourneyEnd = 1 'set the end journey, for rail/stats EndX = jX EndY = jY EndZ = jZ End If 'any splash damage hit? '---> splash goes here End If End If Next x End If End If 'move along the journey jJourney = jJourney + jStep 'move the dummy missile along too jX = jX + jSpeedX jY = jY + jSpeedY jZ = jZ + jSpeedZ Loop 'journey didn't hit anything? set the end journey here for slugs and stats If HitSomething = 0 Then EndX = jX EndY = jY EndZ = jZ End If 'create visual slug? If missile(MIS).t = 8 Then CreateSlug MIS End If 'kill it missile(MIS).t = 0 missile(MIS).orbit = 0 missile(MIS).owner = "" '------------------------------------------------------------------------------------- End If End Sub Public Sub MISSILE_REBOUND() 'for the missile A, a special collision of rebounding Dim o As Integer Dim oNorth, oSouth, oEast, oWest, oTop, oBottom As Double Dim inX, inY, inZ As Integer Dim HitFloor As Integer WHAMMY = 0 'count our whammys and return them, in case we want it to explode! 'rubber for grenades, not fans. 1 will make it get stuck in the wall rubber = 1 If missile(A).t = 6 Then 'custom rubber bounces here rubber = 0.7 End If For o = 0 To BLOCKS 'do collision for each block (o) inX = 0: inY = 0: inZ = 0 collide = 0 'get values oNorth = block(o).z oSouth = (block(o).z + block(o).zd) oWest = block(o).x oEast = (block(o).x + block(o).xd) oTop = ((0 + block(o).y)) + block(o).yd oBottom = 0 + block(o).y 'add our fatness oNorth = oNorth - MISSILE_FATNESS oSouth = oSouth + MISSILE_FATNESS oEast = oEast + MISSILE_FATNESS oWest = oWest - MISSILE_FATNESS oTop = oTop + MISSILE_FATNESS oBottom = oBottom - MISSILE_FATNESS 'work out the in's If missile(A).x > oWest And missile(A).x < oEast Then inX = 1 If missile(A).y > oBottom And missile(A).y < oTop Then inY = 1 If missile(A).z > oNorth And missile(A).z < oSouth Then inZ = 1 'entered top? If inX = 1 And inZ = 1 And oldmisY > oTop And missile(A).y < oTop Then WHAMMY = WHAMMY + 1 missile(A).y = oTop missile(A).speedy = 0 - (missile(A).speedy) End If 'entered north? If inX = 1 And inY = 1 And oldmisZ < oNorth And missile(A).z > oNorth Then WHAMMY = WHAMMY + 1 missile(A).z = oNorth missile(A).speedz = 0 - (missile(A).speedz) End If 'entered south? If inX = 1 And inY = 1 And oldmisZ > oSouth And missile(A).z < oSouth Then WHAMMY = WHAMMY + 1 missile(A).z = oSouth missile(A).speedz = 0 - (missile(A).speedz) End If 'entered west? If inZ = 1 And inY = 1 And oldmisX < oWest And missile(A).x > oWest Then WHAMMY = WHAMMY + 1 missile(A).x = oWest missile(A).speedx = 0 - (missile(A).speedx) End If 'entered east? If inZ = 1 And inY = 1 And oldmisX > oEast And missile(A).x < oEast Then WHAMMY = WHAMMY + 1 missile(A).x = oEast missile(A).speedx = 0 - (missile(A).speedx) End If 'entered bottom? (lol) If inX = 1 And inZ = 1 And oldmisY < oBottom And missile(A).y > oBottom Then WHAMMY = WHAMMY + 1 missile(A).y = oBottom missile(A).speedy = 0 - (missile(A).speedy) End If Next o If WHAMMY >= 1 Then 'if it bounced, all speeds are dampened due to rubber missile(A).speedx = missile(A).speedx * rubber missile(A).speedy = missile(A).speedy * rubber missile(A).speedz = missile(A).speedz * rubber 'bouncing sounds--> End If End Sub Public Sub MISSILES() 'missiles physics is here Dim SpinSpeed As Double Dim DrawTrails As Integer Dim pla As Integer Dim HitAPerson As Integer HitAPerson = 0 'move trails along DrawTrails = 0 RocketTrailNL = RocketTrailNL + NL If RocketTrailNL >= CONF(ROCKET_TRAIL_PARTICLES).value Then RocketTrailNL = 0 DrawTrails = 1 End If For A = 0 To MaxMissiles If missile(A).owner <> "" And missile(A).t >= 1 Then With missile(A) oldmisX = .x oldmisY = .y oldmisZ = .z '---------------------------------------------------------------------------- 'rockets If .t = 1 Then 'spin it according to da powah! SpinSpeed = .power * 0.008 .spin = .spin + (SpinSpeed * NL) 'move it according to independent speeds .x = .x + ((.speedx * 0.0001) * NL) .y = .y + ((.speedy * 0.0001) * NL) .z = .z + ((.speedz * 0.0001) * NL) 'snap spin to bar. spin isn't really needed tbh .bar = .spin 'rocket trail? If DrawTrails = 1 Then CREATE_EXPLOSION .x, .y, .z, 10, 10, .owner, 20, .variation, .special 'hit wall? MISSILE_REBOUND If WHAMMY >= 1 Then CREATE_EXPLOSION .x, .y, .z, .power, .speed, .owner, .t, .variation, .special .t = 0 End If End If 'fans If .t = 2 Then 'spin it according to da powah! SpinSpeed = .power * 0.02 .spin = .spin + (SpinSpeed * NL) 'move it according to independent speeds .x = .x + ((.speedx * 0.0001) * NL) .y = .y + ((.speedy * 0.0001) * NL) .z = .z + ((.speedz * 0.0001) * NL) 'snap spin to VER .ver = .spin 'curve, weight, gravity .speedy = .speedy + ((.curve * 0.002) * NL) .curve = .curve - ((.weight * 0.001) * NL) If .curve < -10 Then .curve = -10 'other speeds slowly run out due to weight 'If .speedx >= 0 Then .speedx = .speedx - ((.weight * 0.0001) * NL): If .speedx <= 0 Then .speedx = 0 'If .speedx <= 0 Then .speedx = .speedx + ((.weight * 0.0001) * NL): If .speedx >= 0 Then .speedx = 0 'If .speedz >= 0 Then .speedz = .speedz - ((.weight * 0.0001) * NL): If .speedz <= 0 Then .speedz = 0 'If .speedz <= 0 Then .speedz = .speedz + ((.weight * 0.0001) * NL): If .speedz >= 0 Then .speedz = 0 'rebound collision MISSILE_REBOUND 'create a spark if it rebounded? If WHAMMY >= 1 And CONF(DRAW_FAN_SPARKS).value >= 1 Then CREATE_EXPLOSION .x, .y, .z, .power, .speed, .owner, 21, .variation, .special End If End If 'forks & plasma If .t = 3 Then 'spin it according to da powah! SpinSpeed = .power * 0.07 .spin = .spin + (SpinSpeed * NL) 'move it according to independent speeds .x = .x + ((.speedx * 0.0001) * NL) .y = .y + ((.speedy * 0.0001) * NL) .z = .z + ((.speedz * 0.0001) * NL) 'snap spin to bar. spin isn't really needed tbh .bar = .spin 'hit wall? (plasma) MISSILE_REBOUND If WHAMMY >= 1 And CONF(DRAW_PLASMA_SPARKS).value >= 1 Then CREATE_EXPLOSION .x, .y, .z, .power, .speed, .owner, .t, .variation, .special .t = 0 End If End If 'grenades If .t = 6 Then 'spin it according to da powah! SpinSpeed = .power * 0.008 .spin = .spin - (SpinSpeed * NL) 'move it according to independent speeds .x = .x + ((.speedx * 0.0001) * NL) .y = .y + ((.speedy * 0.0001) * NL) .z = .z + ((.speedz * 0.0001) * NL) 'snap spin to bar. spin isn't really needed tbh .ver = .spin 'gravity .speedy = .speedy - ((.weight * 0.0006) * NL) 'terminal velocity If .speedy <= -70 Then .speedy = -70 'rebound collision MISSILE_REBOUND 'bounces countdown? If .curve <> 0 Then If WHAMMY >= 1 Then .curve = .curve - 1 If .curve <= 0 Then GRENADE_EXPLOSION A End If End If 'have we hit a player? MIS = A For pla = 0 To MaxPeople If person(pla).Name <> "" And person(pla).PAC <> "" And person(pla).Team <> 0 Then 'get player info MAN = person(pla).PAC manX = (Int(Mid$(MAN, 2, 5)) - 50000) / 100 manY = (Int(Mid$(MAN, 7, 5)) - 50000) / 100 manZ = (Int(Mid$(MAN, 12, 5)) - 50000) / 100 manName$ = Mid$(MAN, 41) 'create hitbox bx1 = manX - HIT_FATNESS bx2 = manX + HIT_FATNESS by1 = manY - HIT_FATNESS by2 = manY + HIT_FATNESS bz1 = manZ - HIT_FATNESS bz2 = manZ + HIT_FATNESS CanHit = 1 'did we hit him? If jX >= bx1 And jX <= bx2 And jY >= by1 And jY <= by2 And jZ >= bz1 And jZ <= bz2 And CanHit = 1 Then 'hit the guy CREATE_EXPLOSION jX, jY, jZ, 30, 30, missile(MIS).owner, missile(MIS).t, missile(MIS).variation, missile(MIS).special 'do we own this missile? send a hit line If LCase(missile(MIS).owner) = LCase(WCONF(PLAYER_NAME).CHAR) Then 'send hit line here SEND_HIT_LINE MIS, pla 'kill the missile missile(MIS).t = 0 missile(MIS).orbit = 0 missile(MIS).owner = "" HitAPerson = 1 End If End If End If Next pla 'general for all projectiles If .spin > 360 Then .spin = .spin - 360 If .spin < 0 Then .spin = .spin + 360 'orbit .orbit = .orbit - NL If .orbit <= 0 Then 'kill the missile if it runs out of orbit time 'but if its a grenade, explode it If .t = 6 Then GRENADE_EXPLOSION A .t = 0 .owner = "" If A = MaxMissiles Then MaxMissiles = MaxMissiles - 1 End If If MaxMissiles <= -1 Then MaxMissiles = 0 If HitAPerson = 1 Then .orbit = 0: .t = 0: .owner = "" '---------------------------------------------------------------------------- End With End If Next A End Sub Public Sub MoveTowards(iFrom As PHYSICS_INSTRUMENT, iTo As PHYSICS_INSTRUMENT, iSpeed) 'this will make one point drift towards another, at the rate of iSpeed 'we will use normal method, but ANGULAR_TRAVEL might come along later If CONF(ANGULAR_TRAVEL).value = 0 Then If iFrom.x < iTo.x Then iFrom.x = iFrom.x + (iSpeed * NL): If iFrom.x >= iTo.x Then iFrom.x = iTo.x If iFrom.x > iTo.x Then iFrom.x = iFrom.x - (iSpeed * NL): If iFrom.x <= iTo.x Then iFrom.x = iTo.x If iFrom.y < iTo.y Then iFrom.y = iFrom.y + (iSpeed * NL): If iFrom.y >= iTo.y Then iFrom.y = iTo.y If iFrom.y > iTo.y Then iFrom.y = iFrom.y - (iSpeed * NL): If iFrom.y <= iTo.y Then iFrom.y = iTo.y If iFrom.z < iTo.z Then iFrom.z = iFrom.z + (iSpeed * NL): If iFrom.z >= iTo.z Then iFrom.z = iTo.z If iFrom.z > iTo.z Then iFrom.z = iFrom.z - (iSpeed * NL): If iFrom.z <= iTo.z Then iFrom.z = iTo.z End If End Sub Public Sub PULL_TRIGGER() 'the player has pulled the trigger, but can he fire? CanDo = 1 'idle and connected? If CONNECTION = 1 Then If IDLE = 1 Or PLAY = 0 Then CanDo = 0 End If 'in the middle of changing gun? If CHANGING_GUN > 0 Then CanDo = 0 'rocket If PLAYER_GUN = 1 Then If PLAYER_RELOAD > 0 Then CanDo = 0 If PLAYER_VARIATION = 0 Then CanDo = 0 If CONF(R_ROCKET_TYPE).value < 1 Then CanDo = 0 If ROCKETS < 1 Then CanDo = 0: If OUT_OF_AMMO = 0 Then OUT_OF_AMMO = 1 If CanDo = 1 Then 'fire it FIRE_GUN End If End If 'fan If PLAYER_GUN = 2 Then If PLAYER_RELOAD > 0 Then CanDo = 0 If PLAYER_VARIATION = 0 Then CanDo = 0 If CONF(R_FAN_TYPE).value < 1 Then CanDo = 0 If FANS < 1 Then CanDo = 0: If OUT_OF_AMMO = 0 Then OUT_OF_AMMO = 1 If CanDo = 1 Then 'fire it FIRE_GUN End If End If 'forks and plasma If PLAYER_GUN = 3 Then If PLAYER_RELOAD > 0 Then CanDo = 0 If PLAYER_VARIATION = 0 Then CanDo = 0 If PLASMA < 1 Then CanDo = 0: If OUT_OF_AMMO = 0 Then OUT_OF_AMMO = 1 If CanDo = 1 Then 'fire it FIRE_GUN End If End If 'grenade launcher If PLAYER_GUN = 6 Then If PLAYER_RELOAD > 0 Then CanDo = 0 If PLAYER_VARIATION = 0 Then CanDo = 0 If GRENADES < 1 Then CanDo = 0: If OUT_OF_AMMO = 0 Then OUT_OF_AMMO = 1 If CanDo = 1 Then 'fire it FIRE_GUN End If End If 'shotgun If PLAYER_GUN = 4 Then If PLAYER_RELOAD > 0 Then CanDo = 0 If PLAYER_VARIATION = 0 Then CanDo = 0 If SHELLS < 1 Then CanDo = 0: If OUT_OF_AMMO = 0 Then OUT_OF_AMMO = 1 If CanDo = 1 Then 'fire it FIRE_GUN End If End If 'rifle If PLAYER_GUN = 5 Then If PLAYER_RELOAD > 0 Then CanDo = 0 If PLAYER_VARIATION = 0 Then CanDo = 0 If SUPERBULLETS < 1 Then CanDo = 0: If OUT_OF_AMMO = 0 Then OUT_OF_AMMO = 1 If CanDo = 1 Then 'fire it FIRE_GUN End If End If 'machinegun If PLAYER_GUN = 7 Then If PLAYER_RELOAD > 0 Then CanDo = 0 If PLAYER_VARIATION = 0 Then CanDo = 0 If BULLETS < 1 Then CanDo = 0: If OUT_OF_AMMO = 0 Then OUT_OF_AMMO = 1 If CanDo = 1 Then 'fire it FIRE_GUN End If End If 'railgun If PLAYER_GUN = 8 Then If PLAYER_RELOAD > 0 Then CanDo = 0 If PLAYER_VARIATION = 0 Then CanDo = 0 If SLUGS < 1 Then CanDo = 0: If OUT_OF_AMMO = 0 Then OUT_OF_AMMO = 1 If CanDo = 1 Then 'fire it FIRE_GUN End If End If 'out of ammo? If OUT_OF_AMMO = 1 Then OUT_OF_AMMO = 2 'make a click sound LOCAL_SOUND "no_ammo.wav" End If End Sub Public Sub SET_TAIL_ANGLE() 'work out, by the situation, our personal tail angle, in comparison to our body facing angle. 'set to the matrix If MATRIX = 0 Then PLAYER_TAIL_HOR = FACING.hor PLAYER_TAIL_VER = FACING.ver PLAYER_TAIL_BAR = FACING.bar End If If MATRIX = 1 Then PLAYER_TAIL_HOR = FACING.hor 'if we are quite still 'PLAYER_TAIL_HOR = TRAVEL.hor 'if we are above a certain low speed PLAYER_TAIL_VER = 0 PLAYER_TAIL_BAR = 0 End If If MATRIX = 2 Then PLAYER_TAIL_HOR = FACING.hor 'if we are quite still 'PLAYER_TAIL_HOR = TRAVEL.hor 'if we are above a certain low speed PLAYER_TAIL_VER = 180 PLAYER_TAIL_BAR = 0 End If 'sort out 360 overlap problem If PLAYER_TAIL_HOR < (FACING.hor - 180) Then PLAYER_TAIL_HOR = PLAYER_TAIL_HOR + 360 If PLAYER_TAIL_VER < (FACING.ver - 180) Then PLAYER_TAIL_VER = PLAYER_TAIL_VER + 360 If PLAYER_TAIL_BAR < (FACING.bar - 180) Then PLAYER_TAIL_BAR = PLAYER_TAIL_BAR + 360 If PLAYER_TAIL_HOR > (FACING.hor + 180) Then PLAYER_TAIL_HOR = PLAYER_TAIL_HOR - 360 If PLAYER_TAIL_VER > (FACING.ver + 180) Then PLAYER_TAIL_VER = PLAYER_TAIL_VER - 360 If PLAYER_TAIL_BAR > (FACING.bar + 180) Then PLAYER_TAIL_BAR = PLAYER_TAIL_BAR - 360 'set boundaries boundary = 45 boundaryleanback = 90 'we can lean back a little more, it looks good - actually for forward too boundarybarrel = 15 'for banking If FLOOR = 0 Then boundaryleanback = 10 If PLAYER_TAIL_HOR > (FACING.hor + boundary) Then PLAYER_TAIL_HOR = FACING.hor + boundary If PLAYER_TAIL_HOR < (FACING.hor - boundary) Then PLAYER_TAIL_HOR = FACING.hor - boundary If PLAYER_TAIL_VER > (FACING.ver + boundaryleanback) Then PLAYER_TAIL_VER = FACING.ver + boundaryleanback If PLAYER_TAIL_VER < (FACING.ver - boundaryleanback) Then PLAYER_TAIL_VER = FACING.ver - boundaryleanback If PLAYER_TAIL_BAR > (FACING.bar + boundarybarrel) Then PLAYER_TAIL_BAR = FACING.bar + boundarybarrel If PLAYER_TAIL_BAR < (FACING.bar - boundarybarrel) Then PLAYER_TAIL_BAR = FACING.bar - boundarybarrel 'cap tail angles CapAngle (PLAYER_TAIL_HOR) CapAngle (PLAYER_TAIL_BAR) CapAngle (PLAYER_TAIL_VER) End Sub Public Sub CapAngle(whatangle As Double) Dim ddone As Boolean ddone = False 'make sure this angle is within 0-360 degrees (maybe less than 360) Do Until ddone If whatangle > 360 Then whatangle = whatangle - 360 If whatangle < 0 Then whatangle = whatangle + 360 If whatangle >= 0 And whatangle <= 360 Then ddone = True Loop End Sub Public Sub MOVEMENT() 'the main physics of movement are here Dim ApplyForce As Integer Dim force As Double Dim GravTV As Double Dim OutrunTV As Double Dim BankSpeed As Double 'slither SLITHER_HOLD = 0 If CONF(SLITHER).value = 0 Then SlitherPower = 0 If CONF(SLITHER).value >= 1 Then Call SLITHER_PHYSICS End If 'banking return (land 1 and 2 only) If MATRIX >= 1 And MATRIX <= 2 Then 'work out banking speed BankSpeed = 0.001 + (CONF(BANK_SPEED).value * 0.0008) 'set limit fixes If BankGoal > (FACING.bar + 180) Then BankGoal = BankGoal - 360 If BankGoal < (FACING.bar - 180) Then BankGoal = BankGoal + 360 'move towards bank goal If FACING.bar < BankGoal Then FACING.bar = FACING.bar + (BankSpeed * NL): If FACING.bar >= BankGoal Then FACING.bar = BankGoal If FACING.bar > BankGoal Then FACING.bar = FACING.bar - (BankSpeed * NL): If FACING.bar <= BankGoal Then FACING.bar = BankGoal End If 'gravity If MATRIX >= 1 Then GRAVITY_PULL.x = TRAVEL.x GRAVITY_PULL.y = TRAVEL.y GRAVITY_PULL.z = TRAVEL.z 'work out terminal velocity GravTV = 150 + CONF(TERMINAL_VELOCITY).value GravTV = GravTV * 2 'kill gravity if we're in a magna beam If InMagnaBeam >= 1 Then GravTV = 0 'outrun_gravity? If CONF(OUTRUN_GRAVITY).value >= 1 Then 'work out what the speed is we need to outrun in order to change gravity OutrunTV = GravTV * 0.5 End If 'plot the point depending on matrix If MATRIX = 1 Then GRAVITY_PULL.y = 0 - GravTV If MATRIX = 2 Then GRAVITY_PULL.y = 0 + GravTV If MATRIX = 3 Then GRAVITY_PULL.z = 0 - GravTV If MATRIX = 4 Then GRAVITY_PULL.z = 0 + GravTV If MATRIX = 5 Then GRAVITY_PULL.x = 0 + GravTV If MATRIX = 6 Then GRAVITY_PULL.x = 0 - GravTV 'work out gravity acceleration force = (80 + CONF(CONF_GRAVITY).value) * 0.0012 'apply gravity to our movement MoveTowards TRAVEL, GRAVITY_PULL, force End If 'bowie physics? If CONF(BOWIE_PHYSICS).value >= 1 Then 'have we outrun gravity? If RawSpeed >= OutrunTV Then 'work out what matrix we are in depending on our facing '1 If FACING.ver > 115 Or FACING.ver < 225 Then If FACING.bar < 45 Or FACING.bar > 315 Then MATRIX = 1 End If End If '2 If FACING.ver > 115 And FACING.ver < 225 Then If FACING.bar < 45 Or FACING.bar > 315 Then MATRIX = 2 End If End If End If End If 'work out the face speed for the face position (potential top speed) FaceSpeed = 15 + (CONF(speed).value * 1.4) FaceSpeed = FaceSpeed - (CONF(ACCELERATION).value * 0.7) FaceSpeed = FaceSpeed + SlitherPower If FaceSpeed <= 0 Then FaceSpeed = 0 'set the point onto the face instrument FACING.x = 0 FACING.y = 0 FACING.z = 0 - FaceSpeed Rotate FACING.x, FACING.y, FACING.bar Rotate FACING.z, FACING.y, FACING.ver Rotate FACING.x, FACING.z, FACING.hor 'work out our acceleration for movement, depending on variables MoveAccel = 2 If FLOOR = 1 Then MoveAccel = MoveAccel + (105 - CONF(CONF_WEIGHT).value) If FLOOR = 0 Then MoveAccel = MoveAccel + (CONF(AERODYNAMICS).value * 7) If FLOOR = 1 Then MoveAccel = MoveAccel + (CONF(ACCELERATION).value * 4) If MoveAccel <= 0 Then MoveAccel = 0 MoveAccel = MoveAccel * 0.0007 'apply forces, there are 8 possible directions of basic movement ApplyForce = 0 If KEY_FORWARD = 1 Then ApplyForce = 1 'forward If KEY_BACK = 1 Then ApplyForce = 2 'back If KEY_LEFT = 1 Then ApplyForce = 3 'left If KEY_RIGHT = 1 Then ApplyForce = 4 'right If KEY_FORWARD = 1 And KEY_LEFT = 1 And KEY_RIGHT = 0 Then ApplyForce = 5 'forward-left If KEY_FORWARD = 1 And KEY_LEFT = 0 And KEY_RIGHT = 1 Then ApplyForce = 6 'forward-right If KEY_BACK = 1 And KEY_LEFT = 1 And KEY_RIGHT = 0 Then ApplyForce = 7 'back-left If KEY_BACK = 1 And KEY_LEFT = 0 And KEY_RIGHT = 1 Then ApplyForce = 8 'back-right If SLITHER_HOLD = 1 Then ApplyForce = 9 'a special force, for slithering 'jump If KEY_JUMP = 1 And FLOOR = 1 Then Call DO_JUMP 'work out the perfect forward situation for slither use later FORWARD = FACING 'have we applied any force If ApplyForce >= 1 Then MOVING = FACING Select Case ApplyForce Case 1 'forward (leave as normal) Case 2 'back Rotate MOVING.x, MOVING.z, 180 MOVING.y = 0 - MOVING.y Case 3 'left MOVING.x = 0 - FaceSpeed: MOVING.y = 0: MOVING.z = 0 Rotate MOVING.x, MOVING.y, MOVING.bar Rotate MOVING.z, MOVING.y, MOVING.ver Rotate MOVING.x, MOVING.z, MOVING.hor Case 4 'right MOVING.x = 0 + FaceSpeed: MOVING.y = 0: MOVING.z = 0 Rotate MOVING.x, MOVING.y, MOVING.bar Rotate MOVING.z, MOVING.y, MOVING.ver Rotate MOVING.x, MOVING.z, MOVING.hor Case 5 'forward-left MOVING.x = 0: MOVING.y = 0: MOVING.z = 0 - FaceSpeed Rotate MOVING.x, MOVING.z, 315 Rotate MOVING.x, MOVING.y, MOVING.bar Rotate MOVING.z, MOVING.y, MOVING.ver Rotate MOVING.x, MOVING.z, MOVING.hor Case 6 'forward-right MOVING.x = 0: MOVING.y = 0: MOVING.z = 0 - FaceSpeed Rotate MOVING.x, MOVING.z, 45 Rotate MOVING.x, MOVING.y, MOVING.bar Rotate MOVING.z, MOVING.y, MOVING.ver Rotate MOVING.x, MOVING.z, MOVING.hor Case 7 'back-left MOVING.x = 0: MOVING.y = 0: MOVING.z = 0 - FaceSpeed Rotate MOVING.x, MOVING.z, 225 Rotate MOVING.x, MOVING.y, MOVING.bar Rotate MOVING.z, MOVING.y, MOVING.ver Rotate MOVING.x, MOVING.z, MOVING.hor Case 8 'back-right MOVING.x = 0: MOVING.y = 0: MOVING.z = 0 - FaceSpeed Rotate MOVING.x, MOVING.z, 135 Rotate MOVING.x, MOVING.y, MOVING.bar Rotate MOVING.z, MOVING.y, MOVING.ver Rotate MOVING.x, MOVING.z, MOVING.hor Case 9 'slither override, will move towards our slither hor MOVING.x = 0 MOVING.y = 0 MOVING.z = 0 - FaceSpeed Rotate MOVING.x, MOVING.y, MOVING.bar Rotate MOVING.z, MOVING.y, MOVING.ver Rotate MOVING.x, MOVING.z, SLITHER_TURN.hor End Select 'over-ride the point if there is gravity, to stop climbing-in air and so on If FLOOR = 0 And MATRIX >= 1 And ApplyForce >= 1 Then If MATRIX = 1 Then MOVING.y = TRAVEL.y If MATRIX = 2 Then MOVING.y = TRAVEL.y If MATRIX = 3 Then MOVING.z = TRAVEL.z If MATRIX = 4 Then MOVING.z = TRAVEL.z If MATRIX = 5 Then MOVING.x = TRAVEL.x If MATRIX = 6 Then MOVING.x = TRAVEL.x End If MoveTowards TRAVEL, MOVING, MoveAccel End If 'over-ride the point if we are on the floor, to prevent sinking into seams, and climbing into the air If FLOOR = 1 And MATRIX >= 1 Then If MATRIX = 1 Then MOVING.y = 0: TRAVEL.y = 0 If MATRIX = 2 Then MOVING.y = 0: TRAVEL.y = 0 If MATRIX = 3 Then MOVING.z = 0: TRAVEL.z = 0 If MATRIX = 4 Then MOVING.z = 0: TRAVEL.z = 0 If MATRIX = 5 Then MOVING.x = 0: TRAVEL.x = 0 If MATRIX = 6 Then MOVING.x = 0: TRAVEL.x = 0 End If 'friction and air resistance If FLOOR = 0 Then force = (5 + CONF(AIR_RESISTANCE).value) * 0.0002 If FLOOR = 1 Then force = (20 + CONF(FRICTION).value) * 0.0007 MoveTowards TRAVEL, CENTERED, force 'magna beam override If InMagnaBeam >= 1 Then If InMagnaBeam = 1 Then TRAVEL.y = 0 - MAGNA_BEAM_SPEED If InMagnaBeam = 2 Then TRAVEL.y = 0 + MAGNA_BEAM_SPEED If InMagnaBeam = 3 Then TRAVEL.z = 0 - MAGNA_BEAM_SPEED If InMagnaBeam = 4 Then TRAVEL.z = 0 + MAGNA_BEAM_SPEED If InMagnaBeam = 5 Then TRAVEL.x = 0 + MAGNA_BEAM_SPEED If InMagnaBeam = 6 Then TRAVEL.x = 0 - MAGNA_BEAM_SPEED End If 'move character! PLAYER_X = PLAYER_X + ((TRAVEL.x * 0.00003) * NL) PLAYER_Y = PLAYER_Y + ((TRAVEL.y * 0.00003) * NL) PLAYER_Z = PLAYER_Z + ((TRAVEL.z * 0.00003) * NL) 'work out the angle of travel TRAVEL.hor = GetAngleFromPoints(0, 0, TRAVEL.x, TRAVEL.z) tempX = TRAVEL.x tempz = TRAVEL.z Rotate tempX, tempz, (0 - TRAVEL.hor) TRAVEL.ver = GetAngleFromPoints(0, 0, tempz, TRAVEL.y) + 90 CapAngle TRAVEL.ver 'work out mph GetMPH 'collision COLLISION 'set old co-ordinates as new OLD_X = PLAYER_X OLD_Y = PLAYER_Y OLD_Z = PLAYER_Z End Sub Public Sub GetMPH() 'work out the MPH of our travel instrument Dim MPH_GAUGE As PHYSICS_INSTRUMENT 'set up a temporary instrument MPH_GAUGE = TRAVEL 'rotate it back on itself so its north Rotate MPH_GAUGE.x, MPH_GAUGE.z, 0 - MPH_GAUGE.hor Rotate MPH_GAUGE.z, MPH_GAUGE.y, 0 - MPH_GAUGE.ver 'get raw unit speed RawSpeed = Abs(MPH_GAUGE.z) 'get kph and main conversion KPH = Abs(MPH_GAUGE.z) * 0.38 'get mph conversion MPH = KPH * 0.621371192 End Sub Public Sub GetMissileMPH(mSpeedX, mSpeedY, mSpeedZ, mHor, mBar, mVer) 'work out the speed of this missile 'we know that a player moves at 0.00003, and a missile moves at 0.0001 (notice the less 0) Dim MISSILE_GAUGE As PHYSICS_INSTRUMENT 'set up a temporary instrument MISSILE_GAUGE.x = mSpeedX MISSILE_GAUGE.y = mSpeedY MISSILE_GAUGE.z = mSpeedZ MISSILE_GAUGE.hor = mHor MISSILE_GAUGE.bar = mBar MISSILE_GAUGE.ver = mVer 'rotate it back on itself so its north Rotate MISSILE_GAUGE.x, MISSILE_GAUGE.z, 0 - MISSILE_GAUGE.hor Rotate MISSILE_GAUGE.z, MISSILE_GAUGE.y, 0 - MISSILE_GAUGE.ver 'get kph MissileClockSpeed = Abs(MISSILE_GAUGE.z) * 0.38 'get mph MissileClockSpeed = MissileClockSpeed * 0.621371192 'convert because of the difference in player movement MissileClockSpeed = MissileClockSpeed / 0.3 End Sub Public Function GetAngleFromPoints(pointX1, pointY1, pointX2, pointY2) As Double 'work out the angle in degrees by knowing the points. 'point 1 represents the axis, while point 2 is the entity the angle will face 'this means for an aim bot shooting a player, point 2 is the player, and point 1 would be the bot Dim XXX As Double Dim YYY As Double Dim angle As Double Dim ori As Integer XXX = pointX2 - pointX1 YYY = pointY2 - pointY1 If XXX <= 0.0000001 And XXX >= -0.0000001 Then XXX = 0.0000001 If YYY <= 0.0000001 And YYY >= -0.0000001 Then YYY = 0.0000001 'ney If XXX >= 0 And YYY <= 0 Then angle = (1 * (PI / 2)) + Atn(YYY / XXX): ori = 1 'se If XXX >= 0 And YYY >= 0 Then angle = (1 * (PI / 2)) + Atn(YYY / XXX): ori = 2 'sw If XXX <= 0 And YYY >= 0 Then angle = (1 * (PI / 2)) + Atn(YYY / XXX): ori = 3 'nw If XXX <= 0 And YYY <= 0 Then angle = (3 * (PI / 2)) + Atn(YYY / XXX): ori = 4 angle = angle * (180 / PI) If ori >= 3 Then angle = angle + 180 'angle = angle + 1 If angle >= 360 Then angle = angle - 180 If angle >= 360 Then angle = angle - 180 'pointX2 = XX: pointY2 = YY GetAngleFromPoints = angle End Function Public Sub SLITHER_PHYSICS() 'all slither physics are here Dim Influence As Double Dim InfDir As Integer Dim tSLITH As Double Dim tFACING As Double Dim GainLimit As Double Dim SlitherSlowDown As Double Dim BankLimit As Double 'begin a slither If SlitherDir = 0 Then 'reset the gain SlitherGain = 0 'LAND 1 If MATRIX = 1 Then 'slither right If KEY_FORWARD = 1 And KEY_BACK = 0 And KEY_LEFT = 0 And KEY_RIGHT = 1 Then SlitherDir = 1 CrossoverPoint = TRAVEL.hor LastSlitherHor = FACING.hor SLITHER_TURN = TRAVEL End If 'slither left If KEY_FORWARD = 1 And KEY_BACK = 0 And KEY_LEFT = 1 And KEY_RIGHT = 0 Then SlitherDir = 2 CrossoverPoint = TRAVEL.hor LastSlitherHor = FACING.hor SLITHER_TURN = TRAVEL End If End If 'LAND 2 If MATRIX = 2 Then 'slither right If KEY_FORWARD = 1 And KEY_BACK = 0 And KEY_LEFT = 1 And KEY_RIGHT = 0 Then SlitherDir = 1 CrossoverPoint = TRAVEL.hor LastSlitherHor = FACING.hor SLITHER_TURN = TRAVEL End If 'slither left If KEY_FORWARD = 1 And KEY_BACK = 0 And KEY_LEFT = 0 And KEY_RIGHT = 1 Then SlitherDir = 2 CrossoverPoint = TRAVEL.hor LastSlitherHor = FACING.hor SLITHER_TURN = TRAVEL End If End If End If 'stop the slither if we're in mid-air If FLOOR = 0 Then SlitherDir = 0 'doing a slither If SlitherDir > 0 Then PSLITHERPOWER = 0 'looparound fix If FACING.hor > (LastSlitherHor + 180) Then LastSlitherHor = LastSlitherHor + 360 If FACING.hor < (LastSlitherHor - 180) Then LastSlitherHor = LastSlitherHor - 360 'capture the power PSLITHERPOWER = FACING.hor - LastSlitherHor 'wrong way? end the slither and power If PSLITHERPOWER > 0 And SlitherDir = 1 Then SlitherDir = 0: PSLITHERPOWER = 0: SlitherPower = 0 If PSLITHERPOWER < 0 And SlitherDir = 2 Then SlitherDir = 0: PSLITHERPOWER = 0: SlitherPower = 0 'the right way? gain the power If PSLITHERPOWER > 0 And SlitherDir = 2 Then PSLITHERPOWER = Abs(PSLITHERPOWER) If PSLITHERPOWER < 0 And SlitherDir = 1 Then PSLITHERPOWER = Abs(PSLITHERPOWER) 'got power? If PSLITHERPOWER > 0 Then 'convert the power PSLITHERPOWER = PSLITHERPOWER * 1 'add it to the gain SlitherGain = SlitherGain + PSLITHERPOWER 'work out the gain limit GainLimit = 45 + (CONF(SLITHER_GAIN).value * 0.8) 'add the power if under the limit If SlitherGain <= GainLimit Then SlitherPower = SlitherPower + PSLITHERPOWER 'take away power if its over the gain! If SlitherGain > GainLimit Then SlitherPower = SlitherPower - PSLITHERPOWER End If 'remember the last hor LastSlitherHor = FACING.hor 'set slither force to over-ride our other forces SLITHER_HOLD = 1 'grip Influence = CONF(GRIP).value * 0.015 MoveTowards TRAVEL, FORWARD, Influence End If 'banking If MATRIX >= 1 And MATRIX <= 2 Then If SlitherDir = 0 Then BankGoal = 0 If SlitherDir > 0 Then 'work out the banking amount in degrees BankGoal = Abs((SlitherGain * 0.01) * (CONF(SLITHER_BANK).value * 0.7)) If SlitherDir = 1 Then BankGoal = 0 - BankGoal If SlitherDir = 2 Then BankGoal = 0 + BankGoal 'invert if we're on LAND 2 If MATRIX = 2 Then BankGoal = 0 - BankGoal End If 'bank limits BankLimit = 10 + (CONF(BANK_LIMIT).value * 0.5) If BankGoal >= BankLimit Then BankGoal = BankLimit If BankGoal <= (0 - BankLimit) Then BankGoal = 0 - BankLimit End If 'letting go of certain controls will release the slither If KEY_LEFT = 0 And KEY_RIGHT = 0 Then SlitherDir = 0 If KEY_FORWARD = 0 Then SlitherDir = 0 'slow down power while not slithering If SlitherPower > 0 And SlitherDir = 0 Then 'general lubricant SlitherSlowDown = 0.1 SlitherPower = SlitherPower - (NL * SlitherSlowDown) End If 'slow down during slither If SlitherPower > 0 And SlitherDir > 0 Then 'resistance goes up, to make it harder to gain speed SlitherSlowDown = -0.05 + (RawSpeed * 0.0007) 'this adjustment has a huge impact on slither speed If SlitherSlowDown <= 0 Then SlitherSlowDown = 0 eva = SlitherSlowDown SlitherPower = SlitherPower - (NL * SlitherSlowDown) End If 'stop negative power If SlitherPower <= 0 Then SlitherPower = 0 End Sub Public Sub WEAPONS() 'weapons physics 'trying to fire a gun? If KEY_FIRE = 1 And PLAYER_GUN >= 1 Then PULL_TRIGGER End If 'reload physics If PLAYER_RELOAD > 0 Then PLAYER_RELOAD = PLAYER_RELOAD - NL If PLAYER_RELOAD <= 0 Then PLAYER_RELOAD = 0 'reload has happened here, put click sounds here etc 'reload fan If PLAYER_GUN = 2 Then PLAYER_SPECIAL = CONF(R_FAN_TYPE).value End If End If 'changing gun If CHANGING_GUN > 0 Then CHANGING_GUN = CHANGING_GUN - NL 'do animations here instead of in animations, since changing a gun is generally a physical thing 'the speed and gravity of the spring cant be changed, as the gun change relys on it 'also, the gun changes on the crossover point, but the script is called at the end GUN_SPRING = GUN_SPRING + (SPRING_SPEED * NL) SPRING_SPEED = SPRING_SPEED - (SPRING_GRAVITY * NL) If SPRING_SPEED < 0 Then 'over halfway PLAYER_GUN = CHANGE_TO_GUN 'set the specific gun to the config gun If PLAYER_GUN = 1 Then PLAYER_VARIATION = CONF(R_ROCKET_LAUNCHER).value: PLAYER_SPECIAL = CONF(R_ROCKET_TYPE).value If PLAYER_GUN = 2 Then PLAYER_VARIATION = CONF(R_FAN_CANNON).value: PLAYER_SPECIAL = CONF(R_FAN_TYPE).value If PLAYER_GUN = 3 Then PLAYER_VARIATION = CONF(R_FORK_GUN).value: PLAYER_SPECIAL = 0 If PLAYER_GUN = 4 Then PLAYER_VARIATION = CONF(R_SHOTGUN).value: PLAYER_SPECIAL = 0 If PLAYER_GUN = 5 Then PLAYER_VARIATION = CONF(R_RIFLE).value: PLAYER_SPECIAL = 0 If PLAYER_GUN = 6 Then PLAYER_VARIATION = CONF(R_GRENADE_LAUNCHER).value: PLAYER_SPECIAL = 0 If PLAYER_GUN = 7 Then PLAYER_VARIATION = CONF(R_MACHINEGUN).value: PLAYER_SPECIAL = 0 If PLAYER_GUN = 8 Then PLAYER_VARIATION = CONF(R_RAIL_GUN).value: PLAYER_SPECIAL = 0 If PLAYER_GUN = 9 Then PLAYER_VARIATION = CONF(R_SPECIAL_GUN).value: PLAYER_SPECIAL = 0 End If If GUN_SPRING <= 0 Then GUN_SPRING = 0 'change gun now If CHANGING_GUN <= 0 Then CHANGING_GUN = 0 PLAYER_GUN = CHANGE_TO_GUN GUN_SPRING = 0 SPRING_SPEED = 0 SPRING_GRAVITY = 0 'call a gun changing script here RemoteScript "CHANGE_GUN" If PLAYER_GUN = 0 Then RemoteScript "CHANGE_TO_NOGUN" If PLAYER_GUN = 1 Then RemoteScript "CHANGE_TO_ROCKET" If PLAYER_GUN = 2 Then RemoteScript "CHANGE_TO_FAN" If PLAYER_GUN = 3 Then RemoteScript "CHANGE_TO_FORK" If PLAYER_GUN = 4 Then RemoteScript "CHANGE_TO_SHOTGUN" If PLAYER_GUN = 5 Then RemoteScript "CHANGE_TO_RIFLE" If PLAYER_GUN = 6 Then RemoteScript "CHANGE_TO_GRENADE" If PLAYER_GUN = 7 Then RemoteScript "CHANGE_TO_MACHINE" If PLAYER_GUN = 8 Then RemoteScript "CHANGE_TO_RAIL" If PLAYER_GUN = 9 Then RemoteScript "CHANGE_TO_SPECIAL" End If End If End Sub