ID:155931
 
I tried to avoid asking this at all costs but I'm afraid I have to due to the fact that I cannot find it anywhere in the dm guide or the resources. So how do I make it so that mobs attack you?
In response to Kaiochao
I found a quite a bit of resources but when I use them there giving me tons of errors. Can somebody show me how to do this and I'm looking for something simple. I was hoping they would attack you at a certain distance as well.
In response to Bigmnm
Have you tried looking at the code and reading what everything does and troubleshooting the errors? Resources aren't suppose to be copied and pasted into your source. You read them, understand them, and rewrite them to fit your game or design a new system off your new found understanding of DM.
In response to WickedlyAndy
Demo aren't meant to be copy and pasted.
You meant to learn what makes them tick, and reimpliment it in your own game.
In response to Flame Sage
I have looked all over and I can't find anything. The tutorials are not very good because even if they have what I need, they also have other code as well and I can't figure which is which. I tried the dm guide and I can't find where it talks about mobs attacking you.
In response to Bigmnm
Bigmnm wrote:
I have looked all over and I can't find anything.

I doubt you'd looked hard enough, then. Using the forum search before making a forum topic is fundamental, and this sort of thing has been answered many times.

The tutorials are not very good because even if they have what I need, they also have other code as well and I can't figure which is which.

...Tutorials are for teaching you things, not for giving you code. And needless to say, if you don't 'figure out' some random piece of code (in contrast to libraries which you don't have to fully understand) then you shouldn't use it. Messing with stuff before you understand it can be ultimately very bad.

I tried the dm guide and I can't find where it talks about mobs attacking you.

That's because it doesn't. It teaches how to use the language, not how to create an X game with Y feature. Once you know how to program, you can think about things programmatically and break them down to program functions which you can figure out how to pull off. For example: I want a mob to react to players and attack them. I need to either make it alerted by players moving within view of it or make it periodically look for any nearby players, and once it has spotted a player, to walk next to it and attack him once in range.
The programming specifics can be learned from resource such as the DM Reference and the DM Guide, where you'll find info on the movement system (i.e. how to move things or do stuff when things move), finding out what's in a mob's view, loops, etc. Obviously, you'd still be doing it very wrong and missing the point if you just look for relevant code to copy. Even if your project works initially, you'll very quickly run into problems if you don't understand programming. If you're having trouble learning or understanding, then feel free to ask on the forum every once in a while, of course.