Scripts / [SOLVED] How to stop the patrol actions for a short time?-

Author
Message
Jnick
8
Years of Service
User Offline
Joined: 10th Feb 2016
Location: U.S.A.
Posted: 27th Mar 2023 17:18
I am working on a conversation script, but want the NPC to patrol when not being in the conversation. What flag do I set to stop the patrol action while speaking to the NPC and then turn the action back on?

The author of this post has marked a post as an answer.

Go to answer
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 27th Mar 2023 23:18
if you can use the behaviour editor you can swap scripts in there which will make it much easier, i.e. swap between stand and speak and the patrol logic
take a look at character_attack and the patrol behaviours for how to swap back and forth
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Jnick
8
Years of Service
User Offline
Joined: 10th Feb 2016
Location: U.S.A.
Posted: 28th Mar 2023 21:08 Edited at: 28th Mar 2023 23:21
The switch script does not work for what I want to do, I want to keep running the same script. I am currently working on a way to accomplish the function I am after. But ran into one other question.

In game guru an item had a name that could be referenced screen that looked like an EntityName[e] for objects and NPC's. In MAX an NPC has an "identity" it appears that this does not match up with the old EntityName[e]. How do you reference the identity of an NPC in script?
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 28th Mar 2023 22:50 Edited at: 28th Mar 2023 22:54
string = GetEntityName ( e ) -- will return the name of the entity specified by e
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Jnick
8
Years of Service
User Offline
Joined: 10th Feb 2016
Location: U.S.A.
Posted: 29th Mar 2023 18:28 Edited at: 31st Mar 2023 19:40
Worked out the pause and restart patrol in the conversation script I post

Attachments

Login to view attachments
PM
Jnick
8
Years of Service
User Offline
Joined: 10th Feb 2016
Location: U.S.A.
Posted: 31st Mar 2023 19:43
This post has been marked by the post author as the answer.
Here is a short version with just the distance tor talking used to switch between actions. Could be used with any trigger to make the switch between two actions.

Attachments

Login to view attachments
PM

Login to post a reply

Server time is: 2024-05-03 21:08:08
Your offset time is: 2024-05-03 21:08:08