Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
The texture is here: http://oi58.tinypic.com/33kq2oj.jpg the resource: http://oi62.tinypic.com/sv30ok.jpg I dont understand whats going on shouldnt something be showing here? http://oi61.tinypic.com/a1jm7k.jpg
 
Appearing very bright in-game: http://oi60.tinypic.com/inyk28.jpg
                                                  http://oi60.tinypic.com/epnnsz.jpg
Any help please guys?
 
abdoul said:
Appearing very bright in-game: http://oi60.tinypic.com/inyk28.jpg
                                                  http://oi60.tinypic.com/epnnsz.jpg
Any help please guys?

What shaders are you using? You can always duplicate an existing model template and use the information stored there.
 
Yeah you were right it was the shader cheers. Still don't understand why the texture doesn't appear in openBRF http://oi61.tinypic.com/a1jm7k.jpg
 
Quick question: Why does the rename presentation never opens in game after clicking "Yes"?

This is the game_menu part, which should open a village rename window after clicking "Yes", but instead it goes straight back to mnu_town.
(
"village_purchase_confirmation",0,
"The construction of this village will cost us 10.000. Shall I give the orders?",
"none",
[],
[
("confirm_yes", [], "Yes",
[(store_troop_gold, ":gold_amount", "trp_player"),
(try_begin),
(ge, ":gold_amount", 10000),
(assign, "$g_build_village", 1),      #might have to limit construction to 1 village at a time
(assign, "$g_current_town", "$current_town"),
(troop_remove_gold, "trp_player", 10000),
(assign, "$g_village_to_rename", "$g_unpurchased_village"),
(party_set_slot, "$current_town", slot_village_was_purchased, 1),
                      #F&B begin trying build time via slots
                        (party_set_slot, "$g_encountered_party", slot_center_build_village, slot_center_village_build),
                        (store_current_hours, ":cur_hours"),
                        (assign, ":hours_takes", 24),
                        (val_add, ":hours_takes", ":cur_hours"),
                        (party_set_slot, "$g_encountered_party", slot_center_build_end_hour, ":hours_takes"),
                      #F&B end trying build time via slots
(start_presentation, "prsnt_set_party_name3"),  #dunno why the village rename keeps breaking
(jump_to_menu, "mnu_town"),
(else_try),
(lt, ":gold_amount", 10000),
(display_message, "@You can't afford to build a village!"),
(else_try),
(display_message, "@You cannot build more villages."),
(try_end),
],),
("confirm_no", [], "No", [(jump_to_menu, "mnu_town")],),
],),
 
@Fire_and_blood it is because you have this "(jump_to_menu, "mnu_town")," right after starting the presentation. You need to jump to menu after the presentation is done (from presentation itself or you could jump to the menu, then the next line open that presentation (put start presentation after jump to menu) (idk about this...is just a guess on how menus and presentations works)).
 
There's a weird issue when reassigning villages to a new town. Right after a village gets rebinded, the game starts throwing errors regarding prosperity calculation.
Does anyone know why this happens? I haven't touched the script calculate_castle_prosperities_by_using_its_villages at all.

Recent Messages log:
Village has been rebound to Grantebrycge
SCRIPT WARNING: Division by zero, LINE NO:11,
At script: calculate_castle_prosperities_by_using_its_villages.

This is the code I use to reassign the village:
        (assign, ":min_dist", 999999),
        (assign, ":min_dist_town", -1),
        (try_for_range, ":cur_town", towns_begin, towns_end),
          (store_distance_to_party_from_party, ":cur_dist", "$g_unpurchased_village", ":cur_town"),
          (lt, ":cur_dist", ":min_dist"),
          (assign, ":min_dist", ":cur_dist"),
          (assign, ":min_dist_town", ":cur_town"),
        (try_end),
(str_clear, s0),
(str_store_party_name, s0, ":min_dist_town"),
(display_log_message, "@Village has been rebound to {s0}"),
        (party_set_slot, "$g_unpurchased_village", slot_village_bound_center, ":min_dist_town"),
 
That error is caused by a store_div or val_div with 0. The piece of code that you posted isn't producing the error; the error is produced somewhere in the following lines after that.
 
There is no other code with store_div and val_div.

This is the whole script, I run for building a village.
     
("build_village",
[
(party_relocate_near_party, "$g_unpurchased_village", "$g_current_town", "$g_village_build_dist"),
(party_set_slot, "$g_unpurchased_village", slot_party_type, spt_village),
(call_script, "script_give_center_to_lord", "$g_unpurchased_village", "trp_player", 0),
(enable_party, "$g_unpurchased_village"),
(party_set_note_available, "$g_unpurchased_village", 1),
#F&B reassign village to nearest town
(party_set_slot, "$g_unpurchased_village", slot_village_bound_center, 0),
        (assign, ":min_dist", 999999),
        (assign, ":min_dist_town", -1),
        (try_for_range, ":cur_town", towns_begin, towns_end),
          (store_distance_to_party_from_party, ":cur_dist", "$g_unpurchased_village", ":cur_town"),
          (lt, ":cur_dist", ":min_dist"),
          (assign, ":min_dist", ":cur_dist"),
          (assign, ":min_dist_town", ":cur_town"),
        (try_end),
(str_clear, s0),
(str_store_party_name, s0, ":min_dist_town"),
(display_log_message, "@Village has been rebound to {s0}"),
        (party_set_slot, "$g_unpurchased_village", slot_village_bound_center, ":min_dist_town"),
#F&B reassign end
(party_set_slot, "$g_unpurchased_village", slot_center_is_purchased, 1),
(try_for_range_backwards, ":party_no", "p_village_213", "p_salt_mine"),
(party_slot_eq, ":party_no", slot_center_is_purchased, 1),
(else_try),
(assign, "$g_unpurchased_village", ":party_no"),
(try_end),
]),

Maybe it is not enough to just change slot_village_bound_center.
 
Your code makes one or more castles to have no villages. Native's scripts have a convention that each castle have at least 1 village.

The error is produced in script calculate_castle_prosperities_by_using_its_villages, this line to be more specific:
(store_div, ":castle_prosperity", ":total_prosperity", ":total_villages"),
As you can see, division by 0 implies the fact that ":total_villages" will be 0 resulting that one castle has no villages.
 
Thank you.

My villagers were walking across half the map to the town they where previously bound to, so I thought slot_village_bound_center should be used to rectify that. But it's actually slot_village_market_town, which should have been used. Works without errors now.


Edit:
Is there a way to check, whether the flag pf_disabled is true for a given party? In header_operations, there's only party_set_flags, but no party_get_flags.
 
In the Vikingr mod, when on horseback you can switch a lance to throwing mode using the "p" key. I'm assuming this is related to WSE. Is there any way I can replicate a similar function without using WSE? i.e. Have a lance that you can thrust with using left mouse, you can couch with X, and if you want to throw it, you can by pressing another key to switch its mode.

I'm going to assume doing so without WSE is not possible.
 
You can swap it back and forth between lance and thrown modes at any time. AI can do it too.

And if your lance weapon is defined as couchable, you'll be able to couch it in melee mode.

Essentially, your only restrictions are:

1. Both items mush share the same mesh.
2. Items must have different itp_type_* values.
3. Second entry must be a melee weapon (i.e. not a bow, crossbow or thrown).
 
You both have more experience at this than I do, so I shall defer to your superior knowledge. I just would think that the swap mode would make it so it just goes back and forth between throwing and melee. I wouldn't have figured that this would let me do it and keep lance control at manual instead of automatic.

[Edit]

I've tried putting it in and while initially the weapon is throwable, when I switch its mode, it turns to a regular polearm instead of a lance and I can't couch it (even with automatic), nor can I switch it back to a throwing weapon. Here's my code:

Code:
["cavalry_lance_throw",         "Cavalry Lance", [("cavalry_lance",0)], itp_type_thrown |itp_merchandise|itp_primary|itp_next_item_as_melee ,itcf_throw_javelin, 
80, weight(4)|difficulty(0)|spd_rtng(85) | shoot_speed(20) | thrust_damage(28 ,  pierce)|max_ammo(1)|weapon_length(126),imodbits_thrown ],
["cavalry_lance",         "Cavalry Lance", [("cavalry_lance",0)], itp_couchable|itp_type_polearm|itp_offset_lance|itp_merchandise| itp_primary|itp_penalty_with_shield|itp_wooden_parry, itc_cutting_spear,
 80 , weight(1)|difficulty(0)|spd_rtng(85) | weapon_length(126)|swing_damage(16 , blunt) | thrust_damage(28 ,  pierce),imodbits_polearm ],
 
Status
Not open for further replies.
Back
Top Bottom