Recent content by SPD_Phoenix

  1. SPD_Phoenix

    Modding Q&A [For Quick Questions and Answers]

    MadocComadrin said:
    SPD_Phoenix said:
    If that is the case, it was a bad design. Empty/unassigned placeholder should be null, not zero. I thought that the module system defined some values to be read as integer from the slots, so null and negative are set to zero. Anyway, I don't use uninitilized slots, so I get away with a lot of bug.
    Bad design? Integers in most languages have either been automatically assigned to 0 or to whatever was in that chunk of memory.
    Then player id should not be zero.

    Edit: not just player id, most of the stuffs that have an id of zero should be invalid, like no_item in module_items. Then it will be a little easier to work with unassign/uninitialized slots, party/troop id,... 
  2. SPD_Phoenix

    Modding Q&A [For Quick Questions and Answers]

    Ikaguia said:
    SPD_Phoenix said:
    I think there a few things you should be clear:
    - Slot: in simple term, slots are memory allocation created to store information for easy recall/use later. It named for what it will store or do. The content of uninitialized slots will be nothing (null is not the same as zero) or -1 (not valid or not exist). Value must be assign to slots be for they can be used later or they won't do anything. If you change the name of the slot, you will have to change all the code referencing it to use the new name.

    that's wrong...
    all slots are set to 0 by default. that's the reason of many bugs like player troops as guards(player = 0) because the guard slot was not set.
    If that is the case, it was a bad design. Empty/unassigned placeholder should be null, not zero. I thought that the module system defined some values to be read as integer from the slots, so null and negative are set to zero. Anyway, I don't use uninitilized slots, so I get away with a lot of bug.
  3. SPD_Phoenix

    Modding Q&A [For Quick Questions and Answers]

    ThaneWulfgharn said:
    SPD_Phoenix said:
    ThaneWulfgharn said:
    I don't get it.I changed it to spr_banner_x from mesh_banner_x that it was still nothing.Say,can we create a new function slot_troop_banner to set the place of slot_troop_banner_scene_prop?
    Does not matter. As long as you can assign proper scene prop IDs to those slots so the game can understand. Or you will have to rewrite the code.

    I'm still not very clear on what you try to achieve. Did you want to assign banner to lords using a loop instead of manually one by one? If so, how many lords and how many banners? Are you including companions?
    You see the script that assigns banners to faction:
          (faction_set_slot, "fac_kingdom_1", slot_faction_banner, "mesh_banner_lannister"),
          (faction_set_slot, "fac_kingdom_2", slot_faction_banner, "mesh_banner_kingdom_b"),
          (faction_set_slot, "fac_kingdom_3", slot_faction_banner, "mesh_banner_kingdom_c"),
          (faction_set_slot, "fac_kingdom_4", slot_faction_banner, "mesh_banner_kingdom_a"),
          (faction_set_slot, "fac_kingdom_5", slot_faction_banner, "mesh_banner_kingdom_d"),
          (faction_set_slot, "fac_kingdom_6", slot_faction_banner, "mesh_banner_kingdom_e"),
          (faction_set_slot, "fac_kingdom_7", slot_faction_banner, "mesh_banner_kingdom_7"),
          (faction_set_slot, "fac_kingdom_8", slot_faction_banner, "mesh_banner_kingdom_8"),
          (faction_set_slot, "fac_kingdom_9", slot_faction_banner, "mesh_banner_kingdom_9"),
          (faction_set_slot, "fac_kingdom_10", slot_faction_banner, "mesh_banner_kingdom_10"),
          (faction_set_slot, "fac_kingdom_11", slot_faction_banner, "mesh_banner_kingdom_11"),
          (faction_set_slot, "fac_kingdom_12", slot_faction_banner, "mesh_banner_kingdom_f"),
    It is easy.Lords have a quite harder script.If I make a function like this:
          (troop_set_slot, "trp_knight_1_2", slot_troop_banner, "mesh_banner_lannister"),
          (troop_set_slot, "trp_knight_1_3", slot_troop_banner, "mesh_banner_lannister"),
    It will be easier to add banners,and it would work for lords,companions and even SOLDIERS!
    I added the "slot_troop_banner" at module constants,but dosen't seem to work.
    I think there a few things you should be clear:
    - Slot: in simple term, slots are memory allocation created to store information for easy recall/use later. It named for what it will store or do. The content of uninitialized slots will be nothing (null is not the same as zero) or -1 (not valid or not exist). Value must be assign to slots be for they can be used later or they won't do anything. If you change the name of the slot, you will have to change all the code referencing it to use the new name.

    - Assigning banner:
    (troop_set_slot, "trp_knight_1_2", slot_troop_banner, "mesh_banner_lannister"),
    This is manual assigning. You can do this for each lord. However, you don't give the lords the mesh id (mesh_ ) from module_meshes. You should give them scene prop id (spr_ ) from module_scene_props. Even though they use the same texture and mesh, the internal code might use them differently. You can probably assigning the mesh id instead, but you will have to change other code to reference the mesh id as well. Use loop: when you want to assign sequential banner ids to sequential lord ids, it is most efficient to use loop so that lord_1 gets banner #1, lord_2 gets banner #2 and so on. Or you want to assign all lords (of the same faction or grouping) to use the same banner.

    - Adding new banners: you need to add them to module_meshes, module_scene_props, module_map_icons in the same order. Also need to add or modify code such as background color in module_scripts, selection presentation in module_presentations.

    First of all, you need to change your code to assign scene_prop ids to the slot (it was suggested earlier). That probably the main problem.
  4. SPD_Phoenix

    how to let my wife join my party?

    Thanks Lord Kinlar. Pretty simple way to do it. I will try to do the new code next weekend.
  5. SPD_Phoenix

    Modding Q&A [For Quick Questions and Answers]

    ThaneWulfgharn said:
    I don't get it.I changed it to spr_banner_x from mesh_banner_x that it was still nothing.Say,can we create a new function slot_troop_banner to set the place of slot_troop_banner_scene_prop?
    Does not matter. As long as you can assign proper scene prop IDs to those slots so the game can understand. Or you will have to rewrite the code.

    I'm still not very clear on what you try to archieve. Did you want to assign banner to lords using a loop instead of manually one by one? If so, how many lords and how many banners? Are you including companions?
  6. SPD_Phoenix

    how to let my wife join my party?

    Thanks Lord Kinlar for the suggestion. I will update the code when I have the time for it.

    An army of wives? What is you method of by passing the restriction?

    I am using additional spouse slots, but it needs a lot of codes to add 15 slots and condition check for the Sarranid, and varying for the Nord. Not to mention the relationship check. That is a mess.
  7. SPD_Phoenix

    Modding Q&A [For Quick Questions and Answers]

    Alakeram said:
    where do i find the lords range check? alot of them come with npc_kingdoms_begin, npc_kingdoms_end where do i find the end? or whould i just extend it to the new final lord? or is that even the lords? lol i know it has something to do with headers but i can't find them (unless they're hidden in troops.py)

    EDIT: ok i found out lords are lords_begin, lords_end and kings are kings_begin, kings_end but where do i find that in troops.py?
    Take a look at module_constants to see how those constants are assigned.
  8. SPD_Phoenix

    Warband on console

    How do you mod a console game?
  9. SPD_Phoenix

    Modding Q&A [For Quick Questions and Answers]

    tf_guarantee_range (archer), tf_guarantee_horse (cavalry), others are infantry. Don't know if that have changed or there is anything new.
  10. SPD_Phoenix

    Face and Name

    Export your character. Import back in new game. Change the skin color, hair color and style. Your character is back. You can also just copy the face code from one character export to another.

    If you want it in the module_system, you will have to by pass the face generation when starting new character. Face gen reset face code to defaut value when it starts.
  11. SPD_Phoenix

    Help custom recruit

    Money check should be in the condition block so the menu won't appear if you do not have enough money.
  12. SPD_Phoenix

    Merging mod weapons and items.

    Selective resource means you do not want to transfer (copy) the whole brf and texture folder over. In other words, you will only selectively transfer the models and textures you want. This save some memory (game won't have to load unused resources). It's not that complicated. You can delete unused mesh/texture form the brf. Just make sure you have everything in order.

    There's probably a guide or tutorial somewhere.
  13. SPD_Phoenix

    Modding Q&A [For Quick Questions and Answers]

    Sayd Ûthman said:
    Oh thank's phoenix, i will try this, but what i was intending to do is to make the trigger check this every friday aka the 5th day. so it check every 5 day, and the re-arm interval is to jump saturday and sunday. it is the correct way to do it ??
    I believe so.
  14. SPD_Phoenix

    Merging mod weapons and items.

    For personal use? If you are going to release the mod, then you will need permission first.

    Anyway, you are on the right track. For the items, the most difficult task would be transfering the selective resources (brf and dds files). After that, you can create the items as you wish or you can copy and modify the item code from the original mod.

    The character meshes: I suppose this is the face and body mesh. It will be much harder and require the module system. You can use multiple head and body meshes but you have to define a new race for each set.
  15. SPD_Phoenix

    Modding Q&A [For Quick Questions and Answers]

    @Sayd Ûthman
    This is a trigger that you wish to start 5 days into the game then every other day after that. All it does is checking the center religion, if it is "1" (for what ever it is), then put a prayer into the slot. Edit: with the condition, the trigger will only take effect if player start as islam.

    Trigger can be used without condition block. Every condition can be done in the consequence block. I would do it like this:

    (24 * 5 , 0, 24 * 2,
      [(eq, "$background_answer_5", cb5_islam),], # Edit: I see that you used this condition earlier. It is the only one that you need.
      [(try_for_range,":prayer_town",towns_begin,towns_end),
          (party_slot_eq,":prayer_town",slot_center_religion,1),
          (party_set_slot,":prayer_town",slot_town_has_prayer,1),
        (try_end),
        ]
      ),
    The problem with your code is that even with register used in the condition block, you can only transfer the last qualified center to the consequence block after the loop in the condition block is done. You can not break the loop, go to a different block then come back to the loop.
Top Bottom