Recent content by Vetrogor

  1. Vetrogor

    WFaS Coding (game_key_is_down, gk_attack)

    Trying different combinations key_is_down/game_key_is_down and gk_attack/key_left_mouse_button may help. I will do some tests.
    dsI0zhP.jpg


    But I used mnb engine of v1.172.
  2. Vetrogor

    [MODDING] Prophesy of Pendor Tweaks and Talk

    [FIX] To disable defenders charge in sieges.

    This bug inherited from Native module system. It will force defenders to charge after several reinforcement waves. The fix just deletes that code.

    1) Open file mission_templates.txt
    2) Find 2 instances of code and replace
    Python:
    3.000000 0.000000 5.000000  0  26 2147483678 2 144115188075856321 144115188075857270 2370 1 1224979098644774912 30 2 1224979098644774912 2 2385 2 1224979098644774913 0 2147483678 2 1224979098644774913 30 1930 2 4 10 2105 2 144115188075856321 1 4 0 32 2 1224979098644774912 300 1700 1 1224979098644774914 1770 2 1224979098644774915 1224979098644774914 2147483679 2 1224979098644774915 144115188075856381 2147483679 2 1224979098644774915 144115188075856383 30 2 144115188075856321 2 1107 1 0 1790 3 144115188075856381 0 2 1790 3 144115188075856383 0 2 1790 3 144115188075856381 2 2 1790 3 144115188075856383 2 2 1107 1 1 30 2 144115188075856321 4 1107 1 0 1790 3 144115188075856381 9 2 1790 3 144115188075856383 9 2 1107 1 1 3 0

    Code to replace
    Python:
    3.000000 0.000000 5.000000  0  7 2147483678 2 144115188075856321 144115188075857270 2370 1 1224979098644774912 30 2 1224979098644774912 2 2385 2 1224979098644774913 0 2147483678 2 1224979098644774913 30 1930 2 4 10 2105 2 144115188075856321 1
  3. Vetrogor

    WB Coding Fix bots in a battle scene (anim_stand_staff) Singleplayer

    Also agent_set_look_target_position works only short amount of time. You can exploit it to fix look position. Create a storage for agents in some troop then each frame use agent_set_look_target_position on agents. For example:
    Python:
      (0,0,0,[],[
        (troop_get_slot, ":num", "trp_storage", 0),
        (val_add, ":num", 1),
        (try_for_range, ":slot", 1, ":num"),
          (troop_get_slot, ":agent", "trp_storage", ":slot"),
          (agent_get_slot, ":x", ":agent", slot_agent_look_x),
          (agent_get_slot, ":y", ":agent", slot_agent_look_y),
          (agent_get_slot, ":z", ":agent", slot_agent_look_z),
          (init_position, pos1),
          (position_set_x, pos1, ":x"),
          (position_set_y, pos1, ":y"),
          (position_set_z, pos1, ":z"),
          (agent_set_look_target_position, ":agent", pos1),
        (try_end),
      ]),

    This is just an example. You need to store agents and look position slots.

    p.s. It's not very efficient but I don't know any better way.
  4. Vetrogor

    WFaS Coding Health Bars

    I use this code in SP not sure if it works in MP
    Python:
        (ti_battle_window_opened, 0, 0, [], [
          (start_presentation, "prsnt_battle_window"),
        ]),
    If it doesn't work than try this
    Python:
        (1, 0, 0, [
          (neg|presentation_is_active, "prsnt_battle_window"),
        ], [
          (start_presentation, "prsnt_battle_window"),
        ]),
  5. Vetrogor

    WB Coding Fix bots in a battle scene (anim_stand_staff) Singleplayer

    Setting agent_set_speed_limit to 0 can fix agent on one place.
  6. Vetrogor

    Warband Script Enhancer 2 (v1.0.5.6)

    in WSE2 limit 100

    Nope it is limited to 64.
  7. Vetrogor

    Warband Script Enhancer 2 (v1.0.5.6)

    There is a limit in the character view screen. You can't increase above 63.
  8. Vetrogor

    Warband Script Enhancer 2 (v1.0.5.6)

    Currently limit for attributes like strength are limited to 63. It will be good to rase limit to 255 at least.
  9. Vetrogor

    WB Coding WRECK full plugin system python code how to integrate?

    deepcopy doesn't eat factions of items. How to workaround this? This happens because WRECK fully uses dynamic tags.

    I have tried to slice
    Python:
    add_items = glob['items'][:]
    but it gives error that "agregation and int are not compatible" in get_thrust_damage.
  10. Vetrogor

    WB Coding WRECK full plugin system python code how to integrate?

    So deepcopy function seems don't work. I wonder why?

    This is the error screen
    M0oKVMq.jpg


    This is my test code
    Python:
    # -*- coding: UTF-8 -*-
    from compiler import *
    register_plugin()
    
    def preprocess_entities(glob):
      add_items = deepcopy(glob['items'])

    This is WRECK code
    Python:
    	try:
    		stage = 0
    		# Pre-processing (note that all entity-level injections are already done but script-level injections are not).
    		glob = get_globals()
    		preprocess_entities_internal(glob)
    		stage = 1
    		for plugin in WRECK.plugins:
    			processor = getattr(glob[plugin], 'preprocess_entities', None)
    			if processor:
    				try: processor(glob)
    				except Exception, e: raise MSException('Error in %r pre-processor script.' % plugin, formatted_exception())
    		# Compiling...
    		stage = 2
    		for entity_name, entity_def in parsers.iteritems():
    			stage = 3
    			entities = get_globals()[entity_name]
    			stage = 4
    			for index in xrange(len(entities)):
    				entities[index] = entity_def['processor'](entities[index], index)
    			stage = 5
    			setattr(WRECK, entity_name, entity_def['aggregator'](entities))
    		# Post-processing (plugins are NOT allowed to do anything here as we are dealing with already compiled code)
    		stage = 6
    		postprocess_entities()
    	except Exception, e:
    		print '{1}FAILED.'.format(*COLORAMA)
    		if isinstance(e, MSException):
    			if stage == 0:
    				print 'COMPILER PREPROCESSOR ERROR:\n{error!s}{0}'.format(*COLORAMA, error = e.formatted())
    			if stage == 1:
    				print 'PLUGIN {module!s} PREPROCESSOR ERROR:\n{error!s}{0}'.format(*COLORAMA, module = plugin, error = e.formatted())
    			elif stage == 3:
    				print 'MODULE {module!s} ENTITY #{index} COMPILATION ERROR:\n{error!s}{0}'.format(*COLORAMA, module = entity_name, index = index, error = e.formatted())
    			elif stage == 4:
    				print 'MODULE {module!s} AGGREGATOR ERROR:\n{error!s}{0}'.format(*COLORAMA, module = entity_name, error = e.formatted())
    			elif stage == 5:
    				print 'COMPILER POSTPROCESSOR ERROR:\n{error!s}{0}'.format(*COLORAMA, error = e.formatted())
    		else:
    			print 'COMPILER INTERNAL ERROR:\n{error!s}{0}'.format(*COLORAMA, error = formatted_exception())
    		WRECK.time_compile = gettime()
    		raise MSException()
    	print '{2}DONE.{0}'.format(*COLORAMA)
    	WRECK.time_compile = gettime()
  11. Vetrogor

    WB Coding python code doesn't work

    This is how I fixed psevdorandom equipment of agents. When mission starts the random generator aparently uses mission timer as seed for random generator. Each time you enter to the scene random will generate the same sequence. It always uses 0 as time for starting random sequence. So I have just shifted the sequence of random numbers from (0 to 99) wich gives more random results in equipment. I think this also can help for face randomisation. Well at the beginning this code I used for random reequipment and sudenly it changes all randomness.

    1) Add this trigger at the begining of each mission.
    Python:
    (ti_on_agent_spawn, 0, ti_once,[],[
        # Procedure to fix psevdorandom of troops equipment
        (try_for_range, ":i", 0, "$random_seed"), 
          (store_random_in_range, reg10, 0, 2),
        (try_end),

    2) Add this code for each mission end possibilty. This can take some time but it is worth it.
    Python:
    (store_mission_timer_a_msec, "$random_seed"),
    (val_mod, "$random_seed", 100),

    In the global map I don't think that random can duplicate sequences because random uses time as seed.
    Well the first spawned agent will not be randomised. Maybe reequip him.
  12. Vetrogor

    WB Coding WRECK full plugin system python code how to integrate?

    I need to integrate python code in the fully integrated WRECK via plugin system. This code creates duplicate noswing weapons for motomotaru formations. I don't know python well. So how can I do it? This code doesn't work. from copy import deepcopy from compiler import * register_plugin() def...
  13. Vetrogor

    Warband Refined & Enhanced Compiler Kit (v1.0.0 @ Mar 01, 2015)

    Addition to plugin_ms_extension.py

    This is division rounded up. For negative values it will round down.

    Python:
    (val_divup, <destination>, <value>),	              # Divide destination with round up. Negatives will be rounded down.
    (store_divup, <destination>, <value1>, <value2>),	   # Divide destination := value1/value2 with round up. Negatives will be rounded down.

    Python:
    def val_divup(destination, value, *argl):
    	return [
    		(assign, l._sign_, destination),
    		(val_abs, destination),
    		(val_div, l._sign_, destination),
    		(assign, l._y_, value),
    		(val_mul, l._sign_, l._y_),
    		(val_abs, l._y_),
    		(val_div, l._sign_, l._y_),
    		(val_add, destination, l._y_),
    		(val_sub, destination, 1),
    		(val_div, destination, l._y_),
    		(val_mul, destination, l._sign_),
    	]
    
    def store_divup(destination, value1, value2, *argl):
    	return [
    		(assign, l._sign_, value1),
    		(assign, l._y_, value2),
    		(assign, l._x_, value1),
    		(val_abs, l._x_),
    		(val_div, l._sign_, l._x_),
    		(val_mul, l._sign_, l._y_),
    		(val_abs, l._y_),
    		(val_div, l._sign_, l._y_),
    		(val_add, l._x_, l._y_),
    		(val_sub, l._x_, 1),
    		(store_div, destination, l._x_, l._y_),
    		(val_mul, destination, l._sign_),
    	]
  14. Vetrogor

    Warband Battle Size Changer v1.5

    @blinky182, the easiest way to modify Viking Conquest module system files and compile.
  15. Vetrogor

    PYTHON SCRIPT/SCHEME EXCHANGE

    @SupaNinjaMan , I don't know what is exactly your code do. Maybe you need to sort all agents on the scene maybe not. But I add some information to clarify. As for arena correct your code to this and watch rgl_log:
    Python:
    (try_begin),
        (key_clicked, key_k),
        (try_for_agents, reg11),
            (str_store_agent_name, s11, reg11),
            (agent_ai_get_num_cached_enemies, reg12, reg11),
            (display_message, "@{reg12} enemies are cached by {reg11}:{s11}, they are:"),
            (try_for_range, ":index", 0, reg12),
                (agent_ai_get_cached_enemy, reg13, reg11, ":index"),
                (str_store_agent_name, s13, reg13),
                (display_message, "@{reg13}: {s13}"),
            (try_end),
        (try_end),
    (try_end),
Top Bottom