Scripts / [SOLVED] Conversation script help with positioning text.

Author
Message
jjumisko
4
Years of Service
User Offline
Joined: 11th Dec 2019
Location: Los Angeles
Posted: 5th Jan 2020 23:30 Edited at: 5th Jan 2020 23:36
I want the conversation to display just below center screen. I positioned the convo(e) reply to the first question, but the NPC text still displays at the bottom of the screen. In fact, I would like ALL text to display at about y=65. Any help will be very appreciated! So far, I've gotten a ton of help from people here. Thanks in advance.

Acer Nitro 5
2.4 GHz Core i5
GeForce GTX1050
32Mb SDRAM

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

Go to answer
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 6th Jan 2020 04:32
This post has been marked by the post author as the answer.
It works as expected for me.
The only text at the bottom was the prompt,
If you want the prompt at the center of the screen, you would has to use TextCenterOnX function, insted of PrompDuration command.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 6th Jan 2020 09:27
You are using a prompt for the NPC text, prompts are hard coded and only appear in the bottom centre of the screen. You would need to use the text command on the NPC's line just like you have with your responses.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Primary Laptop:
i5, NV1050 4GB, 8GB memory, 1x 1TB HDD, Win10.

Secondary Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
jjumisko
4
Years of Service
User Offline
Joined: 11th Dec 2019
Location: Los Angeles
Posted: 15th Jan 2020 17:20 Edited at: 17th Jan 2020 16:20
Thanks to both of you. Sorry it took me so long to reply. Life got in the way of working on my game!

Totally worked to use the TextCenterOnX command (function? I still don't understand the difference) but I found I needed to add some timers for some simple responses. I got it up and running. Works great now. I feel like I can now have pretty complex conversations with NPCs now! Awesome.

Here's the script. I don't know who wrote it or I would give credit! My modifications.

Acer Nitro 5
2.4 GHz Core i5
GeForce GTX1050
32Mb SDRAM
PM
thatandplaygames
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location: In a creative space
Posted: 13th Feb 2020 14:33
No text is showing up for me.

GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 14th Feb 2020 05:08
Save that script into the scriptbank named conversation2.lua
Then assign it by properties into a map entity that is;
static=no
the script
always active = yes
PM
thatandplaygames
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location: In a creative space
Posted: 14th Feb 2020 15:59
Thank you. Does it need to be named conversation2.lua? I notice the function conversation2_init(e)

What if I wanted other characters to have a different conversation? Saving a new onversation1.lua and changing the function to conversation1_init(e) did not work.

Thanks!!
thatandplaygames
4
Years of Service
User Offline
Joined: 12th Feb 2020
Location: In a creative space
Posted: 14th Feb 2020 16:03
Thank you!
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 16th Feb 2020 22:14 Edited at: 16th Feb 2020 22:17
The name of the script MUST match the function names
minus the _init(e) or _main(e)
it MUST be lower case as well.
in other words, convo_withdraco.lua

BTW _init(e) and _main(e) MUST match also.
must have function convo_withdraco_init(e)
and function convo_withdraco _main(e)

New names with individual scripts are fine, just adhere to the rule above.
PM

Login to post a reply

Server time is: 2024-04-23 10:27:37
Your offset time is: 2024-04-23 10:27:37