Coding for a good nights sleep! |My Final Question|

Currently viewing this thread:

bjorne.

Sergeant Knight
First of all. Hi.
Second of. Okey, I pretty much decided to leave the mount&blade community, thus quitting modding. Though, I allways had this thing disturbing me. I started a code, which where went to trigger when the units are told to hold fire.
I wanted them to play an animation and pretty much swap weapon.

Thing is. I had no idea of how to have a Vertex Animation being triggered. So I couldn't do it that way. So, I tried to find other ways. Now, this is what I came up with. I am sure it is not enough. And sure that it ain't good enough.

Code:
(key_is_down, "hold fire"),
(try_begin),
  (agent_has_item_equipped,":agent",itm_musket_bayonet),
  (agent_is_ally, ":agent"),
  (agent_is_human, ":agent"),
(try_end),
(agent_get_wielded_item,<destination>,":agent",1),
(agent_set_animation, ":agent", anim_fix_bayonet)


Here's the thing. I think I managed to figure out how do test the conditions (which is pretty much as the commun "if" command). yet, I couldn't find any code that would be the same as the commun "then" command.

If anyone gives me a hand with this, then I'll surely be sleeping the future nights :smile:
 

Lumos

Archduke
WBWF&SNWM&BVC
Seems interesting, so let me try...
Code:
musketeer_bayonets = (0,0,0, [], [
(try_for_agents, ":agent"),
     (agent_is_human, ":agent"),
     (agent_is_alive, ":agent"),
     (agent_has_item_equipped), # Here is your mistake, bjorne. You must not do the try_end now
     (agent_get_wielded_item,<destination>,":agent",1), # I don't get this. Hand 1 is the right, right? And why do you do this?
     (agent_set_animation, ":agent", anim_fix_bayonet),
(try_end), # Now is the time for the try_end
]),
I hope this helps. Can you add some more info please?
 

bjorne.

Sergeant Knight
Okey. So (try_begin) ---> (try_end) is not equal to "if"?

and. I did the
Code:
(agent_get_wielded_item,<destination>,":agent",1), # I don't get this. Hand 1 is the right, right? And why do you do this? 
thingy, to get the agent to wield the weapon. Not just add it to the inventory. Though. That method could be wrong. I don't know. Tbh.
 

Lumos

Archduke
WBWF&SNWM&BVC
agent_get_wielded_weapon stores the item ID in the <destination> afaik.
So you need to use something like:
Code:
(agent_get_troop_id, ":troop", ":agent"),
(troop_equip_items, ":troop"), # I thought just of this because checking through header_operations there seems to be no "equip particular item" operation
 

bjorne.

Sergeant Knight
but that code equips every item in the inventory. I don't want that. I want it to be used by the player aswell.



FrisianDude said:
Why would you want to leave?
I do not posess the amount of time that I would need to still do this, and enjoy it.
 
Top Bottom