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 / RPG Questions

Author
Message
Crazy Programmer
AGK Developer
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Lost in AGK
Posted: 26th Oct 2006 03:12 Edited at: 26th Oct 2006 03:22
Ok iv been programming in DBP for along time and i am wanting to start an rpg the right way. I have some questions and will have alot of questions on what to do and how to do along the time of completion. I have started the basic rpg. Here is a screen shot.

People say its a start but i disagree what you see is really whats there i need to make a fighting engine for it but have no idea how i saw Riddi's fighting engine and liked the way he changed the wepons and the distance of the objects but didnt really get the concept of it...i would like it all explained to me. right now just to test the exp and damage done i just did some simple collision.

yes dont laugh at me lol...how is a good fighting engine made? are there secrets or is it just done with OOP...I will start one programming a fighting engine and i will post the code here and hope yall will help me in any way posible.

I also need to learn Ai here is how i move my cows and it looks really weird.

Again dont laugh at me...How do you get distance from objects that are simulated like this in Next a?

So please guys help me as much as posible i hope others can learn from this too!


RadiusOFT
19
Years of Service
User Offline
Joined: 14th Jul 2005
Location: Aloha, OR(egon)
Posted: 26th Oct 2006 07:04 Edited at: 26th Oct 2006 07:06
you can do pythags theorum to get the distance between two objects... im sure there are better ways though. heres an example i made up



[edit] in order to use "dist" outside of the function, just make it a global. ie "Global Dist as Integer"

Hope this helps, by the way, for all you vetran coders, if i scrwed this up at all please let me know, so i can revise. But it should work, I tested it.

jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 26th Oct 2006 07:11
how is a good fighting engine made? One cow at a time.

I think that you have arrived at the end of the road when it comes to strictly procedural programming. Now, you need to program in an object-oriented, event-driven manner.

The best advice I can think of, I have already said alot today...create UDTs that represent your world, and have your game loop "deal" with them in a logical manner, using state machines. That is all any game is...a state machine with assets.

I find it amusing that you find your self-discovery so amusing...surprise, you are already making the steps. Killing cows is a great way to gain programming XP, too.
Dracula
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: DBP Recreation of Castle Csejthe
Posted: 26th Oct 2006 15:39
I am not at home, but off the top of my head:

Calculate the distance of your mob and check for attack key, and if within rage call a Function for attak. The function would include some random chance for hitting +/- bonuses or deficits, and then a bunch of conditionals for the amount of damage, flags for timing the speed at which both the player and mob can attack, then end the function back to main loop to await the flags resetting so they can do it again. Also in your function check HP of both and possible death. Use array variables, since you can only pass one var in a function. I will be writing one at some point for my RPG, if you are still in need at that point, I'll share it.

If anyone disagrees with my logic, please say so as I am not the best programmer...

Happy Halloween and Happy Programming!!!

D

Login to post a reply

Server time is: 2024-11-27 03:50:14
Your offset time is: 2024-11-27 03:50:14