That's kinda like the wiki, except actually helpful! Wow, lots of great info there; soooo much to learn. Thank you very much! If I have any other questions, I will definitely ask.
[QUOTE=PigeonPatrol;47855654]verify it's on the server and check for errors[/QUOTE]
Added if server check and now all the sounds do not play.
Is there no such thing as [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/NetworkVarNotify]Entity:NetworkVarNotify[/url] clientside?
looking to rewrite/redesign my store ui.
the code is an impossible-to-maintain mess and is also just over 2000 lines long, as it was made 4 years ago now.
id like to keep a similar theme but just make it look better, and not being a ui designer im not really sure what would be good. the idea was to have something kinda stylish and minimalist but the problem i find is that there's a ridiculous amount of empty space and you have to move your cursor half a screen of nothingness between pressing buttons.
suggestions welcome, wanting to keep the same style and elements but just rejigger it around so it looks more professional.
[img_thumb]http://cushie.net/sharex/a3166119cd91f6283e1e04cba74b3e20.jpg[/img_thumb]
[img_thumb]http://cushie.net/sharex/c4afbd0580a6f9dac23fc472b641b996.jpg[/img_thumb]
[img_thumb]http://cushie.net/sharex/9ee49e37c9483e3953c7fd6f98ff0e02.jpg[/img_thumb]
Is there any simple thing to get the current gmod version?
[QUOTE=Giraffen93;47859402]Is there no such thing as [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/NetworkVarNotify]Entity:NetworkVarNotify[/url] clientside?[/QUOTE]
[url]http://wiki.garrysmod.com/page/GM/EntityNetworkedVarChanged[/url]
This maybe.
[QUOTE=Busan1;47863796]Is there any simple thing to get the current gmod version?[/QUOTE]
[url]http://wiki.garrysmod.com/page/Global_Variables[/url]
[editline]2nd June 2015[/editline]
[IMG]http://i.imgur.com/n4FHacN.png[/IMG]
[QUOTE=zerf;47864068][url]http://wiki.garrysmod.com/page/Global_Variables[/url]
[editline]2nd June 2015[/editline]
[IMG]http://i.imgur.com/n4FHacN.png[/IMG][/QUOTE]
Thank you,
another question, how can I enable HorizontalScrollbar on DIconLayout? it seems like it worked on DIconList but it's not there for layout, and llist is decapricated
[QUOTE=thegrb93;47864012][url]http://wiki.garrysmod.com/page/GM/EntityNetworkedVarChanged[/url]
This maybe.[/QUOTE]
nope, that's where i got the idea from
only works on setnw*
I have a small problem, im making a xp/level system just to learn and ive gotten stuck :/
i have this:
local required = 1000
[code]
if ( self.experience >= self.required ) then
self:LevelUp()
self.required = self.required * 2
net.Start( "RequiredXP" )
net.WriteString( required )
net.WriteString( self.level + 1 )
net.Send( self )
end
[/code]
the problem is with self. However this if statement is inside a function which uses FindMetaTable( "Player" )
This is the error im getting:
[code]
[ERROR] addons/levels/lua/autorun/server/asd.lua:43: attempt to compare nil with number
1. HandlePlayerXP - addons/levels/lua/autorun/server/asd.lua:43
2. fn - addons/levels/lua/autorun/server/asd.lua:62
3. unknown - addons/ulib/lua/ulib/shared/hook.lua:179
[/code]
This is line 43, if ( self.experience >= self.required ) then
And I really dont understand why its nil...
uh.. how come the whole playersay hook gets wiped and/or duplicated when i save a file? it's super weird
Ok, this is annoying me. I have a sound I created, and it's a very loud sound, kind of like an explosion. I've managed to make it sound perfect, and if you're close enough, you can hear it.
However, there is a certain radius at which the sound cannot be heard from (too far away = not even an echo???). I have tested it with default HL2 sounds as well, so it's not just mine. The emitted sound cannot be heard past this radius, when in actuality one would be able to quite clearly hear it echoing everywhere. Is there a way to get this sound to basically play all over the map while still preserving the directional effect?
[QUOTE=Invule;47866354]I have a small problem, im making a xp/level system just to learn and ive gotten stuck :/
i have this:
[code]snip
[/code]
the problem is with self. However this if statement is inside a function which uses FindMetaTable( "Player" )
This is the error im getting:
[code]
[ERROR] addons/levels/lua/autorun/server/asd.lua:43: attempt to compare nil with number
1. HandlePlayerXP - addons/levels/lua/autorun/server/asd.lua:43
2. fn - addons/levels/lua/autorun/server/asd.lua:62
3. unknown - addons/ulib/lua/ulib/shared/hook.lua:179
[/code]
This is line 43, if ( self.experience >= self.required ) then
And I really dont understand why its nil...[/QUOTE]
you're trying to compare with [B]self.[/B]required, but the local variable you created is only 'required', i'm assuming you don't set self.required before the first time it tries to compare so it's nil?
try setting self.required to 1000 on the player when they spawn in
[QUOTE=Z0mb1n3;47866925]Ok, this is annoying me. I have a sound I created, and it's a very loud sound, kind of like an explosion. I've managed to make it sound perfect, and if you're close enough, you can hear it.
However, there is a certain radius at which the sound cannot be heard from (too far away = not even an echo???). I have tested it with default HL2 sounds as well, so it's not just mine. The emitted sound cannot be heard past this radius, when in actuality one would be able to quite clearly hear it echoing everywhere. Is there a way to get this sound to basically play all over the map while still preserving the directional effect?[/QUOTE]
you could try messing with soundscripts: [url]http://wiki.garrysmod.com/page/sound/Add[/url]
check out the SoundData structure through the page, in particular the 'level' property that corresponds with here: [url]https://developer.valvesoftware.com/wiki/Soundscripts#SoundLevel[/url]
never used them myself but sounds like thats your best bet for changing behavior of the sound in-game, but i feel like the distances are probably hard coded.
alternatively if it's not possible but important to you, you could do something like send the coordinates of the explosion to all players, do some distance checks and maths, and play an explosion sound at the right distance between the player and the explosion origin to get the direction/volume you want.
Hmm. My round system seems to be crashing the game. In the files that show why you crashed(named hl2_crash_2015_2 or something like that), I was able to find that it says: "Lua Panic! Something went horribly wrong!"stack overflow"". What does that necessarily mean? I'll give the code, I guess I'll have to remove some stuff to make it less-crash-prone?
[code]function StartRound()
RoundStarted = true
--net.Start("TellClientToPlayASound")
--net.Broadcast()
for k, v in pairs(player.GetAll()) do
v:SetTeam( TEAM_NILNONE ) --set everyone's team to the unassigned players
end
local pl = table.Random( player.GetAll() ) --get a random player
pl:JoinRebel() --make them the rebel
for k, v in pairs(team.GetPlayers(TEAM_NILNONE)) do --get everyone who's
--still on the unassigned team
v:JoinCombine() --and make all those players become combine
end
--GAMEMODE:SetRoundTimer( 180 )
end
function GM:Think()
if (!RoundStarted) and #player.GetAll() >= MinPlayers then
StartRound()
end
end
[/code]
Is this too data-heavy so that it might crash the game? What can I do to improve it?
[code]
function StartRound()
RoundStarted = true
--net.Start("TellClientToPlayASound")
--net.Broadcast()
for k, v in pairs(player.GetAll()) do
v:JoinCombine()
end
local pl = table.Random( player.GetAll() ) --get a random player
pl:JoinRebel() --make them the rebel
--GAMEMODE:SetRoundTimer( 180 )
end
function GM:PlayerAuthed()
if (!RoundStarted) and #player.GetAll() >= MinPlayers then
StartRound()
end
end
[/code]
Something like that might work.
[QUOTE=A Fghtr Pilot;47867982]Hmm. My round system seems to be crashing the game. In the files that show why you crashed(named hl2_crash_2015_2 or something like that), I was able to find that it says: "Lua Panic! Something went horribly wrong!"stack overflow"". What does that necessarily mean? I'll give the code, I guess I'll have to remove some stuff to make it less-crash-prone?
[code]-snip-
[/code]
Is this too data-heavy so that it might crash the game? What can I do to improve it?[/QUOTE]
from a lot of your posts i see, i feel like you are overly concerned about performance. i used to be the same way a few years ago because i was constantly worrying that everything i did was gonna put too much load on the server, but the game isnt gonna crash and burn as easily as you think. if you cant think of a better way to do it, do it how you are able to, and if when tested it causes performance issues, thats the point you should be concerned about removing it or finding another way.
as for your code, there is nothing i can see wrong unless for some reason 'RoundStarted' is being set straight back to false somewhere, as it will be doing multiple loops through all players every tick.
other than that it isn't heavy in the slightest. if you want to avoid making comparisons every tick then drop the functions that would be every tick into a 1s timer, since a delay of ~1s on rounds starting/ending is negligible.
[QUOTE=PigeonPatrol;47868012][code]
-snip-
[/code]
Something like that might work.[/QUOTE]
PlayerAuthed() wouldn't really be appropriate if he wants to use this to also start the round after the last finishes, you'd have to wait for a player to join before the next round would start
[QUOTE=Busan1;47865084]Thank you,
another question, how can I enable HorizontalScrollbar on DIconLayout? it seems like it worked on DIconList but it's not there for layout, and llist is decapricated[/QUOTE]
You'll have to use DScrollPanel for this.
[QUOTE=Cushie;47868103]stack overflows are often due to situations where you have accidentally created an infinite loop.[/QUOTE]
Stack overflows don't happen due to infinite loops, facepalm. They usually happen because of badly used or unintended recursion (either direct or indirect).
[QUOTE=mijyuoon;47868274]Stack overflows don't happen due to infinite loops, facepalm. They usually happen because of badly used or unintended recursion (either direct or indirect).[/QUOTE]
He said often, which is true.
[QUOTE=PigeonPatrol;47868295]He said often, which is true.[/QUOTE]
Wat? Stack overflows are NEVER caused by LOOPS. Implementations of loops don't even use stack.
[QUOTE=Robotboy655;47868263]You'll have to use DScrollPanel for this.[/QUOTE]
I have a [URL="http://wiki.garrysmod.com/page/Category:DScrollPanel"]DScrollPanel[/URL], and inside it I put a DIconLayout, but how can I enable Horizontal scrollbar for DScrollPanel?
DIconLayout:Dock(FILL) AFAIK
See my usage of DScrollPanel in my Lua main menu:
[url]https://github.com/robotboy655/gmod-lua-menu/search?utf8=%E2%9C%93&q=DScrollPanel[/url]
[QUOTE=PigeonPatrol;47868295]He said often, which is true.[/QUOTE]
[QUOTE=mijyuoon;47868274]Stack overflows don't happen due to infinite loops, facepalm. They usually happen because of badly used or unintended recursion (either direct or indirect).[/QUOTE]
he's right, although infinite recursion is technically an infinite loop, its not really the correct way to say it and it was just terrible terminology/brainfarts on my part, im at work and something came up midway through editing the sentence so i ended up finishing it off after i had lost my train of thought.
[QUOTE=Cushie;47867618]you're trying to compare with [B]self.[/B]required, but the local variable you created is only 'required', i'm assuming you don't set self.required before the first time it tries to compare so it's nil?
try setting self.required to 1000 on the player when they spawn in
[/QUOTE]
I got it working now, thanks!
[QUOTE=Robotboy655;47868731]DIconLayout:Dock(FILL) AFAIK
See my usage of DScrollPanel in my Lua main menu:
[url]https://github.com/robotboy655/gmod-lua-menu/search?utf8=%E2%9C%93&q=DScrollPanel[/url][/QUOTE]
I am unsure how to do it, where in the main menu is there a normal horizontal scrollbar? I tried to dock itemlayout, and scrollpanel, but it seems to make no change.
[QUOTE=Busan1;47871361]I am unsure how to do it, where in the main menu is there a normal horizontal scrollbar? I tried to dock itemlayout, and scrollpanel, but it seems to make no change.[/QUOTE]
Oh, you are talking about the horizontal one. Sorry, never had any use for it, so I don't know anything about it.
[QUOTE=James xX;47847092]Do matproxies not work on materials in the vgui/ folder or am I doing it wrong?[/QUOTE]
3 day bump
[QUOTE=James xX;47871987]3 day bump[/QUOTE]
They should work on all materials. I think TF2 does it with the Balloon land overlay.
[QUOTE=Robotboy655;47872057]They should work on all materials. I think TF2 does it with the Balloon land overlay.[/QUOTE]
For some reason the init function didn't get called on the material when it was placed in the vgui/logos/ folder, but did when it was placed in the notvgui/logos folder.
Anyone know what a good way to check if a SWEP's owner is sprinting is? I want to play an animation if the owner of the SWEP is sprinting, and I'm thinking that if I do it in a think hook it'll keep repeatedly playing the animation, theoretically...
Sorry, you need to Log In to post a reply to this thread.