SFFP wrote:Hi I like this mod alot but I found a bug: Sometimes the hostile mobs are not hostile and just walk around
ElectricSolstice wrote:SFFP wrote:Hi I like this mod alot but I found a bug: Sometimes the hostile mobs are not hostile and just walk around
This happens to me a lot.
PilzAdam wrote:ElectricSolstice wrote:SFFP wrote:Hi I like this mod alot but I found a bug: Sometimes the hostile mobs are not hostile and just walk around
This happens to me a lot.
Does it happen in singleplayer or on servers?
--starting at line 224
if self.attack.dist then
--What is this section for?
if self.attack.dist < dist then
self.state = "attack"
self.attack.player = player
self.attack.dist = dist
end
--so if self.attack.dist >= dist then self.state is not changed
--end of section i'm asking about
else
self.state = "attack"
self.attack.player = player
self.attack.dist = dist
end
if dist < self.view_range then
self.state = "attack"
self.attack.player = player
self.attack.dist = dist
end
Neon wrote:I would say that some attack distance is set (self.attack.dist) by configuration of the specific mob, and then checked against the distance between the player and the mob itself. Thus some short-sighted mob won't attack until it blunders into the player, while some eagle-eyed mobs might nearly always attempt to attack the player.
PilzAdam wrote:The code simply checks if the player is closer to the mob than the player that is currently chased. That means the mob always attacks the closest player.
self.attack.dist is the distance to the player that is currently attacked.
ElectricSolstice wrote:PilzAdam wrote:The code simply checks if the player is closer to the mob than the player that is currently chased. That means the mob always attacks the closest player.
self.attack.dist is the distance to the player that is currently attacked.
Hmm, then shouldn't the code be reversed then? Currently, it reads as if self.attack.dist < dist. Wouldn't that translate as if the distance to the player i'm currently chasing is less then the next person's distance, chase the next person.

PilzAdam wrote:ElectricSolstice wrote:PilzAdam wrote:The code simply checks if the player is closer to the mob than the player that is currently chased. That means the mob always attacks the closest player.
self.attack.dist is the distance to the player that is currently attacked.
Hmm, then shouldn't the code be reversed then? Currently, it reads as if self.attack.dist < dist. Wouldn't that translate as if the distance to the player i'm currently chasing is less then the next person's distance, chase the next person.
Oh, that might be a bug.
ElectricSolstice wrote:PilzAdam wrote:ElectricSolstice wrote:
Hmm, then shouldn't the code be reversed then? Currently, it reads as if self.attack.dist < dist. Wouldn't that translate as if the distance to the player i'm currently chasing is less then the next person's distance, chase the next person.
Oh, that might be a bug.
Have you checked out my last commits? I think it fixes the bug and has it correctly using if dist < self.attack.dist
Also, the jump is now a function and put into the table like you wanted, but now the table has also been switched to be a metatable, allowing modders to use their own code for any of the functions in the table. For most of it, I can't see anyone wanting to, but never know if someone would want to make their own custom on_punch function to make the enemy blow up or change forms or something like that. It's also useful because any code you separate in the future for more customization (like say make a punch function to customize how a monster attacks) then you don't need to do that whole def.func or function () code end because all of the variables in the table definition can be changed now without any other changes.
ElectricSolstice wrote:Neon wrote:I would say that some attack distance is set (self.attack.dist) by configuration of the specific mob, and then checked against the distance between the player and the mob itself. Thus some short-sighted mob won't attack until it blunders into the player, while some eagle-eyed mobs might nearly always attempt to attack the player.
No, sight would be self.view_range. self.attack.dist is something else. I've figured it out now. It's the attack range (how long the arms of a monster that punches would be). Anything that runs up to you though looks like it has a range of 2 though. The self.attack.dist isn't customized by mob, at least not yet.
Anyways, I made a few changes to the mod. On mine, the monsters should now always follow... except for maybe monsters that no longer exist. There's some message in the command line about StaticObjectList or something like that for monsters that seem to be off on their own thing. However, I think it's an error on the part of the c++ code rather than the mod because that occurs for other things too. Anyways, besides that, I've also made it so you can configure which mods are spawned and also monsters that are trying to attack you will jump as they pursue.
Here's my current fork with the minor changes. Hope it gets pulled into PilzAdam's mod.
https://github.com/ElectricSolstice/mobs
If you find something wrong with it, feel free to respond to this post.
GingerHunter797 wrote:ElectricSolstice wrote:Neon wrote:I would say that some attack distance is set (self.attack.dist) by configuration of the specific mob, and then checked against the distance between the player and the mob itself. Thus some short-sighted mob won't attack until it blunders into the player, while some eagle-eyed mobs might nearly always attempt to attack the player.
No, sight would be self.view_range. self.attack.dist is something else. I've figured it out now. It's the attack range (how long the arms of a monster that punches would be). Anything that runs up to you though looks like it has a range of 2 though. The self.attack.dist isn't customized by mob, at least not yet.
Anyways, I made a few changes to the mod. On mine, the monsters should now always follow... except for maybe monsters that no longer exist. There's some message in the command line about StaticObjectList or something like that for monsters that seem to be off on their own thing. However, I think it's an error on the part of the c++ code rather than the mod because that occurs for other things too. Anyways, besides that, I've also made it so you can configure which mods are spawned and also monsters that are trying to attack you will jump as they pursue.
Here's my current fork with the minor changes. Hope it gets pulled into PilzAdam's mod.
https://github.com/ElectricSolstice/mobs
If you find something wrong with it, feel free to respond to this post.
So whats the difference between PlizAdam's mod and ElectricSolstice?
I have already changed how long it takes to kill them. So if thats all it does then Im not gonna use it.
The only thing I really would like to see is the spawn rate increased. I can go a whole night and only see a few monsters...
ElectricSolstice wrote:GingerHunter797 wrote:ElectricSolstice wrote:
No, sight would be self.view_range. self.attack.dist is something else. I've figured it out now. It's the attack range (how long the arms of a monster that punches would be). Anything that runs up to you though looks like it has a range of 2 though. The self.attack.dist isn't customized by mob, at least not yet.
Anyways, I made a few changes to the mod. On mine, the monsters should now always follow... except for maybe monsters that no longer exist. There's some message in the command line about StaticObjectList or something like that for monsters that seem to be off on their own thing. However, I think it's an error on the part of the c++ code rather than the mod because that occurs for other things too. Anyways, besides that, I've also made it so you can configure which mods are spawned and also monsters that are trying to attack you will jump as they pursue.
Here's my current fork with the minor changes. Hope it gets pulled into PilzAdam's mod.
https://github.com/ElectricSolstice/mobs
If you find something wrong with it, feel free to respond to this post.
So whats the difference between PlizAdam's mod and ElectricSolstice?
I have already changed how long it takes to kill them. So if thats all it does then Im not gonna use it.
The only thing I really would like to see is the spawn rate increased. I can go a whole night and only see a few monsters...
It fixes some bugs so monsters will jump when chasing you. Also, it gives you configuration options to change which monsters are allowed to spawn in the world. Just put mobs_monster_name_spawn = false to make it so that monster doesn't spawn.
brunob.santos wrote:Look at that texture that I did.
http://img841.imageshack.us/img841/1636/1a31.png
If you want to add to the mod. I can give you.
brunob.santos wrote:I think that currently, this mod still needs improvements in its functionality. Numerous entities are locked, it can not ever happen. Rats are really a pest, I'm not talking about filth, I'm talking about crowds fought.
ElectricSolstice wrote:Entities are locked? What do you mean by that?
brunob.santos wrote:ElectricSolstice wrote:Entities are locked? What do you mean by that?
remain paralyzed. not interact with anything.
Nightshade wrote:brunob.santos wrote:ElectricSolstice wrote:Entities are locked? What do you mean by that?
remain paralyzed. not interact with anything.
I have this same problem too. Hostile mobs still hang around in the daytime, but they don't attack, and you can't kill them. Rats too--sometimes I try to kill/collect them and I get an error that says something along the lines of "this object exists, but it technically does not exist"...
PilzAdam wrote:Nightshade wrote:brunob.santos wrote:remain paralyzed. not interact with anything.
I have this same problem too. Hostile mobs still hang around in the daytime, but they don't attack, and you can't kill them. Rats too--sometimes I try to kill/collect them and I get an error that says something along the lines of "this object exists, but it technically does not exist"...
AFAIK thats a bug in the engine, I cant do anything about it in the mod.
Users browsing this forum: No registered users and 18 guests