• What do you need help with? V3
    6,419 replies, posted
Aha, yeah. Should work :) Thank you. [editline]23rd October 2012[/editline] Does anyone know if Spacetech will update his gmsv_teleport module?
Here's a better way of doing it: [lua]local mapsdata = {} function AddMapData( Map, EntPos, Eggs ) mapsdata[Map] = {EntPos = EntPos, Eggs = Eggs} end function GetMapDataByName( name ) return mapsdata[Name] end[/lua]
I'm not up to date with GM13 and I've been googling about and cant find it. I'm trying to use a binary module in GM13... Where do I place it and is it still require( "blah" ) to run? The modules up to date but no matter what I do its not loading.
[QUOTE=Divran;38148891]Here's a better way of doing it: [lua]local mapsdata = {} function AddMapData( Map, EntPos, Eggs ) mapsdata[Map] = {EntPos = EntPos, Eggs = Eggs} end function GetMapDataByName( name ) return mapsdata[Name] end[/lua][/QUOTE] Thank you!
[img]http://i.imgur.com/dXsXW.jpg[/img] How do I simulate this effect?
[QUOTE=TheCloak;38151608][img]http://i.imgur.com/dXsXW.jpg[/img] How do I simulate this effect?[/QUOTE] [url]http://wiki.garrysmod.com/page/Libraries/halo/Add[/url] Not 100% sure, but i think that does the job.
Thank you. One more question, how would I be able to detect if what I'm looking at is a prop? And how would I be able to distinguish what type it is?
[QUOTE=thejjokerr;38150620]What else, other than being in the "admin" usergroup, makes someone an admin according to IsAdmin?: [img]http://i.imgur.com/9j2LR.png[/img] I haven't overriden Player.IsAdmin, so I don't think (think) it's any of my code interfering. [editline]23rd October 2012[/editline] Is it because IsAdmin checks for the "Admin" usergroup? Case sensitive? [editline]23rd October 2012[/editline] Nah that isn't it. Did IsAdmin just break? [editline]23rd October 2012[/editline] Strangely enough, IsAdmin returns true (as it should) on the client side.[/QUOTE] Are you editing a gamemode or making one from scratch yourself? if editing: find where they redefined IsAdmin and change it yourself if making new gamemode: [lua] local Player = FindMetaTable("Player") function Player:IsAdmin() -- code end [/lua]
[QUOTE=TheCloak;38152941]Thank you. One more question, how would I be able to detect if what I'm looking at is a prop? And how would I be able to distinguish what type it is?[/QUOTE] local objEnt = objPl:GetEyeTrace( ).Entity print( objEnt:GetClass( ) )
Thanks. Sorry for all of the questions. There's very limited documentation on GMod Lua so it's hard for me to search myself
How would I go about attaching a entity to a npc's bone after it has collided with it? Right now I just parented the entity as a placeholder but it looks like crap: [vid]http://puu.sh/1i01d[/vid]
I need help, I'm currently trying to fix MelonRacer for Gmod 13. But when the player spawns its just the normal player entity not the melon entity. Here is the console log when i first start the game. [I][ERROR] gamemodes/melonracer/gamemode/init.lua:7: bad argument #2 to 'Find' (string expected, got no value) 1. Find - [C]:-1 2. unknown - gamemodes/melonracer/gamemode/init.lua:7 Couldn't Load Init Script: 'melonracer/gamemode/init.lua' [ERROR] ...melonracer/entities/entities/trigger_checkpoint/init.lua:19: ')' expected near 'then' 1. unknown - gamemodes/melonracer/entities/entities/trigger_checkpoint/init.lua:0 Attempted to create unknown entity type trigger_checkpoint! Can't init trigger_checkpoint Attempted to create unknown entity type trigger_checkpoint! Can't init trigger_checkpoint Attempted to create unknown entity type trigger_checkpoint! Can't init trigger_checkpoint Attempted to create unknown entity type trigger_checkpoint! Can't init trigger_checkpoint Garry's Mod melonracer mr_eight 1 76561197999127845 clientside lua startup! env_cubemap used on world geometry without rebuilding map. . ignoring: building_template/building_template002l env_cubemap used on world geometry without rebuilding map. . ignoring: building_template/building_template002p Redownloading all lightmaps [/I] I need some help please.
[QUOTE=InfernalCookie;38142817]In GM12 this code works but in GM13 the file isn't made or even detected when I manually make the file to test ( won't delete the file in order to replace it ) [lua] local id = string.Replace( self:SteamID(), ":", "!" ) local pnts = self:PS_GetPoints() local items = string.Implode( ",", self.Items ) local data = Format( "%s/%s", pnts, items ) if file.Exists( "pointshop/" .. id .. ".txt", "DATA" ) then file.Delete( "pointshop/" .. id .. ".txt" ) evolve:Notify( evolve.colors.red, "[DEBUG] " .. id .. " file deleted" ) end file.Write( "pointshop/" .. id .. ".txt", data ) evolve:Notify( evolve.colors.red, "[DEBUG] " .. id .. " " .. data ) [/lua] It does print the correct things it's supposed to.[/QUOTE] So I got a box but no one knows what's wrong with it?
In GM13 the folders aren't autocreated if they don't exist.
Does anyone know how Garry did the spawn menu in 12/11? Specifically the part where he can have a scrollable one. I can't find the derma control. [url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index0a13.html][img]http://maurits.tv/data/garrysmod/wiki/www.imgdumper.nl/uploads2/4bbb51302af21/4bbb513028fdf-DGrid.png[/img][/url] I'm looking to do something like this but just have the buttons be bigger and have it be a scrollable menu like DListView is.
[QUOTE=Chessnut;38155018]In GM13 the folders aren't autocreated if they don't exist.[/QUOTE] I have a function that checks and creates non-existent directories, so that's not it.
[QUOTE=TheCloak;38154190]Thanks. Sorry for all of the questions. There's very limited documentation on GMod Lua so it's hard for me to search myself[/QUOTE] You may wish to check out [url]www.glua.me[/url] for examples of using code (it'll be updated for Gmod 13 shortly)
is there a vehicle script tutorial? I wanna make a motorbike vehicle but I don't understand the script part
Does anyone has a list of the material overlays and effects to use for Gmod13?
Having odd problem in 13: [code] self:SetRenderMode(RENDERMODE_TRANSALPHA) self:SetColor(Color(0,0,0,0)) [/code] Completely invisible. [code] self:SetRenderMode(RENDERMODE_TRANSALPHA) self:SetColor(Color(0,0,0,20)) [/code] Completely visible. Why can't I get my entity to be just slightly transparent anymore?
Scripted sounds aren't working anymore. The script files I would place in scripts/sounds aren't getting read by gmod, so my sweps are silent. Is there any way of getting scripted sounds working again? Or will i have to use emitsound for each and every one? I have over 40 sweps I have to fix here, please don't tell me I have to manually add every single sound
You need to use [b][url=http://wiki.garrysmod.com/page/Libraries/sound/Add]Libraries/sound/Add[img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
I am too dumb to not use || &&, please help. What do I need to do instead now?
[QUOTE=Hyper Iguana;38155119]Does anyone know how Garry did the spawn menu in 12/11? Specifically the part where he can have a scrollable one. I can't find the derma control. [url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index0a13.html][img]http://maurits.tv/data/garrysmod/wiki/www.imgdumper.nl/uploads2/4bbb51302af21/4bbb513028fdf-DGrid.png[/img][/url] I'm looking to do something like this but just have the buttons be bigger and have it be a scrollable menu like DListView is.[/QUOTE] i remember the days when i didnt know derma, tough times :( you are KINDA in the right track. what you need is a DPanelList (which has been deprecated, but still exists), then loop through your models and create a spawn icon. when you click the spawn icon just make it spawn a prop_physics with the model. i have prepared some code for you. it may/may not work [lua] // localized list of models local Models = { "model.mdl", "model2.mdl", // etc }; // OR you can use a directory of models local Models, folders = file.Find("models/*.mdl", "GAME"); local pseudoSpawnMenu = vgui.Create("DPanelList") pseudoSpawnMenu:SetSize(256, 320); // make it a divisible by 32 (default spawnicon size, otherwise we will get ugly positioning) pseudoSpawnMenu:Center(); // makes it center on the screen pseudoSpawnMenu:Popup(); // makes it freeze the player and enable the mouse pseudoSpawnMenu:EnableHorizontal(true) // enables items to be listed side by side pseudoSpawnMenu:EnableVerticalScrollbar(true) pseudoSpawnMenu:SetPadding(5) // distance between the panellist and the items (i think) pseudoSpawnMenu:SetSpacing(5) // spacing between items for _, model in pairs(Models) do local icon = vgui.Create("SpawnIcon", pseudoSpawnMenu); icon:SetModel(model); icon.DoClick = function(this) // not sure is SpawnIcon:GetModel() exists, so lets be safe RunConsoleCommand("gm_spawn", model); end pseudoSpawnMenu:AddItem(icon); end [/lua]
-snip-
[QUOTE=TheTrueAndy;38172225]I am too dumb to not use || &&, please help. What do I need to do instead now?[/QUOTE] a && b is now bit.bor(a, b) and a && b is not bit.band(a, b) [editline]25th October 2012[/editline] [QUOTE=Hyper Iguana;38172248][lua] if (ply:IsAdmin()) or (ply:IsAlive()) then if (ply:IsAdmin()) and (ply:IsAlive()) then [/lua][/QUOTE] that are completely different. && and || are logical conditional operators. & and | work on bits. [editline]25th October 2012[/editline] [QUOTE=Mitsudigi;38164871]Having odd problem in 13: [code] self:SetRenderMode(RENDERMODE_TRANSALPHA) self:SetColor(Color(0,0,0,0)) [/code] Completely invisible. [code] self:SetRenderMode(RENDERMODE_TRANSALPHA) self:SetColor(Color(0,0,0,20)) [/code] Completely visible. Why can't I get my entity to be just slightly transparent anymore?[/QUOTE] use RENDERMODE_TRANSCOLOR
[QUOTE=Chessnut;38172084]You need to use [b][url=http://wiki.garrysmod.com/page/Libraries/sound/Add]Libraries/sound/Add[img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b][/QUOTE] You da man, thanks
[QUOTE=InfernalCookie;38142817]In GM12 this code works but in GM13 the file isn't made or even detected when I manually make the file to test ( won't delete the file in order to replace it ) [lua] local id = string.Replace( self:SteamID(), ":", "!" ) local pnts = self:PS_GetPoints() local items = string.Implode( ",", self.Items ) local data = Format( "%s/%s", pnts, items ) if file.Exists( "pointshop/" .. id .. ".txt", "DATA" ) then file.Delete( "pointshop/" .. id .. ".txt" ) evolve:Notify( evolve.colors.red, "[DEBUG] " .. id .. " file deleted" ) end file.Write( "pointshop/" .. id .. ".txt", data ) evolve:Notify( evolve.colors.red, "[DEBUG] " .. id .. " " .. data ) [/lua] It does print the correct things it's supposed to.[/QUOTE] I still really need help with this problem.
[QUOTE=InfernalCookie;38173877]I still really need help with this problem.[/QUOTE] Not sure if you're allowed the !'s in the file name
I was allowed in GM12... I can make the file manually with the '!' in it... Think Gmod doesn't allow it?
Sorry, you need to Log In to post a reply to this thread.