Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
It's a place to store "strings", that is, bits of text or numbers, for use in menus and speech. For example, if the marshall says "I want you to patrol around {reg12}, {reg13} and {reg14}", you can be sure there's a bit of code beforehand that defines which settlements should be mentioned.
It goes up to reg65 iirc, but that's just a vague guess based on what I've seen.
 
They're not coded to anything. They're just predefined global variables. Their usage depends on the code. There's a convention that most scripts that return any value put it in reg0, for example.
 
Thanks to Lumos, I have fixed the problem that prompted me to create this account, and got the game to recognize my module.
Then I got stonewalled again:
I copied the Floris  to create and "faction-ize" my city I edited the "Parties", "Scenes", "Factions", "Troops", "Scripts" folders.
Upon starting Warband under my CustomModule it processes the .ini file (yay, thanks Lumos!), then gets to processing my settings and a dialog box comes forward and reads only: "Unable to find face mesh: Male Head".  :shock:
Awesome, I was like, I'll copy the textures, meshes, resources from Floris again, did nothing.
What's more is that I did not even OPEN the module_meshes folder to the best of my knowledge. And I know for a fact I added nothing that would require additional face meshes. Is there a way to add this one mesh back or do I need to rebuild the module, and copy my customized files back in?
Thanks again, guys, and I hope this is the last time I take time from your day!
 
One question: I want to make the Bows and Crossbows ability not to show on the character screen. I know I probably should flag them as inactive, but I don't know where to find those two abilities. Can you help me? Thanks!
 
Kinglok12 said:
[...] then gets to processing my settings and a dialog box comes forward and reads only: "Unable to find face mesh: Male Head".  :shock:
Awesome, I was like, I'll copy the textures, meshes, resources from Floris again, did nothing.
Check for errors with OpenBRF, copy any missing meshes over from CommonRes?

Antonis said:
One question: I want to make the Bows and Crossbows ability not to show on the character screen. I know I probably should flag them as inactive, but I don't know where to find those two abilities. Can you help me? Thanks!
The only proficiency you can flag as inactive is the firearms one, which is hidden by default. To remove the entries for any others, you'll need to remove their lines in the language files. I believe that replacing the proficiency's strig gentry will remove its "plus" button as well, but this could be a lie (in which case, the "plus" signs' positions will be governed by game_variables.txt).
 
sea travel is,Likes works.But i can't be a ship icon and AI can't move on sea even they are have a ship icon.Why that is happening ?

Should i add a transition area to coasts for their changing icon ? for example,what sea terrain passable is it ? the river ? or bridge ?
zQbXZj.jpg

6Y0OW0.jpg
 
I want to get certain bandit spawns to accompany a (specific kingdom's) marshall on campaign, and then leave when the campaign ends. I've looked at the code for ai behaviour but the sheer number of scripts and variables dealing with marshall AI has me stumped as to where to begin.

Late thank you to Dusk Voyager helping with casualties - only recently got a chance to test it and it worked perfectly  :smile:
 
Hey, me again  :smile:

After fixing most of the errors in the code and compiling, whenever I click on the "Multiplayer" option in the menu, the game crashes and I get.

RGL ERROR

Unexpected End of File in Modules/Cry of Winter/scenes.txt

Thanks!  :grin:
 
Hi,
how can I make a faction be allied(or at the very least not hostile) with another? Is editing the faction relations in the module_factions_enough?
Even better, is ther a script to make a central faction with vassal factions or many factions that are part of the same "group". I prefer not using whole mods like Diplomacy etc.
Thank you.
 
@Suns_Persian_Guard you need to recompile the mod. Your error is in module_scenes.py. Make sure that you have no scenes with a name like this "" (empty name, no characters in it). If you want empty name, then put a space.
 
Antonis said:
Hi,
how can I make a faction be allied(or at the very least not hostile) with another? Is editing the faction relations in the module_factions_enough?
Even better, is ther a script to make a central faction with vassal factions or many factions that are part of the same "group". I prefer not using whole mods like Diplomacy etc.
Thank you.

Set a simple trigger that sets their relationship to 100 every day.

For vassals, I've thought about this quite a bit: one solution would be to prevent the lesser factions from having foreign policy by removing them from the declare war/peace script. Then you'd have to direct those wars manually by setting a trigger that brings the lesser factions into the war/peace with the major faction's enemies.

There might be some other stuff you could potentially do to prevent stagnation, such as implementing a script where smaller factions can decide to break vassalage if the larger faction has fewer settlements (could possibly weight towards castles, or even castles on hills, for the military impressiveness of said faction). Everything else would probably work alongside this.
 
Thank you. I will add the trigger, to make perfect relations. As for the vassals, my idea was to make some equal minor factions. To explain better, I am making a mod about the greek revolution in 1821 against the Ottomans. At first, I had only 2 factions, Greeks and Ottomans, but after a short period of time(less than a month) the Greeks kept losing most of their territory and soon only one faction remained(Greeks didn't have a regular army, unlike the proffesional adversaries). Boring to have ony a faction after a game month, right? So, I thought of dividing Ottoman Empire to its counties(pashaluks) and that had results. Of course, as equal parts of the same nation, they shouldn't declare war to gain a for or just a town. Also, there is not a central Ottoman faction present. And there's my problem. Thank you, though. 
 
Hi, could a coder look though this code its supposed to check how much gold the player has if it is below 5000 it add's 3000 its just intended to improve my coding skills  :lol:

("add_gold_script")
  [
    (try_begin),
    (assign, ":player_gold", 5000),
    (store_troop_gold, ":player_gold", "trp_player"),
(lt, "player_gold", 5000),
(troop_add_gold, "trp_player", 3000),
    (try_end),


its throwing up a syntax error i placed it at the bottom of module scripts beneath "refresh_center_stables".
 
Deutch1 said:
Hi, could a coder look though this code its supposed to check how much gold the player has if it is below 5000 it add's 3000 its just intended to improve my coding skills  :lol:

("add_gold_script")
  [
    (try_begin),
    (assign, ":player_gold", 5000),
    (store_troop_gold, ":player_gold", "trp_player"),
(lt, "player_gold", 5000),
(troop_add_gold, "trp_player", 3000),
    (try_end),


its throwing up a syntax error i placed it at the bottom of module scripts beneath "refresh_center_stables".

Is that the entire script? If so you'll need the same number of forward and backward brackets, otherwise it'll treat the entire rest of the file like the end of the script.

Here's an edited version that should work:

Code:
 ("add_gold_script" #removed the closing bracket here.
  [
    (try_begin),
 #   (assign, ":player_gold", 5000), #comnented out this line as it's not needed. Player_gold is assigned by the followng line.
    (store_troop_gold, ":player_gold", "trp_player"),
   (lt, "player_gold", 5000), 
   (troop_add_gold, "trp_player", 3000),
    (try_end),
]), #closed both brackets


Ideally you'd also want to indent the try blocks (makes stuff a lot neater and easier to read/spot syntax errors. Looking at the existing code is the best way to learn.
 
Deutch1 said:
Code:
 ###("add_gold_script") [color=blue]# What is this I don't even...?[/color]
### [ [color=blue]# Make sure to note how scripts work before throwing brackets around.[/color]
 ("add_gold_script", [ [color=blue]# That's better.[/color]
	(try_begin), [color=blue]# ALWAYS keep proper indentation. I like tabs, but you can use three or four spaces, if you so insist.[/color]
		(assign, ":player_gold", 5000),[color=blue] # This line is useless, remove it. You're assigning a value to a variable, but you are overwriting it later. Just remove this line.[/color]
		(store_troop_gold, ":player_gold", "trp_player"), [color=blue]# Correct; also note how try_* blocks should be further indented[/color]
		(lt, "[color=blue][b]:[/b][/color]player_gold", 5000), [color=blue]# The colon was missing, and you need it to mark player_gold as a local variable.[/color]
		(troop_add_gold, "trp_player", 3000), [color=blue]# This works because (almost) [i]every[/i] single line of code in the ModSys is an if-statement, i.e. it can fail; ergo if you've got 5000+ gold (the previous line fails), the entire try_* block will stop its execution.[/color]
	(try_end), [color=blue]# Always remember to close your try_* blocks![/color]
 [color=blue][b]]),[/b] # And always make sure your script is closed off properly.[/color]

EDIT: Ninja'd.
EDIT2:
jacobhinds said:
Looking at the existing code is the best way to learn.
That's completely true, however only when not relating to indentation. In some places, the Native code suffers from horrible issues in that respect, and one ends up rewriting all the weird (and sometimes misplaced) double-spaced indentations with proper solid tabs, taking up more time than the actual modifications being made. *sigh*
 
Status
Not open for further replies.
Back
Top Bottom