making agents stand still -zombies eating people!

Currently viewing this thread:

jik

Knight
Is there a way to make agents stand still in a battle?  I need to force 1-6 agents to hold still while I run a specific animation on them.  The animation part is fine, but once the sequence is done, they start to move again.  I know there is a hold order, but it works on a class basis.  Is there a way to tell an agent not to move for a period of time?  (I can run the timer with an agent slot and a trigger)
 

fisheye

Grandmaster Knight
agent_set_scripted_destination onto current location? It'll run on the spot, but you said you have anims taken care of.
 

jik

Knight
fisheye said:
agent_set_scripted_destination onto current location? It'll run on the spot, but you said you have anims taken care of.

I've used that, but they seem to move away from the spot after a second or so.  Does setting an animation break the scripted_destination operation?  I would tell you exactly what I am trying to do, but it would ruin the surprise...  Here is a generalized bit of the code:

(try_for_agents,":agent2"),
(agent_is_alive,":agent2"),
(agent_get_team,":z_team",":agent2"),
(eq,":z_team",1),
(agent_get_position,pos2,":agent2"),
(get_distance_between_positions,":dist",pos1,pos2),
(le,":dist",200),  ##need to be close
(agent_set_scripted_destination,":agent2",pos1,1), ##move to the target
(agent_set_animation, ":agent2", "anim_1"),
(agent_set_animation, ":agent2", "anim_2"),
(try_end),

This is generally what I am doing.  So they seem to move to the spot a bit, run anim_1 and anim_2, then the move way.  I need to keep them there till they are done.  Do I need to make another trigger that keeps them there (running the destination and the anims over and over)?
 

fisheye

Grandmaster Knight
well, ****, I don't know. Whenever I've used set_scripted destination, the guys would run there, and keep running on the spot until I told them to do something else. I'd try throwing in another set_scripted_destination after the anims, just in case the anims clear the destination. What about Fei Dao's suggestion.
 

Shik

Baron
M&BWBWF&S
Try combining Fisheye's suggestion with (team_give_order, ..., ..., mordr_stand_ground)
Also something that might be relevant is (team_set_order_position).

I know that cf_siege_assign_men_to_belfry uses the scripted destination command to make sure that the troops don't go astray when they're attached to the siege tower.
 

jik

Knight
Fei Dao said:
Try combining Fisheye's suggestion with (team_give_order, ..., ..., mordr_stand_ground)
Also something that might be relevant is (team_set_order_position).

I know that cf_siege_assign_men_to_belfry uses the scripted destination command to make sure that the troops don't go astray when they're attached to the siege tower.

I can't use the team order, I need to affect just a few of them I will try and run the scripted dest. thing again at the end of the script.  I think I would need to set the run animation the the anim_2 (which is a looping one) so that they continue to to use that animation.
 

Arch3r

Count
M&BWBNW
Might try to set a speed limit.

(agent_set_speed_limit,<agent_id>,<speed_limit(kilometers/hour)>),
Probally setting it to 0 will make them stand still.
 

jik

Knight
I found out why they were still moving, I had another trigger to force them to attack which was stopping an earlier scripted move.  So I fixed that.  Still the animation won't cycle.  Well, I guess I can just call the animation a few times to keep them doing it.  I have to run some checks anyway while they are there, I can try and tie it all together. 
 

jik

Knight
Ok, maybe to spark some interest in what I am doing I got the ok to post what I am trying to accomplish.  The idea is that the enemy are zombies.  When a human is "KOed" by the zombies, those within 300cm will fall on him and start to eat him.  Only up to 3 zombies will do this.  The target agent will have a slot that will start to go up.  Each zombie "eating" this agent adds a certain number to it from a timed trigger.  I'm hoping to use this trigger as well to keep them tied to the spot and to animate them.

What I am hoping to do is see if these fallen men can be rescued.  What I need to know is how agents, kos and death work.  If the troop is KOed, is the agent active?  For how long?  If the agent is deleted on a KO, my plans may not work...
 
Top Bottom