Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Ikaguia said:
you're probably calling that script somewhere without using the 2 parameters

So how can I define this parameters here?

#TLD begin - do this only once
  # select what friendly faction was most interested in this victory (mtarini)
  (store_troop_faction, ":frakcja_gracza", "trp_player"),
  (assign, "$impressed_faction", ":frakcja_gracza"), # by default, it is player starting fatcion
  (store_faction_of_party, ":defeated_faction", "$g_enemy_party"),

      (str_store_faction_name, s4, ":defeated_faction"),
          #(display_log_message, "@DEBUG: player defeated a party of faction {s4}."),

  (call_script, "script_find_closest_enemy_town_or_host", ":defeated_faction", "p_main_party"),
          (assign, ":impressed_party", reg0),

  (try_begin),
  (ge, ":impressed_party", 0),
  (str_store_party_name, s3, ":impressed_party"),
  (store_faction_of_party, "$impressed_faction", ":impressed_party"),
  (try_begin),
                (is_between, ":impressed_party", centers_begin, centers_end),
                (display_message, "@Wieść o twoim zwycięstwie przeciwko {s4} dociera do {s3}.", 0x33DD33),
               
  (else_try),
(display_message, "@{s3} jest świadkiem twojego zwycięstwa przeciwko {s4}.", 0x33DD33),
  (try_end),
#(display_message, "@Debug: giving rank points for impressed faction."),  
            (call_script, "script_increase_rank", "$impressed_faction"),
  (else_try),
  #(display_log_message, "@DEBUG: nobody directly interested witnesses your victory."),
  (try_end),
         
#TLD end
 
I have a question concerning weapons. I'm using Caba'drin's code which allows your troops to switch weapons by using a keybind. I want spear armed troops to carry daggers or at least some other kind of sidearm, but to start with their spears equipped at the start of battle. It's not too big of a deal for the player since they can just order their units to switch to spears, but when facing an opponent in battle, the opposing side uses their sidearms instead of their spears and doesn't switch to the spear at all (I'm using one of the weapons break codes but limiting it to spears, but I haven't fully tested to see if their spears break that they'll then switch to another weapon in their inventory since they never use their spears as primary weapons).

I've tried just giving the weapons with only itp_secondary by itself, but that seems to be relatively useless resulting in the weapon unable even to be equipped by both the player and troops. Even with itp_secondary attached to these sidearms, and spears only having |itp_primary, itc_spear| they still equip their sidearms instead of spears.

Is there some other way that I could get this to work? Scripts maybe?
 
I was added ibanez's ballista codes to my mod.But,sometimes,firing itself even while im not controlling.

Code:

Code:
ballista_tick = (0, 0, ti_once, [],[(assign,"$balista_action",0),# 0 is none, 1 is in action, 2 fired, 3 reloading, 4 one second please:P
	(assign,"$balista_fire",0),
	(assign,"$missile_count",0), 
	(assign,"$missile_max",15),
	])  
ballista_action = (0, 0, 0, [(key_clicked, key_e),
			(eq,"$balista_action",0),
			(scene_prop_get_instance,":balista_instance", "spr_balista", 0), 
			(get_player_agent_no,":player_agent"),  
			(prop_instance_get_position,pos1,":balista_instance"),  
			(agent_get_position,pos2,":player_agent"), 
			(get_distance_between_positions,":distance",pos1,pos2), 
			(lt,":distance",750),    
			(mission_cam_set_mode,1),   
			(mission_cam_set_position, pos2),    
			(assign,"$balista_action",4)],
		  [(scene_prop_get_instance,":balista_instance", "spr_balista", 0), 
			(prop_instance_get_position,pos1,":balista_instance"),   
			(position_move_z,pos1,125),      
			(position_move_y,pos1,350),     
			(position_rotate_z,pos1,180),  
			(mission_cam_animate_to_position, pos1, 1000, 0), 
		]) 
ballista_enter = (0, 0, 0, [(key_clicked, key_f),(eq,"$balista_action",1)],
		  [(mission_cam_set_mode,0),
			(assign,"$balista_action",0),
		]) 
		
ballista_wtf = (0, 1, 0, [(eq,"$balista_action",4)],
		  [(assign,"$balista_action",1),
		])
ballista_missile_tick = (0, 0, 0, [(eq,"$balista_action",1)],
		  [(scene_prop_get_instance,":balista_instance", "spr_balista", 0), 
			(prop_instance_get_position,pos1,":balista_instance"),     
			(scene_prop_get_instance,":missile_instance", "spr_balista_missile", "$missile_count"),    
			(prop_instance_get_position,pos2,":balista_instance"),     
			(position_move_z,pos2,55),     
			(prop_instance_set_position,":missile_instance",pos2),  
			(position_move_z,pos1,125),      
			(position_move_y,pos1,350),        
			(position_rotate_z,pos1,180),     
			(mission_cam_set_position, pos1),
		]) 
ballista_rotate_something = (0, 0, 0, [(key_is_down, key_space),(eq,"$balista_action",1)],
		  [(assign,"$balista_action",2), 
			(scene_prop_get_instance,":balista_instance", "spr_balista", 0),        
			(prop_instance_get_position,pos1,":balista_instance"),       
			(position_move_z,pos1,500),     
			(position_move_y,pos1,350),  
			(position_rotate_z,pos1,180),   
			(mission_cam_animate_to_position, pos1, 1000, 0),   
		])      
ballista_misslie_check = (0, 0, 0, [],[(try_for_range,":missile_number",0,"$missile_count"),   
				(scene_prop_get_instance,":missile_instance", "spr_balista_missile", ":missile_number"),
				(prop_instance_get_position,pos1,":missile_instance"),    
				(prop_instance_get_position,pos2,":missile_instance"),
				(position_set_z_to_ground_level, pos2),       
				(get_distance_between_positions,":distance",pos1,pos2),  
				(try_begin),              
				(gt,":distance",5),       
				(position_move_y,pos1,-300),
				(position_rotate_x,pos1,1),  
                (prop_instance_animate_to_position,":missile_instance",pos1,10),        
				(get_player_agent_no,":player_agent"),    
				(try_for_agents,":agents"),          
				(agent_is_alive, ":agents"),         
				(agent_get_position,pos2,":agents"),         
				(get_distance_between_positions,":missile_hit",pos1,pos2),   
				(try_begin),                       
				(lt,":missile_hit",100),                
				(agent_set_hit_points,":agents",0,0),     
				(agent_deliver_damage_to_agent,":player_agent",":agents"),    
				(try_end),          
				(try_end),              
				(try_end),     
				(try_end),
		])      
ballista_reload = (0, 0, 0, [(eq,"$balista_action",2)],
		  [(assign,"$balista_action",3),  
			(try_begin),      
			(lt,"$missile_count","$missile_max"),       
			(val_add,"$missile_count",1),  
			(try_end)
		])
ballista_fire = (0, 0, 0, [(key_clicked, key_t),(eq,"$balista_action",1),],
		  [(try_begin), 
			(eq,"$balista_fire",1), 
			(assign,"$balista_fire",0),    
			(else_try),         
			(assign,"$balista_fire",1),  
			(try_end)
		])
ballista_fire_tick = (0, 0, 0, [(eq,"$balista_fire",1),],
		  [(store_sub,":one_less","$missile_count",1), 
			(store_sub,":two_less","$missile_count",2), 
			(scene_prop_get_instance,":missile_instance", "spr_balista_missile", "$missile_count"), 
			(scene_prop_get_instance,":missile_instance2", "spr_balista_missile", ":one_less"), 
			(scene_prop_get_instance,":missile_instance3", "spr_balista_missile", ":two_less"), 
			(prop_instance_get_position,pos1,":missile_instance"),     
			(prop_instance_get_position,pos2,":missile_instance2"),  
			(prop_instance_get_position,pos3,":missile_instance3"),  
			(position_move_y,pos1,-100),        
			(position_move_y,pos2,-100),       
			(position_move_y,pos3,-100),     
			(particle_system_burst, "psys_torch_fire",pos1,10),   
			(particle_system_burst, "psys_torch_smoke",pos1,10), 
			(particle_system_burst, "psys_torch_fire_sparks",pos1,10),    
			(particle_system_burst, "psys_fire_glow_1",pos1,5),  
			(particle_system_burst, "psys_torch_fire",pos2,5),   
			(particle_system_burst, "psys_torch_fire_sparks",pos2,5),    
			(particle_system_burst, "psys_fire_glow_1",pos2,2),   
			(particle_system_burst, "psys_torch_fire",pos3,5),   
		])
ballista_check_actions = (0, 4, 0, [(eq,"$balista_action",3),],
		  [(assign,"$balista_action",5),
		])
ballista_create_missiles = (0, 0.1, 0, [(eq,"$balista_action",5),],
		  [(assign,"$balista_action",4),
          (scene_prop_get_instance,":balista_instance", "spr_balista", 0),
          (prop_instance_get_position,pos1,":balista_instance"),   
		  (position_move_z,pos1,125),    
		  (position_move_y,pos1,350),     
		  (position_rotate_z,pos1,180),     
		  (mission_cam_animate_to_position, pos1, 1000, 0),  
		  (scene_prop_get_instance,":missile_instance", "spr_balista_missile", "$missile_count"),    
		  (prop_instance_get_position,pos2,":balista_instance"),      
		  (position_move_z,pos2,55),     
		  (prop_instance_set_position,":missile_instance",pos2), 
		])      
ballista_move_up = (0, 0, 0, [(key_is_down, key_up),(eq,"$balista_action",1),],
		  [(scene_prop_get_instance,":balista_instance", "spr_balista", 0),   
			(prop_instance_get_position,pos1,":balista_instance"),      
			(position_rotate_x,pos1,3),     
			(prop_instance_animate_to_position,":balista_instance",pos1,10),    
		])
ballista_move_down = (0, 0, 0, [(key_is_down, key_down),(eq,"$balista_action",1),],
		  [(scene_prop_get_instance,":balista_instance", "spr_balista", 0),   
		  (prop_instance_get_position,pos1,":balista_instance"),     
		  (position_rotate_x,pos1,-3),  
		  (prop_instance_animate_to_position,":balista_instance",pos1,10), 
		]) 
ballista_move_left = (0, 0, 0, [(key_is_down, key_left),(eq,"$balista_action",1),],
		  [(scene_prop_get_instance,":balista_instance", "spr_balista", 0),
			(prop_instance_get_position,pos1,":balista_instance"),    
			(position_rotate_z,pos1,3),         
			(prop_instance_animate_to_position,":balista_instance",pos1,10),   
		])
ballista_move_right = (0, 0, 0, [(key_is_down, key_right),(eq,"$balista_action",1),],
		  [(scene_prop_get_instance,":balista_instance", "spr_balista", 0), 
			(prop_instance_get_position,pos1,":balista_instance"),      
			(position_rotate_z,pos1,-3),    
			(prop_instance_animate_to_position,":balista_instance",pos1,10), 
		])
 
How can the water be fixed? It looks beautiful in a way, but doesn't make much sense without a maelstrom at it's center.
29opb1k.jpg
 
Fire_and_Blood said:
How can the water be fixed? It looks beautiful in a way, but doesn't make much sense without a maelstrom at it's center.
29opb1k.jpg

I'm not quite sure. It's a problem I've had with the ACOK map as well. Given that I've been using a fairly outdated water travel system, it has not been much of a problem for me, but as I want to implement your water travel for ACOK 2.0, I was going to have a look at it myself tommorow to see how I could fix it.

It's obviously caused by the water texture converging on itself in the middle of the map, but I'm not quite sure what can be done about it. I might try just extending the map to remove the center and have it further inland, thus making the "maelstrom" be covered by land rather than water. I brought it up a couple of years ago, but never really figured anything out.

Edit:

Okay, extending the map does nothing. It's not a shader thing, odd as that seems. The river and ford terrain does not maelstrom itself, it's only the ocean terrain.


This picture shows a quick extension I made of my own map. The blue dot is where the convergence SHOULD be, if it was just a matter of extending the map. The red dot is where the convergence ACTUALLY is, and is where it's been from the start.

What you can do to fix this, is taking the entire terrain part and just drag it over the convergence, so it's hidden by the plains/steppe/desert whatever terraint tiles. You'll have to re-do all the coordinates for the parties though.

Second edit:

Yeap, just take the entire map and move it along the x or y coordinates until the coordinates 0.0 0.0 are covered by land in as wide a range as is needed to cover the convergence in land terrain.
 
Masterancza said:
Ikaguia said:
you're probably calling that script somewhere without using the 2 parameters

So how can I define this parameters here?

#TLD begin - do this only once
  # select what friendly faction was most interested in this victory (mtarini)
  (store_troop_faction, ":frakcja_gracza", "trp_player"),
  (assign, "$impressed_faction", ":frakcja_gracza"), # by default, it is player starting fatcion
  (store_faction_of_party, ":defeated_faction", "$g_enemy_party"),

      (str_store_faction_name, s4, ":defeated_faction"),
          #(display_log_message, "@DEBUG: player defeated a party of faction {s4}."),

  (call_script, "script_find_closest_enemy_town_or_host", ":defeated_faction", "p_main_party"),
          (assign, ":impressed_party", reg0),

  (try_begin),
  (ge, ":impressed_party", 0),
  (str_store_party_name, s3, ":impressed_party"),
  (store_faction_of_party, "$impressed_faction", ":impressed_party"),
  (try_begin),
                (is_between, ":impressed_party", centers_begin, centers_end),
                (display_message, "@Wieść o twoim zwycięstwie przeciwko {s4} dociera do {s3}.", 0x33DD33),
               
  (else_try),
(display_message, "@{s3} jest świadkiem twojego zwycięstwa przeciwko {s4}.", 0x33DD33),
  (try_end),
#(display_message, "@Debug: giving rank points for impressed faction."),  
            (call_script, "script_increase_rank", "$impressed_faction"),
  (else_try),
  #(display_log_message, "@DEBUG: nobody directly interested witnesses your victory."),
  (try_end),
         
#TLD end

your script is expecting two parameters: the faction and how much rank it should increase, you're calling it with only the 1st parameter, thus causing the error
 
["grenades", "Grenades", [("grenade",0)],
itp_type_thrown |itp_merchandise|itp_primary, itcf_throw_stone,500,
weight(4)|difficulty(0)|spd_rtng(85) | shoot_speed(30) | thrust_damage(1 ,  blunt)|
max_ammo(2)|weapon_length(:cool:,imodbits_none,
[(ti_on_missile_hit, [
(this_or_next|multiplayer_is_server), #Only run on server for multiplayer
(neg|game_in_multiplayer_mode),
(store_trigger_param_1,":grenadier"),
    (try_for_agents,":target"),
        (agent_get_position,pos2,":target"),
        (get_distance_between_positions,":dist",pos1,pos2),
(try_begin),
            (lt,":dist",250), #Distance between target and impact position needs to be less than
#this for it to deal damage (in cm's)
            (store_agent_hit_points,":hp",":target",1),
    (store_random_in_range,":dmg",60,100),    #Deal random damage between those two values
    (val_sub,":hp",":dmg"),
    (agent_set_hit_points,":target",":hp",1),
    (le,":hp",0),
    (agent_deliver_damage_to_agent,":grenadier",":target"),
(try_end),
        #Graphics and sound effects below
        (particle_system_burst,"psys_pistol_smoke",pos1,50),
        (particle_system_burst,"psys_village_fire_big",pos1,50),
        (play_sound_at_position,"snd_pistol_shot",pos1),
    (try_end)
])]],

I have 1 item grenades, explosive boom it works very well, but....
I want grenade exploded a few seconds after hitting the ground
how?
sorry my english bad
 
There is a bridge polygon limit but it's pretty high. I've got over a hundred bridge tiles and I've never had a crash.
The main problem might be bandits effectively isolating huge sections of the map by hanging around bridges. I can imagine you'd get consistently low prosperity in such areas as the farmers/caravans do the back and forth thing.
 
Harlef said:
I want to delete 3 factions in WFaS, what scripts do I have to delete?
basically follow this tutorial but deleting instead of adding. I don't think there are many differences in WFaS over WB
http://forums.taleworlds.com/index.php/topic,116286.0.html
 
@Fire_and_blood & Cozur
It is how the engine assigns texture coordinates to the world map (i believe it does it in this way so that the textures aren't overly repetitive). It can be fixed easily, this looks complicated but its really not (will take 5 to 10 minutes max)

Assuming that you dont currently use any custom shader files, this will work:

Download the shader files here (https://www.taleworlds.com/en/Games/Warband/Download)
Extract them all into your main mod folder
Open up the compile.fx with notepad
Delete everything and paste this in
Code:
:start

@echo off && title compiling the tld hlsl shaders thing-- && echo ^[Compiling Shaders for ACOK...PS thanks Grandmaster^] && echo ^[started at %time%^] && echo. 
start /b /wait /i /high /realtime fxc /D /nologo /D PS_2_X=ps_2_b /Tfx_2_0 /Fomb.fx mb_src.fx

echo. && echo Shader processing has ended at %time%.
echo Press any key to recompile. . .
echo ___________________________________
pause>nul
goto :start
Now save, then close.
Double click compile.fx, it should now compile your shader files (ussually takes about a minute). If all is well it will say something like compilation succeeded; see blablabla

Ok now shader files are set up we can edit them:
Open up mb_src.fx with notepad++
Run a search for vs_map_water
When you have found the line which says
Code:
VS_OUTPUT_MAP_WATER vs_map_water (uniform const bool reflections, float4 vPosition : POSITION, float3 vNormal : NORMAL, float2 tc : TEXCOORD0, float4 vColor : COLOR0, float4 vLightColor : COLOR1)
{
Go a few lines down (like 11 lines roughly) until you get to this line
Code:
Out.Tex0 = tc + texture_offset.xy;
replace the above line with these two lines

Code:
float water_texture_scale = 0.5;
Out.Tex0 = (water_texture_scale*float2(vWorldPos.x,vWorldPos.y)) + texture_offset.xy;


Once you have done this save the file, close it. Then double click compile.fx again. Wait for it to finish, then run your mod. Note you can make changes while in game also (make your changes to mb_src.fx, run compiler, then press ctrl+f while in game and your shaders will be reloaded).

You may have to play around with the water_texture_scale line, depending on what scale you want your water texture to be. e.g change its value to higher if you want the water texture to be repeated more often, or change its value to lower you want it to be repeated less often.

What you have basically done by replaceing the code with the above is: change it so that the water shader no longer uses texture coordinates given by the engine - instead it uses the position of the map on the x and y axis as texture coordinates. We can simply use this as, the map is static and doesnt move, and the map water is completely flat, doesnt have any (or atleast minimal) differences on the z axis.
 
Ikaguia said:
Harlef said:
I want to delete 3 factions in WFaS, what scripts do I have to delete?
basically follow this tutorial but deleting instead of adding. I don't think there are many differences in WFaS over WB
http://forums.taleworlds.com/index.php/topic,116286.0.html
I used this tutorial ( http://forums.taleworlds.com/index.php/topic,128647.0.html ) and deleted several error-causing-stuff but i get many different errors, is it possible to remove that faction if i just disable the towns and remove the lords?

E: I disabled the towns and villages, but lords still appear, still no way to remove their party template?
 
Status
Not open for further replies.
Back
Top Bottom