Clarifying Module System Operations

Users who are viewing this thread

Lav

Sergeant Knight at Arms
As I'm in the process of revising the entire header_operations.py file, I find myself confused with many operations. So I would be grateful if other community members could provide input on their effects and purposes.

store_atan2. What does it do? It's never used anywhere, and comments are pretty confusing.

party_get_cur_town. This one just freaks me out. It should be complete duplicate of party_get_attached_to, but actually both are often used together in various checks. So they are different after all? If so, then how they are different?

store_num_free_stacks and store_num_free_prisoner_stacks. I suppose these are deprecated in Warband? Or are there still some limits on the number of party troop stacks?

party_leave_cur_battle. Only used once in Native code, and in a context which just doesn't make sense (as in that dialog branch the encounter is immediately cancelled anyway). So what does this operation actually do? Is it just an inverse of party_quick_attach_to_current_battle?

party_set_marshall. It is not clear what game effects are there from declaring a party as a marshall (I mean effects provided by game engine, not scripting).

I'll be adding more questions as my revision goes further, so far processed ~20% of the file. :smile:
 
Lav said:
store_atan2. What does it do? It's never used anywhere, and comments are pretty confusing.

Should be this one:

http://en.wikipedia.org/wiki/Atan2

Essentially:
The atan2 function takes into account the signs of both vector components, and places the angle in the correct quadrant.
 
Lav said:
party_get_cur_town. This one just freaks me out. It should be complete duplicate of party_get_attached_to, but actually both are often used together in various checks. So they are different after all? If so, then how they are different?
I'm not sure what's the practical difference, but the second one is AI related. It checks if the party behavior is ai_bhvr_in_town and if it is it returns the behavior object (the town party id).
Lav said:
store_num_free_stacks and store_num_free_prisoner_stacks. I suppose these are deprecated in Warband? Or are there still some limits on the number of party troop stacks?
They both return 10. I guess they could be deprecated, but not necessarily because they return a constant (get_max_players does too, and it's definitely not deprecated).
Lav said:
party_leave_cur_battle. Only used once in Native code, and in a context which just doesn't make sense (as in that dialog branch the encounter is immediately cancelled anyway). So what does this operation actually do? Is it just an inverse of party_quick_attach_to_current_battle?
It makes sense to me. Party A is besieging town B, the player comes and asks party A to stop the siege. The operation is called on party A to make it stop the siege on town B, then the encounter between party A and the player is ended.
Lav said:
party_set_marshall. It is not clear what game effects are there from declaring a party as a marshall (I mean effects provided by game engine, not scripting).
I can't tell you the exact effects, but I see it checks initiative among other things, so I assume it's used for war parties (where lord follow the marshall) to enhance the leader AI.
 
Ok, it's me again with a few more questions.

setup_quest_text. What does this actually do? My assumption is it cleans up any remaining quest notes in case they weren't removed earlier. Or maybe it's no longer needed at all.

reset_price_rates. It's always called as (reset_price_rates, 0). Does the parameter have any meaning?

position_rotate_(x/y)_floating. Not sure how they are different from normal position_rotate? One of them rotates around local axis, and another around global axis? If so, which is what?

get_angle_between_positions. Does it calculate angle between position rotation vectors? Or does it use position's coordinates and zero [0,0,0] as angle vertex?
 
Lav said:
position_rotate_(x/y)_floating. Not sure how they are different from normal position_rotate? One of them rotates around local axis, and another around global axis? If so, which is what?
the angle parameter 's in floating point.
if you do :
(set_fixed_point_multiplier, 100),
then :
(position_rotate_x, pos1, 45),
do the same thing with :
(position_rotate_x_floating, pos1, 4500),


Lav said:
get_angle_between_positions. Does it calculate angle between position rotation vectors? Or does it use position's coordinates and zero [0,0,0] as angle vertex?
angle between same axis of both position register.
 
Lav said:
setup_quest_text. What does this actually do? My assumption is it cleans up any remaining quest notes in case they weren't removed earlier. Or maybe it's no longer needed at all.
It resets quest title and description back to their original value (defined in quests.txt), but I'm not sure what it could be used for. Is it even possible to change name and description at runtime?

Lav said:
reset_price_rates. It's always called as (reset_price_rates, 0). Does the parameter have any meaning?
No, it's ignored.
 
Great, thanks again!

Ok, I'll probably post the last bunch of questions tomorrow or by Saturday, and hopefully the work will be more or less completed by Monday.

cmpxchg8b said:
It resets quest title and description back to their original value (defined in quests.txt), but I'm not sure what it could be used for. Is it even possible to change name and description at runtime?
There are no operations for that, you can only change quest notes. So this one is apparently meaningless.

Actually, to speed things up, here's the full list of operations that I'm uncertain with. For most of them one can quickly write simple tests, so I was leaving that for myself. However if other people would be willing to help, that would speed things up noticeably.

Code:
clear_omitted_keys              = 78  # (clear_omitted_keys),
                                      # Effects not clear, apparently is somehow required to clean up after calling (omit_key_once). 4research.
disable_party                         = 1230  # (disable_party, <party_id>),
                                              # Party disappears from the map. How will it interact with <try_for_parties>? 4research.
party_get_morale                      = 1671  # (party_get_morale, <destination>, <party_id>),
                                              # Returns a value in the range of 0..100. Apparently only used for player's party and has no direct game effects. 4research.
party_set_morale                      = 1672  # (party_set_morale, <party_id>, <value>),
                                              # Value should be in the range of 0..100. Apparently only used for player's party and has no direct game effects. 4research.
add_companion_party                   = 1233  # (add_companion_party, <troop_id_hero>),
                                              # Apparently duplicates (troop_join). No longer used in 1.143. Is it still functional? 4research.
remove_member_from_party              = 1210  # (remove_member_from_party, <troop_id>, [party_id]),
                                              # Removes hero member from party. Player party is default value. Can it be used with regular troops? 4research.
remove_regular_prisoners              = 1211  # (remove_regular_prisoners, <party_id>),
                                              # Not used in Native code. Supposedly removes all non-hero prisoners from the party. 4research.
remove_troops_from_companions         = 1215  # (remove_troops_from_companions, <troop_id>, <value>),
                                              # Not used in Native code. Supposedly removes troops from player's party, duplicating functionality of (party_remove_members). 4research.
party_count_companions_of_type        = 1631  # (party_count_companions_of_type, <destination>, <party_id>, <troop_id>),
                                              # Apparently duplicates (party_count_members_of_type). 4research.
store_party_size_wo_prisoners         = 2157  # (store_party_size_wo_prisoners, <destination>, [party_id]),
                                              # Stores total number of members in the party (without prisoners). Apparently deprecated and duplicates (party_get_num_companions). 4research.
heal_party                            = 1225  # (heal_party, <party_id>),
                                              # Apparently instantly heals all wounded members. 4research.
party_set_next_battle_simulation_time = 1667  # (party_set_next_battle_simulation_time, <party_id>, <next_simulation_time_in_hours>),
                                              # Used in Native with -1 for next simulation time (apparently indicates NOT to simulate battle in the next hour). 4research.
troop_ensure_inventory_space             = 1510  # (troop_ensure_inventory_space, <troop_id>, <value>),
                                                 # Removes items from troop inventory until troop has specified number of free inventory slots. Does it remove from the end of inventory, or cheapest first? 4research.
store_troop_value                        = 2231  # (store_troop_value, <destination>, <troop_id>),
                                                 # Possibly deprecated, not used anywhere in the game. 4research.
check_quest_finished          =  201  # (check_quest_finished, <quest_id>),
                                      # Checks that the quest has been successfully (? 4research) completed and not active (i.e. not taken again).
check_quest_concluded         =  204  # (check_quest_concluded, <quest_id>),
                                      # Checks that the quest is marked as concluded with (conclude_quest). Does it also return true for successful/failed quests? 4research.
cancel_quest                  = 1284  # (cancel_quest, <quest_id>),
                                      # Cancels specified quest, removing it from the list of active quests. Apparently has identical results with (complete_quest). 4research.
The eventual goal is to get a completely reworked, well-structured, fully documented and up-to-date header_operations file.
 
Caba`drin said:
My understanding is it simply compares Z-rotations of the two positions, correct?

May be. Sometime, MS operations do think slightly different with what they're expected to
We can test it by do it for 2 position reg with Z axis're not paralel.


As this thread 's about MS Operation, may be it's good place to ask this.
I have multiple presentations running at once from a mission template, some of them are read only though. How to stop one presentation without affecting the others?
(set_presentation_duration, 0), close them at once, pushing me to make a trigger every frame to check each presentation status and restart them if neccesary.
 
dunde said:
Caba`drin said:
My understanding is it simply compares Z-rotations of the two positions, correct?

May be. Sometime, MS operations do think slightly different with what they're expected to
We can test it by do it for 2 position reg with Z axis're not paralel.
I had run a series of tests using this operation (back when I thought it took the X,Y coordinates and calculated the actual angle between those) and the difference in Z-rotations seemed to be what was going on. The value returned by the operation changed as my agent turned (and appropriately for a comparison of Z-rot) but did not change if the character moved toward or away from the other position that was being tested.

dunde said:
As this thread 's about MS Operation, may be it's good place to ask this.
I have multiple presentations running at once from a mission template, some of them are read only though.
At the risk of revealing my ignorance...how did you get multiple presentations to run at once? Even with read_only presentations, I've always seen the more recent call force a currently running presentation to end in missions.
 
Caba`drin said:
At the risk of revealing my ignorance...how did you get multiple presentations to run at once? Even with read_only presentations, I've always seen the more recent call force a currently running presentation to end in missions.
You can run a presentation without a background mesh (like "battle" presentation which shows minimap, combat stats and group controls). In this situation nothing prevents you from starting another presentation as far as I understand.
 
Hrm, I don't want to derail the thread (so feel free to tell me to get lost) but whenever I start another background-less, read_only presentation while battle is running, battle stops running. First values of the presentation: ("caba_order_display", prsntf_read_only,0,[
 
Lav said:
Caba`drin said:
At the risk of revealing my ignorance...how did you get multiple presentations to run at once? Even with read_only presentations, I've always seen the more recent call force a currently running presentation to end in missions.
You can run a presentation without a background mesh (like "battle" presentation which shows minimap, combat stats and group controls). In this situation nothing prevents you from starting another presentation as far as I understand.

Yes, that's what going on at my lead_charge mission template. The presentations are customized battle presentation, caba's battle order and compass.
 
Caba`drin said:
Hrm, I don't want to derail the thread (so feel free to tell me to get lost) but whenever I start another background-less, read_only presentation while battle is running, battle stops running. First values of the presentation: ("caba_order_display", prsntf_read_only,0,[
So you are running one transparent presentation just fine, am I reading you right? If so, then maybe the order in which presentations are started has a difference? Perhaps you must start read-only presentations before you start the regular one, or vice versa? Also, are you running WSE? It could make a difference as well. Finally, maybe the game engine doesn't like it when presentations overlap? The last one is really a wild guess, but still.
 
Caba`drin said:
Hrm, I don't want to derail the thread (so feel free to tell me to get lost) but whenever I start another background-less, read_only presentation while battle is running, battle stops running. First values of the presentation: ("caba_order_display", prsntf_read_only,0,[

caba_order_display has presentation_set_duration operation at ti_on_presentation_run.
That's the point I asked. The operation's not only effect caba_order_display but also battle presentation.
 
I have uploaded current state of the file to MB Repository.

http://www.mbrepository.com/file.php?id=3478

Currently working on operations for scene and mission handling. After that planning to move to presentation operations, agent and scene prop handling.

Unfortunately the work slowed down so failed to complete by today. Also, didn't yet write the tests for many operations marked "4research".

I am not closely familiar with multiplayer operations, so if someone wants to volunteer for the task, he would be extremely welcome.

Comments, suggestions and criticism are welcome.
 
This is very nice :grin:.

A small suggestion would be adding table of contents searching that we usually see in large text files.

ie.

Code:
# TABLE OF CONTENTS
################################################################################
#
#  1. OPERATION MODIFIERS.  S001


Code:
# OPERATION MODIFIERS S001

So we can find the Operation Modifiers section by searching for S001
 
Back
Top Bottom