Scripts / [SOLVED] Need help and a possible bug report on script I'm working on

Author
Message
DarinM1967
6
Years of Service
User Offline
Joined: 1st Sep 2018
Location:
Posted: 15th Aug 2024 22:05
Hey, everybody! Hope ya'll are doing well. I decided to try to create Oblivion-like npc conversation script and having some really weird issues. I'm sure some of it is me, but also stumbled upon a reported and apparently not fixed bug with FreezePlayer too. This is my terrible attempt of modifying one of smallg's conversation with panel scripts. In a nutshell, when the player comes close to a npc that they can converse with, it should prompt them to press 'e' key, then the player is frozen (will be freezing all entities too, eventually) looking at the face of the npc. 2 panels will appear one with the npcs responses and another with choices of 1 or more responses for the player. Depending on which number the player presses the text in both panels will change to reflect their choice. The player at any time during the conversation, press 'e' to end conversation. If they press 'e' again within the range of the npc the conversation will restart from the beginning. Now, what my script is currently doing is if player presses '1' the conversation flys through the next conversation and ends at the last one in that branch as if the player pressed '1' twice. The same thing happens if the player presses '2', and runs off to a conversation that I haven't entered yet, leaving the player frozen with nothing to click except for the 'e' to end the conversation. It's like the game doesn't realize that the player only pressed either number once, but it could also be something I'm forgetting to add or something. The the FreezePlayer() bug make the player's view jump or turn, sometimes making them face the opposite of where they were facing. Anyway help with the scripting issue would be greatly appreciated and if I need to report the bug on another thread please let me know. Thanks in advance for any help, advice, or suggestions!

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

Go to answer

Attachments

Login to view attachments
PM
DarinM1967
6
Years of Service
User Offline
Joined: 1st Sep 2018
Location:
Posted: 16th Aug 2024 03:48
This post has been marked by the post author as the answer.
Update: Copilot (preview) was able to help me fix understand that the g_Inkey was being processed too fast and I needed to use another variable "choice_made" to add an additional layer to my choice conditionals. I've made the modifications, repeatedly tested and it appears to be working, except for the "FreezePlayer()" and "UnFreezePlayer()" possible bug. If anyone would test confirm that it is still a bug and if I need to either go and report it on "Product Chat", or send TGC an email, that would be great! Anyway, I have included the "fixed" script here so if anyone is interested in using it. I used some bits of Smallg's NPC conversation with panel, multi-branching conversation, and "freeze enemies in time" scripts to create this script so its his shoulder's I'm standing on. For the most part the npcs freeze, but if npcs are shooting (with or without adding the modified soldier.lua from "freeze enemies in time", so didn't use it) they will keep shooting until they need to reload then their freeze, so best make sure the player and conversing npcs are not in direct fire and everything should work okay. If I don't get any replies, I'll assume the TGC have been notified about the bug. Anyway, back to modding, and playtesting!

Attachments

Login to view attachments
PM

Login to post a reply

Server time is: 2024-09-09 07:12:56
Your offset time is: 2024-09-09 07:12:56