Jump to content
The Dark Mod Forums

Help with completing conversation


Springheel
 Share

Recommended Posts

I have two AI set up to begin the map stationary. When the player approaches them, it triggers a conversation, and at the end of that conversation, a changetarget command is given which gives the AI a patrol to follow. The mission requires them to start patrolling after the conversation.

 

Problem: if the conversation is interrupted by an alert, the AI never complete it and never trigger the changetarget command. Thus they don't get a path--after searching they return to their start positions and never move. This breaks the map.

 

How can I solve this problem? Is there a way to create a temporary objective that fails the mission if the player alerts the AI? I wouldn't want it to stay active once the convo was done, however.

Link to comment
Share on other sites

Couple different thoughts spring to mind. One, create an alert_idle_only pathway for them to follow once alerted.

 

Two, yes, you can have an Objective that fails when AI are alerted, and have the same thing that triggers the end of conversation trigger for it to be removed.

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

I had the exact same problem in Cleighmoor.

 

In my case, opening a door triggers a trigger_once ("A").

 

"A" targets the target_startconversation that starts the conversation.

 

"A" also targets a trigger_relay ("B"). This has a 2.5 minute delay on it, and is timed to fire after the conversation is over.

 

"B" targets a trigger_once ("C").

 

"C" targets the target_changetarget entities ("D" and "E"), one for each guard in the conversation.

 

In the conversation, after the exchanges are over and "D" and "E" are triggered to get the guards moving, the final step is to trigger a func_remove ("F").

 

"F" targets "C".

 

What happens when all goes well ...

 

The door triggers "A".

"A" triggers the conversation start.

"A" triggers "B" and "B" goes to sleep for 2.5 minutes.

The talking part of the conversation ends.

The conversation triggers "D" and "E" and the guards start their patrols.

The conversation triggers "F".

"F" removes "C".

At the 2.5 minute mark, "B" wakes up and tries to trigger "C", but "C" is gone, so nothing happens.

 

What happens when the conversation is interrupted ...

 

The door triggers "A".

"A" triggers the conversation start.

"A" triggers "B" and "B" goes to sleep for 2.5 minutes.

The talking part of the conversation begins, but the guards spot you.

The conversation is aborted.

The guards chase you around but you escape.

The guards return to their conversation marks and stand there.

At the 2.5 minute mark, "B" wakes up and triggers "C".

"C" triggers "D" and "E" and the guards start their patrols.

 

Problems? ...

 

If you drag out the chase beyond where "B" wakes up, what I hoped would happen was that the guards would be given their patrol targets, and they would eventually start patrolling when they were done with you. I never tested that part, assuming that 99% of the players would want to hear the conversation, and would sit still to let it finish.

 

You need to adjust the 2.5 minute delay so "B" doesn't wake up in the middle of the conversation. It also must be long enough to cover however long you think it'll take the player to evade the guards or put them out of commission.

Link to comment
Share on other sites

If they return to the convo position after alert, could you set up another trigger there where by upon returning from alert state they would trigger the convo again?

 

They'd have to be inside it to begin with otherwise it might cause weird things, probably they start inside the target covo area using a trigger once? but if they move outside of it then it disables the trigger once with a script.

 

Gah, what I meant was a brush surrounded by a room brush or just 4 walls bound together so that if they leave the trigger area and then return, returning sets the trigger once to active again, using the new one.

 

I'm an amateur so that's all I can think of :P

 

I don't know if they can start inside a trigger once brush without setting it off though. I was guessing that the check was done when the boundries were crossed.

Edited by Lux
Link to comment
Share on other sites

Duh, much better thought, simply have an objective trigger your changetarget if those AI are alerted.

 

That way the mission doesn't fail, the player doesn't need to start over, things just carry on as you've already designed.

 

(You don't even need to make it temporary, since it'll have no ramification if your changetarget is redundant.)

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

I don't know if they can start inside a trigger once brush without setting it off though. I was guessing that the check was done when the boundries were crossed.

 

For the record, a trigger brush checks its contents repeatedly. If it finds an entity touching it, and it's the correct entity, then it fires and deletes itself from the game.

 

So starting a guard inside a trigger brush that's looking for that guard will fire the trigger.

Link to comment
Share on other sites

*updates the Triggers wiki page to read "within the bounds", instead of "enters the bounds"

 

Awesome info, thanks for the clarification!

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

@grayman -- thanks, good to know. So in that case you could just put a bounding box around their convo area which triggers a teleport script that would delay a bit and then insert a second trigger_once in their convo area after they've left it. Upon returning it would be there to trigger a script that checks their awareness state, and if they were calm... the convo?

 

EDIT: I guess this might break if their search pattern led them back through the area, though would the convo pull them out of their search state? Which would take precedence?

Edited by Lux
Link to comment
Share on other sites

...would the convo pull them out of their search state? Which would take precedence?

It would not, searching/fighting overrides conversing. (I'm not sure about fleeing/cowering though, presumably they take priority too.)

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

Making some progress. What I've done is this:

 

1. Make an invisible objective --> alert Bob

2. If successful, it triggers a relay that fires the changetarget entity.

3. If their conversation completes, conversation triggers a func_remove that removes the relay.

 

This way, if the player alerts Bob before he completes the conversation, he's given his new target and will start pathing when his search is done. This part seems to work.

If the player doesn't alert Bob, the trigger_relay is deleted at the end of the conversation so completing the "alert Bob" objective after that has no result (haven't tested this yet).

 

Is there a way to remove objectives that are no longer needed?

 

Also, can I make new objectives that become active with a trigger? I'd like to use this same trick for a conversation later in the game, but I don't want the objective active until the conversation begins.

 

(can anyone confirm that it's alert lvl 3 that breaks a conversation?)

Link to comment
Share on other sites

Sounds good.

 

Also, can I make new objectives that appear with a trigger? I'd like to use this same trick for a conversation later in the game, but I don't want the objective active until the conversation begins.

 

Yes, atdm:target_setobjective_visibility is what you want, I used it heavily in Inn Business. Just give it the number of the objective and remember to not change objective numbers in the future (without updating the target)!

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

Doesnt that just affect visibility? I don't want it to become visible at all. I would like it to be completely inactive until a set point, and then have become active but invisible.

Link to comment
Share on other sites

Ah, yes, that "appear" is misleading. I'll change it.

 

How would atdm:target_setobjective_state work? Could I start the objective as already filled, then set it to unfilled when the second conversation begins? If it starts as filled, won't it fire its success target?

Link to comment
Share on other sites

Where are target_setobjective_states explained? I've done some searching and found there apparently is a number of "invalid" which might be what I want, but I can't find where the numbers are explained.

Link to comment
Share on other sites

How would atdm:target_setobjective_state work? Could I start the objective as already filled, then set it to unfilled when the second conversation begins? If it starts as filled, won't it fire its success target?

 

Yes, you can start it filled/checked then uncheck it. The spawnarg pop-up shows the numbers associated with each possible objective state in the editor drop-down. Typically if an objective starts off complete, it wouldn't have a success target, but a failure target instead.

 

I've never tried setting up an objective that starts completed with a completion target.

 

You may also decouple the behind the scenes working objective (non-visible), from the displayed objective. This way you can show what you want, when you want, entirely separately from when things are actually completed/failed/triggered.

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

Where are target_setobjective_states explained? I've done some searching and found there apparently is a number of "invalid" which might be what I want, but I can't find where the numbers are explained.

 

Nowhere that I know of. They are mentioned in DR, the wiki Objectives and Objectives Editor pages, but not explained.

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
Share on other sites

I just did a test, and invalid seems to be what I want...it keeps the objective from ticking off.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Damn, I thought I had this working the way I wanted.

 

The Leader is blocked by a func_static monsterclip barrier, and the follower walks into the trigger_entity_multiple brush and fires the conversation repeatedly. At the end of each conversation, the Leader takes a few steps to try and get to his next pathnode, but since he can't, the conversation fires again and away they go. This is supposed to continue until a trigger removes the obstacle so the Leader can proceed to his next pathnode.

 

Problem is, after a random number of firings (I've observed from 3 to 6 thus far), the Leader starts pathing directly into the wall (and thus far, always the same spot) for an extended period of time, and after this, no more conversations are played. He eventually stops walking into the wall and walks all over the place in the room trying to get to his next pathnode, but for some reason the conversation never resumes. The Follower seems to be still inside the trigger, so it still should be firing.

 

I need some tools to debug this problem. I can't tell if the trigger has disappeared, or if the Leader is trying to get to a spot to engage in conversation but can't, or what. Any suggestions of spawnargs that might be useful? Is there something that tells what an AI is actually trying to do at that moment?

Link to comment
Share on other sites

seta tdm_ai_showtasks "1"

seta tdm_ai_showgoalpos "1"

seta tdm_ai_showdest "1"

 

Those might give you a clue as to where he's headed and if he's involved in a task (opening door, using elevator, etc.)

 

There's a general cvar ...

 

seta tdm_ai_debug "1"

 

... that might give us some non-visual clues (written to Darkmod.log), but understanding what they're saying prolly involves reading the code.

 

I'd need to see the map and the situation to help any further.

Link to comment
Share on other sites

I don't suppose there's a cvar that tells you what triggers are being fired? The behaviour I'm seeing looks very much like the trigger just stops firing, but that shouldn't be happening. I'm not aware of any way to check whether it is, however.

Link to comment
Share on other sites

The behaviour I'm seeing looks very much like the trigger just stops firing, but that shouldn't be happening. I'm not aware of any way to check whether it is, however.

 

Give it an additional target, like a convenient light, which you'll see get toggled when the trigger fires.

"The measure of a man's character is what he would do if he knew he never would be found out."

- Baron Thomas Babington Macauley

Link to comment
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.

 Share

  • Recent Status Updates

    • STiFU

      Anyone here clocking in some times in Neon Light?
      · 0 replies
    • JackFarmer

      Boris Johnson's resignation does not change the fact that Australia is home to 29 million kangaroos and Wales has a population of just over three million.

      If the Australian kangaroos were to invade Wales, one resident would have to fight almost ten kangaroos at a time.
      · 8 replies
    • peter_spy

      Deathloop – what a mess of a game. I'd love to see a post-mortem on it some day. I hope Arkane is doing okay though.
      · 27 replies
    • OrbWeaver

      I like house-cleaning and taking out the trash.
      · 3 replies
    • STiFU

      Be honest: Who of you have actually finished Cuphead? This game is freaking tough! It might even be harder than Sekiro. Dark Souls is a joke in comparison to Cuphead! :-D 
      · 8 replies
×
×
  • Create New...