[Help] Hellmouth Mob Spawn

04/10/2011 18:21 chickmagnet#16
Quote:
Originally Posted by alexalx View Post
Added you.

Are you online on msn?
ye iam
04/10/2011 18:22 F i n c h i#17
Add me on msn, It doesn't work.
04/10/2011 18:25 F i n c h i#18
Quote:
Originally Posted by chickmagnet View Post
ye iam
Accept my invitation.
04/11/2011 00:00 F i n c h i#19
Alright,I can't figure out why it doesn't work.

Sorry for spam :S
04/11/2011 02:46 taylor2846#20
hay this is not relly on topic but it kinda is lmao,

i got mobs spawning,
now where would i start coding the movement codes.
and the attacking codes.


just need to no where to start.
04/11/2011 03:15 pro4never#21
Make a new server thread and then perform some simple AI calculations on your spawn.


For example...


while(running)
{
foreach(Spawn spawn in Dictionary.Spawns.Values);//make sure you are adding to this db when loading a new spawn from db or command
{
//optional check to see if the map the spawn is on has active players (if not do not perform ai checks... no players to see it!
foreach(Mob monster in spawn.Members.Values);//select each mob inside the spawn!)
{

//check if mob is alive: If so perform these other things, if not check if valid time for re spawn, if so re spawn it somewhere inside the spawn (pull new random coords, etc)

//Check for players near monster

//Check distance to player: if < attack range && last attack was at least attack speed ago, try attack (you need to code a monster>player attack calculation as well)


//Else, calculate direction monster needs to walk to move towards player (if last walk > walk speed ago)

//Walk in that direction (send walk packet, update the map so mob moves in the map objects)
}
}

}


That would be a POOR system to use but it gives you some general concept of how you'd go about it.

Personally I'd do a foreach player in server, then check for spawns within say... 2 screens of them and then perform AI checks only on those spawns (saves you cpu time because you only operate on spawns with players near'ish to them)

I'd also add in all sorts of other helper methods and checks to make sure say a monster doesn't wander too far away from the spawn and such... but you get the idea.
04/11/2011 17:56 F i n c h i#22
So,the mobs won't spawn cause the map is nulled?
Or whats wrong in those breakpoints?

CLICK THE BAR TO SEE THE FULL IMAGE!
[Only registered and activated users can see links. Click Here To Register...]
04/11/2011 18:20 pro4never#23
Yes, make sure M.Map is assigned to and that Map is assigned to.

Seems right now it's using _map instead of Map which is wrong.

Just fix it.
04/11/2011 18:28 F i n c h i#24
Quote:
Originally Posted by pro4never View Post
Yes, make sure M.Map is assigned to and that Map is assigned to.

Seems right now it's using _map instead of Map which is wrong.

Just fix it.
Quote:
Originally Posted by chickmagnet View Post
can u plz hint me a lil 2 how i can fix this coz i messed wit all the lines the console said and yet i still get same error

[Only registered and activated users can see links. Click Here To Register...]
I have the same problem as this user.

Look at picture.
04/11/2011 21:23 pro4never#25
Simply make sure the maps are assigned to before calculating this shit...

god... no wonder almost no one wrote the 10 lines of code needed to do this before and just waited for something to be released.
04/11/2011 21:36 F i n c h i#26
Quote:
Originally Posted by pro4never View Post
Simply make sure the maps are assigned to before calculating this shit...

god... no wonder almost no one wrote the 10 lines of code needed to do this before and just waited for something to be released.
Lol,sometimes it works,It spawns the monsters / guards in twin city , sometimes not.
And btw,monsters aren't moving =(
04/12/2011 00:47 pro4never#27
jesus christ... you people REALLY need to learn to read.

The twin city stuff works because the map is already initialized (there are players/npcs/etc loaded onto it so the map has been created)

They don't move because this is ONLY RELATED TO SPAWNING.

You have to code monster AI, movement, attacking, death, re spawning still.

I'm sorry but if you guys can't figure this out from the 50+ posts I've made on the subject then you have no reason using a computer let alone trying to code a source.
04/12/2011 00:52 F i n c h i#28
Quote:
Originally Posted by pro4never View Post
jesus christ... you people REALLY need to learn to read.

The twin city stuff works because the map is already initialized (there are players/npcs/etc loaded onto it so the map has been created)

They don't move because this is ONLY RELATED TO SPAWNING.

You have to code monster AI, movement, attacking, death, re spawning still.

I'm sorry but if you guys can't figure this out from the 50+ posts I've made on the subject then you have no reason using a computer let alone trying to code a source.
Alright,I understand now,Thanks!
04/12/2011 01:28 taylor2846#29
when a mob dies how would i remove the mod from the map to wait for it to respawn?
04/12/2011 01:43 pro4never#30
It's all up to you. You could always just flag it as dead and when spawning just ensure that what is being pulled is alive.

Saves adding/removing all the time but again... it's all up to you (you're going to be adding/removing with this system anyways due to the way the location info works... which sucks but w/e)

So yah, I'd remove. Doesn't really make any diff.