The Daily Click ::. Forums ::. Klik Coding Help ::. turn base system
 

Post Reply  Post Oekaki 
 

Posted By Message

Tac0o0



Registered
  05/12/2008
Points
  195
22nd March, 2010 at 03:59:44 -

Hi guys, im trying to develop an rpg engine. now i have no idea where to start. ive looked at a few examples here but ive got nothing. ive been able to initiate a battle with random enemys to fight but when one enemy is destroyed how does the programming know who goes next. i just have no idea how to do this turn system so if anyone knows that would be awsome. heres a screeny

http://img638.imageshack.us/img638/1963/rpgh.png

 
check out my comics

www.tacoscorner.com

Xhunterko



Registered
  07/05/2003
Points
  1015

VIP MemberHas Donated, Thank You!Hasslevania 2!Pokemon Ball!
22nd March, 2010 at 05:28:39 -

Image

My old articles may be of some use:

Part 2:

http://www.create-games.com/article.asp?id=1437

Part 1:

http://www.create-games.com/article.asp?id=1402

Though they are written for 1.5. Often while writing the code, I found myself thinking, 'gosh I wish there was an or funtion'. Hope that's of some use. Nice looking btw.

 
All platforming problems can be mostly solved here:

http://www.clickteam.com/mbfiles2/277308-engine.zip
http://www.angelfire.com/games5/psywakd/platform.gam
www.zephni.com

These are very excellent examples by other people and are very informative.
Image

I work at the speed of "maybe".

Coming Soon: Diary Of An Indie Developer
http://www.youtube.com/watch?v=XaF6H9MrgH8

Twitter:
http://twitter.com/xhunterko

Tac0o0



Registered
  05/12/2008
Points
  195
22nd March, 2010 at 08:47:32 -

Thanks bro! looks good. ill take a deeper look in the morning.

 
check out my comics

www.tacoscorner.com

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
22nd March, 2010 at 09:00:22 -

Don't know where to start? Do what real programmers do, write some pseudocode first, then write the code. Most people try to write code in their head, which is easy when the code is easy, but when you make something bigger, you really have to sort things. It might seem boring to write pseudocode, but 20 mins writing it down saves you 2 months of headaches

Also, pseudocode really helps when you're trying to expand the code and add new features, so you know what to change and where you put it. Doesn't have to be formal or anything, just notes you understand.
Example..
1. Do Player's turn
2. Do Enemy's turn
3. Check HP of Enemy and HP of player
3.1. If both Enemy and Player have > 0 HP, go back to 1
3.2. If Enemy HP < 0, player wins..
3.3. If player HP < 0, player loses..
3.2.1. On win, player dances like a monkey
3.2.2. On win, player gets Random(1000) gold
3.2.3. On win, player gets candy
3.2.4. After they get the lewt, go back to the town map frame
3.4. If both HP < 0, the person with lowest HP loses

..and so on. If you still can't think of a way to do it, add more detail. Like, you could put a note for 3.2.3, e.g.
Comment: 3.2.3 player gets candy, when they win and don't already have a lot
Conditions: Counter("Win")==1, Counter("Candy") < 99
Actions: Add Random(3)+1 to Counter("Candy")

Obviously here, you're going to put a lot more detail in 1 and 2, so go write some separate stuff for them.

E.g.
On player's turn:
1. Is it player's turn to move?
1.1. Set Flag 0 on if it's their turn. Turn off later after player's turn.
2. Display options for player
2.1. If player has "Fireball", show "Fireball" button
2.2. If player knows Healing, show "Heal" button
3. Wait for input from player
4. Check if the input is legal
4.1. If player presses Fireball, but doesn't have enough Mana, go back to 2.
5. Calculate damage, etc
6. End player's turn, turn on enemy's turn
6.1. Turn off Flag 0



And then so on for the enemy's turn. If xhunterko's articles don't help you, be specific about which part you're having trouble with.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image
   

Post Reply



 



Advertisement

Worth A Click