Normal M&B Module System for version 1.010

Users who are viewing this thread

No problem with the wait, my lord.  I think you have done and handled everything better than could be expected.  Keep up the good work...and take a moment to enjoy what you've done.  I have been here since the begining, and must admit, it was worth the wait, and you've made it fun while waiting.  My best wishes to you all, a good team is hard to come by.
 
I ran a diff on this versus v.903 Module system (the code base for Onin no Ran). Aside from all the sick stuff to be done with tableaus, here's proof Armagan and Co. listens to the modding community (if there was any doubt before), from the Most Wanted Module System Additions thread:

Fujiwara said:
Various bitwise operations:

val_shift_left (val_shift_left,>dest>,<n places>) : dest = dest << n
val_shift_right : dest = dest >> n

store_and (store_and,<dest>,<op1>,<op2>) : dest = op1 & op2
store_or : dest = op1 | op2
store_xor : dest = op1 ^ op2
store_not : (store_not,<dest>,<op1>) : dest = ~op1

This would make the implementation of bitfields for custom flags much cleaner and less bug-prone

What I found in the header_operations.py file:
Code:
val_or                 = 2114   #dest, operand ::       dest = dest | operand
				# (val_or,<destination>,<value>),
val_and                = 2115   #dest, operand ::       dest = dest & operand
				# (val_and,<destination>,<value>),
store_or               = 2116   #dest, op1, op2 :      dest = op1 | op2
                                # (store_or,<destination>,<value>,<value>),
store_and              = 2117   #dest, op1, op2 :      dest = op1 & op2
                                # (store_or,<destination>,<value>,<value>),

Plus, this little tidbit:
Code:
troop_sort_inventory                   = 1511	# (troop_sort_inventory,<troop_id>),

No more bubble sort routines taking up way too much code. Just one line...

Thank you, Armagan. Thank you!
 
Fujiwara said:
Code:
val_or                 = 2114   #dest, operand ::       dest = dest | operand
				# (val_or,<destination>,<value>),
val_and                = 2115   #dest, operand ::       dest = dest & operand
				# (val_and,<destination>,<value>),
store_or               = 2116   #dest, op1, op2 :      dest = op1 | op2
                                # (store_or,<destination>,<value>,<value>),
store_and              = 2117   #dest, op1, op2 :      dest = op1 & op2
                                # (store_or,<destination>,<value>,<value>),

Fuji, I'm a little confused about how the logical operators work, could you elaborate? I tried running this code:
Code:
      (assign, ":1or2", 1),
      (val_or, ":1or2", 2),
      (try_begin),
        (eq, ":1or2", 1),
        (display_message, "@PASS!"),
      (else_try),
        (display_message, "@FAIL!"),
      (try_end),
      (try_begin),
        (eq, ":1or2", 2),
        (display_message, "@PASS!"),
      (else_try),
        (display_message, "@FAIL!"),
      (try_end),
      (try_begin),
        (eq, ":1or2", 3),
        (display_message, "@PASS!"),
      (else_try), :lol:
        (display_message, "@FAIL!"),
      (try_end),

and got FAIL FAIL PASS when I would expect PASS PASS FAIL. :?:

I don't think it means what I think it means.  :cool:
 
dstemmer said:
and got FAIL FAIL PASS when I would expect PASS PASS FAIL. :?:
Looks like it is really not just logic, as I thought at first, but bitwise operation as Fujiwara wanted.
In binary 1=01, 2=10, 3=11
So
01 | 10 = 11 = 3
 
Rongar said:
dstemmer said:
and got FAIL FAIL PASS when I would expect PASS PASS FAIL. :?:
Looks like it is really not just logic, as I thought at first, but bitwise operation as Fujiwara wanted.
In binary 1=01, 2=10, 3=11
So
01 | 10 = 11 = 3

Ah, I get it, looked up bitwise operations on wikipedia. Unfortunately I have to wait until next semester for my theory of computation class so I don't think I grasp the full implications of having these bitwise operators yet. If anybody can give a practical example of them being used in the module system I'd love to take a look at it.
 
wow the file is under 1mb thats quite small.dont you think  :wink:

EDIT:sorry if im stupid but i have no idea how to start this up.do i have to put
      the folder into my m&b folder or something? :neutral:
 
grailknighthero said:
Just out of curiosity, what use do we have for bitwise functions?  Allows us to mess around with header file hex code more?
I guess they can be useful to work with item's modifiers.

Browncheese,
start from here http://forums.taleworlds.com/index.php/topic,5408.0.html
 
Got python not recognized upon building module.
I got around it by copying the build_module file from an earlier version.
Works a treat.
Has no one else encountered this?
The module system was downloaded several times, none worked.
 
Holy Jesus, haven't had a hardon that big since i turned 20, my wife sure's gonna be happy. Thank you, Armagan.
 
.... urm... right

Anyway, thanks armie! BoW will return, with more great ideas for you to put in M&B 2 :razz:
 
I found a spelling mistake that I dont think was there before.
module_troops.py, line 818. It says #Headwaer instead of #Headwear.
Not much, and it's #'d out, so it doesn't change anything, but still...
 
Back
Top Bottom