ID:176766
 
I am making a game and i really need a attack system.
I checked out all the demo's and libraries but i can't get any of them working.

This is the ID:
The player and the monsters have all differend stats.
- Strenght
- Defence

I want to make hostile mobs (that attack you when in oview(4) and mobs that only attack when you attack them.

The ammound of damage sould depend of the strenght of the player and the defence of the monster.
When the monsters attacks this is the other way around.

The monsters must drop differend items and give differend amounts of experience.

When the monster die's he must spawn after a random amount of time. When they are not attacking the have to move random.

I hope you get the ID and I know it's verry hard to make a working system.

If you want to help me out plz mail me : [email protected]

I can't pay any dimes but i will include you name in the game.

Greetz Marcel
Fint wrote:
I am making a game and i really need a attack system.
I checked out all the demo's and libraries but i can't get any of them working.

Well, what I have to say might be a bit disappointing, but hopefully it will help. A demo may help show the basics of a battle system, but ultimately how you implement this is going to depend a lot on the details of your game and what kind of specific system you want.

This is the ID:
The player and the monsters have all differend stats.
- Strenght
- Defence

I want to make hostile mobs (that attack you when in oview(4) and mobs that only attack when you attack them.

So I take it this is not a random-encounter battle system, but has pre-arranged enemies.

Basically what you need to do is set up some kind of AI loop that controls these mobs, making them move about and look for players to attack, etc. The loop should really only be activated when the player is within a certain distance (like 50-100 tiles or so), so it's not running for every mob in the world at once. You can set vars to control nuances of the behavior, like the pattern in which the character moves or whether it automatically attacks players in a certain range, etc.

The ammound of damage sould depend of the strenght of the player and the defence of the monster.
When the monsters attacks this is the other way around.

Some people are going to show you a way to do this using two procs: something like Attack() and MonsterAttack(). Ignore these people.
What you need instead is a generic attack proc like this:
mob
proc/Attack(mob/target) // src is the attacker
// calculate damage
// do damage
// delay further movement for a short time
And that proc should be called for the monster when attacking players, and for the player when attacking monsters.

The monsters must drop differend items and give differend amounts of experience.

This is best left to vars. If all mobs have an exp var for experience, monsters can use this to hold the amount of experience gained for killing them.

As for items to drop, lists can help there, but I'd actually recommend holding off on this part until the rest of the battle system is in place. In the meantime, if you really want the monster to drop something, put in this quick snippet:
mob/monster
var/dropitem // a type like /obj/potion/healing

Die(mob/killedby) // override /mob/proc/Die() which you must define
... // do other things here, whatever else is necessary
if(dropitem && prob(50)) new dropitem(loc)
del(src)
That's a limited system that only supports one type of item drop; you'll need lists to get really fancy with this, which is why I think it's best to wait till everything else runs smoothly.

When the monster die's he must spawn after a random amount of time. When they are not attacking the have to move random.

There are lots of ways to handle respawning, but this is best left till later too. As for movement, the above bit about the AI loop should deal with that.

I hope you get the ID and I know it's verry hard to make a working system.

Er... do you mean "idea", not "ID"? ID means something else entirely.

If you want to help me out plz mail me : [email protected]

I can't pay any dimes but i will include you name in the game.

I'm afraid I have more bad news for you: This is something of a complexity beyond what a volunteer can do for you. You'll have to set up most of this battle system yourself. I'm sure we can help a little on that, offering advice on how to set up particular procs in your battle system, but because of the way these things integrate into the game you won't be able to have someone else do the whole thing (or even some of it).

Lummox JR
In response to Lummox JR
Thank you very much Lummox JR
This info you gave me will help a lot i think.
Ill start right away.

Greetz Marcel (Fint)
In response to Fint
Fint wrote:
Thank you very much Lummox JR
This info you gave me will help a lot i think.
Ill start right away.

Good luck with it.

The most important thing you should remember is that a battle system is huge, and it's the key component to your game. If you seem to make slow progress at first, that's normal; things like the AI loop, the Attack() proc I mentioned, and so on could take upwards of a few weeks, especially if you're not experienced. Just keep working at them and don't hesitate to come to the forums for help if you get stuck.

I think you'll also find forum searches to be very helpful to you. If you look up terms like "monster ai" or "monster attack oview" you may find some very valuable pieces of code--which may or may not work, but can help you get unstuck.

Lummox JR
In response to Lummox JR
If you have AOL Instant Messenger, you can drop me a line (My screen name is Zboyy), and I'll gladly help debug it a little bit.


(Zane Brooks / Hanns) --- Just thought I'd try that out..see how it looks. :P
In response to Hanns
I dunno what that instant messager is (i am from holland) but i think its something like MSN.

If you also have MSN can you add me then?
(e-mail adres: [email protected])

Or maybe you can send me you e-mail adres so i can mail you some questions.

Greetz Marcel