View unanswered posts | View active topics It is currently Fri Nov 01, 2024 12:05 am



Reply to topic  [ 49 posts ]  Go to page Previous  1, 2, 3, 4  Next
 Detached attachables being deleted 
Author Message
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Detached attachables being deleted
CaveCricket48 wrote:
What do you mean by the DS being unstable?


It starts wobbling around on spawn (Usually calms down after some time) and is generally unstable in flight.
Also, lua attached engines seem to displace when a certain velocity is achieved (Not always, and it isn't constant either. Sometimes the get displaced even at low velocity).
This usually ends up with either:
A. Engine blown up then boom.
B. 180-360 degree rotation of whole DS, then boom.
C. Boom.

That's with the extra engines being off.
I have no idea what is going to happen when they will be on.

So far they just blow up when toggled so i'll have to mess around with the .ini junk.

Grif wrote:
Draw order is also semi-unfixable.

Well that just blows.
What if I throw an attachable on the extra engines, will it show over the DS' wings?


Wed Jun 16, 2010 8:58 pm
Profile
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post Re: Detached attachables being deleted
MaximDude wrote:
It starts wobbling around on spawn (Usually calms down after some time) and is generally unstable in flight.
Also, lua attached engines seem to displace when a certain velocity is achieved (Not always, and it isn't constant either. Sometimes the get displaced even at low velocity).
This usually ends up with either:
A. Engine blown up then boom.
B. 180-360 degree rotation of whole DS, then boom.
C. Boom.



That's probably the result of their sprites trying to use the same points in space at the same time. Your best bet would be to make the engines unhittable, though that kind of kills the purpose. Maybe add a real attachable to the DS that, when gibbed, causes the engine to detach.


Wed Jun 16, 2010 9:04 pm
Profile WWW
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Detached attachables being deleted
Areku wrote:
Your best bet would be to make the engines unhittable, though that kind of kills the purpose.

Naw, that'd be silly. If I was to do it this way then i'd make the wings unhittable.

For this there's 'SetWhichMOToNotHit' but i'm not really sure how to use it... ~___~'


Wed Jun 16, 2010 11:48 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13143
Location: Here
Reply with quote
Post Re: Detached attachables being deleted
Code:
pointerA:SetWhichMOToNotHit(pointerB)

Although that function hasn't always worked with MOSprite objects for me.


Wed Jun 16, 2010 11:54 pm
Profile
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Detached attachables being deleted
Image
Wut?

What would be the issue here?


Sat Jun 19, 2010 5:15 pm
Profile
User avatar

Joined: Tue Dec 12, 2006 3:10 pm
Posts: 495
Location: Uncertain quantum state
Reply with quote
Post Re: Detached attachables being deleted
That function requires two parameters.

MO to not hit, and duration.

Negative number for indefinite.


Sat Jun 19, 2010 6:42 pm
Profile
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Detached attachables being deleted
findude wrote:
That function requires two parameters.

MO to not hit, and duration.

Negative number for indefinite.


Oh, I see.
It works now, but it still seems to be the same as before.
I'm gonna see if it has something to do with the .ini junk.


Sat Jun 19, 2010 6:58 pm
Profile
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Detached attachables being deleted
I just discovered the reason my script didn't work when I used ini attaching.
It seems that when attaching extra emitters to a dropship they spawn without MOIDs.

Now, I can get past this by making my engine a regular attachment, that will allow me to use the first part of the script (Secondary engines that rotate according to main ones), but I still won't be able to trigger emission.

This blows balls.
Unless there is another way to do it.

CC I am disappoint.

Edit:

Yup, works perfectly with regular attachables.
Image

The only way I can think of making it work is making an emitter spawn on button press and having it lua-attached to the bottom of the secondary jet and use that math junk for it to move with the jet's rotation.
But I bet it would cause issues when going high-speed.

Gonna try it out.

ps. CC, why must you make simple ideas so hard to achieve?

Edit 2:

That's it, need the final piece of help before i'm done with this thing.
I need to emitter that is (lua)attached to the secondary engine to follow the engine's own rotation as well as the dropship's.
Like so:
Image
(Orange blob is the emitter)
I tried messing around with the piece of script CC48 posted but I ended up with crashes...


Sat Jun 19, 2010 9:05 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13143
Location: Here
Reply with quote
Post Re: Detached attachables being deleted
Okay, you'll need a pointer to the thruster attachable (I'll name it self.pointer) in the example. Then just position the emitter at the thruster's position plus the additional distance to put it at the right spot.

Code:
self.thing.Pos = self.pointer.Pos + Vector(0,10):RadRotate(self.pointer.RotAngle);
self.thing.RotAngle = self.pointer.RotAngle;
self.thing.Vel = self.Vel;

PS: "self.thing" is the pointer to the emitter. And the Y value in the "Vector(0,10)" is the distance of the emitter down. The X value is left/right distance.


Sun Jun 20, 2010 4:54 am
Profile
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Detached attachables being deleted
CaveCricket48 wrote:
Code:
self.thing.Pos = self.pointer.Pos + Vector(0,10):RadRotate(self.pointer.RotAngle);
self.thing.RotAngle = self.pointer.RotAngle;
self.thing.Vel = self.Vel;


What happens is one emitter is being pinned where I want it, but doesn't react to anything, and the second just falls down.
If the emitter gets destroyed the game crashes.

No errors in the console.

Code:
   for i = 1,MovableMan:GetMOIDCount()-1 do
      self.secjet = MovableMan:GetMOFromID(i);
      if self.secjet.PresetName == "Heavy Drop Ship Secondary Engine" and self.secjet.RootID == self.ID then
         self.emitter.Pos = self.secjet.Pos + Vector(0,40):RadRotate(self.secjet.RotAngle);
         self.emitter.RotAngle = self.secjet.RotAngle;
         self.emitter.Vel = self.Vel;
      end
   end


Fri Jun 25, 2010 11:25 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13143
Location: Here
Reply with quote
Post Re: Detached attachables being deleted
The script chunk I posted is supposed to be in the Update() function and the pointer finding thing is supposed to be in the Create() function. They're not supposed to be combined. Oh, and you'll need to get 2 pointers, one for each fake engine, as well as 2 of my chunks for each pointer.


Sat Jun 26, 2010 12:01 am
Profile
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Detached attachables being deleted
Actually, I have the pointer finder in every piece of the script.
I don't know how to make it so the 'secjet' is found once and then accessed just with 'self.secjet' instead of the whole attachable finder thing all over...

But I don't see how the pointer finder affects the operation of the script except by adding ♥♥♥♥ to do.
Regardless whether I shove it up 'Create()', it still won't work like it should...

Anyway, what you are saying is that I need to separate the secjets into left and right?
I did it just a few moments ago, still doesn't work properly.

Edit:

Ooooh, I though of a way to make it work without depending on he secjet's rotation, but on the main jet's rotation.
Some tricky offsets are involved, but in theory, it should work.

Commence attempt.

Edit 2:

Woohoo it works!
I just need to get the position right and find out why the emitters disappear after about 10ms after activation.


Sat Jun 26, 2010 12:16 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13143
Location: Here
Reply with quote
Post Re: Detached attachables being deleted
Try "emitterpointer.ToDelete = false".


Sat Jun 26, 2010 1:37 am
Profile
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post Re: Detached attachables being deleted
CaveCricket48 wrote:
Try "emitterpointer.ToDelete = false".

I did 'ToAEmitter(blah).ToDelte = false'.
No effect.
Must be ini.

Anyway, a thought came in mind.
If the emitters are lua attached, it means the forces they generate do not apply to the ds, am I correct?
If I am, then how would I make those forces get applied?

That's not the main problem right now though.

I'm off to bed now, its 3am...
Hopefully i'll finish this thing tomorrow today.


Sat Jun 26, 2010 1:42 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13143
Location: Here
Reply with quote
Post Re: Detached attachables being deleted
MaximDude wrote:
Anyway, a thought came in mind.
If the emitters are lua attached, it means the forces they generate do not apply to the ds, am I correct?
If I am, then how would I make those forces get applied?

Forces via Lua!

Also,
MaximDude wrote:
I did 'ToAEmitter(blah).ToDelte = false'.
No effect.
Must be ini.

It's 'ToAEmitter(blah).ToDelete = false' not
'ToAEmitter(blah).ToDelte = false'.


Sat Jun 26, 2010 2:02 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 49 posts ]  Go to page Previous  1, 2, 3, 4  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.026s | 13 Queries | GZIP : Off ]