Author Topic: Better MS Scripting Reference: header_operations expanded  (Read 20498 times)

0 Members and 1 Guest are viewing this topic.

Lav

  • Sergeant Knight at Arms
  • *
    • Skype - Eleyvie
    • Steam - eleyvie
    • View Profile
    • Lav's Warband Workshop
  • Faction: Vaegir
  • MP nick: Lav
  • M&BWB
Better MS Scripting Reference: header_operations expanded
« on: January 18, 2012, 09:40:10 PM »
If you ever needed a comprehensive reference on Warband Module System operations, you have found it!

Operations introduced in Warband patches 1.153-1.166 are indicated appropriately.

Here you can find a thoroughly restructured, expanded and documented version of header_operations.py file from the Warband Module System. All operations have been grouped into sections, their calling syntax has been checked, nearly every operation has been properly commented. Many mistakes or inconsistencies in operation calling syntax or supposed effects have been researched and corrected. Most unobvious conventions and assumptions are highlighted.

What's more, a lot of comments have been added to the file which should make it much easier to use by people who are still learning the ropes of Warband modding.

Download URL #1: http://www.nexusmods.com/mountandblade/mods/3478
Download URL #2: http://www.mbrepository.com/file.php?id=3478

(click to show/hide)

(click to show/hide)

Quote from: Terms of Use
You are free to use this file in your module sources.

You are also free to redistribute the file (separately or as part of your module sources), use the information from the file to create other forms of Module System scripting reference, or convert it to other formats (CHM, HTML, DOC, RTF, PDF, whatever) for as long as you keep "Introduction and Credits" section intact. You can add to it, highlighting your own contribution to the project, but never remove.

The file still could be improved in some places, and not all operations have been completely researched to this moment. Multiplayer section in particular has not been expanded at all, as I do not consider myself an expert on Warband MP modding. Tableau section could use some extra love as well. Some inaccuracies in other sections are also possible, humans do make mistakes after all. Despite all that, I daresay this is the file which will be of great help to any Warband scripter.

Special credits go to cmpxchg8b, Caba'drin, SonKidd, MadVader, dunde, Ikaguia, MadocComadrin, Cjkjvfnby and shokkueibu for their help and support during this file development.

Sayd Ûthman

  • Language Moderator
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Sayd_uthman
  • WB
Re: Better MS Scripting Reference: header_operations expanded
« Reply #1 on: January 18, 2012, 09:51:41 PM »
Thank's for sharing, will be useful for sure

Seek n Destroy

  • Marquis
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: SnD
  • WBWF&S
Re: Better MS Scripting Reference: header_operations expanded
« Reply #2 on: January 21, 2012, 11:34:08 AM »
Very useful, thanks Lav!

CTCCoco

  • Knight at Arms
  • *
    • Steam - CTCCoco
    • View Profile
    • Calradia Slave Rebellion
  • Faction: Neutral
  • WBNW
Re: Better MS Scripting Reference: header_operations expanded
« Reply #3 on: January 25, 2012, 10:24:30 AM »
 So, if you wanna to move forward, you only use position_move_y?

It looks easier now, because before I believed that you must to calculate the exact coordinates yourself, just like SA-MP (Pawn), MTA:SA, Garry's Mod... etc.

Thanks for this hehe.
« Last Edit: January 25, 2012, 10:29:41 AM by CTCCoco »
Calradia Slave Rebellion
Programmer, Game Developer, Modder & Webmaster

Lav

  • Sergeant Knight at Arms
  • *
    • Skype - Eleyvie
    • Steam - eleyvie
    • View Profile
    • Lav's Warband Workshop
  • Faction: Vaegir
  • MP nick: Lav
  • M&BWB
Re: Better MS Scripting Reference: header_operations expanded
« Reply #4 on: January 25, 2012, 10:33:58 AM »
So, if you wanna to move forward, you only use position_move_y?

It looks easy now, because before I believed that you must to calculate the exact coordinates yourself, just like SA-MP (Pawn), MTA:SA, Garry's Mod... etc.

Thanks for this hehe.
Apparently so, though I have not tested this (I'm still preparing the research plan for mission-time operators - that includes positions, agents, scene props and scene items). So test this before using in actual code.

If it doesn't work as advertised, you can still create a position with coords (0, Y, 0) and call position_transform_position_to_parent to get target position.

kefka95

  • Tweak'd Out
  • Squire
  • *
    • View Profile
  • Faction: Bandit
Re: Better MS Scripting Reference: header_operations expanded
« Reply #5 on: February 01, 2012, 10:57:17 PM »
Very cool, thanks for putting this together Lav!

Specialist

  • Master Knight
  • *
  • Coder
    • View Profile
  • Faction: Neutral
  • MP nick: TheSpecialist
  • WB
Re: Better MS Scripting Reference: header_operations expanded
« Reply #6 on: February 02, 2012, 12:19:41 AM »
Amazing! Too bad replace_scene_props only works in MT triggers though. I could really use a trigger that replaces props at will. :P

Lav

  • Sergeant Knight at Arms
  • *
    • Skype - Eleyvie
    • Steam - eleyvie
    • View Profile
    • Lav's Warband Workshop
  • Faction: Vaegir
  • MP nick: Lav
  • M&BWB
Re: Better MS Scripting Reference: header_operations expanded
« Reply #7 on: February 02, 2012, 05:31:11 AM »
Amazing! Too bad replace_scene_props only works in MT triggers though. I could really use a trigger that replaces props at will. :P
Well, moving a prop 1000 meters below ground usually works. Though this method will eventually overload the memory if used frequently. As a way around, you could probably have a "hidden cache" of scene props below ground, where you could take them from when needed. Maybe even make a script which will take a scene prop from the cache if there's one, or create a new if cache has no instances of needed prop left.

Swyter

  • Grandmaster Knight
  • *
  • »Star Wars Conquest Dev Team Leader
    • View Profile
    • [my tiny homepage]
  • Faction: Swadian
  • MP nick: Sareth | Swyter
  • WBM&BWF&S
Re: Better MS Scripting Reference: header_operations expanded
« Reply #8 on: February 10, 2012, 07:37:43 PM »
Good job, only two comments:

Code: [Select]
  # Sooner or later someone was bound to dedicate some time and effort to fix
  # this problem by properly documenting the file. It just so happened that I
  # was the first person crazy enough to accept the challenge.

You're not the first, all these people contributed originally for documenting the opcodes.

Was an idea of the now disappeared Theoris, whom I helped and later maintained the online docs.
In various formats that even allows exporting to the games format.

http://mbcommands.ollclan.eu/top/

So please, change that.



Here's my personal contribution, maybe I'm not 100% spot on though:

Code: [Select]
set_tooltip_text                      = 1130  # (set_tooltip_text, <string_id>),
                                              # Assigns the output text for the selected item?

ai_mesh_face_group_show_hide          = 1805  # (ai_mesh_face_group_show_hide, <group_no>, <value>), # 1 for enable, 0 for disable
                                              # Debug -- Draws the selected index of triangles/quads from the navigation graph on-screen.
 
auto_set_meta_mission_at_end_commited = 1305  # (auto_set_meta_mission_at_end_commited), Not documented. Not used in Native. Was (simulate_battle, <value>) before.
                                              # Returns the mission as successful by the game. Used in campaign.

Lav

  • Sergeant Knight at Arms
  • *
    • Skype - Eleyvie
    • Steam - eleyvie
    • View Profile
    • Lav's Warband Workshop
  • Faction: Vaegir
  • MP nick: Lav
  • M&BWB
Re: Better MS Scripting Reference: header_operations expanded
« Reply #9 on: February 13, 2012, 08:16:20 AM »
Good job, only two comments:
You're not the first, all these people contributed originally for documenting the opcodes.

Was an idea of the now disappeared Theoris, whom I helped and later maintained the online docs.
In various formats that even allows exporting to the games format.

http://mbcommands.ollclan.eu/top/

So please, change that.
I think we mean different challenges here. My goal was to get the job done. Not to contribute, not to create a tool to aggregate community contributions, but simply to get the job done - alone if necessary. So while MB Commands Database is an attempt to achieve the same goal, it is an entirely different challenge.

Here's my personal contribution, maybe I'm not 100% spot on though:

Code: [Select]
set_tooltip_text                      = 1130  # (set_tooltip_text, <string_id>),
                                              # Assigns the output text for the selected item?

ai_mesh_face_group_show_hide          = 1805  # (ai_mesh_face_group_show_hide, <group_no>, <value>), # 1 for enable, 0 for disable
                                              # Debug -- Draws the selected index of triangles/quads from the navigation graph on-screen.
 
auto_set_meta_mission_at_end_commited = 1305  # (auto_set_meta_mission_at_end_commited), Not documented. Not used in Native. Was (simulate_battle, <value>) before.
                                              # Returns the mission as successful by the game. Used in campaign.
Thanks!

Swyter

  • Grandmaster Knight
  • *
  • »Star Wars Conquest Dev Team Leader
    • View Profile
    • [my tiny homepage]
  • Faction: Swadian
  • MP nick: Sareth | Swyter
  • WBM&BWF&S
Re: Better MS Scripting Reference: header_operations expanded
« Reply #10 on: June 08, 2012, 11:47:11 AM »
Thanks for this hehe.





You can find an updated version here:
https://bitbucket.org/Swyter/swysdk/src/76c918857aa3/Header/header_operations.py

I've added all the new opcodes until the newest v1.153. You probably have to remove a bunch of swysdk and wse related code.

_______________
PS: What's with the beacon image you insert at the end of all your posts, wadlegnst?
Code: [Select]
[img]http://www.dailyforexrates.info/g.gif[/img]

Is it some sort of dishonest tracking, exploit or advertising?  :|
« Last Edit: June 08, 2012, 11:54:15 AM by Swyter »

( ͡° ͜ʖ ͡°)

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Nord
  • WB
Re: Better MS Scripting Reference: header_operations expanded
« Reply #11 on: June 20, 2012, 11:28:45 PM »
You sir. Are a god send.

Lav

  • Sergeant Knight at Arms
  • *
    • Skype - Eleyvie
    • Steam - eleyvie
    • View Profile
    • Lav's Warband Workshop
  • Faction: Vaegir
  • MP nick: Lav
  • M&BWB
Re: Better MS Scripting Reference: header_operations expanded
« Reply #12 on: August 12, 2012, 05:41:30 PM »
Brought up to date with version 1.153 operations.

UPDATE: Removed the MediaFire link, added Nexus instead.

shokkueibu

  • Knight
  • *
  • Winning Is For Losers
    • View Profile
  • Faction: Bandit
  • MP nick: Wolfpack_sHocK
  • M&BWB
Re: Better MS Scripting Reference: header_operations expanded
« Reply #13 on: August 20, 2012, 11:26:13 PM »
Excellent work, Lav :)

Here's some stuff for you:
(click to show/hide)

Kato_Yang

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
Re: Better MS Scripting Reference: header_operations expanded
« Reply #14 on: May 22, 2013, 07:57:34 PM »
Great job, immensely useful documentation, many thanks to you Lav!