View unanswered posts | View active topics It is currently Sun Jun 16, 2024 1:41 am



Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
 Emitters & TDExplosives 
Author Message
User avatar

Joined: Thu Jan 21, 2010 10:59 pm
Posts: 151
Reply with quote
Post 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.

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)
Solved by myself.

1.5 - How do you choose which direction the particles are emitted if the spread isn't 3.14?
Solved by 4zK. Thanks!

2 - I know people have done it, but how do you make it so the grenade doesn't rotate when thrown?
Solved by Shook. Thanks!

3 - How do I attach a sound to the emitter for each shot fired?
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.


Last edited by ShadowStorm on Mon Oct 08, 2012 5:20 pm, edited 4 times in total.



Fri Oct 05, 2012 10:35 pm
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post Re: Emitters & TDExplosives
What exactly are you making?


Fri Oct 05, 2012 10:41 pm
Profile
User avatar

Joined: Thu Jan 21, 2010 10:59 pm
Posts: 151
Reply with quote
Post 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.


Fri Oct 05, 2012 10:48 pm
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post Re: Emitters & TDExplosives
Eh, you mean a turret in the shape of a grenade? :grin:

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.


Fri Oct 05, 2012 11:03 pm
Profile
User avatar

Joined: Thu Jan 21, 2010 10:59 pm
Posts: 151
Reply with quote
Post 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?


Fri Oct 05, 2012 11:29 pm
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post 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.
Shotsound.lua [161 Bytes]
Downloaded 203 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.


Last edited by 4zK on Fri Oct 05, 2012 11:47 pm, edited 1 time in total.



Fri Oct 05, 2012 11:33 pm
Profile
User avatar

Joined: Thu Jan 21, 2010 10:59 pm
Posts: 151
Reply with quote
Post 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!


Last edited by ShadowStorm on Fri Oct 05, 2012 11:50 pm, edited 1 time in total.



Fri Oct 05, 2012 11:47 pm
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post Re: Emitters & TDExplosives
Haha, don't worry, that's only barely 5 lines of lua :grin:


Fri Oct 05, 2012 11:49 pm
Profile
User avatar

Joined: Thu Jan 21, 2010 10:59 pm
Posts: 151
Reply with quote
Post 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


Fri Oct 05, 2012 11:55 pm
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post Re: Emitters & TDExplosives
Why mustn't the grenade rotate? The turret phase can always spawn upright.


Sat Oct 06, 2012 12:30 am
Profile
User avatar

Joined: Thu Jan 21, 2010 10:59 pm
Posts: 151
Reply with quote
Post 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.


Sat Oct 06, 2012 7:26 am
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post Re: Emitters & TDExplosives
You can send me the .lua/.ini files if you want me to take a closer look at it.


Sat Oct 06, 2012 12:44 pm
Profile
User avatar

Joined: Fri Feb 16, 2007 8:43 pm
Posts: 1695
Location: AH SHIT FUCK AUGH
Reply with quote
Post 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.


Sat Oct 06, 2012 1:00 pm
Profile WWW
User avatar

Joined: Thu Jan 21, 2010 10:59 pm
Posts: 151
Reply with quote
Post 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


Mon Oct 08, 2012 2:49 am
Profile
User avatar

Joined: Mon Oct 11, 2010 1:15 pm
Posts: 594
Location: Finlandia
Reply with quote
Post 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" :)


Mon Oct 08, 2012 1:45 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 16 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.088s | 14 Queries | GZIP : Off ]