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

Users who are viewing this thread

Status
Not open for further replies.
This is what I came up with.
Simply write /id <playername> into chat.
e.g "/id Theoris" or "/id Some_Random_Guy"

Code:
					    #/id <PlayerName>
						#Shows the ID of PlayerName.
						(str_starts_with, s1, "@id"),
						(str_store_substring, s3, s1, 2),
						(str_store_trim, s2, s3),
				    	(get_max_players, ":max"),
				    	(try_for_range, ":player", 0, ":max"),
				    	    (player_is_active, ":player"),
				    		(str_store_player_username, s3, ":player"),
				    		(str_equals, s2, s3),
				    		(assign, ":max", 0),
				    		(assign, reg0, ":player"),
							(str_store_string, s0, "@[Server] PlayerID of {s3} is {reg0}."),
							(multiplayer_send_string_to_player, ":player_no", pa_server_message, s0),
				    	(try_end),
						(set_trigger_result, 1),

conclusion; a very powerful tool!
 
Update!
cmpxchg8b said:
v1020
- Added case insensitive parameter to string comparison functions (str_equals, str_contains, str_starts_with, str_ends_with).
- Added register_get and register_set operations. Example usage: looping over registers in script_game_receive_url_response.
- Added store_wse_version operation. Self-explanatory.
- Fixed trial mode check (wrong check at wrong location - can't get any worse).
- Bundled msvcp100.dll and msvcr100.dll. There should be no need to install the Visual C++ 2010 Redistributable Package anymore.
 
Excellent! *High Fives*

Although, I will say you've given me a  little bit more work to do with a side project of my own  :twisted:

Edit: Nice example  :lol:

And @Urist, Unfinished business? TW has put more effort in opening this game up for modding than most games on the market, and they are still working on adding new operations. Likewise, I could see why they wouldn't include string manipulation functions in the first place, and frankly, we didn't need string functions very much at all until very recently.

Edit 2: this should probably be moved to the Unofficial Tools Subforum.

Edit 3: If I could make a suggestion for a future version, could you add something in for making mappable keys? I think a lot of mods could benefit from having keys the client can set, even if they have to create their own menu for it.
 
MadocComadrin said:
Edit 3: If I could make a suggestion for a future version, could you add something in for making mappable keys? I think a lot of mods could benefit from having keys the client can set, even if they have to create their own menu for it.
What do you mean by this? Mappable to what?
 
Let me be more specific, currently, we have two ways to get input from the keyboard, game keys, which can be redefined to specific keys by the user, and direct access to the keys themselves. When modders want to implement a feature that involves the keyboard, they are forced to use the latter (since using a game key would add to or override it's hard-coded function); however, this forces the modder to pick a key to be specifically dedicated to this. If a person playing the mod has redefined their game keys to this key, there is a problem, eg. Modder Joe implements a shield-bash to occur when a user presses the v key, but player Jim has redefined his kick key to v.

What would be nice is if you could find some way to essentially create "unused" game keys and operations to map them to keyboard keys. Modders could create the menus to map them. I hope that clears it up a bit.
 
Fine work, sir.

I just sent another support ticket regarding it to JestServers. If only they would include WSE in with the default package.. would be plain awesome.
 
Ah, I was going to do that eventually! If you post on the forums too, I'll add my voice. Heck, just tell Jest that one of his other customers likes this too.
 
MadocComadrin said:
Let me be more specific, currently, we have two ways to get input from the keyboard, game keys, which can be redefined to specific keys by the user, and direct access to the keys themselves. When modders want to implement a feature that involves the keyboard, they are forced to use the latter (since using a game key would add to or override it's hard-coded function); however, this forces the modder to pick a key to be specifically dedicated to this. If a person playing the mod has redefined their game keys to this key, there is a problem, eg. Modder Joe implements a shield-bash to occur when a user presses the v key, but player Jim has redefined his kick key to v.

What would be nice is if you could find some way to essentially create "unused" game keys and operations to map them to keyboard keys. Modders could create the menus to map them. I hope that clears it up a bit.
I'll look into it.
 
cmpxchg8b said:
v1030
- Added key operations (wse_key_is_down, wse_key_clicked, wse_key_get, wse_key_set, wse_key_clear)

Valid WSE key ids are 0 to 48 (same as game key ids, I'm lazy and reused the same data structure).
Detailed usage is described in the header_operations.py snippet.

A problem with this is that there is no easy way to save key mapping locally. However, saving settings (without the need of a savegame - usable for multiplayer too) will be soon supported by WSE.
 
Nice work! May I request one more string operations? It would be a compare operation that returns 1 if string1 is lexographically greater than string2, -1 if it's less than, and 0 if the strings are the same. (Capitalization could be set to take effect with a flag).
 
MadocComadrin said:
Let me be more specific, currently, we have two ways to get input from the keyboard, game keys, which can be redefined to specific keys by the user, and direct access to the keys themselves. When modders want to implement a feature that involves the keyboard, they are forced to use the latter (since using a game key would add to or override it's hard-coded function); however, this forces the modder to pick a key to be specifically dedicated to this. If a person playing the mod has redefined their game keys to this key, there is a problem, eg. Modder Joe implements a shield-bash to occur when a user presses the v key, but player Jim has redefined his kick key to v.

What would be nice is if you could find some way to essentially create "unused" game keys and operations to map them to keyboard keys. Modders could create the menus to map them. I hope that clears it up a bit.
Couldn't it be done that if someone presses a key, whatever will be called unless his agent starts doing something else at that moment?
 
Now that I think of it, is there really need for key operations? Can't modders just do (key_is_down, "$key_some_action") and allow the user to bind $key_some_action to whatever he wants with a custom presentation?
 
Update!
cmpxchg8b said:
v1040
- Added str_compare and str_store_reverse operations.
- Added wse_console_command_received game script that will be executed when a command is entered on the dedicated server console (after parsing standard commands). See example #2.
- Changed all string operations from using cstring functions (strlen, strstr, _strlwr_s...) to ATL::CStringW to allow for UTF8 compatibility.
- Removed <max_replacements> parameter from str_replace to simplify logic.
- Renamed str_get_ascii to str_get_char (not all characters returned are ASCII).

Note: wse_console_command_received works both with commands typed by the server admin and commands in the config file (e.g. Sample_Battle.txt). Both cases are handled by the same game functiion.
 
Status
Not open for further replies.
Back
Top Bottom