• NutScript - Nutty name, serious framework
    2,778 replies, posted
[QUOTE=Johnny Guitar;44082554]what do you mean? after they spawn on that character?[/QUOTE] Yeah exactly that.
playerspawn hook?
if GM:PlayerInitialSpawn( %d+ ) then I think I got it wrong. Tried it, definitely wrong. [B]Edit:[/B] Well I'm sorry for not being able to code. -_-
Heights...It would be nice if people can edit their height. Next Response: DO IT URSELF My Response: Maybe.
[QUOTE=pilot;44087345]Heights...It would be nice if people can edit their height. Next Response: DO IT URSELF My Response: Maybe.[/QUOTE] Do you mean them being able to modify their own bones?
[QUOTE=imacc2009;44087966]Do you mean them being able to modify their own bones?[/QUOTE] Yeah I think he means that he wants to be able to add characteristics into the player creation e.g. small players and tall players (within reason) Probably because he's been looking into tiramisu lately.
[QUOTE=GTbrawlers;44089879]Yeah I think he means that he wants to be able to add characteristics into the player creation e.g. small players and tall players (within reason) Probably because he's been looking into tiramisu lately.[/QUOTE] I modified someone on my servers bones and I couldn't revert it back. He walked into the lab and crashed the ceiling.
[QUOTE=imacc2009;44082783]if GM:PlayerInitialSpawn( %d+ ) then I think I got it wrong. Tried it, definitely wrong. [B]Edit:[/B] Well I'm sorry for not being able to code. -_-[/QUOTE] If you know that you're not able to code, don't try to give people advice.
[QUOTE=freakyy;44090749]If you know that you're not able to code, don't try to give people advice.[/QUOTE] ... sometimes it works.
[QUOTE=GTbrawlers;44089879]Yeah I think he means that he wants to be able to add characteristics into the player creation e.g. small players and tall players (within reason) Probably because he's been looking into tiramisu lately.[/QUOTE] Tiramisu had nice qualities to it. I just feel bad this gold mine of opportunities is just lying there in waste.
[QUOTE=pilot;44090817]Tiramisu had nice qualities to it. I just feel bad this gold mine of opportunities is just lying there in waste.[/QUOTE] Then dig it yourself and get the gold.
Hi I've been trying to create a plugin called "gas area" but I can't get the plugins finished (too many problems). If someone could be nice enough to try to develop the plugin for NutScript I would be grateful. This explains what the plugin must do a little bit: When you enter in a gased area, your level of Oxygen will decrease. When your level of Oxygen reaches 0, your character will lose health until death.
[QUOTE=imacc2009;44090510]I modified someone on my servers bones and I couldn't revert it back. He walked into the lab and crashed the ceiling.[/QUOTE] Once you reconnect your bones should revert. I've done this before. [QUOTE=Shayco;44091173]Hi I've been trying to create a plugin called "gas area" but I can't get the plugins finished (too many problems). If someone could be nice enough to try to develop the plugin for NutScript I would be grateful.[/QUOTE] That lack of information on what this is at all. ggwp 10/10
[QUOTE=imacc2009;44090832]Then dig it yourself and get the gold.[/QUOTE] Of course, and I've been trying to do this. I just hit walls every few often. Nothing peculiar.
I think porting stuff from Tiramisu would be great as that framework had potential but it was never followed up and I actually hated working with it / playing it. Also as for the gas area plugin, can't you just edit the radiation area one?
Making a Schema right now
Hi, I've recently put nutscript on my private server and I'm a noob coder, literally the only coding I've ever done is when I edit some files in NutScript. But anyways, I can't seem to get the color correction to go away, even after setting the option to false. Is there something else I must do to get rid of it?
Blazer lol thats not the color correction your talking about go into nutscript/gamemode/core/cl_hooks.lua and replace everything with this [code]-- Auto-reload will remove the variable if it doesn't get reset. nut.loaded = nut.loaded or false nut.loadingText = nut.loadingText or {} local surface = surface local draw = draw local pairs = pairs local nut = nut function GM:HUDShouldDraw(element) if (element == "CHudHealth" or element == "CHudBattery" or element == "CHudAmmo" or element == "CHudSecondaryAmmo") then return false end if (element == "CHudCrosshair") then return false end return true end local OUTLINE_COLOR = Color(0, 0, 0, 250) local math_Clamp = math.Clamp function GM:PaintBar(value, color, x, y, width, height) color.a = 205 draw.RoundedBox(2, x, y, width, height, OUTLINE_COLOR) width = width * (math_Clamp(value, 0, 100) / 100) - 2 if (width > 0) then surface.SetDrawColor(color) surface.DrawRect(x + 1, y + 1, width, height - 2) surface.SetDrawColor(255, 255, 255, 50) surface.DrawOutlinedRect(x + 1, y + 1, width, height - 2) end return y - height - 2 end local NUT_CVAR_BWIDTH = CreateClientConVar("nut_barwscale", "0.27", true) local NUT_CVAR_BHEIGHT = CreateClientConVar("nut_barh", "10", true) local BAR_WIDTH, BAR_HEIGHT = ScrW() * NUT_CVAR_BWIDTH:GetFloat(), NUT_CVAR_BHEIGHT:GetInt() local lastFPS = 0 local avgFPS = 0 cvars.AddChangeCallback("nut_barwscale", function(conVar, oldValue, value) if (NUT_CVAR_BWIDTH:GetFloat() == 0) then BAR_WIDTH = 0 else BAR_WIDTH = math.max(ScrW() * NUT_CVAR_BWIDTH:GetFloat(), 8) end end) cvars.AddChangeCallback("nut_barh", function(conVar, oldValue, value) BAR_HEIGHT = math.max(NUT_CVAR_BHEIGHT:GetInt(), 3) end) local vignette = Material("nutscript/vignette.png") local vignetteAlpha = 0 local DrawRect = surface.DrawRect local SetDrawColor = surface.SetDrawColor local SetDrawMaterial = surface.SetMaterial local logo = Material("shg/logo.png") local glow = Material("shg/logo_glow.png") nut.loadAlpha = nut.loadAlpha or 0 nut.loadScreenAlpha = nut.loadScreenAlpha or 255 function GM:PostRenderVGUI() if (!gui.IsGameUIVisible() and nut.loadScreenAlpha > 0) then local scrW, scrH = surface.ScreenWidth(), surface.ScreenHeight() local goal = 0 if (nut.loaded) then goal = 255 end nut.loadAlpha = math.Approach(nut.loadAlpha, goal, FrameTime() * 60) if (nut.loadAlpha == 255 and goal == 255) then if (nut.loadScreenAlpha == 255) then LocalPlayer():EmitSound("friends/friend_online.wav", 160, 51) end nut.loadScreenAlpha = math.Approach(nut.loadScreenAlpha, 0, FrameTime() * 60) end local alpha = nut.loadScreenAlpha if (alpha > 0) then SetDrawColor(10, 10, 14, alpha) DrawRect(0, 0, scrW, scrH) local x, y, w, h = scrW*0.5 - 128, scrH*0.4 - 128, 256, 256 surface.SetDrawColor(255, 255, 255, alpha) surface.SetMaterial(logo) surface.DrawTexturedRect(x, y, w, h) surface.SetDrawColor(255, 255, 255, (nut.loadAlpha/255 * 150 + math.sin(RealTime() * 2)*25) * (alpha / 255)) surface.SetMaterial(glow) surface.DrawTexturedRect(x, y, w, h) for i = #nut.loadingText, 1, -1 do local alpha2 = (1-i / #nut.loadingText) * alpha draw.SimpleText(nut.loadingText[i], "nut_TargetFont", scrW * 0.5, scrH * 0.6 + (i * 36), Color(255, 255, 255, alpha2), 1, 1) end nut.schema.Call("DrawLoadingScreen") do return end end end end local DrawOutlinedRect = surface.DrawOutlinedRect function GM:HUDPaint() local client = LocalPlayer() local scrW, scrH = surface.ScreenWidth(), surface.ScreenHeight() if (nut.config.drawVignette) then local alpha = 240 local data = {} data.start = client:GetPos() data.endpos = data.start + Vector(0, 0, 1000) local trace = util.TraceLine(data) if (!trace.Hit or trace.HitSky) then alpha = 125 end vignetteAlpha = math.Approach(vignetteAlpha, alpha, FrameTime() * 75) SetDrawColor(255, 255, 255, vignetteAlpha) SetDrawMaterial(vignette) surface.DrawTexturedRect(0, 0, scrW, scrH) end if (IsValid(nut.gui.charMenu)) then return end nut.scroll.Paint() if (nut.fadeStart and nut.fadeFinish) then local fraction = 255 - (math.TimeFraction(nut.fadeStart, nut.fadeFinish, CurTime()) * 255) local color = Color(255, 255, 255, fraction) local bigTitle = nut.config.bigIntroText or SCHEMA.name surface.SetFont("nut_TitleFont") local _, h = surface.GetTextSize(bigTitle) draw.SimpleText(bigTitle, "nut_TitleFont", scrW * 0.5, scrH * 0.35, color, 1, 1) draw.SimpleText(nut.config.smallIntroText or SCHEMA.desc, "nut_TargetFont", scrW * 0.5, (scrH * 0.35) + h, color, 1, 1) return end local entity = client:GetEyeTraceNoCursor().Entity nut.schema.Call("HUDPaintTargetID", entity) if (nut.schema.Call("ShouldDrawCrosshair") != false and nut.config.crosshair) then local x, y = scrW * 0.5 - 2, scrH * 0.5 - 2 local size = nut.config.crossSize or 1 local size2 = size + 2 local spacing = nut.config.crossSpacing or 5 local alpha = nut.config.crossAlpha or 150 SetDrawColor(25, 25, 25, alpha) DrawOutlinedRect(x-1 - spacing, y-1 - spacing, size2, size2) DrawOutlinedRect(x-1 + spacing, y-1 - spacing, size2, size2) DrawOutlinedRect(x-1 - spacing, y-1 + spacing, size2, size2) DrawOutlinedRect(x-1 + spacing, y-1 + spacing, size2, size2) SetDrawColor(230, 230, 230, alpha) DrawRect(x - spacing, y - spacing, size, size) DrawRect(x + spacing, y - spacing, size, size) DrawRect(x - spacing, y + spacing, size, size) DrawRect(x + spacing, y + spacing, size, size) end if (client:GetNetVar("tied")) then nut.util.DrawText(scrW * 0.5, scrH * 0.25, "You have been tied.") end local x = 8 local y = scrH - BAR_HEIGHT - 8 y = nut.bar.Paint(x, y, BAR_WIDTH, BAR_HEIGHT) nut.bar.PaintMain() end function GM:ShouldDrawTargetEntity(entity) return false end function GM:PostProcessPermitted(element) return false end function GM:CreateSideMenu(menu) if (nut.config.showTime) then menu.time = menu:Add("DLabel") menu.time:Dock(TOP) menu.time.Think = function(label) label:SetText(os.date("!%c", nut.util.GetTime())) end menu.time:SetContentAlignment(6) menu.time:SetTextColor(color_white) menu.time:SetExpensiveShadow(1, color_black) menu.time:SetFont("nut_TargetFont") menu.time:DockMargin(4, 4, 4, 4) end if (nut.config.showMoney and nut.currency.IsSet()) then menu.money = menu:Add("DLabel") menu.money:Dock(TOP) menu.money.Think = function(label) label:SetText(nut.currency.GetName(LocalPlayer():GetMoney(), true) or "Unknown") end menu.money:SetContentAlignment(6) menu.money:SetTextColor(color_white) menu.money:SetExpensiveShadow(1, color_black) menu.money:SetFont("nut_TargetFont") menu.money:DockMargin(4, 4, 4, 4) end end local deltaAngle local sin, cos = math.sin, math.cos function GM:CalcView(client, origin, angles, fov) local view = self.BaseClass:CalcView(client, origin, angles, fov) local drunk = client:GetNetVar("drunk", 0) local realTime = RealTime() if (drunk > 0) then deltaAngle = LerpAngle(math.max(0.8 - drunk, 0.025), deltaAngle or angles, angles) view.angles = deltaAngle + Angle(cos(realTime * 0.9) * drunk*4, sin(realTime * 0.9) * drunk*7.5, cos(realTime * 0.9) * drunk*5) view.fov = fov + sin(realTime * 0.5) * (drunk * 5) end local entity = client:GetRagdollEntity() if (IsValid(entity)) then local index = entity:LookupAttachment("eyes") if (index and index > 0) then local attachment = entity:GetAttachment(index) view.origin = attachment.Pos view.angles = attachment.Ang end end return view end function GM:HUDPaintTargetPlayer(client, x, y, alpha) local color = team.GetColor(client:Team()) color.a = alpha if (client:IsTyping()) then local text = "Typing..." local typingText = client:GetNetVar("typing") if (nut.config.showTypingText and typingText a
Will do, thanks.
[QUOTE=GamesPuff;44111756]Blazer lol thats not the color correction your talking about go into nutscript/gamemode/core/cl_hooks.lua and replace everything with this[/QUOTE] Didn't people literally just say DON'T edit the framework?
Adding this code to the schema's cl_hook will do the job. [lua] function SCHEMA:ModifyColorCorrection(color) color["$pp_colour_brightness"] = color["$pp_colour_brightness"] + 0.02 color["$pp_colour_contrast"] = 1 color["$pp_colour_addr"] = 0 color["$pp_colour_addg"] = 0 color["$pp_colour_addb"] = 0 color["$pp_colour_mulr"] = 0 color["$pp_colour_mulg"] = 0 color["$pp_colour_mulb"] = 0 end[/lua]
[QUOTE=GamesPuff;44108619]Making a Schema right now[/QUOTE] Elaborate please
Hello all. Sorry for being a complete moron, but I have yet to figure out how to change someone's faction and/or rank. Can someone give me a quick rundown on how that works?
well if you haven't already, you have to whitelist them to the faction, which i think might be /givewhitelist, i can't remember off the top of my head. of course, after the command you list the person's character's name and then the faction name. I don't know about the rank, though. if that isn't the command, you can go in game and open your f1 menu, you should find the command under the help tab.
[QUOTE=GamesPuff;44111756]-spergler-[/QUOTE] don't edit the base gamemode, that makes it hard for you to update
[QUOTE=Johnny Guitar;44115452]don't edit the base gamemode, that makes it hard for you to update[/QUOTE] so should I use what rebel posted or what Puff added? I'm confused.
Do what rebel posted. If it still doesn't work add me on steam and I'll help you sort it out.
[QUOTE=Bwanbwan;44115103]Hello all. Sorry for being a complete moron, but I have yet to figure out how to change someone's faction and/or rank. Can someone give me a quick rundown on how that works?[/QUOTE] You whitelist them to the faction, the command is /plywhitelist name faction Once done, they must create a new character to that faction, and thats it, to change their rank, Usually if they're a non cp class, you select a class through the classes menu, but if they're apart of the CP system you set their name to the corrosponding rank: e.g /charsetname CP-RCT.49492 CP-TAHCEOI.49492
I'd just like to say if it wasn't exactly clear already, Rebel and Chessnut created this framework so if they suggest something then It's likely right (of course they don't know everything but c'mon). Also Johnny is a great coder so I'd also recommend listening to his advice. If that doesn't help or you failed to read the wiki or previous posts then I have little hope for you. [Editline]1[/editline] By this I pretty much mean use the search function, wiki or consult someone before repeating questions we've read 50 times.
[QUOTE=GTbrawlers;44113531]Elaborate please[/QUOTE] Im making a private Schema for my community sorry :P [editline]3rd March 2014[/editline] [QUOTE=Johnny Guitar;44115452]don't edit the base gamemode, that makes it hard for you to update[/QUOTE] Ok thanks Johnny but i didnt think he would have a good schema so i just told him to put the cl_hooks like i did it worked tho but he should do what rebel did thats what i did already
Sorry, you need to Log In to post a reply to this thread.