Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Two questions about agents.

Is it possible to make an agent stop moving but fighting? Like guarding a door and not moving away but attacking all the enemies that come in range?

And the other question is: I tried to remove the player from his horse with agent_set_position. I want to dehorse the player directly right off the saddle but it seems that horse and player are attached to another so I can't just 'teleport' the player off his horse. Is this possible?

Information about these things is appreciated. 
 
Ritter Dummbatz said:
Two questions about agents.

Is it possible to make an agent stop moving but fighting? Like guarding a door and not moving away but attacking all the enemies that come in range?

And another question I have since I am already asking. I tried to remove the player from his horse with agent_set_position. I want to dehorse the player directly right off the saddle but it seems that horse and player are attached to another so I can't just 'teleport' the player off his horse.

Information about these things is appreciated.
1. set him on a separate team or class and give him the stand ground or hold position command. That would be easiest, otherwise you would have to create a scene_prop to box his legs in.

2. I would try a combination of a dismount order, followed by setting his animation to something else, and a teleport.
 
Ritter Dummbatz said:
Is it possible to make an agent stop moving but fighting? Like guarding a door and not moving away but attacking all the enemies that come in range?
You could try using agent_set_scripted_destination. They may get over-occupied with moving/holding the destination and only block, however.

Ritter Dummbatz said:
And the other question is: I tried to remove the player from his horse with agent_set_position. I want to dehorse the player directly right off the saddle but it seems that horse and player are attached to another so I can't just 'teleport' the player off his horse. Is this possible?
Since there's no operation to dismount a horse, the only way to do this is to kill the horse agent, then set the player agent's position and then spawn another horse agent immediately in the previous position. You'd probably want to move the dead horse agent's corpse somewhere out of sight immediately, too.
 
As currently, the weapons are attached to the right arm. During an animation, is it possible to detach the weapon for awhile from the hand so that the right hand is free and could do a reload animation, then attach it back to the hand?
 
I wanna make a shield play a sound when the player press the defend buttom, wich should I use?


ti_on_init_item          = -50.0 #can only be used in module_items triggers
ti_on_weapon_attack      = -51.0 #can only be used in module_items triggers
# Trigger Param 1: attacker agent id ##1.134
# Position Register 1: Weapon Item Position
ti_on_missile_hit        = -52.0 #can only be used in module_items triggers
# Position Register 1: Missile Position
# Trigger Param 1: shooter agent id
## Start 1.134
 
None of the above.
Code:
(0, 0, 2, [(game_key_clicked, gk_defend)],
   [
    (get_player_agent_no, ":player"),
    (agent_get_wielded_item, ":shield", ":player", 1),
    (eq, ":shield", "itm_shield_that_plays_sound"),
    (agent_play_sound, ":player", "snd_sound"),
   ]),
 
mr.master said:
As currently, the weapons are attached to the right arm. During an animation, is it possible to detach the weapon for awhile from the hand so that the right hand is free and could do a reload animation, then attach it back to the hand?

Change the animations no?
EG: Make it so that the rifle is attached to the left hand, then edit the anim so that the reload animation makes the right hand leave the gun, and come back up. Unless that is hardcoded
If I could help.. I would, but I am lost as to editing animations. :sad:
 
Hey people.
I need some help here with a thing and I don't even know if it's possible to do it. But here it goes.

I wanna make a certain music file play in one certain village. In this case its a "background sound". It would be even better if it was possible to play two music files at the same time.

I also wish to make that certain village as foggy and as "dark" as possible with the weather 24/7, while the rest of the maps weather remains unaltered. Is this possible? :???:
 
Atrummixer said:
I also wish to make that certain village as foggy and as "dark" as possible with the weather 24/7, while the rest of the maps weather remains unaltered.

You'll need to set up a trigger to go into the various village mission templates.
In that trigger, you would use:
get_global_cloud_amount        = 90  # (get_global_cloud_amount, <destination>), #returns a value between 0-100
set_global_cloud_amount        = 91  # (set_global_cloud_amount, <value>), #value is clamped to 0-100
get_global_haze_amount          = 92  # (get_global_haze_amount, <destination>), #returns a value between 0-100
set_global_haze_amount          = 93  # (set_global_haze_amount, <value>), #value is clamped to 0-100

And then you'd need another trigger to re-set the cloud and fog after the mission is over.

So the first trigger would look something like:
Code:
(ti_before_mission_start, 0, ti_once, [(eq, "$current_town", "p_village_##")] ,
   [
    (get_global_cloud_amount, "$cloud"), 
    (get_global_haze_amount, "$haze"), #need to be global variables so you can re-set to the same level after
    (set_global_cloud_amount, 100),
    (set_global_haze_amount, 80), #100 may be a bit much
   ]),

The re-set to normal trigger, unfortunately cannot be in mission templates as there is no "on_mission_end" trigger. (Very strange, but true.) Thus, you should use simple_triggers with something like this:
Code:
(0,
   [
    (neq, "$cloud", -1),
    (neq, "$haze", -1),
    (set_global_cloud_amount, "$cloud"),
    (set_global_haze_amount, "$haze"), 
    (assign, "$cloud", -1),
    (assign, "$haze", -1),
   ]),
 
Code:
  (
    "village_center",0,-1,
    "village center",
    [(0,mtef_scene_source|mtef_team_0,0,0,1,[]),
...],
    [
      (ti_after_mission_start, 0, ti_once, [(eq, "$current_town", "p_village_whatever"),], [
          (play_sound, "snd_music"),
          (set_fog_distance,100,0x10000000),
        ]),
Adjust the 100 for fog distance, and the hex code for transparency and color.
Caba`drin said:
The re-set to normal trigger, unfortunately cannot be in mission templates as there is no "on_mission_end" trigger. (Very strange, but true.)
You can try using ti_on_leave_area and ti_tab_pressed/ti_escape_pressed in place of ti_on_mission_end.
 
Specialist said:
mr.master said:
As currently, the weapons are attached to the right arm. During an animation, is it possible to detach the weapon for awhile from the hand so that the right hand is free and could do a reload animation, then attach it back to the hand?

Change the animations no?
EG: Make it so that the rifle is attached to the left hand, then edit the anim so that the reload animation makes the right hand leave the gun, and come back up. Unless that is hardcoded
If I could help.. I would, but I am lost as to editing animations. :sad:
I have done animations a tad. But I need to know if it's possible to attach/detach the weapon during animation. Thats what other people do when they example, animate weapons afaik. Ive done it in messiah studio where the clip comes off etc. But I don't know how to do it in blender nor do I know if wb supports this.
 
mr.master said:
EG: Make it so that the rifle is attached to the left hand, then edit the anim so that the reload animation makes the right hand leave the gun, and come back up.
If you are using crossbows to do guns, it allows vertex animation during reloading cycle. You can try use it.
Also, some mods have nice musket reloading animations, look how them are done
 
Status
Not open for further replies.
Back
Top Bottom