Chessnut / NutScript

A free role-play framework for Garry's Mod.
http://nutscript.rocks
MIT License
94 stars 77 forks source link

Can't type into text boxes, text boxes name coming up differently, config blank #676

Closed virtualFear closed 7 years ago

virtualFear commented 8 years ago

Hi all,

An issue just came up on my server recently which I'm not quite sure how to go about. Text boxes on the server are coming up blank despite there being stuff in them (on server config, typing into a box brings up a notification that it's been changed but it's still blank), players can't type into the blank text boxes (tested on character creation and chardesc) and the fields in text boxes comes up differently (/chardesc comes up as "chgDesc" and "chgDescDesc", screenshot here.

While I'm here, I was having an issue where when I altered the config it would change back straight away (tried to change chat distance and the server music, both changed back almost straight away and no changes carried), although that's much less important.

Thanks in advance

Rubberbandits commented 8 years ago

you're fucked gmod update broke the entire gamemode. chessnut is no where to be seen so do not count on an update.

On Fri, Apr 29, 2016 at 8:40 PM, virtualFear notifications@github.com wrote:

Hi all,

An issue just came up on my server recently which I'm not quite sure how to go about. Text boxes on the server are coming up blank despite there being stuff in them (on server config, typing into a box brings up a notification that it's been changed but it's still blank), players can't type into the blank text boxes (tested on character creation and chardesc) and the fields in text boxes comes up differently (/chardesc comes up as "chgDesc" and "chgDescDesc", screenshot here. http://steamcommunity.com/sharedfiles/filedetails/?id=675480740

While I'm here, I was having an issue where when I altered the config it would change back straight away (tried to change chat distance and the server music, both changed back almost straight away and no changes carried), although that's much less important.

Thanks in advance

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/Chessnut/NutScript/issues/676

GoproMgH commented 8 years ago

not true hes just a busy man and the gamemode is still working for me

Cyumus commented 8 years ago

Try adding a SetZPos to the textEntry. The text seems to have been written behind the panel. If this doesn't work, try changing the font and size of the text to default.

benmort38 commented 8 years ago

Could you give an example code?

Cyumus commented 8 years ago

Of course. That's an example using the gamemode/core/derma/cl_business.lua file. If you modified something from that file, be aware to backup it.

self:SetZPos(1)

self.search = self:Add("DTextEntry")
self.search:Dock(TOP)
self.search:SetTall(36)
self.search:SetFont("nutMediumFont")
self.search:DockMargin(10 + self:GetWide() * 0.35, 0, 5, 5)
self.search:SetZPos(2)

Lower values of ZPos will appear behind higher ones.

If the code above doesn't work, change the font like:

self.search = self:Add("DTextEntry")
self.search:Dock(TOP)
self.search:SetTall(36)
self.search:SetFont("Arial")
self.search:DockMargin(10 + self:GetWide() * 0.35, 0, 5, 5)

If it still doesn't work, comment below and when I have time I'll look it carefully.

benmort38 commented 8 years ago

Page not found, but I'll try this out. Thank you so much

Also I should mention that I use nutscript 1.0 because 1.1 was not working on my server

Also, seeing as this also does it to me on my ulx menu, what would the default font be?

benmort38 commented 8 years ago

Just tried changing the font, didn't seem to fix it, I'll keep looking

Cyumus commented 8 years ago

NS1.0 is outdated. I highly recommend you, first of all, to backup all your files. Then, update your GarrysModDS and NutScript to the last version.

If you don't want (or you can't) to update your GmodDS and NS, give me a moment to mount all the gamemode of NS1.0 and see if it happens to me, too.

benmort38 commented 8 years ago

I tried using nutscript 1.1 and it bugged out all the weapon holdtypes. People would hold their guns like fists and punch whenever they shot. Couldn't get color correction to fix properly. I like nutscript 1.0 overall more.

Cyumus commented 8 years ago

Okay, then. I'll try to find out the problem by mounting NS1.0 in my server.

benmort38 commented 8 years ago

I don't know how I would go about putting that ZPos into NS 1.0, I'm somewhat new to all this. Also ulx has the same issue now.

benmort38 commented 8 years ago

Also if yours works please send me the link to the NS1.0 you're using

Cyumus commented 8 years ago

I tested NS1.0 with HL2RP schema and they work perfectly to me.

TextEntryTest1

TextEntryTest2

Ulx works, too. TextEntryTest3

I downloaded all files from here: HL2RP: https://github.com/Chessnut/hl2rp/archive/master.zip NS1.0: https://github.com/Chessnut/NutScript/archive/master.zip

Remake all changes you made and be careful when doing it, you can break the gamemode as has happened to you.

EDIT: Maybe you're using an 1.1 schema with a 1.0 framework...

benmort38 commented 8 years ago

Could it possibly be an addon? Seeing as it does it to ulx and nutscript, and I don't want to do that only to find it didn't work

Cyumus commented 8 years ago

Which schema are you using? I see that derma and I guess that is a NS1.1 schema, but you're using a NS1.0 framework... did you copied all NS1.1 styles to NS1.0 or are you using a NS1.1 schema on a NS1.0 framework?

benmort38 commented 8 years ago

What do you mean I'm using a NS1.1 schema? Where do you see that?

benmort38 commented 8 years ago

I just imported that framework and everything broke. Not sure what on earth happened there.

Couldn't include file 'nutscript\gamemode\cl_init.lua' (File not found) (@gamemodes/starwarsrp/gamemode/cl_init.lua (line 1))

Cyumus commented 8 years ago

As you can see in the screenshot, now I'm in a NS1.1 schema with the NS1.1 framework.

NS11proof

This style of frames are in NS1.1 schemas. Download this NS1.0 schema and check if all folders matches: https://github.com/Chessnut/hl2rp/archive/master.zip

GoproMgH commented 8 years ago

i have the same exact problem theres text but its invisible

benmort38 commented 8 years ago

Oh lol yeah I'm running a 1.1 schema on the 1.0 framework

benmort38 commented 8 years ago

Wait no I'm not even sure. Hang on

benmort38 commented 8 years ago

Everything is fixed, just gotta make it less depressing looking in the colors and I gotta fix the recognition. Thank you so much

Cyumus commented 8 years ago

I'm glad that it has been solved. ^^

benmort38 commented 8 years ago

Ahem, I'm very embarrassed to say this but I just put those into the server and nobody can see who anyone else is above their head, and same thing with the tab menu. "Unknown" with a skeleton

Cyumus commented 8 years ago

This is because you added the plugin 'recognize'. In NS1.0, unrecognize people is shown as skeletons in the scoreboard. Just type /recognize staring who you want to recognize and press Enter.

If you don't want that plugin, just disable it. I remember that there was an option on Settings in the F1 menu.

benmort38 commented 8 years ago

Apparently just removing it didn't work either. Let me look

benmort38 commented 8 years ago

I got it to work sort of. You can see the player's name in game.

However, if you are looking at the tab list, any new player, even when their class is changed, stays as unknown. I didn't see a disable setting in f1

benmort38 commented 8 years ago

I'm gonna try and just remove it altogether and see if that breaks anything. Hold tight

benmort38 commented 8 years ago

Yeah no, not working

Cyumus commented 8 years ago

Don't remove code as if they were LEGO blocks xD

Just change that function:

function PLUGIN:IsPlayerRecognized(client)
    if (client == LocalPlayer()) then
        return true
    end

    local localPlayer = LocalPlayer()
    if (IsValid(localPlayer) and localPlayer.character) then
        local recognized = localPlayer.character:GetData("recog", {})
        if (recognized[client.character:GetVar("id", 0)] == true) then
            return true
        end
    end
end

for that one:

function PLUGIN:IsPlayerRecognized(client)
    return true
end
Cyumus commented 8 years ago

That function is in the /plugins/recognition/sh_plugin.lua file.

benmort38 commented 8 years ago

I see that, how do I reverse it?

Cyumus commented 8 years ago

If you have the .zip, just download again all files you removed. Then go to nutscript/plugins/recognition, open the sh_plugin.lua file and change the function.

benmort38 commented 8 years ago

Right, but again, I'm a beginner at this. Could I just remove the function?

Cyumus commented 8 years ago

Yes, replace it. Just delete it and rewrite as said:

function PLUGIN:IsPlayerRecognized(client)
    return true
end

That will make everybody recognize each other.

Cyumus commented 8 years ago

Uh... I forgot that NS1.0 has too high coupling... there is a hook that doesn't work properly in clientside... maybe in the scoreboard derma... sorry...

I'm going to look for the file where is the 'if clause' that makes the difference between being recognized or not...

benmort38 commented 8 years ago

Yeah, thank you. I can't wait to hear back

Cyumus commented 8 years ago

Forgot what I said...

You can do it by editing the function... as you can see on these images.

Changing the return value to 'false':

function PLUGIN:IsPlayerRecognized(client)
    return false
end

In this case, even you won't recognize yourself, because to all cases, code won't show your real name and description. false

On the other hand, if you change the return value to 'true':

function PLUGIN:IsPlayerRecognized(client)
    return true
end

Everybody will recognize each other.

true

I thought that it didn't work because I tried it with bots. But a bot has no description, so... it was a misunderstanding. Sorry.

benmort38 commented 8 years ago

Mm, alright. one last question

benmort38 commented 8 years ago

I'm trying to make it look less like... well.... 1945. There is a color color correction. I tried to remove it by just copying and pasting the code of the non-depressing stuff, where it has:

color["$pp_colour_brightness"] = brightness * 1

I put it into the bottom line inside of the gamemode>core, but instead I get a ton of script errors, which makes no sense to me.

Cyumus commented 8 years ago

Do you mean these lines?

local color = {}
    color["$pp_colour_addr"] = 0
    color["$pp_colour_addg"] = 0
    color["$pp_colour_addb"] = 0
    color["$pp_colour_brightness"] = brightness * -1
    color["$pp_colour_contrast"] = 1.25
    color["$pp_colour_colour"] = math.Clamp(0.7 - color2, 0, 1)
    color["$pp_colour_mulr"] = 0
    color["$pp_colour_mulg"] = 0
    color["$pp_colour_mulb"] = 0
benmort38 commented 8 years ago

Yeah. I changed the brightness to say * 1 on the top line and it fixed the color for a minute, so I decided to add it to the bottom line and then it broke the server...

benmort38 commented 8 years ago

Do you have any clue how to make it colorful now or will I have to live in a depressing world?

Cyumus commented 8 years ago

Of course it breaks... see what happens:

local brightness = 0.01 // In this line, you initialize and declare the brightness variable
local color2 = 0.25
local curTime = CurTime() // CurTime means 'Current Time', so curTime contains the value of 'now'.

if (nut.fadeStart and nut.fadeFinish) then
    brightness = 1 - math.TimeFraction(nut.fadeStart, nut.fadeFinish, curTime)
       // This formula means that the brightness equals 1 (the maximun value of brightness), minus the 
// time fraction of 'now' between the time that the fade starts and the time that the fade ends. 
// For example: time.TimeFraction(0,2,1) will return 0.5, that means that 1 is exactly between 0 and
// 2. time.TimeFraction(1,3,2) will return 0.5, too; time.TimeFraction(0,10,10) will return 1, and so on.
// That means that "brightness" will change progressively as time passes until it become 0 (means 'no change').

    if (curTime > nut.fadeFinish) then
        nut.fadeStart = nil
        nut.fadeFinish = nil
    end
end

if (nut.fadeColorStart and nut.fadeColorFinish) then
    color2 = (1 - math.TimeFraction(nut.fadeColorStart, nut.fadeColorFinish, curTime)) * 0.7

    if (curTime > nut.fadeColorFinish) then
        nut.fadeColorStart = nil
        nut.fadeColorFinish = nil
    end
end

local color = {}
color["$pp_colour_addr"] = 0
color["$pp_colour_addg"] = 0
color["$pp_colour_addb"] = 0
color["$pp_colour_brightness"] = brightness * -1 // That value become a negative number.
color["$pp_colour_contrast"] = 1.25
color["$pp_colour_colour"] = math.Clamp(0.7 - color2, 0, 1)
color["$pp_colour_mulr"] = 0
color["$pp_colour_mulg"] = 0
color["$pp_colour_mulb"] = 0

hook.Run("ModifyColorCorrection", color)

DrawColorModify(color) // And finally, that function will change the color on your screen using the 
// values in the color table. So, if you start in brightness = -1 (brightness = 1 - 0 -> 
// brightness = brightness * -1), you'll have a dark window, because brightness is a value between -1 
// and 1, meaning -1 the darkest and 1 the brightest. As time passes, negative brightness will 
// progressively been reduced until the TimeFraction returns 1, so that means that brightness = 1 - 1 
// -> brightness = 0 -> brightness = 0*-1 -> brightness = 0, so the window will have a normal 
// brightness.

This function is called every time.

If you want to change the style of the whole gamemode, you have to edit the nut.config.sadColors value to 'false', and then you'll have a normal brightness.

If you want a brightest GUI... then you must change the /nutscript/vignette.png file.

Cyumus commented 8 years ago

You can try to edit the HUDPaint() function by yourself to adjust the interface to your likes, but if you don't know how derma works, I don't recommend you do that.

benmort38 commented 8 years ago

where is the nut.config.sadColors located?

benmort38 commented 8 years ago

Ah, sweet, I got it working.

benmort38 commented 8 years ago

Also I found one issue with your schema. All of my guns do like 500 damage. What on earth is wrong with the damage multiplier lol

Cyumus commented 8 years ago

Do you mean this function?


function GM:ScalePlayerDamage(client, hitGroup, damageInfo)
    if (hitGroup < 2 and damageInfo:IsBulletDamage()) then
        damageInfo:ScaleDamage(10)
    elseif (limbs[hitGroup]) then
        damageInfo:ScaleDamage(0.75)
    end
end
benmort38 commented 8 years ago

Yes, where is that!