Jump to content
The Dark Mod Forums

Sotha's mapping thread


Sotha

Recommended Posts

So it needs a relay from conv to s & r? odd but probably the way it's set up.

 

Conv AI goes back to where he started. Sounds familar. I think in Alchemist instead I set up the jail escapee to re-target it him so he went to a new path point instead of an actual conv goto because if he successfully escaped ... then he came back to prison!

 

Seems there is some internal start origin that AI try to return to. Don't know if there any neat way to change that. Different workarounds but no crisp solution I know of. Might be worth browsing script events I suppose. Certainly AI do sometimes stop at other places permanently when you don't want them to! :laugh:

Link to comment
Share on other sites

Well in the script folder there's tdm_events and doom events and tdm_ai something or there is http://www.modwiki.net/wiki/Script_events_(Doom_3) or even google doom3 "return to origin" or something. Or maybe start him at the end point and teleport him at game start. I'm guessing here of course. Another possibility is two path_waits each with say 10 seconds that target each other then there is a change target entity to point the AI at those waits. He should wait there forever. Sometimes all you can do is improvise. I'll look again if you can't find a happy solution.

Link to comment
Share on other sites

Well in the script folder there's tdm_events and doom events and tdm_ai something or there is http://www.modwiki.n...events_(Doom_3) or even google doom3 "return to origin" or something. Or maybe start him at the end point and teleport him at game start. I'm guessing here of course. Another possibility is two path_waits each with say 10 seconds that target each other then there is a change target entity to point the AI at those waits. He should wait there forever. Sometimes all you can do is improvise. I'll look again if you can't find a happy solution.

 

Thanks for helping. I cannot use targets as I must save the target slot for later use. This is the thing that makes my situation particularily tricky. I ended up doing the teleport thing. It's not pretty (the AI suddenly jumps a few centimeters, sinks a bit into the ground and then becomes normal) but at least it works.

 

I think we really need the AI re-targetting feature, that would give 100% perfect control of AI's to the mappers. AI's could just change patrol paths at the mappers whim offering a myriad of possibilities. It's already on the wishlist, here: http://bugs.angua.at/view.php?id=2333

 

Just to make sure it is not forgotten. ;)

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Hey, what does an INVALID objective do? I search the wiki but could not find the answer.

 

In my map, I am setting an objective to invalid. There is a atdm:target_setobjective_state, which sets the objective number to state 2.

 

In game, in the objectives screen, which comes out by pressing O, the objective does not have any kind of tick. Like it was in the INCOMPLETE state. I am assuming that INVALID is supposed to tick the objective into a state that it cannot be completed nor failed.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Yes, that's my guess too. I don't actually know but I suspect that 'invalid' is to prevent triggering. I think it might have been intended that when invisible and invalid that if completed by the player anyway it would not trigger. So it kind of enables/disables is my guess. A reversible invisible objective can be used for all kinds of non-objective tasks that need the diverse choices that the objectives system offers. But there might occasionally be situations when it wants disabling, perhaps temporarily.

 

Note, we already have a atdm:target_changetarget entity to change targets. :)

Link to comment
Share on other sites

Also note that a script can teleport more precisely to replace an existing AI or other entity. I did this in Heart with Sam but also see the script in Lockdown I did to switch the player tip. It gets the angle and position of the first entity, copies them to the other entity (which is a teleport) and removes the original.

 

 

Note, we already have a atdm:target_changetarget entity to change targets. :) Does that complete that bugtracker request or did it specifically need to be a script? I'd guess script can already change a target if there is an entity there is likely a script event?

Link to comment
Share on other sites

Note, we already have a atdm:target_changetarget entity to change targets. :) Does that complete that bugtracker request or did it specifically need to be a script? I'd guess script can already change a target if there is an entity there is likely a script event?

 

Nope. Last time I tested, the AI's cannot change their targets with any way once they've been given the initial target. target_changetarget did nothing, if I remember correctly. Also SR remove targets does nothing to AI.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Nope. Last time I tested, the AI's cannot change their targets with any way once they've been given the initial target. target_changetarget did nothing, if I remember correctly. Also SR remove targets does nothing to AI.

 

I looked now for quite some time int ai.cpp and there is a lot of code, and unfortunately, most of it is not really documented (oh, the code says what it does, but not why, and how that relates to anything).

 

For instance, there are "AddTarget" and "RemoveTarget" routines, but what exactly is their effect? I don't know :/

 

One thing that caught my eye were moveToPosition and moveToEntity.

 

The latter could be useful if you place a marker-entity in DR, the former if you want to type in the coordinates. Have you tried using these script events ala:

 

 $ai_name_here.moveToPosition("123,456,768");
 // or
 $ai_name_here.moveToEntity($player1); // or any other entity name

 

? You should technically do create this as "yourmap.script":

 

function moveTheAI ()
{
 $ai_name_here.moveToPosition("123,456,768");
}

 

Then place a atdm:target_callscriptfunction somewhere in your map and link it from any trigger and give it the spawnargs:

 

 "delay"      "0"         // after the trigger, wait so many seconds before the call is made (if you want a delay)
 "call"       "moveTheAI"

 

Edit: I think it should be possible to create an "atdm:ai_move_marker" entity that, if linked to one or more AI makes them go to this marker if the AI is triggered. But first try if this works at all please.

"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

Thanks Tels! That did the trick!

 

This does not work

function movezag()
{
$ai.moveToEntity($destination);

}

 

 

but this does:

void movezag()
{
$ai.moveToEntity($destination);

}

 

I can even do two levers, one of which makes the AI to walk to another place and stay there. Then when I pull the other lever the AI returns back to the original place and stays there. Works like a charm.

 

I tested it with a cyclic patrol nodes. If the AI is targetted to walk to node1, which targets node2, which targets node1 again: the following thing happens:

  • Ai walks between the nodes.
  • If I pull the lever which orders the AI to walk to $destination, he indeed walks there, but then returns to the original patrol route between the nodes.

So all in all: this gives mappers greatly improved control over AI's. Very nice, now I don't have to do the ugly teleport trick. I got itching about all the cool things I can do with this. :wub:

 

But the mappers really, really need to have a way to clear AI targets, then there will be 100% control over AI's.

 

Thanks again, this is great!

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Thanks Tels! That did the trick!

 

This does not work

function movezag()
{
$ai.moveToEntity($destination);

}

 

 

but this does:

void movezag()
{
$ai.moveToEntity($destination);

}

 

I might be blind, but I can't see the difference between these :D Yeah, saw it now, I am now legally blind :o

 

As for patrol nodes, I suspected that the AI patrol route is not cleared, but so far I haven't found where it is initialized at all. If I find that place, it should be possible to change it (remove all old targets, add new patrol node as target) and then give you this as a new scriptEvent.

"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

So all in all: this gives mappers greatly improved control over AI's. Very nice, now I don't have to do the ugly teleport trick. I got itching about all the cool things I can do with this

 

Could you or Tels add this to the wiki somewhere under AI pathing? It sounds like something pretty important, but I haven't followed the whole conversation.

Link to comment
Share on other sites

Could you or Tels add this to the wiki somewhere under AI pathing? It sounds like something pretty important, but I haven't followed the whole conversation.

 

I can add it once I have again time, not today.

 

Hey, I spotted some kind of weirdness related to this. I did it first like this:

  • Inside a conversation, the last thing that happens in the conversation, I trigger a trigger_once.
  • This trigger once trigger a atdm:target_callscriptfunction, which calls the script which does a debug sys.println and gives the AI an entity to walk to.

This setup did *not* seem to work reliably. Sometimes it didn't work, sometimes it did. I cannot say why. I saw the console reporting that the script is running but the AI did not move!

 

When I tested this further I placed a switch which targets the same atdm:target_callscriptfunction so I can test firing the script. This lever ALWAYS works. There was not this strange unrealiablyness I saw with direct targetting.

 

So finally I ended up in a situation where the conversation targets a trigger_once which targets the switch, which targets the script call entity. Now it just works. I am puzzled why there was some problems with the other setup. Very strange.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Try this. On the Ai give it the spawnarg property:

 

snd_relaxed

- [hyphen]

 

If that doesn't work then you might need to create a new def in your def folder. Something like say, mymap.def containing (in this example the builder vocal set)

 

entityDef mymap_vocal_set_builder_no_idle_remarks

{

"inherit" "atdm:ai_vocal_set_builder_03_guard"

"snd_relaxed" ""

}

Link to comment
Share on other sites

Try this. On the Ai give it the spawnarg property:

 

snd_relaxed

- [hyphen]

 

If that doesn't work then you might need to create a new def in your def folder. Something like say, mymap.def containing (in this example the builder vocal set)

 

entityDef mymap_vocal_set_builder_no_idle_remarks

{

"inherit" "atdm:ai_vocal_set_builder_03_guard"

"snd_relaxed" ""

}

 

Thanks! "snd_relaxed" "-" didn't do the trick by I found a spawnarg method: idle_bark_interval_min and _max to high values like 6000. Seems to work.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I can add it once I have again time, not today.

 

Hey, I spotted some kind of weirdness related to this. I did it first like this:

  • Inside a conversation, the last thing that happens in the conversation, I trigger a trigger_once.
  • This trigger once trigger a atdm:target_callscriptfunction, which calls the script which does a debug sys.println and gives the AI an entity to walk to.

This setup did *not* seem to work reliably. Sometimes it didn't work, sometimes it did. I cannot say why. I saw the console reporting that the script is running but the AI did not move!

 

When I tested this further I placed a switch which targets the same atdm:target_callscriptfunction so I can test firing the script. This lever ALWAYS works. There was not this strange unrealiablyness I saw with direct targetting.

 

So finally I ended up in a situation where the conversation targets a trigger_once which targets the switch, which targets the script call entity. Now it just works. I am puzzled why there was some problems with the other setup. Very strange.

 

Should be tracked, is probably a racing condition? What happens if you add a "sys.wait(0.1)" or something before trying to move him?

"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

Could you or Tels add this to the wiki somewhere under AI pathing?

 

This is not related to path_nodes nor pathfinding per se. I started a new article AI Patrol, which tells lists the known methods how to move AI around. http://wiki.thedarkmod.com/index.php?title=AI_Patrol

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I have an object bound to an AI (bind+bindToJoint).

 

Can I have the object detach at will? How?

 

With scriping that should work:

 

$object_name.unbind();

"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

You can easily make it detach if the AI reaches a certain alert level, if that helps.

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

    • 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.
      · 5 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
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...