Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Sherlock Holmes said:
is no 'Ammo' section of the UI or anything in the item code that would suggest so.

I don't know the code for this mod. Not sure either if that icon is dynamic or static. But if you want to check the code you should search on module_presentations.py.

A example is how VC uses a custom presentation to display the stamina text

Code:
("staminabar", prsntf_read_only|prsntf_manual_end_only, 0, [
    (ti_on_presentation_load, [
        (set_fixed_point_multiplier, 1000),
        
        (str_clear, s12),
        
        (create_text_overlay, "$stamina_bar", "@Stamina:", tf_center_justify),
        (overlay_set_color, "$stamina_bar", 0xDDDDDD),
        (position_set_x, pos1, 889),
        (position_set_y, pos1, 40),
        (overlay_set_position, "$stamina_bar", pos1),
        (position_set_x, pos1, 800),
        (position_set_y, pos1, 800),
        (overlay_set_size, "$stamina_bar", pos1),
        ##
        (get_player_agent_no,":player_agent"),
        (agent_is_active, ":player_agent"),
        (agent_is_alive,":player_agent"), #  test for alive players.
        (agent_is_human, ":player_agent"),
        (agent_get_slot, ":basic_stamina_i", ":player_agent", slot_agent_fatiga_inicial),
        (store_div, ":stamine_div10", ":basic_stamina_i", 10), #10 #
        (store_div, ":stamine_div2", ":basic_stamina_i", 2), #50%
        (store_mul, ":stamine_div3o4", ":basic_stamina_i", 3), #3/4
        (val_div, ":stamine_div3o4", 4),
        
        (agent_get_slot, ":basic_stamina", ":player_agent", slot_agent_fatiga),
        # (assign, reg0,":basic_stamina"),
        
        (try_begin),
          (lt, ":basic_stamina", 5),
          (str_store_string,s12,"@Exhausted"),
        (else_try),
          (lt, ":basic_stamina", ":stamine_div10"),
          (str_store_string,s12,"@Very Tired"),
        (else_try),
          (lt, ":basic_stamina", ":stamine_div2"),
          (str_store_string,s12,"@Tired"),
        (else_try),
          (lt, ":basic_stamina", ":stamine_div3o4"),
          (str_store_string,s12,"@Normal"),
        (else_try),
          (str_store_string,s12,"@High"),
        (try_end),
        
        (create_text_overlay, reg1, s12, tf_center_justify),
        (position_set_x, pos1, 800),
        (position_set_y, pos1, 800),
        (overlay_set_size, reg1, pos1),
        (position_set_x, pos1, 949),
        (position_set_y, pos1, 40),
        (overlay_set_position, reg1, pos1),
        (overlay_set_color, reg1, 0x0000bb), #azul
        
        (presentation_set_duration, 999999),
    ]),
    (ti_on_presentation_run,
      [
    ]),
]),
 
Sherlock Holmes said:
One thing I've not yet figured out is how the engine generates the item pictures on the bottom right. Obviously it is some sort of a 2D render(Same camera position) however with this particular item the 2D render certainly doesn't look like this way, and there is no 'Ammo' section of the UI or anything in the item code that would suggest so.
I'm talking about the laser icon in the bottom right:
A8BnEL5.jpg
I'm pretty sure that the icon always matches the
Code:
ixmesh_inventory
model for the ammunition item, probably referencing the default one if there isn't an inventory model defined. Call this an educated guess ("regular" gunpowder mods using the hidden musket and "cartridges" all usually use the cartridge inventory model for the icon). I might be wrong.
 
Is there a tutorial on mission templates?Now im comfortable wsith quests,dialogs,triggers,game menua and i almost know to male quests but mission templates are driving me crazy... I cant understand them on my own...
 
Why doesn't the start menu work on any mods when you are in battle... Brytenwalda, ACOK, etc? Pressing Esc goes only to options, you can't even exit if you are killed. Pretty hard to play when if you die you want to load and try again.
 
LootingScumbag said:
Why doesn't the start menu work on any mods

modders choice, as this is controlled on the code side

- avoids breaking quests
- avoids some bugs (depends on what the scene is doing)
- prevents exploits
....

you can change it on your own mod if you want. Just check Lav's header_operations.py for the operations that control it. You should already be reading the entire thingy anyway to know what the API can and can't do
 
Code:
 ("arena_duel_richard",mtf_arena_fight,-1,
 "Dueling Richard",
 (56,mtef_visitor_source|mtef_team_0,af_override_all,aif_start_alarmed,1,[itm_arena_tunic_blue,itm_practice_sword,itm_ankle_boots]),
 (58,mtef_visitor_source|mtef_team_2,af_override_all,aif_start_alarmed,1,[itm_arena_tunic_red,itm_practice_sword,itm_ankle_boots]),
  [common_inventory_not_available,
   (ti_tab_pressed,0,0, [(display_message,"@Richard:Trying to flee,little thief" )],[])
   (1,3, ti_once, [(main_hero_fallen),],
    [(quest_set_slot,"qst_praven_trouble",slot_quest_current_state,4), 
   (finish_mission),
	 ]
	 ),
     (2,3, ti_once, [(all_enemies_defeated,1),],
      [(quest_set_slot,"qst_praven_trouble",slot_quest_current_state,3),
       (remove_troop_from_site, "trp_npc17", "scn_town_6_tavern"),
       (finish_mission),
	   ]
	  ),
   ],
 ),
]
whats wrong with this mission template? I get tuple cant be called error on first finish mission tuple.And that last bracket is litteraly last in mission tempates...i didnt put it my mission template is last so i accidently  copied that bracket...
 
A python 'tuple' is basically everything in these brackets -> (). "Tuple object not callable" means that you've forgotten to put a comma at the end of the first trigger, which is the line with
Code:
ti_tab_pressed
.
 
DarkNord said:
whats wrong with this mission template?

if  you want to avoid those mistakes use a proper code indentation and a editor with Python color highlights. Even better, use Sublime Text with MBScript API.

that will change your code from "hurts my eyes" to "clean and easy to spot errors"
 
I already set up my colors and it looks awesome...and i actually did spot that comma mising but since i mostly followed some guy's  tutorial and he didnt put comma there i thought it should be like that...and when i got that error i knew i missed comma found it and put but then i get new error:
Error on mission templates (and now it shows code I already posted.just with some words replaced with numbers.)and since i dont know what this error means...someone has idea?
 
does anyone know how to disable the stumble and fall feature for brytenwalda, is the osp pack available? And is there anyway to make the start menu show instead of option menu when you press start in combat. If you are fighting in the arena then the start menu shows but when in battle with an army it goes to options. This is a great game but some things are really annoying. Stumble and fall is a great idea that was poorly executed. All npc's need to have this feature not just player and make it more realistic, i will be all by myself just walking around in low stress and stumble and fall, it is ridiculous.
 
kalarhan said:
LootingScumbag said:
Why doesn't the start menu work on any mods

modders choice, as this is controlled on the code side

- avoids breaking quests
- avoids some bugs (depends on what the scene is doing)
- prevents exploits
....

you can change it on your own mod if you want. Just check Lav's header_operations.py for the operations that control it. You should already be reading the entire thingy anyway to know what the API can and can't do

currently playing brytenwalda, which i guess uses floris, so id like to get the osp packs to fix some things, after i learn how of course
 
http://www71.zippyshare.com/v/FaealQSV/file.html
Here is text file with all explainations of my error.Sorry for posting it this way but i currently dont have internet connection on my pc so this is best way out...  :oops:
And looting scumbag im not sure but maybe if you check mission templates and fint the one responsible for tumbling and change "intervals" (those three starting numbers),(they say to game how often to check are conditions met but i didnt played brytenwalda for lot but i remember that he tumbles while going backwards...)
1=1 in-game hour and if he stumbles while walking through town and not battle i dont know what to say maybe those guys will know  :mrgreen:
They are pretty smart :fruity: :lol:
 
LootingScumbag said:
currently playing brytenwalda, which i guess uses floris

No. Brytenwalda and Floris are from the same age. They share some ideas and scripts developed by the community as OSP, but they don't use each others code.

Floris is a dev framework besides a mod. It has a good organization and documentation.

BW is a mod for players. The code is closer to Native (in organization).

You can get the 1.41 source for BW on their website. Just check the BW forum and the sticky threads there.
https://forums.taleworlds.com/index.php/topic,251745.0.html



LootingScumbag said:
does anyone know how to disable the stumble and fall feature for brytenwalda, is the osp pack available?

And is there anyway to make the start menu show instead of option menu

Answered above about BW. Look for triggers that check for usage of the back key (one suggestions) and other triggers on the MST.

And the menu is answered a couple posts back.






 
DarkNord said:
Anyone know the fix for error i posted above??

doubt, as you posted on a scamming site that is know for virus and other stuff. Not saying you are trying to do something bad, just they are.

use something clean like Dropbox or GoogleDrive, these old hosting sites are not good at all.
 
kalarhan said:
LootingScumbag said:
currently playing brytenwalda, which i guess uses floris

No. Brytenwalda and Floris are from the same age. They share some ideas and scripts developed by the community as OSP, but they don't use each others code.

Floris is a dev framework besides a mod. It has a good organization and documentation.

BW is a mod for players. The code is closer to Native (in organization).

You can get the 1.41 source for BW on their website. Just check the BW forum and the sticky threads there.
https://forums.taleworlds.com/index.php/topic,251745.0.html



LootingScumbag said:
does anyone know how to disable the stumble and fall feature for brytenwalda, is the osp pack available?

And is there anyway to make the start menu show instead of option menu

Answered above about BW. Look for triggers that check for usage of the back key (one suggestions) and other triggers on the MST.

And the menu is answered a couple posts back.

i went and got the source code from their thread but of course i am using the patch and also the graphic patch and if i edit the osp and recompile, do i need to apply those after? They don't really explain.
 
DarkNord said:
http://www71.zippyshare.com/v/FaealQSV/file.html
Here is text file with all explainations of my error.Sorry for posting it this way but i currently dont have internet connection on my pc so this is best way out...  :oops:
And looting scumbag im not sure but maybe if you check mission templates and fint the one responsible for tumbling and change "intervals" (those three starting numbers),(they say to game how often to check are conditions met but i didnt played brytenwalda for lot but i remember that he tumbles while going backwards...)
1=1 in-game hour and if he stumbles while walking through town and not battle i dont know what to say maybe those guys will know  :mrgreen:
They are pretty smart :fruity: :lol:

thanks for helping me find the relevant code...

Code:
#si anda hacia atras, player se cae chief
## Beaver - Mission Template for tripping when walking backwards - SP ONLY
common_andar_cae = (1, 0, 5, [ #Check every second, if conditions pass, only re-run after 5 sec
         (eq, "$sp_caer_andar", 1),
	(game_key_is_down,gk_move_backward), #Player moving backwards
	(neg|key_is_down,key_left_shift), #Don't trip if walking
        (neg|main_hero_fallen)
],
[

       (get_player_agent_no, ":player"),
       (agent_get_horse,":agent_mounted",":player"),
           (eq,":agent_mounted",-1),
      (store_skill_level, ":athletics_level", "skl_athletics", "trp_player"),
	(store_random_in_range,":percentage",0,100), #Get random percentage
   (try_begin),    #MOTO amounts to even 20% chance for athletics < 6...
##       (lt,":percentage",2), #10% risk of tripping
##      (agent_set_animation, ":player", "anim_strike_fall_back_rise"),
##      (display_message, "@You walk backwards without looking, you stumble and fall."),
##       (try_begin),
##       (eq,"$character_gender",tf_male),
##         (agent_play_sound, ":player", "snd_man_yell"),
##      (else_try),
##          (eq, "$character_gender", tf_female),
##         (agent_play_sound, ":player", "snd_woman_yell"),
##      (try_end),
##      (else_try),
##		(lt, ":athletics_level", 2),
##       (gt, ":percentage", 2),
##       (lt, ":percentage", 4),
##      (agent_set_animation, ":player", "anim_strike_fall_back_rise"),
##      (display_message, "@You stumble and fall."),
##       (try_begin),
##       (eq,"$character_gender",tf_male),
##         (agent_play_sound, ":player", "snd_man_yell"),
##      (else_try),
##          (eq, "$character_gender", tf_female),
##         (agent_play_sound, ":player", "snd_woman_yell"),
##      (try_end),
##      (else_try),
##		(lt, ":athletics_level", 4),
##       (gt, ":percentage", 4),
##       (lt, ":percentage", 6),
##      (agent_set_animation, ":player", "anim_strike_fall_back_rise"),
##      (display_message, "@You stumble and fall."),
##       (try_begin),
##       (eq,"$character_gender",tf_male),
##         (agent_play_sound, ":player", "snd_man_yell"),
##      (else_try),
##          (eq, "$character_gender", tf_female),
##         (agent_play_sound, ":player", "snd_woman_yell"),
##      (try_end),
##      (else_try),
##		(lt, ":athletics_level", 6),
##       (gt, ":percentage", 6),
##       (lt, ":percentage", 8),
##      (agent_set_animation, ":player", "anim_strike_fall_back_rise"),
##      (display_message, "@You stumble and fall."),
##       (try_begin),
##       (eq,"$character_gender",tf_male),
##         (agent_play_sound, ":player", "snd_man_yell"),
##      (else_try),
##          (eq, "$character_gender", tf_female),
##         (agent_play_sound, ":player", "snd_woman_yell"),
##      (try_end),
##      (else_try),
##        (display_message, "@"),
       (val_mul, ":athletics_level", 3),
       (store_sub, ":chance_trip", 23, ":athletics_level"),
       (lt, ":percentage", ":chance_trip"),    #chance to trip 20% athletics 0 down to 2% athletics 6 (0 above that)
       (agent_set_animation, ":player", "anim_strike_fall_back_rise"),
       (display_message, "@You stumble and fall."),
       (try_begin),
           (eq,"$character_gender",tf_male),
           (agent_play_sound, ":player", "snd_man_yell"),
       (else_try),
           (eq, "$character_gender", tf_female),
           (agent_play_sound, ":player", "snd_woman_yell"),
       (else_try),
           (agent_play_sound, ":player", "snd_man_yell"),
       (try_end),
       (try_end),
])
###andar hacia atras se cae chief acaba

now i know nothing about m&b language syntax but it appears this is like a void method declaration and the method name is common_andar_cae. I'm probably talking completely wrong but anyways I figure I can just delete this and then i assume common_andar_cae is referenced somewhere else and i would need to delete reference to this function variable??

i could just edit the interval times to make it never happen but id rather this code not get executed if possible instead? can't i just delete this?? and find the reference to common_andar_cae?

After compiling to I need to then apply the update patch? and if i am using the graphic patch, that too i assume? i hope they wouldnt overwrite the edited compiled files
 
LootingScumbag said:
i went and got the source code from their thread but of course i am using the patch and also the graphic patch and if i edit the osp and recompile, do i need to apply those after? They don't really explain.

1) Please don't copy quote a post. They are linked, keep only the important part. Either delete the rest or use spoiler tag

2) Answer is you can't. Either play your own 1.41 version, or the others. You can't use a source from one mod in another (unless you have enough tech know-how on the compiler). That was already explained earlier when talking about Native x Mods source code.

Yes that includes Repolished x 1.41, or Reworked x 1.41.

--> you may talk to the dev from Reworked and see if he can share the source code. Note that Reworked is very different from BW 1.41, they are not the same game (in terms of balance, etc)


LootingScumbag said:
I can just delete this and then i assume common_andar_cae is referenced somewhere else and i would need to delete reference to this function variable??
yes



LootingScumbag said:
what does MST mean?

module_mission_templates.py files



LootingScumbag said:
now i know nothing about m&b language syntax
you already got all the links for tutorials, so I will assume you still haven't read any of them. This means we need to wait until you do before talking about any real modding stuff (like usage of operations, etc)
 
Status
Not open for further replies.
Back
Top Bottom