Jump to content
DarkMatters Celebrates
18 Years of Christmas in Ancaria

From the Sacred 2 Christmas Island Soundtrack
Click to Open Player!

Llama8

Understanding what Creatures.txt file does

Recommended Posts

DB suggested a very cool idea for my mod which involves Creatures.txt & I just wanted to make sure I understand the file & what it's doing & where, etc & thought that we should probably share the knowledge with everyone else. I've put my comments in bold. Anyone elses comments/thoughts are welcome.

 

mgr.createCreature {
id = 1994,  [b]Creature ID, referenced to in Spells.txt for summoning/shifting spells.[/b]
itemtype_id = 12773, [b]Reference to itemtype.txt[/b]
name = "spell_dm_dragon_shapeshift", [b]Creature name, don't think it does anything per se[/b]
behaviour = "Invalid", [b]Which AI the creature uses if it's not player controlled (ie, an NPC)[/b]
dangerclass = 7, [b]Affects item drop classes & probably other stuff[/b]
groupmaxcount = 1, [b]max number of monsters in a group[/b]
elite_creature_id = 1994, 
probabilityforelite = 0.000000,
rank = 0,
tenergy_creature_id = 1994, 
livesremaining = 0, [b]How many times will it rise up after you kill it (only for undead)[/b]
unconscioustime = 20,
palettebits = "1111111111111111",
monstertype = 0, [b]0 = normal, 1 = champion, 2 = boss[/b]
faction_id = 1,
modelscale = 0.200000, [b]scalling applied to creature's model, <1 gives a smaller in-game appearance, >1 gives a larger in-game appearance[/b]
rise_from_ground = 0,
has_corpse = 1, [b]Does it create a corpse when it dies (undead have this as 0)[/b]
has_soul = 1, [b]Does it create a soul when it does (which can be "sucked up" by Soul Reaper)[/b]
can_strafe = 0,
spells = { [b]CAs that a creature can cast, per Spells.txt[/b]
	entry0 = { "enemy_area_weaken" },
},

}

 

What I'm not quite sure of is how to add spells & skills to a player character (ie, the two Dragon Mage forms). I assume that the section later on in the file is where you add skills, but I'm not sure which file the "bonus = " is referring to (though I have a suspicion that the answer is "later in the file" & only a few of the bonus ids are explicitly stated what they do, such as bonus = 256 is attack & bonus 258 is defence):

 

mgr.addCreatureBonus( 1994, {
intensity = 300,
bonus = 256,
})

mgr.addCreatureBonus( 1994, {
intensity = 1000,
bonus = 258,
})

 

Having had a further look down the file (after the bit with the player skills in it, I got to these entries:

mgr.addCreatureSkill( 1994, {
skill_id = 3,
advanced = 0,
skill_name = "skill_armor_lore",
})
mgr.addCreatureSkill( 1994, {
skill_id = 13,
advanced = 0,
skill_name = "skill_constitution",
})
mgr.addCreatureSkill( 1994, {
skill_id = 19,
advanced = 1,
skill_name = "skill_ancient_magic_lore",
})
mgr.addCreatureSkill( 1994, {
skill_id = 24,
advanced = 0,
skill_name = "skill_alchemist",
})
mgr.addCreatureSkill( 1994, {
skill_id = 27,
advanced = 0,
skill_name = "skill_perception",
})
mgr.addCreatureSkill( 1994, {
skill_id = 0,
advanced = 0,
skill_name = "skill_DM_dragonmagic_focus",
})
mgr.addCreatureSkill( 1994, {
skill_id = 0,
advanced = 0,
skill_name = "skill_DM_dragonmagic_lore",
})
mgr.addCreatureSkill( 1994, {
skill_id = 9,
advanced = 1,
skill_name = "skill_tactics_lore",
})

So I assume that that's where/how you add a skill to a creature/form (and possibly make it Mastered by changing the advanced = flag).

 

Then there's a section with:

mgr.addCreatureBpRelation {
creature_id = xxxx,
blueprint_id = yyyy,
}

where x & y are numbers and

 

mgr.addMapPos {
merchantType = 2,
   position = { 25,32,0 , 2708.030,578.617,-11.425, 208.000 },
}

Which would be how it spanws merchants. Interestingly there seems to be two forms for this:

mgr.addMapPos {
merchantType = 2,
   position = {
     x = 123550.00,
     y = 64500.00,
     z = 0.00,
     layer = 0,
     orientation = 0.000,
   },
}

Link to post

If you modify:

 

monstertype = 0 ---> normal

monstertype = 1 ---> Champion

monstertype = 2 ---> Boss

 

I read this in the ancient post of darkmatters :thumbsup:

 

Link to post

groupmaxcount = 1 ---> how many mobs to be in group ( if you put 8 this will be 8 in this group how is the cobolt )

 

modelscale = 0.200000 ---> this is the height of the mobs

 

and this I read in ancient post of darkmatters and sorry for double post :thumbsup: and I hope I was helpful :thumbsup:

 

 

 

Link to post

I wonder if Sacred 2 scales monsters using that modelscale line. So if you took the line for a Kobold & increased that value, would you have giant Kobolds? Or would it "just" change the physics of the creature (so it can't walk through doors if the modelscale value is toobig) without changing the graphics?

Link to post

The line modelscale = ______ scales the model file and so you can have larger (or smaller) creatures like the kobold.

 

The itemtypeid tells the game which model to use for the creature.

 

mgr.addCreatureBonus does as you suggested, adds from I assume all possiblie item modifiers although the only commented ones I could find gives the following list of numbers and their bonus:

26 = experience
256 = AW
258 = VW
45 = fire armour
28 = phys armour
21 = npc dex
22 = npc int
23 = npc stam
20 = npc stre
24 = vit npc
25 = npc will
27 = phys dam
262 = attack speed
55 = prone phys
718 = crbonus_addVW
44 = magic armour
47 = xcrbonus damping phys
563 = chance to evade
246 = level ca all

 

mgr.addCreatureSkill is as you suggest, the advanced = 1 is mastery is probably correct.

Link to post

So I assume that that's where/how you add a skill to a creature/form (and possibly make it Mastered by changing the advanced = flag).

The advanced flag determines which column of the skill page it appears in. 0 is left, 1 is right.

 

To modify the skill and make it mastered, you go to:

mgr.createSkill {
skill_name = "skill__enemy_focus",
advance_level = 255,
min_level = 1,
mean_value = 200,
advance_mean_value = 0,
skillgroup = "SKG_ASPECTS",
}

And change the advance_level value. Using 1 will mean that it's mastered straightaway.

Link to post

So I assume that that's where/how you add a skill to a creature/form (and possibly make it Mastered by changing the advanced = flag).

 

Yes. The game just wants to know if the creature has mastered this particular skill or not. The rest is scaling to its level.

 

Adding new spells and CAs goes per spells entry in the mgr.createCreature sections. Keep in mind that the player character spells are somewhat hardcoded, at least the DMs to my experience. I never tried switching around spells from one toon to the other.

 

Also keep in mind, that a creature not only recieves bonuses and skills directly, but also those from their template_id creature (if they have one set).

 

addCreatureBpRelation ties a creature id to a blueprint id (this is used for the mounts that can be bought at mount vendors).

 

The merchant definitions (mgr.addMapPos) entries do not seem to work in any way (seems to be a leftover from the past). Merchants and the likes of them are now defined via the files in the persector.zip.

Link to post

How can I increase the level of bosses?

 

Hi. I don't think this can be done.

  • Like! 1
Link to post

How can I increase the level of bosses?

 

And great to have you here on the boards...

Welcome to DarkMatters Happy!

 

:)

 

gogo

  • Like! 1
Link to post

Hello all! I don't know if anyone is still active in this forum, but here it goes.

I'm trying to solve the bug described here:

Where you have a NPC that you were supposed to escort somewhere, but due to some fu**ery, he is still following the player around. This NPC's name is Lathor.

So I naively tried to use the creatures.txt file in order to be able to edit the faction.txt file, make my Seraphim and the NPC enemies so I can kill him. I added the following faction relation to the faction.txt file:

mgr.addFactionRelation {
    id1 = 1,
    id2 = 12,
    f1name = "FACTION_INVALID",
    f2name = "FACTION_HUMAN",
    relation = "FRT_ENEMY",
}

id1 is supposed to be the Seraphim, and id12 is supposed to represent humans. I indeed found out in the creatures.txt file that Lathor, the NPC I'm trying to kill, is a human.

However, my edits don't work and I am still unable to kill this NPC. Does anybody have a clue why? Should I edit more files to be able to kill a NPC? I already tried this but it didn't work either:

Thank you for your help :)

Link to post
1 hour ago, tititoto69 said:

Hello all! I don't know if anyone is still active in this forum, but here it goes.

I'm trying to solve the bug described here:

Where you have a NPC that you were supposed to escort somewhere, but due to some fu**ery, he is still following the player around. This NPC's name is Lathor.

So I naively tried to use the creatures.txt file in order to be able to edit the faction.txt file, make my Seraphim and the NPC enemies so I can kill him. I added the following faction relation to the faction.txt file:


mgr.addFactionRelation {
    id1 = 1,
    id2 = 12,
    f1name = "FACTION_INVALID",
    f2name = "FACTION_HUMAN",
    relation = "FRT_ENEMY",
}

id1 is supposed to be the Seraphim, and id12 is supposed to represent humans. I indeed found out in the creatures.txt file that Lathor, the NPC I'm trying to kill, is a human.

However, my edits don't work and I am still unable to kill this NPC. Does anybody have a clue why? Should I edit more files to be able to kill a NPC? I already tried this but it didn't work either:

Thank you for your help :)

We are still alive, and happy you met Flix!

Welcome to DarkMatters

:)

 

gogo

  • Like! 1
Link to post

Thank you very much to the both of you, @flix and @gogoblender! Glad to see this forum is still active after so many years. Sacred 2 is a really enjoyable game.

I will try to search the game files according to your hints, and if I find something interesting, I'll post it here and in the original thread. FYI, I didn't change the difficulty: I just took the Lathor quest, but right after I decided to follow another quest that was closer, and boom, the Lathor quest was bugged, as described in the thread I posted.

Link to post
18 minutes ago, tititoto69 said:

Thank you very much to the both of you, @flix and @gogoblender! Glad to see this forum is still active after so many years. Sacred 2 is a really enjoyable game.

I will try to search the game files according to your hints, and if I find something interesting, I'll post it here and in the original thread. FYI, I didn't change the difficulty: I just took the Lathor quest, but right after I decided to follow another quest that was closer, and boom, the Lathor quest was bugged, as described in the thread I posted.

I just realized that the quest is "Salesman of Death" which was bugged in the vanilla game in exactly this way.  This was fixed in the Community Patch.  Do you have that installed?

  • Thanks! 1
Link to post

Yes, "Salesman of Death", that's the one! And yes, I do have the Community Patch installed: on the main menu, it is written "CM-Patch 0160" at the bottom, and I do have v2.65.2 (Sacred 2 Gold via Steam). But I installed it after I had the bug. So maybe it fixed it for the players that did not start the quest yet?

By the way, I did some poking around in the scripts files to try to fix the bug. Here is what I did (I put it in a spoiler because maybe I should have posted it in the thread specific to the bug?):

Spoiler

So I searched in the creatures.txt file for the string "Lathor" and found this:


mgr.createCreature {
    id = 1687,
    itemtype_id = 11067,
    name = "Human_Story_Lathor",
    behaviour = "questCreatures",
    dangerclass = 5,
    groupmaxcount = 1,
    elite_creature_id = 1687,
    probabilityforelite = 0.000000,
    rank = 50,
    tenergy_creature_id = 1687,
    template_creature_id = 1374,
    livesremaining = 0,
    unconscioustime = 20,
    palettebits = "1111111111111111",
    monstertype = 0,
    faction_id = 12,
    equipset_id = 349,
    modelscale = 1.150000,
    rise_from_ground = 0,
    has_corpse = 1,
    has_soul = 1,
    can_strafe = 0,
}

That seems to be its creature definition, with the ID 1687. I tried to change its behavior to "Enemy_warrior_simple", but that didn't work.

Now, based on what you said, I search in the quest.txt file for the string "1687". I found a few occurrences, among them this one:


quest.createTaskCreature(8065, {
    itemtype = 11067,
    creature = 1687,
    behaviour = "questCreatures",
    ismortal = 0,
    isfighting = 0,
    persistent = 0,
    position = { 38,20,0 , 2674.110,2776.170,234.489, 225.000 },
})

Great! Its task creature ID is 8065. What if I set the ismortal property to 1? Well... that wouldn't have been to simple! That did not have the intended effect.

Now, I tried to search for the string "8065" in the quest.txt file, and again found a few occurrences. There were 6 lines detailing a groupchange, here they are:


{ 8065,2,1,"CM_Begleiter_feige",9 },
{ 8065,2,2,"Invalid",0 },
{ 8065,7,0,"Enemy_warrior_brave",57 },
{ 8065,7,1,"CM_Begleiter_feige",8 },
{ 8065,9,2,"questCreatures",66 },
{ 8065,10,2,"Invalid",0 },

I replaced them all with the following (X means I didn't change the original value from the line):


{ 8065,X,X,"Enemy_warrior_simple",12 },

I set 12 for the last parameter because the faction_id of Lathor defined in the createCreature function is 12, meaning "Human".

And then... that didn't work either. Not losing hope, I poked around the questscripts.txt file and searched for the string "8065". I found a few occurrences like these:


quest.setScript( 3070, "OnTaskFulfilled", function(args)
changeCreature {
tcid = 8065,
mortality = "IMMORTAL",
}
changeCreature {
tcid = 8554,
mortality = "IMMORTAL",
faction = "FACTION_FRIEND_HERO_ALL",
role = "ROLE_DIALOG",
behaviour = "questCreatures",
delay = 1,
}
end)

I tried to set the mortality to "MORTAL" for each one, but then again: no visible changes in the game.

It's as if the edits that I made were not taken into account by the game, at all. Do I need to do something particular after editing the game files, like compiling something? Note that I always did the edits while the game was fully closed. Also, I applied these edits cumulatively.

 

 

Link to post

Wow Lathor has his own creature entry!  I bet you could just delete it and he would vanish because the quest couldn't find him.  I don't THINK that would cause any errors or crashes, but maybe back up the save game just in case?

It's pretty rare for a side quest NPC to have his own creature entry. Usually only main quest NPC's are unique like that.

And yes, CM Patch fixes it, but only if the quest was not yet started.

  • Thanks! 1
Link to post

Well, that was good thinking, I didn't thought of it. It kinda works, in the sense of Lathor having disappeared, which is awesome! That leaves however the silver circle on the map where the beginning of his quest is supposed to be, in front of his house in the Badawi village. But that's no big deal.

Thank you very much for your help, and what you do for this community. I've been checking out your mods, I'll probably end up installing the music mod! I'll go explain the solution in the other topic.

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...