Weapon Creation Script (in progress, almost complete)

正在查看此主题的用户

It's an item. I am trying to make an item creation menu, but I need to save what item it is, thus I need to save a specific item. for example "itm_war_bow" for a war bow.

I realize my itp versus itm mistake
 
Ok, item id is integer, so it's assignable to variable or register. But to completely save an item and it's stats, you need to save it's imod too.
I can't find the set values how an imod modifies the item's stat, I only find the bit mask on header_item_modifier.py.
 
Alright, I have figured out my original problem to only hit another.
I am trying to use the troop_add_item command, and so far it is half working.
In earlier coding it sets:
插入代码块:
(assign, "$imod_style", imodbit_lordly),
And when adding the item to inventory it says:
插入代码块:
(troop_add_item, "trp_player", "$creation", "$imod_style"),

Now it will give me the right item that I have set creation to, but it will not give me any imod styles.
Does anyone know why?
 
Ok, I am trying to make a menu creation menu which I might release depending on the final size (is currently just under 100 lines long and I've only just started) But i am quickly trying to set the price for making it a imodded item. For example a Lordly short sword rather than a short sword. But I can't find the price increase for buying an imodded item. Can anyone help me for each of the imods?
 
This is data set from rubik's custom commander mod:
modifiers = [
  (imod_plain, 100, 0),
  (imod_cracked, 50, -1),
  (imod_rusty, 55, -1),
  (imod_bent, 65, -1),
  (imod_chipped, 72, -1),
  (imod_battered, 75, -1),
  (imod_poor, 80, -1),
  (imod_crude, 83, -1),
  (imod_old, 86, -1),
  (imod_cheap, 90, -1),
  (imod_fine, 190, 1),
  (imod_well_made, 250, 1),
  (imod_sharp, 160, 1),
  (imod_balanced, 350, 1),
  (imod_tempered, 670, 1),
  (imod_deadly, 850, 1),
  (imod_exquisite, 1450, 1),
  (imod_masterwork, 1750, 1),
  (imod_heavy, 190, 1),
  (imod_strong, 490, 1),
  (imod_powerful, 320, 1),
  (imod_tattered, 50, -1),
  (imod_ragged, 70, -1),
  (imod_rough, 60, -1),
  (imod_sturdy, 170, 1),
  (imod_thick, 260, 1),
  (imod_hardened, 390, 1),
  (imod_reinforced, 650, 1),
  (imod_superb, 250, 1),
  (imod_lordly, 1150, 1),
  (imod_lame, 40, -1),
  (imod_swaybacked, 60, -1),
  (imod_stubborn, 90, 1),
  (imod_timid, 180, 1),
  (imod_meek, 180, -1),
  (imod_spirited, 650, 1),
  (imod_champion, 1450, 1),
  (imod_fresh, 100, 1),
  (imod_day_old, 100, -1),
  (imod_two_day_old, 90, -1),
  (imod_smelling, 40, -1),
  (imod_rotten, 5, -1),
  (imod_large_bag, 190, 1)]
2nd columns are price in percent, 3rd columns are 1s for good imods, and -1s for bad ones.
 
(troop_add_gold, <merchant_id>, <gold>),
you can get the merchant id for any town from it's slot.
(party_get_slot, ":merchant", ":town_id", slot_town_armorer), to get town id's armor merchant.
 
Ok, Seeing as this has become my post where I am talking about my creation menu... I have a problem with coding:
插入代码块:
(24,
   [
(try_for_range, ":center_no", towns_begin, towns_end),
        (try_begin),
        (party_get_slot, ":temp1", ":center_no", slot_town_arms_time),
           (try_begin),
              (gt, ":temp1", 1),
              (val_sub, ":temp1", 1),
              (party_set_slot, ":center_no", slot_town_arms_time, ":temp1"),
              (assign, reg1, ":temp1"),
              (str_store_party_name, s1, ":center_no"),
              (display_message,"@You have {reg1} days until your weapon in {s1} is ready to be picked up."),
           (else_try),
              (eq, ":temp1", 1),
              (str_store_party_name, s1, ":center_no"),
              (display_message,"@You have a weapon ready to be picked up at {s1}."),
           (try_end),
        (try_end),

        (try_begin),
        (party_get_slot, ":temp2", ":center_no", slot_town_armor_time),
           (try_begin),
              (gt, ":temp2", 1),
              (val_sub, ":temp2", 1),
              (party_set_slot, ":center_no", slot_town_arms_time, ":temp2"),
              (assign, reg2, ":temp2"),
              (str_store_party_name, s2, ":center_no"),
              (display_message,"@You have {reg2} days until your armor in {s2} is ready to be picked up."),
           (else_try),
              (eq, ":temp2", 1),
              (str_store_party_name, s2, ":center_no"),
              (display_message,"@You have armor ready to be picked up at {s2}."),
           (try_end),
        (try_end),

        (try_begin),
        (party_get_slot, ":temp3", ":center_no", slot_town_horse_time),
           (try_begin),
              (gt, ":temp3", 1),
              (val_sub, ":temp3", 1),
              (party_set_slot, ":center_no", slot_town_arms_time, ":temp3"),
              (assign, reg3, ":temp3"),
              (str_store_party_name, s3, ":center_no"),
              (display_message,"@You have {reg3} days until your horse in {s3} is ready to be picked up."),
           (else_try),
              (eq, ":temp3", 1),
              (str_store_party_name, s3, ":center_no"),
              (display_message,"@You have a horse ready to be picked up at {s3}."),
           (try_end),
        (try_end),
(try_end),
          ]),

This scripting has a problem as it will never allow the slot_town_X_time to lower below 29, even sometimes raising it to 29 from 26. The code that set's slot_town_X_time works fine by the way. Any idea's where I went wrong?

P.S. ANYONE USES THIS CODE BEFORE I RELEASE THE FULL VERSION AND I KILL YOU!!!
 
Eagle, I like your idea. If I may give you suggestion, I have 2 suggestion for you to improve your item creation script:
1. I see on your script (even you dont post it, I know from the trigger above), when you order the item to the merchant, you save the time he needs to create the item in days and save it to slot. You decrease the slot value every 24 hours until it reach 1.
Well, I suggest you to get the current day the game passed, then added with days he needs to create the item, and save the value to slot.
It will make your trigger slimmer, because you only need to get current day and comparing with the slot, no need to decrease the value. To get the current day, use:
(store_current_day, ":cur_day"),
2. I think it will be better if messages for item ready notifications from 1 town, compiled as ome message.
Instead of have messages:
you have horse ready to pick at sargoth
you have armor ready to pick at sargoth
you have weapon ready to pick at sargoth
it will be better to get one message:
you have horse, armor and weapon ready to pick at sargoth

 
Yea, I though of using that after I had made it.
Anyways, I found the problem... If you look at the:
(party_get_slot, ":temp2", ":center_no", slot_town_armor_time),
Area of the script, you will notice that when I the re-set the slot, it set it to:
(party_set_slot, ":center_no", slot_town_arms_time, ":temp2"),
Just thought that I would put that out there. Finally, I finished the actual game menu to make this work, It's over 2000 lines long, so if you want to make something similar feel free to use this script. All I did to make this work was add the slots:
#Eagles
slot_town_arms_time  = 111
slot_town_arms_item  = 112
slot_town_arms_imod  = 113
slot_town_armor_time = 121
slot_town_armor_item = 122
slot_town_armor_imod = 123
slot_town_horse_time = 131
slot_town_horse_item = 132
slot_town_horse_imod = 133
Then you just assign the item and the mod you want on your weapon to the slot, before using game menu's if slot_town_arms_time, slot_town_armor_time or slot_town_horse_time is equal to one to pick them up.
 
后退
顶部 底部