brunob.santos wrote:How do I cancel a mob? I want to remove the mob and desert rats.
mobs.spawning_mobs["mobs:sand_monster"]=false
mobs.spawning_mobs["mobs:rat"]=falsebrunob.santos wrote:I wrote these two lines in the file but nothing changed minetestYour 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
mobs.spawning_mobs["mobs:sand_monster"]=false
mobs.spawning_mobs["mobs:rat"]=false
if self.sounds and self.sounds.follow then
minetest.sound_play(self.sounds.follow, {object = self.object})
end
if self.follow ~= "" and not self.following then
for _,player in pairs(minetest.get_connected_players()) do
local s = self.object:getpos()
local p = player:getpos()
local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5
if self.view_range and dist < self.view_range then
self.following = player
end
end
end
ak399g wrote:"chance" means for every block/node the mob could spawn on, it has a 1/chance probability of doing so? would that be every second?
ak399g wrote:"chance" means for every block/node the mob could spawn on, it has a 1/chance probability of doing so? would that be every second?
ak399g wrote:"animation" is used for speeding up/slowing down walk cycles when the mob's speed changes (e.g. in pursuit of a player)?
ak399g wrote:I'm not entirely sure what "active_object_count" does.
ak399g wrote:a "max height" of 0 is at sea level?
ak399g wrote:why do most min_light values use -1 instead of 0 as total darkness?
ak399g wrote:I've got him saying "Welcome to the Himalayas!" (monsters inc) randomly, but I was wondering if it could be based off chance instead? because random has him saying it WAYYYYYY To often. Better yet, play it when the mob notices a player and begins pursuit.
Would that be as simple as addingYour 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 self.sounds and self.sounds.follow then
minetest.sound_play(self.sounds.follow, {object = self.object})
end
into the API underYour 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 self.follow ~= "" and not self.following then
for _,player in pairs(minetest.get_connected_players()) do
local s = self.object:getpos()
local p = player:getpos()
local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5
if self.view_range and dist < self.view_range then
self.following = player
end
end
end
and if so, where? if not, what else?
ak399g wrote:It'd be nice to add a sound mode for noticing you. E.g. a sheep baaing complacently when being led on by wheat, a cave monster growling at you.
PilzAdam wrote:Add it where "self.attack.player" is set.
if self.type == "monster" and minetest.setting_getbool("enable_damage") then
for _,player in pairs(minetest.get_connected_players()) do
local s = self.object:getpos()
local p = player:getpos()
local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5
if dist < self.view_range then
if self.attack.dist then
if self.attack.dist < dist then
self.state = "attack"
self.attack.player = player
self.attack.dist = dist
end
else
self.state = "attack"
self.attack.player = player
self.attack.dist = dist
-- ADDED LINES BEGIN
if self.sounds and self.sounds.follow then
minetest.sound_play(self.sounds.follow, {object = self.object})
end
-- ADDED LINES END
end
end
end
end
sounds = {
random = "mobs_snowman",
sounds = {
follow = "mobs_snowman",
ak399g wrote:When following me, they don't seem to want to jump when confronted with an obstacle. They will jump up hills and such when casually walking, but they don't in pursuit.
PilzAdam wrote:That will be fixed with a new engine feature in 0.4.8, then I disable jumping completly and the mobs can just walk 1 node high.
ak399g wrote:I take it that players will also be able to walk one node high?
PilzAdam wrote:ak399g wrote:I take it that players will also be able to walk one node high?
Of course not, that would be stupid.
ak399g wrote:PilzAdam wrote:ak399g wrote:I take it that players will also be able to walk one node high?
Of course not, that would be stupid.
Maybe I'm confused as to what you mean by "walk one node high." I think it means "when the mob encounters a node, it can step up onto it." Why shouldn't players function that way too? Unless that's not what you mean.
PilzAdam wrote:Its "stupid" to do that for players because we already have a nice moving system with jumping to get up nodes; Why change it if it works out well?
TenPlus1 wrote:Any chance of adding mob sounds so you know when something is about to attack, even a hurt sound when it does... Thanks, great mod btw...
Secret_Guy_3 wrote:Will there be more mobs?
ak399g wrote:TenPlus1 wrote:Any chance of adding mob sounds so you know when something is about to attack, even a hurt sound when it does... Thanks, great mod btw...
You can add your own sounds by dropping them in the sounds folder and editing the .lua file, allowing them to make noise randomly, or when attacking you. I've also been able to add a third instance that allows for sound upon them noticing you.Secret_Guy_3 wrote:Will there be more mobs?
You can copypaste a mob in the .lua, change the name, upload your own textures/sounds, change speed/damage/spawn locations/frequency, pretty much anything you'd need.
I'm on vacation now, but I could post tutorials after I get back.
Emgogall wrote:i know i sound like a noob but how do you download that?
Users browsing this forum: Bing [Bot] and 10 guests