Inarion的最近内容

  1. [solved] Global variables getting overwritten/deleted

    Somebody 说:
    BTW, that script does reset slots, but only for food and books, and if you took care to place your slots outside their value range for different items, then you should be fine.
    The actual problem was that I initialized all slot values in this script - most of them static values but one slot was thought to save the xp-progress of the item - and they got reinitialized again and again...

    GetAssista 说:
    It has not. module_constants is just what it says - list of easy_to_remember and telling-names-when-in-code constants. You can use only raw numbers just as correctly, when referring to slots. Or you can use variables in a loop as slot indices, which can be very useful.
    In fact, all those constants are replaced by their related numbers on compile, that's all
    Yeah, that makes more sense... :wink:
  2. [solved] Global variables getting overwritten/deleted

    Yes, of course the slot has to be defined in module_constants.py
    My question was whether I had to make a declaration somewhere: "slot_xyz has to be used as an troop slot; slot_123 has to be used as an item slot; etc."
    But that question is now answered.


    And I got another answer, which seems to be way less mysterious than expected:
    All the time I thought the script where I set the slot values (also the initial xp for the items) would only be launched once at the creation of a new game. But at the bottom of module_simple_triggers.py one can find:
    插入代码块:
       #This corrects for an error in 1.105
       (call_script, "script_initialize_item_info"),
        ]),
    Don't know, when this trigger fires, but it does quite often (at least once a day).
    I suppose when kt0 released his code this little nasty trigger was still non-existent. So back then his scripts would work fine...

    I still don't know why the bank script didn't work but will find out some day. :wink:
  3. [solved] Global variables getting overwritten/deleted

    Egbert 说:
    I didn't know there was a low limit on slots, I have 259 party slots in one of my mods and it seems to work. I thought you just shouldn't overlap slots with each group (party, troop, faction).
    I didn't know that either. I just read it somewhere in this board. But maybe it has been changed or the poster was wrong?

    GetAssista 说:
    Umm, slots are like array cells. Each troop/party/faction/... have a specific array, accessible through slots. # of slot = array index. So there are pretty lot of of those cells

    So I guess all your problems are indeed due to overlapping slots and you programming relying on only 256 of them (for what entity, btw?)
    Thanks for the explanation. That makes sense.
    And to define what kind of slot it is I just have to use it appropriately? E.g.: I defined the slot "slot_item_experience" and by the following
    插入代码块:
    (item_set_slot, "itm_testitem", slot_item_kt_experience, 0),
    I declare it as an item slot?

    Back to the overwritten-slot-issue. Assuming item slots do not interfere with troop/town/... slots I have no idea where the problem is. Because I just added no more than 8 item slots. (And tried different slot numbers: 5 to 13, 70 to 78, 190 to 198...) And their values should only be changed by 2 scripts...
    And to answer your question: I do not have to rely on only 256 slots for a certain entity because I don't need that many slots. In my 2nd post I only asked about the maximum number of slots because I then thought of slots as registers.
  4. [solved] Global variables getting overwritten/deleted

    Egbert 说:
    Started a new game? Does it only happen once a week when the simple trigger fires?
    Yes, I started a new game to get the changes in the game_start script to work.
    Do you have a certain simple trigger in mind? I believe they all have different intervals...
    I haven't yet observed a fixed interval in which the reset occurs, but as mentioned I can force it by losing a battle (maybe because it takes a while until I'm free again). I'll watch out for clues...

    GetAssista 说:
    check if slots/global vars you use for moneys, are cross-used somewhere else. Just do a full text search inside module system directory for var name, and check module_constants for overlapping slots
    Garnier used $g_player_deposit to store the deposit. (Each bank accessed the same "bank account")
    But when I search the *.py files all I get is:
    插入代码块:
    Search "$g_player_deposit" (0 hits in 0 files)
    (I took out Garnier's pieces of code)

    Concerning the slots I suppose you're right. I guess there is no single slot number that is not already used. But how is it possible then to preserve the values of one or a few slots throughout the whole game? (I adapted kt0's leveling items - but never came across any complaints saying it wouldn't work properly. So I suppose that problem is more personal and less global?)
    I'm not sure I understood the way slots are working: There are up to 256 (00 to FF) slots in each of which I can store a value. But these values can't stay there - are they written to different storages? (Slot number 5 for example is used at least 20 times for different slots) Or did I get it totally wrong and there are 256 slots for each slot-enabled object?  :???:

    I hope I didn't write completely confusing for I sometimes lack the vocabulary to say what I intended... :wink:

    Thanks for your help,
    Inarion
  5. [solved] Global variables getting overwritten/deleted

    Hi, I was trying out Garnier's bank script today. But soon I realized that in certain intervals my deposit changed to zero. (e.g. after being defeated and captured in a battle or after having participated in a tournament, maybe even after just waiting some time on the world map) Same thing...
  6. OSP Kit Combat Combat Abilities

    Hi there,
    I have a quite general question concerning the xp-penalty-script:
    Can anyone confirm or decline that it actually does something with the player's experience?

    I tried to implement a similar script this weekend, but as it seems my character is only able to gain but never to lose experience. (Maybe there is a difference between M&B and Warband?)

    Any help would be appreciated.

    Greets
    Inarion
后退
顶部 底部