搜索结果: *

  1. Modding Q&A [For Quick Questions and Answers]

    Dusk Voyager 说:
    ChiefNinja2 说:
    Does anyone know how I could go about tying a sound to an animation? Like, when you swing your sword there's a whoosh noise, I was wondering if I was able to add that sort of thing to custom animations I'd created?
    You can use agent_play_sound in the mission trigger activating the animation.

    Hmm, what if I want to play the sound after a certain delay? Just using agent_play_sound plays the sound as soon as the trigger is activated...
  2. Modding Q&A [For Quick Questions and Answers]

    Does anyone know how I could go about tying a sound to an animation? Like, when you swing your sword there's a whoosh noise, I was wondering if I was able to add that sort of thing to custom animations I'd created?
  3. Modding Q&A [For Quick Questions and Answers]

    Well, I changed up the script I was using a bit. I now have:

    horse_fall_off = (

    ti_on_agent_hit, 0, 0,
          [
    (store_trigger_param_1,":victim_agent"),
    (store_trigger_param_3,":eek:rig_damage"),
    (store_random_in_range,":randnum",0,100),
         
    #Change/modify these to change your chances of beinh dehorsed, my percentage is twice the damage dealt.
    (val_sub,":randnum",":eek:rig_damage"),
    (val_sub,":randnum",":eek:rig_damage"), 
     
    (agent_get_troop_id,":victim_troop",":victim_agent"),
    (store_skill_level, ":riding_level", skl_riding, ":victim_troop"),
    #(val_add, ":riding_level", 1),
    #(val_clamp, ":riding_level", 1, 11),
    #(store_div, ":damage_mul", ":eek:rig_damage", ":riding_level"), ## Chance is now based partially on riding skill.

    (store_random_in_range,":chance",0,1), ### Decrease this number (20) for higher chances of knocking riders off (and vice-versa).
     
    (store_agent_hit_points,":hp",":victim_agent"),

    (try_begin),
     
    (agent_is_human,":victim_agent"),
    (neg|ge,":randnum",0),
    (ge,":hp",1),
    (agent_get_horse,":horse",":victim_agent"),
    (neg|eq,":horse",-1),
    (agent_get_item_id,":horsetype", ":horse"),
    (neg|eq,":horsetype",-1),
    (agent_get_position,pos1,":horse"),
    (agent_get_speed, pos2, ":horse"),
    (store_agent_hit_points,":horsehp",":horse"),
    (entry_point_get_position, pos3, 0),
    (agent_set_position,":horse",pos3),
    (remove_agent, ":horse"),
     
    (set_spawn_position, pos1),
    (spawn_horse,":horsetype",0),
    (agent_start_running_away, reg0),
    (agent_set_horse_speed_factor, reg0, 100), #I don't think this works but it isn't necessary.
    (agent_set_hit_points,reg0,":horsehp"),
     
    (try_end),
           
    ], [])

    The problem is that every time I uncomment

    (store_skill_level, ":riding_level", skl_riding, ":victim_troop"),

    agents are suddenly unable to do damage to one another, which I guess means this line is causing the script to fail somehow. Any ideas?
  4. Modding Q&A [For Quick Questions and Answers]

    I've found and implemented this script for agents to fall off horses:

    horse_fall_off = (

    ti_on_agent_hit, 0, 0, [],[
    #### Knocked off horses script, base by Gaunt, edited by Davee, edited a bit more by ChiefNinja.

    (store_trigger_param_1, ":victim_agent"),
    #(store_trigger_param_2, ":attacker"),
    (store_trigger_param_3, ":eek:rig_damage"),

    (display_message,"@Horse script called!"),

        #(ge, ":eek:rig_damage", 15), ### Minimum damage needed
        (store_agent_hit_points,":hp",":victim_agent"),
        (val_sub, ":hp", ":eek:rig_damage"),
        (ge, ":hp", 1), ### So it dosn't run when it's not needed (agent dies anyway)

        (agent_is_human,":victim_agent"),

    (store_skill_level, ":skl_level", skl_riding, ":victim_agent"),
    (val_add, ":skl_level", 1),
    (val_clamp, ":skl_level", 1, 11),
    (store_div, ":damage_mul", ":eek:rig_damage", ":skl_level"), ## Chance is now based partially on riding skill.

    (store_random_in_range,":chance",0,1), ### Decrease this number (20) for higher chances of knocking riders off (and vice-versa).
        (ge,":damage_mul", ":chance"), ### If damage_mul dealt is over or equal to the ":chance" number, knock-off occurs.

    (agent_get_horse,":horse",":victim_agent"),
    (neq,":horse",-1),
    (agent_get_item_id,":horsetype", ":horse"),
    (neq,":horsetype",-1),
    (agent_get_position,pos1,":horse"),
    #(agent_get_speed, pos2, ":horse"),
    (store_agent_hit_points,":horsehp",":horse"),
    (entry_point_get_position, pos3, 0),
    (agent_set_position,":horse",pos3),
    (remove_agent, ":horse"),

        (set_spawn_position, pos1),
        (spawn_horse,":horsetype",0),
        (agent_start_running_away, reg0),
        #(agent_set_horse_speed_factor, reg0, 100), #I don't think this works but it isn't necessary. <- Only changes max speed of the horse
        (agent_set_hit_points,reg0,":horsehp"),

    ])

    It works fine, I figured out how to get it to work. The problem is that, as far as I can tell, once an agent has fallen off his horse, he is unable to deal damage higher than 0 with attacks, or maybe he's unable to receive it. Anyway, once people start falling off horses, no one can be hurt, it seems.

    I'd guess this is because I'm using ti_on_agent_hit, but I'm unable to see how I'd resolve this...

    EDIT: Yeah it seems like using ti_on_agent_hit means that no one takes damage...
  5. Modding Q&A [For Quick Questions and Answers]

    The_dragon 说:
    @ChiefNinja2 Start a new game and it should solve the problem.

    @Melphiz I believe that you can't do such thing.

    Hmm, that doesn't seem to have worked. I'll mess about a bit more, but this really has me stumped.

    EDIT: Turns out I forgot a try_end in the script I was calling, I just never got an error when it compiled.
  6. Modding Q&A [For Quick Questions and Answers]

    Hi guys, I've come across something which seems a bit odd. I have this trigger in module_triggers.

    (1.0, 0, 0,[],
      [
    (call_script, "script_free_company_captain_replace"),
    (display_message,"@{!}DEBUG -- Replacing caps."),
                        ]),

    in this state, the script is not called and the message isn't displayed. When I comment out the call_script, the message displays, and when I comment out the display_message, nothing happens. This is really weird because just above it, I have set up this trigger:

    (0.5, 0, 0, [],
      [
        (call_script, "script_player_party_add_weariness"),
    (display_message,"@{!}DEBUG -- Update weariness."),
                        ]),

    Which works fine, even though it is basically the same. Whats going on?
  7. Modding Q&A [For Quick Questions and Answers]

    Hi guys, I'm looking for a way to detect if the player is resting in a town/castle/village. I've tried using (party_is_in_any_town,"p_main_party"), but this doesn't seem to work. Any ideas?
  8. Party-stopping script

    Cheers! The problem seems to have kinda fixed itself now... That context menu stuff is really handy!
  9. Party-stopping script

    Lav 说:
    ChiefNinja2 说:
    The problem is that the party doesn't change icon when it chases me- the game still seems to read the ai behavior as ai_bhvr_hold... even when it isn't. What's up with that?
    Because there's party behavior/object and party current behavior/object. First you can dictate directly, second is governed by current situation in party's immediate vicinity (enemies to chase after or run away from) and the only thing you can do is modify party's personality with party_set_aggressiveness, party_set_courage and party_set_ai_initiative.

    ChiefNinja2 说:
    Also, I'm wondering of the trigger I've set up is the best way to do things. Is looping through all the parties on the map so frequently likely to cause performance issues? Is there a simpler way of doing things?
    Try setting max courage, zero aggressiveness and zero initiative for the night. You'll need to restore them in the morning though and there's no way to retrieve their current values - this means you'll need to write down "correct" values for each party type from module_parties/module_party_templates and use them in your code directly.

    Ah, that's interesting. Ideally, I'd like parties to be able to chase each other/ the player during night time, so if I go too close to a bunch of camped looters at night, they'll chase/run away from me.

    I tried subbing "get_party_ai_current_behavior" into my parties_icon_handling script, but it doesn't seem to affect anything at the moment...
  10. Party-stopping script

    Okay, the saga continues  :grin:

    I'm now trying to change the party icon of all the parties stopping at night, I did this using the same method to storing their behaviour- I store the original map icon, change it to a tent at night and then restore the original.

    However, I soon realised that if parties move about at night (ie, chasing the player) they keep the tent icon, which obviously looks a bit wierd. So I created a new trigger which fires at night, and a new script:

    trigger:
      (0.1, 0, 0,
      [
      (is_currently_night)
      ],
      [
        (call_script, "script_parties_icon_handling"),
    (display_message,"@{!}DEBUG -- Icon handling."),
                        ]),
    and the script:
    ("parties_icon_handling",
    [

    (try_for_parties, ":party"), #Loops through all parties

    (party_get_slot, ":type", ":party", slot_party_type), # Check to make sure party isn't a town, castle etc.

    (store_faction_of_party, ":p_faction", ":party"),

    (neg|eq, ":type", spt_castle),
    (neg|eq, ":type", spt_town),
    (neg|eq, ":type", spt_village),
    (neg|eq, ":type", spt_cattle_herd),
    (neg|eq, ":type", spt_bandit_lair),
    (neg|eq, ":party", "p_main_party"),
    (neg|eq, ":p_faction", "fac_neutral"),

    (is_currently_night),

    (get_party_ai_behavior, ":bhvr", ":party"),
    (party_get_slot, ":prev_party_icon", ":party", slot_party_prev_icon),

    (try_begin),

    (eq, ":bhvr", ai_bhvr_hold),
    (party_set_icon, ":party", "icon_camp"),

    (else_try),

    (neg|eq, ":bhvr", ai_bhvr_hold),
    (party_set_icon, ":party", "icon_axeman"),

    (try_end),

    (try_end), #Go to next party

    ]),
    The problem is that the party doesn't change icon when it chases me- the game still seems to read the ai behavior as ai_bhvr_hold... even when it isn't. What's up with that?

    Also, I'm wondering of the trigger I've set up is the best way to do things. Is looping through all the parties on the map so frequently likely to cause performance issues? Is there a simpler way of doing things?
  11. Party-stopping script

    Awesome! It works!

    Just as a followup question, does anyone know if it's possible to edit the way npcs fight? In terms of blocking and attacking? I was wondering if it was possible to make them a little less... random.
  12. Party-stopping script

    Here you go  :grin:

    module_triggers:
      (1, 0, 12,
      [
      (is_currently_night)
      ],
      [
        (call_script, "script_parties_stop_at_night"),
    (display_message,"@{!}DEBUG -- Stop at night."),
                        ]),

      (1, 0, 12,
      [
      (neg|is_currently_night)
      ],
      [
        (call_script, "script_parties_start_morning"),
    (display_message,"@{!}DEBUG -- Start in the day."),
                        ]),

    module_scripts:
    # script_parties_stop_at_night

    ("parties_stop_at_night",
    [

    (try_for_parties, ":party"), #Loops through all parties

    (party_get_slot, ":type", ":party", slot_party_type), # Check to make sure party isn't a town, castle etc.

    (get_party_ai_behavior, ":bhvr", ":party"),

    (party_set_slot, ":bhvr", slot_party_prev_bhvr),

    (neg|eq, ":type", spt_castle),
    (neg|eq, ":type", spt_town),
    (neg|eq, ":type", spt_village),
    (neg|eq, ":type", spt_cattle_herd),
    (neg|eq, ":type", spt_bandit_lair),

    (try_begin),

    (neg|eq, ":bhvr", ai_bhvr_avoid_party),
    (neg|eq, ":bhvr", ai_bhvr_attack_party),

    (party_set_ai_behavior, ":party", ai_bhvr_hold),

    (try_end),

    (try_end), #Go to next party

    ]),

    # script_parties_start_morning

    ("parties_start_morning",
    [

    (try_for_parties, ":party"), #Loops through all parties

    (party_get_slot, ":type", ":party", slot_party_type), # Check to make sure party isn't a town, castle etc.

    (get_party_ai_behavior, ":bhvr", ":party"),
    (party_get_slot, ":prev_ai_bhvr", slot_party_prev_bhvr),

    (neg|eq, ":type", spt_castle),
    (neg|eq, ":type", spt_town),
    (neg|eq, ":type", spt_village),
    (neg|eq, ":type", spt_cattle_herd),
    (neg|eq, ":type", spt_bandit_lair),

    (try_begin),

    (eq, ":bhvr", ai_bhvr_hold),

    (party_set_ai_behavior, ":party", ":prev_ai_bhvr"),

    (try_end),

    (try_end), #Go to next party

    ]),

    They stop at night, just as they should, but stay still unless disturbed after that. slot_party_prev_bhvr is defined in module_constants.
  13. Party-stopping script

    Ah, yes that seems to work pretty well.

    Parties still don't seem to resume normal activities at the break of day- despite me storing their ai_behaviour in a slot. I'm guessing this is because lots of them are travelling to towns/patrolling around locations, so will I need to store these as well?
  14. Party-stopping script

    Ah, okay, that sounds reasonable. One quick question, is there a way to run a script once a day, at a specific time of day?
  15. Party-stopping script

    Hi guys, I'm trying to make a script which makes parties on the map stop and rest at night. If they are chasing or fleeing another party they'll keep going, but otherwise they'll stop. Here's what I've got so far: In module_triggers (near the top) and then in module_scripts, right at the...
  16. Parts of Warband aren't working

    oh, and in multiplayer pressing L no longer brings up the leaderboard, or whatever you call it- it brings up the game log instead. I can't find a way to reconfigure the key (when I stop it from opening the game log it doesn't load anything.)
  17. Parts of Warband aren't working

    oh, and I was using native btw
  18. Parts of Warband aren't working

    Hi, I've recently started to notice lots of problems with warband- not sure if they are caused by the patch, as I think that some surfaced before I downloaded it; -When I click on buttons, the sound is really quiet. Not really that bad, but it's a bit annoying -Whenever I enter a battle...
后退
顶部 底部