Search results for query: *

  1. Cokjan

    Warband Script Enhancer 2 (v1.1.2.0)

    EXCEPTION_OUT_OF_MEMORY crash with WSE2 on TLD mod when entering Isengard
    20:52:41 - Build: Release
    20:52:41 - Mount&Blade Warband WSE2 version: 1.174 1110 Dec 12 2023 17:43:03
    20:52:41 - Havok version: 2013.1.0-r1
    20:52:41 - FMOD Ex version: 4.44.64
    20:52:41 - WSE netcode version: 10
    20:52:41 - Command line: --module TLD --no-intro
    20:52:41 - Initializing timer...
    20:52:41 - Collecting system info...
    20:52:41 - Dumping system info...

    --------------------------------- game load

    20:54:31 - Launching game...
    20:55:15 - Loading post effect shaders (HDR: 1, DoF: 1, FXAA: 1, PP: 0)...
    20:55:15 - Loaded earlyZ shaders...
    20:55:16 - Loaded PostFx shaders...
    20:55:21 - Saving game...
    20:55:21 - Creating new savegame file...
    20:55:21 - Saving header...
    20:55:21 - Saving game state...
    20:55:21 - Closing new save game file...
    20:55:21 - Starting checksum control...
    20:55:21 - Performing checksum control...
    20:55:22 - Savegame checksum control succeeded!
    20:55:22 - Backing up old file name...
    20:55:22 - Removing old backup file...
    20:55:22 - Renaming old savegame to backup file...
    20:55:22 - Renaming new savegame file...
    20:55:22 - Savegame succeded!
    20:55:24 - Starting map isengard_center in mode town_center
    20:55:24 - WARNING: Failed to change river material to mud
    20:55:27 - EXCEPTION_OUT_OF_MEMORY (0xE0000006, 0x004381E0)
    20:55:27 - Dumping call stack...
    20:55:27 - - 0x77689392 ??+0x77689392 (RaiseException+0x62)
    20:55:27 - - 0x009DBD1C ??+0x9DBD1C (NewHandler+0x1C)
    20:55:27 - - 0x00B7CFB7 ??+0xB7CFB7 (_callnewh+0x1:cool:
    20:55:27 - - 0x00B7884F ??+0xB7884F (malloc+0x60)
    20:55:27 - - 0x00B77D71 ??+0xB77D71 (operator new+0x1D)
    20:55:27 - - 0x00855A78 ??+0x855A78 (std::vector<mbFaunaRec,std::allocator<mbFaunaRec> >::_Reallocate+0x2:cool:
    20:55:27 - - 0x009E78B8 ??+0x9E78B8 (rglManifold::build+0x2C:cool:
    20:55:27 - - 0x008A6643 ??+0x8A6643 (mbMission::start+0x27C3)
    20:55:27 - - 0x0089E5AF ??+0x89E5AF (mbMetaMission::startMission+0x1F)
    20:55:27 - - 0x0089BA29 ??+0x89BA29 (mbMeetingRedirector::redirect+0xD9)
    20:55:27 - - 0x0089D675 ??+0x89D675 (mbMenuWindow::frameMove+0x405)
    20:55:27 - - 0x00825932 ??+0x825932 (mbCoreGame::frameMove+0xF2)
    20:55:27 - - 0x008330FA ??+0x8330FA (CD3DApplication::FrameMove+0x3A)
    20:55:27 - - 0x00832355 ??+0x832355 (CD3DApplication::Render3DEnvironment+0x3A5)
    20:55:27 - - 0x00832D3C ??+0x832D3C (CD3DApplication::Run+0xEC)
    20:55:27 - - 0x009CA7EF ??+0x9CA7EF (WinMain+0xF6F)
    20:55:27 - - 0x00B7EDE1 ??+0xB7EDE1 (__tmainCRTStartup+0xF1)
    20:55:27 - - 0x75C37BA9 ??+0x75C37BA9 (BaseThreadInitThunk+0x19)
    20:55:27 - - 0x7783BD2B ??+0x7783BD2B (RtlInitializeExceptionChain+0x6B)
    20:55:27 - - 0x7783BCAF ??+0x7783BCAF (RtlClearBits+0xBF)
    20:55:27 - - 0x7783BCAF ??+0x7783BCAF (RtlClearBits+0xBF)
    20:55:27 - Dumping memory status...
    20:55:27 - Commit size: 3616 MB
    20:55:27 - Working set size: 3495 MB
    20:55:27 - Available size: 19718 MB
    20:55:27 - Heap #0 (process): 3242 MB
    20:55:27 - Heap #1: 3 MB
    20:55:27 - Heap #2: 0 MB
    20:55:27 - Heap #3: 0 MB
    20:55:27 - Heap #4: 76 MB
    20:55:27 - Heap #5: 0 MB
    20:55:27 - Heap #6: 2 MB
    20:55:27 - Heap #7: 0 MB
    20:55:27 - Heap #8: 28 MB
    20:55:27 - Closing log file...

    I've sent the full log to discord
  2. Cokjan

    Warband Script Enhancer 2 (v1.1.2.0)

    More map terrain texture variety which I think will be helpful for recognizing whether you're currently in a forest or not, because sometimes its not very obvious due to how sparse trees are in the campaign map. Might make the map look less boring aswell!

    I am aware there are workarounds like using desert and snow, but IIRC they don't blend the texture nicely. Like desert textures bleeding out too much to the plain's 'face'. Grass doesn't spawn in deserts battlemap either so its premade plain battlemap or move the player somewhere else. I am sorry if what I said is confusing.
  3. Cokjan

    Warband Script Enhancer 2 (v1.1.2.0)

    This might be a rather useless and non-priority feature, may I suggest that forest terrain have a separate material? so its:
    map_plain
    +new WSE2 map_plain_forest
    map_steppe
    +new WSE2 map_steppe_forest
    etc.
  4. Cokjan

    Warband Script Enhancer 2 (v1.1.2.0)

    I am curious but is it possible for WSE2 to add a new animation flag, something like acf_combat where the animation would behave like an attacking animation with proper hitboxes?
  5. Cokjan

    Mod help request SOLVED

    use openbrf to find the arrow mesh (ctrl + f), and then use the scale tool for lods
  6. Cokjan

    Mount & Blade: Warband (Module system code for lords to age and die)

    Complete plug n play code with AI in my experience is just not possible, the rest still need human brain. It can give you useful clue though, if you understand what it meant and it somewhat makes sense. It could be a useful learning tool for codes as well before you ask a person what it meant.

    For instance I used ChatGPT when trying to make shaders for waving banner from horizontal to vertical (I do not understand HLSL at all), I copied the whole code so the AI understand it first, and it gave me a clue on what exactly to change lol
  7. Cokjan

    Improved faces and bodies - compilation

    lol wtf i didn't realize the texture dimension is 512x513, thanks for pointing that out. The meshes seems to be the exact same to me, just with extra vertex animation for the sliders. I also have converted the sliders from skin.txt to .py so holler at me if you want it!
  8. Cokjan

    Improved faces and bodies - compilation


    This one uses corprus' head mesh and it has more sliders, might want to check it out
  9. Cokjan

    OSP Code Combat Grenades and Explosions (Originally by Beaver)

    For anyone reading this, if you have a bug where the explosions sometimes doesn't work (doesn't damage enemy). You can duplicate the position to a higher index number, eg (copy_position, pos63, pos1), and use pos63 instead of pos1.

    Also, you can use :

    (set_fixed_point_multiplier, 100), # to make sure its in centimetres
    (try_for_agents,":target", pos63, ":radius"),

    That way, it won't iterate literally everyone on the map. Just those within the AOE range.
  10. Cokjan

    changing agent's inventory/equipment

    agent_equip_item will add the item. The other operations in which requires the item to actually exist is agent_set_wielded_item

    Personally, I'd give them bow, arrows, and shield in the module_troops. So I'd always know that the last empty weapon slot is 3 and can replace the slot with a sword/lance
  11. Cokjan

    OSP Combat Two-handed attack animations on horseback

    That's great use of the WSE operation! (y)
  12. Cokjan

    [WB] Cokjan's Workshop

    Thanks y'all
  13. Cokjan

    [WB] Cokjan's Workshop

    Cokjan's Workshop 1. Movement Controls 1.1 Dodge Step Mechanic Adds a grounded, not over the top 3 directional dodge step. The animation are not perfect, but perhaps still acceptable enough. If the player has more than 6 athletics skill, the player can dodge step and perform actions like...
  14. Cokjan

    SP Native Extended Native - Calradia's Borderlands --- Released !

    When it was? Are they still around?
    I think so, I messaged one of the team members at moddb in april.
  15. Cokjan

    SP Native Extended Native - Calradia's Borderlands --- Released !

    You can ask permission for suvarnabhumi mahayuth's 3d asset. They gave it to me so you could try as well. Might be nice to see a southeast asian faction :smile:
  16. Cokjan

    B Tutorial 2D Creating a Simple Texture Atlas with OpenBRF

    Some might find this useful, many would probably get confused. But still, here's an image of a crappy and quite complex openbrf UV coordinate example
  17. Cokjan

    Questions about "try_for_agents" performance and "agent_set_attack_action" function.

    In theory yes, but avoid setting triggers that run less than once every frame (0.015), I think some of them can get skipped. 0.1 is better in my experience.

    I would also replace the raw mission timer with a global variable that increments by 1 every time the loop runs.
    Alright, thanks for the suggestions! I did notice there's pretty much no "major" difference between 0.1 and 0, seems like setting it to 0 would make it a waste of computing power. And yes I forgot to put the ticks_mod outside the try agent loop lol

    Python:
    something_something_combat_ai = [
        (ti_before_mission_start, 0, 0, [],[
            (assign, "$prev_ai_time", 0),
            (assign, "$time_ticks", 0),
        ]),
    
        (0, 0, 0, [],[
            (assign, ":delay", 300), #0.3 msec
            (assign, ":mod", 10), #number of frames
            (store_mission_timer_a_msec, ":time_msec"),
            (val_sub, ":time_msec", "$prev_ai_time"), #Need to assign to 0 in ti_before_mission_start
            (gt, ":time_msec", ":delay"), #Trigger delay 0.5 seconds - optional
            (val_add, "$time_ticks", 1),
            (try_begin),
                (eq, "$time_ticks", ":mod"), #The last frame
                (store_mission_timer_a_msec, "$prev_ai_time"),
            (try_end),
            (val_mod, "$time_ticks", ":mod"),
            (try_for_agents, ":agent_no"),
                # Only check every 10th agent each tick to reduce stutter
                (store_mod,":agent_mod",":agent_no", ":mod"),
                (eq,":agent_mod","$time_ticks"),
                (agent_is_human, ":agent_no"),
                (agent_is_alive, ":agent_no"),
                (agent_ai_get_behavior_target, ":enemy", ":agent_no"),
                #Example of using cahced enemies.
                (try_begin),
                    (this_or_next|eq, ":enemy", -1),
                    (neg|agent_is_alive, ":enemy"),
                    (agent_ai_get_num_cached_enemies, ":cached_num", ":agent_no"),
                    (assign, ":closest_enemy", -1),
                    (assign, ":closest_distance", 1000000),
                    (agent_get_position, pos1, ":agent_no"),
                    (try_for_range, ":cached_enemy", 0, ":cached_num"),
                        (agent_get_position, pos2, ":cached_enemy"),
                        (get_distance_between_positions, ":distance", pos1, pos2),
                        (lt, ":distance", ":closest_distance"),
                        (agent_is_alive, ":closest_enemy"),
                        (assign, ":distance", ":closest_distance"),
                        (assign, ":closest_enemy", ":cached_enemy"),
                    (try_end),
                    (assign, ":enemy", ":closest_enemy"),
                (try_end),
                (gt, ":enemy", -1),
                #Your melee AI block
        
            (try_end),
        ]),
    ]

    The engine creates a cache of 16 enemies every 2 seconds. This cache is sorted from nearest to farthest.
    Use parameter "code=python" to show code.
    Wow, thank you for writing that code! I just tested it and it works. I did read about the engine automatically making a cache of enemies somewhere, but have no idea how to call the variables before.

    Oh and by the way, it seems like using agent_ai_get_behavior_target lead to these errors. It can sometimes randomly disappear though.

    Code:
     At Mission Template mst_lead_charge trigger no: 9 consequences. At Mission Template mst_lead_charge trigger no: 9 consequences. At Mission Template mst_lead_charge trigger no: 9 consequences.
    SCRIPT WARNING ON OPCODE -2147481946: Invalid Agent ID: 6503696; LINE NO: 19:
     At Mission Template mst_lead_charge trigger no: 9 consequences. At Mission Template mst_lead_charge trigger no: 9 consequences. At Mission Template mst_lead_charge trigger no: 9 consequences.
    SCRIPT WARNING ON OPCODE -2147481946: Invalid Agent ID: 0; LINE NO: 19:
     At Mission Template mst_lead_charge trigger no: 9 consequences. At Mission Template mst_lead_charge trigger no: 9 consequences. At Mission Template mst_lead_charge trigger no: 9 consequences.
    SCRIPT WARNING ON OPCODE -2147481946: Invalid Agent ID: 6503696; LINE NO: 19:
     At Mission Template mst_lead_charge trigger no: 9 consequences. At Mission Template mst_lead_charge trigger no: 9 consequences. At Mission Template mst_lead_charge trigger no: 9 consequences.
    SCRIPT WARNING ON OPCODE -2147481946: Invalid Agent ID: 0; LINE NO: 19:

    Using agent_ai_get_look_target removes those errors, but a new one pops out saying error opcode 1702 (agent_is_alive). Which I assume is caused by (neg|agent_is_alive, ":enemy"), I'll play around to try and fix these lil bugs.

    Thanks again, both of you.
  18. Cokjan

    Questions about "try_for_agents" performance and "agent_set_attack_action" function.

    Ooh thanks for the link, Vetrogor. There are information there for try_for_agents not available in lav's header operation file.

    I didn't quite understand the part with cached enemies, do you mean something like this?
    Code:
    something_something_combat_ai = (
      0.01, 0, 0, [
      (store_mission_timer_a_msec,":mission_time_ms"),
      (ge,":mission_time_ms",10000),
      (store_div,":mission_time_s",":mission_time_ms",1000),
      (store_div,":mission_time_ticks",":mission_time_ms",100),
    
        (try_for_agents, ":agent_no"),
            # Only check every 50th agent each tick to reduce stutter
            (store_mod,":ticks_mod",":mission_time_ticks",50),
            (store_mod,":agent_mod",":agent_no",50),
            (eq,":agent_mod",":ticks_mod"),
            (agent_is_human, ":agent_no"),
            (agent_is_alive, ":agent_no"),
            # insert code for gathering agent info
    
            (agent_ai_get_cached_enemy, ":cached_enemy", ":agent_no", 1), #i'm not sure what cache index is, does 1 means the nearest cached enemy?
            (agent_is_human, ":cached_enemy"),
            (agent_is_alive, ":cached_enemy"),
            # insert code for gathering enemy info
    
            (try_begin),
                # consequence block
            (try_end),
    
        (try_end),   
          ], [])

    So in essence, each 0.01 seconds, a random agent chosen by modulo is checked, and 1 cached enemy is checked too. So that means 2 agents checked each 0.01 seconds, which also meant that in a full 1 second, 200 agents would be checked? Do I get that right? I mean its definitely an improvement over checking all agents each 0.01 seconds, albeit with a tradeoff for consistency.
  19. Cokjan

    Which file contains the script/trigger for agent wounded or dead

    Code:
    (
        ti_on_agent_killed_or_wounded, 0, 0, [],
      [
        # 1. GATHER DATA
        (store_trigger_param_1, ":dead_agent"),
        (store_trigger_param_2, ":killer_agent"),
        (agent_get_troop_id, ":dead_agent_trp", ":dead_agent"),
        (neg|troop_is_hero, ":dead_agent_trp"),
        (agent_get_wielded_item, ":killer_weap", ":killer_agent"),
        (item_get_swing_damage_type, ":swing_type", ":killer_weap"),
        (item_get_thrust_damage_type, ":thrust_type", ":killer_weap"),
    
        # 2. KILL/WOUND CHANCE
        # 2.1 BLUNT KILL CHANCE
        (try_begin),
            (this_or_next|eq, ":swing_type", 2), # 2 = blunt
            (eq, ":thrust_type", 2), # 2 = blunt
            (store_random_in_range, ":blunt_kill_chance", 1, 4),
            (eq, ":blunt_kill_chance", 1), # 25% chance to kill
            (set_trigger_result, 1), # 1 = force kill
            
        # 2.2 CUT/PIERCE WOUND CHANCE
        (else_try),
            (this_or_next|neq, ":swing_type", 2), # NOT BLUNT
            (neq, ":thrust_type", 2), # NOT BLUNT
            (store_random_in_range, ":cut_pierce_wound_chance", 1, 8),
            (eq, ":cut_pierce_wound_chance", 1), # 12.5% chance to wound
            (set_trigger_result, 2), # 2 = force wounded
        (end_try),
        ]),

    I don't know if this stack/clash with surgery skill, haven't tested that.
  20. Cokjan

    Questions about "try_for_agents" performance and "agent_set_attack_action" function.

    Thanks a lot for the help again Jacob. I can rest more easily now with the confirmation :smile:
    Hmm setting the second value to -2 or 1 doesn't seem to work either

    Code:
            # Cancel test
            (try_begin),
            (le, ":dist", 200),
            (this_or_next|eq, ":ags_atk", 0), #just for testing
            (this_or_next|eq, ":ags_atk", 1),
            (eq, ":ags_atk", 2),
            (agent_set_attack_action, ":ags", -2, -2),
            (display_message, "@ Cancel"), #debug
            (try_end),
Back
Top Bottom