[WB] Warband Script Enhancer v3.2.0 (21/07/2013)

Users who are viewing this thread

Status
Not open for further replies.
cmpxchg8b said:
Well, they weren't that useful... they featured only a few operations and scripts.
I started writing official documentation, but it's not exactly high priority and it will take me a bit of time.

Feel free for using the Modding Wiki for that.
 
@cmpxchg8b I know you are a busy man, but what do you think about this blocking trigger? Is it possible? For many people this feature can be very useful for many things. As I said on the previous page, useful parameters could be: agent whose blocking incoming attacks, attacker, and maybe type of weapon, like sword or blunt weapon.
What do you think about it?
 
SonKidd said:
1. dunno if this has been requested, but is it possible to change the attributes (skills/ proficiency) for individual agents?

2. how about setting a weapon to 100% crush through? (for upper swing). Or even 100% crush through for all directions?

3. at spawn missile, make the missile penetrate shield.

4. trigger on_agent_blocked (for blocking with like swords).

Thanks :smile:.

just in case you missed this :smile:
 
Ikaguia said:
also that agent_get_bone_position
Will add it in next hotfix.
woyo-sensei said:
@cmpxchg8b I know you are a busy man, but what do you think about this blocking trigger? Is it possible? For many people this feature can be very useful for many things. As I said on the previous page, useful parameters could be: agent whose blocking incoming attacks, attacker, and maybe type of weapon, like sword or blunt weapon.
What do you think about it?
Possible, but I'm not sure if the engine keeps track of attacking agent/weapon. Will probably be added in a later version.
SonKidd said:
1. dunno if this has been requested, but is it possible to change the attributes (skills/ proficiency) for individual agents?
Impossible, agents fetch attributes from their troop (you can change troop attributes and the change will affect all agents of that troop).
SonKidd said:
2. how about setting a weapon to 100% crush through? (for upper swing). Or even 100% crush through for all directions?
Possible, but tricky to add. Will consider it.
SonKidd said:
3. at spawn missile, make the missile penetrate shield.
At spawn?
SonKidd said:
4. trigger on_agent_blocked (for blocking with like swords).
See answer to woyo-sensei above.
 
Yesss!  :grin:, A little while ago i downloaded 'the forge' to my computer as i do a lot of work off line and luckily i have a copy of your examples, if you want to keep them that is :wink:. (Just quote me and take out the writing as its all laid out by you already :wink:)

Example #1 - chat message parsing

Module system script (module_scripts.py)

       
Code:
#script_wse_chat_message_received
	# Called each time a chat message is received (both for servers and clients)
	# INPUT
	# script param 1 = sender player id
	# script param 2 = chat type (0 = global, 1 = team)
	# s0 = message
	# OUTPUT
	# trigger result = anything non-zero suppresses default chat behavior. Server will not even broadcast messages to clients.
	# result string = changes message text for default chat behavior (if not suppressed).
	("wse_chat_message_received", [
		(multiplayer_is_server),
		(store_script_param, ":player_no", 1),
		(try_begin),
			(str_store_trim, s1, s0),
			(str_starts_with, s1, "@/"),
			(str_store_substring, s1, s1, 1),
			(try_begin),
				(str_starts_with, s1, "@die", 1),
				(player_is_active, ":player_no"),
				(player_get_agent_id, ":agent_no", ":player_no"),
				(ge, ":agent_no", 0),
				(remove_agent, ":agent_no"),
				(set_trigger_result, 1),
			(else_try),
				(str_starts_with, s1, "@id", 1),
				(assign, reg0, ":player_no"),
				(set_result_string, "@My player number is {reg0}."),
			(else_try),
				(set_trigger_result, 1),
			(try_end),
		(else_try),
			(str_contains, s0, "@ho"),
			(str_store_replace, s1, s0, "@ho", "@a woman with question life choices"), #Pun intended.
			(set_result_string, s1),
		(try_end),
	]),
Video of above script running on a dedicated server
http://www.youtube.com/watch?v=BgRJeQ1L3ak&hd=1

________________________________________________________________________________

Example #2 - dedicated server console command parsing
This example adds a set_max_players_real console command that can set the max number of players without being limited to 64, unlike set_max_players.

Module system script (module_scripts.py)
Code:
#script_wse_console_command_received
	# Called each time a command is typed on the dedicated server console (after parsing standard commands)
	# INPUT
	# s0 = text
	# OUTPUT
	# trigger result = anything non-zero if the command succeeded
	# result string = message to display on success (if empty, default message will be used)
	("wse_console_command_received", [
		(str_split, ":num_tokens", s30, s0, "@ ", 1),
		(ge, ":num_tokens", 1),
		(assign, ":fail", 0),
		(try_begin),
			(str_store_string, s0, "@set_max_players_real"),
			(str_store_replace_spaces_with_underscores, s0, s0), #Workaround for Warband' annoying habit of replacing all underscores with spaces (seriously, was underscore the less common character they could come up with?)
			(str_starts_with, s30, s0),
			(try_begin),
				(ge, ":num_tokens", 3),
				(str_to_num, ":max_players", s31),
				(str_to_num, ":max_private_players", s32),
				(is_between, ":max_players", 2, 251),
				(is_between, ":max_private_players", 2, 251),
				(le, ":max_players", ":max_private_players"),
				(server_set_max_num_players, ":max_players", ":max_private_players"),
				(assign, reg0, ":max_players"),
				(assign, reg1, ":max_private_players"),
				(set_result_string, "@Set maximum players to {reg0} and maximum private players to {reg1}"),
			(else_try),
				(set_result_string, "@Usage: set_max_players_real <max_players> (2-250) <max_private_players> (2-250)"),
			(try_end),
		(else_try),
			(assign, ":fail", 1),
		(try_end),
		
		(eq, ":fail", 0),
		(set_trigger_result, 1),
	]),

Screenshot of the code in action
http://img405.imageshack.us/img405/5030/consolecommanddemo.png

________________________________________________________________________________

Example #3 - composite multiplayer messages

Server code

Code:
(multiplayer_message_init, 10), # network buffer register no. 10
(multiplayer_message_put_int, 10, 0x00FF00),
(multiplayer_message_put_string, 10, "@Hello world!"),
(multiplayer_send_composite_message_to_player, ":player_no", event_display_colored_message, 10),

Client code

Code:
("wse_multiplayer_message_received", [
	(store_script_param, ":player_no", 1),
	(store_script_param, ":event", 2),
	(try_begin),
		(eq, ":event", event_display_colored_message),
		(neg|multiplayer_is_server),
		(multiplayer_cur_message_get_int, ":color"),
		(multiplayer_cur_message_get_string, s0),
		(display_message, "@{s0}", ":color"),
	(try_end),
]),

Wolf.
 
cmpxchg8b said:
SonKidd said:
3. at spawn missile, make the missile penetrate shield.

eh, like (spawn_missile, missile_type, 1), will spawn a missile that will always penetrate shield.

then would it be possible to change an agents troop type in the middle of the battle, without any serious side effects? (since I'm assuming that other stuff such as face, items are constant once the person is spawned.)
 
SonKidd said:
eh, like (spawn_missile, missile_type, 1), will spawn a missile that will always penetrate shield.
It's not that simple... right now I can't think of a way to do that.
SonKidd said:
then would it be possible to change an agents troop type in the middle of the battle, without any serious side effects? (since I'm assuming that other stuff such as face, items are constant once the person is spawned.)
Can't you just give agents different troop types at spawn?
 
I logged in to ask you a question on behalf of a friend of mine;
He has set network_compatible = 0 on both client and server. And when he tried player_set_skin serverside, the agent just died and when he respawned he still looked the same. But player_get_gender gave him the value of what he tried to set with player_set_skin. Is this supposed to happen?

P.S: This post looks very awkward... ^^
 
Status
Not open for further replies.
Back
Top Bottom