Need batch programmers for multiplayer batch game :)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Ymit
Posts: 3
Joined: 14 Sep 2015 19:39

Need batch programmers for multiplayer batch game :)

#1 Post by Ymit » 14 Sep 2015 19:50

I am working on a multiplayer rpg batch game and need some help.
Images:
http://imgur.com/nsXC1eh
http://imgur.com/uzo2mi2

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Need batch programmers for multiplayer batch game :)

#2 Post by foxidrive » 14 Sep 2015 21:38

Please tell us what you expect, and what help you'd like,
and provide the code you have so far if you want help,
and describe the task fully.

See here: viewtopic.php?f=3&t=6108

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Need batch programmers for multiplayer batch game :)

#3 Post by ShadowThief » 14 Sep 2015 21:43

And the images are... proof that you know how to make menus? Seriously, what am I supposed to do with this information?

When you need help from other people with a thing, actually provide the people with that thing. And if you're just posting to gauge interest, why? This is a forum dedicated to batch; at least one of us is going to be interested in helping in some capacity.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Need batch programmers for multiplayer batch game :)

#4 Post by Squashman » 15 Sep 2015 06:33

If I had a dollar for everytime this thread topic was started, I would be rich.

Ymit
Posts: 3
Joined: 14 Sep 2015 19:39

Re: Need batch programmers for multiplayer batch game :)

#5 Post by Ymit » 15 Sep 2015 20:05

the code so far:

Code: Select all

@echo off
title Rpg
color 0f

:Menu
cls
echo.
echo  ___________
echo ^|           ^|
echo ^|   Game    ^|
echo ^|___________^|
echo.
echo By Ymit
echo.
echo [S]tart
echo [E]xit
echo.
set /p m="-: "
if /i %m% == s goto start
if /i %m% == e exit
set m=
goto Menu

:start
goto login-createAcount

:login-createAcount
cls
echo.
echo Do you have an acount?
echo [Y]/[N]
echo.
set /p yn="-: "
if /i %yn% == y goto login
if /i %yn% == n goto createAcount
if /i %yn% == t goto listAcountInfo
set yn=
goto login-createAcount

:createAcount
cls
echo.
echo What is your desired name???
set /p usrname="-: "
if exist %usrname%.plr (
   cls
   echo.
   echo Username Taken!
   pause>nul
   goto createAcount
)

call:init
goto Save

:init
set maxHp=100
set hp=%maxHp%
set lvl=1
set xp=1
set xptill=10
set unlockedLvl=1
set dmg=3
goto :EOF

:login
cls
echo.
echo Enter Username:
set /p usrname="-: "
if not exist %usrname%.plr (
   cls
   echo.
   echo No Username: %usrname%!
   pause>nul
   goto login
)
for /f " eol=X tokens=1,2,3,* " %%l in (%usrname%.plr) do set %%l
goto Home

:listAcountInfo
for /f " eol=X tokens=1,2,3,* " %%l in (%usrname%.plr) do echo %%l
pause>nul
goto Menu

:updmg
set /a upDmg+=%random% %%5
if %upDmg% leq 2 goto updmg
set /admg+=%upDmg%
goto:EOF

:lvlUp
set /a xp -=%xptill%
set /a xptill+=%random% %%10
set /a lvl+=1
set /a maxHp+=30
set hp=%maxHp%
call:updmg
cls
echo Level Up!
pause>nul
goto Home

:Home
set unlockedLvl=%lvl%
if %xp% geq %xptill% goto lvlUp
cls
echo.
echo ___________________
echo.
echo %usrname%, Hp; %hp%, Dmg: %dmg%
echo Lvl: %lvl%, Xp: %xp%/%xptill%
echo ___________________
echo.
echo [S]ingle Player
echo [M]ulti Player (Beta!)
echo [F]Save
echo [E]xit
set /p m="-: "
if /i %m% == s goto SinglePlayerMenu
if /i %m% == m goto MultiplayerMenu
if /i %m% == f goto Save
if /i %m% == e goto Menu
set m=
goto Home

:MultiplayerMenu
set m=99
cls
echo                      MULTIPLAYER
echo [H]ost
echo [J]oin
echo [E]xit
set /p m="-: "
if /i %m% == h goto Host
if /i %m% == j goto Join
if /i %m% == e goto Home
set m=
goto MultiplayerMenu

:Host
cls
echo Enter name of game.
set /p gname="-: "
if not defined gname goto Host
set hname=%usrname%
set hhp=%hp%
set hdmg=%dmg%
(
echo hname=%hname%
echo jname=NONE
echo hhp=%hhp%
echo jhp=NONE
echo hdmg=%hdmg%
echo jdmg=NONE
echo turn=2
) > %gname%.txt
call:waitForJoin
cls
echo Someone has joined!
echo.
echo Do You Want To Play With: %jname%???
echo [Y]/[N]
set /p yn="-: "
if /i %yn% == y goto BeginMultiplayerGame
if /i %yn% == n (
   cls
   echo Ok!
   pause>nul
   goto Host
   (
   echo permision=NO
   ) > %gname%.txt
)
goto Host

:waitForJoin
cls
echo Waiting... (Cancle bye closing game)
ping localhost -n 1 >nul
for /f " eol=X tokens=1,2,3,* " %%l in (%gname%.txt) do set %%l
if not %jname% == NONE goto:EOF
goto waitForJoin

:findgame
cls
echo Waiting... (Cancle bye closing game)
ping localhost -n 1 >nul
if not exist %gname%.txt goto findgame
for /f " eol=X tokens=1,2,3,* " %%l in (%gname%.txt) do set %%l
if not %jname% == NONE goto gameFull
set jname=%usrname%
set jhp=%hp%
set jdmg=%dmg%
(
echo hname=%hname%
echo jname=%jname%
echo hhp=%hhp%
echo jhp=%jhp%
echo hdmg=%hdmg%
echo jdmg=%jdmg%
echo turn=2
) > %gname%.txt
goto:EOF

:BeginMultiplayerGame
set turn=1
echo Permision=YES >> %gname%.txt
cls
echo in Game with %jname%
pause>nul
goto MultiplayerBattle

:waitForPermision
cls
echo Waiting for permision... (do not close game until allowed in or not!)
ping localhost -n 1 >nul
for /f " eol=X tokens=1,2,3,* " %%l in (%gname%.txt) do set %%l
if %permision% == YES goto:EOF
cls
echo Permision denied!
pause >nul
goto MultiplayerMenu

:Join
cls
echo Enter name of game to join.
set /p gname="-: "
if not defined gname goto Join
call:findgame
cls
echo Found game!
pause>nul
call:waitForPermision
cls
echo Permision Granted!
set turn=2
pause>nul
goto MultiplayerBattle

::this part is still being fixed.

::MultiplayerBattle
::cls
::echo                          %hname% VS %jname%!
::echo.
::echo %hname%'s Hp: %hhp% Dmg: %hdmg%
::echo %jname%'s Hp: %jhp% Dmg: %jdmg%
::echo.
::if %turn% == 3 goto WonMB
::if %turn% == 2 (
::   echo Waiting for turn...
::   for /f " eol=X tokens=1,2,3,* " %%l in (%gname%.txt) do set %%l
::   (
::   echo hname=%hname%
::   echo jname=%jname%
::   echo hhp=%hhp%
::   echo jhp=%jhp%
::   echo hdmg=%hdmg%
::   echo jdmg=%jdmg%
::   echo turn=2
::   ) > %gname%.txt
::   cls
::   set turn=1
::   echo wait for %hname% to tell you to continue!
::   pause>nul
::   goto MultiplayerBattle
::)
::echo [A]ttack
::echo [S]urrender
::echo.
::set /p m="-: "
::if /i %m% == a (
::   set /a hhp-=%jdmg%
::   set /a jhp-=%hdmg%
::   set turn=2
::   (
::   echo hname=%hname%
::   echo jname=%jname%
::   echo hhp=%hhp%
::   echo jhp=%jhp%
::   echo hdmg=%hdmg%
::   echo jdmg=%jdmg%
::   echo turn=1
::   ) > %gname%.txt
::   cls
::   echo Tell %jname% to continue!
::   pause>nul
::)
::if /i %m% == s goto Surrender
::set m=
::goto MultiplayerBattle

:WonMB
cls
echo You have either defeated %jname% or he/she surrenderd!
echo.
pause>nul
goto Home

:Surrender
(
echo hname=%hname%
echo jname=%jname%
echo hhp=%hhp%
echo jhp=%jhp%
echo hdmg=%hdmg%
echo jdmg=%jdmg%
echo turn=3
) > %gname%.txt
cls
echo.
echo You have surrenderd to %hname%!
echo.
pause>nul
goto Home

:Save
(
echo usrname=%usrname%
echo hp=%hp%
echo xp=%xp%
echo xptill=%xptill%
echo unlockedLvl=%unlockedLvl%
echo dmg=%dmg%
echo lvl=%lvl%
) > %usrname%.plr
cls
echo Saved Successfully!
pause>nul
goto Home

:SinglePlayerMenu
cls
echo.
echo [1] MapPack #1
if %unlockedLvl% GEQ 10 echo [2] MapPack #2
if %unlockedLvl% GEQ 19 echo [3] MapPack #3
echo [E]xit
echo.
set /p m="-: "
if /i %m% == e goto Home
if %m% == 1 goto MapPack#1
if %m% == 2 goto MapPack#2
if %m% == 3 goto MapPack#3
set m=
goto SinglePlayerMenu

:MapPack#1
cls
echo.
echo [1] Map #1
if %unlockedLvl% GEQ 2 echo [2] Map #2
if %unlockedLvl% GEQ 3 echo [3] Map #3
if %unlockedLvl% GEQ 4 echo [4] Map #4
if %unlockedLvl% GEQ 5 echo [5] Map #5
if %unlockedLvl% GEQ 6 echo [6] Map #6
if %unlockedLvl% GEQ 7 echo [7] Map #7
if %unlockedLvl% GEQ 8 echo [8] Map #8
if %unlockedLvl% GEQ 9 echo [9] Map #9
echo [E]xit
echo.
set /p m="-: "
if %m% == 1 (
   set mhp=15
   set mdmg=2
   set /a xpDrop=%random% %%5
   goto BattleEnemy
)
if %m% == 2 (
   set mhp=23
   set mdmg=3
   set /a xpDrop=%random% %%7
   goto BattleEnemy
)
if %m% == 3 (
   set mhp=30
   set mdmg=3
   set /a xpDrop=%random% %%7
   goto BattleEnemy
)
if %m% == 4 (
   set mhp=26
   set mdmg=4
   set /a xpDrop=%random% %%8
   goto BattleEnemy
)
if %m% == 5 (
   set mhp=35
   set mdmg=4
   set /a xpDrop=%random% %%9
   goto BattleEnemy
)
if %m% == 6 (
   set mhp=31
   set mdmg=5
   set /a xpDrop=%random% %%11
   goto BattleEnemy
)
if %m% == 7 (
   set mhp=38
   set mdmg=5
   set /a xpDrop=%random% %%14
   goto BattleEnemy
)
if %m% == 8 (
   set mhp=45
   set mdmg=4
   set /a xpDrop=%random% %%15
   goto BattleEnemy
)
if %m% == 9 (
   set mhp=55
   set mdmg=6
   set /a xpDrop=%random% %%23
   goto BattleEnemy
)
if /i %m% == e goto Home
set m=
goto MapPack#1

:MapPack#2
cls
echo.
if %unlockedLvl% GEQ 10 echo [1] Map #1
if %unlockedLvl% GEQ 11 echo [2] Map #2
if %unlockedLvl% GEQ 12 echo [3] Map #3
if %unlockedLvl% GEQ 13 echo [4] Map #4
if %unlockedLvl% GEQ 14 echo [5] Map #5
if %unlockedLvl% GEQ 15 echo [6] Map #6
if %unlockedLvl% GEQ 16 echo [7] Map #7
if %unlockedLvl% GEQ 17 echo [8] Map #8
if %unlockedLvl% GEQ 18 echo [9] Map #9
echo [E]xit
echo.
set /p m="-: "
if /i %m% == e goto Home
if %m% == 1 (
   set mhp=60
   set mdmg=6
   set /a xpDrop=%random% %%25
   goto BattleEnemy
)
if %m% == 2 (
   set mhp=78
   set mdmg=7
   set /a xpDrop=%random% %%30
   goto BattleEnemy
)
if %m% == 3 (
   set mhp=80
   set mdmg=8
   set /a xpDrop=%random% %%37
   goto BattleEnemy
)
if %m% == 4 (
   set mhp=88
   set mdmg=8
   set /a xpDrop=%random% %%40
   goto BattleEnemy
)
if %m% == 5 (
   set mhp=90
   set mdmg=9
   set /a xpDrop=%random% %%45
   goto BattleEnemy
)
if %m% == 6 (
   set mhp=100
   set mdmg=10
   set /a xpDrop=%random% %%49
   goto BattleEnemy
)
if %m% == 7 (
   set mhp=115
   set mdmg=11
   set /a xpDrop=%random% %%50
   goto BattleEnemy
)
if %m% == 8 (
   set mhp=120
   set mdmg=12
   set /a xpDrop=%random% %%60
   goto BattleEnemy
)
if %m% == 9 (
   set mhp=140
   set mdmg=14
   set /a xpDrop=%random% %%67
   goto BattleEnemy
)
set m=
goto MapPack#2

:MapPack#3
cls
echo.
if %unlockedLvl% GEQ 19 echo [1] Map #1
if %unlockedLvl% GEQ 20 echo [2] Map #2
if %unlockedLvl% GEQ 21 echo [3] Map #3
if %unlockedLvl% GEQ 22 echo [4] Map #4
if %unlockedLvl% GEQ 23 echo [5] Map #5
if %unlockedLvl% GEQ 24 echo [6] Map #6
if %unlockedLvl% GEQ 25 echo [7] Map #7
if %unlockedLvl% GEQ 26 echo [8] Map #8
if %unlockedLvl% GEQ 27 echo [9] Map #9
echo [E]xit
echo.
set /p m="-: "
if /i %m% == e goto Home
set m=
goto MapPack#3

:BattleEnemy
set m=99
if %mhp% LEQ 0 goto Win
if %hp% LEQ 0 goto Lose
cls
echo                          %usrname% VS Monster!
echo.
echo %usrname%'s Hp: %hp%
echo Monster's Hp: %mhp%
echo.
echo [A]ttack
echo [F]lee
echo.
set /p m="-: "
if /i %m% == a (
   set /a hp-=%mdmg%
   set /a mhp-=%dmg%
   set m=
   goto BattleEnemy
)
if /i %m% == f goto Flee
set m=
goto BattleEnemy

:Flee
set /a flee=%random% %%4
if %flee% == 2 (
   set flee=
   set /a hp-=%mdmg%
   cls
   echo You Got Away,
   echo         But Got No Loot!
   pause>nul
   goto Home
) else (
   set flee=
   cls
   echo You Didn't Escape!
   pause>nul
   goto BattleEnemy
)
set flee=
goto BattleEnemy

:Win
if %xpDrop% leq 0 set xpDrop=1
set /a xp+=%xpDrop%
cls
echo You Won The Fight!
echo        You Gained:
echo           Xp: %xpDrop%
pause>nul
goto Home

:Lose
set hp=50
cls
echo You Lost!
pause >nul
goto Home

it hasnt been properly commented but that is what i got in a couple of days work.

Ymit
Posts: 3
Joined: 14 Sep 2015 19:39

Re: Need batch programmers for multiplayer batch game :)

#6 Post by Ymit » 15 Sep 2015 20:12

i'm sorry i didn't ask correctly. i am working on a rpg game that you are able to battle your friends in. using dropbox or google drive or onedrive as a shared directory which the two batch files could read and write files from. i have a good bit done already. like the hosting-joining of a game, a simple leveling system and a good many single player levels. i guess when i said i need help i meant some help with the multiplayer battling part.

Post Reply