Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
@ Herder:

      (1, 0, 0, [],
      [
        (set_fixed_point_multiplier, 100),
        (try_for_agents, ":agent"),
        (agent_is_alive, ":agent"),
        (agent_is_human, ":agent"),
        [only certain troops]
        (agent_get_position, pos1, ":agent"),
        (position_get_x, 100, ":pos_x"),
        (position_get_y, 100, ":pos_y"),
        (agent_get_slot, ":px", ":agent", slot_agent_last_pos_x),
        (agent_get_slot, ":py", ":agent", slot_agent_last_pos_y),
          (try_begin),
          (this_or_next|neq, ":pos_x", ":px"),
          (neq, ":pos_y", ":py"),
          [use agent_set_animation and agent_play_sound here]
          (try_end),
        (agent_set_slot, ":agent", slot_agent_last_pos_x, ":pos_x"),
        (agent_set_slot, ":agent", slot_agent_last_pos_y, ":pos_y"),
        (try_end),
        ]),
 
@ Dusk Voyager, thanks man!


**EDIT**

This is going some what wrong, I've made some adjustments to the script and added it in to the mission templates, sadly I seem to get a list error.

      (1, 0, 0, [],
      [
        (set_fixed_point_multiplier, 100),
        (try_for_agents, ":agent"),
        (agent_is_alive, ":agent"),
        (agent_is_human, ":agent"),
        ["trp_swadian_drummer"]
        (agent_get_position, pos1, ":agent"),
        (position_get_x, 100, ":pos_x"),
        (position_get_y, 100, ":pos_y"),
        (agent_get_slot, ":px", ":agent", slot_agent_last_pos_x),
        (agent_get_slot, ":py", ":agent", slot_agent_last_pos_y),
          (try_begin),
          (this_or_next|neq, ":pos_x", ":px"),
          (neq, ":pos_y", ":py"),
          [agent_play_sound, "snd_drums_swad",pos1,1]
          (try_end),
        (agent_set_slot, ":agent", slot_agent_last_pos_x, ":pos_x"),
        (agent_set_slot, ":agent", slot_agent_last_pos_y, ":pos_y"),
        (try_end),
        ]),

Is there any thing I'm missing?
 
Seek n Destroy said:
According to the expanded header operations from Lav two handed weapons return the left hand and so do the ranged ones (bow and crossbow)
agent_get_wielded_item                  = 1726  # (agent_get_wielded_item, <destination>, <agent_id>, <hand_no>),
                                                # Retrieves the item reference that the agent is currently wielding in his right hand (hand_no = 0) or left hand (hand_no = 1). Warband assumes that weapons are wielded in right hand, and shields in left hand. Returns -1 when nothing is wielded, and also for left hand when wielding a two-handed or ranged weapon.
First, you shouldn't take anything for granted - I make mistakes too.

Second, I'm pretty sure what I meant in that line is that Warband returns -1 when nothing is wielded and also returns -1 for left hand when you're wielding a two-handed weapon or bow/xbow.
 
Frenzied_Crocoduck_Herder said:
      (1, 0, 0, [],
      [
        (set_fixed_point_multiplier, 100),
        (try_for_agents, ":agent"),
        (agent_is_alive, ":agent"),
        (agent_is_human, ":agent"),
        (agent_get_troop_id, ":troop", ":agent"),
        (eq, ":troop", "trp_swadian_drummer"),

        (agent_get_position, pos1, ":agent"),
        (position_get_x, 100, ":pos_x"),
        (position_get_y, 100, ":pos_y"),
        (agent_get_slot, ":px", ":agent", slot_agent_last_pos_x),
        (agent_get_slot, ":py", ":agent", slot_agent_last_pos_y),
          (try_begin),
          (this_or_next|neq, ":pos_x", ":px"),
          (neq, ":pos_y", ":py"),
          (agent_play_sound, ":agent", "snd_drums_swad"),
          (try_end),
        (agent_set_slot, ":agent", slot_agent_last_pos_x, ":pos_x"),
        (agent_set_slot, ":agent", slot_agent_last_pos_y, ":pos_y"),
        (try_end),
        ]),

Is there any thing I'm missing?
Put the bold text in and add the red agent slots to module_constants.
 
@ Dusk Voyager, you have been very helpful! Though there's another error that needs to be ironed out:

p46wNfX.jpg
 
These two lines:
Code:
 (position_get_x, 100, ":pos_x"),
         (position_get_y, 100, ":pos_y"),

Code:
(position_get_x, ":pos_x", pos1),
         (position_get_y, ":pos_y", pos1),
Also what module system are you using? Because the normal one doesn't throw exceptions when you use unassigned variables or have errors in your statements.
 
Lav said:
Seek n Destroy said:
According to the expanded header operations from Lav two handed weapons return the left hand and so do the ranged ones (bow and crossbow)
agent_get_wielded_item                  = 1726  # (agent_get_wielded_item, <destination>, <agent_id>, <hand_no>),
                                                # Retrieves the item reference that the agent is currently wielding in his right hand (hand_no = 0) or left hand (hand_no = 1). Warband assumes that weapons are wielded in right hand, and shields in left hand. Returns -1 when nothing is wielded, and also for left hand when wielding a two-handed or ranged weapon.
First, you shouldn't take anything for granted - I make mistakes too.

Second, I'm pretty sure what I meant in that line is that Warband returns -1 when nothing is wielded and also returns -1 for left hand when you're wielding a two-handed weapon or bow/xbow.
Sorry, my bad. Everybody makes mistakes but so far it has been a huge help. Anyway this is certainly not the part that is failing seeing that I commented it out when tracking down the error.
 
The_dragon said:
These two lines:
Code:
 (position_get_x, 100, ":pos_x"),
         (position_get_y, 100, ":pos_y"),

Code:
(position_get_x, ":pos_x", pos1),
         (position_get_y, ":pos_y", pos1),
Also what module system are you using? Because the normal one doesn't throw exceptions when you use unassigned variables or have errors in your statements.
Sorry, I forgot the pos1. Embarrassing for someone supposed to be an "experienced coder".
 
@ The_Dragon, thank you, I'm in both you and Dusk Voyager's debt. I'm not sure which version of the module system I'm using, but it is fairly outdated. I chose it because it had a certain version of PBOD and Diplomacy that I wanted.
 
what operation checks the faction is active ? because i wanna to make fly the "have your missions for me ?" menu if the player's faction is active.I dont want ask a question when i was a king.

Thanks for advance.
 
HyperCharge said:
what operation checks the faction is active ? because i wanna to make fly the "have your missions for me ?" menu if the player's faction is active.I dont want ask a question when i was a king.

Thanks for advance.
Code:
(faction_slot_eq, ":faction", slot_faction_state, sfs_active),
Possible values for this slot are defined in module_constants.py.
 
okay,then what should i do for fly this dialog if im a king ?

Code:
[anyone|plyr,"lord_talk", [#(troop_slot_eq, "$g_talk_troop", slot_troop_is_prisoner, 0),
                             (neg|troop_slot_ge, "$g_talk_troop", slot_troop_prisoner_of_party, 0),
                             (ge, "$g_talk_troop_faction_relation", 0),
                             (store_partner_quest,":lords_quest"),
                             (lt,":lords_quest",0),
							 (neg|faction_slot_eq, "$g_talk_troop_faction", slot_faction_leader, "trp_player"),
							 (neg|troop_slot_eq, "trp_player", slot_troop_spouse, "$g_talk_troop"),
							 #                             (eq,"$g_talk_troop_faction","$players_kingdom")
                             ],
   "Do you have any tasks for me?", "lord_request_mission_ask",[]],

Should i add my (call_script,"script_id"), ?
 
HyperCharge said:
okay,then what should i do for fly this dialog if im a king ?

Should i add my (call_script,"script_id"), ?
Erm... sorry, I don't understand what you want to do with this menu. Do you want to remove it or auto-proceed it?
 
Frenzied_Crocoduck_Herder said:
@ Dusk Voyager, shouldn't have thanked you so soon, I don't get any errors, sadly nothing plays when the troops move.

Are you sure that there is at least 1 agent with troop id "trp_swadian_drummer"? Are you sure that the trigger is in the mission template that you are running?
 
Then try and put debug messages. Put this at the top of the trigger, to make sure that it is running (display_message, "@Trigger fired!")
Then put this right after agent_play_sound (display_message, "@Agent should play a sound!")


Quick question: does anyone have warband exe 1.153? And can he/she share it with me? (I am too lazy to download and install the 1.153 version (why spending 600 mb if someone could share it, right?)) (I want to do a dll c++ modding thing for warband using WSE source code files xD)
 
Status
Not open for further replies.
Back
Top Bottom