[QUOTE=CrAzYfReAk101;48159262]Might be a dumb question, but I'm not gonna get anywhere if I don't ask.
I'm fiddling with Nutscript 1.1 after a long while, and I'm trying to use the in-game Config menu to change the Menu Music. By default, I'm sure most of you know, the default menu music is located at 'music/hl2_song2.mp3'. I added my own music which I put into a folder in my Addons, to which I would assume the line would be along the lines of 'addons/warneverchangescontent/music/menutheme.mp3' However when I enter this it does not stick. It will say it has set the music to said line, but when I go back in the Config menu to double check it's still set to 'music/hl2_song2.mp3'.
Any suggestions or aid would be greatly appreciated, as this is quite an annoyance.
UPDATE: I found this console error to pop up when entering the Menu.
2 BASS_ERROR_FILEOPEN[/QUOTE]
the config menu visually resets the defaults when you reopen it but the things themselves self do change, and that BASS error is what I was going until I got the proper location of the sound, I don't know exactly all about your case but my config says: 'song/<songname>.mp3' and my file is in 'sounds/song/<songname>.mp3' - so maybe try that even though it's in an addon, and if that doesn't work you could just separate the song and put it on fastdl rather than in an addon
[QUOTE=Smt;48159434]the config menu visually resets the defaults when you reopen it but the things themselves self do change, and that BASS error is what I was going until I got the proper location of the sound, I don't know exactly all about your case but my config says: 'song/<songname>.mp3' and my file is in 'sounds/song/<songname>.mp3' - so maybe try that even though it's in an addon, and if that doesn't work you could just separate the song and put it on fastdl rather than in an addon[/QUOTE]
I tried that, didn't really see much of a change. I also tried playing the sound via the console, and to no avail.
] play addons/warneverchangescontent/sounds/music/menutheme.wav
Failed to load sound "addons\warneverchangescontent\sounds\music\menutheme.wav", file probably missing from disk/repository
I don't know if I'm pathing it incorrectly or what, but it's being a pain. It's formatted correctly at 44100hz, it's a Wav... So yeah, I'm stumped.
the contents of the addons folder act as if they're in the regular gmod folder, you'll just want it to be 'sounds/music/menutheme.wav'
[QUOTE=a-cookie;48159537]the contents of the addons folder act as if they're in the regular gmod folder, you'll just want it to be 'sounds/music/menutheme.wav'[/QUOTE]
No dice. Same old error message. File missing when it's obviously not.
[QUOTE=CrAzYfReAk101;48159732]No dice. Same old error message. File missing when it's obviously not.[/QUOTE]
If I remember correctly, you don't need the 'sounds/' part of the filepath, either.
[QUOTE=Z0mb1n3;48160410]If I remember correctly, you don't need the 'sounds/' part of the filepath, either.[/QUOTE]
Also nothing. I even made an MP3 copy of the sound just in case.
] play music/menutheme.mp3
Create Stream Failed error 41
Failed to load sound "music\menutheme.mp3", file probably missing from disk/repository
Did you resource.AddFile it so it downloads?
[QUOTE=Chessnut;48161816]Did you resource.AddFile it so it downloads?[/QUOTE]
I'm not familiar with what this is; I'm testing my gamemode via Singleplayer.
My servers char inventory you cant equip anything in inventory even the flashlight thats apart of the plugin, any reasons why?
Did you check the server console?
[QUOTE=Chessnut;48191964]Did you check the server console?[/QUOTE]
Yeah and there are not any errors, you buy the flashlight via Business and then in inventory you right lick and it only says drop, and you cant equip it at all...
Update: I got the inventory stuff fixed but I cant get props to persist
Hold C and right click the prop to persist.
Any reason ITEM:getDesc() can't handle a percentage sign?
[QUOTE=Chessnut;48193729]Hold C and right click the prop to persist.[/QUOTE]
We did that but when the server restarts the props disappear..
try restarting your server by typing 'quit' in the server's console, or 'changelevel' to whatever the current map is to reload it, simply killing the server doesn't tell it to save data
-snip-
Is there an easy way of adding tabs to the F1 menu?
So I want to add a couple of languages for players to speak ICly. I made a really simple, quick start that really anybody could make, it's just a normal chat command:
[code]
nut.chat.register("jpn", {
format = "%s says in Japanese \"%s\"",
onGetColor = function(speaker, text)
return Color(102, 153, 204)
end,
onCanHear = nut.config.get("chatRange", 280),
prefix = {"/jpn", "/japanese"}
})
[/code]
Obviously, anybody can hear that.
I want to make it so that if player has flag "J" they can understand and speak the language. Any pointers on where to start as to incorporating it into a chat command?
[QUOTE=Shadico;48211793]So I want to add a couple of languages for players to speak ICly. I made a really simple, quick start that really anybody could make, it's just a normal chat command:
[code]
nut.chat.register("jpn", {
format = "%s says in Japanese \"%s\"",
onGetColor = function(speaker, text)
return Color(102, 153, 204)
end,
onCanHear = nut.config.get("chatRange", 280),
prefix = {"/jpn", "/japanese"}
})
[/code]
Obviously, anybody can hear that.
I want to make it so that if player has flag "J" they can understand and speak the language. Any pointers on where to start as to incorporating it into a chat command?[/QUOTE]
Couldn't you...
[code]
--[[untested]]--
nut.chat.register("jpn", {
format = "%s says in Japanese \"%s\"",
onGetColor = function(speaker, text)
return Color(102, 153, 204)
end,
onCanHear = function(speaker,listener)
if(listener:hasFlags("J")) return true end
end,
prefix = {"/jpn", "/japanese"}
})
[/code]
I had to pop a "then" on the if hasflags statement, but then once I used it I got this error in console.
[code]
[ERROR] gamemodes/cyberpunk/plugins/jap.lua:12: attempt to call method 'hasFlags' (a nil value)
1. onCanHear - gamemodes/cyberpunk/plugins/jap.lua:12
2. send - gamemodes/nutscript/gamemode/core/libs/sh_chatbox.lua:155
3. Run - gamemodes/nutscript/gamemode/core/hooks/sv_hooks.lua:242
4. unknown - gamemodes/nutscript/plugins/chatbox/sh_plugin.lua:69
5. func - gamemodes/nutscript/gamemode/core/libs/external/sh_netstream2.lua:117
6. unknown - lua/includes/extensions/net.lua:32
[/code]
Seems that the "listener" variable (if there actually is one? I didn't find anything on the wiki) doesn't register the hasFlags check.
try
[lua]listener:getChar():hasFlags("J")[/lua]
[QUOTE=Johnny Guitar;48217032]try
[lua]listener:getChar():hasFlags("J")[/lua][/QUOTE]
This worked, thanks a ton! I also added a variable to make sure that the player needs the J flag to use the command. The only thing I need now is a way for the chat to print "%s says something in Japanese." if the listener doesn't have the J flag. Any pointers on that...? I remember there being a Vortigese plugin for 1.0 that did something similar.
[code]
nut.chat.register("jpn", {
onCanSay = function(speaker, text)
return speaker:getChar():hasFlags("J")
end,
format = "%s says in Japanese \"%s\"",
onGetColor = function(speaker, text)
return Color(102, 153, 204)
end,
onCanHear = function(speaker,listener)
if listener:getChar():hasFlags("J") then return true end
end,
prefix = {"/jpn", "/japanese"}
})
[/code]
[QUOTE=Shadico;48217201]This worked, thanks a ton! I also added a variable to make sure that the player needs the J flag to use the command. The only thing I need now is a way for the chat to print "%s says something in Japanese." if the listener doesn't have the J flag. Any pointers on that...? I remember there being a Vortigese plugin for 1.0 that did something similar.
[code]
nut.chat.register("jpn", {
onCanSay = function(speaker, text)
return speaker:getChar():hasFlags("J")
end,
format = "%s says in Japanese \"%s\"",
onGetColor = function(speaker, text)
return Color(102, 153, 204)
end,
onCanHear = function(speaker,listener)
if listener:getChar():hasFlags("J") then return true end
end,
prefix = {"/jpn", "/japanese"}
})
[/code][/QUOTE]
[lua]nut.chat.register("jpn", {
onCanSay = function(speaker, text)
return speaker:getChar():hasFlags("J")
end,
onChatAdd = function(speaker, text)
if (LocalPlayer():getChar():hasFlags("J")) then
chat.AddText(speaker.."says in Japanese"..text)
else
chat.AddText(speaker.."speaks in Japanese")
end
end,
format = "%s says in Japanese \"%s\"",
onGetColor = function(speaker, text)
return Color(102, 153, 204)
end,
prefix = {"/jpn", "/japanese"}
})[/lua]
Sorry for the late reply, try this. I've implemented languages into NS 1.0 before and this is similar how I did it. If it doesn't work come back to me with errors or [URL="http://steamcommunity.com/id/252535313373423/"]Add me on steam.[/URL]
If you add me on steam and I help you there, please post the solution on here if I do not remember to do so first.
[QUOTE=soliv;47876365]Apparently NS1.1 really hates strings for ACT_ , even the default Combine Soldier has animation issues.
Looks like it tries to switch between two animations (T-Pose and Default standing)
[vid]http://crg-community.com/shit/2.webm[/vid]
Do you guys have the same issue?
[lua] [ACT_MP_STAND_IDLE] = {"idle_unarmed", ACT_IDLE_ANGRY} [/lua][/QUOTE]
Just came across this same issue when I started to fix animations for some of the TnB models using nut.anim.setModelClass.
Also, Johnny Guitar's code more or less worked, though in the function replace "speaker" with "speaker:getChar():getName()", no quotes. The string should look something like this:
[code]onChatAdd = function(speaker, text)
if (LocalPlayer():getChar():hasFlags("J")) then
chat.AddText(nut.config.get("chatColor"),speaker:getChar():getName()..' says in Japanese "'..text..'"')
else
chat.AddText(nut.config.get("chatColor"),speaker:getChar():getName().." says something in Japanese.")
end
end,
[/code]
You can just use speaker:Name()
Sequences are borked inside of animation tables for movement. You can translate all sequences to activity names, though.
Entity():GetSequenceActivityName()