Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
HelrothHyrmir said:
I have the problem regarding to custom item meshes.So I opened my openBRF,imported the meshes and their respective materials and textures there.After that,I saved the meshes,materials and textures in "resource" folder of my mod in brf extension,and textures with "DDS" extension in "textures" folder.I created my new item in module_items.py file,and added it to a Swadian Recruit in the "module_troops.py" file.Before that,I opened "module.ini" folder of my mod,edited "scan_module_textures = 0" to "scan_module_textures = 1" and added "load_mod_resource = armor_meshes" , "load_mod_resource = armor_material" and "load_mod_resource = armor_texture" so the game can read them.After that,I have successfuly built the module,launched MB Warband,recruited Swadian Recruit,but that item had no textures/materials of the item shown at all.Only mesh was recognizable and it was blank.Any ideas in which part I made mistake?

P. S. - I already made a new topic about this,but its more appropriate for this kind of question to be posted in QnA topic.
I agree, the whole mesh+texture system in WB is too damn contrived. :sad:
 
HelrothHyrmir said:
P. S. - I already made a new topic about this,but its more appropriate for this kind of question to be posted in QnA topic.

you posted in the guild subforum. That one is for showing off your mod, not questions. Use this forum instead (the Forge) to discuss modding in general. And this thread is the best place for quick questions like this one.

like DJ_FRedy linked above your post indicates you have the wrong order on module.ini.
 
The new order is as following : "load_mod_resource = "armor_texture" , "load_mod_resource = armor_material","load_mod_resource = armors_1" .No avail.

I also attempted setting the armor meshes first : "load_mod_resource = armors_1" , "load_mod_resource = armor_texture", "load_mod_resource = armor_material" and putting the armor meshes in middle while textures first and materials last.The problem is still not solved
 
HelrothHyrmir said:
The problem is still not solved

texture, material, mesh. That is the order. No need to experiment with other combinations.

if you still have issues AFTER that then you will need to post more info, like screenshots of your BRF entries so people can check your flags, your code (it is common to make mistakes like the wrong name of a texture), etc.

one problem at time.
 
Me again sorry.
I spent all yesterday reading up on dialog etc to understand why my script doesn't work but I cannot get it to work or understand how so I have come to the conclusion its just to advanced for me so I have to find something I am capable of doing.
module trigger right at the end
(24, 0, ti_once, #Checks every 24 hours, delay interval for trigger is 0 hours and the trigger launches only once.
[
(store_current_day, ":cur_day"), #Store the current day.
(eq, ":cur_day", 365), #Get the current day. Trigger check interval MUST be 24 hours for this.
],
[
      (store_random_in_range, ":town_no", towns_begin,towns_end), #Gets 1 random town from the given list.
  (set_spawn_radius, 4),
    (try_for_range, ":unused", 0, 1), # spawn one party
          (spawn_around_party, ":town_no", "pt_barbarians"),
    (party_set_ai_behavior,reg(2),ai_bhvr_patrol_location),
(display_message, "@Rumours from passing traveller - A large band of barbarians led by Warlord Perus have landed near (town_no)",0x00FF00),
    (try_end)]),
my hope is this will spawn after 365 days only once and at a random town where they will patrol and attack anything in sight.
It compiles which is a miracle after yesterday but I know that means nothing so before I test in game and wait for 365  days, have I done something right.
Many thanks for everyone help so far and sorry I frustrate people with not understanding there help.
 
Got the screenshots,but how to insert the images?Do I need to upload it to google first and insert the link of that image or?
 
markfamily said:
It compiles which is a miracle after yesterday but I know that means nothing so before I test in game and wait for 365  days, have I done something right.
Why do you say wait 365 to test if you can do your tests when you want?
Replace:
(24, 0, ti_once,
With:
(1, 0, 0,
It also removes the conditions of the first trigger block.
You don't need to perform a 'try_for_range' operation.
I also tell you that it will not work, an operation is not well defined, I give you a hint, 'spawn_around_party'.
Everything you type in 'display_message' will be saved as text, only previously defined values, register values (reg1) or string values (s1) will be modified, (town_no) will not do the trick. Define it first.
 
markfamily said:
Code:
 (24, 0, ti_once, #Checks every 24 hours, delay interval for trigger is 0 hours and the trigger launches only once.
	 [
		(store_current_day, ":cur_day"), #Store the current day.
		(eq, ":cur_day", 365), #Get the current day. Trigger check interval MUST be 24 hours for this.
	 ],
	 [
      (store_random_in_range, ":town_no", towns_begin,towns_end), #Gets 1 random town from the given list.
   (set_spawn_radius, 4),
     (try_for_range, ":unused", 0, 1), # spawn one party
           (spawn_around_party, ":town_no", "pt_barbarians"),
    (party_set_ai_behavior,reg(2),ai_bhvr_patrol_location),
	(display_message, "@Rumours from passing traveller - A large band of barbarians led by Warlord Perus have landed near (town_no)",0x00FF00),
     (try_end)]),

first fix your indentation. It makes your code hard to read to everyone, including you.

Code:
(24, 0, ti_once, 
  [
    (store_current_day, ":cur_day"), 
    (eq, ":cur_day", 365), 
  ],
  [
    (store_random_in_range, ":town_no", towns_begin,towns_end), 
    (set_spawn_radius, 4),
    (try_for_range, ":unused", 0, 1), 
      (spawn_around_party, ":town_no", "pt_barbarians"),
      (party_set_ai_behavior,reg(2),ai_bhvr_patrol_location),
      (display_message, "@Rumours from passing traveller - A large band of barbarians led by Warlord Perus have landed near (town_no)",0x00FF00),
    (try_end)
  ]
),

adding to Dj_FRedy comments:
1) why are you using a loop to execute one cycle? That doesnt do anything at all. Does it break anything? No. Just a line of code that does nothing at all. I am commenting on this because it seems you dont understand what are loops for, so I recommend you review the tutorial on this part, as it is one of the fundamentals for coding.
2) your comments are not bad, but also not good. As they are obvious (they just put in text what the code already tells you). It is fine to do that as you are a beginner, just keep in mind you dont need to do that as you get more comfortable with reading MBScript.
  what you should comment is WHAT you are trying to do. What does this trigger feature is for. That is the kind of stuff you will forget after a week, and other people will have no idea what you were thinking about.
  # event for invasion of XXXX after one year
  ^ example
3)
Code:
(eq, ":cur_day", 365),
  this is dangerous. Best to use a "ge" instead to prevent your code breaking if you change the scheduler in the future.
4)
Code:
(spawn_around_party, ":town_no", "pt_barbarians"),
(party_set_ai_behavior,reg(2),ai_bhvr_patrol_location),
  look at spawn_around_party description. What register it uses to store the party_id ? Hint: it is not reg2
  this reg(2) is the same as reg2 btw, it is the old syntax from M&B, not Warband.
5) on display_message, read this https://forums.taleworlds.com/index.php/topic,347990.msg8335287.html#msg8335287

 
Has anyone run into this problem? You make a castle map with a hill and when you take a walk on that hill you run into lots of invisible walls and suddenly walk 10 feet above the ground...it's really weird and annoying. How do you fix it?

BCCFDE2A57C034540B0C0D18FBC463801571821B

FB0A1F34B5DFE54E86E7E6BF7AE0139AF7EEA2D1

6AE0232AB8113F4CE05BE5A76E15188AF438E819
 
Dj_FRedy said:
markfamily said:
It compiles which is a miracle after yesterday but I know that means nothing so before I test in game and wait for 365  days, have I done something right.
Why do you say wait 365 to test if you can do your tests when you want?
Sorry sounds daft my logic was so i knew it spawned on day 365 and for a brief moment I actually thought I did it right i just keep on assuming if it compiles its right.
##invasion script
(24, 0, ti_once, #Checks every 24 hours, delay interval for trigger is 0 hours and the trigger launches only once.
  [(store_current_day, ":cur_day"), #Store the current day.
  (eq, ":cur_day", 365),], #spawn on day 365
  [(store_random_in_range, ":town_no", towns_begin,towns_end), #Gets 1 random town from the given list.
  (assign, reg1, ":town_no"),
  (set_spawn_radius,4),(spawn_around_party,":town_no","pt_barbarians"),
    (party_set_ai_behavior,"pt_barbarians",ai_bhvr_patrol_location),
(display_message, "@Rumours from passing traveller - A large band of barbarians led by Warlord Perus have landed near (reg1)",0x00FF00),
    (try_end)]),
Just read through https://forums.taleworlds.com/index.php/topic,142422.0.html on loops is there a more basic version for a have no clue learner like me.
Thank you all again for your help and understanding.
I wont be changing the scheduler that sounds way to complicated for me at the moment
 
Is there a particuar reason that the disband button no longer works after altering the troop tree structure?

Via module_system, I've moved Swadian Knights to tier 6, equivalent to the tier of a Nord Huscarl. After that, it seens the disband option is no longer clickable.

I've tested, and it does not affect the Nord Huscarls, who are the only other native tier 6 troop present in my game. So far, no clue on what is causing this issue.

I do know that somewhere on the module system (though I can't remember for my life on what module file it is), Swadian Knights are declared as tier 5 troops for the swadian kingdom, and Nord Huscarls are declared as tier 6 troops for the nordic kingdom.

Could this be related to it, and thus a resolution would be to rework this piece of code to include Swadian Knights as the swadian tier 6 unit?

I also read a bit about a limit on troop number on a mod, that might cause a similar issue. Is this true?
EDIT: nevermind, it seens I set the troop to have the tf_unmoveable_on_party_window by mistake, so I could not disband it.
 
If you allow me the irony, markfamily, in the end we're going to have to turn this into a 'Make your first script in MB-Modsys' exercise, you've looked for it when posting, so don't get angry if they joke about it. It's what you get by building the house starting with the roof, which collapses because it doesn't have a foundation.

Now pay attention because this is the exercise:

- Try to properly Indent the code of your script
- Use the conditional operation 'ge' instead of 'eq'.
- Define the operation 'spawn_around_party' correctly, e.g:
(spawn_around_party, ":town_no", "pt_barbarians"),
(assign, ":new_party", reg0),
- Restructure the operation 'party_set_ai_behavior', e.g:
(party_set_ai_behavior, ":new_party", ai_bhvr_patrol_location),
- In the operation 'display_message' try to correct the following error:
Replace
(reg1)
With:
{reg1}
- Remove '(try_end)' from the script

Do you realize what I mean when I tell you about the construction of the house? In 2 weeks you can not pretend to codify at this level, you will have to study much more theoretical if you do not want to end up frustrating and wasting valuable time. That's my humble advice.

And now, I urge you to present the exercise, we'll see how you've done.
Peace!



 
I need a trigger that automatically changes the name of a certain troop, like: trp_custom_bandit

Into one random name, choosen from a list of strings. As an example, then whenever the party containing trp_custom_bandit is spawned, the trigger will automatically change the in-game name of the troop from "Custom Bandit" into either "Gelmarr", "Golmarr" or "Gylmarr".

I remember there being a piece of code that did this ages ago, but can't remember exactly where I found it. Anyone got a clue?
 
I solved my problem!The main issue of meshes not working right was because I set their flags into AA000,when I returned the flags to 0,everything went as it should be.I knew something small was causing that big issue..
 
Status
Not open for further replies.
Back
Top Bottom