Old 11-18-2008   #11 (permalink)
Newbie
 
NEDM_Insane's Avatar
 

Join Date: Nov 2008
Posts: 9
NEDM_Insane is on a distinguished road
Default Re: ION Cannon

Quote:
Originally Posted by SERPENT711 View Post
It isn't working because by using {table, value} you are making a table with "table" and "value" as its members and passing that 1 table to the insert method. Try using:

Code:
table:insert( table,value )
Which passes the arguments table and value as separate arguments instead of as 1 table.
That didnt work it gave me an error that said:

Bad argument #1 (expected number, got table)

Then i did:

table.insert (params.CVars, "blah(actually code)")

then got (table expected, got nil).... WTF?
NEDM_Insane is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 11-18-2008   #12 (permalink)
Advanced Member
 
itsbth's Avatar
 

Join Date: Feb 2007
Location: Norway
Posts: 280
itsbth is on a distinguished road
Send a message via MSN to itsbth
Default Re: ION Cannon

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.
itsbth is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-18-2008   #13 (permalink)
Advanced Member
 
singilli's Avatar
 

Join Date: Jun 2007
Posts: 184
singilli is on a distinguished road
Default Re: ION Cannon

Is it any good ?
singilli is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-18-2008   #14 (permalink)
Newbie
 
NEDM_Insane's Avatar
 

Join Date: Nov 2008
Posts: 9
NEDM_Insane is on a distinguished road
Default Re: ION Cannon

Quote:
Originally Posted by itsbth View Post
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)).
Ok i changed CVars to pluh so now it looks like:

Code:
table.insert{ params.pluh, "code here"}
But i got another error that said i didn't have the right amount of arguments.


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"}
pluh = CVars... i just changed it.
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
NEDM_Insane is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-22-2008   #15 (permalink)
Newbie
 
NEDM_Insane's Avatar
 

Join Date: Nov 2008
Posts: 9
NEDM_Insane is on a distinguished road
Default Re: ION Cannon

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
shared:
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"
init:
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
So why won't it spawn?
NEDM_Insane is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-22-2008   #16 (permalink)
Member
 
Wodden's Avatar
 

Join Date: Sep 2007
Location: Leipzig, Germany
Posts: 59
Wodden is on a distinguished road
Send a message via ICQ to Wodden Send a message via MSN to Wodden Send a message via Skype™ to Wodden
Default Re: ION Cannon

Quote:
Originally Posted by NEDM_Insane View Post
Code:
local ent = ents.Create( "ION Cannon" )
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:
Originally Posted by l3ulletje View Post
Jeez you sure had fun with colours and fonts and underlines and bolds and aaarrgh eyes... the pain! the pain!
My IQ is 117

████████
████████
████
███
Wodden is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-22-2008   #17 (permalink)
Advanced Member
 
itsbth's Avatar
 

Join Date: Feb 2007
Location: Norway
Posts: 280
itsbth is on a distinguished road
Send a message via MSN to itsbth
Default Re: ION Cannon

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.
itsbth is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-23-2008   #18 (permalink)
Advanced Member
 
CAANz's Avatar
 

Join Date: Mar 2008
Location: On the planet Earth... Simple is that.
Posts: 182
CAANz is on a distinguished road
Send a message via MSN to CAANz
Default Re: ION Cannon

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...
CAANz is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -7. The time now is 11:50 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.

Page top