Salvos for the turret behaviour

New releases and general discussions.

Post » Wed Jan 28, 2009 12:28 pm

I could understand a setting for burst of fire, or what ever you want to call it, but I dont think an ammunition setting would be all that great.
Sure it might be cool for some situations, but what about if the user wants to get more ammunition?
Besides wouldn't that be better under the bullet behavior?
Ok not really, as it stands there's a setting under the bullet behavior for speed of the bullet, and personally I think it would be better under the turrets behavior, unless you want to add a different bullet for each turret. Then again you can change just about all of the individual behavior settings during runtime.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Wed Jan 28, 2009 12:50 pm

If the new features were implemented you could make the new turrets act just like the old turrets by setting your Fire Rate to what the Reload is currently, setting the Reload speed to 0, and setting the Ammo to 1. It would behave exactly the same way then.

Also, I think it's more logical to have your turret store an Ammo amount, rather than the bullet itself... after all, a bullet is just one unit of ammo. As for getting more ammunition, how about a "Reload" action?

Also, a suggestion (if these features are considered): Setting Ammunition to 0 would mean "infinite." Oh, and what I meant earlier by "Constant fire" is that it should always fire when the target is within range, not just when the angle is appropriate. Unless there's already some method to do this, and I'm missing it.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Jan 28, 2009 1:45 pm

Well first off the on shoot trigger would have to be directly related to ammunition, so every turret that used it would be subtracting something every time its triggered.
Ok thats great we got that part... blah, blah, blah, but what exactly are they shooting?
That kind of limits the trigger to the object being created.
Suppose I wanted to have an additional condition like:
On tank shoot
helicoptersprite is in range
> create object misslesprite

Then if your going to have a rate of fire, wont that variable have be tied to the amount of ammunition?
So now I would be stuck firing x amount of bullets, as well as missles etc.

Would it not be just as simple to create a private variable, for something that would be somewhat obscure?
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Wed Jan 28, 2009 2:18 pm

Okay then, I take it all back. It's a terrible idea.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Jan 28, 2009 6:44 pm

can't you just make this easily with variables?
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed Jan 28, 2009 8:20 pm

Private variables should solve this elegantly. For example, Salvo = number of shots within one salvo.

On (Do something to cause shooting)
Repeat (Fire shot) Salvo times.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Jan 29, 2009 1:41 am

Well...I did make it easily with variables. I guess the only function it needs to work 100% like the way GMG wants though is to at least add the feature for Constant Fire, because there's no way to make the turret do that currently. Unless, again, I'm missing something.

And Mipey... that Repeat loop would cause the turret to create five bullets all at once in the same tick.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jan 29, 2009 9:15 am

Well, let's call it simultaneous salvo? :roll:

Okay, you are correct, however. Here is alternate solution (in pseudocode) - assuming the Turret object has a Salvo PV:

[code:1rg7mug9]+Turret.Value('Salvo')>0
+ Every 100 ms
> Fire Bullet Action here
> Substract 1 from Turret.Value('Salvo')[/code:1rg7mug9]

So whenever you want the turret to fire, you change its Salvo to, say, 4 and it would keep firing until it's fired 4 shots. As for targeting - you could just make it remember the position it fired at first, or you could make it check target each shot. Modify the 'Fire Bullet Action' stuff to define how it behaves during salvo.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Jan 29, 2009 1:45 pm

Ok well I guess for realism's sake this: [url:2a90zb3m]http://www.mediafire.com/?znqtwnuywnz[/url:2a90zb3m]
Should be pretty close.
I still say since its relatively easy to do, there's no point in changing an existing plugin.
But I don't see why there can't be an additional plugin that does this.
Goodness knows what the future will bring, especially if someone should ever make a easier way to make plugins.
Perhaps something like a sub-plugin, that works in tandem with another plugin.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Previous

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests