Better MS Scripting Reference: header_operations expanded

Users who are viewing this thread

I actually wanted to ask you about these two descriptions. I have read them but found them to be incomplete or lacking informations.

Your version
Code:
val_min = 2110

    (val_min, <destination>, <value>),
    Assigns the right value if the right value is less than left.

val_max = 2111

    (val_max, <destination>, <value>),
    Assigns the right value if the right value is greater than left.
compared to the current original version
Code:
val_min                    = 2110    # (val_min, <destination>, <value>),
                                     # Assigns <destination> := MIN (<destination>, <value>)
val_max                    = 2111    # (val_max, <destination>, <value>),
                                     # Assigns <destination> := MAX (<destination>, <value>)
I personally find the mathematic formula easier to understand. Your descriptions are also missing the information, that it takes the lowest value of both variables. Currently your description at val_min (val_max) is not telling what happens if the right value is higher (lower) than the left one.

For the syntax stuff I meant the changes about quick strings and translation:
@ - creates quick string. The file quick_strings.txt should be deleted before release. As variables.txt. When you add new quick_string/variable it will be attached to the end of the txt file for save compatibility. And deleted quick_string/variable will still be there. {!} - don't create text for translation {reg0?One of your prisoners, :} - If reg0=1 then add text "One of your prisoners, :"
 
If you are familiar with mathematics expressions than it's easier for you to write compact. But it's lack the description. Logicaly there two oposite possibilities. For example, max(x, y). Does this mean that maximum value of X and Y will be assigned to result or that X will be trancated with maximum at Y value. So there are X or Y value will be returned.

If you are mathematition than you believe only in one possibility. But for others it's not obvious. The description that I found on the Internet is very compact, simple and strict.
Python:
    (val_max, <destination>, <value>),
   #  Assigns the right value if the right value is greater than left.
You compare right value and left. If right value is greater than it will be assigned to left value. Otherwise don't do anything. Does it need to be writen: "don't do something that I wasn't telling you about", seriosly?

As for syntax I found this in the file "process_init.py"
Python:
from module_info import *
from process_operations import *
import os

print "Initializing..."

try:
  os.remove(export_dir + 'tag_uses.txt')
except:
  a = []
try:
  os.remove(export_dir + 'quick_strings.txt')
except:
  a = []
try:
  os.remove(export_dir + 'variables.txt')
except:
  a = []
try:
  os.remove(export_dir + 'variable_uses.txt')
except:
  a = []

variables = []
variable_uses = []
try:
  file = open("variables.txt","r")
  var_list = file.readlines()
  file.close()
  for v in var_list:
    vv = string.strip(v)
    if vv:
      variables.append(vv)
      variable_uses.append(int(1))
  save_variables(export_dir, variables, variable_uses)
except:
  print "variables.txt not found. Creating new variables.txt file"
As I can understand this 4 files should be deleted before major release: tag_uses.txt, quick_strings.txt, variables.txt, variable_uses.txt. They will be newly generated. Also WRECK doesn't recognise caps letters and it's adding new variables (with low letters) to variables.txt. So you shouldn't use caps in the global variables.
Someone more experienced can reveal more information, I think.
 
If you are mathematition than you believe only in one possibility. But for others it's not obvious. The description that I found on the Internet is very compact, simple and strict.
I am aware of that I sit in a comfortable corner and the description needs improvement (as do some other ones with mathematic formulas).
You compare right value and left. If right value is greater than it will be assigned to left value. Otherwise don't do anything. Does it need to be writen: "don't do something that I wasn't telling you about", seriosly?
I only think that you a trapped a little bit in a similar corner, the programmer one. Someone who has never programmed before and for whom this would be one of the first steps (we have such people, I assure you), wouldn't understand your description either because they would not be sure what happens with the value if the sentence in your description isn't fullfilled.
I am not trying to talk bad your description, it's a good first step. I only think we need something more clear.

As for syntax I found this in the file "process_init.py"
Python:
from module_info import *
from process_operations import *
import os

print "Initializing..."

try:
os.remove(export_dir + 'tag_uses.txt')
except:
a = []
try:
os.remove(export_dir + 'quick_strings.txt')
except:
a = []
try:
os.remove(export_dir + 'variables.txt')
except:
a = []
try:
os.remove(export_dir + 'variable_uses.txt')
except:
a = []

variables = []
variable_uses = []
try:
file = open("variables.txt","r")
var_list = file.readlines()
file.close()
for v in var_list:
vv = string.strip(v)
if vv:
variables.append(vv)
variable_uses.append(int(1))
save_variables(export_dir, variables, variable_uses)
except:
print "variables.txt not found. Creating new variables.txt file"
As I can understand this 4 files should be deleted before major release: tag_uses.txt, quick_strings.txt, variables.txt, variable_uses.txt. They will be newly generated. Also WRECK doesn't recognise caps letters and it's adding new variables (with low letters) to variables.txt. So you shouldn't use caps in the global variables.
Someone more experienced can reveal more information, I think.
I think I have recently read about those files but I am still working my way through it for the Modding Guide. Are they getting generated in the folder of the Module System or the Mod itself at compiling or when starting the game? And why would you delete them before major release?
 
I think my description is full. Logically it's clear that if I don't add additional description than you shouldn't do anything. I don't like flowing descriptions that tells nothing new. For me such compact description is some kind of professional beaty. It's kind of balance between less talking and giving full and wide picture.

Why delete this files? When you remove old variables or quick_strings in the module system they will remain in txt files. For example you can add a lot of quick_strings when debugging and then remove them.
 
I think my description is full. Logically it's clear that if I don't add additional description than you shouldn't do anything. I don't like flowing descriptions that tells nothing new. For me such compact description is some kind of professional beaty. It's kind of balance between less talking and giving full and wide picture.
I will think about it and ask others about their opinion. Perhaps I am stuck in my own thoughts too much.
Will think about those txt files too.
 
@Kentucky 『 HEIGUI 』 James suggested following formulation:
Code:
val_min                    = 2110    # (val_min, <destination>, <value>),
                                     # Assigns <destination> := MIN (<destination>, <value>)
                                     # Assigns the lesser of either number to the first variable
val_max                    = 2111    # (val_max, <destination>, <value>),
                                     # Assigns <destination> := MAX (<destination>, <value>)
                                     # Assigns the greater of either number to the first variable
 
I will think about it and ask others about their opinion. Perhaps I am stuck in my own thoughts too much.
You are right, clarity (for newbies) is a priority, not elegant, but unintuitive formulations. Just like with coding styles.
A wiki with examples would be most helpful for operations, but it's too late in the game now.
 
Last edited:
A wiki with examples would be most helpful for operations, but it's too late in the game now.
Out of scope for the moment, with the Modding Guide I have enough work at hand already.
There was one a few years ago but the host stopped paying for the domain.
Also this. What frustrates me the most at documenting informations is the amount of times that people created some Modding Wiki page and then they were gone after a short time, with all the informations they contained. I would have been more happy if people would have invested their time to update Jik's old Module System tutorial either via forum posts or another PDF. Swyter luckily managed to restore one of the lost wikis here:

 
Out of scope for the moment, with the Modding Guide I have enough work at hand already.

Also this. What frustrates me the most at documenting informations is the amount of times that people created some Modding Wiki page and then they were gone after a short time, with all the informations they contained. I would have been more happy if people would have invested their time to update Jik's old Module System tutorial either via forum posts or another PDF. Swyter luckily managed to restore one of the lost wikis here:


I also haven't time to create a full wiki or manual. But I need to store some investigations somewere mostly for myself. And I think wiki is the proper way. Thanks for the link. I used Wayback Machine to get information form old wiki. But some information was unavalible.
 
You are right, clarity (for newbies) is a priority, not elegant, but unintuitive formulations. Just like with coding styles.
A wiki with examples would be most helpful for operations, but it's too late in the game now.

I think it's not too late. I started to mod (tweak) few years ago. For me it's all new. I prefer old Warband engine because of Taleworlds agenda on modding. I prefer some help for modding like K700 does like adding new operators, clarifying mechanics and so on.
 
I also haven't time to create a full wiki or manual. But I need to store some investigations somewere mostly for myself. And I think wiki is the proper way. Thanks for the link. I used Wayback Machine to get information form old wiki. But some information was unavalible.
Ah, I was not refering to your wiki in my frustration statement, I hope you did not feel mentioned by it. You are using the fandom one as base which has far higher chances to persist in contrast to the other wikis which got all hosted by individuals and perished with time.
 
Ah, I was not refering to your wiki in my frustration statement, I hope you did not feel mentioned by it. You are using the fandom one as base which has far higher chances to persist in contrast to the other wikis which got all hosted by individuals and perished with time.

I'm not disapointed. Even if you mentioned it, for my opinion, it's better to know others opinions than not. It helps to criticise your beliefs. Also, secretly, I'm not happy with fandom wiki. But it's something at least.
 
I have updated the GitLab, find the updated file here:


@Vetrogor , I integrated all informations of mbcommands wiki up to your latest change at 12:18, 20 August 2021‎ (take note that I did some little commits which I haven't announced here). I kept out the following two due to make things sure first:
(position_get_distance_to_terrain, <fixed_point>, <position>), and (position_get_distance_to_ground_level, <fixed_point>, <position>), have both gotten a change in syntax, always replacing <destination> with <fixed_point>. Is the result then always given to reg0 or reg1 or what is the destination of it?
 
Back
Top Bottom