|
-
Apr 25th, 2001, 07:47 PM
#1
Thread Starter
Addicted Member
Can this be Done
Guys I am building an editor for a game right now I got all the data being pulled from one get routine which is already making it run slow and I only have 1/4 of the get's done
how can I make so instead of doing all of this in the click of a
button
HOW CAN i WRITE THIS SO i CAN GO TO FILE CLICK OPEN SELECT THE FILE THEN LET IT GET ALL THE GETS AND MAKE THEM GLOBAL VARIEABLES SO I CAN
CALL THEM FROM 2 OR 3 DIFFRENT FORMS. i THINK IT WOULD SPEED UP EACH FORM CORRECT?? IF I OPENEND EVERYTHING FROM THE BEGENING THEN JUST CALLED THE VARIABLE
THANKS,
LEARNING MATT
im P$, n$
Dim x As Integer
Dim PlayerAddOff As Integer
Dim PlayerMultOff As Integer
Dim CPlayerAddOff As Integer
Dim CPlayerMultOff As Integer
Dim NPlayerAddOff As Integer
Dim NPlayerMultOff As Integer
Dim CPlayerMult As Integer
Dim NPlayerMult As Integer
Dim CPlayerAdd As Integer
Dim NPlayerAdd As Integer
Dim CPlayerNumber As Integer
Dim NPlayerNumber As Integer
Dim lastname As String
Dim NameLength As Integer
Dim nu As String * 1
Dim player As Integer
' team abv
Dim cteamabvoff As Long
Dim nteamabvoff As Long
Dim cteamabvmult As Integer
Dim nteamabvmult As Integer
Dim Tmabv As String
Dim abvlength As Integer
' team city
Dim ccitynm As Integer
Dim ncitynm As Integer
Dim ccitynum As Long
Dim ncitynum As Long
Dim citylength As Integer
Dim ccitymultoff As Long
Dim ncitymultoff As Long
Dim ccityaddoff As Long
Dim ncityaddoff As Long
Dim ccitymult As Integer
Dim ccityadd As Integer
Dim ncitymult As Integer
Dim ncityadd As Integer
Dim Cityname As String
'team name
Dim cnicknm As Integer
Dim nnicknm As Integer
Dim cnicknum As Long
Dim nnicknum As Long
Dim nicklength As Integer
Dim cnickmultoff As Long
Dim nnickmultoff As Long
Dim cnickaddoff As Long
Dim nnickaddoff As Long
Dim cnickmult As Integer
Dim cnickadd As Integer
Dim nnickmult As Integer
Dim nnickadd As Integer
Dim nickname As String
' team uniforms
Dim Hhelm As String
Dim Hskin As String
Dim Hjers As String
Dim Ahelm As String
Dim Askin As String
Dim Ajers As String
Dim HHelmoff As Long
Dim HSkinoff As Long
Dim HJersoff As Long
Dim AHelmoff As Long
Dim ASkinoff As Long
Dim AJersoff As Long
' team playbooks
Dim run1n2 As String
Dim run3n4 As String
Dim pass1n2 As String
Dim pass3n4 As String
Dim run1n2off As Long
Dim run3n4off As Long
Dim pass1n2off As Long
Dim pass3n4off As Long
Open "C:\test.nes" For Binary Access Read As #1
For player = 1 To 30
PlayerAddOff = CDec(&H10)
PlayerMultOff = CDec(&H11)
CPlayerAddOff = ((team * 60) + (player * 2) + 11)
CPlayerMultOff = CPlayerAddOff + 1
NPlayerAddOff = CPlayerAddOff + 2
NPlayerMultOff = CPlayerAddOff + 3
' team abv
cteamabvoff = CDec(&H1FCFC) + (4 * team)
nteamabvoff = cteamabvoff + 4
' team city
ccitymultoff = CDec((&H1FC4E) + (team * 2))
ccityaddoff = ccitymultoff + 1
ncitymultoff = ccitymultoff + 2
ncityaddoff = ccitymultoff + 3
' team nick
cnickmultoff = CDec((&H1FC8E) + (team * 2))
cnickaddoff = cnickmultoff + 1
nnickmultoff = cnickmultoff + 2
nnickaddoff = cnickmultoff + 3
' team Uniform
HHelmoff = CDec((&H2C2DA) + (team * 10))
HSkinoff = HHelmoff + 1
HJersoff = HHelmoff + 2
AHelmoff = HHelmoff + 3
ASkinoff = HHelmoff + 4
AJersoff = HHelmoff + 5
' team playbooks
run1n2off = CDec((&H1D30C) + (team * 4))
run3n4off = run1n2off + 1
pass1n2off = run1n2off + 2
pass3n4off = run1n2off + 3
'now that we know the offsets open the file and get the data
Get #1, CPlayerAddOff, nu
CPlayerAdd = Asc(nu)
Get #1, CPlayerMultOff, nu
CPlayerMult = Asc(nu)
Get #1, NPlayerAddOff, nu
NPlayerAdd = Asc(nu)
Get #1, NPlayerMultOff, nu
NPlayerMult = Asc(nu)
' team Abv
Get #1, cteamabvoff, nu
cteamabvmult = Asc(nu)
Get #1, nteamabvoff, nu
nteamabvmult = Asc(nu)
' team city
Get #1, ccitymultoff, nu
ccitymult = Asc(nu)
Get #1, ccityaddoff, nu
ccityadd = Asc(nu)
Get #1, ncitymultoff, nu
ncitymult = Asc(nu)
Get #1, ncityaddoff, nu
ncityadd = Asc(nu)
If ccitymult = 190 Or ncitymult = 190 Then
ccitymult = 255 + 190
ncitymult = 255 + 190
Else
ccitymult = 189
ncitymult = 189
End If
' Team nick
Get #1, cnickmultoff, nu
cnickmult = Asc(nu)
Get #1, cnickaddoff, nu
cnickadd = Asc(nu)
Get #1, nnickmultoff, nu
nnickmult = Asc(nu)
Get #1, nnickaddoff, nu
nnickadd = Asc(nu)
If cnickmult = 191 Or nnickmult = 191 Then
cnickmult = 510 + 191
nnickmult = 510 + 191
Else
cnickmult = 445
nnickmult = 445
End If
CPlayerNumber = ((CPlayerMult - 128) * 256) + CPlayerAdd + PlayerAddOff
NPlayerNumber = ((NPlayerMult - 128) * 256) + NPlayerAdd + PlayerAddOff
' team city
ccitynum = CDec(&H1FC53) + ccitymult + ccityadd
ncitynum = CDec(&H1FC53) + ncitymult + ncityadd
If ncitynum <= ccitynum Then
ncitynum = ncitynum + 256
End If
' team nick
cnicknum = CDec(&H1FC53) + cnickmult + cnickadd
nnicknum = CDec(&H1FC53) + nnickmult + nnickadd
If nnicknum <= cnicknum Then
nnicknum = nnicknum + 256
End If
Get #1, CPlayerNumber + 1, nu
PlayerNumber = Hex(Asc(nu))
NameLength = (NPlayerNumber - CPlayerNumber) - 1
lastname = String(NameLength, " ")
Get #1, CPlayerNumber + 2, lastname
PlayerNam = lastname
'team abv
abvlength = (nteamabvoff - cteamabvoff) - 1
Tmabv = String(abvlength, " ")
Get #1, cteamabvoff + 1, Tmabv
Teamabv.Text = Tmabv
' team city
citylength = (ncitynum - ccitynum)
Cityname = String(citylength, " ")
Get #1, ccitynum + 1, Cityname
Teamcity.Text = Cityname
' team nick
nicklength = (nnicknum - cnicknum)
nickname = String(nicklength, " ")
Get #1, cnicknum + 1, nickname
Teamnick.Text = nickname
' team unifroms
Get #1, HHelmoff + 1, nu
Hhelm = Hex(Asc(nu))
Hhel.Text = Hhelm
Get #1, HSkinoff + 1, nu
Hskin = Hex(Asc(nu))
Hskn.Text = Hskin
Get #1, HJersoff + 1, nu
Hjers = Hex(Asc(nu))
Hjer.Text = Hjers
Get #1, AHelmoff + 1, nu
Ahelm = Hex(Asc(nu))
Ahel.Text = Ahelm
Get #1, ASkinoff + 1, nu
Askin = Hex(Asc(nu))
Askn.Text = Askin
Get #1, AJersoff + 1, nu
Ajers = Hex(Asc(nu))
Ajer.Text = Ajers
' team playbooks
Get #1, run1n2off + 1, nu
run1.Tag = Hex(Int(Asc(nu) / &H10)) 'The x in &Hxy
If run1.Tag = "0" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-0.bmp")
End If
If run1.Tag = "1" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-1.bmp")
End If
If run1.Tag = "2" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-2.bmp")
End If
If run1.Tag = "3" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-3.bmp")
End If
If run1.Tag = "4" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-4.bmp")
End If
If run1.Tag = "5" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-5.bmp")
End If
If run1.Tag = "6" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-6.bmp")
End If
If run1.Tag = "7" Then
Set run1.Picture = LoadPicture("c:\tecmo\r1-7.bmp")
End If
run2.Tag = Hex(Asc(nu) Mod &H10) 'The y in &Hxy
If run2.Tag = "0" Then
Set run2.Picture = LoadPicture("c:\tecmo\r2-0.bmp")
End If
If run2.Tag = "1" Then
Set run2.Picture = LoadPicture("c:\tecmo\r2-1.bmp")
End If
If run2.Tag = "2" Then
Set run2.Picture = LoadPicture("c:\tecmo\r2-2.bmp")
End If
If run2.Tag = "3" Then
Set run2.Picture = LoadPicture("c:\tecmo\r2-3.bmp")
End If
If run2.Tag = "4" Then
Set run2.Picture = LoadPicture("c:\tecmo\r2-4.bmp")
End If
If run2.Tag = "5" Then
Set run2.Picture = LoadPicture("c:\tecmo\r2-5.bmp")
End If
If run2.Tag = "6" Then
Set run2.Picture = LoadPicture("c:\tecmo\r2-6.bmp")
End If
If run2.Tag = "7" Then
Set run2.Picture = LoadPicture("c:\tecmo\r2-7.bmp")
End If
-
Apr 25th, 2001, 09:02 PM
#2
Thread Starter
Addicted Member
am I saying this wrong?
Did I not explain this clear?
Thanks,
Matt
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|