|
| | #11 (permalink) | |
| Newbie ![]() Join Date: Nov 2008
Posts: 9
![]() | Quote:
Bad argument #1 (expected number, got table) Then i did: table.insert (params.CVars, "blah(actually code)") then got (table expected, got nil).... WTF? | |
| | |
| Sponsored Links | |
| | #12 (permalink) |
| Advanced Member ![]() | params.CVars is nil... Try to find out why. (And BTW, you are missing the language strings "#No sound", "#Zap1", "#Zap2", "#Zap3". Remove the # if you don't want to use localization (though you should use it)).
__________________ Wire developer. Currently working at: Topaz (A scripting language written in Lua) <Fox682> itsbot: follow the white rabbit <ITSBOT> i don't want to follow that. |
| | |
| | #14 (permalink) | |
| Newbie ![]() Join Date: Nov 2008
Posts: 9
![]() | Quote:
Code: table.insert{ params.pluh, "code here"}
EDIT: OK I changed a few things around here. this is my table code: Code: table.insert{params.pluh,"wire_IONCannon_delay"}
table.insert{params.pluh,"wire_IONCannon_damage"}
table.insert{params.pluh,"wire_IONCannon_sound"}
table.insert{params.pluh,"wire_IONCannon_auto"}
Ok now im getting this error, i think its because i need to build the actual ION Cannon right? weapons\gmod_tool\stool.lua:77: attempt to concatenate local 'property' (a table value) Last edited by NEDM_Insane; 11-18-2008 at 06:06 PM.. Reason: added stuffs | |
| | |
| | #15 (permalink) |
| Newbie ![]() Join Date: Nov 2008
Posts: 9
![]() | ok worked on this a few days: cl_init: Code: include('shared.lua')
ENT.Spawnable = false
ENT.AdminSpawnable = false
ENT.RenderGroup = RENDERGROUP_OPAQUE
function ENT:GetOverlayText()
return self:GetPlayerName()
end
Code: ENT.Type = "anim" ENT.Base = "base_wire_entity" ENT.PrintName = "ION Cannon" ENT.Author = "NEDM_Insane" ENT.Contact = "Steam: NEDM_Insane E-Mail: InsaneHL@comacst.net" Code: AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include('shared.lua')
ENT.WireDebugName = "ION Cannon"
function ENT:Initialize()
self.Model = "models/props_c17/lampShade001a.mdl"
self.Entity:SetModel( "models/props_c17/lampShade001a.mdl" )
self.hires = false
self.Entity:PhysicsInit( SOLID_VPHYSICS )
self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
self.Entity:SetSolid( SOLID_VPHYSICS )
self.Entity:SetColor(255,0,0,255)
self.Entity:DrawShadow( false )
local phys = self.Entity:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
phys:SetDragCoefficient ( 10 )
end
self.Inputs = Wire_CreateInputs ("R" "B" "G" "Fire")
end
function ENT:SpawnFunction( ply, tr)
if ( !tr.Hit ) then return end
local SpawnPos = tr.HitPos + tr.HitNormal * 16
local ent = ents.Create( "ION Cannon" )
ent:SetPos( SpawnPos )
ent:Spawn()
ent:Activate()
return ent
end
-- Damage from the ION cannon
function ENT:SetDamage( i )
self.Damage = i
end
function ENT:GetDamage()
return
end
-- Delay on ION cannon (if set to auto)
function ENT:SetDelay( i )
if self.Auto == 1 then
self.Delay = i
end
end
function ENT:GetDelay()
return self.Delay
end
-- Sound IONs make
function ENT:SetSound( str )
self.Sound = str
end
function ENT:GetSound()
return self.Sound
end
function ENT:Setup (out_dist, out_color, out_ang, out_pos, Range)
self.out_dist = out_dist
self.out_color = out_color
self.out_ang = out_ang
self.out_pos = out_pos
self:SetBeamLength(Range)
self.PrevOutput = nil
self.Inputs.SelectValue.Value = 0
end
function ENT:TriggerInput(ingame, value)
if (iname == "A" ) then
if (value ~= 0) then
local vStart = self.Entity:GetPos()
local vForward = self.Entity:GetUp()
local trace = {}
trace.start = vStart
trace.endpos = vStart + (vForward * self:GetBeamLength() & )
local trace = util.TraceLine( trace )
end
end
end
|
| | |
| | #16 (permalink) | |
| Member ![]() | Whats your entitys folder name? I think it's ion_cannon or something. Usage of ents.Create: Code: ents.Create("Entity folder name here") e.g. ents.Create("prop_combine_ball)
__________________ ![]() ------Sorry for my bad english im german.------ Quote:
████████ ████████ ████████ | |
| | |
| | #17 (permalink) |
| Advanced Member ![]() | USE () NOT {} WHEN CALLING FUNCTIONS! Unless you know what you're doing, which you obviously don't
__________________ Wire developer. Currently working at: Topaz (A scripting language written in Lua) <Fox682> itsbot: follow the white rabbit <ITSBOT> i don't want to follow that. |
| | |
| | #18 (permalink) |
| Advanced Member ![]() | Use GCFScape to find some better sounds.
__________________ Steps to take before asking about a broken wiremod or tools. ![]() Don't Read This! If you did you lose... |
| | |
| Sponsored Links | |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|