Jump to content

interpolateBetween - Error Boolean


.:HyPeX:.

Recommended Posts

Posted (edited)

Well, my interpolate is giving boolean and stops working on one argument, the others just work fine..

but i cant get the value wich is failing..

Note that image one works pefrectly, while text doesnt.

    for a=1, 4 do 
    local nimage = "Image"..a 
    local ntext = "Text"..a 
        for c=1, 4 do 
        Dashboard.Positions.ImageNow[nimage][c] = interpolateBetween(Dashboard.Positions.ImageNow[nimage][c], 0,0, Dashboard.Positions.ImageStart[nimage][endx][c],0,0, progress, "Linear") 
        end 
        for b=2, 9 do 
        Dashboard.Positions.TextNow[ntext][b] = interpolateBetween(Dashboard.Positions.TextNow[ntext][b], 0,0, Dashboard.Positions.TextStart[ntext][endx][b],0,0, progress, "Linear") 
        end 
    end 

Table:

local Dashboard = { 
    Positions = { 
        ImageStart = { 
            Image1 = { 
                {0.2, 0, 1, 1, "Image1.jpg"}, 
                {0.2, 0, 1, 1, "Image1.jpg"}, 
                {0.2, 0, 1, 1, "Image1.jpg"}, 
                {0.2, 0, 1, 1, "Image1.jpg"}, 
                {0.2, 0, 1, 1, "Image1.jpg"} 
            }, 
            Image2 = { 
                {0.4, 0, 1, 1, "Image2.jpg"}, 
                {0.7, 0, 1, 1, "Image2.jpg"}, 
                {0.3, 0, 1, 1, "Image2.jpg"}, 
                {0.3, 0, 1, 1, "Image2.jpg"}, 
                {0.3, 0, 1, 1, "Image2.jpg"} 
            }, 
            Image3 = { 
                {0.6, 0, 1, 1, "Image3.jpg"}, 
                {0.8, 0, 1, 1, "Image3.jpg"}, 
                {0.8, 0, 1, 1, "Image3.jpg"}, 
                {0.4, 0, 1, 1, "Image3.jpg"}, 
                {0.4, 0, 1, 1, "Image3.jpg"} 
            }, 
            Image4 = { 
                {0.8, 0, 1, 1, "Image4.jpg"}, 
                {0.9, 0, 1, 1, "Image4.jpg"}, 
                {0.9, 0, 1, 1, "Image4.jpg"}, 
                {0.9, 0, 1, 1, "Image4.jpg"}, 
                {0.5, 0, 1, 1, "Image4.jpg"} 
            }, 
        }, 
        ImageNow = { 
            Image1 = {0.2, 0, 1, 1, "Image1.jpg"}, 
            Image2 = {0.4, 0, 1, 1, "Image2.jpg"}, 
            Image3 = {0.6, 0, 1, 1, "Image3.jpg"}, 
            Image4 = {0.8, 0, 1, 1, "Image4.jpg"}, 
        }, 
        TextStart = { 
            Text1 = { 
                {"Achivements", 0.21,0.8, 0.1,0.1,270, x * 0.05 + (x*0.2), y*0.85,255}, 
                {"Achivements", 0.21,0.8, 0.1,0.1,270, x * 0.05 + (x*0.2), y*0.85,0}, 
                {"Achivements", 0.21,0.8, 0.1,0.1,270, x * 0.05 + (x*0.2), y*0.85,255}, 
                {"Achivements", 0.21,0.8, 0.1,0.1,270, x * 0.05 + (x*0.2), y*0.85,255}, 
                {"Achivements", 0.21,0.8, 0.1,0.1,270, x * 0.05 + (x*0.2), y*0.85,255} 
            }, 
            Text2 = { 
                {"Rankings", 0.41, 0.8, 0.1,0.1, x * 0.05 + (x*0.4), y*0.85,255}, 
                {"Rankings", 0.71, 0.8, 0.1,0.1, x * 0.05 + (x*0.7), y*0.85,255}, 
                {"Rankings", 0.31, 0.8, 0.1,0.1, x * 0.05 + (x*0.3), y*0.85,0}, 
                {"Rankings", 0.31, 0.8, 0.1,0.1, x * 0.05 + (x*0.3), y*0.85,255}, 
                {"Rankings", 0.31, 0.8, 0.1,0.1, x * 0.05 + (x*0.3), y*0.85,255} 
            }, 
            Text3 = { 
                {"Tuning",0.61, 0.8, 0.1,0.1, x * 0.05 + (x*0.6), y*0.85,255}, 
                {"Tuning",0.81, 0.8, 0.1,0.1, x * 0.05 + (x*0.8 ), y*0.85,255}, 
                {"Tuning",0.81, 0.8, 0.1,0.1, x * 0.05 + (x*0.8 ), y*0.85,255}, 
                {"Tuning",0.41, 0.8, 0.1,0.1, x * 0.05 + (x*0.4), y*0.85,0}, 
                {"Tuning",0.41, 0.8, 0.1,0.1, x * 0.05 + (x*0.4), y*0.85,255} 
            }, 
            Text4 = { 
                {"Settings", 0.81, 0.8, 0.1,0.1, x * 0.05 + (x*0.8 ), y*0.85,255}, 
                {"Settings", 0.91, 0.8, 0.1,0.1, x * 0.05 + (x*0.9), y*0.85,255}, 
                {"Settings", 0.91, 0.8, 0.1,0.1, x * 0.05 + (x*0.9), y*0.85,255}, 
                {"Settings", 0.91, 0.8, 0.1,0.1, x * 0.05 + (x*0.9), y*0.85,255}, 
                {"Settings", 0.51, 0.8, 0.1,0.1, x * 0.05 + (x*0.5), y*0.85,0} 
            }, 
        }, 
        ImageNow = { 
            Image1 = {0.2, 0, 1, 1, "Image1.jpg"}, 
            Image2 = {0.4, 0, 1, 1, "Image2.jpg"}, 
            Image3 = {0.6, 0, 1, 1, "Image3.jpg"}, 
            Image4 = {0.8, 0, 1, 1, "Image4.jpg"}, 
        }, 
        TextNow = { 
            Text1 = {"Achivements", 0.21,0.8, 0.1,0.1,270, x * 0.05 + (x*0.2), y*0.85,255}, 
            Text2 = {"Rankings", 0.41, 0.8, 0.1,0.1,270, x * 0.05 + (x*0.4), y*0.85,255}, 
            Text3 = {"Tuning",0.61, 0.8, 0.1,0.1,270, x * 0.05 + (x*0.6), y*0.85,255}, 
            Text4 = {"Settings", 0.81, 0.8, 0.1,0.1,270, x * 0.05 + (x*0.8 ), y*0.85,255}, 
        }, 
    }, 
    CurentSelected = 0, 
    rankings = { 
        labels = { 
            "Kills", 
            "Deaths", 
            "Headshots", 
            "PlayTime", 
            "EXP", 
            "Level", 
            "Rank",            
        }, 
        currentTop = "Kills", 
        current = 1,  
        labelsData = { 
        "Kills", 
        "Deaths", 
        "PlayTime", 
        "Headshots", 
        "EXP", 
        "Level", 
        "Rank", 
        }, 
        localLabel = {0,0,0,0,0,0,0}, 
        data = {0,0,0,0,0,0,0}, 
    }, 
  
  
} 

Edited by Guest

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

Posted

gui/client.lua:448: bad argument @'interpolateBetween' [expected number at argument at argument 1, got boolean]

Line 448 translates to line 8 on my pasted code up there.

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

Posted

EDIT: found out a number was missing in my tables, i only had edited one of them when i saw the error before :lol:

EG:

{"Tuning",0.61, 0.8, 0.1,0.1, x * 0.05 + (x*0.6), y*0.85,255},

--

{"Tuning",0.61, 0.8, 0.1,0.1,270, x * 0.05 + (x*0.6), y*0.85,255},

270 value was missing.

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

  • Moderators
Posted

Alright, nice you found yourself, because my mind was litteraly about to blow up to understand your code and spot the problem.

Happy coding !

The rEvolution is coming ...

Posted
Alright, nice you found yourself, because my mind was litteraly about to blow up to understand your code and spot the problem.

Happy coding !

To help you get it, imageStart/textStart table contains base positions according to 5 different possibilities to dxDrawImage and dxDrawText.

ImageNow/TextNow are variables wich are constantly being edited, and they go from one to another possible position with interpolateBetween.

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...