Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Attach a projectile to player?
Attach a projectile to player?
2001-09-14, 11:24 AM #1
I'm trying to make a parachute attach to player.

Code:
trigger:
if (GetSourceRef() == 23)
      {
   theguy = GetParam(0);
   thechute = FireProjectile(theguy, canada, -1, -1, '0.0, 0.0, 0.0', '0 0 0', 0, 0, 0, 0);
   AttachThingToThingEx(thechute, theguy, 0x8);
      }

^ When I used fireProjectile like that, there was a Checksum Error.

Code:
trigger:
if (GetSourceRef() == 23)
      {
   theguy = GetParam(0);
   thechute = CreateThing(canada);
         AttachThingToThingEx(thechute, theguy, 0x8);
      }

^ When we tried that, it worked but the projectile was at your feet.

Code:
trigger:
if (GetSourceRef() == 23)
      {
   theguy = GetParam(0);
   thesector = GetThingSector(theguy);
   theposition = GetThingPos(theguy);
   thechute = CreateThingAtPosNR(canada, thesector, theposition, '0 0 0');
         AttachThingToThingEx(thechute, theguy, 0x8);
      }

^ I think this one works, but its not always facing forward.

So... I think it causes checksum error when I try to attach a Projectile to a Thing. Does it? And is there a way to fix it, or do I have to use CreateThingAtPosNR?
2001-09-15, 12:26 PM #2
I know what you mean with CreateThing...I tried that for Radice a few weeks ago. It was really strange..it shouldn't cause a checksum, but you can try CreateThingNR
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-09-15, 12:32 PM #3
Ooops.. I misread you. To make the thing face the right direction with CreateThingNR or whatever, try this:

Code:
Idiot = FireProjectile(theguy, blank, -1, -1, '0.0, 0.0, 0.0', '0 0 0', 0, 0, 0, 0);

PlayerVec = GetThingLVec(theguy);
SetThingLook(thechute, PlayerVec);
DestroyThing(Idiot);


The idiot projectile could be anything.. I would just take like +bryarbolt, in the templates set it to invisible and no collide. What this will do is fire a blank, get it's look vec (which is the same as the players), apply it to the chute, then destroy the blank.

Just hollar if anything is unclear.
Hope I helped
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-09-15, 1:47 PM #4
Actually, you should probably change the SetThingLook statement to:

SetThingLook(thechute, VectorSet(0, 0, VectorZ(PlayerVec));

That will make it so it only uses the vector on the z axis, so it doesn't go in a funny direction if your pitching up/down.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-09-16, 5:23 AM #5
Here's what I have:
Code:
if (GetSourceRef() == 23)
      {
   theguy = GetParam(0);
   thesector = GetThingSector(theguy);
   theposition = GetThingPos(theguy);
   thechute = CreateThingAtPosNR(canada, thesector, theposition, '0 0 0');
   idiot = FireProjectile(theguy, blank, -1, -1, '0.0, 0.0, 0.0', '0 0 0', 0, 0, 0, 0);
   PlayerVec = GetThingLVec(idiot);
   SetThingLook(thechute, VectorSet(0, 0, VectorZ(PlayerVec)));
   DestroyThing(idiot);
         AttachThingToThingEx(thechute, theguy, 0x8);
      }

If the view is looking forward, the chute doesn't appear.
If the view is looking a little up/down, the chute opens sideways (so the thing is either looking up or down at 90 degrees).
And the StopChute cog (which destroys it and is linked to the projectile in static.jkl) doesn't work. I think it only works if it uses FireProjectile, not when its creating a Thing.
Whats the NR for in CreateThingNR? And how do you use it? ... CreateThingNR(template, ?)

FireProjectile would be much easier, if it didn't cause checksum... Maybe the attach flags are causing it?
2001-09-16, 10:54 AM #6
I think the prob is in here:

Code:
thechute = FireProjectile(theguy, canada, -1, -1, '0.0, 0.0, 0.0', '0 0 0', 0, 0, 0, 0);


Go back to trying fireprojectile with 2 fixes

1) I have never seen a vector like this:

'0.0, 0.0, 0.0'

Its always '0.0 0.0 0.0' (NO COMMAS)

or

VectorSet(0.0, 0.0, 0.0)

and

2) I believe your prob is the first, but I have never see the last 3 flags in Fireprojectile set to 0. You might want to try:

thechute = FireProjectile(theguy, canada, -1, -1, '0.0 0.0 0.0', '0 0 0', 0, 0x1, 1, 1);
- Wisdom is 99% experience, 1% knowledge. -

↑ Up to the top!