[Mod] Simple Mobs [mobs]

OSRISKING
New member
 
Posts: 1
Joined: Fri Oct 11, 2013 21:39

by OSRISKING » Fri Oct 11, 2013 21:40

How do you shoot.
 

ElectricSolstice
Member
 
Posts: 90
Joined: Tue Aug 20, 2013 02:00

by ElectricSolstice » Sat Oct 12, 2013 00:51

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.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Oct 12, 2013 09:28

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?
Last edited by PilzAdam on Sat Oct 12, 2013 09:28, edited 1 time in total.
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Sat Oct 12, 2013 09:33

I've seen this happen on my server many times. They're still easily killed, they just don't always attack.
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Sat Oct 12, 2013 15:10

I see the "not always attacking" as a feature. Peaceful mobs roaming the world may stay. Hostile ones get disposed of. Unfortionately they don't learn.
A list of my mods can be found here.
 

ElectricSolstice
Member
 
Posts: 90
Joined: Tue Aug 20, 2013 02:00

by ElectricSolstice » Sun Oct 13, 2013 22:30

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?


Both
 

ElectricSolstice
Member
 
Posts: 90
Joined: Tue Aug 20, 2013 02:00

by ElectricSolstice » Sun Oct 13, 2013 23:24

I have a question about your api.lua file. What is the point of this code?


Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
--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


I think that section might have something to do with the weird behavior. Although, might be because I don't understand what self.attack.dist is supposed to be.
 

ElectricSolstice
Member
 
Posts: 90
Joined: Tue Aug 20, 2013 02:00

by ElectricSolstice » Mon Oct 14, 2013 00:10

Hmm, removing a few lines seems like it fixed it.

--starting at line 223 in api.lua
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if dist < self.view_range then
      self.state = "attack"
      self.attack.player = player
      self.attack.dist = dist
end


Is there any reason not to shorten those lines down to this?
Last edited by ElectricSolstice on Mon Oct 14, 2013 00:13, edited 1 time in total.
 

User avatar
Neon
Member
 
Posts: 119
Joined: Thu Aug 15, 2013 02:03
In-game: Neon

by Neon » Mon Oct 14, 2013 02:52

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.
 

ElectricSolstice
Member
 
Posts: 90
Joined: Tue Aug 20, 2013 02:00

by ElectricSolstice » Mon Oct 14, 2013 23:34

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.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Oct 15, 2013 10:45

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
Member
 
Posts: 90
Joined: Tue Aug 20, 2013 02:00

by ElectricSolstice » Tue Oct 15, 2013 12:59

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.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Wed Oct 16, 2013 14:14

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.
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Thu Oct 17, 2013 14:21

Look at that texture that I did.
Image
If you want to add to the mod. I can give you.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Thu Oct 17, 2013 20:01

how can I decrease the occurrence of sheep?
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

ElectricSolstice
Member
 
Posts: 90
Joined: Tue Aug 20, 2013 02:00

by ElectricSolstice » Fri Oct 18, 2013 00:48

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.


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.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Oct 19, 2013 13:25

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.

I currently dont have enough time to look at your pull request, but Ill take care of it ASAP. Sorry.
 

User avatar
GingerHunter797
Member
 
Posts: 144
Joined: Sun Oct 13, 2013 15:36
In-game: GingerHunter797

by GingerHunter797 » Sat Oct 19, 2013 14:35

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...
http://i.imgur.com/gqXXUaI.png

3DS Friend Code: 2122-7173-2797
Add me as a friend! :D

Want to play a fun game? http://voxelands.com/
 

ElectricSolstice
Member
 
Posts: 90
Joined: Tue Aug 20, 2013 02:00

by ElectricSolstice » Sun Oct 20, 2013 03:39

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...


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.
 

User avatar
GingerHunter797
Member
 
Posts: 144
Joined: Sun Oct 13, 2013 15:36
In-game: GingerHunter797

by GingerHunter797 » Mon Oct 21, 2013 20:33

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.


I like this version a lot better than the original. I acctually fear the mobs now becuase they chase. i think this addition should be added to the mod.
http://i.imgur.com/gqXXUaI.png

3DS Friend Code: 2122-7173-2797
Add me as a friend! :D

Want to play a fun game? http://voxelands.com/
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

by philipbenr » Tue Oct 22, 2013 01:15

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.


Very nice. Just add some more noise and It'll be great.
"The Foot is down!"
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Tue Oct 22, 2013 08:11

Animals I would love to see in mob mods, decreasing order:
I am terrible at modelling, so I will leave that to someone else.

Useful
We need more of these, because they are useful. Unique meats!
  • Chickens (eggs, chicken meat)
  • Cows (milk, steak, gelatin)
  • Ducks (duck meat)
  • Deer (venison, ivory)
  • Pheasants/birds (bird meat, eggs)

Hostile
Maybe more specific to biomes?
  • Wolfs - near trees
  • Abominable Snowman / yeti - snow biomes
  • Slender - better for a fork/other mod
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Wed Oct 23, 2013 00:38

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.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

ElectricSolstice
Member
 
Posts: 90
Joined: Tue Aug 20, 2013 02:00

by ElectricSolstice » Wed Oct 23, 2013 01:15

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.


Entities are locked? What do you mean by that?
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Wed Oct 23, 2013 01:40

ElectricSolstice wrote:Entities are locked? What do you mean by that?

remain paralyzed. not interact with anything.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

User avatar
Nightshade
Member
 
Posts: 25
Joined: Thu Oct 24, 2013 15:25

by Nightshade » Thu Oct 24, 2013 18:24

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"...
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Thu Oct 24, 2013 18:41

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"...

AFAIK thats a bug in the engine, I cant do anything about it in the mod.
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

by BrunoMine » Thu Oct 24, 2013 19:07

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.

I believe that all bugs for a mod, belong to his own creator. The guilt of his existence is a bug, however, is not obliged to fix.
All entities that become altomaticamente stops should be excluded.
I must say here that you're a great creator of mods.

[spoiler=Ideas]Ideas. I believe it is already time to do this mod to work best, it is impossible to raise livestock when I need to be constantly cleaning.
A good idea would be to create a node that ensure the cattle.
example, "a house for the sheep." when this sheep is cleaned the server, you can spawn node (home) where it was saved.[/spoiler]
Last edited by BrunoMine on Thu Oct 24, 2013 19:09, edited 1 time in total.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com
 

davidforsure!!!
Member
 
Posts: 72
Joined: Fri Oct 25, 2013 09:02

by davidforsure!!! » Fri Oct 25, 2013 09:03

hi am first time here
 

davidforsure!!!
Member
 
Posts: 72
Joined: Fri Oct 25, 2013 09:02

by davidforsure!!! » Fri Oct 25, 2013 09:03

my winrar crashed oh no
 

PreviousNext

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 14 guests

cron