Data Realms Fan Forums http://45.55.195.193/ |
|
Emitters & TDExplosives http://45.55.195.193/viewtopic.php?f=1&t=31871 |
Page 1 of 2 |
Author: | ShadowStorm [ Fri Oct 05, 2012 10:35 pm ] |
Post subject: | Emitters & TDExplosives |
Alright, so I have a few questions about a 'grenade'(It's not really a grenade, but it IS a TDExplosive) i'm making. Solved by myself. Solved by 4zK. Thanks! Solved by Shook. Thanks! Solved by 4zK. 4 - How do you gib AEmitters? Adding "AddGib = Gib..." to the end of my emitter doesnt work, as soon as it stops emitting it just disappears. |
Author: | 4zK [ Fri Oct 05, 2012 10:41 pm ] |
Post subject: | Re: Emitters & TDExplosives |
What exactly are you making? |
Author: | ShadowStorm [ Fri Oct 05, 2012 10:48 pm ] |
Post subject: | Re: Emitters & TDExplosives |
A grenade in the shape of a turret but with the gun barrels inside, which on detonation, spawns a emitter in place of it with a sprite where the barrels extended and fires a barrage of bullets in both left and right directions for a duration of 5 seconds. Mainly used for bunker clearing. Pretty much the thing that Leon used in RE Retribution on the elevator scene. |
Author: | 4zK [ Fri Oct 05, 2012 11:03 pm ] |
Post subject: | Re: Emitters & TDExplosives |
Eh, you mean a turret in the shape of a grenade? ![]() Anyhoo, you could do it by making the grenade have a MOSRotating payload - the MOSRo having two AEmitters attached to it, one that emits bullets to the left, the other to the right. The grenade script(s) (e.g. TimedFuze.lua) can apply the same rotation angle of the grenade to the payload upon detonation, but if you want it to always shoot horizontally, you wouldn't need to apply that, as it would spawn upright by default. The rotation angle of the grenade itself doesn't really matter. Please do ask me if you need help with specifics. ...or whether you'd like me to do it for you EDIT: Ehh, you can set the rotation angle of the emission with this: Code: EmissionAngle = Matrix AngleDegrees = x The starting point of where the degrees are count is the right horizontal side. So 0 would be to the right, 180 to the left. |
Author: | ShadowStorm [ Fri Oct 05, 2012 11:29 pm ] |
Post subject: | Re: Emitters & TDExplosives |
Alrighty, that information you have given is very valuable. I have another question though, how do I attach a sound to the emitter for each shot fired? |
Author: | 4zK [ Fri Oct 05, 2012 11:33 pm ] |
Post subject: | Re: Emitters & TDExplosives |
An easy way to make the sounds is to use a gunfire loop, but in case there isn't one available - I can make you a script for the bullets to make a sound every time they are created. EDIT: Attachment:
File comment: Add this to the particle/bullet being emitted. ![]() Downloaded 226 times You can take a look at the M1 Garand ding sound in the Ronin Rifles.ini for a template for a sound effect emitter. |
Author: | ShadowStorm [ Fri Oct 05, 2012 11:47 pm ] |
Post subject: | Re: Emitters & TDExplosives |
I'll leave that decision in your hands, because I don't want to bother people to make scripts if they are preoccupied with other things. So if you make it, I'll take it. If not, it doesn't matter to me, because the gun loop sounds like a idea that works for me! |
Author: | 4zK [ Fri Oct 05, 2012 11:49 pm ] |
Post subject: | Re: Emitters & TDExplosives |
Haha, don't worry, that's only barely 5 lines of lua ![]() |
Author: | ShadowStorm [ Fri Oct 05, 2012 11:55 pm ] |
Post subject: | Re: Emitters & TDExplosives |
Test phase 1 compete. (Tears to my eyes, because things I make usually take another 10 edits for it to work). Now to add sound, revise the sprite, maybe change the angle and soon it will be done! EDIT: The only thing I can't figure out still, is the non rotating grenade |
Author: | 4zK [ Sat Oct 06, 2012 12:30 am ] |
Post subject: | Re: Emitters & TDExplosives |
Why mustn't the grenade rotate? The turret phase can always spawn upright. |
Author: | ShadowStorm [ Sat Oct 06, 2012 7:26 am ] |
Post subject: | Re: Emitters & TDExplosives |
Unfortunately (probably because I didn't/don't know how to, use mosrotating) the AEmitter spawns at the same angle as the grenade. |
Author: | 4zK [ Sat Oct 06, 2012 12:44 pm ] |
Post subject: | Re: Emitters & TDExplosives |
You can send me the .lua/.ini files if you want me to take a closer look at it. |
Author: | Shook [ Sat Oct 06, 2012 1:00 pm ] |
Post subject: | Re: Emitters & TDExplosives |
ShadowStorm wrote: 1 - Is it possible to limit a emitter to fire it's particles in a 45 degree range(22.5 above and below 0 degrees) You mean like a cone? Because in that case, spread is defined in double-radians (which is silly, should just be normal radians :c), meaning that pi equals a completely radial spread (as in 360 degrees). To get a 45 degree angle, you just divide pi by 8 (approximately 0,393) and put it as the spread. That oughta give you a neat 45 degree cone of fire. Also, if you want to be completely sure that it's always oriented horizontally, just add these two lines somewhere within function Update(self) in the Lua: Code: self.RotAngle = 0; self.AngularVel = 0; Or, if you don't want to mess with Lua, have the grenade gib an emitter that then emits the turret immediately afterwards. It's an old trick, so i'm not quite sure if it still works what with fired things inheriting angles and all that jazz, but worth a shot i guess. |
Author: | ShadowStorm [ Mon Oct 08, 2012 2:49 am ] |
Post subject: | Re: Emitters & TDExplosives |
Thanks shook, those two lines of code did the job. I still cant figure how to add sound for each bullet fired by the emitter.(Either the script doesn't work or I attached it to the wrong part of my code). Edit: also, how do you gib AEmitter's |
Author: | 4zK [ Mon Oct 08, 2012 1:45 pm ] |
Post subject: | Re: Emitters & TDExplosives |
You wrote the .lua file wrong. In the code you refer to it as "Sound Shot.lua" when it's "Shot Sound.lua" ![]() |
Page 1 of 2 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |