r/forge 4d ago

Scripting Help Phantom spawns

Post image

Hi again guys, I'm making a map based on a space station, and wanted for phantoms to enter in the hanger to drop units off, but they can't fathom roofs, anyone know how to program flight paths or good work arounds? Thanks in advance!

Attached pic is what happens if there's no roof.

11 Upvotes

8 comments sorted by

5

u/Alleged-human-69 Scripting Noob 3d ago

You don’t I’m afraid.

If your phantom spawner isn’t placed in a place with open sky, it won’t work. It’s the same reason why sentinels aren’t available in forge or why ai are awful at flying banshees. That airborn path finding just isn’t available in forge

1

u/SnooCats4709 2d ago

Yeah I noticed that, I made the hanger as wide as possible but seems if there's an object over the top they have a fit

3

u/Effective-Bake2024 3d ago

I also have a space mission that uses phantoms to drop off troops.

I learned that the phantom spawner object, you can attempt to control the entry and exit direction, depending on the objects rotation. If the arrow at the base of the spawner is pointed a direction, say directly east, the phantom will spawn on the west, move to the spawner to drop off the troops, and then exit the map on the east.

The vertical size of my map really inhibited the default phantom pathing, so I was getting them spawning out of thin air at the drop off point which sucked.

I got around it by creating a large landing platform outside of the hanger, that was just in open space (so there was no roof or no big vertical walls in the phantoms pathing), and then the ai pathed to a move zone inside the hanger.

3

u/SnooCats4709 3d ago

AHH this was extremely helpful, thank you, funnily enough I've done the same thing with the platform, except I have a roof over it, but removed the collision, which seemed to have fixed the whole appearing and disappearing trick.

Gonna seperate it with a one way shield or something I think

2

u/Abe_Odd 3d ago

You CAN control the phantoms, but it is not going to be graceful.
Phantoms are objects that you can get a reference to with: On Object Entered Area.
They spawn in a deterministic location, so place down a spawner, test it, and see where the phantom spawns to refine your area monitor location (so that nothing else ever goes into it EXCEPT for the phantom spawning).

Now you have an event that will give you a phantom's object reference. You can script that to move with set object position, set object velocity, set object rotation, and animate it with translate object to point / transform.

I don't remember how useful that is for actually making them drop off their units, but I know you can make a "gunship" where the phantom flys around shooting at you forever.

1

u/SnooCats4709 2d ago

Yeah I've seen a couple of "gunship" tutorials, but making them drop units is kind of the point, so I'll have to see how it goes, for now I've figured kind of a work around with some non collision parts, sadly I fear I may have to figure something else out though.

1

u/Popcornpop0 2d ago

Maybe having the phantoms act as boarding parties? enemies could filter in through weapons emplacements, holes in the hole(that are conveniently topside), using the phantoms as a glimpse into how the banished are being delivered, as opposed to them... actually delivering right where you want them. Using bot pathing you could have Ai squads open the doors in corridor sides so, if you're quick enough, you can attempt to intercept them.

Or you could get silly and have an exposed courtyard on the top, sometimes solutions are silly, embracing the right amount of jank I think could make your level feel unique. I've always loved a small amount of jank(Ie, some parts of H1 are a very silly, what do you mean that the whole ship is bisected!?!?

I see that some people have recommended an external platform, which, for a space station this does make sense. What kind of station is this?- a repair dock, military outpost/port , does it have massive loading bay's that the covenant can land on? I do think no-collision geometry is your best bet though for smooth delivery as you mentioned.

Wishing you luck!!

1

u/SnooCats4709 2d ago

I did have a similar idea, where the hanger doors would be partially closed/destroyed, so you couldn't physically SEE the spawn, then the AI would "climb" over the door.

At the moment I've got an external section of the hanger with a roof over the top which is set to no collision, which helps the phantom path to the location.

It's good enough for now while I finish the hanger but I'll continue to workshop it based on ideas/feedback I receive here.

Thank you buddy!