Skip to content

Conversation

@XCal-Dev
Copy link

Adds parameter for making the npc face player before initiating dialog.

makes it a bit more immersive and also drastically lowers the chance of seeing your character behind the ped you are talking to.

sorry if bad pull request new to this only the changes from 139-144.

Tested it and it works with the freeze option, shouldn't cause the ped to start twitching and ped resumes course after interaction has ended.

Adds parameter for making the npc face player before initiating dialog.
@XCal-Dev
Copy link
Author

exports['envi-interact']:PedInteraction(ped, { title = 'Greetings', speech = 'Hello there! Let\'s choose an option. What would you like to talk about?', menuID = 'npc-interaction', position = 'right', greeting = 'GENERIC_HI', focusCam = true, faceme = true, freeze = true, options = { { key = 'E', label = 'Talk', reaction = 'CHAT_STATE', selected = function(data) print('Initiating conversation...') exports['envi-interact']:CloseMenu(data.menuID) -- To close the current menu after interaction end, }, { key = 'I', label = 'Insult', reaction = 'GENERIC_SHOCKED_HIGH', selected = function(data) print('Insulting the ped...') exports['envi-interact']:CloseEverything() -- To close all menus and percentage bars after interaction end } } })

example code changed with new parameter above.

Copy link
Owner

@Envi-Scripts Envi-Scripts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good and is a nice touch, just for my own OCD - can we change the param name to turnToFace to make it more in line with the native and cleaner for others to understand and if possible add to the docs

@XCal-Dev
Copy link
Author

sorry for late reply not an issue but I need to work on it a bit more, isn't as good as it could be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants