Author Topic: Project looking for Programmer (I can't do it myself)  (Read 44154 times)

0 Members and 1 Guest are viewing this topic.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #75 on: November 21, 2021, 08:16:00 pm »
Hi Daniel3D
huh, interesting notice
Quote
TREESTU1 is the correct file list
I have had some time to spend with QB64, so I make another step towards the final  application ofinstaller

here code running pure Qbasic

Code: QB64: [Select]
  1. ' 2021 11 21 adding and testing procedure to copy original files from source path to destination path
  2. ' 2021 11 13, Modifications to Installation menu
  3. ' 3 choices: install game, install mods, exit from installation
  4. DECLARE SUB UpdateRunFile ()
  5. DECLARE SUB SaveConfig ()
  6. DECLARE SUB LoadConfig ()
  7. DECLARE SUB UpdateOp (oplist$, num%, opval$, length%)
  8. DECLARE FUNCTION Menu% (m AS ANY, mm$, ini%)
  9. declare sub header
  10. declare sub changepath (kind as integer)
  11.  
  12. Type MenuType
  13.     x As Integer
  14.     y As Integer
  15.     c1 As Integer
  16.     c2 As Integer
  17.     w As Integer
  18.  
  19. Const Spath = "A:\", Dpath = "C:\STUNTS", Source = 1, Destination = 2
  20. Const MainWin = 1, InstallWin = 2, MsgWin = 7
  21. Dim Shared men(1 To 5) As MenuType, ment$(1 To 5), ErrMsg$(1 To 4), CurErr%
  22. Dim Shared videoid$(1 To 5), soundid$(1 To 6), curvideo%, cursound%, Mpath$(1 To 5, 1 To 2)
  23. Dim Shared runfile$, SourcePath$, DestPath$, DummyCurpath%, DefaultSourcePath$, DefaultDestinationpath$
  24. Dim Shared InstFile(1 To 250) As String
  25.  
  26. runfile$ = "STUNTS.BAT"
  27. Defaultsourcepat$ = Spath
  28. DefaultDestinationpath$ = Dpath
  29. SourcePath$ = ".\"
  30. DestPath$ = ".\cs11"
  31. DummyCurpath% = 1
  32.  
  33. videoid$(1) = "MCGA"
  34. videoid$(2) = "EGA"
  35. videoid$(3) = "Tandy"
  36. videoid$(4) = "Hercules"
  37. videoid$(5) = "CGA"
  38. curvideo% = 1
  39.  
  40. soundid$(1) = "No sound"
  41. soundid$(2) = "PC Speaker"
  42. soundid$(3) = "Tandy"
  43. soundid$(4) = "Ad Lib"
  44. soundid$(5) = "Sound Blaster"
  45. soundid$(6) = "MT-32"
  46. cursound% = 1
  47.  
  48.  
  49. header
  50.  
  51. men(1).x = 4
  52. men(1).y = 7
  53. men(1).w = 40
  54. men(1).c1 = 7
  55. men(1).c2 = 4
  56. ment$(1) = "Video display`Sound option`Install game to ...`Exit"
  57.  
  58. men(2).x = 13
  59. men(2).y = 12
  60. men(2).w = 27
  61. men(2).c1 = 0
  62. men(2).c2 = 2
  63. ment$(2) = "MGCA/VGA graphics`EGA graphics`Tandy graphics`Hercules graphics`CGA graphics"
  64.  
  65. men(3).x = 11
  66. men(3).y = 12
  67. men(3).w = 34
  68. men(3).c1 = 0
  69. men(3).c2 = 2
  70. ment$(3) = "No music or sound effects`Internal PC speaker`Tandy sound`Ad Lib card`Sound Blaster card`Roland MT-32"
  71.  
  72.  
  73. men(4).x = 11
  74. men(4).y = 12
  75. men(4).w = 40
  76. men(4).c1 = 0
  77. men(4).c2 = 1
  78. ment$(4) = "Install game`Install mods`Exit"
  79.  
  80.  
  81. men(5).x = 67
  82. men(5).y = 15
  83. men(5).w = 10
  84. men(5).c1 = 0
  85. men(5).c2 = 4
  86. ment$(5) = "Yes`No`Cancel"
  87.  
  88. ErrMsg$(1) = "Error: file of configuration not found"
  89. ErrMsg$(2) = "Error: file of list of installation not found"
  90. ErrMsg$(3) = "Error: file of original installation not found"
  91. ErrMsg$(4) = "Error: file of Mods installation not found"
  92. CurErr% = 0
  93.  
  94. Mpath$(1, Source) = "Caution you are changing default source path!"
  95. Mpath$(2, Source) = "Type here source path: "
  96. Mpath$(3, Source) = "This is the new source path: "
  97.  
  98. Mpath$(1, Destination) = "Caution you are changing default destination path!"
  99. Mpath$(2, Destination) = "Type here destination path: "
  100. Mpath$(3, Destination) = "This is the new destination path: "
  101.  
  102.  
  103. GoSub Fileok
  104. LoadConfig
  105.  
  106. ' loading list file installation
  107. GoSub Fileok
  108. CurErr% = 2
  109.  
  110. Open "liststu.txt" For Input As #1
  111. z = 0
  112.     z = z + 1
  113.     Line Input #1, tmp$
  114.     If InStr(tmp$, ".") Then InstFile(z) = tmp$ Else z = z - 1
  115.     'Print InstFile(z), z
  116.     'If z Mod 20 = 0 Then Sleep
  117. CurErr% = 0
  118.  
  119. UpdateOp ment$(1), 1, videoid$(curvideo%), men(1).w - 2
  120. UpdateOp ment$(1), 2, soundid$(cursound%), men(1).w - 2
  121.  
  122. curmain% = 1
  123.     a% = Menu%(men(1), ment$(1), curmain%)
  124.     If a% <> -1 Then curmain% = a%
  125.     Select Case a%
  126.         Case -1 ' exiting by EScape key from menu
  127.             Color 7, 0
  128.             Cls
  129.             Print
  130.             Exit Do
  131.         Case 4 'saving configuration
  132.             SaveConfig
  133.             UpdateRunFile
  134.             Color 7, 0
  135.             Cls
  136.             Print
  137.             Print "Configuration saved."
  138.             Exit Do
  139.         Case 1 'video display settings
  140.             PCopy 0, MainWin
  141.             a% = Menu%(men(2), ment$(2), curvideo%)
  142.             If a% <> -1 Then curvideo% = a%
  143.             UpdateOp ment$(1), 1, videoid$(curvideo%), men(1).w - 2
  144.             PCopy MainWin, 0
  145.         Case 2 ' sound options
  146.             PCopy 0, MainWin
  147.             a% = Menu%(men(3), ment$(3), cursound%)
  148.             If a% <> -1 Then cursound% = a%
  149.             UpdateOp ment$(1), 2, soundid$(cursound%), men(1).w - 2
  150.             PCopy MainWin, 0
  151.         Case 3 'install options....
  152.             ' here user can choose  installation of original game
  153.             ' adding mods
  154.             ' after doing this he can choose destination folder, source folder
  155.             PCopy 0, MainWin
  156.             Do
  157.  
  158.                 b% = Menu%(men(4), ment$(4), DummyCurpath%)
  159.                 PCopy 0, InstallWin
  160.                 Select Case b%
  161.                     Case 1 ' game standard installation
  162.                         ChangePath Source
  163.                         PCopy InstallWin, 0
  164.                         ChangePath Destination
  165.                         GoSub Fileok
  166.                         CurErr% = 3
  167.                         If Right$(SourcePath$, 1) <> "\" Then Slash$ = "\" Else Slash$ = ""
  168.                         If Right$(DestPath$, 1) <> "\" Then Slash2$ = "\" Else Slash2$ = ""
  169.                         For w = 1 To z Step 1
  170.                             nameFile$ = SourcePath$ + Slash$ + LTrim$(InstFile(w))
  171.                             Locate 20, 1: Print nameFile$; "  ";
  172.                             namefile2$ = DestPath$ + Slash2$ + LTrim$(InstFile(w))
  173.                             Open nameFile$ For Input As #1
  174.                             tmp$ = Input$(LOF(1), # 1)
  175.                             Close #1
  176.                             MkDir DestPath$ + Slash2$
  177.                             Open namefile2$ For Binary As #1
  178.                             Put #1, , tmp$
  179.                             Close #1
  180.                             tmp$ = ""
  181.                         Next w
  182.                         CurErr% = 0
  183.                         On Error GoTo 0
  184.                         PCopy InstallWin, 0
  185.  
  186.  
  187.                     Case 2 ' mods installation
  188.                         ChangePath Source
  189.                         PCopy InstallWin, 0
  190.                         ChangePath Destination
  191.  
  192.                         GoSub Fileok
  193.                         CurErr% = 4
  194.  
  195.                         '  Open "filen" For Input As #1
  196.  
  197.  
  198.                         CurErr% = 0
  199.                         On Error GoTo 0
  200.                         PCopy InstallWin, 0
  201.  
  202.                     Case 3 ' return to option menu
  203.                         PCopy MainWin, 0
  204.                         Exit Do
  205.  
  206.                 End Select
  207.  
  208.             Loop
  209.  
  210.     End Select
  211.  
  212. Print "Use " + UCase$(runfile$) + " to play Stunts"
  213.  
  214. Fileok:
  215. On Error GoTo nofile
  216. If CurErr% = 0 Then CurErr% = 1
  217.  
  218. nofile:
  219. If CurErr% = 2 Or CurErr% = 3 Then k = 4 Else k = 0
  220. ShowMessage 14, 0, 16, 19, 20, 50 + k, 0, 3, ErrMsg$(CurErr%)
  221. If CurErr% = 3 Or CurErr% = 4 Then
  222.     If tmp$ = "" Then Filename$ = nameFile$ Else Filename$ = namefile2$
  223.     ShowMessage 14, 0, 16, 19, 20, 50, 0, 3, "File error: " + Filename$
  224.     Resume Next
  225.  
  226. Sub ChangePath (Mtype As Integer)
  227.     If Mtype = Source Then
  228.         Apath$ = SourcePath$
  229.         k = 0
  230.     Else
  231.         Apath$ = DestPath$
  232.         k = 4
  233.     End If
  234.     ShowMessage 14, 0, 16, 19, 15, 56 + k, 0, 3, Mpath$(1, Mtype)
  235.     Locate 19, 20: Color 14, 0: Print "Actual path: "; Apath$
  236.     Locate 20, 20:
  237.     If Mtype = Source Then
  238.         Input "Type here source path: ", a$
  239.     ElseIf Mtype = Destination Then
  240.         Input "Type here destination path: ", a$
  241.     End If
  242.  
  243.     If a$ = "" Or a$ = Apath$ Then
  244.         Locate 21, 20: Print " No new path": Sleep 1
  245.     Else
  246.         Locate 21, 20: Print Mpath$(3, Mtype); UCase$(a$); " , do you confirm?"
  247.         c% = Menu%(men(5), ment$(5), DummyCurpath%)
  248.         If c% = 1 Then
  249.             Apath$ = a$
  250.             If Mtype = Source Then SourcePath$ = Apath$ Else DestPath$ = Apath$
  251.         ElseIf c% = 2 Then
  252.             ' nothing is changed
  253.         End If
  254.     End If
  255.  
  256.  
  257.  
  258. Sub ShowMessage (Fcol, Bcol, Urow, Brow, FstCo, WidthMsg, sFcol, sBcol, Msg$)
  259.     'Subroutine to show a message on the ASCII screen and restore
  260.     ' the previous screen after message has been shown
  261.     ' Usage: SHOWMESSAGE Forwardcolor, Backgroundcolor, UpRow, BottomRow,FirstColumn, WidthMessagge,shadowForwardColor,shadowBackgroundColor, Message$
  262.     Dim z As Integer
  263.  
  264.     PCopy 0, MsgWin
  265.     Color Fcol, Bcol
  266.     For z = Urow To Brow
  267.         Locate z, FstCo: Print Space$(WidthMsg);
  268.     Next z
  269.     Color sFcol, sBcol
  270.     For z = Urow + 1 To Brow
  271.         Locate z, FstCo + WidthMsg: Print "  ";
  272.     Next z
  273.  
  274.     Locate Brow + 1, FstCo + 2: Print Space$(WidthMsg);
  275.     Color Fcol, Bcol
  276.     Locate Urow + 1, FstCo + 5: Print Msg$
  277.     Sleep 2
  278.     PCopy MsgWin, 0
  279.  
  280. Sub LoadConfig
  281.     'Make sure the file exists
  282.     '  Open "setup.cfg" For Binary As 1: Close 1
  283.  
  284.     Open "setup.cfg" For Input As 1
  285.     Do Until EOF(1)
  286.         Line Input #1, a$
  287.         n% = InStr(a$, "=")
  288.         If n% Then
  289.             p$ = LCase$(LTrim$(RTrim$(Left$(a$, n% - 1))))
  290.             v$ = LTrim$(RTrim$(Mid$(a$, n% + 1)))
  291.  
  292.             Select Case p$
  293.                 Case "video"
  294.                     For i% = 1 To 5
  295.                         If LCase$(v$) = LCase$(videoid$(i%)) Then
  296.                             curvideo% = i%
  297.                             Exit For
  298.                         End If
  299.                     Next i%
  300.                 Case "sound"
  301.                     For i% = 1 To 6
  302.                         If LCase$(v$) = LCase$(soundid$(i%)) Then
  303.                             cursound% = i%
  304.                             Exit For
  305.                         End If
  306.                     Next i%
  307.                 Case "runfile"
  308.                     runfile$ = Left$(v$, 12)
  309.             End Select
  310.         End If
  311.     Loop
  312.     Close 1
  313.  
  314. Function Menu% (m As MenuType, mm$, ini%)
  315.     Dim mop$(1 To 20), mops As Integer
  316.  
  317.     mt$ = mm$
  318.     Do Until Len(mt$) = 0
  319.         mops = mops + 1
  320.         n% = InStr(mt$, "`")
  321.         If n% Then
  322.             mop$(mops) = Left$(mt$, n% - 1)
  323.             mt$ = Mid$(mt$, n% + 1)
  324.         Else
  325.             mop$(mops) = mt$
  326.             mt$ = ""
  327.         End If
  328.     Loop
  329.  
  330.     Color m.c1, m.c2
  331.     Locate m.y, m.x
  332.     Print "Ú" + String$(m.w, 196) + "¿";
  333.     For i% = m.y + 1 To m.y + mops
  334.         Locate i%, m.x
  335.         Print "³ " + mop$(i% - m.y) + Space$(m.w - Len(mop$(i% - m.y)) - 1) + "³";
  336.     Next i%
  337.     Locate m.y + mops + 1, m.x
  338.     Print "À" + String$(m.w, 196) + "Ù";
  339.     Color 8, 0
  340.     For i% = m.y + 1 To m.y + mops + 1
  341.         Locate i%, m.x + m.w + 2
  342.         Print "  ";
  343.     Next i%
  344.     Locate i%, m.x + 2
  345.     Print Space$(m.w + 2);
  346.  
  347.     cur% = ini%
  348.     ex% = 1
  349.     Update% = -1
  350.     Do
  351.         If Update% Then
  352.             Color m.c1, m.c2
  353.             Locate m.y + ex%, m.x + 1
  354.             Print " " + mop$(ex%) + Space$(m.w - Len(mop$(ex%)) - 1);
  355.             Color 0, 7
  356.             Locate m.y + cur%, m.x + 1
  357.             Print " " + mop$(cur%) + Space$(m.w - Len(mop$(cur%)) - 1);
  358.             ex% = cur%
  359.             Update% = 0
  360.         End If
  361.  
  362.         akey$ = InKey$
  363.         Select Case akey$
  364.             Case Chr$(0) + Chr$(72)
  365.                 If cur% > 1 Then
  366.                     cur% = cur% - 1
  367.                 Else
  368.                     cur% = mops
  369.                 End If
  370.                 Update% = -1
  371.             Case Chr$(0) + Chr$(80)
  372.                 If cur% < mops Then
  373.                     cur% = cur% + 1
  374.                 Else
  375.                     cur% = 1
  376.                 End If
  377.                 Update% = -1
  378.             Case Chr$(13)
  379.                 Exit Do
  380.             Case Chr$(27)
  381.                 cur% = -1
  382.                 Exit Do
  383.         End Select
  384.     Loop
  385.  
  386.     Menu% = cur%
  387.  
  388. Sub SaveConfig
  389.     Open "setup.cfg" For Output As 1
  390.     Print #1, "video=" + videoid$(curvideo%)
  391.     Print #1, "sound=" + soundid$(cursound%)
  392.     Print #1, "runfile=" + runfile$
  393.     Close 1
  394.  
  395. Sub UpdateOp (oplist$, num%, opval$, length%)
  396.     Dim op$(1 To 20)
  397.  
  398.     o$ = oplist$ ' oplist$ is a string of name of items of menu separated by ' except the last one
  399.     Do While Len(o$)
  400.         ops% = ops% + 1
  401.         n% = InStr(o$, "`")
  402.         If n% Then
  403.             op$(ops%) = Left$(o$, n% - 1)
  404.             o$ = Mid$(o$, n% + 1)
  405.         Else
  406.             op$(ops%) = o$
  407.             o$ = ""
  408.         End If
  409.     Loop
  410.  
  411.     For i% = Len(op$(num%)) To 1 Step -1
  412.         If Mid$(op$(num%), i%, 1) = "(" Then Exit For
  413.     Next i%
  414.  
  415.     If i% Then op$(num%) = RTrim$(Left$(op$(num%), i% - 1))
  416.  
  417.     op$(num%) = op$(num%) + Space$(length% - Len(op$(num%)) - Len(opval$) - 2)
  418.     op$(num%) = op$(num%) + "(" + opval$ + ")"
  419.  
  420.     o$ = ""
  421.     For i% = 1 To ops%
  422.         o$ = o$ + op$(i%)
  423.         If i% <> ops% Then o$ = o$ + "`"
  424.     Next i%
  425.  
  426.     oplist$ = o$
  427.  
  428. Sub UpdateRunFile
  429.     Open runfile$ For Output As 1
  430.     If videoid$(curvideo%) = "Tandy" Then
  431.         v$ = "TDY"
  432.     ElseIf videoid$(curvideo%) = "Hercules" Then
  433.         v$ = "HERC"
  434.     Else
  435.         v$ = videoid$(curvideo%)
  436.     End If
  437.  
  438.     Print #1, "@SKID" + v$ + ".EXE";
  439.  
  440.     Select Case cursound%
  441.         Case 1: Print #1, " /spc /ns"
  442.         Case 2: Print #1, " /spc"
  443.         Case 3: Print #1, " /std"
  444.         Case 4: Print #1, " /sad"
  445.         Case 5: Print #1, " /ssb"
  446.         Case 6: Print #1, " /smt"
  447.         Case Else: Print #1,
  448.     End Select
  449.     Close 1
  450.  
  451. Sub header
  452.     'Color 15, 7
  453.     Cls , 7
  454.     Color 0, 3
  455.     Locate 25, 1
  456.     Print Space$(4) + Chr$(24) + " " + Chr$(25) + " to move highlight, ENTER to select option, ESC to exit, F1 for help" + Space$(5);
  457.     Color 15, 1
  458.     Locate 2, 3: Print Space$(74);
  459.     Locate 3, 3: Print Space$(74);
  460.     Locate 4, 3: Print Space$(74);
  461.     Color 8, 0: Locate 5, 5: Print Space$(74)
  462.     Locate 3, 77: Print "  ";: Locate 4, 77: Print "  ";
  463.     Color 15, 1
  464.     Locate 2, 28: Print Chr$(34) + "Stunts" + Chr$(34) + " Setup Program";
  465.     Locate 3, 34: Print "Version 1.1";
  466.     Locate 4, 18: Print "Copyright (c) 2021 Stunts Online Community";
  467.  

to get that it works you must add this file to the folder of .exe
ListSTU.TXT  that is your list in a polite way to use in program.

Waiting your feedback.
Temporary paths previously used and saved on coming
Programming isn't difficult, only it's  consuming time and coffee

Offline Daniel3D

  • Newbie
  • Posts: 62
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #76 on: November 22, 2021, 09:18:01 am »
I love the solution,
that way, I can change it if needed for other incarnations of the game.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #77 on: November 22, 2021, 08:06:17 pm »
fine to read this
Quote
I love the solution,
that way, I can change it if needed for other incarnations of the game.

please can give me a working link to a modded version of STUNTS so I can go on and finish the project.
That you have posted before is too slow! When I try to download the archive it showed a too long time to download (just 6 hours).
In the while I'll make a version of memorizing the last paths used.

Waiting your answer.
Programming isn't difficult, only it's  consuming time and coffee

Offline Daniel3D

  • Newbie
  • Posts: 62
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #78 on: November 23, 2021, 08:50:36 am »
fine to read this
please can give me a working link to a modded version of STUNTS so I can go on and finish the project.
That you have posted before is too slow! When I try to download the archive it showed a too long time to download (just 6 hours).
In the while I'll make a version of memorizing the last paths used.

Waiting your answer.
Added below.
  • the game - clean  -- EDIT< may have been not clean, replaced the archive
  • a mod program simple garage with 3 custom cars in the garage.
  • a custom car the Caterham


This should give enough data to test all parts of the install menu.

Thanks a lot for your work so far.
« Last Edit: November 23, 2021, 10:02:11 am by Daniel3D »

Offline Daniel3D

  • Newbie
  • Posts: 62
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #79 on: November 23, 2021, 01:54:43 pm »
I discovered a mistake in a part of the original code.
Around line 451:

This should have a different setting for hercules graphics because it is based on CGA.
I changed the piece of code myself (I think it is right, but this is about as far as I can manage, hahaha)
Quote
Sub UpdateRunFile
    Open runfile$ For Output As 1
    If videoid$(curvideo%) = "Tandy" Then
        v$ = "TDY"
      a$ = " "
    ElseIf videoid$(curvideo%) = "Hercules" Then
        v$ = "CGA"
      a$ = " /h"
    Else
        v$ = videoid$(curvideo%)
      a$ = " "
    End If
 
    Print #1, "@SKID" + v$ + ".EXE" + a$;
Could you replace this part for me in your copy?
I don't have QB myself and wouldn't know how to use it if I did. (I can probably do it. Just never had something worth compiling)
« Last Edit: November 24, 2021, 02:08:56 pm by Daniel3D »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #80 on: November 24, 2021, 08:24:46 pm »
Hi Daniel3D

1.
Quote
This should have a different setting for hercules graphics because it is based on CGA.

here the integration of code, try if it works well. You should use a PC machine with Hercules graphic slot.
Code: QB64: [Select]
  1. ' 2021 11 25  Integrating the Hercules graphic settings following Daniel3D's instructions
  2. ' 2021 11 13, Modifications to Installation menu
  3. ' 3 choices: install game, install mods, exit from installation
  4. DECLARE SUB UpdateRunFile ()
  5. DECLARE SUB SaveConfig ()
  6. DECLARE SUB LoadConfig ()
  7. DECLARE SUB UpdateOp (oplist$, num%, opval$, length%)
  8. DECLARE FUNCTION Menu% (m AS ANY, mm$, ini%)
  9. declare sub header
  10. declare sub changepath (kind as integer)
  11.  
  12. Type MenuType
  13.     x As Integer
  14.     y As Integer
  15.     c1 As Integer
  16.     c2 As Integer
  17.     w As Integer
  18.  
  19. Const Spath = "A:\", Dpath = "C:\STUNTS", Source = 1, Destination = 2
  20. Const MainWin = 1, InstallWin = 2, MsgWin = 7
  21. Dim Shared men(1 To 5) As MenuType, ment$(1 To 5), ErrMsg$(1 To 4), CurErr%
  22. Dim Shared videoid$(1 To 5), soundid$(1 To 6), curvideo%, cursound%, Mpath$(1 To 5, 1 To 2)
  23. Dim Shared runfile$, SourcePath$, DestPath$, DummyCurpath%, DefaultSourcePath$, DefaultDestinationpath$
  24. Dim Shared InstFile(1 To 250) As String
  25.  
  26. runfile$ = "STUNTS.BAT"
  27. Defaultsourcepat$ = Spath
  28. DefaultDestinationpath$ = Dpath
  29. SourcePath$ = ".\"
  30. DestPath$ = ".\cs11"
  31. DummyCurpath% = 1
  32.  
  33. videoid$(1) = "MCGA"
  34. videoid$(2) = "EGA"
  35. videoid$(3) = "Tandy"
  36. videoid$(4) = "Hercules"
  37. videoid$(5) = "CGA"
  38. curvideo% = 1
  39.  
  40. soundid$(1) = "No sound"
  41. soundid$(2) = "PC Speaker"
  42. soundid$(3) = "Tandy"
  43. soundid$(4) = "Ad Lib"
  44. soundid$(5) = "Sound Blaster"
  45. soundid$(6) = "MT-32"
  46. cursound% = 1
  47.  
  48.  
  49. header
  50.  
  51. men(1).x = 4
  52. men(1).y = 7
  53. men(1).w = 40
  54. men(1).c1 = 7
  55. men(1).c2 = 4
  56. ment$(1) = "Video display`Sound option`Install game to ...`Exit"
  57.  
  58. men(2).x = 13
  59. men(2).y = 12
  60. men(2).w = 27
  61. men(2).c1 = 0
  62. men(2).c2 = 2
  63. ment$(2) = "MGCA/VGA graphics`EGA graphics`Tandy graphics`Hercules graphics`CGA graphics"
  64.  
  65. men(3).x = 11
  66. men(3).y = 12
  67. men(3).w = 34
  68. men(3).c1 = 0
  69. men(3).c2 = 2
  70. ment$(3) = "No music or sound effects`Internal PC speaker`Tandy sound`Ad Lib card`Sound Blaster card`Roland MT-32"
  71.  
  72.  
  73. men(4).x = 11
  74. men(4).y = 12
  75. men(4).w = 40
  76. men(4).c1 = 0
  77. men(4).c2 = 1
  78. ment$(4) = "Install game`Install mods`Exit"
  79.  
  80.  
  81. men(5).x = 67
  82. men(5).y = 15
  83. men(5).w = 10
  84. men(5).c1 = 0
  85. men(5).c2 = 4
  86. ment$(5) = "Yes`No`Cancel"
  87.  
  88. ErrMsg$(1) = "Error: file of configuration not found"
  89. ErrMsg$(2) = "Error: file of list of installation not found"
  90. ErrMsg$(3) = "Error: file of original installation not found"
  91. ErrMsg$(4) = "Error: file of Mods installation not found"
  92. CurErr% = 0
  93.  
  94. Mpath$(1, Source) = "Caution you are changing default source path!"
  95. Mpath$(2, Source) = "Type here source path: "
  96. Mpath$(3, Source) = "This is the new source path: "
  97.  
  98. Mpath$(1, Destination) = "Caution you are changing default destination path!"
  99. Mpath$(2, Destination) = "Type here destination path: "
  100. Mpath$(3, Destination) = "This is the new destination path: "
  101.  
  102.  
  103. GoSub Fileok
  104. LoadConfig
  105.  
  106. ' loading list file installation
  107. GoSub Fileok
  108. CurErr% = 2
  109.  
  110. Open "liststu.txt" For Input As #1
  111. z = 0
  112.     z = z + 1
  113.     Line Input #1, tmp$
  114.     If InStr(tmp$, ".") Then InstFile(z) = tmp$ Else z = z - 1
  115.     'Print InstFile(z), z
  116.     'If z Mod 20 = 0 Then Sleep
  117. CurErr% = 0
  118.  
  119. UpdateOp ment$(1), 1, videoid$(curvideo%), men(1).w - 2
  120. UpdateOp ment$(1), 2, soundid$(cursound%), men(1).w - 2
  121.  
  122. curmain% = 1
  123.     a% = Menu%(men(1), ment$(1), curmain%)
  124.     If a% <> -1 Then curmain% = a%
  125.     Select Case a%
  126.         Case -1 ' exiting by EScape key from menu
  127.             Color 7, 0
  128.             Cls
  129.             Print
  130.             Exit Do
  131.         Case 4 'saving configuration
  132.             SaveConfig
  133.             UpdateRunFile
  134.             Color 7, 0
  135.             Cls
  136.             Print
  137.             Print "Configuration saved."
  138.             Exit Do
  139.         Case 1 'video display settings
  140.             PCopy 0, MainWin
  141.             a% = Menu%(men(2), ment$(2), curvideo%)
  142.             If a% <> -1 Then curvideo% = a%
  143.             UpdateOp ment$(1), 1, videoid$(curvideo%), men(1).w - 2
  144.             PCopy MainWin, 0
  145.         Case 2 ' sound options
  146.             PCopy 0, MainWin
  147.             a% = Menu%(men(3), ment$(3), cursound%)
  148.             If a% <> -1 Then cursound% = a%
  149.             UpdateOp ment$(1), 2, soundid$(cursound%), men(1).w - 2
  150.             PCopy MainWin, 0
  151.         Case 3 'install options....
  152.             ' here user can choose  installation of original game
  153.             ' adding mods
  154.             ' after doing this he can choose destination folder, source folder
  155.             PCopy 0, MainWin
  156.             Do
  157.  
  158.                 b% = Menu%(men(4), ment$(4), DummyCurpath%)
  159.                 PCopy 0, InstallWin
  160.                 Select Case b%
  161.                     Case 1 ' game standard installation
  162.                         ChangePath Source
  163.                         PCopy InstallWin, 0
  164.                         ChangePath Destination
  165.                         GoSub Fileok
  166.                         CurErr% = 3
  167.                         If Right$(SourcePath$, 1) <> "\" Then Slash$ = "\" Else Slash$ = ""
  168.                         If Right$(DestPath$, 1) <> "\" Then Slash2$ = "\" Else Slash2$ = ""
  169.                         For w = 1 To z Step 1
  170.                             nameFile$ = SourcePath$ + Slash$ + LTrim$(InstFile(w))
  171.                             Locate 20, 1: Print nameFile$; "  ";
  172.                             namefile2$ = DestPath$ + Slash2$ + LTrim$(InstFile(w))
  173.                             Open nameFile$ For Input As #1
  174.                             tmp$ = Input$(LOF(1), # 1)
  175.                             Close #1
  176.                             MkDir DestPath$ + Slash2$
  177.                             Open namefile2$ For Binary As #1
  178.                             Put #1, , tmp$
  179.                             Close #1
  180.                             tmp$ = ""
  181.                         Next w
  182.                         CurErr% = 0
  183.                         On Error GoTo 0
  184.                         PCopy InstallWin, 0
  185.  
  186.  
  187.                     Case 2 ' mods installation
  188.                         ChangePath Source
  189.                         PCopy InstallWin, 0
  190.                         ChangePath Destination
  191.  
  192.                         GoSub Fileok
  193.                         CurErr% = 4
  194.  
  195.                         '  Open "filen" For Input As #1
  196.  
  197.  
  198.                         CurErr% = 0
  199.                         On Error GoTo 0
  200.                         PCopy InstallWin, 0
  201.  
  202.                     Case 3 ' return to option menu
  203.                         PCopy MainWin, 0
  204.                         Exit Do
  205.  
  206.                 End Select
  207.  
  208.             Loop
  209.  
  210.     End Select
  211.  
  212. Print "Use " + UCase$(runfile$) + " to play Stunts"
  213.  
  214. Fileok:
  215. On Error GoTo nofile
  216. If CurErr% = 0 Then CurErr% = 1
  217.  
  218. nofile:
  219. If CurErr% = 2 Or CurErr% = 3 Then k = 4 Else k = 0
  220. ShowMessage 14, 0, 16, 19, 20, 50 + k, 0, 3, ErrMsg$(CurErr%)
  221. If CurErr% = 3 Or CurErr% = 4 Then
  222.     If tmp$ = "" Then Filename$ = nameFile$ Else Filename$ = namefile2$
  223.     ShowMessage 14, 0, 16, 19, 20, 50, 0, 3, "File error: " + Filename$
  224.     Resume Next
  225.  
  226. Sub ChangePath (Mtype As Integer)
  227.     If Mtype = Source Then
  228.         Apath$ = SourcePath$
  229.         k = 0
  230.     Else
  231.         Apath$ = DestPath$
  232.         k = 4
  233.     End If
  234.     ShowMessage 14, 0, 16, 19, 15, 56 + k, 0, 3, Mpath$(1, Mtype)
  235.     Locate 19, 20: Color 14, 0: Print "Actual path: "; Apath$
  236.     Locate 20, 20:
  237.     If Mtype = Source Then
  238.         Input "Type here source path: ", a$
  239.     ElseIf Mtype = Destination Then
  240.         Input "Type here destination path: ", a$
  241.     End If
  242.  
  243.     If a$ = "" Or a$ = Apath$ Then
  244.         Locate 21, 20: Print " No new path": Sleep 1
  245.     Else
  246.         Locate 21, 20: Print Mpath$(3, Mtype); UCase$(a$); " , do you confirm?"
  247.         c% = Menu%(men(5), ment$(5), DummyCurpath%)
  248.         If c% = 1 Then
  249.             Apath$ = a$
  250.             If Mtype = Source Then SourcePath$ = Apath$ Else DestPath$ = Apath$
  251.         ElseIf c% = 2 Then
  252.             ' nothing is changed
  253.         End If
  254.     End If
  255.  
  256.  
  257.  
  258. Sub ShowMessage (Fcol, Bcol, Urow, Brow, FstCo, WidthMsg, sFcol, sBcol, Msg$)
  259.     'Subroutine to show a message on the ASCII screen and restore
  260.     ' the previous screen after message has been shown
  261.     ' Usage: SHOWMESSAGE Forwardcolor, Backgroundcolor, UpRow, BottomRow,FirstColumn, WidthMessagge,shadowForwardColor,shadowBackgroundColor, Message$
  262.     Dim z As Integer
  263.  
  264.     PCopy 0, MsgWin
  265.     Color Fcol, Bcol
  266.     For z = Urow To Brow
  267.         Locate z, FstCo: Print Space$(WidthMsg);
  268.     Next z
  269.     Color sFcol, sBcol
  270.     For z = Urow + 1 To Brow
  271.         Locate z, FstCo + WidthMsg: Print "  ";
  272.     Next z
  273.  
  274.     Locate Brow + 1, FstCo + 2: Print Space$(WidthMsg);
  275.     Color Fcol, Bcol
  276.     Locate Urow + 1, FstCo + 5: Print Msg$
  277.     Sleep 2
  278.     PCopy MsgWin, 0
  279.  
  280. Sub LoadConfig
  281.     'Make sure the file exists
  282.     '  Open "setup.cfg" For Binary As 1: Close 1
  283.  
  284.     Open "setup.cfg" For Input As 1
  285.     Do Until EOF(1)
  286.         Line Input #1, a$
  287.         n% = InStr(a$, "=")
  288.         If n% Then
  289.             p$ = LCase$(LTrim$(RTrim$(Left$(a$, n% - 1))))
  290.             v$ = LTrim$(RTrim$(Mid$(a$, n% + 1)))
  291.  
  292.             Select Case p$
  293.                 Case "video"
  294.                     For i% = 1 To 5
  295.                         If LCase$(v$) = LCase$(videoid$(i%)) Then
  296.                             curvideo% = i%
  297.                             Exit For
  298.                         End If
  299.                     Next i%
  300.                 Case "sound"
  301.                     For i% = 1 To 6
  302.                         If LCase$(v$) = LCase$(soundid$(i%)) Then
  303.                             cursound% = i%
  304.                             Exit For
  305.                         End If
  306.                     Next i%
  307.                 Case "runfile"
  308.                     runfile$ = Left$(v$, 12)
  309.             End Select
  310.         End If
  311.     Loop
  312.     Close 1
  313.  
  314. Function Menu% (m As MenuType, mm$, ini%)
  315.     Dim mop$(1 To 20), mops As Integer
  316.  
  317.     mt$ = mm$
  318.     Do Until Len(mt$) = 0
  319.         mops = mops + 1
  320.         n% = InStr(mt$, "`")
  321.         If n% Then
  322.             mop$(mops) = Left$(mt$, n% - 1)
  323.             mt$ = Mid$(mt$, n% + 1)
  324.         Else
  325.             mop$(mops) = mt$
  326.             mt$ = ""
  327.         End If
  328.     Loop
  329.  
  330.     Color m.c1, m.c2
  331.     Locate m.y, m.x
  332.     Print "Ú" + String$(m.w, 196) + "¿";
  333.     For i% = m.y + 1 To m.y + mops
  334.         Locate i%, m.x
  335.         Print "³ " + mop$(i% - m.y) + Space$(m.w - Len(mop$(i% - m.y)) - 1) + "³";
  336.     Next i%
  337.     Locate m.y + mops + 1, m.x
  338.     Print "À" + String$(m.w, 196) + "Ù";
  339.     Color 8, 0
  340.     For i% = m.y + 1 To m.y + mops + 1
  341.         Locate i%, m.x + m.w + 2
  342.         Print "  ";
  343.     Next i%
  344.     Locate i%, m.x + 2
  345.     Print Space$(m.w + 2);
  346.  
  347.     cur% = ini%
  348.     ex% = 1
  349.     Update% = -1
  350.     Do
  351.         If Update% Then
  352.             Color m.c1, m.c2
  353.             Locate m.y + ex%, m.x + 1
  354.             Print " " + mop$(ex%) + Space$(m.w - Len(mop$(ex%)) - 1);
  355.             Color 0, 7
  356.             Locate m.y + cur%, m.x + 1
  357.             Print " " + mop$(cur%) + Space$(m.w - Len(mop$(cur%)) - 1);
  358.             ex% = cur%
  359.             Update% = 0
  360.         End If
  361.  
  362.         akey$ = InKey$
  363.         Select Case akey$
  364.             Case Chr$(0) + Chr$(72)
  365.                 If cur% > 1 Then
  366.                     cur% = cur% - 1
  367.                 Else
  368.                     cur% = mops
  369.                 End If
  370.                 Update% = -1
  371.             Case Chr$(0) + Chr$(80)
  372.                 If cur% < mops Then
  373.                     cur% = cur% + 1
  374.                 Else
  375.                     cur% = 1
  376.                 End If
  377.                 Update% = -1
  378.             Case Chr$(13)
  379.                 Exit Do
  380.             Case Chr$(27)
  381.                 cur% = -1
  382.                 Exit Do
  383.         End Select
  384.     Loop
  385.  
  386.     Menu% = cur%
  387.  
  388. Sub SaveConfig
  389.     Open "setup.cfg" For Output As 1
  390.     Print #1, "video=" + videoid$(curvideo%)
  391.     Print #1, "sound=" + soundid$(cursound%)
  392.     Print #1, "runfile=" + runfile$
  393.     Close 1
  394.  
  395. Sub UpdateOp (oplist$, num%, opval$, length%)
  396.     Dim op$(1 To 20)
  397.  
  398.     o$ = oplist$ ' oplist$ is a string of name of items of menu separated by ' except the last one
  399.     Do While Len(o$)
  400.         ops% = ops% + 1
  401.         n% = InStr(o$, "`")
  402.         If n% Then
  403.             op$(ops%) = Left$(o$, n% - 1)
  404.             o$ = Mid$(o$, n% + 1)
  405.         Else
  406.             op$(ops%) = o$
  407.             o$ = ""
  408.         End If
  409.     Loop
  410.  
  411.     For i% = Len(op$(num%)) To 1 Step -1
  412.         If Mid$(op$(num%), i%, 1) = "(" Then Exit For
  413.     Next i%
  414.  
  415.     If i% Then op$(num%) = RTrim$(Left$(op$(num%), i% - 1))
  416.  
  417.     op$(num%) = op$(num%) + Space$(length% - Len(op$(num%)) - Len(opval$) - 2)
  418.     op$(num%) = op$(num%) + "(" + opval$ + ")"
  419.  
  420.     o$ = ""
  421.     For i% = 1 To ops%
  422.         o$ = o$ + op$(i%)
  423.         If i% <> ops% Then o$ = o$ + "`"
  424.     Next i%
  425.  
  426.     oplist$ = o$
  427.  
  428. Sub UpdateRunFile
  429.     Open runfile$ For Output As 1
  430.     If videoid$(curvideo%) = "Tandy" Then
  431.         v$ = "TDY"
  432.         a$ = " "
  433.     ElseIf videoid$(curvideo%) = "Hercules" Then
  434.         v$ = "CGA"
  435.         a$ = " /h"
  436.     Else
  437.         v$ = videoid$(curvideo%)
  438.         a$ = " "
  439.     End If
  440.  
  441.     Print #1, "@SKID" + v$ + ".EXE" + a$;
  442.  
  443.     Select Case cursound%
  444.         Case 1: Print #1, " /spc /ns"
  445.         Case 2: Print #1, " /spc"
  446.         Case 3: Print #1, " /std"
  447.         Case 4: Print #1, " /sad"
  448.         Case 5: Print #1, " /ssb"
  449.         Case 6: Print #1, " /smt"
  450.         Case Else: Print #1,
  451.     End Select
  452.     Close 1
  453.  
  454. Sub header
  455.     'Color 15, 7
  456.     Cls , 7
  457.     Color 0, 3
  458.     Locate 25, 1
  459.     Print Space$(4) + Chr$(24) + " " + Chr$(25) + " to move highlight, ENTER to select option, ESC to exit, F1 for help" + Space$(5);
  460.     Color 15, 1
  461.     Locate 2, 3: Print Space$(74);
  462.     Locate 3, 3: Print Space$(74);
  463.     Locate 4, 3: Print Space$(74);
  464.     Color 8, 0: Locate 5, 5: Print Space$(74)
  465.     Locate 3, 77: Print "  ";: Locate 4, 77: Print "  ";
  466.     Color 15, 1
  467.     Locate 2, 28: Print Chr$(34) + "Stunts" + Chr$(34) + " Setup Program";
  468.     Locate 3, 34: Print "Version 1.1";
  469.     Locate 4, 18: Print "Copyright (c) 2021 Stunts Online Community";
  470.  

2.
about QB and abandonware
here you can get it or Qbasic or QBX 7.1  or visual Basic 1.0 for DOS
https://www.abandonwaredos.com/abandonware-game.php?abandonware=QBasic&gid=2854
https://www.xtcabandonware.com/game/741/quick-basic-450
https://www.qbasic.net/en/top-ten-downloads/
Programming isn't difficult, only it's  consuming time and coffee

Offline Daniel3D

  • Newbie
  • Posts: 62
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #81 on: November 25, 2021, 08:24:38 am »
Well, i'm trying.

But VBDOS and QBX 7.1 and QB 7.1 give the same error when I want to make an exe. (see attached image)

I thought that maybe the word 'update' was an issue, so I changed all instances of Update% to Updat%.
That seemed to work, but then it gives different errors that I can't solve.

So, I can not test the code. Not skilled enough, i'm afraid.
« Last Edit: November 25, 2021, 08:45:45 am by Daniel3D »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #82 on: November 25, 2021, 12:42:32 pm »
As soon as I'll try those IDE/Compilers taken from those links.
Programming isn't difficult, only it's  consuming time and coffee

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #83 on: November 25, 2021, 08:14:10 pm »
Hi Daniel3D
your issue to compile STUNTINST.BAS using QBX or QB7.1 or VBDOS is one:
in these compilers there is ISAM, a system for database that there isn't in QBasic and in Quickbasic 4.5.
In conclusion UPDATE is a keyword of ISAM, so that name is forbidden for variables into QBX and following developments.

I think that you can use a Qbasic /RUN namefile   or better a QB45 to compile this Installation program.

you can get QB45 QBasic and QB 2.0 here
https://www.qbasic.net/en/top-ten-downloads/
https://vetusware.com/download/QuickBASIC%202.01/?id=221
https://www.xtcabandonware.com/game/741/quick-basic-450

See later now a take a look to the polite version of STUNTS and to the MOD that you have posted before.
Programming isn't difficult, only it's  consuming time and coffee

Offline Daniel3D

  • Newbie
  • Posts: 62
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #84 on: November 26, 2021, 01:33:39 am »
That makes sense. I'll try that later.

Tried QB45,
still gives errors that need to be debugged, I think.

I'll wait for you to finish.
« Last Edit: November 26, 2021, 07:52:29 am by Daniel3D »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #85 on: November 26, 2021, 07:13:39 pm »
Hi Daniel3D

yes some issues with easy solutions!

1. Add () to the end of declaretion of HEADER sub
Code: QB64: [Select]
  1. DECLARE SUB header ()

2.
in the SUB header
uncomment the first line
Code: QB64: [Select]
  1. 'COLOR 15,7
  2.  

becomes
Code: QB64: [Select]
  1. COLOR 15,7

3.
in the SUB header cancel or REMs the arguments of CLS
so
Code: QB64: [Select]
  1. CLS ,7
becomes
Code: QB64: [Select]
  1. CLS  ' ,7
or better
Code: QB64: [Select]

4.
remember to put in the same folder the file.BAS and SETUP.CFG and the file  LISTSTU.TXT

5.
using QBasic or QB45 be sure that the program will be run in the original folder. It is not enough to load program into QB45 , you must verify that you are in the folder original of file.BAS. You can solve this issue easily, first you load file.BAS and then you use the command menu File->DOS-Shell.  So you get the prompt of DOS, in this you should be in the QB45 folder and you must use CD destinationPath to move to the folder of file.BAS.

NOW you can press F5 and run the program.

Naturally when you choose to Install Game you'll get errors because the folder of running have no such file.
you must build this folderf with original game file and the three files above,
Programming isn't difficult, only it's  consuming time and coffee

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #86 on: November 26, 2021, 07:36:45 pm »
@Daniel3D
please gimme help...
I have downloaded the original polite (or semipolite) version of STUNTS, the MOD simple garage and the custom car

now I have extract zippet files, and in the original polite version folder I have put the sgar  program but running it I got these results:

here sgar is in an own folder
  [ You are not allowed to view this attachment ]  

here sgar in stunts folder

  [ You are not allowed to view this attachment ]  

Programming isn't difficult, only it's  consuming time and coffee

Offline Daniel3D

  • Newbie
  • Posts: 62
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #87 on: November 27, 2021, 06:13:39 am »
I checked with the creator.
He made a function to set the game directory in the sgar.cfg.
You need to modify this manually.
Sorry, I didn't know this.
(Sgar is still in beta)

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #88 on: November 28, 2021, 07:53:51 pm »
Hi Daniel3D
you're right sgar application has an absolute path defined into sgar.cgf
changing  handly it I can see now it runs well.
  [ You are not allowed to view this attachment ]  

Now it is clear that Simple Garage 1.0 does more than only installing new cars as we can see from its help
  [ You are not allowed to view this attachment ]  

for now what do you think that the "Installation MOD"  must do?
Answer 1: if there are different cars from those are default (original) it copies all them into destinationPath
Answer 2: if there are different cars from those are default (original) it let you choose what of them to copy into destinationPath
Answer 3: (feel free to share your thinking about it)

Waiting your feedback
Programming isn't difficult, only it's  consuming time and coffee

Offline Daniel3D

  • Newbie
  • Posts: 62
    • View Profile
Re: Project looking for Programmer (I can't do it myself)
« Reply #89 on: November 29, 2021, 12:25:18 am »
Answer 3.
Default in game directory. If subdirectory are present opt to install to one of those. (Theoretically a different garage program can be made that uses a different directory name)
Also one might want a car in a separate directory named after the car.

So, options could look like:
Install in:
  • Stunts
  • \garage
  • \something
  • \something else
  • \new folder


Is that ok? Or to much?
Just the game folder and garage is fine to.
« Last Edit: November 29, 2021, 12:51:22 pm by Daniel3D »