Search results for query: *

  1. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    KratosMKII said:
    Can i tie a simple trigger time in hours to a variable that can be changed in game through a menu?
    no, but you can emulate something like it with a trigger that runs every hour and only does something when cur hour is multiple of that variable
  2. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    simple triggers with huge loops could case stuttering.
    one thing I`ve seen to fix that is to break down the loop into several (ie: trigger that does half the parties every day instead of all parties every other day)
  3. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    Code:
    if opcode & this_or_next: result.append('this_or_next')
    TypeError: unsupported operand type(s) for &: 'str' and 'int'

    seems like you typed a string ("something") where the ms expected an operation (something)
  4. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    that script is only called once every 24 for hours, so it will take a while to update



    got ninja'ed by Karlaham :razz:
    also, every time the trigger runs to call this script, it has a 1/3 chance of actually calling it
    Code:
           (store_random_in_range, ":random", 0, 30),
           (le, ":random", 10),
    	   
           (call_script, "script_get_center_ideal_prosperity", ":center_no"),
    so it would probably take around 3 days, not one
  5. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    lolitablue said:
    Code:
      [anyone|plyr|repeat_for_parties, "patrol_garrison_target",
      [
        (store_repeat_object, ":party_no"),
        (is_between, ":party_no", centers_begin, centers_end),
        (store_faction_of_party, ":party_faction", ":party_no"),
        (eq, ":party_faction", "$players_kingdom"),
        (str_store_party_name, s11, ":party_no"),
      ],
      "{!}{s11}.", "patrol_garrison_confirm_ask", 
      [
        (store_repeat_object, "$diplomacy_var"),
      ]
      ],

    you would probably want to change this
    Code:
    (is_between, ":party_no", centers_begin, centers_end),
    into something like
    Code:
    (party_get_template_id, ":pt", ":party_no"),
    (this_or_next|eq, ":pt", <outpost_party_template>),
    (is_between, ":party_no", centers_begin, centers_end),
    or
    Code:
    (this_or_next|eq, ":party_no", "p_outpost"),
    (is_between, ":party_no", centers_begin, centers_end),




    Seipherwood said:
    Not entirely sure where this question goes but this seems like the right place.

    Would it be possible to make a book and have it increase multiple skills? I was looking at some books in Morghs, but they dont list any of the bonuses they give, so im not entirely sure how you would go about doing that.

    Like for instance, Book of Persistance - +2 Wound Treatment / Surgery / First Aid

    Would something like that be possible? and if so, how would you do it?
    Also, anyway to make it so it could be brought into any mod or would that be more difficult?

    you would need to use the module system for that:
    Code:
    	#script_game_get_skill_modifier_for_troop
    	# This script is called from the game engine when a skill's modifiers are needed
    	# INPUT: arg1 = troop_no, arg2 = skill_no
    	# OUTPUT: trigger_result = modifier_value
    	("game_get_skill_modifier_for_troop",[(store_script_param, ":troop_no", 1),
    			(store_script_param, ":skill_no", 2),
    			(assign, ":modifier_value", 0),
    			(try_begin),
    				(eq, ":skill_no", "skl_wound_treatment"),
    				(call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_wound_treatment_reference"),
    				(gt, reg0, 0),
    				(val_add, ":modifier_value", 1),
    			(else_try),
    				(eq, ":skill_no", "skl_trainer"),
    				(call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_training_reference"),
    				(gt, reg0, 0),
    				(val_add, ":modifier_value", 1),
    			(else_try),
    				(eq, ":skill_no", "skl_surgery"),
    				(call_script, "script_get_troop_item_amount", ":troop_no", "itm_book_surgery_reference"),
    				(gt, reg0, 0),
    				(val_add, ":modifier_value", 1),
    			(try_end),
    			(set_trigger_result, ":modifier_value"),
    			]),
  6. Ikaguia

    M&B Mod Updater Suite (now Version 2.0!)

    would it be possible to make a version of this that pulls the mod from github or something simillar? that way you would have an easy and stable platform with no need to host all mods yourself
    seems really cool btw
  7. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    I've got a few problems with quick_strings and strings when I used a "\n" in one of them, it seems to shift all other strings in a weird way. Other than that, I have never seen anything like it
  8. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    Howard P. Lovecraft said:
    So, I have a problem with my module system. The problem is in the log copied below. The weird thing is that I have compiled that module A LOT of times, with no problem. Since the last time, nothing has changed to it, nothing added, nothing deleted, nothing edited. I'd appreciate some info.

    Code:
    Initializing...
    variables.txt not found. Creating new variables.txt file
    Compiling all global variables...
    Traceback (most recent call last):
      File "process_global_variables.py", line 132, in <module>
        save_variables(export_dir, variables, variable_uses)
      File "C:\Program Files (x86)\Steam\steamapps\common\MountBlade Warband\Modules
    \SA_MS with Formations KIT\process_operations.py", line 171, in save_variables
        file = open(export_dir + "variables.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/variables.txt'
    Exporting strings...
    Traceback (most recent call last):
      File "process_strings.py", line 26, in <module>
        save_strings(strings)
      File "process_strings.py", line 9, in save_strings
        ofile = open(export_dir + "strings.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/strings.txt'
    Exporting skills...
    Traceback (most recent call last):
      File "process_skills.py", line 32, in <module>
        save_skills()
      File "process_skills.py", line 15, in save_skills
        ofile = open(export_dir + "skills.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/skills.txt'
    Exporting tracks...
    Traceback (most recent call last):
      File "process_music.py", line 23, in <module>
        save_tracks()
      File "process_music.py", line 15, in save_tracks
        file = open(export_dir + "music.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/music.txt'
    Exporting animations...
    Traceback (most recent call last):
      File "process_animations.py", line 61, in <module>
        write_actions(animations,len(action_codes),action_codes,"actions.txt")
      File "process_animations.py", line 24, in write_actions
        file = open(export_dir + file_name,"w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/actions.txt'
    Exporting meshes...
    Traceback (most recent call last):
      File "process_meshes.py", line 25, in <module>
        save_meshes()
      File "process_meshes.py", line 9, in save_meshes
        ofile = open(export_dir + "meshes.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/meshes.txt'
    Exporting sounds...
    Traceback (most recent call last):
      File "process_sounds.py", line 51, in <module>
        write_sounds(sound_samples, sounds)
      File "process_sounds.py", line 13, in write_sounds
        ofile = open(export_dir + "sounds.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/sounds.txt'
    Exporting skins...
    Traceback (most recent call last):
      File "process_skins.py", line 105, in <module>
        export_skins(skins)
      File "process_skins.py", line 45, in export_skins
        ofile = open(export_dir + "skins.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/skins.txt'
    Exporting map icons...
    variables.txt not found. Creating new variables.txt file
    variable_uses.txt not found. Creating new variable_uses.txt file
    Creating new tag_uses.txt file...
    Creating new quick_strings.txt file...
    Traceback (most recent call last):
      File "process_map_icons.py", line 38, in <module>
        save_map_icons(variables,variable_uses,tag_uses,quick_strings)
      File "process_map_icons.py", line 9, in save_map_icons
        ofile = open(export_dir + "map_icons.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/map_icons.txt'
    Exporting faction data...
    Traceback (most recent call last):
      File "process_factions.py", line 70, in <module>
        save_factions(relations)
      File "process_factions.py", line 34, in save_factions
        file = open(export_dir + "factions.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/factions.txt'
    Exporting item data...
    variables.txt not found. Creating new variables.txt file
    variable_uses.txt not found. Creating new variable_uses.txt file
    Creating new tag_uses.txt file...
    Creating new quick_strings.txt file...
    Traceback (most recent call last):
      File "process_items.py", line 72, in <module>
        write_items(variables,variable_uses,tag_uses,quick_strings)
      File "process_items.py", line 19, in write_items
        ofile = open(itemkinds_file_name,"w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/item_kinds1.txt'
    Exporting scene data...
    variables.txt not found. Creating new variables.txt file
    variable_uses.txt not found. Creating new variable_uses.txt file
    Creating new tag_uses.txt file...
    Creating new quick_strings.txt file...
    Traceback (most recent call last):
      File "process_scenes.py", line 77, in <module>
        save_scenes(variables,variable_uses,tag_uses)
      File "process_scenes.py", line 46, in save_scenes
        ofile = open(export_dir + "scenes.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/scenes.txt'
    Exporting troops data
    Traceback (most recent call last):
      File "process_troops.py", line 107, in <module>
        save_troops()
      File "process_troops.py", line 13, in save_troops
        file = open(export_dir + "troops.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/troops.txt'
    Exporting particle data...
    Traceback (most recent call last):
      File "process_particle_sys.py", line 61, in <module>
        save_particle_systems()
      File "process_particle_sys.py", line 29, in save_particle_systems
        ofile = open(export_dir + "particle_systems.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/particle_systems.txt'
    Exporting scene props...
    variables.txt not found. Creating new variables.txt file
    variable_uses.txt not found. Creating new variable_uses.txt file
    Creating new tag_uses.txt file...
    Creating new quick_strings.txt file...
    Traceback (most recent call last):
      File "process_scene_props.py", line 32, in <module>
        save_scene_props(variables,variable_uses,tag_uses,quick_strings)
      File "process_scene_props.py", line 10, in save_scene_props
        ofile = open(export_dir + "scene_props.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/scene_props.txt'
    Exporting tableau materials data...
    variables.txt not found. Creating new variables.txt file
    variable_uses.txt not found. Creating new variable_uses.txt file
    Creating new tag_uses.txt file...
    Creating new quick_strings.txt file...
    Traceback (most recent call last):
      File "process_tableau_materials.py", line 31, in <module>
        save_tableau_materials(variables,variable_uses,tag_uses,quick_strings)
      File "process_tableau_materials.py", line 11, in save_tableau_materials
        ofile = open(export_dir + "tableau_materials.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/tableau_materials.txt'
    Exporting presentations...
    variables.txt not found. Creating new variables.txt file
    variable_uses.txt not found. Creating new variable_uses.txt file
    Creating new tag_uses.txt file...
    Creating new quick_strings.txt file...
    Traceback (most recent call last):
      File "process_presentations.py", line 33, in <module>
        save_presentations(variables,variable_uses,tag_uses,quick_strings)
      File "process_presentations.py", line 11, in save_presentations
        ofile = open(export_dir + "presentations.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/presentations.txt'
    Exporting party_template data...
    Traceback (most recent call last):
      File "process_party_tmps.py", line 46, in <module>
        save_party_templates()
      File "process_party_tmps.py", line 20, in save_party_templates
        file = open(export_dir + "party_templates.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/party_templates.txt'
    Exporting parties
    Creating new tag_uses.txt file...
    Traceback (most recent call last):
      File "process_parties.py", line 69, in <module>
        save_parties(parties)
      File "process_parties.py", line 12, in save_parties
        file = open(export_dir + "parties.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/parties.txt'
    Exporting quest data...
    Traceback (most recent call last):
      File "process_quests.py", line 30, in <module>
        save_quests()
      File "process_quests.py", line 9, in save_quests
        ofile = open(export_dir + "quests.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/quests.txt'
    Exporting info_page data...
    Traceback (most recent call last):
      File "process_info_pages.py", line 26, in <module>
        save_info_pages()
      File "process_info_pages.py", line 9, in save_info_pages
        ofile = open(export_dir + "info_pages.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/info_pages.txt'
    Exporting scripts...
    variables.txt not found. Creating new variables.txt file
    variable_uses.txt not found. Creating new variable_uses.txt file
    Creating new tag_uses.txt file...
    Creating new quick_strings.txt file...
    Traceback (most recent call last):
      File "process_scripts.py", line 52, in <module>
        save_scripts(variables,variable_uses,scripts,tag_uses,quick_strings)
      File "process_scripts.py", line 10, in save_scripts
        file = open(export_dir + "scripts.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/scripts.txt'
    Exporting mission_template data...
    variables.txt not found. Creating new variables.txt file
    variable_uses.txt not found. Creating new variable_uses.txt file
    Creating new tag_uses.txt file...
    Creating new quick_strings.txt file...
    Traceback (most recent call last):
      File "process_mission_tmps.py", line 64, in <module>
        save_mission_templates(variables,variable_uses,tag_uses,quick_strings)
      File "process_mission_tmps.py", line 38, in save_mission_templates
        file = open(export_dir + "mission_templates.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/mission_templates.txt'
    Exporting game menus data...
    variables.txt not found. Creating new variables.txt file
    variable_uses.txt not found. Creating new variable_uses.txt file
    Creating new tag_uses.txt file...
    Creating new quick_strings.txt file...
    Traceback (most recent call last):
      File "process_game_menus.py", line 47, in <module>
        save_game_menus(variables,variable_uses,tag_uses,quick_strings)
      File "process_game_menus.py", line 22, in save_game_menus
        ofile = open(export_dir + "menus.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/menus.txt'
    exporting simple triggers...
    variables.txt not found. Creating new variables.txt file
    variable_uses.txt not found. Creating new variable_uses.txt file
    Creating new tag_uses.txt file...
    Creating new quick_strings.txt file...
    Traceback (most recent call last):
      File "process_simple_triggers.py", line 24, in <module>
        save_simple_triggers(variables,variable_uses,simple_triggers,tag_uses,quick_
    strings)
      File "process_simple_triggers.py", line 8, in save_simple_triggers
        file = open(export_dir + "simple_triggers.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/simple_triggers.txt'
    exporting triggers...
    variables.txt not found. Creating new variables.txt file
    variable_uses.txt not found. Creating new variable_uses.txt file
    Creating new tag_uses.txt file...
    Creating new quick_strings.txt file...
    Traceback (most recent call last):
      File "process_dialogs.py", line 201, in <module>
        save_triggers(variables,variable_uses,triggers,tag_uses,quick_strings)
      File "process_dialogs.py", line 47, in save_triggers
        file = open(export_dir + "triggers.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/triggers.txt'
    Checking global variable usages...
    variables.txt not found. Creating new variables.txt file
    variable_uses.txt not found. Creating new variable_uses.txt file
    Exporting postfx_params...
    Traceback (most recent call last):
      File "process_postfx.py", line 27, in <module>
        write_postfx_params(postfx_params)
      File "process_postfx.py", line 13, in write_postfx_params
        ofile = open(export_dir + "postfx.txt","w")
    IOError: [Errno 13] Permission denied: 'D:/Program Files (x86)/Steam/steamapps/c
    ommon/MountBlade Warband/Modules/test/postfx.txt'
    
    ______________________________
    
    Script processing has ended.
    Press any key to exit. . .

    windows in denying you permission to compile to your warband folder, try compilling somewhere else and then copying it into the warband/modules folder
  9. Ikaguia

    OSP Kit MP Native MS 1.168 without Singleplayer - 0.2 hotfix released

    try setting the module folder to somewhere outside Program files, windows doesnt like programs changing things there
  10. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    language files

    you can generate them ingame by running it windowed and clicking the buttons on the bar on the top
  11. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    Bustah said:
    When is the fact that someone is going to be able to be taken prisoner decided? Before or after ti_agent_killed_or_wounded? Because for some reason after some battles I have more prisoners than there were people wounded and I have some where there are less. It seems that even though I am setting the result of ti_agent_killed_or_wounded in my code, and they show up as killed or wounded in the battle correctly, the prisoner aftermath is wrong. If I leave the battle early, they have the right amount afterwards... it's just the prisoners part that is behaving incorrectly. Any ideas?

    Edit: OK so after some testing I have found that despite setting the result of the trigger, their fate regarding prisonership is already decided.  :???:
    you can use agent_set_no_death_knock_down_only on ti_on_agent_hit
  12. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    overlays made one after the other are sequential

    so, if you do something like:

    Code:
    (create_text_overlay, "@aaa", "$first_overlay"),
    #set overlay pos
    (try_for_range, ":troop", first_troop, last_troop),
        (str_store_troop_name, s0, ":troop"),
        (create_text_overlay, "@A {s0}", reg0),
        #set overlay pos
        (create_text_overlay, "@B do something", reg0),
        #set overlay pos
        (create_text_overlay, "@C do something", reg0),
        #set overlay pos
    (try_end),

    then if you want to get the overlay_id from the troop id, you do:
    Code:
    (store_sub, ":troop_offset", ":troop_id", first_troop),
    (store_mul, ":overlay_id", ":troop_offset", 3),#3 overlays per troop
    (val_add, ":overlay_id", "$first_overlay"),
    (val_add, ":overlay_id", 1),#1 for A, 2 for B, 3 for C

    and if you want troop_id from overlay_id:
    Code:
    (store_add, ":begin", "$first_overlay", 1),
    (store_sub, ":end", last_troop, first_troop),
    (val_mul, ":end", 3),#3 overlays per troop
    (val_add, ":end", ":begin"),
    (try_begin),
        (is_between, ":overlay_id", ":begin", ":end"),
        (val_sub, ":overlay_id", ":begin"),
        (store_div, ":troop_id", ":overlay_id", 3),
        (val_add, ":troop_id", first_troop),
        (store_mod, ":overlay_type", ":overlay_id", 3),
        (try_begin),#A
            (eq, ":overlay_type", 0),
            #do something
        (else_try),#B
            (eq, ":overlay_type", 1),
            #do something
        (else_try),#C
            #do something
        (try_end),
    (try_end),

  13. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    on multiplayer, does anyone know any way to diferentiate players actually joining the server and players "joining" the server because of map changes?

    this could be either from the server or the client.
  14. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    you could also use the actual cast_ray operation, it will stop at the first agent/scene_prop/ground it hits, so it wont hit trought walls or other agents.

    Code:
    cast_ray                                     = 1900  # (cast_ray, <destination>, <hit_position_register>, <ray_position_register>, [<ray_length_fixed_point>]),
    # Version 1.161+. Casts a ray starting from <ray_position_register> and stores the closest hit position into <hit_position_register> (fails if no hits). If the body hit is a scene prop, its instance id will be stored into <destination>, otherwise it will be -1. Optional <ray_length> parameter seems to have no effect.

    edit:

    actually, Im not sure it it hits agents, but if it does you could do a quick check to get the one that is nearest to the hit point
  15. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    are u using particle_system_emit? it has a field for duration

    Code:
    particle_system_emit                        = 1968  # (particle_system_emit, <par_sys_id>, <value_num_particles>, <value_period>),
    																										# Adds a particle system in some fancy way. Uses position offset and color provided to previous calls to (set_position_delta) and (set_current_color). Can only be used in item/prop triggers.
  16. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    I'm not sure, but probably either number, life, damping, or a combination of them

    Code:
    #  5) Particle Life:    Each particle lives this long (in seconds).
  17. Ikaguia

    MP Native LWBR WarForge (v1.133) - Finishing up v2.0 (19/12/2017)

    Progress update:

    managed to remake a bunch of stuff to make it easier for me to add things
    readded arena and peasant items, as well as the custom items from WarForge
    remade the WarForge menu

    Ill now start to readd other things such as the new maps, taunts, weather and jumping from horses.
  18. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    Seek n Destroy said:

    Hot damn, I was cracking my head at similar issues for a while now. Kinda glad I randomly decided to check the thread.

    glad I could help :smile:
  19. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    _Sebastian_ said:
    Ikaguia said:

    What number is multiplayer_event_client?
    And show off the code of that particular event.

    Code:
    multiplayer_event_server			= 200
    multiplayer_event_client			= 201

    and the code for that particular event doesnt even matter, because I added the debug part at the very beggining of script_game_receive_network_message
    anyway, here is the code for that event:
    Code:
    	(else_try),
    		(eq, l.event_type, lwbr.multiplayer_event_client),
    		(store_script_param, l.type, 3),
    		(try_begin),
    			(multiplayer_is_dedicated_server),
    			(display_message, "@Error: Received lwbr.cl_event #{reg0} on server"),
    		(else_try),
    			(neg|is_between, l.type, lwbr.cl_event.start, lwbr.cl_event.start + 100),
    			(assign, reg0, l.type),
    			(display_message, "@Error: Invalid type received for lwbr.cl_event #{reg0}"),
    		(else_try),
    			(ge, l.type, lwbr.cl_event.end - 1),
    			(assign, reg0, l.type),
    			(display_message, "@Error: Unrecognized type received for lwbr.cl_event #{reg0}"),
    		inject('lwbr_inject_client_only_events'),
    		(else_try),
    			(assign, reg0, l.type),
    			(display_message, "@Error: Untreated type received for lwbr.cl_event #{reg0}"),
    		(try_end),

    Code:
    	'lwbr_inject_client_only_events' : [
    		(else_try),#set_var
    			(eq, l.type, lwbr.cl_event.set_var),
    			(store_script_param, l.slot, 4),
    			(store_script_param, l.val, 5),
    			] + foo__debug_func("cl_event.set_var", [l.slot, l.val]) + [
    			(try_begin),
    				(neg|is_between, l.slot, 0, lwbr.var.count),
    				(assign, reg0, l.slot),
    				(display_message, "@Error: invalid or unrecognized var #{reg0} at cl_event.set_var"),
    			(else_try),
    				(troop_set_slot, trp.lwbr_vars, l.slot, l.val),
    				# (try_begin),
    				# 	(eq, l.slot, lwbr.var.---),
    				# 	---
    				# (try_end),
    			(try_end),
    		(else_try),#ask_var
    			(eq, l.type, lwbr.cl_event.ask_var),
    			(store_script_param, l.slot, 4),
    			] + foo__debug_func("cl_event.ask_var", [l.slot]) + [
    			(try_begin),
    				(neg|is_between, l.slot, 0, lwbr.var.count),
    				(assign, reg0, l.slot),
    				(display_message, "@Error: invalid or unrecognized var #{reg0} at cl_event.ask_var"),
    			(else_try),
    				(troop_get_slot, l.val, trp.lwbr_vars, l.slot),
    				(call_script, script.lwbr_send_event_to_server, lwbr.multiplayer_event_server,
    					lwbr.sv_event.return_var, l.slot, l.val, 0),
    			(try_end),
    		(else_try),#return_sv_var
    			(eq, l.type, lwbr.cl_event.return_sv_var),
    			(store_script_param, l.slot, 4),
    			(store_script_param, l.val, 5),
    			] + foo__debug_func("cl_event.return_sv_var", [l.slot,l.val]) + [
    			(try_begin),
    				(neg|is_between, l.slot, 0, lwbr.sv_var.count),
    				(assign, reg0, l.slot),
    				(display_message, "@Error: invalid or unrecognized sv_var #{reg0} at cl_event.return_sv_var"),
    			(else_try),
    				(troop_set_slot, trp.lwbr_sv_vars, l.slot, l.val),
    				(try_begin),
    					(eq, l.slot, lwbr.sv_var.items),
    					(call_script, script.lwbr_give_items_to_troops, l.val),
    				(try_end),
    			(try_end),
    		(else_try),#set_faction_slot
    			(eq, l.type, lwbr.cl_event.set_faction_slot),
    			(store_script_param, l.faction, 4),
    			(store_script_param, l.slot, 5),
    			(store_script_param, l.val, 6),
    			] + foo__debug_func("cl_event.set_faction_slot", [l.faction, l.slot, l.slot]) + [
    			(try_begin),
    				# (is_between, l.faction, 0, fac.end),
    				(faction_set_slot, l.faction, l.slot, l.val),
    			(else_try),
    				(assign, reg0, l.slot),
    				(display_message, "@Error: invalid faction #{reg0} at cl_event.set_faction_slot"),
    			(try_end),
    		(else_try),#clear_items
    			(eq, l.type, lwbr.cl_event.clear_items),
    			] + foo__debug_func("cl_event.clear_items") + [
    			(call_script, script.lwbr_force_change_weapons),
    		],

    the whole thing is here if you´re interested: https://github.com/Ikaguia/LWBR-WarForge


    the weird part is, it works perfectly if I host the server from inside the game, but running the same code on a dedicated server seems to fail to send the events.

    _Sebastian_ said:
    btw... try to not use line breaks within operations.

    they are just python lists, no problem with line breaks in those AFAIK



    edit:

    and I checked, I am sending it to the right l.player_no



    edit2:

    I think I might have figured it out, when sendint event #200 from player to server, I received event #72 on server, it seems that event_type are limited to 128 = 2^7, gonna confirm it now, change the event ids to 125 and 126



    edit3:

    yep, that seemed to fix it, would be nice if TW told us somewhere the limits on things like this :/
  20. Ikaguia

    Modding Q&A [For Quick Questions and Answers]

    Code:
    ("game_receive_network_message",[
    	(store_script_param, ":player_no", 1),
    	(store_script_param, ":event_type", 2),
    	#LWBR WarForge 2.0 --- BEGIN
    	(assign, reg0, l.player_no),
    	(assign, reg1, l.event_type),
    	(display_message, "@script.game_receive_network_message {reg0} {reg1}"),

    Code:
    ("multiplayer_server_player_joined_common",[
    	(store_script_param, ":player_no", 1),
    	(try_begin),
    		(this_or_next|player_is_active, ":player_no"),
    		(eq, ":player_no", 0),
    		...
    		(try_begin),
    			(multiplayer_is_server),
    			...
    			(call_script, "script_multiplayer_send_initial_information", ":player_no"),
    			#LWBR WarForge 2.0 --- BEGIN
    			(str_store_player_username, s0, l.player_no),
    			(assign, reg0, l.player_no),
    			(player_get_unique_id, reg1, l.player_no),
    			(display_message, "@player '{s0}' id #{reg0} uid #{reg1} joined"),
    			(display_message, "@asking info from player"),
    			(multiplayer_send_2_int_to_player, l.player_no, multiplayer_event_client,
    				cl_event.ask_var, var.version),
    			#LWBR WarForge 2.0 --- END
    		(try_end),
    	(try_end),
    	]),

    can anyone help me here?
    script_multiplayer_send_initial_information sends a lot of events to the player, and all of those are received by the client
    right after that script, I print a debug message and try to send another event to the player, the same way script_multiplayer_send_initial_information does it, but the client doesnt get it.



    edit:

    Code:
    ("multiplayer_send_initial_information",[
    	(store_script_param, ":player_no", 1),
    	(multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_return_num_bots_in_team, 1, "$g_multiplayer_num_bots_team_1"),
    	...
    	]),
Back
Top Bottom