Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missile_SetTarget #287

Open
Sammy-XI opened this issue Oct 29, 2019 · 5 comments
Open

Missile_SetTarget #287

Sammy-XI opened this issue Oct 29, 2019 · 5 comments

Comments

@Sammy-XI
Copy link

Some strange behavior using Missile_SetTarget() on a player fired projectile/rocket. Instead of going in a straight-ish line to the target, taking curvature into account, it travels up/down/up in a wave.

@K-Faktor
Copy link
Contributor

yes I support the above said. Missile guidance is not supported

@Sammy-XI
Copy link
Author

Sammy-XI commented May 5, 2020

Any new info on the issue? Thx.

Thus far, I think its the only real issue that affects the mod since the ability is needed in a few places.

@K-Faktor
Copy link
Contributor

K-Faktor commented May 5, 2020

beginReaperTargeting() {
  self endon("death");
  self endon("disconnect");
  self endon("reaper_done");
  level endon("game_ended");
  locator = spawn("script_model", self.origin + (0, 0, 32));
  locator setModel("tag_origin");
  locator.angles = (-90, 0, 0);
  locator hide();
  locator showtoplayer(self);
  self thread visualLocatorScan(locator);
  self thread watchForDeath(locator);
  wait 0.1;
  self thread reaperTimer(level.scr_reaper_timer);
  rounds = level.scr_reaper_maxrounds;
  self enableWeapons();
  while (rounds > 0) {
    self SetWeaponAmmoClip("radar_mp", 1);
    self waittill("weapon_fired");
    rocketArray = GetEntArray("rocket", "classname");
    closestRocket = undefined;
    range = (5000 * 5000);
    for (i = 0; i < rocketArray.size; i++) {
      d = distancesquared(self.origin, rocketArray[i].origin);
      if (d < range) {
        range = d;
        closestRocket = rocketArray[i];
      }
    }

    if (!isDefined(closestRocket))
      continue;
    closestRocket Missile_SetTarget(locator, (0, 0, 0));
    closestRocket waittill("death");
    rounds--;
  }

  self notify("stop_timer");
  self notify("reaper_done");
}

watchForDeath(locator) {
  self waittill_any("reaper_done", "death", "disconnect", "game_ended");
  level.airstrikeInProgress = undefined;
  safe_delete(locator);
}

@K-Faktor
Copy link
Contributor

K-Faktor commented May 5, 2020

It seems that the rocket control function itself does not work (locator)

@Sammy-XI
Copy link
Author

Sammy-XI commented May 5, 2020

The locator is fine. Missile_SetTarget itself does not work correctly. The function above is from OW2 and works as expected in regular cod4. But the same mod files with no alterations has the above behavior in cod4x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants