Author Topic: [WB] Warband Script Enhancer v2.7.1 (04/04/2012)  (Read 104019 times)

0 Members and 5 Guests are viewing this topic.

Turanien

  • Guest
Re: [WB] Warband Script Enhancer v1.020 - string operations for the masses
« Reply #30 on: December 31, 2010, 11:13:46 AM »
Likewise. We are on Jest and will do the same.

cmpxchg8b

  • Modder++
  • Grandmaster Knight
  • *
  • Master of rglPool
    • View Profile
  • Faction: Vaegir
  • MP nick: cmp
  • M&BWBWF&SNW
Re: [WB] Warband Script Enhancer v1.020 - string operations for the masses
« Reply #31 on: December 31, 2010, 03:23:16 PM »
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.
Warband Script Enhancer v2.7.1 - additional operations, game scripts and triggers for Warband modders

cmpxchg8b

  • Modder++
  • Grandmaster Knight
  • *
  • Master of rglPool
    • View Profile
  • Faction: Vaegir
  • MP nick: cmp
  • M&BWBWF&SNW
Re: [WB] Warband Script Enhancer v1.030 - string operations for the masses
« Reply #32 on: December 31, 2010, 07:59:16 PM »
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.
Warband Script Enhancer v2.7.1 - additional operations, game scripts and triggers for Warband modders

Theoris

  • Guest
Re: [WB] Warband Script Enhancer v1.030 - string operations for the masses
« Reply #33 on: December 31, 2010, 08:01:04 PM »
Excellent, thank you. Happy new year by the way!

MadocComadrin

  • Grandmaster Knight
  • *
  • This garden once was perfect.
    • View Profile
  • Faction: Neutral
  • MP nick: MadocComadrin
  • M&BWBWF&S
Re: [WB] Warband Script Enhancer v1.030 - string operations for the masses
« Reply #34 on: December 31, 2010, 08:56:13 PM »
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).

Dusk Voyager

  • Grandmaster Knight
  • *
  • Dem dayum drums
    • View Profile
    • PoP Dev Forum
  • Faction: Rhodok
Re: [WB] Warband Script Enhancer v1.020 - string operations for the masses
« Reply #35 on: December 31, 2010, 09:27:23 PM »
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?
« Last Edit: January 01, 2011, 12:14:19 AM by Dusk Voyager »
(click to show/hide)
(click to show/hide)

cmpxchg8b

  • Modder++
  • Grandmaster Knight
  • *
  • Master of rglPool
    • View Profile
  • Faction: Vaegir
  • MP nick: cmp
  • M&BWBWF&SNW
Re: [WB] Warband Script Enhancer v1.030 - string operations for the masses
« Reply #36 on: January 01, 2011, 12:10:15 AM »
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?
Warband Script Enhancer v2.7.1 - additional operations, game scripts and triggers for Warband modders

MadocComadrin

  • Grandmaster Knight
  • *
  • This garden once was perfect.
    • View Profile
  • Faction: Neutral
  • MP nick: MadocComadrin
  • M&BWBWF&S
Re: [WB] Warband Script Enhancer v1.030 - string operations for the masses
« Reply #37 on: January 01, 2011, 03:33:01 AM »
Aye, but then you have another variable to worry about when porting.

cmpxchg8b

  • Modder++
  • Grandmaster Knight
  • *
  • Master of rglPool
    • View Profile
  • Faction: Vaegir
  • MP nick: cmp
  • M&BWBWF&SNW
Re: [WB] Warband Script Enhancer v1.030 - string operations for the masses
« Reply #38 on: January 01, 2011, 04:31:57 PM »
Update!
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.
« Last Edit: January 01, 2011, 04:36:15 PM by cmpxchg8b »
Warband Script Enhancer v2.7.1 - additional operations, game scripts and triggers for Warband modders

Theoris

  • Guest
Re: [WB] Warband Script Enhancer v1.040 - string operations for the masses
« Reply #39 on: January 01, 2011, 04:34:14 PM »
And here I was thinking Christmas is over..  :P

Jezze

  • Grandmaster Knight
  • *
  • MP Nicks: OLL_Jezze/Nr2_Rekrut_Jezze
    • View Profile
  • Faction: Rhodok
  • M&BWBNW
Re: [WB] Warband Script Enhancer v1.020 - string operations for the masses
« Reply #40 on: January 03, 2011, 08:47:39 AM »
Alright, cool. I just created the thread, check it out and please respond if you can.

Anyway, I just managed to create a Private Message function with WSE. Awesome indeed.

OLL hosts the servers also at Jestservers. We definitely support this tool to be a standard at Jestservers ;).

cmpxchg8b

  • Modder++
  • Grandmaster Knight
  • *
  • Master of rglPool
    • View Profile
  • Faction: Vaegir
  • MP nick: cmp
  • M&BWBWF&SNW
Re: [WB] Warband Script Enhancer v1.100 - string operations for the masses
« Reply #41 on: January 08, 2011, 11:24:39 PM »
Update.
v1100
- Added string operations: str_split, str_store_join, str_store_replace_spaces_with_underscores, str_store_replace_underscores_with_spaces, str_store_server_password_admin, str_store_server_password_private.
- Added a string-indexed dictionary datatype that can be saved and loaded from files. Dict operations: dict_create, dict_free, dict_load_file, dict_load_dict, dict_save, dict_clear, dict_is_empty, dict_has_key, dict_get_size, dict_get_str, dict_get_int, dict_set_str, dict_set_int.
- Added network operations: multiplayer_send_chat_message_to_player, server_set_password_admin, server_set_password_private.
- Replaced server_set_max_num_players with a counterpart that handles Warband's 250 player limit properly.
- Internal changes.

Warband Script Enhancer v2.7.1 - additional operations, game scripts and triggers for Warband modders

Theoris

  • Guest
great!!  :P

Swyter

  • Sergeant Knight at Arms
  • *
  • »Star Wars Conquest Dev Team Leader
    • View Profile
    • [Mount&Blade Command Database]
  • Faction: Swadian
  • MP nick: Sareth | Swyter
  • M&BWBWF&S
It looks pretty cool. It reminds like an Iron Launcher in a hax0r way with added capabilities. But memory hooks are legal?
You're modifying the game code at runtime.

PS: If this is the case, I want to try, if you don't mind :P

PS2: Have you tried the game behavior when your redirector isn't present. Crashes or ignores the opcode jumping the stack?


EDIT: Oh, You have an eye for detail. Great.
Code: [Select]
str_store_md5 = 2624 #(str_store_md5, <string_register_id>, <string_1>), #MD5 encrypts <string_1> and stores it into <string_register_id>

EDIT2: Also, as good brother in arms of coding I should recommend you to pack every single file (libs included) with upx.sf.net  :idea: To shrink then by half.
« Last Edit: January 09, 2011, 09:00:43 PM by Swyter »

cmpxchg8b

  • Modder++
  • Grandmaster Knight
  • *
  • Master of rglPool
    • View Profile
  • Faction: Vaegir
  • MP nick: cmp
  • M&BWBWF&SNW
It looks pretty cool. It reminds like an Iron Launcher in a hax0r way with added capabilities. But memory hooks are legal?
You're modifying the game code at runtime.
I'm modifying my memory. :D
But no, I'm pretty sure it's not illegal. Ever heard of the Oblivion Script Extender? It works in a similar way, and the guys at Valve even added an exception to make it work with Steam. I doubt they'd do that if it was illegal.
PS2: Have you tried the game behavior when your redirector isn't present. Crashes or ignores the opcode jumping the stack?
Unrecognized opcode %d.
That is, if you don't use (neg|is_vanilla_warband) to isolate WSE specific code.
EDIT2: Also, as good brother in arms of coding I should recommend you to pack every single file (libs included) with upx.sf.net  :idea: To shrink then by half.
I'll give that a look.
Warband Script Enhancer v2.7.1 - additional operations, game scripts and triggers for Warband modders