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...
That was the iron fence I used yes.
Your explanations are very helpful. I don't yet know how many names I can dump into it. don't know what the limit an array can handle.
set /a spin=%random% %%5 (double percentages for the value).
then set the code as this
that was the missing piece I didn't know about.
Thank you Boogle.
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...
Pages