搜索结果: *

  1. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    Thanks for the help everyone.  I've pretty much finished my little project of adding persistant equipment to Native Multiplayer. It's been a great learning experience for certain!  I'm not quite sure what I am going to do with the mod from this poin though.  I think all I wanted was to just figure it out.
  2. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    Somebody 说:
    Why can't you just write your own script and call that instead of script_multiplayer_calculate_cur_selected_items_cost?

    That's what I have done and it seems to work :smile:  Thanks
  3. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    Somebody 说:
    There is none - script_multiplayer_calculate_cur_selected_items_cost gets called every time, and a text overlay is created in g_presentation_obj_item_select_12.

    I've rewritten the process and I am simply trying to insert into reg0 from a different location.  I've tried defining a new player slot but this doesn't seem to work.  Any suggestions?
  4. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    Somebody 说:
    Slots are just readable index values - so just don't define slots with the same index as ones that are in use for the same type of objects.

    Thanks for this.

    Second question:

    Anyone know which "slot" is used to store the 'Total Cost' element within the multiplayer selection GUI?
  5. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    What are the rules for adding additional slots?
  6. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    Hey Folks!

    Quick Question about the multiplayer GUI.  I've got my database sending equipment data when the player chooses a "troop"  this works fine except that the icons do not populate the slot view (you can mouse over a seemingly empty slot and the tool-tip text will show).  If I hit ESC and go back into the troop selection, the icons for equipment will show up without issue.

    I think I'm missing something.  Is there an easy way to make the presentation 'refresh' without exiting and then going back into the selection screen?

    Edit - I neglected to mention that clicking on an 'empty' icon populates all of the slots that appeared empty. 

    I apologize if this is too elementary.
  7. Kodashi

    Do you want to see Samurai sword (Katana) imported from Warband ?

    Katana? Sure, why not.

    If you don't like it, don't use it.
  8. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    MadocComadrin 说:
    I *might*, but I'm not at the computer it may be on right now.

    No problem.  If you happen to find it, please let me know!
  9. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    MadocComadrin 说:
    When a player selects a troop/equipment, a network message is sent. So check that message and mimic what it does in the url_response script (You want to assign gear based on data from a database right?).

    As for weapon proficiencies and the rest, they're set via troops, ie. you can't set them per agent. If you want to set them per player, you're going to have to get creative. If the cRPG source is still open, look there.

    Thanks :smile:

    I'm already reading and writing equipment data to and from my database but I wanted to separate the selections a little bit and I thought doing it by class would be easiest.  I think I know exactly which network message you're referring to so thanks for that hint there.

    I tried getting the old crpg souce but the link is no longer working :sad:  Anyone have a copy of it by chance?   
  10. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    Firstly, thanks to everyone for all of your assistance.  I'm able to now read and write equipment data to and from my database and have it populate the approriate slot...at least for the inital spawn.  I have some additional questions; hopefully short and easy ones.

    1) Which script(s) are fired when a player selects their 'Class' from within the gui?  I am looking to set saved equipment from the database to the gui based on their class selection.  This might not be possible so my plan B is to lock that character into a class once they've made their initial selection.  I'm good either way :smile:

    2) What functions are used to set Attributes, Skills, and Weapon Profs?

    ... and I think that might do it. 
  11. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    Sweet, I got it all figured out!

  12. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    Once I can get this inventory thing solved, I think I'll be nearly finished.  However, I am not quite sure how to loop through the Troop_Slot indexes.  Is there any example code out there?
  13. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    Caba`drin 说:
    Kodashi 说:
    I take it that multiplayer troop item selections are done here:

    slot_player_selected_item_indices_begin        = 2
    slot_player_selected_item_indices_end          = 11

    ?

    Yes, the *_set_slot or * _get_slot etc operations refer to arrayed variables that are called slots.

    These should not be confused with the equipment slots ek_* that identify where items go on a troop/agent/player.
    (This arrayed variable type of slot is explained in the syntax thread you've been pointed to that is in my sig.)

    Awesome! 

    Thanks for the guidance on this :smile:
  14. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    I take it that multiplayer troop item selections are done here:

    slot_player_selected_item_indices_begin        = 2
    slot_player_selected_item_indices_end          = 11

    ?
  15. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    I have  a question about troop_set_slot

    Does this function regard slots differently than (player_add_spawn_item,player_id, item_slot_no, item_id),

    I've got my database equipment code almost working but when I use the ek_item* slots, only the last item is populated (within the first slot).  However when I use function (player_add_spawn_item,player_id, item_slot_no, item_id), with the same item and slot ids, the equipment is spawn where I'd expect it to.  I'm so close to getting this working though

  16. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    Vornne 说:
    Kodashi 说:
    5000 is the identifier I am going to use in the Client events (not sure about this part)
    The event number can only be in the range 0 to 127 (otherwise it gets truncated), but other than that you are correct.

    Awesome.  This explains why it wasn't working :smile:  Changing the ID to a valid number (in my case, 9:cool: worked nicely. 

    I believe I am close.  When my character is logged in, he gets the equipmentids which are saved within the database.  The items are equipped but are invisible from the selection menu because I have not yet messed with presentations.py.  I can click on the vanilla available selections and change the equipment which then is reflected in the player slots as expected. 

    Does the equipmentID in the slot have to exist in the troop.py file for that particlar troop in order to show in Vanilla? 
  17. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    I'm not seeing a lot of documentation ion send_message_to_player.

    Can I call it as such?

    (multiplayer_send_3_int_to_player,reg7, 5000, reg8, reg9, reg10),

    Where reg7 is my playerId, 5000 is the identifier I am going to use in the Client events (not sure about this part), and the remaining reg8, reg9, and reg10 are item id's.  Do I have this right?
  18. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    Vornne 说:
    Eiríkr Rauði 说:
    Is there a max weight for items? It seems that Warband does not enjoy a setting of 60+ in the items.py ...
    63.75 (since the value is an integer / 4, max is 255 / 4), but as cmpxchg8b said recently in this thread, it's a module system limit rather than a game engine one (I don't know the engine limit, but you could ask him). What I have used to get around it:
    @@ -115,27 +115,28 @@
    ibf_armor_mask          = 0x00000000000000000000000ff
    ibf_damage_mask          = 0x00000000000000000000003ff
    ibf_10bit_mask          = 0x00000000000000000000003ff
    ibf_weight_mask          = 0x000000000000000000000ffff

    ibf_head_armor_bits      = 0
    ibf_body_armor_bits      = 8
    ibf_leg_armor_bits      = 16
    ibf_weight_bits          = 24
    ibf_difficulty_bits      = 3240

    ibf_hitpoints_mask      = 0x0000ffff
    ibf_hitpoints_bits      = 4050

    #iwf_damage_mask            = 0x10000000000000ff #make sure value is 64 bits so that << will work
    iwf_swing_damage_bits      = 5060
    iwf_swing_damage_type_bits  = 5868
    iwf_thrust_damage_bits      = 6070
    iwf_thrust_damage_type_bits = 6878
    iwf_weapon_length_bits      = 7080
    iwf_speed_rating_bits      = 8090
    iwf_shoot_speed_bits        = 90100

    iwf_max_ammo_bits          = 100110 # use this for shield endurance too?
    iwf_abundance_bits          = 110120
    iwf_accuracy_bits          = 16  #reuse leg_armor for accuracy 
    #iwf_horse_speed_bits        = 8
    #iwf_horse_maneuver_bits    = 16
    @@ -146,12 +147,12 @@

    def weight(x):
      a = int(4.0 * x)
      a = ibf_armor_maskibf_weight_mask & a
      return (((bignum | a) & ibf_armor_mask)ibf_weight_mask) << ibf_weight_bits)

    def get_weight(y):
      a = (y >> ibf_weight_bits) & ibf_armor_maskibf_weight_mask
      return 0.25 * a

    def head_armor(x):
      return (((bignum | x) & ibf_armor_mask) << ibf_head_armor_bits)
    Kodashi 说:
    I want to keep the vanila select screen but just replace the default equipped weapons and such with the db values. I thought it would be simple but it appears that the script ("multiplayer_set_default_item_selections_for_troop") doesn't allow me to call send_message_to_url directly which prevents me from accessing the database.  Perhaps this is because it's called by the client and won't allow send_message_to_url?  How would I get around this?
    As I said, the native equipment selection system uses item and troop slots, which is not really what you want. I wouldn't have the client request the server and then the server request the web server - too much potential for abuse - but rather when the player joins the warband server it requests the web server for the equipment, then stores it in player slots and sends to the client (player) with network messages, which also stores it in player slots, then convert the client presentations to use them instead of troop slots, have the client reply to the server with what equipment you have chosen, the server check to ensure the items are in the player slots stored earlier, and if so, add to the spawn items. Not something easy to start off with.

    Thanks Vornne!  That explanation veyr helpful.  I will give that a go!  I'll take a look at the presentation.py file and figure that one out.
  19. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    Hey Folks,

    I'm still struggling with populating decault items from my database. 

    All I am looking to do is replace the default troop euipment that is equipped whenever a player joins the server with whatever is saved for them wihtin my database.  I want to keep the vanila select screen but just replace the default equipped weapons and such with the db values. I thought it would be simple but it appears that the script ("multiplayer_set_default_item_selections_for_troop") doesn't allow me to call send_message_to_url directly which prevents me from accessing the database.  Perhaps this is because it's called by the client and won't allow send_message_to_url?  How would I get around this?

    Thanks once again :smile:
  20. Kodashi

    Modding Q&A [For Quick Questions and Answers]

    Another question :smile:

    I found that send_message_to_url doesn't work from scripts like; multiplayer_display_available_items_for_troop_and_item_classes.  Is this because the script actually fires from the client?

    If so, can I use the 'send network message' function called within the above script to then call send_message_to_url ?
后退
顶部 底部