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 / Seeking advice for a battle system (RPG)

Author
Message
EternalCaretaker
21
Years of Service
User Offline
Joined: 2nd Nov 2002
Location: United States
Posted: 28th Apr 2003 23:40
Alright, I have a lot of the mechanics worked out for a battle sequence I'm creating for an RPG, but I'd like to hear some advice on the following -- Say there are 4 heroes in the party and 3 enemies in the current battle. How should I set up the code so that the code knows Who's turn it is (so that it can copy all the data from that character/monster such as damage/defense).

Ex in pseudo-code:

Derek's turn
Get Derek's attack data
Derek picks Goblin as attack target
Get Goblin's defense data
Calculate damage and do everything else
Now it's Waren's turn
Get Waren's attack data
Derek picks Ogre as attack target
Get Ogre's defense data
etc....

How would I set up the variables so that the game knows who to take the data from? A temporary array perhaps suchas TempAtkData(x) = ??
(but where would I put the Who's Turn Is It function and how might I set it up?) Or perhaps have a two dimensional array where the first dimension is the character/enemy reference number and the second dimension is all of the stats and have a Who's Turn point to the first dimension?


Advice would be of most help
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 29th Apr 2003 02:33
It could actually be something as simple as an object position. Say when its a characters turn, you have a small arrow above their head. This could be a cone pointed down.

Now, you could store the data so your program would know what position of the cone is each character. So, you could just say that if the cone is positioned (here) then derek_turn=1 or if its positioned (here) then so_and_so=1 so then you could use those variables to load the right data from an array already made.

Hope that makes some sense.

Cheers

RPGamer

Current Project: Eternal Destiny
Tech Demo - Colan Island: Currently 716 Lines
Amadeus
21
Years of Service
User Offline
Joined: 20th Apr 2003
Location: United States
Posted: 29th Apr 2003 06:33
I agree with RPGamer. No point in making just the turn sequence so complicated when all the animations can do enough to that extent. Just start with something simple like displaying text for each element and then start coding in the 3d code once the text example works exactlly right, at least that's how I do it.

Life is a tale told by an idoit, full of sound and fury, signifying nothing. - MacBeth

Login to post a reply

Server time is: 2024-09-20 05:22:17
Your offset time is: 2024-09-20 05:22:17