Game Development Community

Lasers....again

by John Smart · in Torque Game Engine · 10/23/2005 (3:25 pm) · 13 replies

Hi Guys,

I have been working on getting a laser into TGE v1.3.

I scanned the forums and found a few resources. I downloaded one called LaserBeta1 and that works fine, but (yes there is always a but) the auther has recomplied the engine and not included what he has changed ( i have emailed him but no reply as of yet)

The next one i tried was good old Derek Adams laser and i have complied the engine with no errors and i have made changes and scanned his resourse post on this. but i still can't get it to work. I did notice on this thread that another person has the same issue as me but no one could fix it hehehe. It was due to them using 1.3

So my question is. Is it possible to create a laser type weapon based on scripts and not have to recomplie. I ask this because i have to recomplie the engine to give me torso twist and i am using the tank pack + later i will be adding my own functions i am not to clever with C so i like to do as much as i can outside the main engine as possible.

For my project i have got cars, plane, helecopters, Tanks (thanks bravetree) and all the normal type guns. the things i need to get working are lasers and missiles, guided and unguided.

if anyone has a nice resourse out there on a laser type weapon based on scripts or even a nice and easy complie please can you point me in the right direction.

I am still going through all of the resources just in case the search function missed something and i might get lucky.

Cheers
John Smart

#1
10/23/2005 (3:42 pm)
I believe that would sadly be impossible. The only possible way to do it is to have a long jpg and somehow cut it off where it hits the guy and I don't know how you would do that. You definetely could do it with C++ and there is a resource out http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8006 there which a nice resource search for "laser" found.
#2
10/23/2005 (4:07 pm)
Tribes 2 had lasers :)
#3
10/23/2005 (5:47 pm)
Not impossible at all.

I would go for the Tribes 2 method.
#4
10/23/2005 (7:47 pm)
Yes, but the Tribes 2 method uses a differnt projectile type, which is built into the t2 source(and not in torque) so...its pretty much impossible using Script, gonna need to use some source changes...
#5
10/23/2005 (9:51 pm)
Hum I wonder how Tim A. did the lasers in his 4/05 warzone demo thing.

Also maybe with TSE you could put a glow shader on a bullet.
#6
10/23/2005 (10:26 pm)
I have bought some of Tim A packs i will ask him see if he can point me in the right direction, i have found another laser resoure if any one is interested http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3917 i am compiling the engine now and seeing if i can get it to work.
#7
10/23/2005 (11:03 pm)
//------------------------------------------------------------------------------
// Console onEditorRender functions:
//------------------------------------------------------------------------------
// Functions:
//   - renderSphere([pos], [radius], <sphereLevel>);
//   - renderCircle([pos], [normal], [radius], <segments>);
//   - renderTriangle([pnt], [pnt], [pnt]);
//   - renderLine([start], [end], <thickness>);
//
// Variables:
//   - consoleFrameColor - line prims are rendered with this
//   - consoleFillColor
//   - consoleSphereLevel - level of polyhedron subdivision
//   - consoleCircleSegments
//   - consoleLineWidth
//------------------------------------------------------------------------------

function SpawnSphere::onEditorRender(%this, %editor, %selected, %expanded)
{
   if(%selected $= "true")
   {
      %editor.consoleFrameColor = "255 0 0";
      %editor.consoleFillColor = "0 0 0 0";
      %editor.renderSphere(%this.getWorldBoxCenter(), %this.radius, 1);
   }
}

Does this help at all? I found it kinda a hidden gem.
#8
10/24/2005 (2:07 am)
Awesome, thanks Chris =)
#9
10/24/2005 (3:35 am)
Won't that draw a line of even thickness into the distance so it appears to get fatter as it gets further away?..
#10
10/24/2005 (4:51 am)
Hi Guys,

OK call me thick, where does that code go? and is there any more on what that function is relating to? the function SpawnShere i thought was to with spawning a player, at the mo i am stuck at work so i can't play with it but thanks for the code all i need to do is understand it hehehehe.

Cheers
John
#11
10/24/2005 (5:56 am)
Unless I'm as thick as a whale omlette, That code is just a demnstrates of how to call one of the 4 hidden functions, the SpawnSphere code is just for demonstration of scripting convention.
#12
10/24/2005 (6:55 am)
Jason i doubt your as thick as me heheheh. i will use this template and give it a whirle never know i might surprise myself and get it working.
#13
10/24/2005 (12:21 pm)
Its taken from creator/scripts/editorrender.cs that script when you select an object ingame, thats the script that makes the little sphere. I just thought it may be useful thats all.