Author Topic: Modding Q&A [For Quick Questions and Answers]  (Read 3254392 times)

0 Members and 1 Guest are viewing this topic.

Noobmaster69

  • Recruit
  • *
    • Steam - https://steamcommunity.com/id/willy669/
    • View Profile
  • Faction: Bandit
Re: Modding Q&A [For Quick Questions and Answers]
« Reply #31275 on: October 16, 2019, 03:53:35 AM »
Please, don't kill me!

Noobmaster69

  • Recruit
  • *
    • Steam - https://steamcommunity.com/id/willy669/
    • View Profile
  • Faction: Bandit
Re: Modding Q&A [For Quick Questions and Answers]
« Reply #31276 on: October 16, 2019, 03:55:15 AM »
That looks like an texture plane missing an alpha. You need to mess with your alpha settings.

Oh my.. I'm a noob with simple brain  :cry: now what's this alpha thingy... :cry: :cry: :cry: :cry:
Please, don't kill me!

Corbul

  • Sergeant
  • *
  • Quoth I...
    • View Profile
  • Faction: Vaegir
Re: Modding Q&A [For Quick Questions and Answers]
« Reply #31277 on: October 18, 2019, 05:34:08 PM »
Oh my.. I'm a noob with simple brain  :cry: now what's this alpha thingy... :cry: :cry: :cry: :cry:

Alpha texture, it's required for your standard textures to work in-game, for whatever reason. If you have openbrf, you can see it's one of the options in the side-bar. You'll need to add an alpha texture to the .brf in question, then assign it in the side-bar. Depending on what you're trying to do, you can either make a "blank" alpha texture, or recycle one of the native ones. But you'll need an expert to tell you more precisely.
"I can live without eating and drinking, but not without DADA." - George Grosz

SupaNinjaMan

  • Baron
  • *
  • 🆗🆒
    • Steam - sionfel
    • Twitch.tv - Sionfel
    • YouTube - DinosaurWithRobotEye
    • View Profile
  • Faction: Nord
  • MP nick: SupaNinjaMan
  • M&BWBWF&SNWVC
Re: Modding Q&A [For Quick Questions and Answers]
« Reply #31278 on: October 18, 2019, 06:48:23 PM »
Oh my.. I'm a noob with simple brain  :cry: now what's this alpha thingy... :cry: :cry: :cry: :cry:

Alpha texture, it's required for your standard textures to work in-game, for whatever reason. If you have openbrf, you can see it's one of the options in the side-bar. You'll need to add an alpha texture to the .brf in question, then assign it in the side-bar. Depending on what you're trying to do, you can either make a "blank" alpha texture, or recycle one of the native ones. But you'll need an expert to tell you more precisely.
Not to be rude or curt. . . this is not right in the slightest. An alpha is a channel inside the texture files that basically tells the material shader what NOT to draw, giving it transparency. The reason there is a black square is because either 1) you didn't set your alpha settings in OpenBRF correctly, or 2) the process of converting the texture erased the alpha channel.

Here's a video of me explaining how to check and enable alphas because I didn't feel like typing a whole bunch.  I'm also prone to going on rants so you can almost certainly safely ignore my self-discussion about where magenta or black is 1 or 256.
-

Anglolord

  • Veteran
  • *
  • Mod Necromancer
    • View Profile
  • Faction: Swadian
Re: Modding Q&A [For Quick Questions and Answers]
« Reply #31279 on: October 19, 2019, 01:55:11 PM »
Quote
If you look into module_troops you find for examples this line here:
Code: [Select]
["village_walker_1","Villager","Villagers",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners,
   [itm_short_tunic, itm_linen_tunic, itm_coarse_tunic, itm_leather_vest, itm_leather_apron, itm_shirt, itm_woolen_hose, itm_nomad_boots, itm_blue_hose, itm_hide_boots, itm_ankle_boots, itm_leather_boots, itm_fur_hat, itm_leather_cap, itm_straw_hat, itm_felt_hat],
   def_attrib|level(4),wp(60),knows_common,man_face_younger_1, man_face_older_2],
It's distributed across three lines to make it easier to read for the ones who are coding the troops into. Most here I think prefer to have the faction as the last thing in the first line, the whole equipment in the second line and the rest in the last line.
For the cartographer you however need to have it all in one line as I have understood it here, so it should look like:
Code: [Select]
["village_walker_1","Villager","Villagers",tf_guarantee_boots|tf_guarantee_armor,0,0,fac_commoners, [itm_short_tunic, itm_linen_tunic, itm_coarse_tunic, itm_leather_vest, itm_leather_apron, itm_shirt, itm_woolen_hose, itm_nomad_boots, itm_blue_hose, itm_hide_boots, itm_ankle_boots, itm_leather_boots, itm_fur_hat, itm_leather_cap, itm_straw_hat, itm_felt_hat], def_attrib|level(4),wp(60),knows_common,man_face_younger_1, man_face_older_2],
so that the cartographer can read it properly since he might try to read each line as an own troop. Have your try with this.

Thanks for help guys, but still getting this error:
Code: [Select]
@--start parsing parties
luajit: .\mab-parties.lua:66: attempt to perform arithmetic on a nil value
stack traceback:
        .\mab-parties.lua:66: in function 'load'
        cartographer.lua:58: in main chunk
        [C]: ?

I've posted the module_parties file at pastebin (https://pastebin.com/TEbzYjQx) I still can't work out what is preventing Swyters cartographer from reading it. Checked the tuples in Sublime Text and none of the lines appear to run over, I'm not sure it's even that causing it. Anything else I should look for?

Full cartographer log: https://imgur.com/a/DgaetV3
« Last Edit: October 19, 2019, 02:00:29 PM by Anglolord »

SupaNinjaMan

  • Baron
  • *
  • 🆗🆒
    • Steam - sionfel
    • Twitch.tv - Sionfel
    • YouTube - DinosaurWithRobotEye
    • View Profile
  • Faction: Nord
  • MP nick: SupaNinjaMan
  • M&BWBWF&SNWVC
Re: Modding Q&A [For Quick Questions and Answers]
« Reply #31280 on: October 19, 2019, 09:13:40 PM »
Swyter is Spanish, so I doubt this is the issue, but you are using a whole ton of nonstandard Latin Characters in your party names and that could maaaaaayyybe be the issue.
-

kalarhan

  • Python Saint
  • Count
  • *
  • Use Q&A thread, not a PM :)
    • View Profile
  • Faction: Neutral
  • WBNWVCWF&S
Re: Modding Q&A [For Quick Questions and Answers]
« Reply #31281 on: October 19, 2019, 09:42:45 PM »
Anything else I should look for?

did you try to find out if one of the parties is the cause? It should be simple:

1) backup your file
2) delete parties from the file. Like 99% of them lol. Keep just one (first)
3) load the tool and see if it works
4) if it does then restore some parties (block) and try again. Repeat until it breaks. Delete parties until it works.
5) you found the issue

Corbul

  • Sergeant
  • *
  • Quoth I...
    • View Profile
  • Faction: Vaegir
Re: Modding Q&A [For Quick Questions and Answers]
« Reply #31282 on: October 19, 2019, 09:48:24 PM »
Not to be rude or curt. . . this is not right in the slightest.
Tis alright, I was just trying to help the way I understood it, but clearly I didn't know what I was talking about. :mrgreen:
Thanks for the info! :)
"I can live without eating and drinking, but not without DADA." - George Grosz

NoChar

  • Veteran
  • *
    • View Profile
  • Faction: Rhodok
Help w/Module Sytstem
« Reply #31283 on: October 21, 2019, 11:25:22 PM »
I recently added some banners to a new faction I created as they were simply using flags from other factions, and red text would pop up in the left hand corner saying "NOT ENOUGH BANNERS" each time I started a new game.

I added the banners and I think I did everything right, by following this tutorial: https://forums.taleworlds.com/index.php/topic,334271.0.html

However the module system has errors that I tried to find and fix, but couldn't, and also the game stops and freezes and an RGL error appears.
The RGL error says: "Unexpected end to file Modules/MyMod/scripts.txt"

Here is the module system log:
https://pastebin.com/nbmnYdeq

Any help?
Judging by your posting habits, nobody's coming to your feast because you sent the invites to the wrong kingdom.

kalarhan

  • Python Saint
  • Count
  • *
  • Use Q&A thread, not a PM :)
    • View Profile
  • Faction: Neutral
  • WBNWVCWF&S
Re: Help w/Module Sytstem
« Reply #31284 on: October 22, 2019, 01:22:35 AM »
Any help?

you have a syntax error on your module_scripts.py that is breaking the compiler, thus crashing the game. Review your changes to find it and fix the problem there.

Artam

  • Veteran
  • *
    • View Profile
  • Faction: Neutral
  • WBNWVCM&BWF&S
Re: Modding Q&A [For Quick Questions and Answers]
« Reply #31285 on: October 22, 2019, 11:39:38 AM »
Hello everyone,

I'm trying to reduce the chance of enemy lords to escape after being defeated by 5% depending on each point given to prison management. And I think I did it. When the prison management skill at 10, I successfully captured the enemy lord around 30%. Therefore, I would like to share the code here to ask for help from experienced people who will confirm that I am not under the placebo effect.

Code: (module_script.py) [Select]
  ("cf_check_hero_can_escape_from_player",[
  (store_script_param_1, ":troop_no"),
  (assign, ":quest_target", 0),
  (try_begin),
(check_quest_active, "qst_persuade_lords_to_make_peace"),
(this_or_next|quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_target_troop, ":troop_no"),
(quest_slot_eq, "qst_persuade_lords_to_make_peace", slot_quest_object_troop, ":troop_no"),
(assign, ":quest_target", 1),
  (else_try),
(ge, ":troop_no", "trp_sea_raider_leader"),
(lt, ":troop_no", "trp_bandit_leaders_end"),
(try_begin),
  (check_quest_active, "qst_learn_where_merchant_brother_is"),
  (assign, ":quest_target", 1), #always catched
(else_try),
  (assign, ":quest_target", -1), #always run.
(try_end),
  (try_end),

  (assign, ":continue", 0),
  (try_begin),
(eq, ":quest_target", 0), #if not quest target
(store_random_in_range, ":rand", 0, 100),
### BEGIN + LOWERING CHANCE OF LORD ESCAPE
# (lt, ":rand", hero_escape_after_defeat_chance),
(assign, ":escape_chance", 70),
(try_begin),
(store_skill_level, ":level", "skl_prisoner_management", "trp_player"),
(val_mul, ":level", 5),
(val_sub, ":escape_chance", ":level"),
(try_end),
(lt, ":rand", ":escape_chance"),
### END - LOWERING CHANCE OF LORD ESCAPE
(assign, ":continue", 1),
  (else_try),
(eq, ":quest_target", -1), #if (always run) quest target
(assign, ":continue", 1),
  (try_end),

  (eq, ":continue", 1),
]),

I also want to share my thinking process. Because If I am wrong about this, you'll know why. :mrgreen:

Quote from: Comment
# (lt, ":rand", hero_escape_after_defeat_chance), ---------------------------------> hero_escape_after_defeat_chance native value is 70 so I commented out.
(assign, ":escape_chance", 70),------------------------------------------------------> destination ":escape_chance" value is 70
(store_skill_level, ":level", "skl_prisoner_management", "trp_player"),-----------> ":level" = storing prisoner management skill level for player.
(val_mul, ":level", 5),-----------------------------------------------------------------> ":level" * 5
(val_sub, ":escape_chance", ":level"),-----------------------------------------------> ":escape_chance" - ":level"

Quote from: Example
I want lord base escape chance 70%, ":escape_chance" value is 70
Let's say I have 3 prisoner management skill, ":level" value is 3

3 * 5 = 15
70 - 15 = 55

Now, lord escape chance reduced to 55%.

Does this make sense or am I hallucinating?

Kind regards,

Dj_FRedy

  • Count
  • *
  • "game_start"
    • View Profile
  • Faction: Swadian
  • M&BWBNWVCWF&S
Re: Modding Q&A [For Quick Questions and Answers]
« Reply #31286 on: October 22, 2019, 12:59:36 PM »
The range of success is reduced as more prisoner management skill points are gained, therefore... approved.
"Lately I have had little time to play. That is the downside of modding. And once you get behind the scenes (no pun intended) some of the magic disappears. You start contemplating ways to change the game instead of just playing and having fun. Suddenly it is more fun modding than actually playing".
Adorno

kalarhan

  • Python Saint
  • Count
  • *
  • Use Q&A thread, not a PM :)
    • View Profile
  • Faction: Neutral
  • WBNWVCWF&S
Re: Modding Q&A [For Quick Questions and Answers]
« Reply #31287 on: October 22, 2019, 01:19:05 PM »
I would like to share the code here to ask for help from experienced people who will confirm that I am not under the placebo effect.

add testing messages to your code and play test it, that way you can see your code working and you dont need to worry about that. As you get used to it you can reduce the amount of messages as well.

https://forums.taleworlds.com/index.php/topic,347990.msg8335287.html#msg8335287

for your code you should print the skill level, the chance % and the value of rand before the last line (that eq test).

Remember you dont need to guess how things work, you can test them.

Artam

  • Veteran
  • *
    • View Profile
  • Faction: Neutral
  • WBNWVCM&BWF&S
Re: Modding Q&A [For Quick Questions and Answers]
« Reply #31288 on: October 22, 2019, 06:48:04 PM »
Dj_FRedy, much appreciated for your approval.  :party:

kalarhan, thank you for the link. I bookmarked it, and I'll definitely use when I need it.

Kind regards,

freedomhunter max

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: freedomhunter max
  • WBWF&SNW
Re: Modding Q&A [For Quick Questions and Answers]
« Reply #31289 on: October 23, 2019, 05:50:07 AM »
how can i change the time between jumps (of character and of horse)?