Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Ferret on March 14, 2006, 11:04:51 am

Title: ship-invisible breaks collisions
Post by: Ferret on March 14, 2006, 11:04:51 am
I really need to be able to make ships suddenly be untargetable in missions. You can do this with ship-invisible right?
But then I need to make it come back again. So later on I do ship-visible.

So far so good, but now I cannot collide with the ship anymore. :eek2:

Is is there anyway to fix this? Or alternatively, is there another way to stop ships being targetted by the player then revert it again?

[edit]

Also, is there anyway to revert what's done by using ship-vanish?
Title: Re: ship-invisible breaks collisions
Post by: karajorma on March 14, 2006, 06:08:33 pm
Ship-vanish is a rather dangerous SEXP to use carelessly as certain things ignore it. If you want to fake it simply use the set-x(y,z)-position SEXPs to move the ship 200,000m away and stealth it if you can.

You may be able to ship-create a ship that you vanished earlier but you could possibly get some very strange bugs out of that so experiment first before relying on it.
Title: Re: ship-invisible breaks collisions
Post by: Blue Lion on March 14, 2006, 06:10:58 pm
Can't you turn off/on the warp effects?

Have it jump then enter?
Title: Re: ship-invisible breaks collisions
Post by: Ferret on March 14, 2006, 06:15:20 pm
Ship-vanish is a rather dangerous SEXP to use carelessly as certain things ignore it. If you want to fake it simply use the set-x(y,z)-position SEXPs to move the ship 200,000m away and stealth it if you can.

You may be able to ship-create a ship that you vanished earlier but you could possibly get some very strange bugs out of that so experiment first before relying on it.
I would already be doing this if my plan wasn't to move a large amount of ships. (We're talking everyone but the player.)

Also warping might work, but as I said, I'm moving everything, so this would have to include ships not in system yet as the effect I'm having is supposed to be slightly random.

[edit]

Okay I'll explain what I'm trying to do step by step, even though I really didn't want to.

Anyway, I'm trying to make it look like tho player is being transported to a nebula for a short few seconds and back again, quickly and painlessly.
So, turning on the nebula is no problem at all. The problem is making the rest of the ships disappear. I tried to rectify this moving the player 70 odd km away, while saving the coordinates and them moving them back after.
However, they still appear on sensors and are still targeted by the player if you have them targeted when you teleport.

So I tried ship-invisible, they're still targeted by the player, but are now gone from the radar. I realised that I could kinda stop this by starting an EMP storm, which knocks off what you have targetted.

Now, although not without flaws, this is the best I colud come up with, until I realised I was now flying into ships. It took me a while to narrow it down to the ship-invisible, ship-visible combination.

So if anyone has any fix or suggestions it would be appreciated. My mission revolves around this effect so it's pretty critical. Otherwise it's back to the story drawing board
Title: Re: ship-invisible breaks collisions
Post by: Blue Lion on March 14, 2006, 06:22:35 pm
I guess it depends if you have patience is all.

You can make them invisible, or not even there. I suppose we'd need to know more about the missions, which would make no sense.
Title: Re: ship-invisible breaks collisions
Post by: Ferret on March 14, 2006, 06:26:51 pm
Edited my post after you replied. :P
Title: Re: ship-invisible breaks collisions
Post by: Blue Lion on March 14, 2006, 06:44:47 pm
I still think having the ships jump solves it the best. If it's only for a few seconds it shouldn't be a big problem having all the ships jump back in pretty much right where they left.

Only hard part is you have to choreograph it pretty well.
Title: Re: ship-invisible breaks collisions
Post by: Ferret on March 14, 2006, 06:48:16 pm
If I make ships warp out and then in again, will they warp in at thier warp out point or the default position when the mission starts? Because that just wont do at all.

It's not not very viable, I'ld still be having to check whether a ship is in system or not when the player "teleports". Plus that's a hell of a lot of event handling.
Title: Re: ship-invisible breaks collisions
Post by: karajorma on March 15, 2006, 05:25:00 am
Ummm. Unless I've been missing something for years there's no way to have a ship jump out and then jump back in again. You can fake the effect using a ship with a virtually identical name but you can't actually have the same ship jump in that jumped out earlier in a mission.
Title: Re: ship-invisible breaks collisions
Post by: Mefustae on March 15, 2006, 05:50:59 am
How precise would my timing have to be if I wanted to have, say, an Orion jump out, and another Orion with the same name [the same Orion story-wise] jumping in at the exact same time a few thousand kilometres away. So that - for instance - when half of the orion has entered the subspace window, the front half of the second orion would have exited subspace some distance away, immitating an instantaneous jump?
Title: Re: ship-invisible breaks collisions
Post by: Ferret on March 15, 2006, 06:11:44 am
You'll have to time it.

Why is it that of all the added SEXP's there hasn't been one that makes a ship disappear in it's entirety but is still there so can be recalled back at a moments notice?
I personally can see a bazillion uses for this so I'm not sure why it hasn't happened.

How hard would it be to code it myself? I havn't looked at the SEXP stuff at length.
Title: Re: ship-invisible breaks collisions
Post by: Goober5000 on March 15, 2006, 12:47:13 pm
Why is it that of all the added SEXP's there hasn't been one that makes a ship disappear in it's entirety but is still there so can be recalled back at a moments notice?

I personally can see a bazillion uses for this so I'm not sure why it hasn't happened.

Probably because we've been doing tons of other stuff and there's a perfectly fine way of doing it already?
Title: Re: ship-invisible breaks collisions
Post by: Sesquipedalian on March 15, 2006, 07:43:53 pm
I suggest setting all the friendly ships to a different team (e.g. neutral), and then making ALL ships (including the player) stealth usings the set-ship-stealthy sexp.  That would make them untargetable for the player, and also for each other, so you can be more sure that no important ships will be destroyed while the player is "away."
Title: Re: ship-invisible breaks collisions
Post by: Ferret on March 16, 2006, 07:14:34 am
I suggest setting all the friendly ships to a different team (e.g. neutral), and then making ALL ships (including the player) stealth usings the set-ship-stealthy sexp.  That would make them untargetable for the player, and also for each other, so you can be more sure that no important ships will be destroyed while the player is "away."
THAT.. might just work, thank you! *Tests it*
Title: Re: ship-invisible breaks collisions
Post by: Ferret on March 20, 2006, 12:10:07 pm
Right no it didn't, I've been away for the weekend and so have been trying to do this since I came back, I had a slight feeling it was something totally different that was breaking collisions.
And well holy crap it was.

The set-ship-position SEXP when I use it on Alpha 1 is letting the player fly into anything. :shaking:

Can anyone else test this SEXP to tell me if they're getting the same dealy? I've tried as many builds I can find that will even use the SEXPs and I'm still flying into stuff.. *cries*
Title: Re: ship-invisible breaks collisions
Post by: StratComm on March 20, 2006, 02:40:21 pm
Does a shorter set-ship-position hop (say, 5km) still result in this bug?  70km is a fairly long way, and may impact things a little strangely if my hunch is right.  How big is the mission area these days?
Title: Re: ship-invisible breaks collisions
Post by: Ferret on March 20, 2006, 02:41:56 pm
Yes I tried it by sticking the warp about 50 metres away and got the same result.

I did have to reduce the hop to about 50 km anyway, I had it a bit higher and it was messing with the HUD.
Title: Re: ship-invisible breaks collisions
Post by: Sesquipedalian on March 21, 2006, 08:47:38 pm
Hmm.  If you use the set-ship-position sexp on a non-player ship, does it also stop colliding with objects, or is it only the player ship that suffers from this bug?

Either way, you should post a bug report in Mantis (go to the SCP forum for the link).  But if non-player ships retain their collision data, you can work around this bug by moving all of them instead of moving the player.  You would just need to use the every-of sexp (you can look up how to use it in the FS2 wiki).
Title: Re: ship-invisible breaks collisions
Post by: karajorma on March 22, 2006, 02:26:10 am
:D I like that idea. Wouldn't work in missions with asteroid fields though cause you can't move them.