Is there any way to re-size a texture with a variable in a .vmt? I don't want to have to take over 60 pictures again if resizing is an option.
Also, is there a way yet to make SWEPS usable by NPC's? I've got this in autorun...
[lua]list.Set( "NPCWeapons", "name of weapon", "print_name" )[/lua]
and This in my SWEP Base...
[lua]function SWEP:GetCapabilities()
return CAP_WEAPON_RANGE_ATTACK1, CAP_INNATE_RANGE_ATTACK1
end[/lua]
but I still can't get NPCs to use these weapons.
[QUOTE=Agent766;38762046]Is there any documentation on the new Awesomium panels? I've seen people using them, but I don't see any documentation on the wiki or anything.
[editline]9th December 2012[/editline]
More specifically, I'd like to create a HUD. How can I pass Lua variables to a DHTML panel.[/QUOTE]
[url]http://glua.me/bin/?path=/lua/vgui/dhtml.lua[/url]
Have a look over that
[QUOTE=zerothefallen;38761175]Hey, I noticed recently that the scoreboard for TTT has.. disappeared and pretty much is disorganized. I've been looking through the lua for evolve and I don't get if it's Evolve's fault or my own. What's broken?
It gives no errors, they just disappear. EG No dead players are showing, and my karma disappears, but everyone else is there. This isn't clientside because this happens for everyone.
[editline]9th December 2012[/editline]
Does evolve cause this?
[editline]9th December 2012[/editline]
Also this
[lua]
[ERROR] ...rortown/entities/weapons/weapon_ttt_flashbang/shared.lua:287: bad argument #1 to 'SetAngles' (Angle expected, got userdata)
1. SetAngles - [C]:-1
2. ThrowFar - ...rortown/entities/weapons/weapon_ttt_flashbang/shared.lua:287
3. unknown - ...rortown/entities/weapons/weapon_ttt_flashbang/shared.lua:211[/lua]
If you help me I'll have your children
[url]https://dl.dropbox.com/u/34091117/shared%202.lua[/url][/QUOTE]
ent:SetAngles (Vector(math.random(1,100),math.random(1,100),math.random(1,100)))
should be
ent:SetAngles (Angle(math.random(1,100),math.random(1,100),math.random(1,100)))
[lua]hook.Add("SetupSkyboxFog", "MyFog", function()
render.FogStart(0.00)
render.FogEnd(10000.00)
render.FogMaxDensity(0.90)
render.FogColor(0.60, 0.70, 0.80)
end)[/lua]
What am i doing wrong :(
[QUOTE=Jamies;38764407][lua]hook.Add("SetupSkyboxFog", "MyFog", function()
render.FogStart(0.00)
render.FogEnd(10000.00)
render.FogMaxDensity(0.90)
render.FogColor(0.60, 0.70, 0.80)
end)[/lua]
What am i doing wrong :([/QUOTE]
doesn't render have to target it?
What has gmod_vehicle_viewmode been replaced with?
My fix on the pokeball SWEP IS working, but it keeps making this error:
[CODE][ERROR] addons/baddog's pokeballs/lua/entities/pb_base/shared.lua:72: bad argument #1 to 'Create' (string expected, got userdata)
1. Create - [C]:-1
2. Release - addons/baddog's pokeballs/lua/entities/pb_base/shared.lua:72
3. unknown - addons/baddog's pokeballs/lua/entities/pb_base/shared.lua:51[/CODE]
The code to "store" the NPC for the pb_base works, but gives this:
NPC [174][npc_magnusson]
not
npc_magnusson
How do I fix this!?
[QUOTE=Turtle95;38764722]My fix on the pokeball SWEP IS working, but it keeps making this error:
[CODE][ERROR] addons/baddog's pokeballs/lua/entities/pb_base/shared.lua:72: bad argument #1 to 'Create' (string expected, got userdata)
1. Create - [C]:-1
2. Release - addons/baddog's pokeballs/lua/entities/pb_base/shared.lua:72
3. unknown - addons/baddog's pokeballs/lua/entities/pb_base/shared.lua:51[/CODE]
The code to "store" the NPC for the pb_base works, but gives this:
NPC [174][npc_magnusson]
not
npc_magnusson
How do I fix this!?[/QUOTE]
You're passing the entity, you need to be passing the entities class
For example ent where it should be ent:GetClass()
Can't really help you more than that without seeing some code
Could some one please help me with this code.
function AddDir(dir) // Recursively adds everything in a directory to be downloaded by client
local list = file.FindDir("../"..dir.."/*")
for _, fdir in pairs(list) do
if fdir != ".svn" then // Don't spam people with useless .svn folders
AddDir(dir.."/"..fdir)
end
end
for k,v in pairs(file.Find(dir.."/*", true)) do
resource.AddFile(dir.."/"..v)
end
end
I'm trying to make it so it downloads files from an addon any help would b appropriated thanks.
[QUOTE=Drakehawke;38764751]You're passing the entity, you need to be passing the entities class
For example ent where it should be ent:GetClass()
Can't really help you more than that without seeing some code[/QUOTE]
Thank you!! The last part is this, the DoColorstuff function
[CODE]function ENT:DoColorstuff(ent) --Hacky way of doing this, but it looks cool so what the hell
if ent and ent:IsValid() and ent:IsNPC() then
local r = 255
ent:SetMaterial( "models/props_combine/prtl_sky_sheet" )
timer.Simple(3.0, function() ent:Remove() end )
end
end[/CODE]
When this gets called (as in not commented out) it does NOT store the entity. Is there a way to store it AND remove the entity?
[b]What I want Done:[/b]
Modify this shop so that certain items can be only bought it certain ranks i.e Donator ranks (it already had admin only items, so I expect it wouldn't be too hard)
[url]http://www.facepunch.com/showthread.php?t=1228438[/url]
[b]Contact:[/b]
[url]http://steamcommunity.com/id/MrDarkKV/[/url]
Trying to make Alyx attack a player, she just follows me around. Is this not possible to do?
local ent = ents.Create("npc_alyx")
ent:Give("weapon_smg1")
ent:AddEntityRelationship(player.GetByID(1), 1, 99 )
ent:Spawn()
[QUOTE=kl0wn;38765233]Trying to make Alyx attack a player, she just follows me around. Is this not possible to do?
local ent = ents.Create("npc_alyx")
ent:Give("weapon_smg1")
ent:AddEntityRelationship(player.GetByID(1), 1, 99 )
ent:Spawn()[/QUOTE]
Make it so:
ent:Fire("setrelationship","player d_li 97", 1, 99)
Not sure, I used this in a remake of a SWEP. (a different way it was written)
What do I have to do to make a SENT's eyes movable? As it is now, my SENT's eyes are always locked onto the center point of the map (0,0,0), and trying to use Entity:SetEyeTarget() doesn't do anything at all, no matter where I call it or what I set it to. If I use the eye poser tool on it instead, it draws the lines from the SENT's eyes to the crosshair, but the eyes themselves never move. What am I supposed to do here? Is there something I have to set, or is this just not possible?
Hello everyone, can someone please tell me whats wrong with this line of code, it dosent seem to work.
Thanks on advance.
[CODE]hook.Add('PlayerDeath', 'PS_PlayerDeath', function(victim, inflictor, attacker)
if attacker:IsPlayer() and attacker:IsValid() and not victim == attacker then
attacker:PS_GivePoints(1, "killed " .. victim:Nick())
end
end)[/CODE]
[QUOTE=Turtle95;38765256]Make it so:
ent:Fire("setrelationship","player d_li 97", 1, 99)
Not sure, I used this in a remake of a SWEP. (a different way it was written)[/QUOTE]
Still unable to get anyone to attack me, I've tried every combo. If I spawn a combine and make him friendly he ignores me, if I spawn a combine and make him hate me he aims at me but doesn't fire at me.
Added two combine soldiers, made them hate each other, they'll punch each other but not shoot, they just stare each other down.
[QUOTE=DJarthas;38765385]Hello everyone, can someone please tell me whats wrong with this line of code, it dosent seem to work.
Thanks on advance.
[CODE]hook.Add('PlayerDeath', 'PS_PlayerDeath', function(victim, inflictor, attacker)
if attacker:IsPlayer() and attacker:IsValid() and not victim == attacker then
attacker:PS_GivePoints(1, "killed " .. victim:Nick())
end
end)[/CODE][/QUOTE]
[lua]and victim != attacker[/lua]
[QUOTE=kl0wn;38765693]Still unable to get anyone to attack me, I've tried every combo. If I spawn a combine and make him friendly he ignores me, if I spawn a combine and make him hate me he aims at me but doesn't fire at me.
Added two combine soldiers, made them hate each other, they'll punch each other but not shoot, they just stare each other down.[/QUOTE]
my bad, it's ent:Fire("setrelationship","player d_ht 97", 1, 99)
how do you change the projectile of a swep?
[QUOTE=Turtle95;38765801]my bad, it's ent:Fire("setrelationship","player d_ht 97", 1, 99)[/QUOTE]
Something else must be wrong, the npc's just stare at me with hatred but refuse to shoot. I'll keep reading through the wiki, or if anyone else has any suggestions. Thanks
Can someone help me. I've been trying to add custom props/models to my RP gamemode for example some drinks like these [url]http://www.garrysmod.org/downloads/?a=view&id=98695[/url]. After I downloaded them I. I putted them in model/drinks and materials/drinks in my content folder on my gamemode. After making a entity with the .mdl model it only showed the prop but not the material. So it was pink and black (texture error) Can someone please tell me why this is happening?
I need help with a my Slender gamemode im doing please pm me here or on skype pogoman1113
[QUOTE=Banana Lord.;38765716][lua]and victim != attacker[/lua][/QUOTE]
[CODE]hook.Add('PlayerDeath', 'PS_PlayerDeath', function(victim, inflictor, attacker)
if attacker:IsPlayer() and attacker:IsValid() and victim != attacker then
attacker:PS_GivePoints(1, "killed " .. victim:Nick())
end
end)
[/CODE]
So it should be like this?
How do I use ShouldCollide to determine weither the player is actually touching the thing, or just shooting at it?
I want it to block player movement but not traces (i.e, shots)
Want to spawn 5 npc's randomly in the map, and ensure that they do not spawn under or inside of the brush.
Was going to use a trace from above the terrain going straight down till it hit, add 64 to Z then use that point to spawn them, but not fully sure trace is even hitting the world...
Any place where I can find some help with traces?
More errors with this old swep!
[lua]
[ERROR] ...s/terrortown/entities/entities/ent_flashgrenade/init.lua:91: attempt to index a nil value
1. Explode - ...s/terrortown/entities/entities/ent_flashgrenade/init.lua:91
2. unknown - ...s/terrortown/entities/entities/ent_flashgrenade/init.lua:63
Timer Failed! [Simple][@gamemodes/terrortown/entities/entities/ent_flashgrenade/init.lua (line 57)][/lua]
[url]https://dl.dropbox.com/u/34091117/init.lua[/url]
I've attempted to look into this myself, but I don't see what's wrong. timer.simple has it's delay and function, but apparently it's wrong.
I edited it to this, this should work right?
[lua]
local func = function()
if self.Entity then
self:Explode()
end
timer.Simple(2, func)
end[/lua]
(@ posts on the bottom of first page)
Please, PLEASE use [[b][/b]lua] tags for code.
[QUOTE=Banana Lord.;38765716][lua]and victim != attacker[/lua][/QUOTE]
or even:
[lua]and not (victim == attacker)[/lua]
I don't know if this has been asked, but how do I get rid of the World Model on a SWEP?
This is rather annoying me,
I'm trying to store the NPC class on hitting them with the SENT, but if I remove them, the picked up SENT will be nill/null!
[CODE]function ENT:DoColorstuff(ent) --Hacky way of doing this, but it looks cool so what the hell
if IsValid(ent) and ent:IsNPC() then
local r = 255
ent:SetMaterial( "models/props_combine/prtl_sky_sheet" )
timer.Simple(0.1, function()
ent:SetColor(r, 0, 0, 255)
end)
timer.Simple(3.0, function()
ent:Remove()
end )
end
end[/CODE]
I tried setting it before removing, but it keeps on becoming null no matter what.
Sorry, you need to Log In to post a reply to this thread.