Author |
Message |
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Charging weapons.
Here's an idea that might work. Gun fires MOPixels. MOPixels, when created, take a count of other of the same MOPixels within the immediate vicinity, attract them to itself, and wait for 100ms. If the count of the same MOPixels within the immediate vicinity is greater when the wait time is done, wait another 100ms. If not, spawn a crapload of glowy particles and hurty particles, throw them at the aim direction of the nearest Actor, and selfgib.
|
Sun Jul 05, 2009 2:39 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Charging weapons.
Uh, with the lag you are going to make, you might want to try variables injection of time charged, and iterating though a global list of tables with the actor and the particle count as a backup. Lag is reduced to actor count lag.
|
Sun Jul 05, 2009 2:41 am |
|
|
CrazyMLC
Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
|
Re: Charging weapons.
Okay, I'll spill the beans.
I am going to make the ultimate bubble blower that can charge up like I said earlier. If you hold it down for 1 second, a small bubble (TDExplosive, with sprite) appears and shoots forward at a slightly fast speed in a small explosion. If you hold it down for 3 seconds, a medium bubble (TDExplosive, with separate, slightly larger, sprite) appears and goes forward at a medium rate and explodes in at medium strength. If you hold it down for 5 seconds, a huge bubble (TDExplosive, with separate, larger sprite) appears and drifts forward and explodes in a huge explosion.
2 and 4 will also have varying strength, but the same sprite for the charge below them.
They will not obey gravity and will not go as fast as the other bubble guns. (I'm sure I can do this last part with .ini modding.)
Last edited by CrazyMLC on Sun Jul 05, 2009 3:28 am, edited 1 time in total.
|
Sun Jul 05, 2009 2:54 am |
|
|
BlackNecro
Joined: Sat Dec 02, 2006 12:41 am Posts: 27 Location: Germany
|
Re: Charging weapons.
I'd prolly go for something like this. Gun shoots invisible particle. This one creates a 2 second long mosr with small sprite which is aligned to the gun's barrel (like particle accelerator's core thingy), after 2 seconds the invisible particle creates another 2 second lifetime sprite this time medium size. Then the last second that big sprite is spawned. All of this happens as long as you hold down Fire (just check in the update function of the invisible particle), if you release fire the current sprite gets removed and in place of it the explosive of the current strength gets spawned.
|
Sun Jul 05, 2009 3:23 am |
|
|
Darkhunter21
Joined: Sat Feb 28, 2009 11:06 pm Posts: 69
|
Re: Charging weapons.
CrazyMLC you need to say thank you to me, I got Areku here to help jew
|
Sun Jul 05, 2009 3:25 am |
|
|
Mind
Joined: Thu Mar 06, 2008 10:54 pm Posts: 1360 Location: USA
|
Re: Charging weapons.
Why do you even want to do it with ini? Lua-ing it would just be easier.
|
Sun Jul 05, 2009 3:25 am |
|
|
CrazyMLC
Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
|
Re: Charging weapons.
The last part I can do in ini modding.
|
Sun Jul 05, 2009 3:28 am |
|
|
LowestFormOfWit
Joined: Mon Oct 06, 2008 2:04 am Posts: 1559
|
Re: Charging weapons.
Darkhunter21 wrote: That looks like it would be a LUA based thing, I have no prior knowledge of LUA so I can't be mutch help Darkhunter21 wrote: What was that about not needing LUA!! HUH *eh hem
anyway so Maybe you could get some of these ne--- I mean Smart people like numgun or someone to tell you how Darkhunter21 wrote: I need to learn LUA too it seems to be very helpful to peoples Darkhunter21 wrote: Sounds like LUA, but what if you could make a A-emitter shoot out that shot a particle out that shot an emitter out that shot a particle out and so on? Before people come to kill you, it's Lua. Not LUA. It's not an acronym. If you can't avoid typing it in all caps you're safer saying Sparkle Magic. (like me).
|
Sun Jul 05, 2009 5:02 am |
|
|
Darkhunter21
Joined: Sat Feb 28, 2009 11:06 pm Posts: 69
|
Re: Charging weapons.
Oh Ok So LU.. err Sparkle Magic ™ Is needed to make the gun charge up right, like if someone made a shoop da whoop cannon (Which gives me an idea) and had it play IMA CHARGING MAH LAZOR! when ever you charged it rite?
|
Sun Jul 05, 2009 5:04 am |
|
|
Kyred
Joined: Sun May 31, 2009 1:04 am Posts: 308
|
Re: Charging weapons.
If your going to use Lua, then you'll need to use a timer. I dunno how good you are with Lua, but if you want help, just ask. I'm not working on anything at the moment and I would be willing to help out. The basic structure for the Lua would look like this. Every second, some value increments and the sprite changes. Then the timer resets itself and does it again when the next second comes along. Code: function Create(self) self.timer = Timer(); end
function Update(self) if self.timer:IsPastSimMS(1000) then ---something here self.timer:Reset(); end end
|
Sun Jul 05, 2009 6:00 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Charging weapons.
You know, you could use parent controller tracking.
Just realized that. Anyway, Scale works better for the sprite, just add a lua based explosion based off scale.
|
Sun Jul 05, 2009 6:22 am |
|
|
Areku
Joined: Fri Oct 17, 2008 9:46 pm Posts: 5212 Location: The Grills Locker.
|
Re: Charging weapons.
Uh, wouldn't it be simpler to create a small bubble, gradually increasing its size with a script like the particle accelerator's, calculate the position of another point in space based on the scale, and then, when the trigger is released, define a vector between the bubble and the point, making the bubble's velocity directly proportional to the length of the said vector? As in self.Vel.X = self.marker.Pos.X - self.Pos.X and self.Vel.Y = self.marker.Pos.Y - self.Pos.Y. I've tried that method before, and it seems to be a good way to control speeds.
Then, for the increased explosions based on the bubble's size, you could just make the script check self.Scale in the destroy function, and spawn a number of explosive particles depending on it.
Just wait a little more time, the script is almost ready!
|
Sun Jul 05, 2009 1:58 pm |
|
|
CrazyMLC
Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
|
Re: Charging weapons.
I charged it for a short while and it crashed. I charged it for a long while and it exploded in my face. I would like to be able to pick up my bubble if I want. I want it to go slower as it gets bigger. I want it to slowly float forward, bobbing up and down.
Also I really want to have separate sprites because I would like it to be animated.
|
Sun Jul 05, 2009 8:10 pm |
|
|
Kyred
Joined: Sun May 31, 2009 1:04 am Posts: 308
|
Re: Charging weapons.
CrazyMLC wrote: I charged it for a short while and it crashed. I charged it for a long while and it exploded in my face. I would like to be able to pick up my bubble if I want. I want it to go slower as it gets bigger. I want it to slowly float forward, bobbing up and down.
Also I really want to have separate sprites because I would like it to be animated. Easy. But it'll be hard to explain in words >_<. Code: function Create(self) self.power = 0; self.timer = Timer(); end
function Update(self) if self.owner:GetController():IsState(Controller.WEAPON_FIRE) then if self.timer:IsPastSimMS(1000) then --timing is adjustable self.power = self.power + 1; self.timer:Reset(); end end end This is just sort of a possible frame for what your trying to code. Its similar for what I did with the particle accelerator. This will increment the variable 'power' every second you hold down the trigger. You can also change the sprite every timer power is incremented. Power will determine how big the explosion is and how fast the bubble moves when the weapon is fired. The bobbing up and down can be accomplised with sin or cos functions. There's other ways to do that as well.
|
Mon Jul 06, 2009 12:09 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Charging weapons.
But wouldn't you have to define self.owner?
Or is that automatically determined? In which case TLB needs to do some optimization.
|
Mon Jul 06, 2009 2:32 am |
|
|
|
Who is online |
Users browsing this forum: Google [Bot] |
|
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
|
|