[Posting] Re: Phost experience
From:streu
Thread:Phost experience
Forum:Planets
In reply to:Re: Phost experience
Date:Thu, 2018-03-29 18:48 GMT

Nonzero warp does not prevent training - training prevents nonzero warp :smile:

From all my personel evidence this is disproved. Whenever I set the mission to training I get no results if I forget to set the warp to zero manually. (this evidence is taken from PCC2)
I'm not sure if the ship is moving if I set a waypoint with the training mission, since I usually don't set any. :smile:

At the time I wrote the previous reply, I had experimented manually. I have now also written a test case for PHost's automatic test suite that also shows that training works.

begin init
  (delete-all-ships)
  (delete-all-bases)
  (delete-all-minefields)

  ;; Create ship #1 at planet #20, owned by player 3
  (setq sid (create-ship 3 21 9 nil nil nil nil))
  (create-planet 20 3 0)
  (move-ship-to-planet sid 20)

  ;; Configure the ship: Training for 100 supplies, starting with 500 EP, warp 4
  (assert '(eq (ship-crew sid) 410))
  (assert '(eq sid 1))
  (put-ship-mission sid 38)
  (put-ship-intercept-target sid 100)
  (put-ship-exp-points sid 500)
  (put-ship-speed sid 4)
  (put-ship-waypoint-dx sid 20)
  (put-ship-waypoint-dy sid 20)

  ;; Configure the planet: 1000 supplies, 12 factories
  (put-planet-cargo 20 CARGO:SUPPLIES 1000)
  (put-planet-factories 20 12)
end

begin check
  (setq sid 1)
  (assert '(eq (ship-exp-points sid) 643))              ; gained 143 points
  (assert '(eq (ship-speed sid) 0))                     ; speed reset to 0
  (assert '(eq (ship-waypoint-dx sid) 20))              ; waypoint still remains
  (assert '(eq (ship-waypoint-dy sid) 20))
  (assert '(eq (ship-location-x sid) (planet-location-x 20)))  ; not moved
  (assert '(eq (ship-location-y sid) (planet-location-y 20)))
  (assert '(eq (planet-cargo 20 CARGO:SUPPLIES) 912))   ; 100 lost, 12 produced
end

I don't want to to claim PHost to be bug-free, it surely isn't, but I cannot reproduce a problem :sad:

PCC2 will color the mission yellow if you are training and have nonzero warp. This sends the message "the mission will not work", but in fact it's the move that will fail.


--Stefan

This is a testing version.
It may be incomplete, and have more bugs (or features) than the public live version at planetscentral.com.