Author Topic: WIP: Monster combat (reboot) Mashup  (Read 8393 times)

0 Members and 1 Guest are viewing this topic.

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
WIP: Monster combat (reboot) Mashup
« on: November 13, 2021, 03:51:22 pm »
I call it FOREST.
So many regulars here know, I LOOOVE to rewrite old DOS games to modern code. If you have not looked at the old code books - check out here. You never look at spaghetti the same LOL. Especially the older the game, the more of a mess it is *cough* DUKEDOM !!

So anyway, I always loved MONSTER COMBAT, but hated the combat and the monsters - go figure LOL But the concept was amazing to me. So I decided NOT to use the code, and created it from scratch but keeping the spirit of the game. It will be a mashup of LORD meets MONSTER COMBAT.

I know it is listed there as a stat, but the 30-day goal is gone, and instead, you are seeking out a castle ruin to find the princess - who is guarded by a dragon. Yes!!! Old fashion simple fantasy!!
But it is not that easy. This game is hard. Inns are sparse and the only place to train, heal and rest up.

Anyways. the attached .exe is just the initial setup. almost 1,500 lines of code just for this.
You will see the similarities of the original game. the "Q some number and S some numbers" are debugging and will be removed later. Just keeping track of the x,y quadrants, and x,y sectors.

ps
I may put the source up later when it is almost done. right now, lots of includes, and some weird programming scribbles, besides, If bplus gets ahold of it, it will look like assembly language then I wont be able to debug it hahahahah!!


Mediafire download
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #1 on: November 13, 2021, 07:41:41 pm »
The movement works well.
Combat is coming along fine. here is the initial preview of that.

I use a countdown by steps (walking) using Final fantasy I method. Tress use more than paths etc.. When it reaches zero, a random encounter starts

Media Fire download (coming soon)

EDIT: forgot to add the pic

combat.jpg
* combat.jpg (Filesize: 43.93 KB, Dimensions: 646x428, Views: 258)
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #2 on: November 13, 2021, 09:54:00 pm »
Quote
If bplus gets ahold of it, it will look like assembly language then I wont be able to debug it hahahahah!!

LOL I wish I could say, you wouldn't have to!

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #3 on: November 13, 2021, 10:00:06 pm »
It's actually programming pretty smooth - I mashed this game with LORD, and a twist of my own. Trying to get the basic combat and spells done tonight.  then you guys can play around with the combat and spells - probably get the inns and castles done tomorrow.. not sure how I want to do the castles yet.

While the code itself is fairly structured - it has lots of redundant code as I test out routines. so for me, its sloppy
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #4 on: November 13, 2021, 10:34:33 pm »
LOL I wish I could say, you wouldn't have to!

I was sending you kudo's!! :-)
your such an advanced writer, I get embarrassed showing my code LOL
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #5 on: November 14, 2021, 01:43:39 am »
That's a pretty cool game. I looked it up in the ebook. That's a LOT of typing. I would be interested in knowing how you converted it to QB64... time permitting of course... lol I have difficulty in figuring out some of those 'gotos'...  Atariarchives is where I got all my AHL books. Cool site. Looking forward to the next instalment...

Good job.

J
Logic is the beginning of wisdom.

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #6 on: November 14, 2021, 03:12:14 am »
That's a pretty cool game. I looked it up in the ebook. That's a LOT of typing. I would be interested in knowing how you converted it to QB64... time permitting of course... lol I have difficulty in figuring out some of those 'gotos'...  Atariarchives is where I got all my AHL books. Cool site. Looking forward to the next instalment...

Good job.

J

thank you!!

Here is some rambling on what I do. Keep in mind, this is just mindless ramble. hope it makes sense, (its 2:11am my kitties woke me up to feed them and i cant get back to sleep hahaha)

most of the gotos are basically a reverse if then else

For example  almost all of the "on goto" you can change for "select case"

then each case you can either handle it as is, or make a sub

so https://www.atariarchives.org/bigcomputergames/showpage.php?page=37
line 430 - 590 all this can be cleaned up with a SELECT CASE

so you got the 2 for loops
then use a

Code: QB64: [Select]
  1. select case b(j,i)
  2. case 0: print "T";
  3. case 1: print "~";
  4. etc....
  5.  
  6. case 0: print "strength"
  7. etc...

after this there is a check for T condition and "return" if it = 1

this is where it gets totally messy as now you have to find out what line sent it to this section, in short: where is it returning to
Gets totally messy

Best way, for me anyways, is to check overall how the game is played. and then decypher what part of the code applies.

This is why I actually rewrote the code from scratch. My map is STATIC not DYNAMIC as in the game. So if you downloaded the latest file, you will see when you move the objects stay there,even when you go to a different quadrant and come back, they are where you first saw them. In the original, they are recreated on the fly. so its like magic moving forest haha

I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #7 on: November 14, 2021, 04:22:06 am »
Both "forest" files on Mediafire are executables. I can run them but I cannot view the contents...
Logic is the beginning of wisdom.

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #8 on: November 14, 2021, 04:46:51 am »
For those that want to see how I am working this (it is scratch built and sloppy LOL) You can view it here. Hopefully, it will give some ideas.
This is a huge project I am working on. ETA - when it's done :-). If ever.

This is just how I write it. No fancy routines, and try to comment as much as possible, vars easy to understand. I hate ROOC (read-only-once-code)

* * * A T T E N T I O N * * *
This WILL NOT compile. This is just to show my work so far. Lots of files are included but are not shown here.
[/size][/color]


Code: QB64: [Select]
  1.  
  2. '// for game purposes - we can display seed if we want to use it agian
  3. seed = stripTime
  4. Randomize (seed)
  5.  
  6.  
  7. '// ASCII MAP GEN TRY I
  8. '// BASED ON SMcNeil of QB64 idea
  9.  
  10. '// FAKE BOOLEAN :-)
  11. Const TRUE = 1
  12. Const FALSE = 0
  13.  
  14. '// MAPSIZE
  15. Const MAPX = 100
  16. Const MAPY = 100
  17.  
  18. '// TILES USED
  19. Const MAX_TILES = 99
  20. Const MIN_INNS = 5 '        MIN INNS IN THE WORLD. HIGHER FOR EASIER GAME
  21. Const MIN_RUINS = 20 '      RUINS ARE SPECIAL - 20 IS ABOVE AVERAGE, HIGHER FOR MONTE HALL.
  22. Const PLAYER_AVATAR = " "
  23. Const INITIAL_HP = 20 '     STARTING HP
  24. Const INITIAL_DEF = 0 '     STARTING DEFENSE
  25. Const INITIAL_ATK = 5 '     STARTING ATTACK
  26. Const MAX_MOBS = 112 '      TOTAL MOBS IN THE DATABASE - ADJ AS ADDED OR DELETED
  27.  
  28. '// MAX RANDOM SPELLS LIMITS
  29. Const INVISI = 3 '          STARTING # OF INVISIBILITY
  30. Const CHARM = 4 '           STARTING # OF CHARM
  31. Const STUN = 6 '            STARTING # OF STUN SPELLS
  32.  
  33.  
  34. '// GAME INFO
  35. Type tGame
  36.     total_inns As Integer
  37.     total_ruins As Integer ' once ruins are explored they are deleted from map.
  38.  
  39. Type tMob
  40.     level As Integer
  41.     mName As String * 20
  42.     atk As Integer
  43.     xp As Long
  44.     hp As Long
  45.     gold As Long
  46.     weaponStr As String * 30
  47.     deathGossip As String * 200
  48.  
  49. Type tFightResults
  50.     mobCrit As Integer
  51.     playerCrit As Integer
  52.     mobDamage As Integer
  53.     playerDamage As Integer
  54.  
  55. Type tArmor
  56.     level As Integer
  57.     gearName As String * 30
  58.     cost As Long
  59.     buff As Integer
  60.  
  61.  
  62. Type tWeapon
  63.     level As Integer
  64.     gearName As String * 30
  65.     cost As Long
  66.     buff As Integer
  67.  
  68.  
  69. '$include: 'playerRec.bi'
  70. Dim Shared RANDOM_TICK As Integer ' COUNT DOWN TIMER FOR AN ENOUNTER
  71. Dim Shared tile(MAX_TILES) As String
  72. Dim Shared area(MAPX, MAPY) As Integer
  73. Dim Shared As Integer I, J, X, Y
  74. Dim Shared player As tPlayer
  75. Dim Shared game As tGame
  76. Dim Shared mob(MAX_MOBS) As tMob
  77. Dim Shared FightResults As tFightResults
  78. Dim Shared weapon(20) As tWeapon
  79. Dim Shared armor(20) As tArmor
  80.  
  81.  
  82. Dim Shared gameover As Integer
  83.  
  84. '// DATA FILES
  85. '$include: 'xpgain.bi'
  86. '$include: 'weapons.bi'
  87. '$include: 'armorlist.bi'
  88. '$include: 'moblist.bi'
  89. '$include: 'masterslist.bi'
  90.  
  91.  
  92.  
  93.  
  94. INIT_GAME
  95. Dim oqx, oqy, osx, osy As Integer
  96.  
  97.  
  98.  
  99. '// initial walking ticker for random encounters
  100. RESET_RANDOM_ENCOUNTER_TICK
  101. X = (player.qx * 10 - 10) + player.sx
  102. Y = (player.qy * 10 - 10) + player.sy
  103.  
  104.  
  105.     If RANDOM_TICK <= 0 Then COMBAT
  106.  
  107.     DRAW_MAP
  108.     '// get player input
  109.     Do: pkey = InKey$: Loop Until pkey > ""
  110.     pkey = LCase$(pkey)
  111.  
  112.     Select Case pkey
  113.  
  114.         '// is player moving
  115.         Case "w", "a", "s", "d":
  116.             '// THESE KEYS MEANS THE PLAYER IS MOVING. I AM USING THE FINAL FANTASY MOVE CRITERIA
  117.             '// TO DETERMINE A RANDOM ENCOUNTER (FOLLWO THE BEST!)
  118.             '// countdown is based on terrain
  119.             '// TREES = -6
  120.             '// PATHS = -5
  121.             '// ALL ELSE -2
  122.  
  123.  
  124.             '// incase of error save old pos
  125.             oqx = player.qx: oqy = player.qy
  126.             osx = player.sx: osy = player.sy
  127.             Select Case pkey
  128.                 Case "w": player.sy = player.sy - 1
  129.                     If player.sy < 1 Then player.sy = 10: player.qy = player.qy - 1
  130.                     If player.qy < 1 Then player.sy = 1: player.qy = oqy
  131.  
  132.                 Case "s": player.sy = player.sy + 1
  133.                     If player.sy > 10 Then player.sy = 1: player.qy = player.qy + 1
  134.                     If player.qy > 10 Then player.sy = 1: player.qy = oqy
  135.  
  136.                 Case "a": player.sx = player.sx - 1
  137.                     If player.sx < 1 Then player.sx = 10: player.qx = player.qx - 1
  138.                     If player.qx < 1 Then player.sx = 1: player.qx = oqx
  139.  
  140.                 Case "d": player.sx = player.sx + 1
  141.                     If player.sx > 10 Then player.sx = 1: player.qx = player.qx + 1
  142.                     If player.qx > 10 Then player.sx = 1: player.qx = oqx
  143.  
  144.             End Select
  145.  
  146.             '// to figure terrain to determain tick, where the hell are we :-)
  147.             X = (player.qx * 10 - 10) + player.sx
  148.             Y = (player.qy * 10 - 10) + player.sy
  149.             If area(X, Y) = 1 Then RANDOM_TICK = RANDOM_TICK - 6 'trees
  150.             If area(X, Y) = 2 Then RANDOM_TICK = RANDOM_TICK - 5 'paths
  151.  
  152.     End Select
  153.  
  154.  
  155.  
  156.  
  157. Loop Until gameover
  158.  
  159.  
  160. '$include: 'utils.bi'
  161. '$include: 'combat.bi'
  162.  
  163.  
  164. Sub COMBAT
  165.     Dim opt As String
  166.     RESET_RANDOM_ENCOUNTER_TICK
  167.     Print: Print: Print
  168.     '// FIND MOB TO MATCH PLAYERS LEVEL
  169.     'LEVEL,NAME,ATK,XP,HP,GOLD,WEAPON,DEATHTXT
  170.     Restore MOBLIST
  171.  
  172.  
  173.     '// FIND A RANDOM MOB AT PLAYERS LEVEL
  174.     Do
  175.         I = Int(Rnd * MAX_MOBS) + 1
  176.     Loop Until mob(I).level = player.level
  177.  
  178.     mob(I).mName = _Trim$(mob(I).mName) ' for some reason this is not working...
  179.  
  180.     Print "You encountered a "; mob(I).mName
  181.     '// start combat
  182.     Do
  183.         Print "Your hp: "; player.hp
  184.         Print _Trim$(mob(I).mName); " hp: "; mob(I).hp
  185.         Print
  186.         Print "[A]ttack"
  187.         Print "Cast a Spell"
  188.         Print "   [C]harm        [x"; _Trim$(Str$(player.charm)); "]"
  189.         Print "   [I]nvisibility [x"; _Trim$(Str$(player.invisi)); "]"
  190.         Print "   [S]tun         [x"; _Trim$(Str$(player.stun)); "]"
  191.         Print
  192.         Print "You option "; _Trim$(player.pName); ": ";
  193.         Input opt
  194.  
  195.         Select Case LCase$(opt)
  196.  
  197.             Case "a":
  198.                 startFight mob(I).atk
  199.                 Print
  200.                 If FightResults.mobCrit = TRUE Then Print _Trim$(mob(I).mName); " does a powerful move on you!!"
  201.                 Print _Trim$(mob(I).mName); " did "; FightResults.mobDamage; " damage with its "; mob(I).weaponStr
  202.                 If FightResults.playerCrit = TRUE Then Print "You do critical damage!!"
  203.                 Print "You did "; FightResults.playerDamage; " points of damage with your "; weapon(player.weaponId).gearName
  204.                 Print
  205.                 player.hp = player.hp - FightResults.mobDamage
  206.                 mob(I).hp = mob(I).hp - FightResults.playerDamage
  207.  
  208.         End Select
  209.  
  210.  
  211.     Loop Until player.hp < 1 Or mob(I).hp < 1
  212.  
  213.     '// TODO: PUT THIS IN A SUB - AS IT WILL BE CALLED FROM OTHER LOCATIONS
  214.     If player.hp <= 0 Then
  215.         Print "You were knocked out by "; _Trim$(mob(I).mName); " and left for dead"
  216.         Print "You lost all your gold!!": player.money = 0
  217.         Print "and lost 10% of your experience!": player.xp = player.xp - Int(player.xp * .1)
  218.         Print "after some time, you were able to recover about half your health": player.hp = Int(player.hpMax * .5)
  219.         Print
  220.     Else
  221.         Print "you killed "; _Trim$(mob(I).mName);
  222.         Print "You gained "; mob(I).xp; "xp! ": player.xp = player.xp + mob(I).xp
  223.         Print "It was guarding "; mob(I).gold; "gold pieces": player.money = player.money + mob(I).gold
  224.         Print
  225.     End If
  226.     P_AUSE
  227.     Cls
  228.  
  229. Sub INIT_GAME
  230.     gameover = FALSE
  231.     tile(1) = " " 'TREES
  232.     tile(2) = " -" 'PLAINS
  233.     tile(3) = " º" 'CRUMBLING WALLS (IMPASSABLE)
  234.     tile(4) = " M" 'RUINS TO EXPLORE
  235.     tile(5) = " " 'INN
  236.     tile(99) = " ." 'nothing
  237.  
  238.     For I = 1 To MAPX: For J = 1 To MAPY: area(I, J) = 0: Next: Next
  239.  
  240.     '// SETUP DEFAULT PLAYER STUFF
  241.     player.pName = "Adventurer"
  242.     player.avatar = PLAYER_AVATAR
  243.     player.level = 1
  244.     player.xp = 0
  245.     player.potions = 5
  246.  
  247.  
  248.     player.qx = r(10): player.qy = r(10)
  249.     player.sx = r(10): player.sy = r(10)
  250.  
  251.     player.daysInGame = 0.0
  252.     player.hp = INITIAL_HP
  253.     player.hpMax = player.hp
  254.     player.defense = INITIAL_DEF
  255.     player.atk = INITIAL_ATK
  256.     player.atkMax = player.atk
  257.     player.defMax = player.defense
  258.     player.armorBuff = 1
  259.     player.weaponBuff = 5
  260.  
  261.     player.charm = r(CHARM)
  262.     player.stun = r(STUN)
  263.     player.invisi = r(INVISI)
  264.  
  265.     player.armorId = 1
  266.     player.weaponId = 1
  267.     player.money = 0
  268.  
  269.  
  270.     Restore ARMORLIST
  271.     For I = 1 To 16: Read armor(I).level, armor(I).gearName, armor(I).cost, armor(I).buff: Next
  272.     Restore WEAPONLIST
  273.     For I = 1 To 16: Read weapon(I).level, weapon(I).gearName, weapon(I).cost, weapon(I).buff: Next
  274.  
  275.     Restore MOBLIST
  276.     For I = 1 To MAX_MOBS
  277.         Read mob(I).level
  278.         Read mob(I).mName
  279.         Read mob(I).atk
  280.         Read mob(I).xp
  281.         Read mob(I).hp
  282.         Read mob(I).gold
  283.         Read mob(I).weaponStr
  284.         Read mob(I).deathGossip ' not used anymore
  285.     Next
  286.  
  287.     CREATE_MAP
  288.  
  289.  
  290.  
  291. Sub DRAW_MAP
  292.     Dim row, col As Integer
  293.  
  294.     '// DRAW PLAYER CURRENT QUADRANT AND SECTOR
  295.     Locate 1, 1
  296.  
  297.     row = 1:
  298.     For Y = (player.qy * 10 - 10) + 1 To (player.qy * 10)
  299.         col = 1
  300.         For X = (player.qx * 10 - 10) + 1 To (player.qx * 10)
  301.  
  302.  
  303.             If row = player.sy And col = player.sx Then
  304.                 'Print "found": End
  305.                 Print PLAYER_AVATAR;
  306.             Else
  307.  
  308.                 Select Case area(X, Y)
  309.  
  310.                     Case 1:
  311.                         I = r(2)
  312.                         If I = 1 Then Print " ";
  313.                         If I = 2 Then Print " ";
  314.  
  315.                     Case Else
  316.                         Print tile(area(X, Y));
  317.  
  318.                 End Select
  319.             End If
  320.  
  321.             col = col + 1
  322.  
  323.         Next X
  324.  
  325.  
  326.         Restore ARMORLIST
  327.         Dim armorStr As String
  328.         Dim abuff As Integer
  329.         For I = 1 To player.armorId: Read I, armorStr, I, abuff: Next
  330.  
  331.         Restore WEAPONLIST
  332.         Dim weaponStr As String
  333.         Dim wbuff As Integer
  334.         For I = 1 To player.armorId: Read I, weaponStr, I, wbuff: Next
  335.  
  336.  
  337.         Select Case row
  338.             Case 1: Print , _Trim$(player.pName); " Level: "; player.level '; " Q: "; player.qx; ","; player.qy; " S: "; player.sx; ","; player.sy
  339.  
  340.             Case 2: Print , "HP: "; player.hp; "/"; player.hpMax; _
  341.                             " Atk: ";player.atk; "(+"; _Trim$(Str$(wbuff)); ")/"; player.atkMax; _
  342.                             "  Def: "; player.defense; "(+"; _Trim$(Str$(abuff)); ") /"; player.defMax
  343.  
  344.             Case 3: Print , "Armor: "; armorStr; "(+"; _Trim$(Str$(abuff)); ")"
  345.             Case 4: Print , "Weapon: "; weaponStr; "(+"; _Trim$(Str$(wbuff)); ")"
  346.  
  347.             Case 5: Print , "Spells"
  348.             Case 6: Print , "    Charm: "; player.charm
  349.             Case 7: Print , "     Stun: "; player.stun
  350.             Case 8: Print , "Invisible: "; player.invisi
  351.  
  352.             Case 10: Print ,: Print Using "Days in forest: ##.##"; player.daysInGame;: Print "/30";
  353.             Case Else: Print
  354.         End Select
  355.         row = row + 1
  356.     Next Y
  357.  
  358.  
  359. Sub CREATE_MAP
  360.     Dim k As Double
  361.     '// TODO: MAKE A DECENT MAP GEN, THIS IS JUST RANDOM STUFF
  362.     '//       CLOSE TO THE ORIGINAL GAME OF JUST TREES, PATHS AND WALLS.
  363.     For I = 1 To MAPY
  364.         For J = 1 To MAPX
  365.             k = Rnd(1)
  366.             area(I, J) = 99
  367.             If k < .99 Then area(I, J) = 1 'Trees
  368.             If k < .55 Then area(I, J) = 2 ' Plains
  369.             If k < .07 Then area(I, J) = 3 ' WALLS
  370.             '// .011 about 120-140 ish
  371.             If k < .011 Then area(I, J) = 4: game.total_ruins = game.total_ruins + 1 'Ruins
  372.             '// .002 less than 30 avg
  373.             If k < .002 Then area(I, J) = 5: game.total_inns = game.total_inns + 1 'INN
  374.         Next
  375.     Next
  376.  
  377.     '// we need at least 5 inns
  378.     If game.total_inns < MIN_INNS Then
  379.         For I = 1 To MIN_INNS - game.total_inns
  380.             area(r(10), r(10)) = 5
  381.         Next
  382.     End If
  383.  
  384.  
  385.     If game.total_ruins < MIN_RUINS Then
  386.         For I = 1 To MIN_RUINS - game.total_ruins
  387.             area(r(10), r(10)) = 4
  388.         Next
  389.     End If
  390.  
  391.  
  392. Sub RESET_RANDOM_ENCOUNTER_TICK
  393.     '// restart the random encoutner ticker
  394.     '// This only needs to be called at new game,
  395.     '// when player leaves an inn.
  396.     '// after combat.
  397.     '// this will set a ticker that is counted down based on the number of
  398.     '// steps the player takes. how mcuh is based on terrain. see movement sub.
  399.     '// https://finalfantasy.fandom.com/wiki/Random_encounter
  400.     '// this ticker is smaller due to this game size being small
  401.     RANDOM_TICK = Int(Rnd * 30) + 1
  402.  
  403.  
  404.     r = Int(Rnd * num) + 1
  405.  
  406. '// USE IN CONJUNCTION WITH RANDOMIZE
  407. '// The TIMER function returns the number of seconds past the previous midnite
  408. '// This means next day, same seed.
  409. Function stripTime
  410.     Dim t As Long
  411.     Dim d As Long
  412.     Dim s As String
  413.  
  414.     '// strip date
  415.     s = Left$(Date$, 2) + Mid$(Date$, 4, 2) + Right$(Date$, 4)
  416.     d = Val(s)
  417.  
  418.     s = Left$(Time$, 2) + Mid$(Time$, 4, 2) + Right$(Time$, 2)
  419.     t = Val(s)
  420.     stripTime = d * t
  421.  
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #9 on: November 14, 2021, 05:01:08 am »
Both "forest" files on Mediafire are executables. I can run them but I cannot view the contents...

yes, that is because the source is not included. its just to try out what I have so far.
Today I should have up the combat and spells, so you can play around with that... :-)
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #10 on: November 14, 2021, 11:19:15 am »
so the display is currently old fashion printer roll-up method LOL I DEFINATELY WILL be working on that today, just wanted to get the combat working
the combat and spells are working pretty well.

Check out the latest here (I put it on my svn host, easier for uploads and updates faster.)
the screenshot shows an example of a failed charm spell LOL

Program issue, not sure why, but the following does not trim up

Code: QB64: [Select]
  1. mob(i).mname = _trim$(mob(i).mname)

This will not remove the whitespace.  should I just use a different var when displaying a type var string?

charmspell.jpg
* charmspell.jpg (Filesize: 47.5 KB, Dimensions: 646x428, Views: 247)
« Last Edit: November 14, 2021, 11:36:15 am by xra7en »
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #11 on: November 14, 2021, 04:12:14 pm »
From my experience... That's the first time I have seen an array within a trim$() as well as a 'period'. I have always used and seen a simple string used. Perhaps a simple tmp$=mob(i).mname: molb(i)mname=_trim$(tmp$). Not the most efficient but might work... lol
Logic is the beginning of wisdom.

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #12 on: November 14, 2021, 05:41:11 pm »
check out example 4
https://www.qb64.org/wiki/TYPE
Periods used with record types

mob(i).mName in this case means
mob #i's name which is a string

and _trim$(mob(i).mName) should remove all the whitespace before and after

hope this helps clear that up. :-)



Code: QB64: [Select]
  1.  thisMob = _Trim$(mob(I).mName)

that worked.
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #13 on: November 14, 2021, 08:20:37 pm »
Just some more screens (color slowly added)
Image6.jpg
* Image6.jpg (Filesize: 36.19 KB, Dimensions: 646x428, Views: 257)
Image7.jpg
* Image7.jpg (Filesize: 23.85 KB, Dimensions: 646x428, Views: 246)
Image8.jpg
* Image8.jpg (Filesize: 38.91 KB, Dimensions: 646x428, Views: 255)
Image9.jpg
* Image9.jpg (Filesize: 32.69 KB, Dimensions: 646x428, Views: 244)
Image10.jpg
* Image10.jpg (Filesize: 34.92 KB, Dimensions: 646x428, Views: 236)
Image11.jpg
* Image11.jpg (Filesize: 20.45 KB, Dimensions: 646x428, Views: 258)
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
    • View Profile
Re: WIP: Monster combat (reboot) Mashup
« Reply #14 on: November 18, 2021, 06:29:51 pm »
How difficult would this be to turn into a multiplayer with server/client ?

I think this has a potential to work good.
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!