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.

DarkBASIC Discussion / RPG Random Battle Timer Help

Author
Message
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 20th Dec 2002 03:58
Well- Ill try to explain this the best I can. As most of you know, we [halbros productions] are making a 3d RPG called Eternal Destiny. I have come to that point in time where I really need to get along to coding the random battles. If you have played FF you know what I mean. Now here is what I need to do:

I am hoping I can get a random number generated between like 9 and 15, and use that number as second in a timer. Then, when you press a movement key, the timer starts. If there is no movement key being pressed then the timer is stopped.

Then, if the timer
Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 20th Dec 2002 03:58
S**T!! My typing got cut off! Here it is........

Well- Ill try to explain this the best I can. As most of you know, we [halbros productions] are making a 3d RPG called Eternal Destiny. I have come to that point in time where I really need to get along to coding the random battles. If you have played FF you know what I mean. Now here is what I need to do:

I am hoping I can get a random number generated between like 9 and 15, and use that number as second in a timer. Then, when you press a movement key, the timer starts. If there is no movement key being pressed then the timer is stopped.

Then, if the timer <1 then goto battle.

Thats my plan. I am thinking I can generate a random number, then save that as like battleseconds# Then I want to start the timer at battleseconds#

If a movement key (up, down, left, right) is pressed, then start the timer countdown from battleseconds# to zero (or if its easier then zero to battleseconds#) and if there is no key being pressed then stop the timer.

Can someone help me out with this? I am pretty sure I got the idea down right, I just need some help with the way to code it. I was having the big problems with starting and stopping the timer.

Well, I did the best of explaining my problem, my plan, and what I need help with. Just to make helping easier. I always see posts with no detail, so I tried to help you guys out .

If anyone can help, you would be credited.

Thanks a million,

RPGamer
Halbros Productions

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
cyrano
21
Years of Service
User Offline
Joined: 7th Dec 2002
Location:
Posted: 20th Dec 2002 07:34
Well, the code is not perfect but it is late and I'm tired, but you should be able to tweak this and have a pretty functional timer. Pressing the upkey activates the timer.



John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 20th Dec 2002 13:38
Hey thanks a mill- Ill try that out when I get home from school (wo hoooo last day till vacation!) cuz this comp doenst have Db.

Thanks!

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
cyrano
21
Years of Service
User Offline
Joined: 7th Dec 2002
Location:
Posted: 20th Dec 2002 20:41
Hey, I coded an excellent timer that will work for most games out there. This code tracks seconds no matter how quick the player presses and releases the action keys.

Here is the code:




This is far better than the one I coded last night (tired) hope it works well for you. You can obviously make it tighter if you like or whatever, adapt to your needs. I'll put this in the code snippet forum too.

John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 21st Dec 2002 03:08
Thanks a million! That code works great! Thanks so much! How would you like to be credited?

Random Battle Time Generator
Your name here

??

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
cyrano
21
Years of Service
User Offline
Joined: 7th Dec 2002
Location:
Posted: 21st Dec 2002 04:49
Your welcome, glad to help when I can. I know how hard it can be sometimes when programming. Thanks for the credit offer, you can use my forum name Cyrano if you like. My real satisfaction is just being able to help out a fellow programmer.

John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 21st Dec 2002 05:05


RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
Ryeguy457
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location:
Posted: 28th Dec 2002 01:48
Well, you're doing it weird. Why don't you just create a step counter, and when it reaches 0, have a battle? That's what most people do.

However, Final Fantasy does it like so: The game keeps a counter that increases each time you take a step. Each step
a random number is picked from 0 to 255, if this number is less than
(counter / 256 ) then a fight occurs. When a random encounter occurs the
counter is reset to 0. If the lead party member has a Charm Bangle equipped,
then the number added is cut in half.

http://db.gamefaqs.com/console/snes/file/final_fantasy_iii_algorithms.txt

Go there. It's an FAQ explaining algorithms FF3 used. It might be useful.

PS You stole my RPG's name!

John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 28th Dec 2002 04:41
I didnt steal anything. I remember you posting that I had already started when you came up with the idea for the name and quote "It sounded bad so I changed it"

Dont go accusing me of stealing when you even said that when I had started, you thought of the same name and thought it sounded dumb.

This works fine. I have the whole thing sorted out. Its working perfect.

I am NOT changing the games name, the whole story is sorted out.

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
ChronicFear
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 28th Dec 2002 05:37


Can someone tell me why that code wouldnt work?

Your suffering cause of me its divine
-Korn-
Hell Forged Angel
21
Years of Service
User Offline
Joined: 3rd Jan 2003
Location: United Kingdom
Posted: 3rd Jan 2003 18:23
in the first line your varible is called btINcount# but in all the other lines its called btcountER# if this isnt purposeful then its probably your problem

Darkness will claim us all
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 3rd Jan 2003 22:48
I got it all working guys

Current - RPG: Eternal Destiny : Help Wanted!
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!

Login to post a reply

Server time is: 2024-04-16 14:41:48
Your offset time is: 2024-04-16 14:41:48