• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
[QUOTE=Sheeplie;47557414]Is there a function to make an entity's sequence only play once rather than continually as SetSequence seems to do?[/QUOTE] Resert/Set to another sequence. Your issue is that the sequence you are playing has loop flag. [editline]19th April 2015[/editline] Or SetPlaybackRate( 0 ) at the end of the animation or something.
If this is a regular old entiy, is there any way to make the next sequence not start until the current one is finished? I suppose I could always make it a nextbot and use playsequence andwait, but is there any way to do this with an entity? Does lua have some kind of wait function other than timers and curtime subtraction?
[QUOTE=Sheeplie;47558178]If this is a regular old entiy, is there any way to make the next sequence not start until the current one is finished? I suppose I could always make it a nextbot and use playsequence andwait, but is there any way to do this with an entity? Does lua have some kind of wait function other than timers and curtime subtraction?[/QUOTE] You'll have to make a system for this one way ( timers ) or another ( timers but without timer library, CurTime() ).
in a camera (local client): [url]http://ph129.net/i/51YGvS.mp4[/url] not in a camera (other player doing same activity): [url]http://ph129.net/i/G8KOTc.mp4[/url] shared.lua [code] function SWEP:Reload() if (self.NextReload or 0) > CurTime() then return end self.NextReload = CurTime() + 1 self:SetEnabled(!self:GetEnabled()) self:SetHoldType( self:GetEnabled() and self.HoldType or "normal" ) self.PrintName = self:GetEnabled() and "Fists" or "Hands" end [/code] ...I don't get it? The weird thing is, if the weapon is changed to another, then back to the fists, it works. It's not set live for some reason.
[code][ERROR] lua/weapons/dkdn_nextgenheli.lua:242: attempt to call method 'GetAmmoCount' (a nil value) 1. unknown - lua/weapons/dkdn_nextgenheli.lua:242 2. Give - [C]:-1 3. unknown - gamemodes/sandbox/gamemode/commands.lua:696 4. unknown - lua/includes/modules/concommand.lua:54[/code] [lua]function SWEP:Initialize() print( self:Ammo1() )[/lua] [editline]20th April 2015[/editline] Well general problem: I have SWEP.Primary.ClipSize = 100 and SWEP.Primary.DefaultClip = 101 yet somehow I have no ammo... and I have NOTHING that's removing the ammo, either. [editline]20th April 2015[/editline] Does the ammo exist? [lua]game.AddAmmoType( { name = "dkdn_heli", dmgtype = DMG_BULLET, tracer = TRACER_LINE, plydmg = 0, npcdmg = 0, force = 0, minsplash = 0, maxsplash = 0 } )[/lua] [lua]SWEP.Primary.ClipSize = 100 SWEP.Primary.DefaultClip = 100 SWEP.Primary.Automatic = true SWEP.Primary.Ammo = "dkdn_heli"[/lua] DefaultClip being 101 while ClipSize is only 100, my ammo should be 1, but it's none. [editline]20th April 2015[/editline] The gaps between lines are just cus facepunch's edit system sucks.
[QUOTE=WalkingZombie;47561051][code][ERROR] lua/weapons/dkdn_nextgenheli.lua:242: attempt to call method 'GetAmmoCount' (a nil value)[/code][/QUOTE] Do you even read the error. You're calling GetAmmoCount which doesn't exist when all you're doing is printing the ammo on the init function. You need to make a new function for it.
So I have a hook being added in the menu instance: [lua] hook.Add( "OnPlayerChat", "Console3", function( player, strText, bTeamOnly, bPlayerIsDead ) local tab = {} if ( bPlayerIsDead ) then table.insert( tab, Color( 255, 30, 40 ) ) table.insert( tab, "*DEAD* " ) end if ( bTeamOnly ) then table.insert( tab, Color( 30, 160, 40 ) ) table.insert( tab, "( TEAM ) " ) end if ( IsValid( player ) ) then table.insert( tab, player ) else table.insert( tab, "Console" ) end table.insert( tab, Color( 255, 255, 255 ) ) table.insert( tab, ": "..strText ) console:Print( unpack(t)) console:Print( "player spoke") end) [/lua] and for some reason it isn't being called (even the "player spoke" isn't printing. I know this functions works however). any ideas? console is global, and I'm not getting any errors. I added in a Msg call which isn't being called, and I'm not overriding it.
[QUOTE=James xX;47562377]So I have a hook being added in the menu instance: [lua] hook.Add( "OnPlayerChat", "Console3", function( player, strText, bTeamOnly, bPlayerIsDead ) local tab = {} if ( bPlayerIsDead ) then table.insert( tab, Color( 255, 30, 40 ) ) table.insert( tab, "*DEAD* " ) end if ( bTeamOnly ) then table.insert( tab, Color( 30, 160, 40 ) ) table.insert( tab, "( TEAM ) " ) end if ( IsValid( player ) ) then table.insert( tab, player ) else table.insert( tab, "Console" ) end table.insert( tab, Color( 255, 255, 255 ) ) table.insert( tab, ": "..strText ) console:Print( unpack(t)) console:Print( "player spoke") end) [/lua] and for some reason it isn't being called (even the "player spoke" isn't printing. I know this functions works however). any ideas? console is global, and I'm not getting any errors. I added in a Msg call which isn't being called, and I'm not overriding it.[/QUOTE] Two things, 1) What is console defined to? 2) Are you running clientside?
[QUOTE=LUModder;47562413]Two things, 1) What is console defined to? 2) Are you running clientside?[/QUOTE] Console is a table containing panels and functions. It is set. I'm running it in the menu state. I guess this hook doesn't get called in the menu state, so my next question would be, how to pool the console table across the menu and the client state?
[QUOTE=James xX;47562460]Console is a table containing panels and functions. It is set. I'm running it in the menu state. I guess this hook doesn't get called in the menu state, so my next question would be, how to pool the console table across the menu and the client state?[/QUOTE] Isn't the point of having a separate state for the menu is to avoid this being possible? Can't do it without a binary module as far as I know.
[QUOTE=Drakehawke;47562868]Isn't the point of having a separate state for the menu is to avoid this being possible? Can't do it without a binary module as far as I know.[/QUOTE] Found a way without a binary.
[QUOTE=James xX;47563262]Found a way without a binary.[/QUOTE] let me guess.. text files
[QUOTE=MeepDarknessM;47563351]let me guess.. text files[/QUOTE] You sir, have offended me. I will have you know it was concommands :v:
[QUOTE=James xX;47563539]You sir, have offended me. I will have you know it was concommands :v:[/QUOTE] What, you mean you didn't use OnLuaError? :v:
[QUOTE=Luni;47563557]What, you mean you didn't use OnLuaError? :v:[/QUOTE] Yeah I did. OnLuaError is one of the few hooks that actually get called in the menu state, so I didn't have a problem with that. It was for hooks like OnPlayerChat that I had to use the concommands to get information into the menu state.
[QUOTE=LUModder;47562309]Do you even read the error. You're calling GetAmmoCount which doesn't exist when all you're doing is printing the ammo on the init function. You need to make a new function for it.[/QUOTE] Alright, but that's not even the problem actually... ammo doesn't even exist for the SWEP, that returns 0 no matter what (in ANY function)... but I've found ways to do what I'm doing without reserve ammo. "Do I even read the error?" Of course I do. I wasn't aware that GetAmmoCount can't be called in init... I have a rather low level of experience.
[QUOTE=James xX;47563572]Yeah I did. OnLuaError is one of the few hooks that actually get called in the menu state, so I didn't have a problem with that. It was for hooks like OnPlayerChat that I had to use the concommands to get information into the menu state.[/QUOTE] I meant calling error() to pass information to the menu state. :V
[QUOTE=James xX;47562377]So I have a hook being added in the menu instance: [lua] hook.Add( "OnPlayerChat", "Console3", function( player, strText, bTeamOnly, bPlayerIsDead ) local tab = {} if ( bPlayerIsDead ) then table.insert( tab, Color( 255, 30, 40 ) ) table.insert( tab, "*DEAD* " ) end if ( bTeamOnly ) then table.insert( tab, Color( 30, 160, 40 ) ) table.insert( tab, "( TEAM ) " ) end if ( IsValid( player ) ) then table.insert( tab, player ) else table.insert( tab, "Console" ) end table.insert( tab, Color( 255, 255, 255 ) ) table.insert( tab, ": "..strText ) console:Print( unpack(t)) console:Print( "player spoke") end) [/lua] and for some reason it isn't being called (even the "player spoke" isn't printing. I know this functions works however). any ideas? console is global, and I'm not getting any errors. I added in a Msg call which isn't being called, and I'm not overriding it.[/QUOTE] If you've tried using binary modules in the menu state, you would know that it has to be gmsv, which is server. Not sure if this has anything to do with it at all, but the hook is client side, not sure if you're able to use normal garry's mod functionality in the menu state, never really messed with it before.
[QUOTE=Luni;47563842]I meant calling error() to pass information to the menu state. :V[/QUOTE] Ah. Didn't think about that. [editline]20th April 2015[/editline] [QUOTE=Author.;47563888]If you've tried using binary modules in the menu state, you would know that it has to be gmsv, which is server. Not sure if this has anything to do with it at all, but the hook is client side, not sure if you're able to use normal garry's mod functionality in the menu state, never really messed with it before.[/QUOTE] I've already solved it.
Well ammo problems at this point being irrelevant, I must ask... I'm using Swep Construction Kit to make my weapons model... completely, the viewmodel is hidden via [code]SetMaterial( "engine/occlusionproxy" )[/code] So there's a problem. The bullets come from my [del]penis[/del] crotch. I want them to come from the muzzle of my SCK model. I kinda fixed this in first person with some crazy ironsights, but I haven't tested adding a muzzle flash yet. Third Person: [t]http://i.imgur.com/74dd2nf.png[/t] First Person: [t]http://i.imgur.com/fOSAZwf.png[/t] Trying to show the first-person muzzle location: [t]http://i.imgur.com/zoMkW8s.jpg[/t] Third person muzzle location: [t]http://i.imgur.com/kWdBVz1.jpg[/t] Screen resolution is low cus I ran in windows mode. So basically... is there a way that I can change the muzzle location to the appropriate model's muzzle?
Add an attachment with ID of 1 to your world model.
[QUOTE=Robotboy655;47565134]Add an attachment with ID of 1 to your world model.[/QUOTE] Swep Construction Kit. My world model is the bugbait lol, and my viewmodel is the gravity gun. I don't mean to sound rude, but please read my comment thoroughly before replying. Seriously, I don't want to sound rude, but I can't think of how else to word that.
[QUOTE=WalkingZombie;47565147]*clears throat* Swep Construction Kit. My world model is the bugbait lol[/QUOTE] Well, that's your problem. If you wanna make proper SWEPs, you gotta make proper models for them. I guess the only other solution is to not to shoot the bullet clientside ( or hide all tracers ) and then create the bullet effect manually.
Hey, uh, couldn't he use this? [url]http://wiki.garrysmod.com/page/WEAPON/GetTracerOrigin[/url] Or does that only work for firstperson or something?
Assuming TFA's right, how can I check if the player is in first or third person view? Checking if the viewer is just another player should be simple enough including code that uses LocalPlayer() == self.Owner I think
Sorry for the late reply, but the chat tags I'm using are [URL="http://forums.ulyssesmod.net/index.php/topic,6196.0.html"]http://forums.ulyssesmod.net/index.php/topic,6196.0.html[/URL] I can't see a problem with them other then maybe outdated code?
[QUOTE=alexjerta;47565810]Sorry for the late reply, but the chat tags I'm using are [URL="http://forums.ulyssesmod.net/index.php/topic,6196.0.html"]http://forums.ulyssesmod.net/index.php/topic,6196.0.html[/URL] I can't see a problem with them other then maybe outdated code?[/QUOTE] Strip down the whole update thing. Basicly in sv_ everything below AddCSLuaFile( "cl_chat_tags.lua" ) and in cl_ everything below local ADDON_NAME = "chat_prefixes" including the local ADDON_NAME if you aren't using the managed version, in cl_ everything below hook.Add("OnPlayerChat", "Tags", ChatTags)
I can't seem to get lua to refresh. The issue is happening in gamemode files, files in garrysmod/lua, and in addons. The issue affects entites, sweps, and non-entity related scripts alike. This is happening on both my desktop and my laptop and is fairly recent. Is there a setting somewhere that I'm not aware of?
[QUOTE=a1steaksa;47566550]I can't seem to get lua to refresh. The issue is happening in gamemode files, files in garrysmod/lua, and in addons. The issue affects entites, sweps, and non-entity related scripts alike. This is happening on both my desktop and my laptop and is fairly recent. Is there a setting somewhere that I'm not aware of?[/QUOTE] Are you on dev branch?
[QUOTE=Luni;47566608]Are you on dev branch?[/QUOTE] Not to my knowledge
Sorry, you need to Log In to post a reply to this thread.