Jump to content
The Dark Mod Forums
JackFarmer

An entity (or something that works) that drives AIs away from path nodes unaccessible due to player's actions

Recommended Posts

 

1, AI walks from path note 1 to path node 2 to path node 3

2. Due to player's actions (using switches etc), path node 2 is not availably anymore (becuase it is maybe located on a trap door)

3. When path node 2 is not available anymore, AI shall go straight to path node 3

Share this post


Link to post
Share on other sites

If I were doing this, I would just teleport Node 2 to Node 3 (or some other appropriate location) when the player "acts".

 

 

Share this post


Link to post
Share on other sites

My first idea would be to target 2 path coners, one would have chance 0, the second chance 1, and then make a script to reverse values of these spawnargs (not sure what's the specific script for that though).

Edited by peter_spy

Share this post


Link to post
Share on other sites

Thank you for your answers.

However, I have already tried to move the nodes through movers , teleporters or change_target entities. Nothing worked.

Are you sure that one of these methods should work?

 

 

Share this post


Link to post
Share on other sites
On 7/18/2019 at 5:02 PM, VanishedOne said:

Changing node 1's target might also work.

This is what I've used previously. You'd need to do it by clearing all targets, then adding a different target.

There are entities for these 2 functions, or you can use Stim/Response or scripts. Personally I'd use a script so that you can add a sys.waitFrame() inbetween the 2 steps to ensure 100% that the new target doesn't become cleared as well.

Share this post


Link to post
Share on other sites
2 hours ago, JackFarmer said:

Thank you for your answers.

However, I have already tried to move the nodes through movers , teleporters or change_target entities. Nothing worked.

Are you sure that one of these methods should work?

 

 

I just tried it in a testmap and it worked fine.  Save the following as a .map file.  The citywatch will patrol to three of the 4 corners.  Flip the switch and one corner will be teleported so that he now only patrols to 2 corners.

 

Version 2
// entity 0
{
"classname" "worldspawn"
"editor_drLastCameraPos" "0 0 0"
"editor_drLastCameraAngle" "19.2 313.2 0"
// primitive 0
{
brushDef3
{
( 0 0 1 -160 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 -96 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 5 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -160 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 5 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -128 ) ( ( 0.0520833320915699 0 63.375 ) ( 0 0.0520833320915699 5 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -144 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 5 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 152 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 1
{
brushDef3
{
( 0 0 1 -152 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 -96 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -160 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 -64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -144 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 88 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 2
{
brushDef3
{
( 0 0 1 -152 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 -96 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -160 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 -64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -128 ) ( ( 0.0520833320915699 0 63.375 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 152 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 4.583333015441895 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 3
{
brushDef3
{
( 0 1 0 -96 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -160 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 -64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -128 ) ( ( 0.0520833320915699 0 63.375 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -144 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 1 56 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 4
{
brushDef3
{
( 0 0 1 -152 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 -160 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 -64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -128 ) ( ( 0.0520833320915699 0 63.375 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -144 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 120 ) ( ( 0.0520833320915699 0 63.375 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
// primitive 5
{
brushDef3
{
( 0 0 1 -152 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 1 0 -96 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 0 -1 -64 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 0 -1 0 -128 ) ( ( 0.0520833320915699 0 63.375 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( -1 0 0 -144 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 0 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
( 1 0 0 136 ) ( ( 0.0520833320915699 0 0 ) ( 0 0.0520833320915699 4.583333015441895 ) ) "textures/darkmod/stone/brick/blocks_brown" 0 0 0
}
}
}
// entity 1
{
"classname" "info_player_start"
"name" "info_player_start_1"
"origin" "-104 -96 -56"
"angle" "90.000000"
}
// entity 2
{
"classname" "path_corner"
"name" "path_corner_1"
"origin" "-112 64 -56"
"target0" "path_corner_2"
}
// entity 3
{
"classname" "path_corner"
"name" "path_corner_2"
"origin" "120 64 -56"
"target0" "path_corner_3"
}
// entity 4
{
"classname" "path_corner"
"name" "path_corner_3"
"origin" "120 -96 -56"
"target0" "path_corner_1"
}
// entity 5
{
"classname" "atdm:teleport"
"name" "atdm_teleport_1"
"origin" "96 -96 -56"
"target0" "path_corner_2"
}
// entity 6
{
"classname" "atdm:switch_flip"
"name" "atdm_switch_flip_1"
"origin" "-126.725 -24.9769 -16"
"rotation" "0 -1 0 1 0 0 0 0 1"
"rotate" "0 0 45"
"target0" "atdm_teleport_1"
}
// entity 7
{
"classname" "light"
"name" "light_1"
"origin" "8 -16 88"
"light_center" "0 0 0"
"light_radius" "320 320 320"
}
// entity 8
{
"classname" "atdm:ai_citywatch"
"name" "atdm_ai_citywatch_1"
"origin" "-16 -96 -47.9446"
"rotation" "1 0 0 0 1 0 0 0 1"
"team" "0"
"target0" "path_corner_1"
}

 

  • Like 1

Share this post


Link to post
Share on other sites
8 hours ago, Springheel said:

I just tried it in a testmap and it worked fine.  Save the following as a .map file.  The citywatch will patrol to three of the 4 corners.  Flip the switch and one corner will be teleported so that he now only patrols to 2 corners.

Yeah this works, but this is a one way solution. What I need is that the guard would resume his original route when using the switch once again (because, for example, through afresh flipping of the switch, the trap door closes and the area above it is accessable once again)

Share this post


Link to post
Share on other sites
3 hours ago, JackFarmer said:

Yeah this works, but this is a one way solution. What I need is that the guard would resume his original route when using the switch once again (because, for example, through afresh flipping of the switch, the trap door closes and the area above it is accessable once again)

 

You didn't mention that in your original request.  That changes things.

What I would try in that case is creating an invisible door entity below the map that slides "open" and closed" when triggered.  The pathnode can be def_attached to the door entity, allowing it to move from one position to another.  I can't confirm that the pathnode will slide through walls, but I don't see why it wouldn't.

 

 

 

Share this post


Link to post
Share on other sites
4 minutes ago, Springheel said:

 

You didn't mention that in your original request.  That changes things.

What I would try in that case is creating an invisible door entity below the map that slides "open" and closed" when triggered.  The pathnode can be def_attached to the door entity, allowing it to move from one position to another.  I can't confirm that the pathnode will slide through walls, but I don't see why it wouldn't.

 

 

 

You are right, sorry; I forgot to mention that.

I have already tried someting like that with the "bind" command. I will give this another try before I go public.

Share this post


Link to post
Share on other sites

You'd have to make sure the pathnode is resting on or close to the ground in both positions, but it should work.  Bind is probably the correct method.

Share this post


Link to post
Share on other sites

Hello Springheel,

You are right, I have tried this once again and now it works as I always wanted it.

Thank you very much for your help!

I will adjust this for the two locations in question....and then I will post a release thread.

Jack

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...