This is an actual Star Trek Gamebook that came out in 1982 or 1983: Unlike the two Which Ways, in which you played an Ensign starting out on the Enterprise, this one: Star Trek II: Distress Call has you seeing the action from a third-person narrative, the decisions being based around you deciding what happens next, or how whatever's just happened came about, in a "deciding the setting and events" kind of way.

It's a fun little romp. Check it out.