Author Topic: Have a ship jump in facing the player?  (Read 3631 times)

0 Members and 1 Guest are viewing this topic.

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Have a ship jump in facing the player?
Hey all!

So in the second mission in Vassago's Dirge (counting the prelude) where you have to escort a Cretheus, Axem had
Spoiler:
the Vassago jump in from below the player, IIRC. Wherever the player was, the Vassago would jump in from below and facing you. Don't look down. :P Am I recalling correctly and is that what was going on?

I'd like to know how this was done. Any tips?

 

Offline Axem

  • 211
Re: Have a ship jump in facing the player?
No real magic there. Just luring the player to be in the right place at the right time. You could go off in a different direction and completely miss out on that.

That said there are a few arrival cue anchors that might be what you're looking for. One of them is 'In Front Of Ship' that will make the ship arrive some-what in front and facing the ship. Only works on the front vector though. Near Ship would just be a random vector around the ship, no way to restrict vectors. (And using set-object-position to alter the ship's position before it arrives doesn't work either).

Hope that helps in what you might be trying to accomplish!

 

Offline JSRNerdo

  • [`_`]/
  • 29
  • Gone!
Re: Have a ship jump in facing the player?
You can use some clever hacks with FRED set position and in-front-of-ship to get ships that warp in directly above/below/behind etc a ship. Set an invisible dummy ship's location to be, say, left of a ship, and SEXP it to directly face the player. Then have the Vassago warp in in-front-of-ship to the dummy ship, and the Vassago will arrive to the right of the player every time.
Former Inferno lead, BTA fredder-ish and DE fredder. Driven out by ordinary fascists the_e, aesaar and general battuta. Will return if they're ever removed.

 

Offline Axem

  • 211
Re: Have a ship jump in facing the player?
Oh yeah, that'd probably work. Might need some tweaking and stuff to get it just right. In Front Of Ship isn't like, directly in front, but within some random cone or something. But yeah, you could adjust the entry angle like that.

*Hands FRED Crown to JSRNerdo*

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Have a ship jump in facing the player?
Hey, thanks for the tip guys!

Spoiler:
Funny, I was totally under the impression that you'd worked some arcane FRED magic. :P

So, just to be clear, in-front-of-ship will pick a random vector that's within the player's frontal view cone? So the incoming ship might sort of be facing the player, but slewed to one side?

Hmm.

What I really wanted was to make the incoming ship dead-on facing the player, but I'll work with what I've got.
« Last Edit: May 12, 2017, 10:38:47 am by PVD_Hope »

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Have a ship jump in facing the player?
As soon as the ship arrives, teleport it directly in front of the player, cloak it, spawn a fake warp effect, decloak it as it comes through. olololo

 

Offline Mito [PL]

  • 210
  • Proud Member of Slavicus Mechanicus
Re: Have a ship jump in facing the player?
Or spawn the warp effect a tiny moment before the ship arrives, and teleport the vessel right away when it arrives (i suppose...).
How do you kill a hydra?

You starve it to death.

 

Offline Axem

  • 211
Re: Have a ship jump in facing the player?
Might work for fighters, but less so on larger ships (especially capital ships), unless you're going to mess around with set-ship-speed (it works on a per-frame basis, so you'd need 0 repeat delays).

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Have a ship jump in facing the player?
Might work for fighters, but less so on larger ships (especially capital ships), unless you're going to mess around with set-ship-speed (it works on a per-frame basis, so you'd need 0 repeat delays).

Yeah, we're talking about a capital ship here. Potentially a massive one. Why exactly wouldn't it work?

Still haven't tested "in-front-of-ship". Will report here when that's done.

 

Offline Axem

  • 211
Re: Have a ship jump in facing the player?
As soon as the ship arrives, teleport it directly in front of the player, cloak it, spawn a fake warp effect, decloak it as it comes through. olololo

Or spawn the warp effect a tiny moment before the ship arrives, and teleport the vessel right away when it arrives (i suppose...).

Actually I'm mistaken, this does work (you don't need to cloak or spawn the warp effect a tiny moment though). It's a little tricky, you'll need to spawn the warp effect basically at the nose of where the ship would be arriving and do your own warp duration and radius. The ship still does its transitional plane clip in, so the rear end of the ship won't appear suddenly. You just need to make its initial position far far away so you don't see that.

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Have a ship jump in facing the player?
So I tried in-front-of-ship. It's permissible, I suppose, for what I want to do, although smack in front of the player every time would be better.

So, let me get this suggestion straight:

1. Make incoming ship arrive far away (no warp effect)
2. Spawn warp effect (now how do I make the effect spawn in front of the player :confused:)
3. Teleport incoming ship behind the warp effect (and how do I make it face the right way :confused:)

I'm not sure I want to go to all that work, though. I could just stick with in-front-of-ship.

 

Offline Axem

  • 211
Re: Have a ship jump in facing the player?
It sounds like a lot of work, but it's not that bad. You've divided up the task in good manageable chunks. Just a few notes to help you get going.

1. If you select no warp effect, you won't get the high speed entrance, so it'd probably be quite anti-climatic. So just have your default position like... really far away or something.

2. I'd read up on this part of a tutorial to understand how you can get a position of something directly in front or something else.

3. And as for moving and pointing, well there's sexps for that. :) (Coordinate manipulation category!!)

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Have a ship jump in facing the player?

2. I'd read up on this part of a tutorial to understand how you can get a position of something directly in front or something else.

3. And as for moving and pointing, well there's sexps for that. :) (Coordinate manipulation category!!)

2. Thanks! A bit much information to digest, but I get what I have to do.

3. So... set-object-facing-object?

But if that happens after the incoming ship has been teleported... won't the player see the ship pop in behind the warp effect before it turns to face them? Unless a 1-millisecond turn time negates that problem...

 

Offline JSRNerdo

  • [`_`]/
  • 29
  • Gone!
Re: Have a ship jump in facing the player?
A turn time/move time  of 0 means it just sets the position/facing instantly
Former Inferno lead, BTA fredder-ish and DE fredder. Driven out by ordinary fascists the_e, aesaar and general battuta. Will return if they're ever removed.

 

Offline Axem

  • 211
Re: Have a ship jump in facing the player?
3. Yep, that's the sexp. If you just use it with the 2 parameters, it will face the object in a single frame.

So roughly how you would do it is, once the ship arrives is...

Make warp effect appear
Move ship so it is half a ship length "behind" the portal
Point ship at target

So in essence, you place the ship so that its nose its pretty much at where you create the portal. You'll probably need to do a bit of trail and error before you get it bang on, so try it out in a test mission before you try it in your real mission.

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Have a ship jump in facing the player?
Right.

How do I teleport a ship again? I can't quite figure it out... I tried just creating a ship behind the warp effect, but I can't set-object-facing-object on a ship that "doesn't exist."

 

Offline Axem

  • 211
Re: Have a ship jump in facing the player?
set-object-position let's you "teleport" a ship anywhere. Do the event with a has-arrived-delay with a 0 delay.

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Have a ship jump in facing the player?
set-object-position let's you "teleport" a ship anywhere. Do the event with a has-arrived-delay with a 0 delay.

Right. Thanks!

 

Offline wookieejedi

  • 29
  • Intensify Forward Firepower
Re: Have a ship jump in facing the player?
If you are still interested in responses I can show you what I have done for my missions. Currently I have my SEXPs set up so that multiple ships will warp in, all in the same orientation, but at semi-random locations. Could be scripted for right in front of the player like Axem mentioned, too.

 
Re: Have a ship jump in facing the player?
I'd be interested.