Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
builder of the gods said:
Module system compiles fine
Game loads fine
Then error on opcode line 3 and 4 something with get instance no

there is a world of difference between compilation and runtime  :mrgreen:, and another between what you thought you did and what is really going on  :twisted:

Remember to not double post, you can edit your last comment (as you were the last to post here). Also your image is not visible

 
I thought this would be a simple answer but no one is answering it:

My question: I would like to force the EQUIPPING of melee weapons for my archers and slingers (for close combat). Currently about 50% spawn without melee weapons. Slingers and bandits are the main culprits. They use fists in close combat. It seems the punchers don't have a sidearm.
I also have a problem where my skirmishers don't equip with their sidearms. They show up with shield and 3 sets over javelins.
Code:
tf_guarantee_boots            = 0x00100000
tf_guarantee_armor            = 0x00200000
tf_guarantee_helmet           = 0x00400000
tf_guarantee_gloves           = 0x00800000
tf_guarantee_horse            = 0x01000000
tf_guarantee_shield           = 0x02000000
tf_guarantee_ranged           = 0x04000000
tf_unmoveable_in_party_window = 0x10000000 (What does this do?)
In header_troops:
I've seen tf_guarantee_ranged. I've tf_guarantee_polearm in Viking Conquest. How can I do tf_guarantee_ some kind of one-handed melee weapon?
Polearms seem like overkill for low level troops.
 
gdwitt said:
I thought this would be a simple answer but no one is answering it:

My question: I would like to force the EQUIPPING of melee weapons for my archers and slingers (for close combat). Currently about 50% spawn without melee weapons. Slingers and bandits are the main culprits. They use fists in close combat. It seems the punchers don't have a sidearm.
I also have a problem where my skirmishers don't equip with their sidearms. They show up with shield and 3 sets over javelins.
Code:
tf_guarantee_boots            = 0x00100000
tf_guarantee_armor            = 0x00200000
tf_guarantee_helmet           = 0x00400000
tf_guarantee_gloves           = 0x00800000
tf_guarantee_horse            = 0x01000000
tf_guarantee_shield           = 0x02000000
tf_guarantee_ranged           = 0x04000000
tf_unmoveable_in_party_window = 0x10000000 (What does this do?)
In header_troops:
I've seen tf_guarantee_ranged. I've tf_guarantee_polearm in Viking Conquest. How can I do tf_guarantee_ some kind of one-handed melee weapon?
Polearms seem like overkill for low level troops.

Try giving them multiple bows/crossbows or whatever ranged weapon you are using, in other words force upon them enough weapons so they can't go in punch mode.
 
gdwitt said:

Melee weapons are guaranteed by default. Either there's some non-obvious script re-equipping weapons before the mission starts, or the weapons have the wrong flags.

troycall said:
Try giving them multiple bows/crossbows or whatever ranged weapon you are using, in other words force upon them enough weapons so they can't go in punch mode.

That won't work. First of all, unless the bows and crossbows have melee modes, the AI will still switch to punching when it gets close to the enemy because it has no melee weapons. Second of all, troops with duplicate weapons are likely to spawn with just one of them most of the time, so this is a poor workaround.
 
some non-obvious script re-equipping weapons before the mission starts,
This could be. It is Brytenwalda.

Equipping works fairly well for most troops now with OVERLOADING the melee weapons like this:
["bandit","Bagauda","Bagaudas",tf_guaranteeexhorhelm|tf_guarantee_ranged,0,0,'fac_outlaws',
['itm_spikedclub','itm_axe2','itm_lang_knifet2','itm_spear_hasta','itm_javelins','itm_leather_shoes','itm_axe1','itm_axe2','itm_axe2_crude','itm_spear1','itm_axe2','itm_club_thorny','itm_shoes2bare','itm_hoodnewblu','itm_hoodnewblk','itm_blackhood','itm_ptunic3','itm_ptunicwhite','itm_ptunic2','itm_ptunic1','itm_shirtblue','itm_briton_tunic2','itm_knifechp','itm_clubcudgel'],def_attrib2|level(19),wp(140),knows_warrior_basic,bandit_face1,bandit_face2],

Throwing stones are the biggest problem as they seem to confuse the AI into thinking they are melee. But this troop set up is very hard to maintain. I was hoping to renovate module_troops.
The above setup doesn't work very well with bandits-type troops with no shield. Right now about 15% of low-level skirms troops punch even with overloading.

Are you implying I can add melee modes to all my ranged weapons?
Better would be a tf-guarantee statement.
 
Does anyone know how to change relations of factions at game_start script?

For example I want to make some facitons hate some other factions permanetly, so that they are go in war with them more often.
Sorry for double post, was a missclick.
 
troycall said:
Does anyone know how to change relations of factions at game_start script?

Get Lav's module so you can read header_operations. See 5th operation below.
Code:
################################################################################
# [ Z08 ] FACTIONS
################################################################################

  # Despite the importance of factions to the game, there aren't that many
  # actions to deal with them. Essentially, you can control colors and name of
  # existing game factions, set or retrieve relations between them, and work
  # with faction slots. There's also a number of operations which assign or
  # retrieve the factional allegiance of other game objects, like parties and
  # troops, but these have been placed in the respective sections of the file.

# Slot operations for factions

faction_set_slot                =  502  # (faction_set_slot, <faction_id>, <slot_no>, <value>),
faction_get_slot                =  522  # (faction_get_slot, <destination>, <faction_id>, <slot_no>),
faction_slot_eq                 =  542  # (faction_slot_eq, <faction_id>, <slot_no>, <value>),
faction_slot_ge                 =  562  # (faction_slot_ge, <faction_id>, <slot_no>, <value>),

# Generic operations

set_relation                    = 1270  # (set_relation, <faction_id_1>, <faction_id_2>, <value>),
                                        # Sets relation between two factions. Relation is in -100..100 range.
store_relation                  = 2190  # (store_relation, <destination>, <faction_id_1>, <faction_id_2>),
                                        # Retrieves relation between two factions. Relation is in -100..100 range.
faction_set_name                = 1275  # (faction_set_name, <faction_id>, <string>),
                                        # Sets the name of the faction. See also (str_store_faction_name) in String Operations.
faction_set_color               = 1276  # (faction_set_color, <faction_id>, <color_code>),
                                        # Sets the faction color. All parties and centers belonging to this faction will be displayed with this color on global map.
faction_get_color               = 1277  # (faction_get_color, <destination>, <faction_id>)
                                        # Gets the faction color value.

There is no "permanent" relation, as events will change the relation over time. So you will have to check your diplomacy scripts/triggers/dialogs.

And remember you can set relations on module_factions.py if you don't want a random world. No need for the operation in that case (at game start)
 
Hey,

I followed the tutorial to add heraldic items and everything seems alright but once in game the textures of the shields don't show up. Do you know where it comes from?

7aOKV.jpg

JoFjt.png


Bs91c.png


zfSvf.png

Code:
  ("tableau_mesh_mic_shield", 0, "tableau_mesh_mic_shield",  0, 0, 0, 0, 0, 0, 10, 10, 10),

Code:
  ("mic_shield", 0, "sample_mic_shield", 1024, 1024, 0, 0, 0, 0,
   [
       (store_script_param, ":banner_mesh", 1),

       (set_fixed_point_multiplier, 100),

       (init_position, pos1),
       (position_set_x, pos1, -50),
       (position_set_y, pos1, 150),
       (cur_tableau_add_mesh, ":banner_mesh", pos1, 116, 0),
       (init_position, pos1),
       (position_set_z, pos1, 10),
       (cur_tableau_add_mesh, "mesh_tableau_mesh_mic_shield", pos1, 0, 0),
       (cur_tableau_set_camera_parameters, 0, 200, 200, 0, 100000),
       ]),

Code:
["mic_shield", "Knightly Heater Shield",   [("tableau_mic_shield" ,0)], itp_merchandise|itp_type_shield|itp_wooden_parry, itcf_carry_kite_shield,  
390 , weight(2.5)|hit_points(220)|body_armor(23)|spd_rtng(100)|shield_width(30)|shield_height(50),imodbits_shield,
 [(ti_on_init_item, [(store_trigger_param_1, ":agent_no"),(store_trigger_param_2, ":troop_no"),(call_script, "script_shield_item_set_banner", "tableau_mic_shield", ":agent_no", ":troop_no")])]],

All the files are in my brf. I added the load_mod_resource line to module.ini and I correctly imported the textures to the brf. The problem seems to come from the texture but I don't see what I missed. Someone has an idea?
 
kalarhan said:
builder of the gods said:
Module system compiles fine
Game loads fine
Then error on opcode line 3 and 4 something with get instance no

there is a world of difference between compilation and runtime  :mrgreen:, and another between what you thought you did and what is really going on  :twisted:

Remember to not double post, you can edit your last comment (as you were the last to post here). Also your image is not visible
Sorry i will do next time when possible
Strange the image doesnt works it does at my device
Code:
    ("damage_prop",0,"brazier","bo_brazier",    
       [
       (ti_on_scene_prop_stepped_on, # when stepped_on_scene_prop
        [
		  (get_player_agent_no, ":player_agent"), # store player in :player_agent POSSIBLE
          (agent_get_team,":player_team", ":player_agent"), # store player team ,
		  (scene_prop_get_num_instances, ":max", "spr_damage_prop"), # store num of damage_props 
	      (scene_prop_set_team, "spr_damage_prop", 0), # set team to defending
		  (scene_prop_get_team, "$g_defender_team", "spr_damage_prop"), # get team (get defending)
		  (try_for_range, ":prop", 0, ":max"), #try for range 0 to amount of scene props (try for all and store in :prop)
	        (scene_prop_get_instance, ":instance", "spr_damage_prop", ":prop"), # get all
	            (prop_instance_get_position, pos1, ":instance"), # get all positions
            (try_for_agents,":agent"), # search all agents   
	            (agent_is_alive,":agent"), # exclude dead agents
	            (agent_get_team, "$g_agent_on_prop_team", ":agent"), # get team of agent
	            (neq,"$g_agent_on_prop_team", 0), # agent is no defending siege team
                (agent_get_position, pos2, ":agent"), # get agent position
		        (get_distance_between_positions,":dist",pos1,pos2), # get distance between prop and agent
		        (lt,":dist",10),	#SW - how close they have to be to refill ammo
		        (agent_deliver_damage_to_agent, ":agent", ":agent", 15),
		        (eq, ":agent",":player_agent"),
		        (assign, ":player_agent_prop_hit", 1),
            (try_end),
        (try_end),
	    (try_begin),
		    (eq, ":player_agent_prop_hit", 1),
			(display_message, "@You stepped on a pike!"),
		(try_end),
        ]),
      ]),
     


IMP synyax is not perfect becausr of a phone copy its not the problem
 
kalarhan said:
troycall said:
Does anyone know how to change relations of factions at game_start script?

Get Lav's module so you can read header_operations. See 5th operation below.
Code:
################################################################################
# [ Z08 ] FACTIONS
################################################################################

  # Despite the importance of factions to the game, there aren't that many
  # actions to deal with them. Essentially, you can control colors and name of
  # existing game factions, set or retrieve relations between them, and work
  # with faction slots. There's also a number of operations which assign or
  # retrieve the factional allegiance of other game objects, like parties and
  # troops, but these have been placed in the respective sections of the file.

# Slot operations for factions

faction_set_slot                =  502  # (faction_set_slot, <faction_id>, <slot_no>, <value>),
faction_get_slot                =  522  # (faction_get_slot, <destination>, <faction_id>, <slot_no>),
faction_slot_eq                 =  542  # (faction_slot_eq, <faction_id>, <slot_no>, <value>),
faction_slot_ge                 =  562  # (faction_slot_ge, <faction_id>, <slot_no>, <value>),

# Generic operations

set_relation                    = 1270  # (set_relation, <faction_id_1>, <faction_id_2>, <value>),
                                        # Sets relation between two factions. Relation is in -100..100 range.
store_relation                  = 2190  # (store_relation, <destination>, <faction_id_1>, <faction_id_2>),
                                        # Retrieves relation between two factions. Relation is in -100..100 range.
faction_set_name                = 1275  # (faction_set_name, <faction_id>, <string>),
                                        # Sets the name of the faction. See also (str_store_faction_name) in String Operations.
faction_set_color               = 1276  # (faction_set_color, <faction_id>, <color_code>),
                                        # Sets the faction color. All parties and centers belonging to this faction will be displayed with this color on global map.
faction_get_color               = 1277  # (faction_get_color, <destination>, <faction_id>)
                                        # Gets the faction color value.

There is no "permanent" relation, as events will change the relation over time. So you will have to check your diplomacy scripts/triggers/dialogs.

And remember you can set relations on module_factions.py if you don't want a random world. No need for the operation in that case (at game start)

Thanks, also another question - how do I make the start_game_0 and start_game_1 (start_character_1 too) menus longer? (module_game_menus)
I have 42 entries (options) in them, and they only show around 16 the rest are out of the screen *can't scroll down to them or see them*.

in module_presentations I usually solved that issue by setting a height value to the presentation, however game menus isn't the same I think, any ideas on solving this would be appeciated.
 
Is there any way (such as an operation) to clear the gore and stuck missiles which accumulate on an agent? There is something like this for scene prop instances (prop_instance_clear_attached_missiles), but I've found nothing for an agent. The only thing I can think of at the moment is to respawn the agent.

Another question is whether the gore and stuck missile buildup ever naturally decreases with the mere passage of time.
 
troycall said:
menus longer? (module_game_menus)

in module_presentations I usually solved that ..

Somebody said:
Make more menus, and have the first two menu options navigate between them.

Menus are hardcoded presentations. If you want freedom to do whatever, you can do it manually with a presentation. If your case is simple (it usually is), menus work well and are quick to create.

Presentation = freedom = lots of work and time to create
Menu = hardcoded = quick and good for simple stuff



Code:
start_game_0 and start_game_1
Remember that the first menus are hardcoded on the engine. Keep them where they are and add your new menus below those (around 7 or 8th menu), don't mess with the order of the first few (character creation, camp, reports)
 
troycall said:
How to make the module system wait before executing a command, in module_scripts is it possible or do I have to make a trigger in simple_triggers/triggers?

module system can't wait, as it does nothing besides writing code for the API :mrgreen:. If you mean the game engine, then you will need to be more specific on what event are you trying to create.

Worldmap, scene, etc. When and why.
 
Question/Advice Needed:

If I wanted to have lords of a certain faction have larger party sizes, yet not have this faction dominate in AI battles (auto-calc), where do I look?

Is script_party_calculate_strength a good place to start? or is there something better I can do?
 
That might be really hard to balance. The current autocalculation hinges around a hardcoded operation (inflict_casualties_to_party, i believe) that really strongly favours numbers over quality, so you'd either need to overwrite it with your own script or apply a conditional percentage to it. I don't know how cooperative this would be and it may be quite tedious to test.
 
Status
Not open for further replies.
Back
Top Bottom