Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
kalarhan said:
Cozur said:
I'm trying to improve the performance of ACOK on the world map, as it has a tendency to stutter a bit much, while at the same time also having some weird pathfinding for the player character.

What are the most common reasons for the two above?

look at VC and how they changed the big triggers (stuff like economy) from a single event (once a day/week), to something that happens often (say every second, but only one party/NPC/etc at time). By using a new distribution of resources they managed to eliminate the lag on world map (as VC has dozens of kingdoms, hundreds of centers, NPCs, etc).

example:
#walled centers weekly ON AVERAGE
  (1.4,
    [
      #Party AI: pruning some of the prisoners in each center (once a week)
      (store_random_in_range, ":center_no", walled_centers_begin, walled_centers_end),
 

if you have any trigger causing lag (easy to test, as you can run them by themselves and see the impact), that is a easy way to fix it.
Can somebody explain this to me? How do they make sure that every party (center in this case) will get the effect applied to?
 
#walled centers weekly ON AVERAGE
  (1.4,
    [
      #Party AI: pruning some of the prisoners in each center (once a week)
      (store_random_in_range, ":center_no", walled_centers_begin, walled_centers_end),
 
The red marked piece makes sure that every party between the first town and last castle in module_parties_py has this the 'effect' applied to.

Reference can be found in module_constants_py:
module_constants_py said:
taverns_begin = "p_four_ways_inn"
towns_begin = "p_town_1"
castles_begin = "p_castle_1"
villages_begin = "p_village_1"

towns_end = castles_begin
castles_end = villages_begin
villages_end  = "p_salt_mine"
taverns_end = towns_end

walled_centers_begin = towns_begin
walled_centers_end  = castles_end

centers_begin = towns_begin
centers_end  = villages_end
 
KratosMKII said:
kalarhan said:
Cozur said:
I'm trying to improve the performance of ACOK on the world map, as it has a tendency to stutter a bit much, while at the same time also having some weird pathfinding for the player character.

What are the most common reasons for the two above?

look at VC and how they changed the big triggers (stuff like economy) from a single event (once a day/week), to something that happens often (say every second, but only one party/NPC/etc at time). By using a new distribution of resources they managed to eliminate the lag on world map (as VC has dozens of kingdoms, hundreds of centers, NPCs, etc).

example:
#walled centers weekly ON AVERAGE
  (1.4,
    [
      #Party AI: pruning some of the prisoners in each center (once a week)
      (store_random_in_range, ":center_no", walled_centers_begin, walled_centers_end),
 

if you have any trigger causing lag (easy to test, as you can run them by themselves and see the impact), that is a easy way to fix it.
Can somebody explain this to me? How do they make sure that every party (center in this case) will get the effect applied to?

they dont

the random process will make sure that over time all parties (centers) will be processed on the average of once a week. That doesnt mean they will all be processed once every week.

1) Count how many centers you have to process (towns, castles, ...)
2) Divide the time period you will be using (5 days, 7 days, whatever) by the result.
  50 centers
  5 days
  5 days * 24 hours / 50 centers :=  2.4 hours of interval for the trigger

if you want a guaranteed process then just do a incremental loop (one center at time, use a reg or global and add to it until you finish the week, then reset back to starting value)
 
Cozur said:
How do I disable the player regaining all their health after completing a tournament round?

check the tournament code, if it is using the operations to manually set the troop and or agent HP you can change it. If it is not then you can use a global to store the value and do it yourself.

in combat
Code:
store_agent_hit_points                   = 1720  # (store_agent_hit_points, <destination>, <agent_id>, [absolute]),
                                                 # Retrieves current agent health. Optional last parameter determines whether actual health (absolute = 1) or relative percentile health (absolute = 0) is returned. Default is relative.
agent_set_hit_points                     = 1721  # (agent_set_hit_points, <agent_id>, <value>,[absolute]),
                                                 # Sets new value for agent health. Optional last parameter determines whether the value is interpreted as actual health (absolute = 1) or relative percentile health (absolute = 0). Default is relative.

outside combat
Code:
store_troop_health                       = 2175  # (store_troop_health, <destination>, <troop_id>, [absolute]), # set absolute to 1 to get actual health; otherwise this will return percentage health in range (0-100)
                                                 # Retrieves current troop health. Use absolute = 1 to retrieve actual number of hp points left, use absolute = 0 to retrieve a value in 0..100 range (percentage).
troop_set_health                         = 1560  # (troop_set_health, <troop_id>, <relative health (0-100)>),
                                                 # Sets troop health. Accepts value in range 0..100 (percentage).
 
gokiller said:
#walled centers weekly ON AVERAGE
  (1.4,
    [
      #Party AI: pruning some of the prisoners in each center (once a week)
      (store_random_in_range, ":center_no", walled_centers_begin, walled_centers_end),
 
The red marked piece makes sure that every party between the first town and last castle in module_parties_py has this the 'effect' applied to.

Reference can be found in module_constants_py:
module_constants_py said:
taverns_begin = "p_four_ways_inn"
towns_begin = "p_town_1"
castles_begin = "p_castle_1"
villages_begin = "p_village_1"

towns_end = castles_begin
castles_end = villages_begin
villages_end  = "p_salt_mine"
taverns_end = towns_end

walled_centers_begin = towns_begin
walled_centers_end  = castles_end

centers_begin = towns_begin
centers_end  = villages_end
Sorry it was not this.

kalarhan said:
KratosMKII said:
kalarhan said:
Cozur said:
I'm trying to improve the performance of ACOK on the world map, as it has a tendency to stutter a bit much, while at the same time also having some weird pathfinding for the player character.

What are the most common reasons for the two above?

look at VC and how they changed the big triggers (stuff like economy) from a single event (once a day/week), to something that happens often (say every second, but only one party/NPC/etc at time). By using a new distribution of resources they managed to eliminate the lag on world map (as VC has dozens of kingdoms, hundreds of centers, NPCs, etc).

example:
#walled centers weekly ON AVERAGE
  (1.4,
    [
      #Party AI: pruning some of the prisoners in each center (once a week)
      (store_random_in_range, ":center_no", walled_centers_begin, walled_centers_end),
 

if you have any trigger causing lag (easy to test, as you can run them by themselves and see the impact), that is a easy way to fix it.
Can somebody explain this to me? How do they make sure that every party (center in this case) will get the effect applied to?

they dont

the random process will make sure that over time all parties (centers) will be processed on the average of once a week. That doesn't mean they will all be processed once every week.

1) Count how many centers you have to process (towns, castles, ...)
2) Divide the time period you will be using (5 days, 7 days, whatever) by the result.
  50 centers
  5 days
  5 days * 24 hours / 50 centers :=  2.4 hours of interval for the trigger

if you want a guaranteed process then just do a incremental loop (one center at time, use a reg or global and add to it until you finish the week, then reset back to starting value)
Thanks. I added the incremental loops you mentioned to the simple triggers that VC altered.


Edit: Crap. Now i'm getting a IndexError:
*** Warband Refined & Enhanced Compiler Kit (W.R.E.C.K.) version 1.0.0 ***
Please report errors, problems and suggestions at http://lav.lomskih.net/wreck/

Loading module... DONE.
Loading plugins... DONE.
Checking module syntax... DONE.
Allocating identifiers... DONE.
Compiling module... FAILED.
COMPILER INTERNAL ERROR:
Traceback (most recent call last):
  File "compile.py", line 310, in <module>
    entities[index] = entity_def['processor'](entities[index], index)
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\1257AD-master\compile
r.py", line 1168, in process_simple_triggers
    try: return '%f  %s ' % (e[0], parse_module_code(e[1], 'simple_trigger(#%d).
%s' % (index, trigger_to_string(e[0]))))
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\1257AD-master\compile
r.py", line 1447, in parse_module_code
    command = [operation[0], len(operation) - 1]
IndexError: tuple index out of range


COMPILATION FAILED.

Press any key to continue . . .
Is this because i'm using some unconventional trigger times like this one:
    # Checking center upgrades
  (0.032,  ############# twice a day for each of the 733 centers - script executed twice
  [
 
  (try_begin),
    (lt, "$g_check_center_improvements_cur_center", centers_begin),
    (assign, "$g_check_center_improvements_cur_center", centers_begin),
  (try_end),

  (try_begin),
    (ge, "$g_check_center_improvements_cur_center", centers_end),
    (assign, "$g_check_center_improvements_cur_center", centers_begin),
  (try_end),
 
???
 
Does anyone have any idea on how to decrease the load that "script_create_kingdom_party_if_below_limit" causes? I read the post here and since i'm using it a lot (currently 7 party templates that use this to spawn) and there's 43 factions in 1257AD, plus over 1300+ parties in the map, this most likely is causing a major performance hit whenever it fires.

My simple trigger piece that handles it:
Code:
(val_add, "$g_party_faction_respawn_rate_hours_passed", 4),
(try_begin),
	  (ge, "$g_party_faction_respawn_rate_hours_passed", "$g_party_faction_respawn_rate"),
          (assign, "$g_party_faction_respawn_rate_hours_passed", 0),
	  (try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
          (faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
		  
	      (try_begin),
		   (gt, "$g_party_faction_parties_spawn_chance_foragers", 0),
	    	   (store_random_in_range, ":random_no", 0, 100),
	    	   (le, ":random_no", "$g_party_faction_parties_spawn_chance_foragers"),
	    	   (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_forager),
             (try_end),
            
	      (try_begin),
		   (gt, "$g_party_faction_parties_spawn_chance_scouts", 0),
                   (store_random_in_range, ":random_no", 0, 100),
                   (le, ":random_no", "$g_party_faction_parties_spawn_chance_scouts"),
                   (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_scout),
             (try_end),
          
	      (try_begin),
		   (gt, "$g_party_faction_parties_spawn_chance_patrols", 0),
                   (store_random_in_range, ":random_no", 0, 100),
                   (le, ":random_no", "$g_party_faction_parties_spawn_chance_patrols"), #tom was 10
                   (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_patrol),
              (try_end),
          
         
          (try_begin),
		   (gt, "$g_party_faction_parties_spawn_chance_caravans", 0),
                   (store_random_in_range, ":random_no", 0, 100),
                   (le, ":random_no", "$g_party_faction_parties_spawn_chance_caravans"),
                   (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_kingdom_caravan),
          (try_end),
         
	     (try_begin),
		   (gt, "$g_party_faction_parties_spawn_chance_prisoner_trains", 0),
                   (store_random_in_range, ":random_no", 0, 100),
                   (le, ":random_no", "$g_party_faction_parties_spawn_chance_prisoner_trains"),
                   (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_prisoner_train),
            (try_end),
	     
	     
         (try_begin),
		   (gt, "$g_party_faction_parties_spawn_chance_war_parties", 0),
                   (store_random_in_range, ":random_no", 0, 100),
                   (le, ":random_no", "$g_party_faction_parties_spawn_chance_war_parties"),
                   (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_war_party),
         (try_end),
	     
	     
         (try_begin),
		   (gt, "$g_party_faction_parties_spawn_chance_mercenary_companies", 0),
                   (store_random_in_range, ":random_no", 0, 100),
                   (le, ":random_no", "$g_party_faction_parties_spawn_chance_mercenary_companies"),
                   (call_script, "script_create_kingdom_party_if_below_limit", ":cur_kingdom", spt_mercenary_company),
         (try_end),

    (try_end),	

(try_end),	
	   

The beginning of script_create_kingdom_party_if_below_limit
Code:
    # script_create_kingdom_party_if_below_limit
    # Input: arg1 = faction_no, arg2 = party_type (variables beginning with spt_)
    # Output: reg0 = party_no
    ("create_kingdom_party_if_below_limit",
      [
        (store_script_param_1, ":faction_no"),
        (store_script_param_2, ":party_type"),
        
        (call_script, "script_count_parties_of_faction_and_party_type", ":faction_no", ":party_type"),
        (assign, ":party_count", reg0),
        
        (assign, ":party_count_limit", 0),
        (faction_get_slot, ":num_towns", ":faction_no", slot_faction_num_towns),
        (faction_get_slot, ":num_castles", ":faction_no", slot_faction_num_castles),
        (store_add, ":num_towns_castles", ":num_towns"),
        (store_add, ":num_towns_castles", ":num_castles"),

script_count_parties_of_faction_and_party_type (what causes most trouble):
Code:
    
    ("count_parties_of_faction_and_party_type",
      [
        (store_script_param_1, ":faction_no"),
        (store_script_param_2, ":party_type"),
        (assign, reg0, 0),
        (try_for_parties, ":party_no"),
          (party_is_active, ":party_no"),
          (party_get_slot, ":cur_party_type", ":party_no", slot_party_type),
          (store_faction_of_party, ":cur_faction", ":party_no"),
          (eq, ":cur_party_type", ":party_type"),
          (eq, ":cur_faction", ":faction_no"),
          (val_add, reg0, 1),
        (try_end),
    ]),
 
KratosMKII said:
Does anyone have any idea on how to decrease the load that "script_create_kingdom_party_if_below_limit" causes?

change your process to count parties once, instead of counting them again and again for each faction (kingdom).

if that is not enough (should be), then implement a tracking system instead (you know when a party is created and destroyed, so just save that data and you dont need to count them anymore by loop)
 
KratosMKII said:
Edit: Crap. Now i'm getting a IndexError:
*** Warband Refined & Enhanced Compiler Kit (W.R.E.C.K.) version 1.0.0 ***
Please report errors, problems and suggestions at http://lav.lomskih.net/wreck/

Loading module... DONE.
Loading plugins... DONE.
Checking module syntax... DONE.
Allocating identifiers... DONE.
Compiling module... FAILED.
COMPILER INTERNAL ERROR:
Traceback (most recent call last):
  File "compile.py", line 310, in <module>
    entities[index] = entity_def['processor'](entities[index], index)
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\1257AD-master\compile
r.py", line 1168, in process_simple_triggers
    try: return '%f  %s ' % (e[0], parse_module_code(e[1], 'simple_trigger(#%d).
%s' % (index, trigger_to_string(e[0]))))
  File "C:\Program Files (x86)\Mount&Blade Warband\Modules\1257AD-master\compile
r.py", line 1447, in parse_module_code
    command = [operation[0], len(operation) - 1]
IndexError: tuple index out of range


COMPILATION FAILED.

Press any key to continue . . .
Is this because i'm using some unconventional trigger times like this one:
    # Checking center upgrades
  (0.032,  ############# twice a day for each of the 733 centers - script executed twice
  [
 
  (try_begin),
    (lt, "$g_check_center_improvements_cur_center", centers_begin),
    (assign, "$g_check_center_improvements_cur_center", centers_begin),
  (try_end),

  (try_begin),
    (ge, "$g_check_center_improvements_cur_center", centers_end),
    (assign, "$g_check_center_improvements_cur_center", centers_begin),
  (try_end),
 
???
Blah. It was this that caused it:
  (call_script, "script_process_sieges_new", ":cur_hours", "$g_process_sieges_new_cur_center"),
  ###### proceeds to the next center
  (val_add, "$g_process_sieges_new_cur_center", 1),
 
      ()
    ]),

kalarhan said:
KratosMKII said:
Does anyone have any idea on how to decrease the load that "script_create_kingdom_party_if_below_limit" causes?

change your process to count parties once, instead of counting them again and again for each faction (kingdom).

if that is not enough (should be), then implement a tracking system instead (you know when a party is created and destroyed, so just save that data and you dont need to count them anymore by loop)
Thank you.
 
lolitablue said:
Is there a solution to increase or decrease the neccessary experience for the level change of a soldier?

module.ini for general setup

script to implement extra rules (like if you want cavalry to require more XP, or bandits less, whatever rule you want)
Code:
  # script_game_get_upgrade_xp
  # This script is called from game engine for calculating needed troop upgrade exp
  # Input:
  # param1: troop_id,
  # Output: reg0 = needed exp for upgrade
  ("game_get_upgrade_xp",
 
kalarhan said:
lolitablue said:
Is there a solution to increase or decrease the neccessary experience for the level change of a soldier?

module.ini for general setup

script to implement extra rules (like if you want cavalry to require more XP, or bandits less, whatever rule you want)
Code:
  # script_game_get_upgrade_xp
  # This script is called from game engine for calculating needed troop upgrade exp
  # Input:
  # param1: troop_id,
  # Output: reg0 = needed exp for upgrade
  ("game_get_upgrade_xp",

Thank you.
 
just a question, does having many mission_templates used upon entering a scene affect the performance?
Like I have different ones, each with a specific type of NPCs that uses specific animations.
example below:
Code:
...
...
...
#imad_agent_spawn begin
imad_agent_spawn = (
	ti_on_agent_spawn,1,0,[
		(eq, "$talk_context", tc_court_talk),
		(store_trigger_param_1,":agent"),
        # (store_script_param_1, ":center_no"),
		(agent_get_troop_id,":troop",":agent"),
         # (store_faction_of_party, ":center_faction", ":center_no"),
         # (faction_get_slot, ":troop", ":center_faction", slot_faction_guard_troop),
          (le, ":troop", 0),
          (assign, ":troop", "trp_castle_guard"),
	 	 (try_begin),
			(try_begin),
                # (agent_get_wielded_item, ":cur_wielded_item", ":agent", 0),
                # (neq, ":cur_wielded_item", "itm_omi_yari_3"),
                # (agent_set_wielded_item, ":agent", "itm_omi_yari_3"),
				# (agent_has_item_equipped,":agent","itm_katana_1"),
				(agent_set_stand_animation, ":agent", "anim_wots_trainer_1"),
				(agent_set_animation, ":agent", "anim_wots_trainer_1"),
			(try_end),
		 (try_end),
      (set_visitor, 32, ":troop"),
      (set_visitor, 33, ":troop"),
      (set_visitor, 34, ":troop"),
      (set_visitor, 35, ":troop"),
      (set_visitor, 36, ":troop"),
      (set_visitor, 37, ":troop"),
      (set_visitor, 38, ":troop"),
      (set_visitor, 39, ":troop"),
      (set_visitor, 40, ":troop"),
      (set_visitor, 41, ":troop"),
      (set_visitor, 42, ":troop"),
      (set_visitor, 43, ":troop"),
      (set_visitor, 44, ":troop"),
      (set_visitor, 45, ":troop"),
      (set_visitor, 46, ":troop"),
      (set_visitor, 47, ":troop"),
      (set_visitor, 48, ":troop"),
      (set_visitor, 49, ":troop"),
      (set_visitor, 50, ":troop"),
      (set_visitor, 51, ":troop"),
      (set_visitor, 52, ":troop"),
      (set_visitor, 53, ":troop"),
      (set_visitor, 54, ":troop"),
      (set_visitor, 55, ":troop"),
      (set_visitor, 56, ":troop"),
      (set_visitor, 57, ":troop"),
      (set_visitor, 58, ":troop"),
      (set_visitor, 59, ":troop"),
      (set_visitor, 60, ":troop"),
      (set_visitor, 61, ":troop"),
      (set_visitor, 62, ":troop"),
      (set_visitor, 63, ":troop"),
      (set_visitor, 64, ":troop"),
      (set_visitor, 65, ":troop"),
      (set_visitor, 66, ":troop"),
      (set_visitor, 67, ":troop"),
      (set_visitor, 68, ":troop"),
      (set_visitor, 69, ":troop"),
      (set_visitor, 70, ":troop"),
	],[])
#imad_agent_spawn end

#imad_agent_spawn_o_sitting begin
imad_agent_spawn_o_sitting = (
	ti_on_agent_spawn,1,0,[
		(eq, "$talk_context", tc_court_talk),
		(store_trigger_param_1,":agent"),
        # (store_script_param_1, ":center_no"),
		(agent_get_troop_id,":troop",":agent"),
         # (store_faction_of_party, ":center_faction", ":center_no"),
         # (faction_get_slot, ":troop", ":center_faction", slot_faction_guard_troop),
          (le, ":troop", 0),
          (assign, ":troop", "trp_old_man"),
	 	 (try_begin),
			(try_begin),
                # (agent_get_wielded_item, ":cur_wielded_item", ":agent", 0),
                # (neq, ":cur_wielded_item", "itm_omi_yari_3"),
                # (agent_set_wielded_item, ":agent", "itm_omi_yari_3"),
				# (agent_has_item_equipped,":agent","itm_katana_1"),
				(agent_set_stand_animation, ":agent", "anim_wots_sitting_1"),
				(agent_set_animation, ":agent", "anim_wots_sitting_1"),
			(try_end),
		 (try_end),
      (set_visitor, 100, ":troop"),
      (set_visitor, 101, ":troop"),
      (set_visitor, 102, ":troop"),
      (set_visitor, 103, ":troop"),
      (set_visitor, 104, ":troop"),
      (set_visitor, 105, ":troop"),
      (set_visitor, 106, ":troop"),
      (set_visitor, 107, ":troop"),
      (set_visitor, 108, ":troop"),
      (set_visitor, 109, ":troop"),
      (set_visitor, 110, ":troop"),
      (set_visitor, 111, ":troop"),
      (set_visitor, 112, ":troop"),
      (set_visitor, 113, ":troop"),
      (set_visitor, 114, ":troop"),
      (set_visitor, 115, ":troop"),
      (set_visitor, 116, ":troop"),
      (set_visitor, 117, ":troop"),
      (set_visitor, 118, ":troop"),
      (set_visitor, 119, ":troop"),
      (set_visitor, 120, ":troop"),
	],[])
#imad_agent_spawn_o_sitting end

#imad_agent_spawn_center begin
imad_agent_spawn_center = (
	ti_on_agent_spawn,1,0,[
		(eq, "$talk_context", tc_court_talk),
		(store_trigger_param_1,":agent"),
        # (store_script_param_1, ":center_no"),
		(agent_get_troop_id,":troop",":agent"),
         # (store_faction_of_party, ":center_faction", ":center_no"),
         # (faction_get_slot, ":troop", ":center_faction", slot_faction_guard_troop),
          (le, ":troop", 0),
          (assign, ":troop", "trp_castle_guard"),
	 	 (try_begin),
			(try_begin),
                # (agent_get_wielded_item, ":cur_wielded_item", ":agent", 0),
                # (neq, ":cur_wielded_item", "itm_omi_yari_3"),
                # (agent_set_wielded_item, ":agent", "itm_omi_yari_3"),
				# (agent_has_item_equipped,":agent","itm_katana_1"),
				(agent_set_stand_animation, ":agent", "anim_wots_guard_1"),
				(agent_set_animation, ":agent", "anim_wots_guard_1"),
			(try_end),
		 (try_end),
      (set_visitor, 50, ":troop"),
      (set_visitor, 51, ":troop"),
      (set_visitor, 52, ":troop"),
      (set_visitor, 53, ":troop"),
      (set_visitor, 54, ":troop"),
      (set_visitor, 55, ":troop"),
      (set_visitor, 56, ":troop"),
      (set_visitor, 57, ":troop"),
      (set_visitor, 58, ":troop"),
      (set_visitor, 59, ":troop"),
      (set_visitor, 60, ":troop"),
      (set_visitor, 61, ":troop"),
      (set_visitor, 62, ":troop"),
      (set_visitor, 63, ":troop"),
      (set_visitor, 64, ":troop"),
      (set_visitor, 65, ":troop"),
      (set_visitor, 66, ":troop"),
      (set_visitor, 67, ":troop"),
      (set_visitor, 68, ":troop"),
      (set_visitor, 69, ":troop"),
      (set_visitor, 70, ":troop"),
	],[])
#imad_agent_spawn_center end
...
...
...
and is there is a way to improve the above?
and another question, how can I make the statistic "trp_castle_guard" replaced with the town/castle owner, faction guards?
Another questio, where can I find the part in script, that decide which entry points the town walkers uses? I looked in their specific code but found nothing.
Thanks in advance!
 
imado552 said:
does having many mission_templates triggers used upon entering a scene affect the performance?
depends on what they do of course, so there is no right answer here

imado552 said:
and another question, how can I make the statistic "trp_castle_guard" replaced with the town/castle owner, faction guards?
add the logic on the spawn script to choose another troop
 
kalarhan said:
depends on what they do of course, so there is no right answer here
Well, mine so far don't anything much other than adding more agents or npcs to scenes and some horses. so does that mean they won't have that much of an effect?
kalarhan said:
add the logic on the spawn script to choose another troop
Edit: Fixed thanks!
 
kalarhan said:
Cozur said:
How do I disable the player regaining all their health after completing a tournament round?

check the tournament code, if it is using the operations to manually set the troop and or agent HP you can change it. If it is not then you can use a global to store the value and do it yourself.

in combat
Code:
store_agent_hit_points                   = 1720  # (store_agent_hit_points, <destination>, <agent_id>, [absolute]),
                                                 # Retrieves current agent health. Optional last parameter determines whether actual health (absolute = 1) or relative percentile health (absolute = 0) is returned. Default is relative.
agent_set_hit_points                     = 1721  # (agent_set_hit_points, <agent_id>, <value>,[absolute]),
                                                 # Sets new value for agent health. Optional last parameter determines whether the value is interpreted as actual health (absolute = 1) or relative percentile health (absolute = 0). Default is relative.

outside combat
Code:
store_troop_health                       = 2175  # (store_troop_health, <destination>, <troop_id>, [absolute]), # set absolute to 1 to get actual health; otherwise this will return percentage health in range (0-100)
                                                 # Retrieves current troop health. Use absolute = 1 to retrieve actual number of hp points left, use absolute = 0 to retrieve a value in 0..100 range (percentage).
troop_set_health                         = 1560  # (troop_set_health, <troop_id>, <relative health (0-100)>),
                                                 # Sets troop health. Accepts value in range 0..100 (percentage).

Haven't been able to find it anywhere in the code.

When you say using a global, wouldn't that be overwritten, given that there must be a piece of code resetting the health of the player after every match?
 
Mission template type is "step 1" in determining if health/inventory carries over after the scene finishes. So if health isn't being restored manually, it's probably being done when finishing the mission. Ultimately, if you are manually setting it, it doesn't matter either way.

RE: "Wouldn't that be overwritten" - apply your HP changes after it gets overwritten and there's nothing to worry about.  :mrgreen:
 
so just I created a script by copy-pasting init_town_walker script and modifying it for both the town castle interior and the normal castle_centers
Code:
##wots_modifications
  # script.init_castle_walkers
  # Input: none
  # Output: none
  ("init_castle_walkers",
  [
    (try_begin),
      # (eq, "$town_nighttime", 0),
      (try_for_range, ":walker_no", 0, num_castle_walkers),
        (store_add, ":troop_slot", slot_center_walker_0_troop, ":walker_no"),
        (party_get_slot, ":walker_troop_id", "$current_town", ":troop_slot"),
        (gt, ":walker_troop_id", 0),
        (store_add, ":entry_no", castle_walker_entries_start, ":walker_no"),
        (set_visitor, ":entry_no", ":walker_troop_id"),
      (try_end),  
    (try_end),  
  ]),

##wots_modifications 
added the related constant and other stuff but when I enter a scene I get these bunch of errors, without even using the related entry points
Code:
 SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 7981; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 10400; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 14173; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 23503; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 7823; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 2154; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 8121; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 11581; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. Entry points for scene 77 : 0 32 33 16 35 34 37 36 39 38 40 41 42 43 45 44 47 49 50 70 69 48 68 67 66 65 64 63 62 61 60 59 58 57 46 56 55 54 53 52 51 72 71 78 77 76 75 73 74 80 79 
Total entry points for scene 77 : 51 
 SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 7981; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 10400; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 14173; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 23503; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 7823; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 2154; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 8121; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 11581; LINE NO: 6: 
 At script: init_castle_walkers. At script: init_castle_walkers. At script: init_castle_walkers.
It keeps saying invalid troop id, but where?
Code:
castle_walkers_begin = "trp_castle_walker_1"
castle_walkers_end = "trp_castle_walker_dummy"

c_walkers_begin = castle_walkers_begin
c_walkers_end   = castle_walkers_end
Code:
#wots_modifications
["castle_walker_1","Servant","Servants",tf_guarantee_boots|tf_guarantee_armor,0,0,fac.commoners,[itm.short_tunic,itm.linen_tunic,itm.fur_coat,itm.coarse_tunic,itm.tabard,itm.leather_vest,itm.arena_tunic_white,itm.leather_apron,itm.shirt,itm.arena_tunic_green,itm.arena_tunic_blue,itm.woolen_hose,itm.nomad_boots,itm.blue_hose,itm.hide_boots,itm.ankle_boots,itm.leather_boots,itm.fur_hat,itm.leather_cap,itm.straw_hat,itm.felt_hat],def_attrib|level(4),wp(60),knows_common,man_face_young_1,man_face_old_2],
["castle_walker_2","Maid","Maids",tf_female|tf_guarantee_boots|tf_guarantee_armor,0,0,fac.commoners,[itm.blue_dress,itm.dress,itm.woolen_dress,itm.peasant_dress,itm.woolen_hose,itm.blue_hose,itm.wimple_a,itm.wimple_with_veil,itm.female_hood],def_attrib|level(2),wp(40),knows_common,woman_face_1,woman_face_2],
["castle_walker_dummy","Dummy","Dummies",tf_female|tf_guarantee_boots|tf_guarantee_armor,0,0,fac.commoners,[itm.blue_dress,itm.dress,itm.woolen_dress,itm.peasant_dress,itm.woolen_hose,itm.blue_hose,itm.wimple_a,itm.wimple_with_veil,itm.female_hood],def_attrib|level(2),wp(40),knows_common,woman_face_1,woman_face_2],
#wots_modifications
Where is the problem here?
 
Cozur said:
Haven't been able to find it anywhere in the code.

When you say using a global, wouldn't that be overwritten, given that there must be a piece of code resetting the health of the player after every match?

Ruthven said:
Mission template type is "step 1" in determining if health/inventory carries over after the scene finishes. So if health isn't being restored manually, it's probably being done when finishing the mission. Ultimately, if you are manually setting it, it doesn't matter either way.

RE: "Wouldn't that be overwritten" - apply your HP changes after it gets overwritten and there's nothing to worry about.  :mrgreen:

yeap. I dont know how your code works (if it is like Native or not), but that doesnt matter if you go the manual route, as what you are doing is saving (storing) the HP and re-applying it later (on the next fight) yourself. Of course if you can figure out the why (game using different agent ID, or it has a code somewhere, etc) you can act in the source of the issue instead.

1) find the source, change it
2) dont find the source, hack it



imado552 said:
Where is the problem here?
Code:
 At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 10400; LINE NO: 6:
your code is getting invalid values for the troop ID, unless you have 10400+ troops on your module (check the error message for the info)
 
kalarhan said:
imado552 said:
Where is the problem here?
Code:
 At script: init_castle_walkers. SCRIPT ERROR ON OPCODE 1263: Invalid Troop ID: 10400; LINE NO: 6:
your code is getting invalid values for the troop ID, unless you have 10400+ troops on your module (check the error message for the info)
This invalid id is confusing me since my troop's id doesn't even reach 1300+ with all of the multi troops. So I'm confused why the troop Id is invalid
And my troop was added just after walker_end troop
 
Status
Not open for further replies.
Back
Top Bottom