LarryG on 5/9/2016 at 03:09
I am trying to set up a situation where the player lays down a trail of breadcrumbs (not really breadcrumbs, some things else, but I'll call them breadcrumbs to get my point across) from point A to point B in order to get an AI to follow the trail. My thought was that each breadcrumb would be a source of a BreadCrumbStim stimulus. The AI would have a receptron for BreadCrumbStim, and when a breadcrumb is deposited "close enough" to the AI, the receptron would tell the AI to go to the source of the stimulus. This would be accomplished by having the receptron bounce the BreadCrumbStim back to the source breadcrumb. The source breadcrumb would respond by triggering a conversation on itself, with the AI as Actor1 getting told to go to the breadcrumb, do some kind of motions and then delete the breadcrumb
I thought about using the tnhscript, FollowBreadCrumbs. But I can't figure out how to use it.
Quote:
Responds to the message <kbd style="font-family: Consolas, "Andale Mono WT", "Andale Mono", "Bitstream Vera Sans Mono", "Nimbus Mono L", Monaco, "Courier New", monospace; font-size: 14px; direction: ltr; color: rgb(51, 51, 51); box-shadow: rgb(204, 204, 204) 0px 0px 0.3em inset; border-radius: 2px; line-height: 19.6px; background-color: rgb(251, 250, 249);">Breadcrumb</kbd>. The AI will be directed to go to the object the message specifies. If the AI is at high alert, then nothing happens. The minimum alert level will be set to 1 for 5 seconds. [TABLE="class: inline, width: 50%]
<tbody>[TR="class: row0]
[TH="class: col0, bgcolor: #CCCCCC, align: left]Messages[/TH]
[TD="class: col1 leftalign, bgcolor: #EEEEEE]<kbd style="font-family: Consolas, "Andale Mono WT", "Andale Mono", "Bitstream Vera Sans Mono", "Nimbus Mono L", Monaco, "Courier New", monospace; font-size: 1em; direction: ltr; box-shadow: rgb(204, 204, 204) 0px 0px 0.3em inset; border-radius: 2px; background-color: rgb(251, 250, 249);">Breadcrumb</kbd>(<var style="font-family: Consolas, "Andale Mono WT", "Andale Mono", "Bitstream Vera Sans Mono", "Nimbus Mono L", Monaco, "Courier New", monospace; font-style: oblique;">data1=dest_obj</var>)[/TD]
[/TR]
</tbody>[/TABLE]
I think means that the parameter in the editor design note on the AI should actually be breadcrumb=dest_object, maybe, or that I should send the message "BreadCrumb" to the AI, with the destination object somehow pointed to in the message's ancillary data (?). But I don't know of a way to pack the object source id into the message. So maybe this script isn't all that useful for my needs.
So: Does anyone know how the FollowBreadCrumbs script is supposed to be used?
Any other ideas for how to get an AI to follow a series of breadcrumbs?
LarryG on 5/9/2016 at 06:36
Saw that. Does me no good. I don't want the AI following the player. I want the AI following the bread crumbs. Sure that sends the right message, but does me no good. The more I think about it the more I think the tnhscript's FollowBreadCrumbs is the not suited. I need the AI to do too much at each crumb. I need to use the conversation approach to do that. Thanks any.
R Soul on 5/9/2016 at 14:23
You can send the message with a conv/AIWatchObj link etc. Action: Script message, arg1: Breadcrumb, arg2: object ID (names don't work). When the AI reaches the object it gets an ObjActResult message.
I'm not sure how that's better than Go to object, which also allows object names.
LarryG on 5/9/2016 at 21:11
Yeah. I don't know how that would be better either. I'll see which works better in practice.
Nameless Voice on 5/9/2016 at 21:40
I think you'd be better off dynamically building a patrol route and having the AI patrol along it (restarting their patrol as necessary if a new crumb is added, and possibly automatically deleting old crumbs.)
Patrolling is really flexible and properly handles interruptions and save/reload.
R Soul on 5/9/2016 at 23:58
There must be some advantage of using FollowBreadcrumbs over Go to object, otherwise Telliamed wouldn't have written the script, but I agree with NV about using patrol routes. And now I want a sandwich.
LarryG on 6/9/2016 at 03:23
I'm not certain how to dynamically build a patrol route. Is there a tutorial or an example someplace I can look? I thought conversations handled interruptions and save reload. Each bread crumb would have its own small conversation. Just go to the crumb, eating motions, delete the crumb. If another crumb is near, repeat. If not, hang out.
LarryG on 6/9/2016 at 03:59
Hmm. I'm dynamically creating the breadcrumbs so that if the player wastes a few learning how to use them, they won't run out. But this also means that the breadcrumbs won't be named and their object id is not known ahead of time. And since they all have a combine type so that they will stack, dispensing them would have changed their names and ids anyhow. Is there a way to have a conversation do a goto for the object on which the conversation resides? would [Me] work? I need to target the ones that get dropped as they get dropped.
Nameless Voice on 6/9/2016 at 09:02
A blank line usually corresponds with "this object" IIRC, at least when using AIWatchObj.
To make a dynamic patrol, just build AIPatrol links.
You could have each breadcrumb add a metaproperty to itself, M-LastBreadcrumb, and link from the newly created to @M-LastBreadcrumb, then remove the metaproperty after linking.
(The order would be link to @M-LastBreadcrumb, remove M-LastBreadcrumb from @M-LastBreadcrumb, then add M-LastBreadcrumb to self. Finally, probably toggle the AI's patrollingness. Add AIWatchObj links to the crumb so that the AI knows what to do when they reach it.)