Scripts / Making my first script

Author
Message
Zitubia
14
Years of Service
User Offline
Joined: 27th Aug 2009
Location:
Posted: 10th Mar 2018 20:14
Hello, im fooling around and playing around with some lua scripting for the first time.

But i have a small problem.
Im making like a short cutscene with text boxes but for some reason it wont work.

This is my problem, seem to work on my other script i tried. but now i get "nil value" for getPlayerDistance
This is my first script im making from scratch.

all the panels and text positions are random right now, just want this to work and then tewaking can start.
Anyone have a clue?




PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 10th Mar 2018 20:51 Edited at: 10th Mar 2018 20:56
GetPlayerDistance

Lua is case sensitive.

Btw you can put all your text in a table like this:

Been there, done that, got all the T-Shirts!
PM
Zitubia
14
Years of Service
User Offline
Joined: 27th Aug 2009
Location:
Posted: 10th Mar 2018 20:56
Oh, derp. been looking at it for ages. thanks alot, but it dont seem to work as i planned it though. as soon as i press e all goes away., time for some overhauling.
PM
Zitubia
14
Years of Service
User Offline
Joined: 27th Aug 2009
Location:
Posted: 10th Mar 2018 21:15
Im not knowlegable in scripting, but how do i use that local messages code?
could you give me an example of how to use? would be so helpful
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 10th Mar 2018 23:27
Try the attached script.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Zitubia
14
Years of Service
User Offline
Joined: 27th Aug 2009
Location:
Posted: 11th Mar 2018 07:32
Wow, that worked, im gonna study this script in depth, and re-write it so I can try and learn something. I will def cred you if i ever get finnished, and everyone else that lend a hand.

- Zitubia
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 11th Mar 2018 15:02
A couple of enhancements I can think of, 1) Have the panel sized automatically to fit the size of the string and 2) If the string is greater than a certain size split it over two lines.

Have fun.


Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-04-24 15:58:07
Your offset time is: 2024-04-24 15:58:07