Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / text game help

Author
Message
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 10th Jun 2008 00:00 Edited at: 10th Jun 2008 01:17
hey i need some small help
im making a game where your a leader of a Keltoi (celtic)
tribe and ur fighting agaisnt the odds
its a text based game but i got a problem

ive read alot of thread but it doesnt help.

i made a bit and it says


im not sure how to make the person how to type
i got the idea though
If "give up" than end
If "attack" than goto attack1
If "defend" than goto defend1
If "retreat" then goto retreat1
If "get intell" then goto intell1

and stuff like that
but im not sure how to put it together


the player types Attack for example, but how do i make him able to do attack?!
FIXED BY FINDING


Creators of Outscape
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 10th Jun 2008 00:09
also i heard somewhere you dont do
like
if akey is pressed
its like
if (then the key number for a)key is pressed
how do i know this key number???!!!

Creators of Outscape
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 10th Jun 2008 01:14
also can i do this:

say if the player does a fight with 300 troops and the battle is randomated can i make it that it is randomated between somany troops he looses and that number gets saved so i can use it in the next fight
eg he has 200 troops left
so or the next fight he has 200 instead of 300

Creators of Outscape
Destrugter 1
18
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 10th Jun 2008 01:43 Edited at: 10th Jun 2008 03:19
For getting the user input and handling it...you would do something like this.



There is one slight problem...using that, they have to put exactly "Attack" it can't be "attack" all the caps have to be right.

There may be a way to capitalize the lefthand letter of the word, i will try to figure it out and post the answer when i find it...unless in the meantime someone else knows, then feel free to post it.

Edit:
Ok, here is a horrible (but will still work) example of how to do as I explained above.
put this code and change it to your needs wherever you want it to happen.


Edit2:To find the scancode(key number) for a key, use the following code.



you wouldnt do



You would do



Your number gets saved using variables...here is a link to tdk's tutorials on darkbasic pro...read them and you will learn a ton. I refer back to his tutorials a ton still.

http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 10th Jun 2008 18:31
ok that fixes it but 1 more problem
the person starts with 300 troops (for example)
i want to make it that:
in a fight it says how many troops you loose
i want to do it so
the player looses between 2 numbers of troops (eg 100 and 120)
i choose these numbers, then the pc randomates a number imbetween that.

and then those numbers are saved and in the next fight they will have 190 troops (for example), but i dont write the 190 the pc auto puts it there (if u get me).

and if the number =0 then you loose
(something like) if (somthing)=0 then gosub loose

loose:
print "you lost bye bye"
wait 3000
end

Creators of Outscape
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 10th Jun 2008 19:18 Edited at: 10th Jun 2008 19:28
is it somthing like:


in that "(WHAT DO I DO HERES =) )"
i want to do soemthing like
make the pc randomate a number beteen 100-120 to make the number decrease by

Creators of Outscape
Destrugter 1
18
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 10th Jun 2008 19:47 Edited at: 10th Jun 2008 19:47
Windows killer is right. it would look like



Thanks windows killer, you continue to amaze me with your dedication to helping newcomers

do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 10th Jun 2008 20:04 Edited at: 10th Jun 2008 20:17
IT WORKS
thats guys so much
ok theres one last problem,
i want to make it that if your troops = 0 than you loose

like that
but thats not randomated, how do i do it if it hits below 0 it ends aswell
fixed it =D


Creators of Outscape
Destrugter 1
18
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 10th Jun 2008 20:37
That is what being a true programmer is all about, figuring out problems by using simple logic. In fact all programming is, is math and logic. Im not saying I figure out all my stuff on my own, or that everyone should, because that would be incredibly hard for one to memorize every command of a programming language, know what it does, when to use it, when to not use it, every way possible to use it. If you have any more problems in the future, remember this is one of the best communities to ask programming questions.

do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 10th Jun 2008 21:14
thankyou

Creators of Outscape
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 11th Jun 2008 19:17
urm, ive tested this all out and it works realy nice!

but if there a way i can make the game tell me how man troops are lost
because its randomated i cant do
Print "etc"
how do i put it so it says how many troops die

Creators of Outscape
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 12th Jun 2008 05:27 Edited at: 12th Jun 2008 05:28
Quote: "
but if there a way i can make the game tell me how man troops are lost
because its randomated i cant do
Print "etc"
how do i put it so it says how many troops die
"


Put it in a variable and then print it. For example, you might do this (it's only an example):



procyon
16
Years of Service
User Offline
Joined: 29th Feb 2008
Location:
Posted: 12th Jun 2008 09:37
Why do you lose about the same amount of troops in every battle?

Wouldn't it be worth setting up an enemy strength array and telling the player an approximate value when you encounter an enemy. "The enemy look to have a bigger army than ours, possibly 500 men." A simple test of the two variables could be done to give an appropriate description.

You don't even need the array if you want to be random about everything. It would be easy to program and your game would be much more enjoyable if you stood a chance of winning without losing your entire army in three battles.

If you have 300 troops and get into a fight with 10 enemies, they would have to be pretty lousy troops to lose 100-120. You could travel to villages and recruit extra men. Little things like that would make your game better.
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 12th Jun 2008 23:20
ok the game isnt that great atm but i can show u if u want?
what happens is:
a player is attacked and he can choose what he wants to do in the battle
each choice he makes changes his outcome
at the end of a fight he can get more troops by getting new weapons from the enemy to gear up his men

@procyon
im making that recruiting idea atm actually and was one of its main features

im going to when i have time, make sprites of maps and u have to conquer the map
and when u click on a section of the map you attack it

@Sixty Squares
thankyou!!!!!!!!!!!!!!!!!!!!!

-atm my game is just one battle -

do this for the main features

-intel-attack-circle-fire(or wait)
-intel-defend-walls

Creators of Outscape

Attachments

Login to view attachments
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 12th Jun 2008 23:21
im going to make it that every several turns the player will be attacked

Creators of Outscape
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 12th Jun 2008 23:23 Edited at: 12th Jun 2008 23:25
oh and in each battle the foe will have different types of armies and the player will have different/more types of troops
so it all gets bigger and more complexed
Quote: "Wouldn't it be worth setting up an enemy strength array and telling the player an approximate value when you encounter an enemy. "The enemy look to have a bigger army than ours, possibly 500 men." A simple test of the two variables could be done to give an appropriate description."


do you mean i should give a fixed number of losses depending on the choise to make it easier?

Creators of Outscape
procyon
16
Years of Service
User Offline
Joined: 29th Feb 2008
Location:
Posted: 13th Jun 2008 14:22
No, i meant you could store each armies strength in numbers in an array. If you're going to have a map and different armies on this map, then you will need to store a bit of basic information about them to make the game more playable. You could store the variables in a record structure.



You could store more information than i have put in the record structure. That's just a basic start to work with.
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 21st Jun 2008 12:42
sorry didnt realise this was posted back to.
is there a tutorial somewhere on arrays cos i dunno what they are

Creators of Outscape

Login to post a reply

Server time is: 2024-11-25 01:41:12
Your offset time is: 2024-11-25 01:41:12