Page 3 of 7
Re: Age Building - Things to Remember
Posted: Mon Oct 28, 2013 12:03 am
by Deledrius
Karkadann wrote:Would it be possible to reverse engineer bits and pieces of Talahdan and the various associated plasma plug-in components to figure out how the Shootable component needs to be set up?
No need to reverse-engineer it, we have the code!
Re: Age Building - Things to Remember
Posted: Mon Oct 28, 2013 5:41 am
by Sirius
I've been studying how they did the thing in Teledahn. It's tricky, half of it is controlled by Python, the other half by the engine.
Never expect something simple or logical from Plasma
- Technical stuff Show Spoiler
Objects that can be hit by the gun must have physics (obviously), and must be of the LOSOnly MemberGroup. They have a responder modifier (triggered by Python) to play the hit sound.
Then there is some kind of "master object", which has a Dynamic Bullet Manager. It contains references to all the previous objects, two materials for the decal (a "realtime" and "preshade"), a reference to a particle emitter (to create smoke where the object is hit), and a few additional infos about how decals look.
Additionally, there are two objects for the waveset - a Dynamic Torpedo Manager and Dynamic Torpedo Vertex Shader Manager. These are for the low-rez and high-res water.
(Personally, I can't see any ripples created on the water in Teledahn - just the particle effect)
Then there is the Python. It uses two functions, PtRequestLOSScreen and PtShootBulletFrom...
PtRequestLOSScreen gives the Python script informations about which physical object can be seen at a certain point on the screen, at which distance, where in the 3D space, etc. Then the Python script triggers any responder modifier attached to the object (this is the responder modifier playing the sound, it doesn't create the decal/particles), and send a notify to Python scripts attached to the rocks, to tell them to break.
Additionally, there is PtShootBulletFromScreen, which triggers the Dynamic Bullet Manager for the physical objects at this point on the screen (and thus creates decal and particle effects). There is another function, PtShootBulletFromObject, which uses an object's coordinates (location and rotation) instead of a point on the screen.
It's weird, because calling PtShootBulletFromScreen from the KI command line does not create decals on objects (in both first and third person view). I couldn't say why... :?
So, quite a lot of stuff to setup. Plus, it probably requires creating an aiming system, which would also be quite hard.
The easiest solution would be to lock the gun on some device, which would force it to shoot a bullet in the same direction - this way you're sure it will hit a single object. Not half as fun, though.
Re: Age Building - Things to Remember
Posted: Mon Oct 28, 2013 12:05 pm
by Karkadann
Is this something you could help Calena set up if she was interested?
Re: Age Building - Things to Remember
Posted: Mon Oct 28, 2013 7:42 pm
by Calena
I've thought about this and if we do it I'd either add an entire new section on the age designed completely around shooting the gun or maybe even give it it's own age. I really need to get this Pirate Cave built for my grandson for Christmas since he's already asked for it

, but after that I'm game for trying to build this thing. I'd definitely need your help. I don't have the knowledge of the code Sirius has or the knowledge about the plugin that Karkadann has. I do have the ability to produce though

. I'm a building maniac and during the winter months, I spend WAY too much time building. Hey, if it keeps me happy and out of trouble, so be it. No complaints from me.
One thing we'll need is an idea for a gun that's built on a turret. It has to be eye level with the avatar, which normal pirate ship cannons really aren't.
Now, back to work shaping the second cave.
Re: Age Building - Things to Remember
Posted: Tue Oct 29, 2013 5:22 am
by Sirius
Okay, I'll see if I can get it working. I don't have Max, but as long as libHSPlasma can handle it, I can rig it manually.
I won't even bother making a turret to rotate the gun. Simple camera-panning will be enough for testing purpose.
Best of luck with your cave

Re: Age Building - Things to Remember
Posted: Tue Oct 29, 2013 12:47 pm
by dendwaler
One thing we'll need is an idea for a gun that's built on a turret.
Hmm, i builded something today.
Can you use it?
I made it in Riven style.
Its not textured yet.

Re: Age Building - Things to Remember
Posted: Tue Oct 29, 2013 1:37 pm
by Sirius
Real nice !
It surely feels Riven-ese, but I hardly see this thing on a boat... or it has to be a huge boat then
I doubt it could be used like Teledahn's vapor gun, because of the size and weight of the bullets (the game assumes they fly in a straight line, which probably isn't true in this case. And it doesn't even draw any bullet when firing the gun, just a particle effect).
The best way would be to make the bullet kickable (well, kicking it with your feet would probably hurt, though).
Then, you could set the linear velocity of the bullet with Python, which means we could REALLY fire the bullet in any direction, and watch it bounce on walls or push other kickables nearby

The problem is, this was only implemented in MOUL's API (to handle Jalak Dador's kickables). Which means it won't work on Complete Chronicles

Re: Age Building - Things to Remember
Posted: Thu Oct 31, 2013 3:10 pm
by Sirius
Alright, I managed to get it working !
I built a simple gun turret, with no animation. I simply use it as a clickable.
Then, when this turret is clicked, the Python script switches the view to a camera in front of the barrel, and disables avatar movement.
The player can still pan the camera to aim (this way I didn't have to rig manually a whole aiming system).
When the jump key is pressed, the script asks the engine to find the nearest object in the center of the screen (which means it can find the exact location of the impact, the name of the object and the distance to the camera). If this object has a responder or a python file attached, the script can trigger it (this is how rocks break and shrooms move when shot in Teledahn).
It also tells the game to trigger all the bullet managers of all objects on this path, which puts decals on all these objects. I didn't bother with particles, but since it's engine-managed, it should be easy to setup in Max.
It doesn't have sounds, since they are handled by responders, but again it should be easy to setup.
- Show Spoiler
[attachment=0]shootingthewall.png[/attachment]
Yeah, I used a random texture for the decal...
Re: Age Building - Things to Remember
Posted: Fri Nov 01, 2013 11:17 am
by Karkadann
I Using Max If you think I can help set up a tutorial
Re: Age Building - Things to Remember
Posted: Fri Nov 01, 2013 9:52 pm
by Calena
Well . . . umm . . . . okay /me says as I crawl around on the floor trying to pick up the pieces of what's left of my ego

.
Holy smokes! You guys don't mess around when you get an idea, do you?!!! One day Sirius says "it's really complicated". The next thing we know, denDwaler shows up with an outrageously cool gun and Sirius has the whole thing figured out and working

. I am officially impressed . . . and thinking we could have a whole lot of fun building something with this.
But I have a Pirate Cave to build before I can do anything else. Let me know if there's anything I can pitch in with in the meantime.