Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
ScreamingCommie said:
He sure is but he missed a spot
ScreamingCommie said:
Is there any way to get more detailed crash logs than just the rgl_log?
Technically I skipped it, not missed. :smile: And as far as I know, there isn't, but I'm not completely certain, so your best bet is to wait for someone else to respond.
 
Hi, long time no post on this forum  :smile:

This module_dialogs.py code is giving me "Invalid Agent ID At dialog condition" errors :

Code:
  [anyone|plyr, "spouse_talk", 
   [
     (troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
     (neg|agent_has_item_equipped, ":spouse", "itm_gown"),
     ],
   "We should spend some time alone *wink wink nudge nudge*", "close_window",[
   (troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
   (assign, ":meeting_scene", "scn_wedding2"),
   (modify_visitors_at_site,":meeting_scene"),
   (reset_visitors),
   (set_visitor,1,"trp_player"),
   (set_visitor,0,":spouse"),
   (set_jump_mission,"mt_conversation_encounterb"),
   (jump_to_scene,":meeting_scene"),
]],

  [anyone|plyr, "spouse_talk", 
   [
     (troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
     (agent_has_item_equipped, ":spouse", "itm_gown"),
     ],
   "I love you", "spouse_talk2",[
   (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 1),
   (assign, "$g_leave_encounter", 1),
]],

  [anyone, "spouse_talk2",
   [
   ],
   "I love you too, {playername}", "close_window",[
   (assign, "$g_leave_encounter", 1),
]],


The references for "scn_wedding2" and "mt_conversation_encounterb" are ok and working.

Can't see what I'm doing wrong in conditions block. Can anyone help me, please?  :smile:
 
Sir Lacy said:
Hi, long time no post on this forum  :smile:

This module_dialogs.py code is giving me "Invalid Agent ID At dialog condition" errors :
Code:
  [anyone|plyr, "spouse_talk", 
   [
     (troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
     (neg|agent_has_item_equipped, ":spouse", "itm_gown"),
     ],
   "We should spend some time alone *wink wink nudge nudge*", "close_window",[
   (troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
   (assign, ":meeting_scene", "scn_wedding2"),
   (modify_visitors_at_site,":meeting_scene"),
   (reset_visitors),
   (set_visitor,1,"trp_player"),
   (set_visitor,0,":spouse"),
   (set_jump_mission,"mt_conversation_encounterb"),
   (jump_to_scene,":meeting_scene"),
]],

  [anyone|plyr, "spouse_talk", 
   [
     (troop_get_slot, ":spouse", "trp_player", slot_troop_spouse),
     (agent_has_item_equipped, ":spouse", "itm_gown"),
     ],
   "I love you", "spouse_talk2",[
   (call_script, "script_troop_change_relation_with_troop", "trp_player", "$g_talk_troop", 1),
   (assign, "$g_leave_encounter", 1),
]],

  [anyone, "spouse_talk2",
   [
   ],
   "I love you too, {playername}", "close_window",[
   (assign, "$g_leave_encounter", 1),
]],
The references for "scn_wedding2" and "mt_conversation_encounterb" are ok and working.

Can't see what I'm doing wrong in conditions block. Can anyone help me, please?  :smile:
Operation (troop_get_slot, ":spouse", "trp_player", slot_troop_spouse), retrieves spouse troop, not agent.

Also, the dialogs looks like they are supposed to happen on global map, not in a mission. And any agent_ operations can only be successfully used during missions, where agents actually exist.
 
Ok mistery solved, thank you :smile:

I don't think I understand the difference between troop and agent, but i'm not using this in global map, but on mission mt_conversation_encounterb (modified).

Is there any operation to check for armor on a troop?
 
Sir Lacy said:
Ok mistery solved, thank you :smile:

I don't think I understand the difference between troop and agent, but i'm not using this in global map, but on mission mt_conversation_encounterb (modified).

Is there any operation to check for armor on a troop?
troop_get_inventory_slot

However if your dialog actually occurs in an already ongoing conversation, then you are in a mission. Just use store_conversation_agent and pass the resulting value to agent_has_item_equipped. You might also wish to call store_conversation_troop and compare the resulting value with the one you retrieved from player's spouse slot to make sure you are actually talking to your spouse, otherwise King Harlaus who donned a gown will also match the dialog conditions. :smile:
 
Sir Lacy said:
I don't think I understand the difference between troop and agent...
Just in case you really aren't, it's quite simple: much like the party_templates which are used to spawn similar parties, troops (or, should I say, troop definitions) are templates used to spawn agents. When a party of fifty Vaegir Knights enters a battle, fifty agents of one troop will spawn. Agents exist only in scenes and are all considered different, whilst troops are universal for every agent of the given troop.
Fox an example, if you're making some über RPG combat skills, and try and create something like a "Battlecry" which gives +30 STR to all troops within a 5-metre radius of you, this will be a major fault as it will increase the STR stat of all agents that are of the same troop (as each agent inherits its stats from its troop ID, quite in the same way as a party of looters consists of the amount of looters defined in the party template). If you do want to create such a "battlecry" effect, you should boost up individual agents and not mess with troop IDs; that's prone to errors.

TL;DR: Agents are the actual moving guys, gals and horses you see in scenes (i.e. in battle or in settlements or whatever). "Troops", as defined in the troops file, are simply the templates used to define an agent when spawning it.
NB: "Living" horses are agents as well, though their templates are the horse items, not troops. (In fact, "static" horses which are found in some places in Native are simply items added to the scene; were they spawned as agents, they would be real horses and not statues.)
 
Frenzied_Crocoduck_Herder said:
Is it possible to force two factions into an alliance and stop small factions from attacking larger ones?

1. you can make a simple_trigger in simple_triggers.py that gives two factions 100 relations every day. for example:

Code:
(24,
         [
               (set_relation, "fac_kingdom_1", "fac_kingdom_2", 100),
         ]
),

2. This might be a bit harder. the code for declaring war is all over the place and there may be multiple reasons for attack.
it might be easier to create a trigger that tries for settlements, then records how many settlements are owned by each faction via a slot, and then puts them on good terms with other factions if they're too small.



Code:
      ("pre_join_help_attackers",[
#          (store_faction_of_party, ":attacker_faction", "$g_encountered_party_2"),
#          (store_relation, ":attacker_relation", ":attacker_faction", "fac_player_supporters_faction"),
#          (store_faction_of_party, ":defender_faction", "$g_encountered_party"),
#          (store_relation, ":defender_relation", ":defender_faction", "fac_player_supporters_faction"),
#          (ge, ":attacker_relation", 0),
#          (lt, ":defender_relation", 0),
          ],
          "Move in to help {s2}.",[
        (try_begin),
         (eq,"$players_kingdom","$g_encountered_party_faction"),
		 (assign, "$player_has_homage", 0),
         (call_script, "script_player_leave_faction", 0),
         (assign, "$g_recalculate_ais", 1),
        (try_end),
          (store_faction_of_party, ":attacker_faction", "$g_encountered_party_2"),
          (store_relation, ":attacker_relation", ":attacker_faction", "fac_player_supporters_faction"),
          (store_faction_of_party, ":defender_faction", "$g_encountered_party"),
          (store_relation, ":defender_relation", ":defender_faction", "fac_player_supporters_faction"),

         (val_add, ":attacker_relation", 2),
         (val_add, ":defender_relation", -2),
         (call_script, "script_set_player_relation_with_faction",":defender_faction", ":defender_relation"),
         (call_script, "script_set_player_relation_with_faction",":attacker_faction", ":attacker_relation"),
              (select_enemy,0),
              (assign,"$g_enemy_party","$g_encountered_party"),
              (assign,"$g_ally_party","$g_encountered_party_2"),
              (jump_to_menu,"mnu_join_battle")]),
      ("pre_join_help_defenders",[
#          (store_faction_of_party, ":attacker_faction", "$g_encountered_party_2"),
#          (store_relation, ":attacker_relation", ":attacker_faction", "fac_player_supporters_faction"),
#          (store_faction_of_party, ":defender_faction", "$g_encountered_party"),
#          (store_relation, ":defender_relation", ":defender_faction", "fac_player_supporters_faction"),
#          (ge, ":defender_relation", 0), 
#          (lt, ":attacker_relation", 0), 
          ],
          "Rush to the aid of {s1}.",[
        (try_begin),
      (eq,"$players_kingdom","$g_encountered_party_faction"),
(assign, "$player_has_homage", 0),
         (call_script, "script_player_leave_faction", 0),
         (assign, "$g_recalculate_ais", 1),
        (try_end),

          (store_faction_of_party, ":attacker_faction", "$g_encountered_party_2"),
          (store_relation, ":attacker_relation", ":attacker_faction", "fac_player_supporters_faction"),
          (store_faction_of_party, ":defender_faction", "$g_encountered_party"),
          (store_relation, ":defender_relation", ":defender_faction", "fac_player_supporters_faction"),

         (val_add, ":attacker_relation", -2),
         (val_add, ":defender_relation", 2),
         (call_script, "script_set_player_relation_with_faction",":defender_faction", ":defender_relation"),
         (call_script, "script_set_player_relation_with_faction",":attacker_faction", ":attacker_relation"),
              (select_enemy,1),
              (assign,"$g_enemy_party","$g_encountered_party_2"),
              (assign,"$g_ally_party","$g_encountered_party"),
              (jump_to_menu,"mnu_join_battle")]),
      ("pre_join_leave",[],"Don't get involved.",[(leave_encounter),(change_screen_return)]),
    ]
  ),

I'm using this code that allows you to attack whoever you want in a battle encounter. the problem is that it kicks you out of a faction if you help said faction in battle, which makes no sense. I'm stumped since the code seems to follow logic - I'm using diplomacy, is there anything in there that might be reversing the effects of some of these functions?
 
jacobhinds said:
I'm using this code that allows you to attack whoever you want in a battle encounter. the problem is that it kicks you out of a faction if you help said faction in battle, which makes no sense. I'm stumped since the code seems to follow logic - I'm using diplomacy, is there anything in there that might be reversing the effects of some of these functions?
Probably has to do with calls to (call_script, "script_player_leave_faction", 0), and the fact that you should be differentiating between the attacker/defender parties.
 
Jarvisimo said:
Long shot - is there any way to make race specific footstep sounds? I want big stomping sound effects for my ents and trolls. :smile:
As far as I recall, the engine does not support that intrinsically. You can, however, achieve this effect by replacing the default walking sounds with silence and then play the respective new sounds through custom triggers which would check for the agent's race and whatnot.
 
Yeah you only have these ones to play around with
Code:
voice_die        = 0
voice_hit        = 1
voice_grunt      = 2
voice_grunt_long = 3
voice_yell       = 4
voice_warcry     = 5
voice_victory    = 6
voice_stun       = 7
 
Somebody said:
Yeah you only have these ones to play around with
Code:
voice_die        = 0
voice_hit        = 1
voice_grunt      = 2
voice_grunt_long = 3
voice_yell       = 4
voice_warcry     = 5
voice_victory    = 6
voice_stun       = 7

I know of these and I have changed them all.

Lumos said:
Jarvisimo said:
Long shot - is there any way to make race specific footstep sounds? I want big stomping sound effects for my ents and trolls. :smile:
As far as I recall, the engine does not support that intrinsically. You can, however, achieve this effect by replacing the default walking sounds with silence and then play the respective new sounds through custom triggers which would check for the agent's race and whatnot.
I guessed that was the way. Thanks Lumos.
 
Hi.
I'm trying to learn modding (script side). My target (target i gave to myself  :smile: ) is to assign a status to a player who hit a scene prop. Example when i hit an anvil i enter in Berserker mode when i hit again i exit from this mode. I understood how make game listen action of hitting  looking to dummy_a_undestructable. But i can't understand how i can create a berserker mode ?
Suggestions ? Thanks.
 
Jarvisimo said:
What party behaviour will make my bandits attack a city/castle if they're strong enough?
By attacking I assume you mean besieging? Because I doubt you want your bandits to attack the castle like a regular party without all those defender bonusses for walls and stuff. Short answer is there's none. Besieging is handled by scripts and triggers, not party AI. You will have to investigate the lord code for sieges, apply it to bandits, and make sure that the game will properly recognize town siege by bandits (because right now only lords besiege, so I wouldn't be surprised if there are all kinds of dependencies on this assumption).

K.A. said:
Hi.
I'm trying to learn modding (script side). My target (target i gave to myself  :smile: ) is to assign a status to a player who hit a scene prop. Example when i hit an anvil i enter in Berserker mode when i hit again i exit from this mode. I understood how make game listen action of hitting  looking to dummy_a_undestructable. But i can't understand how i can create a berserker mode ?
Suggestions ? Thanks.
Well, there are all kinds of funny operations to imitate berserker mode, like agent_set_damage_modifier and stuff, if that's what you are asking about. If you are asking on how to apply them, well, if you want your Anvil of Berserkness to be mission-independent you'll have to handle everything within scene prop trigger - ti_on_scene_prop_hit does receive agent_id, so it can apply (or remove) anything to agent directly. You'll need an indicator for agent that the berserker mode is active, but that's what agent slots are for. If you want berserker mode to only work in specific mission types, then your scene prop trigger will only set some global flag to indicate that some agent has hit it, and write a separate mission template trigger which will only be present in mission types you want it in, which will check your global flag and apply/remove bonuses to the agent in question.
 
Status
Not open for further replies.
Back
Top Bottom