Recent content by Kaasovic

  1. Kaasovic

    Documentation Coding Community Modding Documentation

    Made a pull request for the Items XML documentation. It took wayyy too long to find a structure that I liked :S
  2. Kaasovic

    Simple mods and overwriting native XMLs

    Have you tried specifying the included gametypes?

    In SandBoxCore/SubModule.xml a XMLNode has an IncludedGameTypes child node
    XML:
            <XmlNode>                
                <XmlName id="Items" path="spitems"/>
                <IncludedGameTypes>
                    <GameType value = "Campaign"/>
                    <GameType value = "CampaignStoryMode"/>
                    <GameType value = "CustomGame"/>
                </IncludedGameTypes>
            </XmlNode>
  3. Kaasovic

    Documentation Coding Community Modding Documentation

    If you'd like to create a pull request for these changes, I can add them to the community documentation. Great work btw :xf-smile:
    Will do once I have sorted out the missing nodes. The MarkDown could probably be improved as well, but I am no expert on that area
  4. Kaasovic

    Documentation Coding Community Modding Documentation

    Went through the Items XML and wrote down the nodes with their attributes/childnotes etc.
    Still have to go through Materials and child nodes.
    List was kinda rushed and doesn't look that pretty :razz:
  5. Kaasovic

    Documentation Coding Community Modding Documentation

    I had some trouble setting the Framework while creating the project in Visual Studio 2019 as there was no such option. What I ended up doing was creating it with no Framework set (defaults to .net core 2.0) and then manually setting it in the csproj XML file by setting the TargetFramework manually to
    XML:
    <TargetFramework>net472</TargetFramework>
    which solved the issue for me.

    Also made a contribution on github providing some useful links in the setting up steps, looking forward to do some more contributions as I figure stuff out :smile:
  6. Kaasovic

    Modding Q&A [For Quick Questions and Answers]

    RexDimitrius said:
    Hello everyone!

    I have a problem related to in-game materials. I would like to make a code which replaces the texture of an armor of an agent to another one (i.e plate armor text to heraldic armor text). All of that needs to happen on the same scene. I found a command but not sure if it is good for this: cur_item_set_material; as I don't know what string should be written in <string_no> spot.

    string_no takes the material name as the argument
  7. Kaasovic

    Modding Q&A [For Quick Questions and Answers]

    Sir John Hawkwood said:
    Hello everyone, i would need an item trigger to give my rifle its own reload sound using reload_musket flag, i tried to do this:

             
    Code:
     (ti_on_item_wielded, 0, 0, [],
                          [(agent_get_animation, ":anim", ":agent_no", 1),
                          (eq, ":anim", "anim_reload_musket"),
                          (try_begin),
                          (play_sound,"snd_steam"),
                          (try_end),])

    Thank you

    This trigger will only trigger if an item is wielded. Try running it every frame by changing ti_on_item_wielded to 0. Every frame might have a negative impact on user performance, so I'd suggest running it every 0.1 seconds.
  8. Kaasovic

    Modding Q&A [For Quick Questions and Answers]

    Maroon said:
    Arch3r said:
    Hello,

    has anyone made a chat that works for both alive and dead players (in Warband multiplayer)? Is it possible to override the default chat (as opened with hotkey T) with one that works for both dead and alive players, or am I right in thinking this is all hardcoded?

    Full Invasion now has a chat for both dead and alive, but as Pitch said, the old keys are hardcoded. We're using P for ours. I know NordInvasion also has a universal chat, theirs is set to U if I recall correctly.

    Correct. Also in our next update we are going to disable the usage of native (team)chat as well to force people to use universal chat.
  9. Kaasovic

    Modding Q&A [For Quick Questions and Answers]

    _Sebastian_ said:
    pete99 said:
    Since I am doing this for NW (which for some reason doesn't appear to have this option) would I be able to just put that line in? Or is there another way to go about doing it. Thanks.
    In case you're doing a server side only mod, you're stuck.
    As the operation doesn't automatically synce to clients you have to mod the client version as well.

    @Max2150
    Try adjusting the shot_speed of the crossbow to a more common range like other crossbows... What value is it btw?

    There actually is a way. Using this operation can set the prune time of an item individually.
    Code:
    scene_prop_set_prune_time                   = 1819  # (scene_prop_set_prune_time, <scene_prop_id>, <value>),

    scene_prop_id can be found using:

    Code:
    try_for_prop_instances  =   16  # (try_for_prop_instances, <destination>, [<object_id>], [<object_type>])
                                    # Version 1.161+. Runs a cycle, iterating all scene prop instances on the scene, or all scene prop instances of specific type if optional parameter is provided.
                                    # If object_id and object_type is not given, it loops through all instances. (https://forums.taleworlds.com/index.php/topic,324874.msg7781764.html#msg7781764)
                                    # Object types are:
                                    #   somt_object = 1
                                    #   somt_entry = 2
                                    #   somt_item = 3
                                    #   somt_baggage = 4
                                    #   somt_flora = 5
                                    #   somt_passage = 6
                                    #   somt_spawned_item = 7
                                    #   somt_spawned_single_ammo_item = 8
                                    #   somt_spawned_unsheathed_item = 9
                                    #   somt_shield = 10
                                    #   somt_temporary_object = 11

    try_for_prop_instances can take an item_id as parameter
  10. Kaasovic

    Modding Q&A [For Quick Questions and Answers]

    Guitarma said:
    Hello again everyone,

    I'm trying to make a multiplayer mod that requires some new key bindings. I looked thru lav's header_operations.py and found the key_clicked operation, but it only allows you to store the key that's pressed, not the player/agent ID that pressed it. I'm assuming this would cause all players to react as if they had just pressed the key, rather than just the one actually pressing the key. Either that, or it's only a singleplayer function. Whatever happens, I need to find some kind of work around.

    Anyone got any ideas?

    While I'm here, I'd also like to know if all of the orders listed in headers_mission_templates.py actually work in Native, even the ones that aren't used in the base game.

    Any and all help is appreciated.

    Thanks!

    It is technically a client operation. You can run a mission trigger or presentation on a client and listen for a key input. This can then be sent to the server using the multiplayer_send_message_to_server or one of the multiplayer_send_int_to_server operations.
  11. Kaasovic

    Modding Q&A [For Quick Questions and Answers]

    pete99 said:
    Kaasovic said:
    pete99 said:
    _Sebastian_ said:
    pete99 said:
    I have been trying to create a code which spawns a scene prop, and then attaches it to an agent. I was wondering if this would work on a server? I did give it a go, and it worked in single player, but not on the server itself. Any idea if its just a single player thing?
    It doesn't synce to clients automatically if that answers your question, however there's already a multiplayer event that does the job in Native; multiplayer_event_set_attached_scene_prop

    Thanks. I have been attempting to use this. I still haven't managed to get it to actually attach yet. Here is the code I am working with:

    ("multiplayer_attach_prop",
      [

    (store_script_param, ":player_no", 1),


    (try_begin),
    (multiplayer_is_server),
    (player_get_agent_id, ":player_agent", ":player_no"),
    (agent_is_active,":player_agent"),
    (agent_get_position, pos1, ":player_agent"), #pos1 holds agent's position. 
       
            (set_spawn_position, pos1),
         
          (spawn_scene_prop, "spr_awning_long"),
    (assign, ":attached_instance_id", reg0),
    (agent_set_attached_scene_prop, ":player_agent", ":attached_instance_id"),
            (agent_set_attached_scene_prop_x, ":player_agent", 1),
            (agent_set_attached_scene_prop_z, ":player_agent", 200),
            (try_for_range, ":player_no", 1),
              (player_is_active, ":player_no"),
              (multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_attached_scene_prop, ":player_agent", ":attached_instance_id"),
            (try_end),
    (try_end),
    ]),

    Do you have the sokf_moveable added to your scene prop?

    How would you go about doing this? I did try changing the line in module.ini which apparently allows physics of all scene props, and nothing appeared to happen. Note, it did work in host game, but not on an actual server, so i'm not sure if this would be the issue or not.

    Ah I looked at your code again and I see that your loop only loops trough one player.

    You could use the try_for_players operation to loop through all players.

    Code:
    ("multiplayer_attach_prop", [
        (store_script_param, ":player_no", 1),
        (try_begin),
            (multiplayer_is_server),
            (player_get_agent_id, ":player_agent", ":player_no"),
            (agent_is_active,":player_agent"),
            (agent_get_position, pos1, ":player_agent"), #pos1 holds agent's position.  
            (set_spawn_position, pos1),
            (spawn_scene_prop, "spr_awning_long"),
            (assign, ":attached_instance_id", reg0),
            (agent_set_attached_scene_prop, ":player_agent", ":attached_instance_id"),
            (agent_set_attached_scene_prop_x, ":player_agent", 1),
            (agent_set_attached_scene_prop_z, ":player_agent", 200),
            (try_for_players, ":player_target", 1), #1 will skip server, 0 will include server. player_no 0 equals the server. Best to skip it here
                (player_is_active, ":player_target"),
                (multiplayer_send_2_int_to_player, ":player_target", multiplayer_event_set_attached_scene_prop, ":player_agent", ":attached_instance_id"),
            (try_end),
        (try_end),
    ]),

    Janycz said:
    Kaasovic said:
    You can use this operation:

    Code:
    agent_fade_out                           = 1749  # (agent_fade_out, <agent_id>),
                                                     # Fades out the agent from the scene (same effect as fleeing enemies when they get to the edge of map).
    Ok. It kills agent without message. But, as I understand it, in the battle agent after this operation is considered to have escaped from the battlefield? I understand correctly, or not? I need to have the agent considered killed.

    I am not sure whether it would count towards an enemy fleeing or a kill, best to check the scripts for counting these
  12. Kaasovic

    Modding Q&A [For Quick Questions and Answers]

    pete99 said:
    _Sebastian_ said:
    pete99 said:
    I have been trying to create a code which spawns a scene prop, and then attaches it to an agent. I was wondering if this would work on a server? I did give it a go, and it worked in single player, but not on the server itself. Any idea if its just a single player thing?
    It doesn't synce to clients automatically if that answers your question, however there's already a multiplayer event that does the job in Native; multiplayer_event_set_attached_scene_prop

    Thanks. I have been attempting to use this. I still haven't managed to get it to actually attach yet. Here is the code I am working with:

    ("multiplayer_attach_prop",
      [

    (store_script_param, ":player_no", 1),


    (try_begin),
    (multiplayer_is_server),
    (player_get_agent_id, ":player_agent", ":player_no"),
    (agent_is_active,":player_agent"),
    (agent_get_position, pos1, ":player_agent"), #pos1 holds agent's position. 
       
            (set_spawn_position, pos1),
         
          (spawn_scene_prop, "spr_awning_long"),
    (assign, ":attached_instance_id", reg0),
    (agent_set_attached_scene_prop, ":player_agent", ":attached_instance_id"),
            (agent_set_attached_scene_prop_x, ":player_agent", 1),
            (agent_set_attached_scene_prop_z, ":player_agent", 200),
            (try_for_range, ":player_no", 1),
              (player_is_active, ":player_no"),
              (multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_set_attached_scene_prop, ":player_agent", ":attached_instance_id"),
            (try_end),
    (try_end),
    ]),

    Do you have the sokf_moveable added to your scene prop?

    Janycz said:
    How can I kill an agent without a report of death (X killed by X)?
    I try:
    Code:
    (agent_deliver_damage_to_agent, ":agent_no", ":agent_no", 100),
    This kills the agent. But the message (X killed by X) is displayed. How to fix this? :?:

    You can use this operation:

    Code:
    agent_fade_out                           = 1749  # (agent_fade_out, <agent_id>),
                                                     # Fades out the agent from the scene (same effect as fleeing enemies when they get to the edge of map).
  13. Kaasovic

    Modding Q&A [For Quick Questions and Answers]

    pete99 said:
    Would the display_message thing show up on a server though? or is it just a client side thing?

    It will show up in the console if the code is run on the server and in the chatlog if code is run on a client.
  14. Kaasovic

    Modding Q&A [For Quick Questions and Answers]

    PitchPL said:
    What are the counterparts of this in singleplayer?
    Code:
            (multiplayer_get_my_player, ":my_player"),
    		(player_get_agent_id, ":my_agent", ":my_player"),

    Code:
    get_player_agent_no                      = 1700  # (get_player_agent_no, <destination>),
                                                     # Retrieves the reference to the player-controlled agent. Singleplayer mode only.
Back
Top Bottom