• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
[QUOTE=MCiLuZiioNz;47789915]Hello everyone, I am currently having two separate issues on one of my servers and could use some help. First Issue: [code] [ERROR] lua/entities/wt_rocketboots_thinker/cl_init.lua:23: attempt to compare nil with number 1. unknown - lua/entities/wt_rocketboots_thinker/cl_init.lua:23 [/code] [URL="http://steamcommunity.com/sharedfiles/filedetails/?id=237544369"]This[/URL] is the addon in question. I extracted the gma and went through the files. Line 23 that outputs the error. [code] self.Dead = self.DieTime<CurTime() or self.Player:IsOnGround() [/code] Second Issue: [code] [ERROR] lua/autorun/rb655_lightsaber_presets.lua:225: bad argument #1 to 'ClientsideModel' (string expected, got nil) 1. ClientsideModel - [C]:-1 2. fn - lua/autorun/rb655_lightsaber_presets.lua:225 3. unknown - addons/ulib/lua/ulib/shared/hook.lua:108 [/code] [URL="http://steamcommunity.com/sharedfiles/filedetails/?id=111412589"]This[/URL] is the second addon in question. Extracted the gma as well to find the line. Line 225 that outputs error. [code] ply.LightsaberMDL = ClientsideModel( wep.WorldModel, RENDERGROUP_BOTH ) [/code] Thanks for any help :)[/QUOTE] You better tell me how are you causing that error so I can fix it properly. ( The second one )
How do [B]edicts [/B]work with Lua? For instance, if I only have [B]one entity[/B], but it creates [B]30 models[/B], is that just [B]one edict[/B]? (pretty sure if it's creating 30 models, those would be potential clientside [B]edicts[/B]) [editline]24th May 2015[/editline] Or lets even assume the models might be zombies, if I was trying to make a L4D style entity to handle zombies. [B]One [/B]instance of [B]one[/B] entity, [B]30 zombies[/B]. How many [B]edicts[/B]?
30 Zombies are still entities. 30 Models are still entities. One entity zombie handler + 30 zombies = 31 edicts or something.
I'm back. How would I count up until I hit a number, then count down, then repeat? For example, if I start with 33, count up until 100, and then count back down until zero, and start counting up again. Any help is appreciated :3
[QUOTE=Robotboy655;47794068]30 Zombies are still entities. 30 Models are still entities. One entity zombie handler + 30 zombies = 31 edicts or something.[/QUOTE] Assuming it is ONLY one entity, and each zombie is just a table entry + cs models?
[QUOTE=Robotboy655;47793981]You better tell me how are you causing that error so I can fix it properly. ( The second one )[/QUOTE] I honestly don't know, it was reported to me by some players.
[QUOTE=WalkingZombie;47794467]Assuming it is ONLY one entity, and each zombie is just a table entry + cs models?[/QUOTE] client-side models are still CSEnt entities.
[QUOTE=Cushie;47794710]client-side models are still CSEnt entities.[/QUOTE] But they don't count towards the edict count do they?
[QUOTE=WalkingZombie;47794467]Assuming it is ONLY one entity, and each zombie is just a table entry + cs models?[/QUOTE] [QUOTE=Cushie;47794710]client-side models are still CSEnt entities.[/QUOTE] + The fact that your clientside zombies will be pretty much unkillable, uninteractable. [editline]24th May 2015[/editline] [QUOTE=James xX;47794776]But they don't count towards the edict count do they?[/QUOTE] They should on client.
[QUOTE=Robotboy655;47794783]They should on client.[/QUOTE] [QUOTE=James xX;47794776]But they don't count towards the edict count do they?[/QUOTE] i dont believe they will, but they will count towards the non networked entity limit which is the same as the edict limit (2048) pretty sure he's asking because left4dead runs smoothly and doesnt break the limit by having large batches of zombies only consuming one edict. in relation to the question, i dont think that'd be possible coded purely in lua. regardless of how you tried to do it you would be consuming either non networked entities or edicts. as said above you'd probably need massive overhead/hackery to have it handled clientside and you'd still be counting towards non-networked entity limits, and if you do it server-side you'd be consuming edicts by creating networked entities. assuming you'd access to sourcecode to do it, but it's not an area im massively familiar with since im not sure how l4d actually manages it.
Edit: Solved it, so no need to have my specific question up here still. .. Had been trying to fix it for 2 hours, and of course I solve it 15 minutes after posting here xD
[QUOTE=Robotboy655;47794783]+ The fact that your clientside zombies will be pretty much unkillable, uninteractable.[/QUOTE] If they're only clientside, then yeah, you're right... but surely there is a way to create an entity that works similarly to the Left 4 Dead zombies? Where one entity controls the entire horde, save for the special infected?
Anyone know where I can find the code for this function: [lua] Nextbot:BecomeRagdoll( dmginfo ) [/lua]
[QUOTE=EthanTheGreat;47789588]My entity is: [B]ANIM[/B] not point, and this keeps happening: [B]SERVER:[/B] [code] lua_run print( Player( 3 ).Vehicle:GetBoneName( 1 )) [/code] [B]Output:[/B] [code] Turn_FL [/code] [B]CLIENT:[/B] [code] lua_run_cl print( Player( 3 ).Vehicle:GetBoneName( 1 )) [/code] [B]OUTPUT:[/B] [code] __INVALIDBONE__ [/code] Idk why this is happening. I might just create a clientside entity to grab the bone positions >:l[/QUOTE] Bump, [code] lua_run_cl print( Player( 3 ).Vehicle:GetBoneCount( )) ~~ OUTPUT: 15 [/code] So GetBonePosition, GetBoneName doesn't work? GetAttachements work though. This is really weird. Can anyone confirm this?
[QUOTE=Shenesis;47793237]Has anyone had that problem where ampersands (&) don't work in labels but do when drawn manually? Doing [lua] local label = vgui.Create("DLabel") label:SetFont("DermaDefaultBold") label:SetText("HI THERE &") label:SetColor(color_black) label:SizeToContents() label:Center() [/lua] results in this: [IMG]https://a.pomf.se/zyacbv.png[/IMG][/QUOTE] [b] Edit: [/b]What Willox said below
"&" characters have a width of 0 for magical Source reasons.
Could someone help me? I'm trying to play a sound on the player when it reachs 50% stamina but i'm having a trouble. It's tells me that the sound is not precached. How can i precache it?
[QUOTE=SmOkEwOw;47795884]Could someone help me? I'm trying to play a sound on the player when it reachs 50% stamina but i'm having a trouble. It's tells me that the sound is not precached. How can i precache it?[/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/util/PrecacheSound]util.PrecacheSound[/url] It's a bit intuitive.
[QUOTE=SmOkEwOw;47795884]Could someone help me? I'm trying to play a sound on the player when it reachs 50% stamina but i'm having a trouble. It's tells me that the sound is not precached. How can i precache it?[/QUOTE] [URL="http://wiki.garrysmod.com/page/util/PrecacheSound"]http://wiki.garrysmod.com/page/util/PrecacheSound[/URL]
You can also just have local lowStaminaSound = Sound( "your_sound_file.mp3" ) at the top of your file, and use that as your sound.
and where should i place that function? on autorun? EDIT: Well the sound i want it's from hl2 so that may work
Quick question, I was working on implementing MySQL in my project and I was looking at Undefined's Pointshop MySQL provider just to be sure of what i'm doing and I see he used [[ and ]] for his query. Something like that : [code] local qs = [[ INSERT INTO `pointshop_data` (uniqueid, points, items) VALUES ('%s', '%s', '[]') ON DUPLICATE KEY UPDATE points = VALUES(points) ]] [/code] Just to be sure, is [[ ]] a string and is it any different than using " " or ' ' ?
[url]http://lua-users.org/wiki/StringsTutorial[/url] Scroll to "Multiline Quotes"
[QUOTE=zerf;47796405][url]http://lua-users.org/wiki/StringsTutorial[/url] Scroll to "Multiline Quotes"[/QUOTE] Easy enough, thanks man!
It's worth nothing that all string literals in Lua can be multi-line. [code] print [[Hello World]] print "Hello\ World" print 'Hello\ World' [/code]
[B]EDIT:[/B] after coding / googling for 8 hours straight I managed to figure everything out ------------------------------------------------------------------------------------------------------------------------------------- I'm altering DPointshopMenu.lua to change colors of the pointshop [URL="http://pastebin.com/EKzJyYVY"]Pastebin code[/URL] The problem is that I can't find how to change certain background / button colors: [QUOTE][IMG]https://dl.dropboxusercontent.com/u/50211087/gmod/screenshots/2015-05-25_00001.jpg[/IMG][/QUOTE] [B]Edit:[/B] I stayed up all night trying to change the skin, and after lots of facedesking I managed to get this: [QUOTE]Image is 1624x1080, click on it for full resolution [IMG]http://images.akamai.steamusercontent.com/ugc/711912327652527449/41E052B263068336D6A2163821001BB54A125E09/[/IMG][/QUOTE] Now all that's left is changing the bright slider / scroller thingy. If anyone could point me in the right direction, I'd appreciate it <3. My brain is tired [B]Edit2:[/B] Am I really the only one who's been in this thread the past 8 hours xD? I finally managed to fix the scroll bar: [QUOTE][IMG]http://images.akamai.steamusercontent.com/ugc/711912327652901576/CA734F3CFDA2A6DE526092925DC3F1DF42CDCAE8/[/IMG][/QUOTE] So I guess that's it :D
I'm trying to suppress player movement in SetupMove. However, removing masks that relate to movement such as IN_FORWARD or IN_BACK seems to have no affect. First time I've used BitMasks and I think I'm doing everything correctly. [LUA] -- Ran SHARED on base derived gamemode hook.Add( "SetupMove", "GstrMovement", function( ply, moveData, userData ) moveData:SetButtons( bit.band(self:GetButtons(), bit.bnot( IN_JUMP )) ) -- Works moveData:SetButtons( bit.band(self:GetButtons(), bit.bnot( IN_FORWARD )) ) -- Doesn't work no matter the order end) [/LUA] Thanks
[QUOTE=scottd564;47799350]I'm trying to suppress player movement in SetupMove. However, removing masks that relate to movement such as IN_FORWARD or IN_BACK seems to have no affect. First time I've used BitMasks and I think I'm doing everything correctly. [LUA] -- Ran SHARED on base derived gamemode hook.Add( "SetupMove", "GstrMovement", function( ply, moveData, userData ) moveData:SetButtons( bit.band(self:GetButtons(), bit.bnot( IN_JUMP )) ) -- Works moveData:SetButtons( bit.band(self:GetButtons(), bit.bnot( IN_FORWARD )) ) -- Doesn't work no matter the order end) [/LUA] Thanks[/QUOTE] It's too late at that point. Either nullify the movedata's velocity or use a hook like StartCommand.
This isn't directly related to gmod lua (though what I need it for is gmod lua so kinda), but I really dunno where else to ask What are these things called in notepad++? and how can I get them into sublime or atom? I cannot find any sort of name for them [img]http://i.imgur.com/DXjO9p6.png[/img] Obviously I don't mean the line numbers, but the little lines with the + that show the start and end of things like functions and if blocks, they're super useful for just visualizing where stuff starts and end and also add the option of hiding blocks of code, but I can't find a plugin for sublime or atom that does similar (specifically the auto-showing of a block, there's a few things for hiding)
Its the fold column.
Sorry, you need to Log In to post a reply to this thread.