Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
HungKnight said:
how the Stones are flying then it does psys_torch_smoke and psys_torch_smoke ? , please help me
sorry my english bad  :mrgreen:  :mrgreen:  :mrgreen:
You can't do flying particles in normal Warband- see the various fire arrow scripts for more info.
heydiddlediddle said:
A quick question. I'm trying to choose a random troop. My goal would be to have a random troop type (from within a set of choices) chosen to be recruit-able in the village menu. So I guess I'm wondering is there something I could call to make this random choice? Or is what I'm thinking of even possible? I've been poking around with little luck so far...
If you look at the existing scripts where the recruit troop is chosen, you can see that there's a chance for it to be the upgrade troop depending on the player's relationship with the village. Ultimately it's the troop id in the center's slot_center_volunteer_troop_type that becomes available for the player to recruit.
 
Somebody said:
heydiddlediddle said:
A quick question. I'm trying to choose a random troop. My goal would be to have a random troop type (from within a set of choices) chosen to be recruit-able in the village menu. So I guess I'm wondering is there something I could call to make this random choice? Or is what I'm thinking of even possible? I've been poking around with little luck so far...
If you look at the existing scripts where the recruit troop is chosen, you can see that there's a chance for it to be the upgrade troop depending on the player's relationship with the village. Ultimately it's the troop id in the center's slot_center_volunteer_troop_type that becomes available for the player to recruit.
Thanks a bunch, I appreciate it. I think I'll have a follow up conundrum here shortly (i.e. trying to pull random troops from two different troop trees) but that was a big help in the right direction.
 
Ikaguia said:
"script_multiplayer_event_mission_end"

also, you should look into module_mission_templates for the triggers that end the maps so that the code doesn't run in the last round
I looked into missions but not found a way to check if the end of round is equal to the end of map.
What i want is the script execute at end of each round but not if this end is equal to the end of map.
 
Somebody said:
HungKnight said:
how the Stones are flying then it does psys_torch_smoke and psys_torch_smoke ? , please help me
sorry my english bad  :mrgreen:  :mrgreen:  :mrgreen:
You can't do flying particles in normal Warband- see the various fire arrow scripts for more info.
thank but
me  find fire arrow (http://mbmodwiki.ollclan.eu/Fire_arrow_kit#Script) but it name error 'ti_on_init_missile' is not defined  :v lol @@ , helps me
sorry my english bad  :mrgreen:  :mrgreen:
 
Somebody said:
It's only a problem if the center doesn't have a valid banner icon, corresponding to the owner's slot_troop_banner_scene_prop.
so ?

should i add some things ?

also,scene objects can be animated ?
for example;
how can i animate the simple tree as in developer's blog 8's video's.
if yes,how ?
 
You are very limited in scene prop animations in Warband - you can move them, resize them and rotate them. That's all. Patch 1.161 promises to introduce vertex animation, similar to that of global map icons. With this patch it should become possible to make animated trees.
 
Okay,anyone knows why it happening that ?
With detailed feedback please  :roll:
HyperCharge said:
vonboD.jpg

the code;
Code:
# script_give_center_to_lord
  # Input: arg1 = center_no, arg2 = lord_troop, arg3 = add_garrison_to_center
  ("give_center_to_lord",
    [
      (store_script_param, ":center_no", 1),
      (store_script_param, ":lord_troop_id", 2), #-1 only in the case of a player deferring ownership of a center
      (store_script_param, ":add_garrison", 3),

	  (try_begin),
	    (eq, "$cheat_mode", 1),
		(ge, ":lord_troop_id", 0),
		(str_store_party_name, s4, ":center_no"),
		(str_store_troop_name, s5, ":lord_troop_id"),
		(display_message, "@{!}DEBUG -- {s4} awarded to {s5}"),
	  (try_end),
	  
	  (try_begin),
	    (eq, ":lord_troop_id", "trp_player"),
	    (unlock_achievement, ACHIEVEMENT_ROYALITY_PAYMENT),
	    
	    (assign, ":number_of_fiefs_player_have", 1),
	    (try_for_range, ":cur_center", centers_begin, centers_end),
	      (neq, ":cur_center", ":center_no"),
	      (party_slot_eq, ":cur_center", slot_town_lord, "trp_player"),
	      (val_add, ":number_of_fiefs_player_have", 1),
	    (try_end),
	    
	    (ge, ":number_of_fiefs_player_have", 5),
	    (unlock_achievement, ACHIEVEMENT_MEDIEVAL_EMLAK),	    
	  (try_end),
	  
      (party_get_slot, ":old_lord_troop_id", ":center_no", slot_town_lord),
      
	  (try_begin), #This script is ONLY called with lord_troop_id = -1 when it is the player faction 
	    (eq, ":lord_troop_id", -1),
	    (assign, ":lord_troop_faction", "fac_player_supporters_faction"),
        (party_set_banner_icon, ":center_no", 0),#Removing banner
		
      (else_try),	
	    (eq, ":lord_troop_id", "trp_player"),
	    (assign, ":lord_troop_faction", "$players_kingdom"), #was changed on Apr 27 from fac_plyr_sup_fac

      (else_try),	  
		(store_troop_faction, ":lord_troop_faction", ":lord_troop_id"),
	  (try_end),	
	  (faction_get_slot, ":faction_leader", ":lord_troop_faction", slot_faction_leader),

	  (try_begin),
	    (eq, ":faction_leader", "trp_player"),

        (try_begin),
            (troop_get_type, ":is_female", "trp_player"),
            (eq, ":is_female", 1),
            (unlock_achievement, ACHIEVEMENT_QUEEN),
        (try_end),
	  (try_end),
	  
	  (try_begin),
		(eq, ":faction_leader", ":old_lord_troop_id"),
		(call_script, "script_add_log_entry", logent_liege_grants_fief_to_vassal, ":faction_leader", ":center_no", ":lord_troop_id", ":lord_troop_faction"),
        (troop_set_slot, ":lord_troop_id", slot_troop_promised_fief, 0),		
	  (try_end),

      (try_begin),
	    (eq, ":lord_troop_id", -1), #Lord troop ID -1 is only used when a player is deferring assignment of a fief
        (party_set_faction, ":center_no", "$players_kingdom"),
	  (else_try),
        (eq, ":lord_troop_id", "trp_player"),
        (gt, "$players_kingdom", 0),
        (party_set_faction, ":center_no", "$players_kingdom"),
      (else_try),
        (eq, ":lord_troop_id", "trp_player"),
        (neg|is_between, "$players_kingdom", kingdoms_begin, kingdoms_end),
        (party_set_faction, ":center_no", "fac_player_supporters_faction"),
      (else_try),
        (party_set_faction, ":center_no", ":lord_troop_faction"),
      (try_end),
      (party_set_slot, ":center_no", slot_town_lord, ":lord_troop_id"),

      (try_begin),
        (party_slot_eq, ":center_no", slot_party_type, spt_village),
        (party_get_slot, ":farmer_party_no", ":center_no", slot_village_farmer_party),
        (gt, ":farmer_party_no", 0),
        (party_is_active, ":farmer_party_no"),
        (store_faction_of_party, ":center_faction", ":center_no"),
        (party_set_faction, ":farmer_party_no", ":center_faction"),
      (try_end),

    (try_begin),
        (this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town),
			(party_slot_eq, ":center_no", slot_party_type, spt_castle),
		(gt, ":lord_troop_id", -1),
		
#normal_banner_begin
        (troop_get_slot, ":cur_banner", ":lord_troop_id", slot_troop_banner_scene_prop),
        (gt, ":cur_banner", 0),
        (val_sub, ":cur_banner", banner_scene_props_begin),
        (val_add, ":cur_banner", banner_map_icons_begin),
        (party_set_banner_icon, ":center_no", ":cur_banner"),
# custom_banner_begin
#        (troop_get_slot, ":flag_icon", ":lord_troop_id", slot_troop_custom_banner_map_flag_type),
#        (ge, ":flag_icon", 0),
#        (val_add, ":flag_icon", custom_banner_map_icons_begin),
#        (party_set_banner_icon, ":center_no", ":flag_icon"),
    (try_end),

#    (try_begin),
#		(eq, 1, 0),
 #       (eq, ":lord_troop_id", "trp_player"),
 #       (neq, ":old_lord_troop_id", "trp_player"),
 #       (party_get_slot, ":center_relation", ":center_no", slot_center_player_relation),
 #       (is_between, ":center_relation", -4, 5),
 #       (call_script, "script_change_player_relation_with_center", ":center_no", 5),
 #       (gt, ":old_lord_troop_id", 0),
 #       (call_script, "script_change_player_relation_with_troop", ":old_lord_troop_id", -25),
 #   (try_end),
	(try_begin),
		(gt, ":lord_troop_id", -1),
		(call_script, "script_update_troop_notes", ":lord_troop_id"),
	(try_end),
	
    (call_script, "script_update_center_notes", ":center_no"),
    
    (try_begin),
      (gt, ":lord_troop_faction", 0),
      (call_script, "script_update_faction_notes", ":lord_troop_faction"),
    (try_end),  
    
    (try_begin),
        (ge, ":old_lord_troop_id", 0),
        (call_script, "script_update_troop_notes", ":old_lord_troop_id"),
        (store_troop_faction, ":old_lord_troop_faction", ":old_lord_troop_id"),
        (call_script, "script_update_faction_notes", ":old_lord_troop_faction"),
    (try_end),

    (try_begin),
        (eq, ":add_garrison", 1),
        (this_or_next|party_slot_eq, ":center_no", slot_party_type, spt_town),
			(party_slot_eq, ":center_no", slot_party_type, spt_castle),
        (assign, ":garrison_strength", 3), 
        (try_begin),
          (party_slot_eq, ":center_no", slot_party_type, spt_town),
          (assign, ":garrison_strength", 9),
        (try_end),
        (try_for_range, ":unused", 0, ":garrison_strength"),
          (call_script, "script_cf_reinforce_party", ":center_no"),
        (try_end),
        ## ADD some XP initially
        (try_for_range, ":unused", 0, 7),
          (store_mul, ":xp_range_min", 150, ":garrison_strength"),
          (store_mul, ":xp_range_max", 200, ":garrison_strength"),
          (store_random_in_range, ":xp", ":xp_range_min", ":xp_range_max"),
          (party_upgrade_with_xp, ":center_no", ":xp", 0),
        (try_end),
    (try_end),

	(faction_get_slot, ":faction_leader", ":lord_troop_faction", slot_faction_leader),
	(store_current_hours, ":hours"),
	
	#the next block handles gratitude, objections and jealousies
	(try_begin),
	  	(gt, ":hours", 0),
		(gt, ":lord_troop_id", 0),
		
    	(call_script, "script_troop_change_relation_with_troop", ":lord_troop_id", ":faction_leader", 10),
		(val_add, "$total_promotion_changes", 10),
		
		#smaller factions are more dramatically influenced by internal jealousies
		#Disabled as of NOV 2010
#		(try_begin),
#			(neg|faction_slot_ge, ":lord_troop_faction", slot_faction_number_of_parties, 4),
#			(assign, ":faction_size_multiplier", 6),
#		(else_try),
#			(neg|faction_slot_ge, ":lord_troop_faction", slot_faction_number_of_parties, 8),
#			(assign, ":faction_size_multiplier", 5),
#		(else_try),
#			(neg|faction_slot_ge, ":lord_troop_faction", slot_faction_number_of_parties, 16),
#			(assign, ":faction_size_multiplier", 4),
#		(else_try),
#			(neg|faction_slot_ge, ":lord_troop_faction", slot_faction_number_of_parties, 32),
#			(assign, ":faction_size_multiplier", 3),
#		(else_try),	
#			(assign, ":faction_size_multiplier", 2),
#		(try_end),
		
		#factional politics -- each lord in the faction adjusts his relation according to the relation with the lord receiving the faction
		(try_for_range, ":other_lord", active_npcs_begin, active_npcs_end),
			(troop_slot_eq, ":other_lord", slot_troop_occupation, slto_kingdom_hero),
			(neq, ":other_lord", ":lord_troop_id"),
			
		    (store_troop_faction, ":other_troop_faction", ":other_lord"),
		    (eq, ":lord_troop_faction", ":other_troop_faction"),

		    (neq, ":other_lord", ":faction_leader"),
			
	        (call_script, "script_troop_get_relation_with_troop", ":other_lord", ":lord_troop_id"),
			(assign, ":relation_with_troop", reg0),

			#relation reduction = relation/10 minus 2. So,0 = -2, 8 = -1, 16+ = no change or bonus, 24+ gain one point
		    (store_div, ":relation_with_liege_change", ":relation_with_troop", 8), #changed from 16
		    (val_sub, ":relation_with_liege_change", 2),

		    (val_clamp, ":relation_with_liege_change", -5, 3),
			
			(try_begin),
				#upstanding and goodnatured lords will not lose relation unless they actively dislike the other lord
				(this_or_next|troop_slot_eq, ":other_lord", slot_lord_reputation_type, lrep_upstanding),
					(troop_slot_eq, ":other_lord", slot_lord_reputation_type, lrep_goodnatured),
				(ge, ":relation_with_troop", 0),
				(val_max, ":relation_with_liege_change", 0),
			(else_try),
				#penalty is increased for lords who have the more unpleasant reputation types
				(this_or_next|troop_slot_eq, ":other_lord", slot_lord_reputation_type, lrep_selfrighteous),
				(this_or_next|troop_slot_eq, ":other_lord", slot_lord_reputation_type, lrep_debauched),
					(troop_slot_eq, ":other_lord", slot_lord_reputation_type, lrep_quarrelsome),
				(lt, ":relation_with_liege_change", 0),
				(val_mul, ":relation_with_liege_change", 3),
				(val_div, ":relation_with_liege_change", 2),
			(try_end),

			
		    (neq, ":relation_with_liege_change", 0),
			#removed Nov 2010
#		  	(val_mul, ":relation_reduction", ":faction_size_multiplier"),
#		  	(val_div, ":relation_reduction", 2),
			#removed Nov 2010
			
			(try_begin),
				(troop_slot_eq, ":other_lord", slot_troop_stance_on_faction_issue, ":lord_troop_id"),
				(val_add, ":relation_with_liege_change", 1),
				(val_max, ":relation_with_liege_change", 1),
			(try_end),
			
 	        (call_script, "script_troop_change_relation_with_troop", ":other_lord", ":faction_leader", ":relation_with_liege_change"),
			(val_add, "$total_promotion_changes", ":relation_with_liege_change"),
			
		    (try_begin),
				(this_or_next|le, ":relation_with_liege_change", -4), #Nov 2010 - changed from -8
				(this_or_next|troop_slot_eq, ":other_lord", slot_troop_promised_fief, 1), #1 is any fief
					(troop_slot_eq, ":other_lord", slot_troop_promised_fief, ":center_no"),
				(call_script, "script_add_log_entry", logent_troop_feels_cheated_by_troop_over_land, ":other_lord", ":center_no", ":lord_troop_id", ":lord_troop_faction"),
		    (try_end),
		  
		(try_end),
	(try_end),
	
	#Villages from another faction will also be transferred along with a fortress
    (try_begin),
		(is_between, ":center_no", walled_centers_begin, walled_centers_end),
        (try_for_range, ":cur_village", villages_begin, villages_end),
			(party_slot_eq, ":cur_village", slot_village_bound_center, ":center_no"),
			(store_faction_of_party, ":cur_village_faction", ":cur_village"),
			(neq, ":cur_village_faction", ":lord_troop_faction"),
			
			(call_script, "script_give_center_to_lord", ":cur_village", ":lord_troop_id", 0),
        (try_end),
    (try_end),       
  ]),

also,How can i do "write a BATTLE WON! word.With green colors" ? i think its already have in fire arrow.I cant found on fire arrow's module.I researched any word of any sentences.can anyone find it ? or,if already founded,can give me topic or,location of this presentation(or what :S) ?

Also;

Lav said:
You are very limited in scene prop animations in Warband - you can move them, resize them and rotate them. That's all. Patch 1.161 promises to introduce vertex animation, similar to that of global map icons. With this patch it should become possible to make animated trees.
But,it already have in Napoleonic Wars ? can be port to WB ?

 
http://mbmodwiki.ollclan.eu/Fire_arrow_kit#Script but it name error 'ti_on_init_missile' is not defined  :v lol @@ , helps me
sorry my english bad  :mrgreen:  :mrgreen:
 
Is it possible to set direct x 7 water to appear in direct x 9 as well? I like the fantasy look of direct x 7 water.
 
Shcherbyna said:
Is there a way to choose different mount animations in scripts?
You could take your body/hand/head/foot/armor on and off very frequently to change the meshes using the new beta's cur_item_add_mesh, making it look like the agent is animating differently, but I'm not sure if it's feasible.
 
Shcherbyna said:
Is there a way to choose different mount animations in scripts?

You can make all your custom mount animation with a higher priority than the mount animation.
Then make a ti_on_agent_mount trigger; inside it calculate which mount animation to use, then do agent_set_animation and your custom calculated animation.
 
I was wondering, is there any way to use drop a agent's shield and keeping the durability saved in that dropped item?
the only way I tought about doing it so far is saving the durability of the shield in a dummy troop slot, but there is no agent_get_item_slot_durability or even agent_set_item_slot_durability AFAIK.
 
Status
Not open for further replies.
Back
Top Bottom