are these commands ai only?

Users who are viewing this thread

modder123

Banned
agent_get_attack_action
agent_get_defend_action

they dont seem to work not even when hosting yourself

are these ai only commands?
 
Both operations are supposed to work for players aswell, but agent_get_attack_action is bugged on dedicated servers(it was back on v1.153 atleast)... on both, server- and client side.
You have to write a workaround which checks for the specific attack animations.

Edit
This is the workaround I made for Battle of Europe.
It should work on Native aswell.
Code:
	("workaround_agent_attack_action",
	[
		(store_script_param, ":agent_id", 1),
    
		(assign, reg0, 0),
		(try_begin),
			(agent_is_active, ":agent_id"),
			(agent_is_alive, ":agent_id"),
			(assign, ":workaround", 0),
			(try_begin),#on decicated server
				(multiplayer_is_dedicated_server),
				(assign, ":workaround", 1),
			(else_try),#client side while on decicated server
				(game_in_multiplayer_mode),
				(neg|multiplayer_is_server),
				(assign, ":workaround", 1),
			(try_end),
		
			(try_begin),
				(eq, ":workaround", 1),
				(agent_get_animation, ":anim", ":agent_id", 1),#upper body animation
				(try_begin),
					(this_or_next|eq, ":anim", "anim_ready_bow"),
					(this_or_next|eq, ":anim", "anim_ready_crossbow"),
					(this_or_next|eq, ":anim", "anim_ready_javelin"),
					(this_or_next|eq, ":anim", "anim_ready_throwing_knife"),
					(this_or_next|eq, ":anim", "anim_ready_throwing_axe"),
					(this_or_next|eq, ":anim", "anim_ready_stone"),
					(this_or_next|eq, ":anim", "anim_ready_pistol"),
					(this_or_next|eq, ":anim", "anim_ready_musket"),
					(this_or_next|eq, ":anim", "anim_ready_swingright_fist"),
					(this_or_next|eq, ":anim", "anim_ready_swingleft_fist"),
					(this_or_next|eq, ":anim", "anim_ready_direct_fist"),
					(this_or_next|eq, ":anim", "anim_ready_uppercut_fist"),
					(this_or_next|eq, ":anim", "anim_ready_slashright_twohanded"),
					(this_or_next|eq, ":anim", "anim_ready_slashleft_twohanded"),
					(this_or_next|eq, ":anim", "anim_ready_thrust_twohanded"),
					(this_or_next|eq, ":anim", "anim_ready_overswing_twohanded"),
					(this_or_next|eq, ":anim", "anim_ready_thrust_onehanded"),
					(this_or_next|eq, ":anim", "anim_ready_thrust_onehanded_horseback"),
					(this_or_next|eq, ":anim", "anim_ready_thrust_onehanded_lance"),
					(this_or_next|eq, ":anim", "anim_ready_slashright_onehanded"),
					(this_or_next|eq, ":anim", "anim_ready_slashleft_onehanded"),
					(this_or_next|eq, ":anim", "anim_ready_overswing_onehanded"),
					(this_or_next|eq, ":anim", "anim_ready_slash_horseback_right"),
					(this_or_next|eq, ":anim", "anim_ready_slash_horseback_left"),
					(this_or_next|eq, ":anim", "anim_ready_slash_horseback_polearm_right"),
					(this_or_next|eq, ":anim", "anim_ready_slash_horseback_polearm_left"),
					(this_or_next|eq, ":anim", "anim_ready_overswing_staff"),
					(this_or_next|eq, ":anim", "anim_ready_thrust_staff"),
					(this_or_next|eq, ":anim", "anim_ready_slashleft_staff"),
					(this_or_next|eq, ":anim", "anim_ready_slashright_staff"),
					(this_or_next|eq, ":anim", "anim_crouch_ready_pistol"),
					(this_or_next|eq, ":anim", "anim_ready_overswing_spear"),
					(this_or_next|eq, ":anim", "anim_ready_overswing_musket"),
					(eq, ":anim", "anim_ready_thrust_musket"),
					(assign, reg0, 1),#readying_attack
				(else_try),
					(this_or_next|eq, ":anim", "anim_release_bow"),
					(this_or_next|eq, ":anim", "anim_release_crossbow"),
					(this_or_next|eq, ":anim", "anim_release_javelin"),
					(this_or_next|eq, ":anim", "anim_release_throwing_knife"),
					(this_or_next|eq, ":anim", "anim_release_throwing_axe"),
					(this_or_next|eq, ":anim", "anim_release_stone"),
					(this_or_next|eq, ":anim", "anim_release_pistol"),
					(this_or_next|eq, ":anim", "anim_release_musket"),
					(this_or_next|eq, ":anim", "anim_release_swingright_fist"),
					(this_or_next|eq, ":anim", "anim_release_swingleft_fist"),
					(this_or_next|eq, ":anim", "anim_release_direct_fist"),
					(this_or_next|eq, ":anim", "anim_release_uppercut_fist"),
					(this_or_next|eq, ":anim", "anim_release_slashright_twohanded"),
					(this_or_next|eq, ":anim", "anim_release_slashleft_twohanded"),
					(this_or_next|eq, ":anim", "anim_release_thrust_twohanded"),
					(this_or_next|eq, ":anim", "anim_release_overswing_twohanded"),
					(this_or_next|eq, ":anim", "anim_release_thrust_onehanded"),
					(this_or_next|eq, ":anim", "anim_release_thrust_onehanded_horseback"),
					(this_or_next|eq, ":anim", "anim_release_thrust_onehanded_lance"),
					(this_or_next|eq, ":anim", "anim_release_slashright_onehanded"),
					(this_or_next|eq, ":anim", "anim_release_slashleft_onehanded"),
					(this_or_next|eq, ":anim", "anim_release_overswing_onehanded"),
					(this_or_next|eq, ":anim", "anim_release_slash_horseback_right"),
					(this_or_next|eq, ":anim", "anim_release_slash_horseback_left"),
					(this_or_next|eq, ":anim", "anim_release_slash_horseback_polearm_right"),
					(this_or_next|eq, ":anim", "anim_release_slash_horseback_polearm_left"),
					(this_or_next|eq, ":anim", "anim_release_overswing_staff"),
					(this_or_next|eq, ":anim", "anim_release_thrust_staff"),
					(this_or_next|eq, ":anim", "anim_release_slashleft_staff"),
					(this_or_next|eq, ":anim", "anim_release_slashright_staff"),
					(this_or_next|eq, ":anim", "anim_crouch_release_pistol"),
					(this_or_next|eq, ":anim", "anim_release_overswing_spear"),
					(this_or_next|eq, ":anim", "anim_release_overswing_musket"),
					(eq, ":anim", "anim_release_thrust_musket"),
					(assign, reg0, 2),#releasing_attack
				(else_try),
					(this_or_next|eq, ":anim", "anim_reload_crossbow"),
					(this_or_next|eq, ":anim", "anim_reload_crossbow_horseback"),
					(this_or_next|eq, ":anim", "anim_reload_pistol"),
					(this_or_next|eq, ":anim", "anim_reload_musket"),
					(this_or_next|eq, ":anim", "anim_reload_musket_full"),
					(this_or_next|eq, ":anim", "anim_reload_musket_two_third"),
					(this_or_next|eq, ":anim", "anim_reload_musket_one_third"),
					(eq, ":anim", "anim_reload_pistol_half"),
					(assign, reg0, 5),#reloading
				(try_end),
			(else_try),
				(agent_get_attack_action, reg0, ":agent_id"),
			(try_end),
		(try_end),
	]),
 
_Sebastian_ said:
Both operations are supposed to work for players aswell, but agent_get_attack_action is bugged on dedicated servers(it was back on v1.153 atleast)... on both, server- and client side.
You have to write a workaround which checks for the specific attack animations.

Edit
This is the workaround I made for Battle of Europe.
It should work on Native aswell.
Code:
	("workaround_agent_attack_action",
	[
		(store_script_param, ":agent_id", 1),
    
		(assign, reg0, 0),
		(try_begin),
			(agent_is_active, ":agent_id"),
			(agent_is_alive, ":agent_id"),
			(assign, ":workaround", 0),
			(try_begin),#on decicated server
				(multiplayer_is_dedicated_server),
				(assign, ":workaround", 1),
			(else_try),#client side while on decicated server
				(game_in_multiplayer_mode),
				(neg|multiplayer_is_server),
				(assign, ":workaround", 1),
			(try_end),
		
			(try_begin),
				(eq, ":workaround", 1),
				(agent_get_animation, ":anim", ":agent_id", 1),#upper body animation
				(try_begin),
					(this_or_next|eq, ":anim", "anim_ready_bow"),
					(this_or_next|eq, ":anim", "anim_ready_crossbow"),
					(this_or_next|eq, ":anim", "anim_ready_javelin"),
					(this_or_next|eq, ":anim", "anim_ready_throwing_knife"),
					(this_or_next|eq, ":anim", "anim_ready_throwing_axe"),
					(this_or_next|eq, ":anim", "anim_ready_stone"),
					(this_or_next|eq, ":anim", "anim_ready_pistol"),
					(this_or_next|eq, ":anim", "anim_ready_musket"),
					(this_or_next|eq, ":anim", "anim_ready_swingright_fist"),
					(this_or_next|eq, ":anim", "anim_ready_swingleft_fist"),
					(this_or_next|eq, ":anim", "anim_ready_direct_fist"),
					(this_or_next|eq, ":anim", "anim_ready_uppercut_fist"),
					(this_or_next|eq, ":anim", "anim_ready_slashright_twohanded"),
					(this_or_next|eq, ":anim", "anim_ready_slashleft_twohanded"),
					(this_or_next|eq, ":anim", "anim_ready_thrust_twohanded"),
					(this_or_next|eq, ":anim", "anim_ready_overswing_twohanded"),
					(this_or_next|eq, ":anim", "anim_ready_thrust_onehanded"),
					(this_or_next|eq, ":anim", "anim_ready_thrust_onehanded_horseback"),
					(this_or_next|eq, ":anim", "anim_ready_thrust_onehanded_lance"),
					(this_or_next|eq, ":anim", "anim_ready_slashright_onehanded"),
					(this_or_next|eq, ":anim", "anim_ready_slashleft_onehanded"),
					(this_or_next|eq, ":anim", "anim_ready_overswing_onehanded"),
					(this_or_next|eq, ":anim", "anim_ready_slash_horseback_right"),
					(this_or_next|eq, ":anim", "anim_ready_slash_horseback_left"),
					(this_or_next|eq, ":anim", "anim_ready_slash_horseback_polearm_right"),
					(this_or_next|eq, ":anim", "anim_ready_slash_horseback_polearm_left"),
					(this_or_next|eq, ":anim", "anim_ready_overswing_staff"),
					(this_or_next|eq, ":anim", "anim_ready_thrust_staff"),
					(this_or_next|eq, ":anim", "anim_ready_slashleft_staff"),
					(this_or_next|eq, ":anim", "anim_ready_slashright_staff"),
					(this_or_next|eq, ":anim", "anim_crouch_ready_pistol"),
					(this_or_next|eq, ":anim", "anim_ready_overswing_spear"),
					(this_or_next|eq, ":anim", "anim_ready_overswing_musket"),
					(eq, ":anim", "anim_ready_thrust_musket"),
					(assign, reg0, 1),#readying_attack
				(else_try),
					(this_or_next|eq, ":anim", "anim_release_bow"),
					(this_or_next|eq, ":anim", "anim_release_crossbow"),
					(this_or_next|eq, ":anim", "anim_release_javelin"),
					(this_or_next|eq, ":anim", "anim_release_throwing_knife"),
					(this_or_next|eq, ":anim", "anim_release_throwing_axe"),
					(this_or_next|eq, ":anim", "anim_release_stone"),
					(this_or_next|eq, ":anim", "anim_release_pistol"),
					(this_or_next|eq, ":anim", "anim_release_musket"),
					(this_or_next|eq, ":anim", "anim_release_swingright_fist"),
					(this_or_next|eq, ":anim", "anim_release_swingleft_fist"),
					(this_or_next|eq, ":anim", "anim_release_direct_fist"),
					(this_or_next|eq, ":anim", "anim_release_uppercut_fist"),
					(this_or_next|eq, ":anim", "anim_release_slashright_twohanded"),
					(this_or_next|eq, ":anim", "anim_release_slashleft_twohanded"),
					(this_or_next|eq, ":anim", "anim_release_thrust_twohanded"),
					(this_or_next|eq, ":anim", "anim_release_overswing_twohanded"),
					(this_or_next|eq, ":anim", "anim_release_thrust_onehanded"),
					(this_or_next|eq, ":anim", "anim_release_thrust_onehanded_horseback"),
					(this_or_next|eq, ":anim", "anim_release_thrust_onehanded_lance"),
					(this_or_next|eq, ":anim", "anim_release_slashright_onehanded"),
					(this_or_next|eq, ":anim", "anim_release_slashleft_onehanded"),
					(this_or_next|eq, ":anim", "anim_release_overswing_onehanded"),
					(this_or_next|eq, ":anim", "anim_release_slash_horseback_right"),
					(this_or_next|eq, ":anim", "anim_release_slash_horseback_left"),
					(this_or_next|eq, ":anim", "anim_release_slash_horseback_polearm_right"),
					(this_or_next|eq, ":anim", "anim_release_slash_horseback_polearm_left"),
					(this_or_next|eq, ":anim", "anim_release_overswing_staff"),
					(this_or_next|eq, ":anim", "anim_release_thrust_staff"),
					(this_or_next|eq, ":anim", "anim_release_slashleft_staff"),
					(this_or_next|eq, ":anim", "anim_release_slashright_staff"),
					(this_or_next|eq, ":anim", "anim_crouch_release_pistol"),
					(this_or_next|eq, ":anim", "anim_release_overswing_spear"),
					(this_or_next|eq, ":anim", "anim_release_overswing_musket"),
					(eq, ":anim", "anim_release_thrust_musket"),
					(assign, reg0, 2),#releasing_attack
				(else_try),
					(this_or_next|eq, ":anim", "anim_reload_crossbow"),
					(this_or_next|eq, ":anim", "anim_reload_crossbow_horseback"),
					(this_or_next|eq, ":anim", "anim_reload_pistol"),
					(this_or_next|eq, ":anim", "anim_reload_musket"),
					(this_or_next|eq, ":anim", "anim_reload_musket_full"),
					(this_or_next|eq, ":anim", "anim_reload_musket_two_third"),
					(this_or_next|eq, ":anim", "anim_reload_musket_one_third"),
					(eq, ":anim", "anim_reload_pistol_half"),
					(assign, reg0, 5),#reloading
				(try_end),
			(else_try),
				(agent_get_attack_action, reg0, ":agent_id"),
			(try_end),
		(try_end),
	]),

i am going to look at that when i get back

either way thank you for taking the time to respond though!!! :smile:
 
just one other note
the defend action, isnt that in essense an auto block
as you can set the value to which way you want to defend, and if you set them all at once, and set it to hold it too for say 5 seconds, surely that is an auto block in essense and i`m pretty sure as you arent exactly speeding up animations or anything, it doesnt need to sync with the server you are on, to work?
 
Somebody said:
No, because there's no point setting them all at once when the agent can only play one animation.

any chance you can just advise me here as i want to test the defend works default
i dont need anything written apart from the in bold part which is just adding in a couple of numpers
i even have the mission temp set up




multiplayer_client_defendspecial = (
  0, 0, 1, [
  (neg|multiplayer_is_dedicated_server),
  (key_clicked,key_k),
  ],
  [

(call_script,"script_client_get_my_agent"),
          (assign,":agent_id",reg0),
          (agent_is_active,":agent_id"),


    (agent_set_defend_action, ":agent_id", 3, 2),
    ])



where am i going wrong here?

because in header operations the command is defined as

agent_set_defend_action                = 1746  # (agent_set_defend_action, <agent_id>, <value>, <duration-in-1/1000-seconds>), #value_1: 0 = defend_down, 1 = defend_right, 2 = defend_left, 3 = defend_up



again i dont need everything re-written, jsut advise in setting the values, so i can practise seeing if i can assign a certain key to it to hold block for 2 seconds
this is not going to be attempted to be used in multiplayer as i know it will be useless but once i get the hang on setting the value i will be fine going forward

ps when i run my temp i get this error

Untitled.jpg
 
What are you trying to do?
agent_get_defend_action is used to get the current defend action, NOT to set it.

Your code is doing nothing, apply a proper variable name or register to <destination>.
Code:
(agent_get_defend_action, ":defend_action", ":agent_id"),
or
Code:
(agent_get_defend_action, reg1, ":agent_id"),

But still...
If you dont check for the specific result, or atleast display it in a message, then your trigger makes no sense at all.
 
sorry misspelt it while i was typing it

mine on my computer is set action


multiplayer_client_defendspecial = (
  0, 0, 1, [
  (neg|multiplayer_is_dedicated_server),
  (key_clicked,key_k),
  ],
  [

(call_script,"script_client_get_my_agent"),
          (assign,":agent_id",reg0),
          (agent_is_active,":agent_id"),


  (agent_set_defend_action, ":agent_id", 3, 2),
    ])


sorry again i had written it wrong as i was in a hurry

so i have set it to action 3 which is defend up
for 2 seconds
but i get that error in picture above

am i doing soemthing wrong
 
Reading and understanding the operation's description and declaration would be a good idea, wouldnt it?
Code:
 # (agent_set_defend_action, <agent_id>, <value>, <duration-in-1/1000-seconds>),
# Forces the agent to perform a defend action. Possible values: -2 = cancel any action (1.153+), 0 = defend_down, 1 = defend_right, 2 = defend_left, 3 = defend_up. Does time value determine delay, speed or duration? 4research.
 
_Sebastian_ said:
Reading and understanding the operation's description and declaration would be a good idea, wouldnt it?
Code:
 # (agent_set_defend_action, <agent_id>, <value>, <duration-in-1/1000-seconds>),
# Forces the agent to perform a defend action. Possible values: -2 = cancel any action (1.153+), 0 = defend_down, 1 = defend_right, 2 = defend_left, 3 = defend_up. Does time value determine delay, speed or duration? 4research.

please re-read my edited version
everything is there in my post above all im asking is where am i going wrong



multiplayer_client_defendspecial = (
  0, 0, 1, [
  (neg|multiplayer_is_dedicated_server),
  (key_clicked,key_k),
  ],
  [

(call_script,"script_client_get_my_agent"),
          (assign,":agent_id",reg0),
          (agent_is_active,":agent_id"),
 

  (agent_set_defend_action, ":agent_id", 3, 2),
    ])

in other words that should be triggering defend up for 2 seconds, why is it not

ps im doing this on nw, the actions seem to be different but 3 is still defined as defend up
 
The consequences block is executed 1 second after you've clicked the specific key.
If you want to make it work immediately, change the time variables from 0, 0, 1, to 0, 0, 0,...

I'm also not quite sure if the set operations work for players, you just asked about the get operations before...
 
_Sebastian_ said:
The consequences block is executed 1 second after you've clicked the specific key.
If you want to make it work immediately, change the time variables from 0, 0, 1, to 0, 0, 0,...

I'm also not quite sure if the set operations work for players, you just asked about the get operations before...

yeh also key is down would be better to trigger it

i will try it as this

multiplayer_client_defendspecial = (
  0, 0, 0, [
  (neg|multiplayer_is_dedicated_server),
  (key_is_down,key_k),
  ],
  [

(call_script,"script_client_get_my_agent"),
          (assign,":agent_id",reg0),
          (agent_is_active,":agent_id"),
 

  (agent_set_defend_action, ":agent_id", 3, 200),
    ])


and let you know if it works

edit nothing happens

no block animation at all happens wether holding a musket or sword or unarmed nothing not even for a second
no error message though this time

do you think its the same scenario you had with attack, where you had to literally define all the possible attack actions yourself?
 
agent_set_defend_action does not work for players. AI only.
So you can't make yourself an autoblock using module system.
Same goes for the set_attack and set_look_direction operations.
 
The_dragon said:
agent_set_defend_action does not work for players. AI only.
So you can't make yourself an autoblock using module system.
Same goes for the set_attack and set_look_direction operations.

not trying to make an auto block

also if you would read, set attack can be done if you create your own definitions of attack actions

also you are one of the rudest people on the planet.
 
modder123 said:
also you are one of the rudest people on the planet.
At the moment the only person that is acting rude is you.
According to your posts in another thread, you tend to troll other people... People that are actually trying to help you.
So stop acting like this, otherwise you wont get any further help anymore!
 
_Sebastian_ said:
modder123 said:
also you are one of the rudest people on the planet.
At the moment the only person that is acting rude is you.
According to your posts in another thread, you tend to troll other people... People that are actually trying to help you.
So stop acting like this, otherwise you wont get any further help anymore!


actually no i have dealt with him elsewhere

he decompiles my stuff without permission and posts it for others to see and then laughs at me

so i have every reason to be angry


either way one thing is for sure

the next time somebody begs me to make them a zoom or something

i am doing exactly what most `mount blade modders do`

thats right

NOTHING

being a nice person gets you nowhere in life clearly

bye
 
Back
Top Bottom