BucketMan:

mindepth = 1 maxdepth = 2

map.symbol{ symbol='u' feat=FEAT_ALTAR_THASAIDON info=6 monster=MONSTER_DEMONIC_MESSENGER
   flags = {
      MOVE_POST_DEST=function()
         -- or use a dialogue
         if quest(QUEST_GOAT_ROBBERS).status == QUEST_STATUS_TAKEN then
            message("You are too late! The poor goat has already been sacrificed.")
            change_quest_status(QUEST_GOAT_ROBBERS, QUEST_STATUS_COMPLETED)
         end
      end
   }
}

                [{QUEST_STATUS_COMPLETED,QUEST_STATUS_FINISHED}] =
                        { feat=FEAT_PERM_SOLID info=3 }

if player.get_sex() == "Female" then

player.inc_intrinsic(FLAG_SEARCH_POWER, amount_to_increase)

NerdanelVampire: I'm beginning to regret that I gave up on the quest, but somehow I guessed you would come up with the fix in no time at all... Still, I probably wouldn't have release 0.6.6 just yet if it hadn't been so late at night and my judgement so impaired. I'm going to go to sleep RIGHT NOW, this reply was my last thing to force through before sleep.

NerdanelVampire: The goat quest works! Thank you! :) I have even implemented live goats. Now I just have to figure out how to have creatures that don't want to murder the player...

BucketMan: Yay! Goat quest! :) Happy, cute little goats. :) They attack the player? This could be handled a couple ways. Let me give you the 'proper' way, and then the 'easy' way. For example, if you wanted to have a friendly animal faction, you could have something like:

factions.new("ANIMAL", "animals")
factions.set_friendliness(FACTION_ANIMAL, FACTION_PLAYER, 0)
factions.set_friendliness(FACTION_PLAYER, FACTION_ANIMAL, 0)

And then add the following flag to all monsters you wanted to be friendly:

FACTION=FACTION_ANIMAL

The problem is that faction handling is a bit finicky. If you're not careful you may end up with goats that act as pets, and fight for the player. It's also a bit tricky to store faction relations in such a way that they can be changed. Do you want members of the FACTION to always be friendly, or should they be able to defend themselves when attacked? Etc.

The easy way would be to simply remove all melee and spell attacks from the goats, and then give them an AI that doesn't chase the player. The only caution here is that some of the default AI's don't behave exactly as you might think. ai.NEVER_MOVE actually does move when adjacent to the player, to allow deathmolds to deliver their melee attack. But with a friendly monster sometimes this means that they'll never move until you're close, and then chase you. ai.RANDOM_MOVE has the same problem. They move randomly...until adjacent to the player, and then chase him.

Simple solution: copy ai.DBT_RANDOM and ai.DBT_NEVER_MOVE from Dragonball T.

NerdanelVampire: It doesn't work!!! I tried to do it the "proper" way, and all I got was some Enemy(neutral animals) goats that still wanted to murder me. But since I had also added camels while I was at it, I had more pressing issues to worry about. The camels kick really hard for a 0th level critter.

I'm going to have to try giving them the DBT_RANDOM AI...

I can't see anything wrong in my new preliminary factions.lua.

factions.new("NEUTRAL", "neutral animals") 
factions.new("HELL", "Hell")

factions.set_friendliness(FACTION_NEUTRAL, FACTION_DUNGEON, 0)
factions.set_friendliness(FACTION_NEUTRAL, FACTION_PLAYER, 0)
factions.set_friendliness(FACTION_NEUTRAL, FACTION_HELL, -10)

factions.set_friendliness(FACTION_PLAYER, FACTION_DUNGEON, -100)
factions.set_friendliness(FACTION_PLAYER, FACTION_NEUTRAL, 0)
factions.set_friendliness(FACTION_PLAYER, FACTION_HELL, -100)

factions.set_friendliness(FACTION_HELL, FACTION_DUNGEON, 0)
factions.set_friendliness(FACTION_HELL, FACTION_PLAYER, -100)
factions.set_friendliness(FACTION_HELL, FACTION_NEUTRAL, -10)

I know the file gets read and my goats get tagged as neutral animals, so where is the problem???

NerdanelVampire: The goats are still enemies, but with the DBT_RANDOM AI they don't attack very much anymore... Now that things are getting better I'm thinking of releasing a bugfix version pretty soon...

BucketMan: ai.DBT_RANDOM will prevent them from chasing the player, but if factions are not working properly they'll still 'attack' the player whenever randomness causes them to try to walk onto the square where the player is. Try removing all melee and spell attacks from their definitions:

   blows = {}
   spells = {}

It will still be 'incorrect' until the faction problem is resolved, but it should at least prevent them from killing players. If they're considered enemies though, this won't probably prevent the player from attacking them until they're no longer considered 'enemies' by the faction system.

NerdanelVampire: I tried changing friendliness to 1, but the first goat I saw was again an enemy. However, with their random movement goats, camels, sparrows, and chaffinches aren't much of a threat, and camels really are particularly powerful only on the scale of level 0 creatures, so I think I'll leave things as they are and hope that a future update to the T-Engine fixes things by itself.

I've been looking into adding pack-behavior for pack monsters, but it appears that LURE_INTO_CORRIDOR isn't implemented, and I appear to have fixed the new bugs that my fixes caused, so I think I'll release 0.6.7... let's say about now. "Release early, release often" goes the saying.

NerdanelVampire: Weird. The faction issue apparently fixed itself with a fresh, new savefile. I thought I had already tried that. This means that the goats in other people's 0.6.7 should be friendly from the start.

Modules/Zothiqband/BugReport3 (last edited 2007-11-09 12:26:16 by NerdanelVampire)