Jump to content
The Dark Mod Forums

Changing AI team relations during the game


joma

Recommended Posts

Hello everyone!

 

I've just joined the forum and this is is my first post. Before my question, I just want to say thanks to everyone who has helped making the MOD, it's amazing! And thanks to the mappers and everyone who has written tutorials and how to's. After seing Melan's massive effort on getting us newbies started (Fiasco at Fauchard St) I've decided to give mapping a go and I'm trying to get familiar with the editor. But I won't promise a mission just yet...

 

Now my question: I've followed the tutorial on editing AI Relations. I have a room with two AI from different teams and the player in the shadows. I want the AI to be initially neutral to each other, but when the player switches a lever, they start fighting each other.

 

I created an entity internal > atdm:team_relations where I make the teams neutral to each other. I also created a target entity target_tdm_setrelations that is triggered when the lever is switched, which changes the relation between teams (as explained in the tutorial).

 

I load my map and everything works fine (I can see that the relation between teams has changed after activating the lever with the console command tdm_ai_rel_print) but the AI won't start fighting each other until they become alert by something the player does (eg a noisemaker arrow).

 

It's like after loading the map nothing checks again what team the AI belong to, unless they get alert. Is there a way to make them realize they should fight?

 

Sorry for the long post, and thanks for any answers!

Link to comment
Share on other sites

First of all, welcome!

 

What I would do is the following.

Place the ai's.

Make them same team, like team 2.

Put in the map a prefab lever and a func_static. It could be any model for example.

Make the lever target the func_static.

Open the f_s in stim&response editor.

Add a response trigger and the effect should be change ai team or set team. Or something similar. Change the other ai into some team the other ai is hostile to. Like team 0.

Now the ai should start fighting. Be sure they are well lit. In my tests long ago the ai's were a bit sluggish to react to each other. You might want to make them bump into each other to make sure they start fighting. You could use the stim&resoponse system to give a ai who does not yet have a path_corner target a new target, which makes him to walk to a path_corner which force him to bump into the other guy.

 

Hope this helps..

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Welcome, joma!

 

As for your question, are the AI in the dark? They might simply not see each other.

 

Otherwise, it could be a bug, and that should be fixed. If it is really a bug that they do not become recognize each other until they get alerted, you might be able to workaround this by creating a small stim that fires between them and makes them alert. (I am unsure how to do this, tho as my experiences as mapper are really limited).

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Welcome, joma!

 

As for your question, are the AI in the dark? They might simply not see each other.

 

Thanks for the quick reply Tels! The AI are in the light, next to each other. They talk and all, so they are aware of each other. In fact, if I remove the 2 entities that manage the relations, they will start fighting as soon as the mission loads (because they are in different teams). So they can see each other, they just don't realize they've become enemies all of the sudden.

 

 

Otherwise, it could be a bug, and that should be fixed. If it is really a bug that they do not become recognize each other until they get alerted, you might be able to workaround this by creating a small stim that fires between them and makes them alert. (I am unsure how to do this, tho as my experiences as mapper are really limited).

 

Hmm, I wouldn't know how to do that either...

Link to comment
Share on other sites

Add a response trigger and the effect should be change ai team or set team. Or something similar. Change the other ai into some team the other ai is hostile to. Like team 0.

Now the ai should start fighting. Be sure they are well lit. In my tests long ago the ai's were a bit sluggish to react to each other. You might want to make them bump into each other to make sure they start fighting. You could use the stim&resoponse system to give a ai who does not yet have a path_corner target a new target, which makes him to walk to a path_corner which force him to bump into the other guy.

 

Hope this helps..

 

Thanks Sotha!

 

Right, so that would be more like making the AI change teams, rather than changing the relation between teams. I'll try that and see how I go!

Link to comment
Share on other sites

I tried Sotha's suggestion, but it works pretty much the same. After changing teams the AI really need to bump into each other to realize they are now hostile.

 

Moreover, if there's initially 3 AI from team A, and one of them changes to team B, he will only fight the AI from team A he bumped into, but will stay neutral to the other AI from team A.

Link to comment
Share on other sites

Yeah, that sounds familiar.

Team changed ai's are stranglely lazily identified as hostiles when they are in plain sight of other ai's.

 

I dunno why.

 

Could you help the thing by adding our new alarm entity.

Change ai team.

Ring the alarm entity which alerts all the ai who are present in you scene.

 

That might help the ai spot each other.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I tried Sotha's suggestion, but it works pretty much the same. After changing teams the AI really need to bump into each other to realize they are now hostile.

 

Moreover, if there's initially 3 AI from team A, and one of them changes to team B, he will only fight the AI from team A he bumped into, but will stay neutral to the other AI from team A.

 

That sounds like a serious bug, could you please add a tracker entry here (and include a small testmap)?

 

http://bugs.angua.at/view_all_bug_page.php

 

Thanx!

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

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.

  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...