Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
hayabusa12 said:
I searched for this, and found nothing. I got the module system working, and did some dabbling, and I seriously messed up two native copies. no problem, right? Everyone started somwhere. my problem is, the "changes" I made stayed in the module system, and I can't figure out how to wipe/revert it back to native. any help?

Note- To reduce confusion, I did not mess up native without having copies of it, I still have several backups to go through. my problem is, the "changes" stayed in the python file, and it would take quite a while to find and remove them all.

Get a new module system.

Now my problem....
This problem has been around since .89x.  I was trying to script in village rebellions and I had it so a party of peasants was spawned and traveled to the player to attack the player.  Once I got this in(but I hadnt got them to attack the player yet, they just traveled to the player and the disappeared) I decided to change it so a battle would happen inside the player's village when the player entered it.  So I commented out the previous code that has the party of peasants travel to the player.....But it still happened.  So I deleted the commented out code from the module system.  And it still happened except the party was somehow changed to the village farmer party.  I was hoping when I updated my version to .901 it would stop, except it hasnt, and it now happens more often.  Before it would happen like once a day(game day), now it happens practically every minute and has become very annoying.  In .89x and .901 I have spent hours searching for any code that would cause this and I have found none.  I have searched for every reference for the village farmer  party and every reference is unchanged native code.  The only thing I can think of is the code that spawns the village farmers is treating the player as a village but it is unchanged and the player is not between villages begin and villages end.  What is going on!
 
make the party enemy of only the player and them use the follow party command and give the the max agressiveness
or tri ussing atack party
 
DarkAnd said:
make the party enemy of only the player and them use the follow party command and give the the max agressiveness
or tri ussing atack party

I probably didnt word my last post right.  What you said is what I was going to do, but I found out a better way to do what I wanted to do, so I completely removed the code from the module system and after many compiles the code was still being executed.  I posted it over at mbx and Winter helped me and we found that the native code that spawns the village farmer parties was not working correctly for me and was some how setting their target as the player.
I commented out the code and it fixed the problem.
I then was going to try to figure out a way to fix the native code, but I decided to try the native code one more time and it worked. 
So all I did was I commented it out, and compiled, then uncommented it and compiled, and it worked.  I just need to test more to make sure.  If it is still screwed up, I have an idea of how to fix it.

Here is what Winter said,
ERROR: need more input

Something to think about is that operations (such as spawn operations) don't need a direct reference to a module list entry to do something. All they need is an integer. For example, if you're adding items to a local variable containing the value 0, the game will add items to the player troop, because trp_player = 0. This may be what's happening.

What I'd do is disable any script that spawns parties until it stops happening, and then reincorporate the scripts with feedback messages that tell you if one of these parties is spawning and in which script/trigger.

I commented out the simple trigger that spawns the village farmer parties and fixed the problem.

This probably makes no sense, because what happened doesnt make sense.  All I did was comment out some code and then put it back in and it fixed the problem.  It doesnt make sense, but I have run into similar problems with python before.
 
A couple quick questions:

Where in the module system can you change the troop type that is recruited from villages?

Currently it is the lowest level faction troop that owns the village at game creation, but I can't find the code that sets this.
I would like to make it so that all villages recruit the exact same troop type regardless of ownership.

Any takers?

-Cheers
 
check_engine said:
A couple quick questions:

Where in the module system can you change the troop type that is recruited from villages?

Currently it is the lowest level faction troop that owns the village at game creation, but I can't find the code that sets this.
I would like to make it so that all villages recruit the exact same troop type regardless of ownership.

Any takers?

-Cheers

The troop types are in module_scripts.py #Cultures: section.

      (faction_set_slot, "fac_culture_1",  slot_faction_tier_1_troop, "trp_swadian_recruit"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_2_troop, "trp_swadian_militia"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_3_troop, "trp_swadian_footman"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_4_troop, "trp_swadian_infantry"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_5_troop, "trp_swadian_knight"),

There's 5 entries because there's a chance to get higher level recruits as your relation improves.  Look at "script_update_volunteer_troops_in_village" also in module_scripts.
 
Hi everyone.  This place sure has grown in 2 1/2 years.  :grin:

My question is about the additional attribute and skill points that are randomly added to a hero troop at the start of a new game.  How are the number of points determined?  Can the automatic addition of points be disabled or reduced?

According to the Mod Sys documentation:
Note that, in addition to the attributes and skills you've defined, the troop also gets 1 random attribute point and 1 random skill point per character level.

This does not appear to be true for the little hero mod I'm making.

I want Marnid, Borcha, Ymira and Rolf to have approx. the following attributes: str_8|agi_6|int_6|cha_5|level(1)
But in actuality, some of these heroes end up with:  str_15|agi_7|int_9|cha_5|level(1) 

Why is the game generating a hero with 7 more strength attribute points than was specified in theTroop file?  It can't have much to do with the additional level-dependent points described in the documentation if the hero's level is only 1.  By the way, the generated heroes have received no additional skill points at all which is fine by me.

The only other time I could find this question asked (but not answered  :cry: ) was in this thread:
http://forums.taleworlds.com/index.php/topic,21777.msg476571/topicseen.html#msg476571


Any insights would be greatly appreciated. 
 
I think if they're level 1 then the attributes don't change much (if at all). Did you include def_attrib? If so get rid of it.

If you're trying to make a high level NPC with fixed stats then try manually cranking it down at game_start with troop_raise_attribute (with a negative argument).

 
fisheye said:
I think if they're level 1 then the attributes don't change much (if at all). Did you include def_attrib? If so get rid of it.
Getting rid of def_attrib worked.  And perhaps not having knows_common is preventing the additional skill points from showing up.

Thanks a bunch, fisheye.   :grin:

fisheye said:
If you're trying to make a high level NPC with fixed stats then try manually cranking it down at game_start with troop_raise_attribute (with a negative argument).
Well, now that you ask...  :wink:

Actually, I'm trying to make heroes that start out at low level with stats similar to the player character's.  I have little use for Native's level 29 Rolf with his low stats if it take him over 60 days of combat to gain just one level.  So I'm reconfiguring all hero stats to make them much more similar to the player.  Each will have 1 or 2 points in weapon mastery, athletics, ironflesh and some specialisation like trade for Marnid, tracking for Borcha, wound treatment for Ymira and tactics for Rolf.  Also, I'd like each to start with enough points in INT to justify their level of specialisation.  Therefore, Marnid starts with 9 points of INT to justify his level 3 Trade skill.

For me, leveling up and customising a character is one of the best parts of the game.  Even if I start my heroes at level 3 instead of 1 this mod should allow me to enjoy leveling them quite a bit more often.
 
Here's a very simple script I'd used in 0.808 to set skill levels to a particular value, so that they did not vary with the character level. (call_script, "script_set_skill_level", skl_leadership, 3), would mean that the affected troop would start the game with a leadership of exactly three, no more, no less.

You could do the same thing with attributes and proficiencies. It has three variables, and scripts only take two parameters, so you need to (assign, "$in_character", trp_borcha), beforehand.

("set_skill_level", ### for "$in_character"),
[
    (store_script_param_1, ":skill"),
    (store_script_param_2, ":level"),

    (store_skill_level, ":eek:riginal", ":skill", "$in_character"),
    (val_sub, ":level", ":eek:riginal"),
    (troop_raise_skill, "$in_character", ":skill", ":level"),
]),

 
nijis said:
Here's a very simple script I'd used in 0.808 to set skill levels to a particular value, so that they did not vary with the character level. (call_script, "script_set_skill_level", skl_leadership, 3), would mean that the affected troop would start the game with a leadership of exactly three, no more, no less.

You could do the same thing with attributes and proficiencies. It has three variables, and scripts only take two parameters, so you need to (assign, "$in_character", trp_borcha), beforehand.

("set_skill_level", ### for "$in_character"),
[
    (store_script_param_1, ":skill"),
    (store_script_param_2, ":level"),

    (store_skill_level, ":eek:riginal", ":skill", "$in_character"),
    (val_sub, ":level", ":eek:riginal"),
    (troop_raise_skill, "$in_character", ":skill", ":level"),
]),
Very useful.  I'll give that a try.  Thanks nijis.

At the risk of pushing my luck, here's another question:

Is archery shot difficulty only calculated for the player character?  And, can the shot difficulty value that is reported be exploited as a trigger for activating a sound?  My aim would be to have an NPC generate a brief cheer if he hits with a shot difficulty of over, say, 10.  I'd only want the sound and none of the arms-raised animation that might interrupt his fighting.  If such a trigger is possible then would it also be possible to use the Hit Friendly Troop report as a trigger possibly generating an "Ooops" or "sorry!!" bark?
 
godot said:
For me, leveling up and customising a character is one of the best parts of the game.  Even if I start my heroes at level 3 instead of 1 this mod should allow me to enjoy leveling them quite a bit more often.

By the way have you tried the Band of Warriors mod (see my sig)? It's open source. Maybe after you've played it a bit you'd prefer to start from BoW as the code base for your mod rather than Native. Sounds like you're trying to do some very similar stuff.
 
fisheye said:
godot said:
For me, leveling up and customising a character is one of the best parts of the game.  Even if I start my heroes at level 3 instead of 1 this mod should allow me to enjoy leveling them quite a bit more often.

By the way have you tried the Band of Warriors mod (see my sig)? It's open source. Maybe after you've played it a bit you'd prefer to start from BoW as the code base for your mod rather than Native. Sounds like you're trying to do some very similar stuff.
Actually I have and I'm way too green at this time to begin understanding how you got hero behaviour to be so customisable.  :oops:  Nice work there.
I'll definitely be spending more time studying your mod after I've dragged myself above the steepest portion of the learning curve.  :wink:
 
I'm getting an error when I try to start the game: attempt to reregister body bo_village_oven

I haven't even touched it. Help?
 
Miclee said:
I'm getting an error when I try to start the game: attempt to reregister body bo_village_oven

I haven't even touched it. Help?
this means you have a duplicate colision of the bo_village_oven
which means that you made a mistake im module.ini
 
Are skeletons or animations now editable (skeletons.brf, anim_b.brf, horse_anim.brf)... Because if they are MAXHARDMAN (who's returned) thinks he can make gore (limbs and heads chooped off)
 
You can be very blunt sometimes, Highlander  :wink:. I wouldn't know how to go about making dismemberment just yet. Although you can make new animations, I'm not sure if you can seperate parts of meshes.
 
In a code, the sound modifier is "snd_":

      (.1, 0, 1, [(eq, "$necessary_variable", 0)[(play_sound, "snd_whateversound"),]),

What is the corresponding modifier in the beginning of a track (files located in the music folder)?
 
Game is crashing when I use this script. I been mad. I'm trying to solve this for 2 days.

(3, 0, 0, [],[
          (assign,":first_done",0),
          (call_script, "script_count_agents"), - This is ok.
          (try_begin),
              (lt, reg1,50),
              (store_random_in_range,":randomize",20,24),
              (entry_point_get_position,20,":randomize"),
              (set_spawn_position, 20),
              (spawn_agent,"trp_english_private"),
              (agent_set_team, reg0, 1),
              (assign,":first_done",1),
          (try_end),
          (try_begin),
              (eq,":first_done",1),
              (lt, reg2,30),
              (store_random_in_range,":randomize",1,5),
              (entry_point_get_position,21,":randomize"),
              (set_spawn_position, 21),
              (spawn_agent,"trp_turkish_private"),
              (agent_set_team, reg0, 0),
          (try_end),
        ]),

I've just tried like this too. And crashed again.

     (entry_point_get_position,pos1,1),
     (set_spawn_position, pos1),
     (spawn_agent,"trp_english_private"),

I've tried to spawn horse, and crashed again :cry:

Someone please help...
 
Status
Not open for further replies.
Back
Top Bottom