Author |
Message |
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Changing the direction of a bullet
The direction of the bullet has to be always horizontal? Is there a way to make it vertical?
|
Thu Feb 24, 2011 1:30 am |
|
|
Coops
Joined: Wed Feb 17, 2010 12:07 am Posts: 1545 Location: That small peaceful place called Hell.
|
Re: Changing the direction of a bullet
lolwut?
Are you asking how to make a bullet go straight up?
|
Thu Feb 24, 2011 1:40 am |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
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
|
Thu Feb 24, 2011 1:49 am |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Re: Changing the direction of a bullet
I know it's kinda strange, but I want to create something like a light saber
|
Thu Feb 24, 2011 2:00 am |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
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
|
Thu Feb 24, 2011 2:11 am |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Re: Changing the direction of a bullet
Ok, let me try.
|
Thu Feb 24, 2011 2:18 am |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: Changing the direction of a bullet
Remember it attaches to the bullet, not the gun.
|
Thu Feb 24, 2011 2:19 am |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Re: Changing the direction of a bullet
I'm not new to lua =D
|
Thu Feb 24, 2011 2:28 am |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
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.
|
Thu Feb 24, 2011 2:37 am |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
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
|
Thu Feb 24, 2011 2:51 am |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
Re: Changing the direction of a bullet
Nothing. It just kept moving in the direction it should move normally.
|
Thu Feb 24, 2011 2:54 am |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
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
|
Thu Feb 24, 2011 3:02 am |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
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?
|
Thu Feb 24, 2011 3:10 am |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
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.
|
Thu Feb 24, 2011 3:14 am |
|
|
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
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.
|
Thu Feb 24, 2011 3:19 am |
|
|
|