Thread Tools Display Modes
04/23/14, 04:49 PM   #1
zireko
 
zireko's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 63
Simple Question about code.

I simply want to ask how I would get the frame rate to display in a small window? I currently have this small lua and I'm just trying to call a function. This is my first thing and I'm trying to play around with a very very simple addon. My lua code is listed below.

Lua Code:
  1. function GetFramerate(number)
  2. end

This is the only line of code I currently have and I'm not getting any lua error or anything. But it is not displaying anywhere. Do I need to make a frame for it to display in? If so how would I do that easy methods only please.
  Reply With Quote
04/23/14, 05:15 PM   #2
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
http://wiki.esoui.com/MyFirstAddon_tutorial
  Reply With Quote
04/23/14, 05:20 PM   #3
zireko
 
zireko's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 63
I have already done the tutorial. It is not very good at explaining how the lua works. I've been asking for youtube video tutorials for creation of a few simple mods and explanations of how things are working. The tutorial on wiki seems more for people that already know how to code.
  Reply With Quote
04/23/14, 05:36 PM   #4
Errc
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 30
If you have really done the tutorial then you would know that your code doesn't do anything... You declare a function and nothing else.

Take the tutorial and get that working, then modify parts of it to see what happens. Look at lua help online and try different things with the tutorial to see what breaks and what happens.

There is a ton of similar threads of "How do I code" on these forums, look for them.
  Reply With Quote
04/24/14, 10:13 AM   #5
Iyanga
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 183
Originally Posted by zireko View Post
I have already done the tutorial. It is not very good at explaining how the lua works. I've been asking for youtube video tutorials for creation of a few simple mods and explanations of how things are working. The tutorial on wiki seems more for people that already know how to code.

Yes, that's a reasonable prerequisite.

How the language itself works can be found here for example:
http://www.lua.org/manual/5.2/
  Reply With Quote
04/24/14, 10:29 AM   #6
ingeniousclown
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 122
I think the "easiest" method would be to just type "/fps" in your chat window...
  Reply With Quote
04/24/14, 11:20 AM   #7
archpoet
Cunning Linguist
 
archpoet's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 19
I agree with each of the replies in their own way.

OP should take one of the provided outs.
  Reply With Quote
04/23/14, 05:46 PM   #8
Joviex
 
Joviex's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 42
Originally Posted by zireko View Post
I simply want to ask how I would get the frame rate to display in a small window? I currently have this small lua and I'm just trying to call a function. This is my first thing and I'm trying to play around with a very very simple addon. My lua code is listed below.

Lua Code:
  1. function GetFramerate(number)
  2. end

This is the only line of code I currently have and I'm not getting any lua error or anything. But it is not displaying anywhere. Do I need to make a frame for it to display in? If so how would I do that easy methods only please.
The code above wont do anything because all you are doing is defining a new function called GetFramerate(paramter = number)


What you want to do is "CALL" the function GetFramerate, not re-define it.


e.g.


fps = GetFramerate()
d(fps)


will display the framerate in the console.


For "constant" updating you would need to hook a callback, so, periodically it would call whatever function you want to perform some action, like, getting the framerate every 100 milliseconds, etc...


If you want to display it on more than the console output, yes, you would need to make a "frame" for it.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Simple Question about code.


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off