View unanswered posts | View active topics It is currently Mon Dec 30, 2024 10:45 pm



Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next
 Changing the direction of a bullet 
Author Message
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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
Profile
User avatar

Joined: Wed Feb 17, 2010 12:07 am
Posts: 1545
Location: That small peaceful place called Hell.
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Changing the direction of a bullet
I know it's kinda strange, but I want to create something like a light saber :D


Thu Feb 24, 2011 2:00 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Changing the direction of a bullet
Ok, let me try.


Thu Feb 24, 2011 2:18 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: Changing the direction of a bullet
Remember it attaches to the bullet, not the gun.


Thu Feb 24, 2011 2:19 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Changing the direction of a bullet
I'm not new to lua =D


Thu Feb 24, 2011 2:28 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 31 posts ]  Go to page 1, 2, 3  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.067s | 13 Queries | GZIP : Off ]