Data Realms Fan Forums http://45.55.195.193/ |
|
Changing the direction of a bullet http://45.55.195.193/viewtopic.php?f=1&t=21568 |
Page 1 of 3 |
Author: | Asklar [ Thu Feb 24, 2011 1:30 am ] |
Post subject: | Changing the direction of a bullet |
The direction of the bullet has to be always horizontal? Is there a way to make it vertical? |
Author: | Coops [ Thu Feb 24, 2011 1:40 am ] |
Post subject: | Re: Changing the direction of a bullet |
lolwut? Are you asking how to make a bullet go straight up? |
Author: | Roast Veg [ Thu Feb 24, 2011 1:49 am ] |
Post subject: | Re: Changing the direction of a bullet |
Attach this to it: Code: function Create(self) self.Vel.Y = 0 - self.Vel.X; self.Vel.X = 0; end |
Author: | Asklar [ Thu Feb 24, 2011 2:00 am ] |
Post subject: | Re: Changing the direction of a bullet |
I know it's kinda strange, but I want to create something like a light saber |
Author: | Roast Veg [ Thu Feb 24, 2011 2:11 am ] |
Post subject: | Re: Changing the direction of a bullet |
Hmm... My script will send them straight up in the air, so it won't be pretty. Maybe if you just reversed X and Y you'd get a better effect. Code: function Create(self) self.Vel = Vector(self.Vel.Y, self.Vel.X) end |
Author: | Asklar [ Thu Feb 24, 2011 2:18 am ] |
Post subject: | Re: Changing the direction of a bullet |
Ok, let me try. |
Author: | Roast Veg [ Thu Feb 24, 2011 2:19 am ] |
Post subject: | Re: Changing the direction of a bullet |
Remember it attaches to the bullet, not the gun. |
Author: | Asklar [ Thu Feb 24, 2011 2:28 am ] |
Post subject: | Re: Changing the direction of a bullet |
I'm not new to lua =D |
Author: | Asklar [ Thu Feb 24, 2011 2:37 am ] |
Post subject: | Re: Changing the direction of a bullet |
Nah, it didn't work. I tried also: Code: function Create(self) self.Vel.X = self.Vel.Y self.Vel.Y = self.Vel.X end But it didn't work either. |
Author: | Roast Veg [ Thu Feb 24, 2011 2:51 am ] |
Post subject: | Re: Changing the direction of a bullet |
What did it do? Try: Code: function Create(self) local store = self.Vel.Y; self.Vel.Y = self.Vel.X; self.Vel.X = store; end |
Author: | Asklar [ Thu Feb 24, 2011 2:54 am ] |
Post subject: | Re: Changing the direction of a bullet |
Nothing. It just kept moving in the direction it should move normally. |
Author: | Roast Veg [ Thu Feb 24, 2011 3:02 am ] |
Post subject: | Re: Changing the direction of a bullet |
It could be because it isn't actually given velocity until a short while after it's fired. Maybe... Code: function Create(self) self.waitTimer = Timer(); end function Update(self) if self.waitTimer:IsPastSimMS(50) then self.Vel = Vector(self.Vel.Y, self.Vel.X); end end |
Author: | Asklar [ Thu Feb 24, 2011 3:10 am ] |
Post subject: | Re: Changing the direction of a bullet |
It didn't work, plus, I got an error =D RTE Aborted! (x_x) (Note, this was during gameplay) Abortion in file.\System\DDTError.cpp,line 109, because: Assertion failed: Collision mismatch in MOPixel::ColideAtPoint! The last frame has been dumped to "abortscreen". I never saw an error like that. And never in game. What the ♥♥♥♥ is going on in here? |
Author: | Roast Veg [ Thu Feb 24, 2011 3:14 am ] |
Post subject: | Re: Changing the direction of a bullet |
I've only ever seen anything like that once, and that was when I made MOPixels collide with each other. It won't be that, though. I'm not sure why you're getting it. |
Author: | Asklar [ Thu Feb 24, 2011 3:19 am ] |
Post subject: | Re: Changing the direction of a bullet |
Colliding? Between them? Maybe it could be because I put HitMos and GetsHitByMos to 1. I'll change that and check. |
Page 1 of 3 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |