Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Hello, my question is a little big. I would like to know how to fix the siege scenes, which you know the stairs doesn't work out too well and is very artificial, I would also like to increase the number of siege towers and completely remove the siege stairs and also increase the size of the walls. To do this I need only edit the scenes or I need to change the codes? (I guess I know the answer to that, but give me directions to achieve this.)

Thanks a lot to those who answers this  :grin:
 
The additional siege towers need to be coded.
The wall can be enlarged inside the scene editor.

Don't know what you mean with the stairs but if they need to be enlarged, well ... If it is about the AI getting stuck you can try to move things around in the editor and see if it helps.
But other than that there is nothing much you can do.
 
Is it possible to give a certain lord a different army than his peers in the same faction? A certain lord with only cavalry would be nice for certain factions, for one.

Also, would giving a lord guarantee_ranged make him join his archers?
 
FrisianDude said:
Is it possible to give a certain lord a different army than his peers in the same faction? A certain lord with only cavalry would be nice for certain factions, for one.
Certainly. You'd need to edit script_cf_reinforce_party. Then either have a special party template set up, or otherwise add troops.

FrisianDude said:
Also, would giving a lord guarantee_ranged make him join his archers?
Quite possibly.
 
Who got experience with editing the world map icon flags? I want to change for exemple the square ones for the rectangular ones, lest the precious banner textures I made are cut crappily.
 
Hey, quick question. I just recently bought a new copy of Warband (it turns out that my friend who gave me warband still plays it, so I wanted to be legal) and I can't use any of the cheats...
I have Cheats enabled, but Ctrl+F4, Ctrl+F9, and Ctrl+F11 don't work.
I need those specifically for Scene Editing....  :cry:

Can anyone help me out? If not, I might use the old exe I had for scene editing, since those cheats actually worked....
 
What's wrong with it?

' Incorrect skeleton type for anim 553 '


Whenever I try to ride horses, the error pops up.;

I know how to deal with some of 'RGL' errors which show errors when starting of loading, but I don't know how to deal with that error. And it looks all of brfs of mod seem working properly. I don't know what can I do;; Help me..  :cry:

PS: I imported PBOB in my mod. Without it, none of scripts are added.
And can it be a problem? I added '1' animation to here, cuz 'spear bracing' needs it.
["strike_fall_back_rise_upper", acf_align_with_ground, amf_priority_striked|amf_play|amf_accurate_body|amf_restart,
  [1.44, "anim_human", blow+5400, blow+5445, arf_blend_in_2],
],

  #NEW ANIM DOMA

["spearwall_hold", acf_thrust|acf_rot_vertical_bow|acf_anim_length(100), amf_priority_attack|amf_use_weapon_speed|amf_use_inertia|amf_keep|amf_client_owner_prediction,
  [ready_durn, "attacks_staff_thrust", 14, 21, blend_in_ready],],

#NEW ANIM DOMA 

["cheer", 0, amf_play|amf_priority_mount,
##  [2.5, "anim_human", 70000, 70045, arf_blend_
 
Any ideas about this script..?

I want to make orders have voices.

I tried it, and it works perfectly in Multiplayer. I tested on a dedicated server
Voice_order = [
(0, 0, 5, [(game_key_clicked, gk_infantry_hear)],[
(multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_infantry"),
]),
(0, 0, 5, [(game_key_clicked, gk_archers_hear)],[
(multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_missile"),
]),
(0, 0, 5, [(game_key_clicked, gk_cavalry_hear)],[
(multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_cavalry"),
]),
(0, 0, 5, [(game_key_clicked, everyone_hear)],[
(multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_all"),
]),
]

But, in this way, the voices are overlapped when I put key '1(gk_infantry_hear)', '2(gk_archers_hear)' at the same time, and it is very odd that one person is saying two or more words at the same time. So, I tried to bind them and make them under the effect of 'time limit' (what is now : 5 ). However, it doesn't work. As I am a noob at scripting.. I can't get what is a problem.

In mission_template
Voice_order = [
(0, 0, 5, [], [

                (try_begin),
(game_key_clicked, gk_infantry_hear),
(multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_infantry"),
(else_try),
(game_key_clicked, gk_archers_hear),
(multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_missile"),
(else_try),
(game_key_clicked, gk_cavalry_hear),
(multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_cavalry"),
(else_try),
(game_key_clicked, gk_everyone_hear),
(multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_all"),
(try_end),
]),


# This is what I added, but It doesn't work and shows an error code : Agent ID


  (0, 0, 3, [(key_clicked, key_m)], [  #call_horse_trigger
      (agent_get_slot, ":horse", "$fplayer_agent_no", slot_agent_horse),
      (gt, ":horse", 0),     
      (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_man_breath_hard"),
  #(agent_play_sound, "$fplayer_agent_no", "snd_man_breath_hard"),
      (display_message,"@You whistle for your horse."),
      (agent_is_alive,":horse"),
      (agent_get_position, pos1, "$fplayer_agent_no"),
      (agent_set_scripted_destination, ":horse", pos1, 0)]),
 
]


Inc onstants

slot_agent_horse        = 30

#And it is in mission_template
init_player_global_variables = (  #Called in caba_order_triggers
0, 0, ti_once, [], [
(get_player_agent_no, "$fplayer_agent_no"),
(agent_get_team, "$fplayer_team_no", "$fplayer_agent_no"),

(agent_get_horse, ":horse", "$fplayer_agent_no"),
    (ge, ":horse", 0),
        (agent_set_slot, "$fplayer_agent_no", slot_agent_horse, ":horse"),
        ])

 
init_player_global_variables won't work in multiplayer - use this instead
Code:
    (multiplayer_get_my_player, ":player"),
    (player_get_agent_id, ":agent", ":player"),
For the sound overlap, use a global or something inside the event to track whether a sound is already playing - make the interval equal to the duration of the sound and reset the variable in the consequence.
 
Somebody said:
init_player_global_variables won't work in multiplayer - use this instead
Code:
    (multiplayer_get_my_player, ":player"),
    (player_get_agent_id, ":agent", ":player"),
For the sound overlap, use a global or something inside the event to track whether a sound is already playing - make the interval equal to the duration of the sound and reset the variable in the consequence.

Many thx!


I didn't test it yet(I'll do later), but maybe it will work..?
Voice_order = [

(0, 0, 5, [], [

    (multiplayer_get_my_player, ":player"),
    (player_get_agent_id, ":my_agent", ":player"),
(agent_is_alive, ":my_agent"),
  (try_begin),
  (game_key_clicked, gk_infantry_hear),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_infantry"),
  (else_try),
  (game_key_clicked, gk_archers_hear),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_missile"),
  (else_try),
  (game_key_clicked, gk_cavalry_hear),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_cavalry"),
  (else_try),
  (game_key_clicked, gk_everyone_hear),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_all"),
  (try_end),
]),

  (0, 0, 3, [(key_clicked, key_m)], [  #call_horse_trigger
      (multiplayer_is_server),
      (multiplayer_get_my_player, ":player"),
      (player_get_agent_id, ":my_agent", ":player"),
      (agent_is_alive, ":my_agent"),
      (agent_get_position, pos0, ":my_agent"),
      (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "#user sound" ),
 
  (try_for_agents, ":cur_agent"),
        (agent_is_non_player, ":cur_agent"),
        (neg|agent_is_human, ":cur_agent"),
        (agent_is_alive, ":cur_agent"),
        (agent_get_position, pos1, ":cur_agent"),
        (try_begin),
          (get_distance_between_positions_in_meters, ":distance_to_target_pos", pos0, pos1),
          (lt, ":distance_to_target_pos", 30),  
        (agent_set_scripted_destination, ":cur_agent", pos0, 0),
          (display_message,"@You whistle for your horse."),
(else_try),
  (display_message,"@It's too far to get a horse."),
(try_end),
  (try_end),
  ]),
 
]
 
DOMA_ said:
Somebody said:
init_player_global_variables won't work in multiplayer - use this instead
Code:
    (multiplayer_get_my_player, ":player"),
    (player_get_agent_id, ":agent", ":player"),
For the sound overlap, use a global or something inside the event to track whether a sound is already playing - make the interval equal to the duration of the sound and reset the variable in the consequence.

Many thx!


I didn't test it yet(I'll do later), but maybe it will work..?
Voice_order = [

(0, 0, 5, [], [

    (multiplayer_get_my_player, ":player"),
    (player_get_agent_id, ":my_agent", ":player"),
(agent_is_alive, ":my_agent"),
  (try_begin),
  (game_key_clicked, gk_infantry_hear),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_infantry"),
  (else_try),
  (game_key_clicked, gk_archers_hear),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_missile"),
  (else_try),
  (game_key_clicked, gk_cavalry_hear),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_cavalry"),
  (else_try),
  (game_key_clicked, gk_everyone_hear),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_all"),
  (try_end),
]),

  (0, 0, 3, [(key_clicked, key_m)], [  #call_horse_trigger
      (multiplayer_is_server),
      (multiplayer_get_my_player, ":player"),
      (player_get_agent_id, ":my_agent", ":player"),
      (agent_is_alive, ":my_agent"),
      (agent_get_position, pos0, ":my_agent"),
      (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "#user sound" ),
 
  (try_for_agents, ":cur_agent"),
        (agent_is_non_player, ":cur_agent"),
        (neg|agent_is_human, ":cur_agent"),
        (agent_is_alive, ":cur_agent"),
        (agent_get_position, pos1, ":cur_agent"),
        (try_begin),
          (get_distance_between_positions_in_meters, ":distance_to_target_pos", pos0, pos1),
          (lt, ":distance_to_target_pos", 30),  
        (agent_set_scripted_destination, ":cur_agent", pos0, 0),
          (display_message,"@You whistle for your horse."),
(else_try),
  (display_message,"@It's too far to get a horse."),
(try_end),
  (try_end),
  ]),
 
]




Hm.... It doens't work and gives an error opcode : Agent : ID -1.  What's wrong with it..?
 
Be more specific - the error message will tell you which opcode is using the invalid agent (so you can look it up in header_oeprations), and what line of which trigger it's in so you can easily debug it yourself. Use player_is_active after multiplayer_get_my_player to eliminate some sources of error.
 
Also, you should always use agent_is_active after getting an agent id, before doing things like agent_is_alive - unless you are absolutely sure it is valid (for example, in a scene prop trigger).
 
Thx to Somebody and Vornne, now most of the things are fully worked.

here is the script. (I added more voice systems and they work perfectly)

Voice_order = [

(0, 0, 1, [(game_key_clicked, gk_infantry_hear),], [
      (multiplayer_get_my_player, ":player_no"),
  (player_is_active, ":player_no"),
  (player_get_agent_id, ":agent", ":player_no"),
  (agent_is_active, ":agent"),
  (agent_stop_sound, ":agent"),
 
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_infantry"),

]),

  (0 , 0, 1, [(game_key_clicked, gk_archers_hear),], [
      (multiplayer_get_my_player, ":player_no"),
  (player_is_active, ":player_no"),
  (player_get_agent_id, ":agent", ":player_no"),
  (agent_is_active, ":agent"),
  (agent_stop_sound, ":agent"),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_missile"),
 
  ]),
 
 
  (0 , 0, 1, [(game_key_clicked, gk_cavalry_hear),], [
      (multiplayer_get_my_player, ":player_no"),
  (player_is_active, ":player_no"),
  (player_get_agent_id, ":agent", ":player_no"),
  (agent_is_active, ":agent"),
  (agent_stop_sound, ":agent"),
      (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_cavalry"),
  ]),
 
 
  (0 , 0, 1, [(game_key_clicked, gk_everyone_hear),], [
      (multiplayer_get_my_player, ":player_no"),
  (player_is_active, ":player_no"),
  (player_get_agent_id, ":agent", ":player_no"),
  (agent_is_active, ":agent"),
  (agent_stop_sound, ":agent"),
 
      (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_all"),
  ]),
 
 
      (ti_before_mission_start, 0, 0, [], [
        (assign, "$gk_order", 0),
    ]),

    (0, .3, 0, [(game_key_clicked, gk_order_1)], [
        (eq, "$gk_order", gk_order_1),    #next trigger set MOVE menu?
        (game_key_is_down, gk_order_1),    #BUT player is holding down key?
        (assign, "$gk_order", 0),
    ]),


    (0, 0, 0, [(game_key_clicked, gk_order_1)], [
        (try_begin),
            (eq, "$gk_order", 0),
            (assign, "$gk_order", gk_order_1),
        (else_try),
            (eq, "$gk_order", gk_order_1),    #HOLD     
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_hold_position"),
            (assign, "$gk_order", 0),
        (else_try),
            (eq, "$gk_order", gk_order_2),    #ADVANCE
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_advance"),
            (assign, "$gk_order", 0),
        (else_try),
            (eq, "$gk_order", gk_order_3),    #HOLD FIRE
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_hold_fire"),
            (assign, "$gk_order", 0),
        (try_end),
    ]),
 
    (0, 0, 0, [(game_key_clicked, gk_order_2)], [
        (try_begin),
            (eq, "$gk_order", 0),
            (assign, "$gk_order", gk_order_2),
        (else_try),
            (eq, "$gk_order", gk_order_1),    #FOLLOW
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_follow"),
            (assign, "$gk_order", 0),
        (else_try),
            (eq, "$gk_order", gk_order_2),    #FALL BACK
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_advance"),
            (assign, "$gk_order", 0),
        (else_try),
            (eq, "$gk_order", gk_order_3),    #FIRE AT WILL
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_fire_at_will"),
            (assign, "$gk_order", 0),
        (try_end),
    ]),
 
    (0, 0, 0, [(game_key_clicked, gk_order_3)], [
        (try_begin),
            (eq, "$gk_order", 0),
            (assign, "$gk_order", gk_order_3),
        (else_try),
            (eq, "$gk_order", gk_order_1),    #CHARGE
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_charge_sound"),
            (assign, "$gk_order", 0),
        (else_try),
            (eq, "$gk_order", gk_order_2),    #SPREAD OUT
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_spread_out"),
            (assign, "$gk_order", 0),
        (else_try),
            (eq, "$gk_order", gk_order_3),    #BLUNT WEAPONS
            #Code for "Use Blunts!" goes here
            (assign, "$gk_order", 0),
        (try_end),
    ]),
 
    (0, 0, 0, [(game_key_clicked, gk_order_4)], [
        (try_begin),
            (eq, "$gk_order", gk_order_1),    #STAND GROUND
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_stand_ground"),         
            (assign, "$gk_order", 0),
        (else_try),
            (eq, "$gk_order", gk_order_2),    #STAND CLOSER
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_stand_closer"),
            (assign, "$gk_order", 0),
        (else_try),
            (eq, "$gk_order", gk_order_3),    #ANY WEAPON
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_use_any_weapon"),
            (assign, "$gk_order", 0),
        (try_end),
    ]),
 
    (0, 0, 0, [(game_key_clicked, gk_order_5)], [
        (try_begin),
            (eq, "$gk_order", gk_order_1),    #RETREAT
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_retreat"),
            (assign, "$gk_order", 0),
        (else_try),
            (eq, "$gk_order", gk_order_2),    #MOUNT
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_cavalry"),
            (assign, "$gk_order", 0),
        (try_end),
    ]),
 
    (0, 0, 0, [(game_key_clicked, gk_order_6)], [
        (try_begin),
            (eq, "$gk_order", gk_order_2),    #DISMOUNT
            (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_call_cavalry"),
            (assign, "$gk_order", 0),
        (try_end),
    ]),


  (0, 0, 3, [(key_clicked, key_m)], [  #call_horse_trigger
 
      (multiplayer_get_my_player, ":player_no"),
  (player_is_active, ":player_no"),
      (player_get_agent_id, ":agent", ":player_no"),
  (agent_is_active, ":agent"),
  (agent_get_position, pos1, ":agent"),
  (multiplayer_send_int_to_server,multiplayer_event_sound_at_player, "snd_man_breath_hard" ),
 
  (try_for_agents, ":cur_agent"),
        (neg|agent_is_human, ":cur_agent"),
(agent_is_active, ":cur_agent"),
        (agent_is_alive, ":cur_agent"),
        (agent_get_position, pos2, ":cur_agent"),
        (try_begin),
          (get_distance_between_positions_in_meters, ":distance_to_target_pos", pos1, pos2),
          (lt, ":distance_to_target_pos", 30),  
        (agent_set_scripted_destination, ":cur_agent", pos1, 1),
          (display_message,"@You whistle for your horse."),
(else_try),
  (display_message,"@It's too far to get a horse."),
(try_end),
  (try_end),
  ]),
 
]


But, the problem is the tuple : '(agent_set_scripted_destination, ":cur_agent", pos1, 1),'  seems not work. And neither  '(agent_set_scripted_destination, ":cur_agent", pos1, 0),' does.

As messages "@You whistle for your horse." and  "@It's too far to get a horse." show up and work as planned (determined by a distance), I believe the tuple above doesn't work or the usage of  'pos' is not proper.

um.. what's wrong with it?



PS : Is there any ways to define 'head' position?? I see AIs (range units) track enemies heads, but I don't know how to define positions of them
 
DOMA_ said:
But, the problem is the tuple : '(agent_set_scripted_destination, ":cur_agent", pos1, 1),'  seems not work. And neither  '(agent_set_scripted_destination, ":cur_agent", pos1, 0),' does.
At least part of your problem is running that operation on the client - that sort of thing (affecting what other players see) must be run on the server. Besides that, the operation might need some extra things done for it to work: I think it's mainly used in native single player for tutorial scenes and other peaceful things, and it might be overridden by the multiplayer battle AI; I would start by searching for it in the native code, then try copy how it is used, changing gradually to the way you want to use it, so the problem is more obvious.
 
Yesterday I have been working on a tavern so I had to manually add it on my map (PW). The strange thing here is that my interior (interior_tavern_b) just ignores the lights. I then tested it in Native by visiting the Dhirim's tavern which uses the same prop and noticed that the lights seem to work very well. Is there anything I can do with my tavern, like adding something on Var1/2 ?
 
Status
Not open for further replies.
Back
Top Bottom