Ad Astra

Ad Astra

22M Downloads

[Bug]: Lander go down to the moon without me

bloodyraoul opened this issue ยท 4 comments

commented

Bug Description

First, the lander was not descending and stay in the air so I have seen there was a closed bug about that and the only thing to do is to remove config file and restart.
Now, the lander go down but i'm not inside and fall alone and crash on the planet

ad_astra-forge-1.19.2-1.11.9.jar
resourcefulconfig-forge-1.19.2-1.0.14.jar

How to Reproduce?

1 Place a rocket
2 Go to the moon
3 Fall on the surface

Expected Behavior

No response

Version

1.11.19

Mod Loader Version

1.19.2 - Forge 43.2.0

Mod Loader

Forge

Logs or additional context

No response

commented

samething happens with the fabric version 1.19.2 fabric loader 1.14.10 v1.11.9

commented

Quick scarpet script to fix this temporarily:

distance_horizontal(p1, p2) -> sqrt((p2:0 - p1:0)^2 + (p2:2 - p1:2)^2);

try_find_lander(player, try_count) -> (
  // if player is already on a lander, ensure they remain on it
  current_mount = player ~ 'mount';
  if(current_mount != null, (
    print(player, str('rocket-fix: player already on lander %s', current_mount ~ 'uuid'));
    schedule(5, 'ensure_player_on_lander', player, lander, 1);
    return();
  ));
  
  // attempt to find lander
  landers = entity_area('ad_astra:lander', player, [10, 200, 10]);
  // exclude landers already with passengers
  landers_filtered = filter(landers, length(_ ~ 'passengers') == 0);
  
  if(length(landers_filtered) < 1, (
    if(try_count > 10, (
      print(player, str('rocket-fix: no lander found after %d tries', try_count));
      return();
    ));
    schedule(5, 'try_find_lander', player, try_count + 1);
    return();
  ));

  // sort all found landers by horizontal distance to player
  player_pos = player ~ 'pos';
  landers_sorted = sort_key(landers, distance_horizontal(_ ~ 'pos', player_pos));

  lander = landers_sorted:0;
  print(player, str('rocket-fix: found lander %s (try %d), mounting player', lander ~ 'uuid', try_count));
  modify(lander, 'mount_passengers', player);
  schedule(5, 'ensure_player_on_lander', player, lander, 1);
);

ensure_player_on_lander(player, lander, try_count) -> (
  if(player ~ 'mount' != null, (
    // still on lander, probably
    // print(player, str('rocket-fix: mount still exists (try %d)', try_count));
    null
  ), (
    print(player, str('rocket-fix: re-mounting player (try %d)', try_count));
    modify(lander, 'mount_passengers', player);
  ));
  if(try_count > 10, (
    print(player, 'rocket-fix: done, have fun not being dead');
    return();
  ));
  schedule(5, 'ensure_player_on_lander', player, lander, try_count + 1);
);

__on_player_changes_dimension(player, from_pos, from_dimension, to_pos, to_dimension) -> (
  // players coming from rockets spawn well above height limit
  if(to_pos:1 <= 320, return());
  print(player, 'rocket-fix: attempting to put you back on your lander');
  try_find_lander(player, 1);
);
commented

Quick scarpet script to fix this temporarily:

distance_horizontal(p1, p2) -> sqrt((p2:0 - p1:0)^2 + (p2:2 - p1:2)^2);

try_find_lander(player, try_count) -> (
  // if player is already on a lander, ensure they remain on it
  current_mount = player ~ 'mount';
  if(current_mount != null, (
    print(player, str('rocket-fix: player already on lander %s', current_mount ~ 'uuid'));
    schedule(5, 'ensure_player_on_lander', player, lander, 1);
    return();
  ));
  
  // attempt to find lander
  landers = entity_area('ad_astra:lander', player, [10, 200, 10]);
  // exclude landers already with passengers
  landers_filtered = filter(landers, length(_ ~ 'passengers') == 0);
  
  if(length(landers_filtered) < 1, (
    if(try_count > 10, (
      print(player, str('rocket-fix: no lander found after %d tries', try_count));
      return();
    ));
    schedule(5, 'try_find_lander', player, try_count + 1);
    return();
  ));

  // sort all found landers by horizontal distance to player
  player_pos = player ~ 'pos';
  landers_sorted = sort_key(landers, distance_horizontal(_ ~ 'pos', player_pos));

  lander = landers_sorted:0;
  print(player, str('rocket-fix: found lander %s (try %d), mounting player', lander ~ 'uuid', try_count));
  modify(lander, 'mount_passengers', player);
  schedule(5, 'ensure_player_on_lander', player, lander, 1);
);

ensure_player_on_lander(player, lander, try_count) -> (
  if(player ~ 'mount' != null, (
    // still on lander, probably
    // print(player, str('rocket-fix: mount still exists (try %d)', try_count));
    null
  ), (
    print(player, str('rocket-fix: re-mounting player (try %d)', try_count));
    modify(lander, 'mount_passengers', player);
  ));
  if(try_count > 10, (
    print(player, 'rocket-fix: done, have fun not being dead');
    return();
  ));
  schedule(5, 'ensure_player_on_lander', player, lander, try_count + 1);
);

__on_player_changes_dimension(player, from_pos, from_dimension, to_pos, to_dimension) -> (
  // players coming from rockets spawn well above height limit
  if(to_pos:1 <= 320, return());
  print(player, 'rocket-fix: attempting to put you back on your lander');
  try_find_lander(player, 1);
);

how do i use this code i have searched google and haven't got any results that would help... i have carpet installed but can't make any sence of this code on how to get it to work

commented

you probably have https://www.curseforge.com/minecraft/mc-mods/minecraft-transit-railway which breaks the lander for some reason