Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Either way, do a try_for_range over all of the players server-side. Inside that loop, have it check for factions and then send a message to the clients you are part of the right faction. Finally script the server event to display the message.
 
Well currently, it's so that it checks that if it's a certain troop type, it plays the sound, otherwise it tries another troop class. But everyone does hear the shouting which is what I wanted. Now I only want to send a message to your team.
 
Question(multiplayer): What can I actually edit/add/remove from native without having to actually make a separate mod? Because I know that I can actually modify native and upload it to the server without forcing all the players also download the mod, but I don't know to what extent.
Example: I wanna make a script for area chat, but I guess that it will force people download the mod, because it needs to actually check for 'u' key presses at every player, in order to start the whole chat presentation thingy (like when you press 't' or 'y').
 
I am having a performance problem with the map(player icon stutters) when I extend the boundaries a considerable amount.  Is there a way to keep the size of the map but still get smooth playability with the map speed and icons? Below are the numbers that were tweaked in the module.ini file.

module_name = Calradia
map_min_x  = -276.477600
map_max_x  = 274.273010
map_min_y  = -182.305222
map_max_y  = 182.879700
map_sea_direction = -40 #wave foam direction
map_sea_wave_rotation = 120 #This is where the tear artefact is visible on the sea.
map_sea_speed_x = 0.02
map_sea_speed_y = -0.02
map_river_direction = 140
map_river_speed_x = 0.01
map_river_speed_y = -0.01
 
Have you tried lowering the map poly count? Also, are you using a lot of trees? Trees are horrible on the overworld map for some reason (or at least they were in the original)
 
Definitely polycount. You might want to put some work into reducing it for the map, e.g. merging small standard tris into larger ones for open areas and for map borders, have less trees e.t.c.
To check if it is really polycount, replace map tree meshes temporarily with empty ones and look on performance
 
New question:smile:) : Can I make M&B:Warband write/read stuff (on the server side) in/from a text file? As it does with the banlist or logs...
 
Not really, all you can do is write to the log file or ban someone. However, if you have a web host with server-side scripting (eg. php) you could send a message there when you want to read/write and have the web server read/write what you want.
 
Alrighty,  I have a bit of a problem here. Basically, I tried to make a sniper scope zoom thingy. First, I did the brf file. The texture had transparency so I saved it as .dds dxt5. Then, in the material options in openbrf, I put options blend, blend add, blend multiply, alpha 1 and alpha 128 and then did all the other necessary stuff to make it work. Then, here are the scripts which I used.

Module meshes
Code:
("scope", 0, "scope", 0, 0, 0, 0, 0, 0, 1, 1, 1),

Module presentations
Code:
("zoom_view", prsntf_read_only, 0, [		#must use prsntf_read_only or you cannot attack
	(ti_on_presentation_load,
		[
		(presentation_set_duration, 999999),
		
		(assign, ":view", 0),
		(get_player_agent_no, ":player_agent"),
		(agent_get_wielded_item, ":item_handone", ":player_agent", 0),
		#(agent_get_wielded_item, ":item_handtwo", ":player_agent", 1),
		(try_begin),
			(eq, ":item_handone", -1),
			(assign, ":view", 1),	#use binoculars
		(else_try),
			#(ge, ":item_handone", 0),
			(item_get_type, ":item_type_handone", ":item_handone"),
			(try_begin),
				(this_or_next|eq, ":item_type_handone", itp_type_one_handed_wpn),
				(this_or_next|eq, ":item_type_handone", itp_type_two_handed_wpn),
				(this_or_next|eq, ":item_type_handone", itp_type_bow),
				(eq, ":item_type_handone", itp_type_polearm),
				(assign, ":view", 2),	#use binoculars
			(else_try),
				(eq, ":item_type_handone", itp_type_crossbow),
				(assign, ":view", 2),	#use scope
			(else_try),
				(eq, ":item_type_handone", itp_type_pistol),
				(assign, ":view", 2),	#use scope
			(else_try),
				(assign, ":view", 0),	#pistol, other, don't do anything
			(try_end),
		(try_end),

		(try_begin),
			(eq, ":view", 1),
			(create_mesh_overlay, reg1, "mesh_scope"),
			(position_set_x, pos1, 0),
			(position_set_y, pos1, 0),
			(overlay_set_position, reg1, pos1),	
		(else_try),
			(eq, ":view", 2),
			(create_mesh_overlay, reg1, "mesh_scope"),
			(position_set_x, pos1, 0),
			(position_set_y, pos1, 0),
			(overlay_set_position, reg1, pos1),			
		(try_end),
		
		]),
	(ti_on_presentation_run,
       		[
			(neg|game_key_is_down,gk_zoom),
			#(assign, "$zoom_view", 0),
			(presentation_set_duration, 0),
        	]),	
]),

Module mission templates
Code:
common_zoom_view = (0, 0, 0, [
		(game_key_is_down, gk_zoom)
	],
	[
		(get_player_agent_no, ":player_agent"),
		(agent_is_alive, ":player_agent"),
		(start_presentation, "prsnt_zoom_view"),
	])
And then added it under multiplayer battle mode. The thing is, no errors while compiling nor did I see when in-game. But when I pressed the zoom button, no scope thingy appeared on the screen and no errors. I'm not sure that is the problem with the brf file or the script. Should I add multiplayer_is_server somewhere and if so, where exactly? Or is the problem with the brf options, if so, could you help me with them? Not really familiar with the transparency options.
 
I noticed you didn't have a 'set_fixed_point_multiplier' (or whatever it's called) operation when you were drawing the presentation. I'm not too well versed with presentations myself, but that may be it.
 
aset_fixed_point_multiplier determines only the precision, e.g. "numbers after the comma" (roughly translated from my native language... probably not correctly... :smile:)
Example: If your operation returns 17.3563, if you have a fixed_point_multiplier of 1, you'll get only "17". if you have it on 1000, you (should) get 17.3563.
 
That I understood, but I'm not sure if presentations require to be set explicitly or not. I often see 1000 being used in native presentations.

Also, your translation was pretty much spot-on.
 
I had have a similar problem, but mine is better: I tired to use Hokei's code for zooming, but instead of zooming in, the camera becomes something like a bird's view. I wondered how to fix it until I realised that the ability which was tied to the code was called "Eagle Vision", and left it as it is. :smile:
 
Lumos said:
I had have a similar problem, but mine is better: I tired to use Hokei's code for zooming, but instead of zooming in, the camera becomes something like a bird's view. I wondered how to fix it until I realised that the ability which was tied to the code was called "Eagle Vision", and left it as it is. :smile:
Well that is hokei's code D: It's the code which he posted on the presentation thingy thread of his. Last page. I tried it D:
 
Status
Not open for further replies.
Back
Top Bottom