Looking to access (insert information into) slots at Compile time.
I figured as much. I already know how to generate various things at Compile time. Thanks though.
I understand the lure of using Custom Troop Trees as a base for your mod, I mean, just about every M&B player wishes to create their own troops in game at some point. HOWEVER: Please understand, that very specific mini-mod (CTT) is not beginner friendly. CTT is almost completely written in Python, which is related to, but not the same as the language used in the ModSys. If you use CTT source as a base you should expect issues when using just about any other mod, as it is not very compatible friendly. Honestly, I would advise to start with just about any other base source for understanding how this all works. If you insist on using CTT's source as a base, you will be mostly on your own because you won't know how to explain which details are necessary to fix what is broken because their is a lot you won't realize you need to know. With all these things being said, if you are like me, you've just accepted the challenge, with your hard-headed ass, lol. But for real, CTT has a steeper learning curve than most other mod sources. So expect headaches, learning, confusion, learning, "start over remarks", learning, maybe some help, learning and taking plenty of breaks to keep from being confused with headaches. Regardless, all the best to you, good luck. Cheers! 07
Those lines are dictating where to add the code that's in the "codeblock" referred to as "not_in_party"Taragoth said:
(assign, "$talk_context", tc_ally_thanks),
not_in_party = [ "code" "code stuff" "more code stuff"
]
I wished it was, but that displays the "@" and still says "{" is an "unrecognized token" but come to find out, "}" is acceptable even by itself. I dunno?!SupaNinjaMan said:
Thank ya kindly![Bcw]Btm_Earendil said:
("create_mercs_items_array",
[
(assign, ":offset", 0), # starting "point" (slot) / distance between elements and starting point
(assign, ":element_counter", 0), # a variable that's used to determine the size of an array
(try_for_range, ":troop_id", mercenary_troops_begin, mercenary_troops_end), # loops through the troop id ranges
(gt, ":troop_id", -1), # any troop id value greater than -1 passes this conditional operation
(assign, ":array_id", ":troop_id"), # assigns the array id variable value the same as the troop id value
(val_add, ":offset", 1), # adds to offset to account for the slot needed to store the array id
(assign, ":array_id_slot", ":offset"), # assigns the array id slot variable value as the same as the offset value
(troop_set_slot, mercs_items_array, ":array_id_slot", ":array_id"), # assigns a specific slot (array_id_slot) of the items array (mercs_item_array) with a value (array_id)
(val_add, ":offset", 1), # adds to offset to account for the slot needed to store the array size
(assign, ":array_size_slot", ":offset"), # assigns the array size slot variable value as the same as the offset value
(troop_get_inventory_capacity, ":inv_cap", ":troop_id"), # gets the inventory capacity of the troop that passed the conditional operation
(try_for_range, ":inv_slot", 0, ":inv_cap"), # a loop through the troop's inventory capacity
(troop_get_inventory_slot, ":item_id", ":troop_id", ":inv_slot"), # gets the item id for each item in the troop's inventory according to its position in the troops capacity
(ge, ":item_id", 1), # any item id greater than or equal to 1 passes this conditional operation
(val_add, ":element_counter", 1), # count how many items pass the conditional operation for use in the array's size property
(val_add, ":offset", 1 ), # adds to offset for each item that passes the conditional operation to account for the slot needed to store each item's id
(assign, ":array_element_slot", ":offset"), # assigns the array element slot variable value the same as the offset value
(troop_set_slot, mercs_items_array, ":array_element_slot", ":item_id"), # assigns a specific slot (array_id_slot) of the items array (mercs_item_array) with a value (array_id)
(try_end), # end of operations to try within the (inventory) loop
(troop_set_slot, mercs_items_array, ":array_size_slot", ":element_counter"), # assigns a specific slot (array_size_slot) of the items array (mercs_item_array) with a value (element_counter)
(assign, ":element_counter", 0), # assign(/reset) the element counter variable value
(try_end), # end of operations to try within the (troop) loop
]),
You are 100% correct, I could/should have chosen a simpler test but honestly once I realized how difficult it would be to use 3 types of info together in an array, with what I knew then, my interest was piqued and it was, "game on!", lol.Ruthven said:
No worries, misunderstandings happen, I understand that, lol. And I by no means am hostile in my replies. (just in case any of them were perceived as such)Ruthven said:
The end goal is literally spelled out, IDK what else to say, just a project to help me understand how to use arrays with the items in a troops' inventory.Ruthven said:
Thanks! Wilco!kalarhan said:
I understand that. That goes without saying really because that applies to just about anything that one person knows and another is learning. At the same time I'm not gonna curtail the "method of my madness" just because some people can't fathom my means. If they wanna answer, then answer, if they don't wanna, then don't. Makes no matter to me. I promise I won't be disappointed if I do or don't understand why they will or won't answer. I'm one of the last persons to be offended by something someone wrote about something I like to do for fun knowing that they know nothing about me. If we all only really knew each other... but since we don't, I'm a very reasonable person who likes to joke around, once I know ya, but one thing I don't do, is assume things about people without proof, nor do I tolerate it. I also like to type a lot late at night while I'm racking my brain over the things I'm tryin to do with this script stuff. lolRodrigo Ribaldo said:
kalarhan said:
Were these statements really necessary? I can't ask questions? Who said I was worried, and who knows better than me what I should concentrate on? My life is in order, this is a hobby and I just like to know things. Come on now. But I do like the "check out this thing" thing.Rodrigo Ribaldo said: