Author Topic: Intercity ufoTrajectory  (Read 354 times)

Offline robin

  • Commander
  • *****
  • Posts: 1248
  • ULTIMATE ROOKIE
    • View Profile
Intercity ufoTrajectory
« on: March 20, 2025, 12:23:27 am »
I'd like to create a trajectory to make a ufo fly (and land) from city to city.
Like this:
City A --> City B --> City C --> City D

Tried the following, but the result is:
City A --> middle of nowhere --> City A --> middle of nowhere --> City A
Strangely it lands in the middle of nowhere and not in the city, even though altitude 0 is set to zone 3 (city zone).

Code: [Select]
  - id: A14_INTERCITY
    # route for spaceliner or airferry, starts from a random city and
    # tours between cities.
    groundTimer: 6000
    waypoints:
      - [3, 1, 65]
      - [0, 4, 65]
      - [3, 0, 20]
      - [0, 4, 65]
      - [3, 0, 20]
      - [0, 4, 65]
      - [3, 0, 20]
      - [0, 4, 65]
      - [3, 0, 20]
      - [5, 0, 100] # needed?

This is the mission:
Code: [Select]
  - type: STR_EGGS_SPREAD_XLARGE
    points: 30
    operationType: 0
    raceWeights:
      0:
        STR_CULT: 100
    waves:
      - ufo: STR_CRAFT_SPACELINER
        count: 1
        trajectory: A14_INTERCITY
        timer: 100

Thanks

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 182
    • View Profile
Re: Intercity ufoTrajectory
« Reply #1 on: March 20, 2025, 01:16:03 am »
The way I've understood the explanation in the ruleset, when you specify the waypoint for landing (altitude 0) it happens BEFORE heading to the zone, so with the [3,0,20] what you're telling it is to land when it reaches the previous waypoint and after take off, head to zone 3 at 20% max speed (altitude will be 1 after takeoff) so you probably want to swap the altitute of waypoints after the 2nd one like this:
Code: [Select]
    waypoints:
      - [3, 1, 65]
      - [0, 4, 65]
      - [3, 4, 20]
      - [0, 0, 65]
      - [3, 4, 20]
      - [0, 0, 65]
      - [3, 4, 20]
      - [0, 0, 65]
      - [3, 4, 20]
      - [5, 0, 100] # needed?
See if it behaves as desired.

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 182
    • View Profile
Re: Intercity ufoTrajectory
« Reply #2 on: March 20, 2025, 03:08:39 pm »
Ater testing I've come up with this set of waypoints
Code: [Select]
    waypoints:
      - [3, 0, 20]
      - [3, 0, 20]
      - [3, 0, 20]
      - [3, 0, 20]
      - [3, 0, 20]
The ufo that uses this trajectory will start landed in a city for the region and will go to another random city after taking off. Repeats are possible and I don't think there's a way to force it not to, but the more cities a region has, the less likely it is to happen. For its last waypoint it will head to another city and despawn when it reaches it. If you don't want it to start landed, then change the 1st waypoint so it has an altitude other than 0. Add/remove the number of waypoints as you need and change the speed to your preference.

Offline robin

  • Commander
  • *****
  • Posts: 1248
  • ULTIMATE ROOKIE
    • View Profile
Re: Intercity ufoTrajectory
« Reply #3 on: March 20, 2025, 10:37:08 pm »
Many thanks, I'll try. The problem, that I didn't think of before, is that the trajectory is limited to a region and my mod has very few cities per region. So this idea might not work in practice.

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 182
    • View Profile
Re: Intercity ufoTrajectory
« Reply #4 on: March 20, 2025, 11:45:48 pm »
You could work around that by adding a special region that contains a single mission zone the same way TFTD does for artifacts and in that zone put the same coordinates of your cities. Just make sure that the mission in question is restricted to this region only and that the waypoints correctly reference the zone (it'll be 0 instead of 3). You'll have to give the region a text string aswell as it will appear in hyperwave detection screens I believe.

Offline robin

  • Commander
  • *****
  • Posts: 1248
  • ULTIMATE ROOKIE
    • View Profile
Re: Intercity ufoTrajectory
« Reply #5 on: March 21, 2025, 12:35:53 am »
Brilliant! Thanks
The only way to restrict the region is to place the mission in an ad hoc missionScript, correct?

Offline CrazedHarpooner

  • Colonel
  • ****
  • Posts: 182
    • View Profile
Re: Intercity ufoTrajectory
« Reply #6 on: March 21, 2025, 11:21:14 am »
Not sure if it's the only way, but it is the way I'm familiar with
Code: [Select]
    missionWeights:
      0:
        YOUR_ALIEN_MISSION: 100
    regionWeights:
      0:
        YOUR_SPECIAL_REGION: 100