• NutScript - Nutty name, serious framework
    2,778 replies, posted
[QUOTE=Garrison;45491956] Also I'm not sure if this is a bug or if it's something that I did, but Nutscript doesn't want to cooperate with these models [url]http://facepunch.com/showthread.php?t=1315851[/url] In Sandbox the playermodels work flawlessly, but with Nutscript they are stuck in T-Pose.[/QUOTE] You need to set those model's classes in libs/sh_animation.lua with: [code]nut.anim.SetModelClass("citizen_female", "xx") nut.anim.SetModelClass("citizen_male", "xx")[/code] I think at least.
[QUOTE=Garrison;45491956]Is it possible to change a player's skin / bodygroup upon use of an item? Also I'm not sure if this is a bug or if it's something that I did, but Nutscript doesn't want to cooperate with these models [url]http://facepunch.com/showthread.php?t=1315851[/url] In Sandbox the playermodels work flawlessly, but with Nutscript they are stuck in T-Pose.[/QUOTE] If you want a playermodel to work, you need to do: [lua] nut.anim.SetModelClass("player", "models/model/here.md") [/lua] in sh_schema.lua or something.
Being fairly new to messing with lua files, I've come upon three main problems/questions that are in the way of my progression and it would be greatly appreciated if someone can offer some tips or tricks for a novice like myself :) 1. I cannot buy anything from the vendor. If I click on the item in which I want to buy, it simply animates to a grey shade then returns to normal (I understand that it's the delay between buying items), without any indication of a successful purchase. I've checked all the boxes for every faction and class as well and I have more than enough credits on my character. 2. How do I impose certain items onto a character according to their faction properly? So far, I've been able to give a certain faction a pistol and stunstick using these: [CODE]function SCHEMA:PlayerLoadout(client) if (client:Team() == FACTION_TRAN) then client:Give("nut_stunstick") end end function SCHEMA:PlayerLoadout(client) if (client:Team() == FACTION_TRAN) then client:Give("cyberpunk_pistol") end end[/CODE] Now it works perfectly fine as a loadout, but in terms of adding it to my inventory, how would I go about doing that? 3. How do I configure workshop items into nutscript items. Like, the vanilla weapons all have descriptions and such and can be added to vendors, how can I achieve that in regard to things I downloaded from the workshop? Thanks in advanced to anyone who can offer some help! :D
[QUOTE=Darkpwn39;45497534]Being fairly new to messing with lua files, I've come upon three main problems/questions that are in the way of my progression and it would be greatly appreciated if someone can offer some tips or tricks for a novice like myself :) 1. I cannot buy anything from the vendor. If I click on the item in which I want to buy, it simply animates to a grey shade then returns to normal (I understand that it's the delay between buying items), without any indication of a successful purchase. I've checked all the boxes for every faction and class as well and I have more than enough credits on my character. 2. How do I impose certain items onto a character according to their faction properly? So far, I've been able to give a certain faction a pistol and stunstick using these: function SCHEMA:PlayerLoadout(client) if (client:Team() == FACTION_TRAN) then client:Give("nut_stunstick") end end function SCHEMA:PlayerLoadout(client) if (client:Team() == FACTION_TRAN) then client:Give("cyberpunk_pistol") end end Now it works perfectly fine as a loadout, but in terms of adding it to my inventory, how would I go about doing that? 3. How do I configure workshop items into nutscript items. Like, the vanilla weapons all have descriptions and such and can be added to vendors, how can I achieve that in regard to things I downloaded from the workshop? Thanks in advanced to anyone who can offer some help! :D[/QUOTE] Use [noparse][code][/code][/noparse] tags.
The vendors are kinda strange. If you have a item like 9mm ammo and set the price to 0 (for the Civil Authority Armory) then the price is going to be set to the standard price of the item, in this case 60 tokens. That means, if I set the price to 0, it's going to use the ITEM.price thing, and I could need free ammo and weapons for the Combine.
[QUOTE=Applad;45504109]The vendors are kinda strange. If you have a item like 9mm ammo and set the price to 0 (for the Civil Authority Armory) then the price is going to be set to the standard price of the item, in this case 60 tokens. That means, if I set the price to 0, it's going to use the ITEM.price thing, and I could need free ammo and weapons for the Combine.[/QUOTE] you could spawn combine with 1 token, set the price to 1 token and add 1 token per PlayerBoughtItem hook
How do I make myself admin/owner? Oh, and quick acts aren't working. The NPC anims don't seen to be working, either, even when set. EDIT: Huh, it works fine with the normal Combine Soldier model. Stormtrooper model, I'm trying to set to Overwatch animations, it should fit nicely, but it's not working.
[QUOTE=RonanZer0;45510945]How do I make myself admin/owner?[/QUOTE] Go in your server's rcon and type "nut_setowner NAME"
Why's my hud not drawing? The only thing that draws is the draw.DrawText stuff. The surface.DrawTexturedRect stuff doesn't draw until I pull out my weapon switcher, then once the weapon switcher goes away, my hud goes away. Also, when my HUD appears, it's a lot darker than normal (this hud looks normal on sandbox) [t]http://oi59.tinypic.com/2dhv91f.jpg[/t]
I've created a faction, but it's a new server and I literally have no idea how to get myself, or anyone else into that faction. If anyone could help that'd be appreciated.
[QUOTE=thexant;45556826]I've created a faction, but it's a new server and I literally have no idea how to get myself, or anyone else into that faction. If anyone could help that'd be appreciated.[/QUOTE] There's a whitelist command, check the commandlist!
[QUOTE=mib999;45557240]There's a whitelist command, check the commandlist![/QUOTE] When I do the whitelist command, it says "Invalid faction"
[QUOTE=thexant;45556826]I've created a faction, but it's a new server and I literally have no idea how to get myself, or anyone else into that faction. If anyone could help that'd be appreciated.[/QUOTE] do this if your the owner/superadmin /plywhitelist charactername faction. as example. /plywhitelist john civil = "John Doe is now whitelisted to Civil Protection"
So, is that new UI that you mentioned being worked on?
[QUOTE=Nope guy;45561810]do this if your the owner/superadmin /plywhitelist charactername faction. as example. /plywhitelist john civil = "John Doe is now whitelisted to Civil Protection"[/QUOTE] It worked, thanks. EDIT: It works for me. I cannot whitelist other players to certain factions, nor can they whitelist themselves when set to a super admin rank. Still says Invalid Faction, although it's not invalid when I do it to myself.
It also seems I cannot use the flashlight. I used to have the flashlight plugin, but had not the slightest idea how to use it, so I deleted it. I even have it set to nut.config.flashlight = true Still nothing.
Is there a way to list all commands? It would also be nice if this had a getting started guide or an FAQ so you don't have to answer questions like mine.
[QUOTE=mogey5101;45567001]Is there a way to list all commands? It would also be nice if this had a getting started guide or an FAQ so you don't have to answer questions like mine.[/QUOTE] as far as I know, hold down F1 and go to help, there should be a commands thing. That's really as far as I know though someone may be able to help out more.
[QUOTE=thexant;45566828]It also seems I cannot use the flashlight. I used to have the flashlight plugin, but had not the slightest idea how to use it, so I deleted it. I even have it set to nut.config.flashlight = true Still nothing.[/QUOTE] Check your inventory, you need to have the flashlight in your inventory before you can use it.
How do I set the "class" of my players, along with their name? I'm working on a Clone Wars schema and Battle Droids have certain names. The default starts with B1., so of course the default name is B1. Droid #(numbers), and I want to be able to rank them up. How...? I see the classes tab my other classes I have for this faction, I set all their models to the proper ones and yet they all look like the default B1 model (I've tripled checked this and restarted the server, they SHOULD be the other models) and when selecting them nothing happens, no model change, no NAME change either. How can I change the "class" of ANY player in my server and fix the model problem? Oh, and I want their name to change with it, but KEEP THEIR NUMBER (numbers are random like CPs). Oh, and a side question: What's the thing called where you miss shots on purpose to elongate battles? EDIT: so apparently using /charsetname (a command I didn't see at first), changing their name will change their class, yet I have to set their model separately, but I want it to change to the proper model on the spot, which it isn't.
[QUOTE=RonanZer0;45575646] Oh, and a side question: What's the thing called where you miss shots on purpose to elongate battles? [/QUOTE] I believe its called STM, or shoot to miss.
I'm tired of this. I can't even draw a single square on the screen. It draws with the toolgun out, and draws partially (dimmed color) with weapon selector. This is a vanilla nutscript install, the surface library doesn't work. draw.DrawText() does though, why is this happen??? :(
[QUOTE=mogey5101;45575803]I believe its called STM, or shoot to miss.[/QUOTE] It's that one thing that is totally retarded. Sackreator54 that might be a problem with nutscript I couldn't figure out why it's doing that.
I heard that you can have stationary and mobile radios that COME with Nutscript. How do I activate them, where are they, and if they don't come with it, where's a plugin for them? EDIT: So they're from Metro 2033 RP? I added the plugin from Metro 2033 RP, but I don't see them in the business menu.
[QUOTE=RonanZer0;45584640]I heard that you can have stationary and mobile radios that COME with Nutscript. How do I activate them, where are they, and if they don't come with it, where's a plugin for them? EDIT: So they're from Metro 2033 RP? I added the plugin from Metro 2033 RP, but I don't see them in the business menu.[/QUOTE] I'm running a Metro 2033 RP and I have them. The stationary ones appear in the Entities menu, and I have been able to add them to vendors. They don't seem to work though and that saddens me.
How do i whitelist people to be etc cp?
[QUOTE=Snorkis1;45587694]How do i whitelist people to be etc cp?[/QUOTE] /plywhitelist Syntax: <string name> <string faction> And by the way, how do flags work? I mean like vendor flags. How do I make a faction/player/class a "vendor" and make it so only "vendor"s can access the business menu? Also, I have a robot "battery" food that I want only a certain faction to be able to consume. How do I limit item consumption to a certain faction? And 1 more thing... I have some weapons set up, and even in the SWEP's shared file and in sandbox the holdtype is pistol holdtype, but for SOME reason in Nutscript, using "metropolice" animation set, he holds it like your everyday SMG...? Why!?
Is it possible to have a salary? and also have the business tab only accessible by the admins?
If it does not seem like I am fixing anything for NutScript, it is because I am working on NS1.1 which is a complete re-write of NS considering my old code was bad. So far: [code] NutScript 1.1 - File organization changes - Style changed to use lowerCamelCase for library members - Database tables now stored in JSON (for web use) instead of vON - All tables now have nut_* prefix in the database - Players no longer store gender in the database, instead models are unified - Characters no longer have an ID for which position the character was created - Database queries now pass the last increment ID if applicable - Faction now stored as a string to prevent issues when adding a new faction - Last time a character was selected now stored - Character creation time now stored - Items now have their own table and store a unique itemID, character who owns it, the item type, and arbritary data in JSON - Schemas no longer require nut.schema.Init() - Schemas now loaded as plugins - The 'schema' folder of a schema moved outside of the 'gamemode' directory - nut no longer refers to the framework's GM table - Items and characters are now metatables + accessed with FindMetaTable("Character") or FindMetaTable("Item") - Character metatables no longer store unneeded info (The main character metatable now holds the functions too) - Items are now instanced (inserted to the database and then has an item object created, thus requiring callback) - Schemas now treated like plugins - Plugin loading changed - Player database no longer holds the inventory - Upgraded to netstream2 - Added nut.char.registerVar(key, data) which now can be called anywhere (shared) rather than a hook. This function also adds more functionality to custom character vars. - Items are now metatables derived from a "proxy" item (acts like how it was before, but didn't copy all of the functions) - Items now store X and Y coordinates - Added grid inventory system - Items will now need ITEM.width and ITEM.height, defaults to 1x1 - Inventory now made into its own object and incorporated into the item system. - Inventorys now accessed like: client:getChar():getInv():add("test") - Inventories will handle their own networking with support for multiple recipients (e.g. for searching) - Language system changed, now registered in files and accessed with L(key, recipient). For example: L"noDesc" clientside or L("noDesc", Entity(1)) server-side. - Languages now dependant on the client rather than server, so clients can set their own languages. - Configuration system can now be changed dynamically on the server. - Database connection errors should now be shown on loading - Added basic NutScript derma skin. - Added more use of gradients (subtle) to UI - Net message sizes should be slightly reduced - nut table no longer is a reference to the GM table (before it was needed so the schema can load) [/code] The grid inventory will look like this: [media]http://www.youtube.com/watch?v=do2V1DKOItA[/media]
Will schemas built on the current version of NS work with NS1.1?
Sorry, you need to Log In to post a reply to this thread.