I removed the second loop and changed your code to this:
set /a spin=%random% %%20 (double percentages for the formula)
then I set the rest of it to this
if %%f EQU %spin% goto !names{%%F]!
Thank you for showing me the rest of the formula for this array Boogle, i know it seems basic stuff to you but it wasn't basic stuff for me, it was actually pretty hard for me to try to grasp the batch syntax of it because i didn't know the syntax of the batch language that I was programming in because no documentation came with the batch language on my computer and that's why I had trouble knowing how to write the formulas out I can look more into this to see what else it can do with the monsters and other stuff so thanks for giving me a starting point with the array, its amazing just how the array just jumps randomly off into the screens now.
Yes, Boogle did try to help but i needed the correct syntax for this difficult language I'm using and not many people know it because they using those more modern languages. Well I asked another guy on another site and he don't know how to do that one either So to answer I find batch to be good for doing only some things with it, average for doing others, and either weak, or just absolutely abysmal for trying to do other stuff.that without third party programs are outside its limits because batch language dosen't have very much of a bone by the looks of things, so to me batch was more like Old Mother Hubbard who has no goodies in her cupboard so you have to dig around to look for all the goodies because her cupboard has gone bust...
Pity Batch aint like magic pockets where you get lollies and candy and cakes all thown out to you all the time all coming out of a magical whirlwind....
The batch language I find it to be unstable but it somehow seems to work, but so much can go wrong with the code if its just one little tiny thing that is missing then it crashes or gives errors.
But there's a neat little program called batchcodefix and that helped me to get rid of most of the errors to make the code stay stable..
The batch game was just an experiement to see what the game would look like because I wanted to roam all around all the game regions first before thinking of shifting this game into a 3d engine.
So the batch gave me a basic rough outline of a game engine. I didnt want this type of game to be only shackeled to just turn-based or stuck forever in the quagmire of batch... The batch was useful for me because i could script it all very fast with that language but the disadvantage is that it would be an open world turn-based engine, not an open world real time interactive engine like with the proper 3d game engines today.
I did ask for some help elsewhere on another site to try to solve this array problem and did receive the following answer when I posted about the problem, 'Nope, i got nothing.' so truck out there, so i did try to help myself by asking around. You say I've been rude to you, no you msunderstood, I have spoken mainly about the problem I'm having with trying to set up the array for I learn by example.
Well the case of the array is very simple. I don't know where the piece of this puzzle fits in so of course I am not going to know where to correctly place the piece of the puzzle. because I've not seen what the finish puzzle looks like to know where this piece has to go and how it fits into the rest of the picture. So here I am trying to jam in the piece and finding that its the wrong shape because i'm holding it the wrong way around and no matter how much i try to force the piece in to try to get it to fit, it just wont' fit and the computer coughs up errors to tell me that piece is not going to fit. So I cannot complete the puzzle until i know where that piece actually fits in and if you don't fit it in right, errors will result. So Its like doing a puzzle. and its really frustrating that you want to complete the puzzle but can't because you don't know how the piece fits.
In telling me to go by my own experience to figure out how it fits myelf, You fail to realize this one truth, that its not experience that's the best teacher, but it is correct example that is the best teacher. that is the best way to learn.
I learn by watcing others show me the correct example.
Experience is not always the best teache because experience is not based on correct principles but on trial and error.
Well no you misunderstood my words, 90% of the problem has already been solved, there's just 10% left that hasn't. But what displeases me is your attitude to learnng, you expect people to solve everything themselves and this a selfish attitude to have, because I been taught i my church that we serve one another and help one anothr, not turn others away if they need help.
When I have a problem I can't solve on my own, I seek help from others, not expect to be told to just edcuate myself which is an insult to my intelligence..Because I have beem taught to belive that other people are teachers and so you go to them to trry to get answers from them to things you need to know..
This is where you approach to learning is different to mine. You expect people to solve their own problem and give them the false 'Harden up' philoosphy and I expect people to give me the answers to solving the problem if they know the answer and people who know the answer and refuse to share their knowledge i will judge them to be unhelpful.
Ther's a bug in the message board text editor on this site, it keeps on switching the text edit mode off everytime I hit the enter key and this really starting to get annoying because the only way I can get the editor to allow me to type anything is to have to save the message and then re-edit it.
for /L %%f in (0,1,!lastindex!) do ( set /a spin=%random% %%r20+1
for /L %%f in (0,1,!lastindex!) do (
IF %%f == %rand% == True goto !names[%%f]!
) goto !names{%%f]! ) goto array
Well this code didn't work. The line I'm having alot of problems with is the set /a spin=%random% (%%????%) line because as I told you before, i don't know how to set this line up to work with the array
so I tried set /a spin=%random% %%f - result: Missing operator error.
so i tried set /a spin=%random% %[!names[%%f]% result: the system cannot find 519459519495194
Its obviously this language is way beyond your capacity since you told already me you can't do it, I've tried and I can't do it either...its too hard.... the batch language is just too advanced..... Need to find an advanced batch programmer.
All I get is a 1001 ways instead of producing system errors.
the result I got was this.
So I cannot get it to work, Obviously from what you're telling me. its too hard for you as well, since its also out of your league because you also can't do it..
I found the array code for the batch language format. All that is needed now is to get the array to pick out a name from the list at random and then just make the goto jumps.
@echo off setlocal enabledelayedexpansion enableextensions
set i=-1
for %%f in (sea, wildera, mgarden, shadowland, secretarea1, gianttree, undeadzom,shutdown2, gianttree3,boat, boxer, easto, oasisb, trollm, bonesc, swampba, biglakem, mlakeast, laddera, ladb, hatchebs, hachty, eeye, spiderbossb, darkwda) do ( set /a i=!i!+1 set names[!i!]=%%f ) set lastindex=!i!
for /L %%f in (0,1,!lastindex!) do ( echo !names[%%f]! )
This code works to display everything that's found inside the array using the for /L loop statement.
Now if I change echo to goto !names[%%f]! inside the for /L loop code then it jumps into the first name that's found in the array 'SEA' and executes that codeblock, but it will not jump randomly into the other names so How do I get the computer to pick out a name at random that's inside an array?
I know how to pass the array off to the goto command because it read the first name correctly,
but I don't know how to set this up with the set /a spin=%random% %%?? to get it to read the names that are found inside in the array and just randomly pick one of those names and just goto jump to it.
its not easy to try to code because you have to get it to somehow randomize the names that are found inside the array. i don't know...
Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm. It uses the structural conventions of a programming language, but is intended for human reading rather than machine reading.
Right.
I only gave you pseudocode - not batch code examples - I have previously provided links to websites that describe how to make arrays/lists in Batch Script.
Um I see so since I don't understand yet how to write in these string arrays to use in my own code in batch format because I need the workaround for batch because its batch and not the other programming languages.. Or why don't I just program the rest of the dam game, and just tweak it all later. Surely I can convert some of the batch to some other language.
Now my coach is a national level coach and at this level we are taught pure truth at the world class level so we can progress alot more quickly. if the coach just taught watered-down rubbish to us then we would not learn anything quickly and be forever learning but never coming to a knowledge of the truth..
I am only trying to give you some suggestions - not tell you how to code - learning to code is an ongoing process - you should always be researching and learning - Google is a great resource. :)
In my opinion - you should not use Batch Script to learn how to code.
But it worked didn't it. even if it was well slow in execution speed.
BUT I would be keen for you to finish your project - even if you REDUCE the size and scope of the project. It looks like you have achieved some nice results even though you are only just learning. Finishing a project is important - but perhaps reduce your goals for this Batch Script game - I would like you to finish it, but I think you are harming your ability to learn to program.
It was fun to try to do the game yes, but I wasn't looking for perfection. I was just looking only to get the basics to work like the overdrives, the progressions, and the mounts, put in little quests and then tweak it all later..
I.E. Getting me to show you how to create Batch Script work-arounds for normal common development functions is NOT the way to learn imo.
Take this last bit of advice or leave it, but I feel you should work out HOW you can finish your game in the next couple of days - e.g. reduce the size - scope, goals or whatever.
Finish the game off in just the next couple of days? I'm only up to region seven, there's still Snowy Peaks Region to make, the Dragon Region. and the Hotlands. I still haven't quite finished the Trollmountains region yet.
Get it done - show it to people. Ignore any negative comments that are not constructive. Then start a new project in either a game engine - or a popular language - that way you will be well supported by an active helpful community - do plenty of tutorials and enjoy the learning process. I believe that you have the tanacity to make games - you just need to learn more - to learn more, do lots of small projects - things that only take a few days at most to complete
NAVIGATION: I daisy chained all my screens up together to allow non-linear screen movement through them. Its only when the player dies, do I make the game pick out a screen at random to warp the player off into. but you do not move in this game in a a fixed linear fashion with heavily scripted invisible nanny boundaries all around the playing area (like MAss Effect 3 had to hold your hand all the time on so you could not even fall off and hurt yourself in that game and only when people are shooting at you or throwing things at you you take damage) but in this game, you move instead in a non-linear fashion so you CAN fall off ledges and stuff and indeed hurt your health, so you can go almost anywhere in the game into almost any area, but if you fall off something and die, well you gt randomly warped to a different area and you get to keep your current stats, so its an open world rpg turn-based game. But its the type of game that really needs a proper 3d engine to make it all come to life. And No nanny barriers to stop you from exploring or hurting yourself.....
Here's how I coded it.
:zordimension
rem WARPING defeated player to any location in the Game to start again. set /a room=%random% %%390+1 if %room%==1 goto boat if %room%==2 goto mgarden if %room%==3 goto shadowland if %room%==4 goto secretarea1 up to 390 rooms ect, ect,
I also set the game up so it picks out monsters out at random depending on your current difficulty level to warp the player off into as well, only put this in some screens areas...
The progression code I used.: The higher up the levels you go, the more stronger monsters appear. I didn't just code this so the same monsters keep increasing their HP each time you level up, no I had put in new enemy encounters into it as well.
So when you vist the same area again. Sometimes I also use also a Random Dice counter for the computer to put something in the area to make it show up after a certain number of visits. . So it dosen't just appear at a certain difficulty level,but appears depening on how many times that you enter the area. such as like putting a bonus health item, or treasure chest item. or a monster ambush, oect or maybe a secret warp gate to a hidden area..
Monster Progressions:
if %curlvl% EQU 2 goto forlighthouse - lighthouse screen shows 1 grizzly bear on it.
if %curlvl% EQU 10 goto forlightbear level 10 appears with 2 grizzly bears on it.
if %curlvl% EQU 20 goto forightrock level 20 shows a troll and a turtle.
if %curlvl% EQU 40 goto forlightroll two trolls appear at level 40
if %curlvl% EQU 50 goto fordragon - a dragon mini boss appears at level 50
The bottom line is that this game really needs a proper game engine for these kind ideas and concepts I have in mind for the game to all come to life, I didn't want the game to be all linear and heavily scripted but I can only do just so much with the windows console, because its not a game engine and I cannot build a proper game engine with it, for batch allowed me to view all the game environment when I move through the screens and test all the progressions and random stuff I have in it yes, but theres no walking, no scrolling, nobody is falling down in real time, there's no monsters chasing you all around the place, or detecting how far you are from them before thet start chasing you, so the game works, but is the static environment that lets it down just moving through a whole bunch of pretty pictures therefore forcing the game to be reduced all down to old school turn-based battles like the old final fantasy games..
I removed the second loop and changed your code to this:
set /a spin=%random% %%20 (double percentages for the formula)
then I set the rest of it to this
if %%f EQU %spin% goto !names{%%F]!
Thank you for showing me the rest of the formula for this array Boogle, i know it seems basic stuff to you but it wasn't basic stuff for me, it was actually pretty hard for me to try to grasp the batch syntax of it because i didn't know the syntax of the batch language that I was programming in because no documentation came with the batch language on my computer and that's why I had trouble knowing how to write the formulas out I can look more into this to see what else it can do with the monsters and other stuff so thanks for giving me a starting point with the array, its amazing just how the array just jumps randomly off into the screens now.
Yes, Boogle did try to help but i needed the correct syntax for this difficult language I'm using and not many people know it because they using those more modern languages. Well I asked another guy on another site and he don't know how to do that one either So to answer I find batch to be good for doing only some things with it, average for doing others, and either weak, or just absolutely abysmal for trying to do other stuff.that without third party programs are outside its limits because batch language dosen't have very much of a bone by the looks of things, so to me batch was more like Old Mother Hubbard who has no goodies in her cupboard so you have to dig around to look for all the goodies because her cupboard has gone bust...
Pity Batch aint like magic pockets where you get lollies and candy and cakes all thown out to you all the time all coming out of a magical whirlwind....
The batch language I find it to be unstable but it somehow seems to work, but so much can go wrong with the code if its just one little tiny thing that is missing then it crashes or gives errors.
But there's a neat little program called batchcodefix and that helped me to get rid of most of the errors to make the code stay stable..
The batch game was just an experiement to see what the game would look like because I wanted to roam all around all the game regions first before thinking of shifting this game into a 3d engine.
So the batch gave me a basic rough outline of a game engine. I didnt want this type of game to be only shackeled to just turn-based or stuck forever in the quagmire of batch... The batch was useful for me because i could script it all very fast with that language but the disadvantage is that it would be an open world turn-based engine, not an open world real time interactive engine like with the proper 3d game engines today.
I did ask for some help elsewhere on another site to try to solve this array problem and did receive the following answer when I posted about the problem, 'Nope, i got nothing.' so truck out there, so i did try to help myself by asking around. You say I've been rude to you, no you msunderstood, I have spoken mainly about the problem I'm having with trying to set up the array for I learn by example.
Well the case of the array is very simple. I don't know where the piece of this puzzle fits in so of course I am not going to know where to correctly place the piece of the puzzle. because I've not seen what the finish puzzle looks like to know where this piece has to go and how it fits into the rest of the picture. So here I am trying to jam in the piece and finding that its the wrong shape because i'm holding it the wrong way around and no matter how much i try to force the piece in to try to get it to fit, it just wont' fit and the computer coughs up errors to tell me that piece is not going to fit. So I cannot complete the puzzle until i know where that piece actually fits in and if you don't fit it in right, errors will result. So Its like doing a puzzle. and its really frustrating that you want to complete the puzzle but can't because you don't know how the piece fits.
In telling me to go by my own experience to figure out how it fits myelf, You fail to realize this one truth, that its not experience that's the best teacher, but it is correct example that is the best teacher. that is the best way to learn.
I learn by watcing others show me the correct example.
Experience is not always the best teache because experience is not based on correct principles but on trial and error.
Well no you misunderstood my words, 90% of the problem has already been solved, there's just 10% left that hasn't. But what displeases me is your attitude to learnng, you expect people to solve everything themselves and this a selfish attitude to have, because I been taught i my church that we serve one another and help one anothr, not turn others away if they need help.
When I have a problem I can't solve on my own, I seek help from others, not expect to be told to just edcuate myself which is an insult to my intelligence..Because I have beem taught to belive that other people are teachers and so you go to them to trry to get answers from them to things you need to know..
This is where you approach to learning is different to mine. You expect people to solve their own problem and give them the false 'Harden up' philoosphy and I expect people to give me the answers to solving the problem if they know the answer and people who know the answer and refuse to share their knowledge i will judge them to be unhelpful.
Ther's a bug in the message board text editor on this site, it keeps on switching the text edit mode off everytime I hit the enter key and this really starting to get annoying because the only way I can get the editor to allow me to type anything is to have to save the message and then re-edit it.
for /L %%f in (0,1,!lastindex!) do (
set /a spin=%random% %%r20+1
for /L %%f in (0,1,!lastindex!) do (
IF %%f == %rand% == True goto !names[%%f]!
)
goto !names{%%f]!
)
goto array
Well this code didn't work. The line I'm having alot of problems with is the set /a spin=%random% (%%????%) line because as I told you before, i don't know how to set this line up to work with the array
so I tried set /a spin=%random% %%f - result: Missing operator error.
so i tried set /a spin=%random% %[!names[%%f]% result: the system cannot find 519459519495194
Its obviously this language is way beyond your capacity since you told already me you can't do it, I've tried and I can't do it either...its too hard.... the batch language is just too advanced..... Need to find an advanced batch programmer.
All I get is a 1001 ways instead of producing system errors.
the result I got was this.
So I cannot get it to work, Obviously from what you're telling me. its too hard for you as well, since its also out of your league because you also can't do it..
I found the array code for the batch language format. All that is needed now is to get the array to pick out a name from the list at random and then just make the goto jumps.
@echo off
setlocal enabledelayedexpansion enableextensions
set i=-1
for %%f in (sea, wildera, mgarden, shadowland, secretarea1, gianttree, undeadzom,shutdown2, gianttree3,boat, boxer, easto, oasisb, trollm, bonesc, swampba, biglakem, mlakeast, laddera, ladb, hatchebs, hachty, eeye, spiderbossb, darkwda) do (
set /a i=!i!+1
set names[!i!]=%%f
)
set lastindex=!i!
for /L %%f in (0,1,!lastindex!) do (
echo !names[%%f]!
)
This code works to display everything that's found inside the array using the for /L loop statement.
Now if I change echo to goto !names[%%f]! inside the for /L loop code then it jumps into the first name that's found in the array 'SEA' and executes that codeblock, but it will not jump randomly into the other names so How do I get the computer to pick out a name at random that's inside an array?
I know how to pass the array off to the goto command because it read the first name correctly,
but I don't know how to set this up with the set /a spin=%random% %%?? to get it to read the names that are found inside in the array and just randomly pick one of those names and just goto jump to it.
its not easy to try to code because you have to get it to somehow randomize the names that are found inside the array. i don't know...
Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm. It uses the structural conventions of a programming language, but is intended for human reading rather than machine reading.
Right.
I only gave you pseudocode - not batch code examples - I have previously provided links to websites that describe how to make arrays/lists in Batch Script.
Um I see so since I don't understand yet how to write in these string arrays to use in my own code in batch format because I need the workaround for batch because its batch and not the other programming languages.. Or why don't I just program the rest of the dam game, and just tweak it all later. Surely I can convert some of the batch to some other language.
Now my coach is a national level coach and at this level we are taught pure truth at the world class level so we can progress alot more quickly. if the coach just taught watered-down rubbish to us then we would not learn anything quickly and be forever learning but never coming to a knowledge of the truth..
I am only trying to give you some suggestions - not tell you how to code - learning to code is an ongoing process - you should always be researching and learning - Google is a great resource. :)
In my opinion - you should not use Batch Script to learn how to code.
But it worked didn't it. even if it was well slow in execution speed.
BUT I would be keen for you to finish your project - even if you REDUCE the size and scope of the project.
It looks like you have achieved some nice results even though you are only just learning.
Finishing a project is important - but perhaps reduce your goals for this Batch Script game - I would like you to finish it, but I think you are harming your ability to learn to program.
It was fun to try to do the game yes, but I wasn't looking for perfection. I was just looking only to get the basics to work like the overdrives, the progressions, and the mounts, put in little quests and then tweak it all later..
I.E. Getting me to show you how to create Batch Script work-arounds for normal common development functions is NOT the way to learn imo.
Take this last bit of advice or leave it, but I feel you should work out HOW you can finish your game in the next couple of days - e.g. reduce the size - scope, goals or whatever.
Finish the game off in just the next couple of days? I'm only up to region seven, there's still Snowy Peaks Region to make, the Dragon Region. and the Hotlands. I still haven't quite finished the Trollmountains region yet.
Get it done - show it to people. Ignore any negative comments that are not constructive.
Then start a new project in either a game engine - or a popular language - that way you will be well supported by an active helpful community - do plenty of tutorials and enjoy the learning process.
I believe that you have the tanacity to make games - you just need to learn more - to learn more, do lots of small projects - things that only take a few days at most to complete
This idea of dumping the names down inside an array sounds good. BUT...
BigRoomsArray('boat', 'mgarden' ...)
randNumber = rand(390)+1
goto BigRoomsArray[randNum]
This array code does not even work in batch.
I just get back only a ton of 'is not recognized' errors.
NAVIGATION: I daisy chained all my screens up together to allow non-linear screen movement through them. Its only when the player dies, do I make the game pick out a screen at random to warp the player off into. but you do not move in this game in a a fixed linear fashion with heavily scripted invisible nanny boundaries all around the playing area (like MAss Effect 3 had to hold your hand all the time on so you could not even fall off and hurt yourself in that game and only when people are shooting at you or throwing things at you you take damage) but in this game, you move instead in a non-linear fashion so you CAN fall off ledges and stuff and indeed hurt your health, so you can go almost anywhere in the game into almost any area, but if you fall off something and die, well you gt randomly warped to a different area and you get to keep your current stats, so its an open world rpg turn-based game. But its the type of game that really needs a proper 3d engine to make it all come to life. And No nanny barriers to stop you from exploring or hurting yourself.....
Here's how I coded it.
:zordimension
rem WARPING defeated player to any location in the Game to start again.
set /a room=%random% %%390+1
if %room%==1 goto boat
if %room%==2 goto mgarden
if %room%==3 goto shadowland
if %room%==4 goto secretarea1
up to 390 rooms ect, ect,
I also set the game up so it picks out monsters out at random depending on your current difficulty level to warp the player off into as well, only put this in some screens areas...
The progression code I used.: The higher up the levels you go, the more stronger monsters appear. I didn't just code this so the same monsters keep increasing their HP each time you level up, no I had put in new enemy encounters into it as well.
So when you vist the same area again. Sometimes I also use also a Random Dice counter for the computer to put something in the area to make it show up after a certain number of visits. . So it dosen't just appear at a certain difficulty level,but appears depening on how many times that you enter the area. such as like putting a bonus health item, or treasure chest item. or a monster ambush, oect or maybe a secret warp gate to a hidden area..
Monster Progressions:
if %curlvl% EQU 2 goto forlighthouse - lighthouse screen shows 1 grizzly bear on it.
if %curlvl% EQU 10 goto forlightbear level 10 appears with 2 grizzly bears on it.
if %curlvl% EQU 20 goto forightrock level 20 shows a troll and a turtle.
if %curlvl% EQU 40 goto forlightroll two trolls appear at level 40
if %curlvl% EQU 50 goto fordragon - a dragon mini boss appears at level 50
The bottom line is that this game really needs a proper game engine for these kind ideas and concepts I have in mind for the game to all come to life, I didn't want the game to be all linear and heavily scripted but I can only do just so much with the windows console, because its not a game engine and I cannot build a proper game engine with it, for batch allowed me to view all the game environment when I move through the screens and test all the progressions and random stuff I have in it yes, but theres no walking, no scrolling, nobody is falling down in real time, there's no monsters chasing you all around the place, or detecting how far you are from them before thet start chasing you, so the game works, but is the static environment that lets it down just moving through a whole bunch of pretty pictures therefore forcing the game to be reduced all down to old school turn-based battles like the old final fantasy games..
Pages