Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Code:
          (str_clear, s68),
          (try_begin),
            (this_or_next|is_between, ":troop_no", lords_begin, lords_end),
            (is_between, ":troop_no", companions_begin, companions_end),
              (troop_get_slot, ":troop_reputation", ":troop_no", slot_lord_reputation_type),
              (store_add, ":troop_reputation_string", ":troop_reputation", "str_personality_archetypes"),
              (str_store_string, s68, ":troop_reputation_string"),
          (else_try),
            (str_store_string, s68, "str_none"),
          (try_end),
The code above is supposed to show the lord's reputation in the notes, but all i get is "Sir" in the place of the personality string.

Here's the strings from the file:
Code:
  ("personality_archetypes", "liege"),
  ("martial", "martial"),
  ("quarrelsome", "bad-tempered"),
  ("selfrighteous", "pitiless"),
  ("cunning", "cunning"),
  ("debauched", "sadistic"),
  ("goodnatured", "good-natured"),
  ("upstanding", "upstanding"),
  ("roguish", "roguish"),
  ("benevolent", "benevolent"),
  ("mercantile", "mercantile"),
 
I noticed that most of my map icons ave a problem with my campaign map terrain.
rsUcjuJ.jpg
Is there a way of fixing it other than having to modify the icons or the campaign map?


PS: I don't know where to ask this, is there any events going on here or something? see pic
LE3rRUB.png
The entire site have these horses as accounts? I checked my account changed my profile pic, but the same.
 
[Bcw]Btm_Earendil said:
Algerian.Sultan said:
I noticed that most of my map icons ave a problem with my campaign map terrain.
rsUcjuJ.jpg
Is there a way of fixing it other than having to modify the icons or the campaign map?
I somehow doubt it can be fixed without modifying either the icons or the campaign map.
What about moving the model up in openbrf? Or is that complete nonsense? (Never tried something like that with icons)
 
gokiller said:
[Bcw]Btm_Earendil said:
Algerian.Sultan said:
I noticed that most of my map icons ave a problem with my campaign map terrain.
rsUcjuJ.jpg
Is there a way of fixing it other than having to modify the icons or the campaign map?
I somehow doubt it can be fixed without modifying either the icons or the campaign map.
What about moving the model up in openbrf? Or is that complete nonsense? (Never tried something like that with icons)

Moving it up would only work if there was a deep plinth underneath the map icon (as used in Viking Conquest) that you didn’t mind being partially visible (without a plinth, part of the icon would float above the ground). For map icons unmounted on plinths you need to edit the campaign map in Thorgrim’s Map Editor to create a flat shelf in it’s current location. Alternatively, you could relocate the map icon to a flat part of the map.
 
KratosMKII said:
Code:
          (str_clear, s68),
          (try_begin),
            (this_or_next|is_between, ":troop_no", lords_begin, lords_end),
            (is_between, ":troop_no", companions_begin, companions_end),
              (troop_get_slot, ":troop_reputation", ":troop_no", slot_lord_reputation_type),
              (store_add, ":troop_reputation_string", ":troop_reputation", "str_personality_archetypes"),
              (str_store_string, s68, ":troop_reputation_string"),
          (else_try),
            (str_store_string, s68, "str_none"),
          (try_end),
The code above is supposed to show the lord's reputation in the notes, but all i get is "Sir" in the place of the personality string.

Here's the strings from the file:
Code:
  ("personality_archetypes", "liege"),
  ("martial", "martial"),
  ("quarrelsome", "bad-tempered"),
  ("selfrighteous", "pitiless"),
  ("cunning", "cunning"),
  ("debauched", "sadistic"),
  ("goodnatured", "good-natured"),
  ("upstanding", "upstanding"),
  ("roguish", "roguish"),
  ("benevolent", "benevolent"),
  ("mercantile", "mercantile"),

My guess is that the instead of doing say str_personality_archetypes+2 to get str_quarrelsome like you're expecting, it's doing like str_personality_archetypes + XXX (what ever the string's number is) to get you sir. Somehow.

Based on the way TW does it when they call it you might try
Code:
	   (troop_get_slot, ":troop_reputation", ":troop_no", slot_lord_reputation_type),
	   (assign, ":personality", "str_personality_archetypes"),
	   (val_add, ":personality", ":troop_reputation"),
	   (str_store_string, s68, ":personality"),
Even though, effectively, you're doing the exact same thing.
 
How would I go about making it so blunt weapons no longer knock people unconscious, and instead replace it with the 25% chance of being knocked unconscious that the player's troops have?
 
SupaNinjaMan said:
KratosMKII said:
Code:
          (str_clear, s68),
          (try_begin),
            (this_or_next|is_between, ":troop_no", lords_begin, lords_end),
            (is_between, ":troop_no", companions_begin, companions_end),
              (troop_get_slot, ":troop_reputation", ":troop_no", slot_lord_reputation_type),
              (store_add, ":troop_reputation_string", ":troop_reputation", "str_personality_archetypes"),
              (str_store_string, s68, ":troop_reputation_string"),
          (else_try),
            (str_store_string, s68, "str_none"),
          (try_end),
The code above is supposed to show the lord's reputation in the notes, but all i get is "Sir" in the place of the personality string.

Here's the strings from the file:
Code:
  ("personality_archetypes", "liege"),
  ("martial", "martial"),
  ("quarrelsome", "bad-tempered"),
  ("selfrighteous", "pitiless"),
  ("cunning", "cunning"),
  ("debauched", "sadistic"),
  ("goodnatured", "good-natured"),
  ("upstanding", "upstanding"),
  ("roguish", "roguish"),
  ("benevolent", "benevolent"),
  ("mercantile", "mercantile"),

My guess is that the instead of doing say str_personality_archetypes+2 to get str_quarrelsome like you're expecting, it's doing like str_personality_archetypes + XXX (what ever the string's number is) to get you sir. Somehow.

Based on the way TW does it when they call it you might try
Code:
	   (troop_get_slot, ":troop_reputation", ":troop_no", slot_lord_reputation_type),
	   (assign, ":personality", "str_personality_archetypes"),
	   (val_add, ":personality", ":troop_reputation"),
	   (str_store_string, s68, ":personality"),
Even though, effectively, you're doing the exact same thing.
Thank you, but that didn't work. The string now is empty. It's strange because the conditions excludes kings and the string s68 appear in the notes as "none". Other mods don't seem to have this issue.
 
Mr_Fun_Times said:
How would I go about making it so blunt weapons no longer knock people unconscious, and instead replace it with the 25% chance of being knocked unconscious that the player's troops have?
I would do something like
Code:
death_handling = (
	ti_on_agent_killed_or_wounded, 0, 0, [], [
	#ti_on_agent_killed_or_wounded is fired whenever an agent is knocked down and can be used to determine
	#whether or not they are knocked out by using set_trigger_result

		(store_random_in_range, ":1d4", 1, 5),	#Roll a 4-sided die, because I wanted to be dumb

		(try_begin),
			(eq, ":1d4", 4),		#Basically if they get a critical save
			(set_trigger_result, 0),	#Knock out instead of die
		(else_try),
			(set_trigger_result, 1),	# Else, perish
		(try_end),
]
WARNING! THIS WILL KILL COMPANIONS!

The problem is that this will fire regardless of weapon type, you could use (store_trigger_param_2, ":attacker"), and see if the agent is using a blunt weapon or whatever, but this is a good jumping off point for you to learn.
 
BeefBacon said:
Can I tell villages to be assigned to specific castles and towns, rather than the closest?

slot used is slot_village_bound_center

Code:
# fill_village_bound_centers
#pass 1: Give one village to each castle

Code:
#pass 2: Give other villages to closest town.
(try_for_range, ":cur_village", villages_begin, villages_end),
   (neg|party_slot_ge, ":cur_village", slot_village_bound_center, 1), #skip villages which are already bound.
        ....

look for those snippets on module_scripts
 
KratosMKII said:
Code:
          (str_clear, s68),
          (try_begin),
            (this_or_next|is_between, ":troop_no", lords_begin, lords_end),
            (is_between, ":troop_no", companions_begin, companions_end),
              (troop_get_slot, ":troop_reputation", ":troop_no", slot_lord_reputation_type),
              (store_add, ":troop_reputation_string", ":troop_reputation", "str_personality_archetypes"),
              (str_store_string, s68, ":troop_reputation_string"),
          (else_try),
            (str_store_string, s68, "str_none"),
          (try_end),
The code above is supposed to show the lord's reputation in the notes, but all i get is "Sir" in the place of the personality string.

Here's the strings from the file:
Code:
  ("personality_archetypes", "liege"),
  ("martial", "martial"),
  ("quarrelsome", "bad-tempered"),
  ("selfrighteous", "pitiless"),
  ("cunning", "cunning"),
  ("debauched", "sadistic"),
  ("goodnatured", "good-natured"),
  ("upstanding", "upstanding"),
  ("roguish", "roguish"),
  ("benevolent", "benevolent"),
  ("mercantile", "mercantile"),

probably not a good idea to add strings and slots together
 
How would I go about modifying what contestants spawn with in tournaments? I did what was said here (taken from the tweaks thread)


TheMageLord said:
Darmoth said:
Hi... we've been wondering about what we would have to do to give archers in the arena a back up weapon. Like a quarter staff, or shorts sword?

Thats stored in mission_templates.txt. Find mst_arena_melee_fight arena_melee_fight. There should be big block of numbers, the first three lines being:
58 0 4112 447 16 1 5  12 18 17 42 28
1 4112 447 16 1 2  3 42
2 4112 447 16 1 4  3 17 42 28
That first number (5:cool: is just the number of lines to follow, so ignore that for the first line. The red number is how many items the unit has. The blue numbers right after that are the items, stored in numerical order. The way you figure out which items are which is open up item_kinds.txt in a program that shows you the line numbers on the side (like notepad2) and check the item by line number. The formula to translate the number to the line number is: (#+1) x 3, so the first item in our list here (12) is on line number 39 (12+1 = 13, x3 = 39). Then go into item_kinds and find number 39, which is a practice bow. I'll leave it up to you to figure out exactly which lines in that big long list of 58 are which, but 12 = bow so if you find all instances of that you should find all the archers.

So if you want to add something, just find the item you want, note the line it's on, translate it into the item number, add it to the list, and add 1 to the red number so it reads the new item.

But I ran into some problems. I'm trying to make it so no one spawns with a heavy practice sword while also spawning with a horse (I'm making two handed unuseable on horseback), I went through the lines, making sure the heavy wooden sword (item #1:cool: never appeared in the same line as a practice horse (item #34), however when testing I noticed some contestants still spawn with the heavy sword while on horseback.

I noticed that in these lines there are no item number entries for practice crossbows, practice bolts, practice axes, and practice javelins, yet these appear in the tournament, so my hunch is that there is more info stored somewhere else.
 
Mr_Fun_Times said:
How would I go about modifying what contestants spawn with in tournaments?

best way is to forget .txt and use the modsys (if available) for that module. Then you can change the game code to do whatever you want with it.
 
JuJu70 said:
probably not a good idea to add strings and slots together
That code is correct.
Number of the type of lord's reputation is added as an offset to the number of the first string in a set of strings that list the names of reputation types.
I've used the same code in a PoP tweak and in Perisno for years.

Something else messes it: either the ids of reputation types were changed or a wrong sXX (i.e. not s6:cool: string was inserted into str_lord_info_string or s68 is already used later in the script and is therefore overwritten etc.
 
Status
Not open for further replies.
Back
Top Bottom