[Need Help - Weapons] - I need a 'peer to peer' beam
by Nicolai Dutka · in Torque Game Engine Advanced · 03/10/2010 (8:02 pm) · 3 replies
Basically, what I am looking for is a weapon that fires out a normal projectile, but onCollision, it checks the object it hit to see if it is a specific object, we'll call it 'magnetic':
I need some code in there that will create a beam connecting the player to the object that the projectile collided with. The beam will stay on until the player disengages it through a button press on the keyboard.
The 'activate()' function already works and knows what type of object we're dealing with and does it's thing, but doesn't create the beam...
Lastly, the 'magnetic' object will be an AIPlayer with the ability to move around, so the beam has to be able to stay connected no matter where the AIPlayer moves to.
How would I go about creating the beam? I'm looking for something along the lines of this:
gizmodo.com/assets/resources/2007/10/lightning.jpg
if(%col.magnetic){
activate();
}I need some code in there that will create a beam connecting the player to the object that the projectile collided with. The beam will stay on until the player disengages it through a button press on the keyboard.
The 'activate()' function already works and knows what type of object we're dealing with and does it's thing, but doesn't create the beam...
Lastly, the 'magnetic' object will be an AIPlayer with the ability to move around, so the beam has to be able to stay connected no matter where the AIPlayer moves to.
How would I go about creating the beam? I'm looking for something along the lines of this:
gizmodo.com/assets/resources/2007/10/lightning.jpg
#2
Any ideas there?
03/17/2010 (10:35 am)
I'm looking more for a way to do this through script only, no engine code...Any ideas there?
#3
03/17/2010 (10:38 am)
Along similar lines, I also would like to create a 'lightning gun' that fires out bolts of lightning that look like that picture in the first post. I've already got a "lightning gun" in the game and firing projectiles that can stun/shock enemies and game objects, but the projectile doesn't look at all how I wanted it... I need it to look like that pic almost exactly... (Like a Ghostbusters style beam weapon...)
Associate Rene Damm
You could probably abduct some of the lightning code for this. In particular, LightningBolt pretty much has the code for generating a lightning path between two points and rendering it. This could probably be easily adapted to create the bream here.