189 Commits

Author SHA1 Message Date
Jens Ayton
959dc99d88 Added big fat deprecation warning for scriptActionOnTarget:. Added skanky code to avoid running world scripts more than once with certain player states (such as STATUS_EXITING_WITCHSPACE).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1445 127b21dd-08f5-0310-b4b7-95ae10353056
2008-03-02 18:56:24 +00:00
Jens Ayton
fda95ca90a r1438 redux.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1440 127b21dd-08f5-0310-b4b7-95ae10353056
2008-03-01 22:05:11 +00:00
Jens Ayton
ddf50cf43e Fixed Xcode project to stop changing Basic-debug.oxp/requires.plist to require version 1.70 when building release builds; fiddled with project to reduce number of places version number is specified.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1439 127b21dd-08f5-0310-b4b7-95ae10353056
2008-03-01 21:01:00 +00:00
Jens Ayton
101f811d72 Fix for Mac builds when there are spaces in the project path.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1438 127b21dd-08f5-0310-b4b7-95ae10353056
2008-03-01 20:40:29 +00:00
Jens Ayton
cf87bfe72f Fix for argument-may-be-clobbered warning in optimized Mac builds.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1437 127b21dd-08f5-0310-b4b7-95ae10353056
2008-03-01 20:18:41 +00:00
Jens Ayton
9fb7456e20 (Woops, thought I did this last night.) Implemented stack for temporary local variables for non-world legacy scripts. (Previous approach was quite thoroughly broken, as it didn't allow reentrancy and broke locals for world scripts.) Moved -descriptionComponents and such into new OOCocoa.m, and added -shortDescription.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1433 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-29 15:48:00 +00:00
Jens Ayton
27d4002e2c Twiddled Xcode project to behave in the presence of system-wide libOgg/libVorbis installations.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1431 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-28 22:33:35 +00:00
Jens Ayton
cec97f0baf shipHitByECM() JS event now has a pulsesRemaining parameter.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1424 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-26 11:01:40 +00:00
Jens Ayton
e95e3fd521 Most AI reactToMessage: calls now also have a script event; see http://www.aegidian.org/bb/viewtopic.php?p=47620#47620 . Some cleanup and optimization. Added command-line hack to graph difference between Vector.random() and Vector.randomDirectionAndLength() as in http://wiki.alioth.net/index.php/Image:Randomvectordistribution.png .
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1423 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-26 01:54:26 +00:00
Jens Ayton
cc056a6a75 Legacy foo_actions can now have local variables, which are cleared when the _actions completes. Marked DebugConsole.py executable for unices. Fixed bugs in vector randomization code, and added a third randomizer which provides an even distribution of lengths (but uneven distribution in space).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1420 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-25 16:22:15 +00:00
Jens Ayton
a420a4dbe6 Global JavaScript methods (which aren't constructors) now have names starting with lowercase letters, in accordance with JavaScript norms. There are compatibility aliases for the old forms. Log() and LogWithClass() merged into single log(). All JavaScript compatibility aliases for deprecated forms are now implemented in JavaScript, in the new oolite-global-prefix.js script. Changed all copyright notices regarding the project as a whole from 2004-2007 to 2004-2008.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1414 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-24 21:07:20 +00:00
Jens Ayton
4b3a74e847 Added script events for planet and station proximity events. Fast PowerPC square root approximation is now actually used. Redefined nil and Nil to be type-pedantic under Cocoa (as they are under GNUstep). Waved a rubber chicken to appease the compiler.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1401 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-22 11:56:23 +00:00
Jens Ayton
0a1cd36e8d Made previously Mac-specific log header cross-platform (mostly; more information is included under OS X).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1386 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-17 15:37:12 +00:00
Jens Ayton
b73d9d98ec Work on replacing two different matrix types with different problems with one type that may have less problems. (I need the matrix to implement generalized cameras. I need the cameras to implement generalized lights. I need the lights to solve a problem with shaders. There might be an additional advantage or two to being able to place a camera anywhere rather than attached to the player, though.)
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1385 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-17 00:50:01 +00:00
Jens Ayton
0715cd3f1e * Random name generation once again uses typographic apostrophe (no, it's _not_ an acute accent), but now properly excludes it for system names.
* Removed pointless cache for relatively rarely used commodity display name lookup.
* Added playerEnteredNewGalaxy(newGalaxyNumber) script event.
* Changed descriptions.plist to OpenStep format.
* Descriptions.plist is now loaded before the first time it's used.
* -[Universe descriptionForKey:] and thus DESC() can now select a random string from an array.
* Added -[Universe descriptionForArrayKey:index:] for localization array lookups.
* Removed hard-to-localize [is-word] in favour of [system-description-string], and [adjusting-word] in favour of [clock-format] and [clock-format-adjusting].
* Removed redundant description strings [long-range-chart-find-planet] and [gameoptions-back].
* Moved mass-unit-to-string mapping to OOConstToString.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1376 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-14 17:23:24 +00:00
Jens Ayton
cba45c8e05 Broke music control out into a separate controller in preparation for JavaScript music interface. As a side effect, mission music should work on SDL builds, and the theme music should loop. I hope. To do: add music Off/On/iTunes control to config menu.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1343 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-03 15:44:24 +00:00
Jens Ayton
f11b6fae14 Implemented JS sound interface. Moved some more generic JS ObjC wrapper stuff into OOJavaScriptEngine.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1340 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-03 02:16:23 +00:00
Jens Ayton
07fc2a25b6 Fixed some bugs in OXP verifier.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1325 127b21dd-08f5-0310-b4b7-95ae10353056
2008-01-28 01:24:40 +00:00
Jens Ayton
c812e61ad9 More data-driven text rendering with eight-bit encoding support.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1323 127b21dd-08f5-0310-b4b7-95ae10353056
2008-01-27 23:37:56 +00:00
Jens Ayton
f2f194ee49 Fixed a bunch of warnings under Windows, some of which even made sense.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1294 127b21dd-08f5-0310-b4b7-95ae10353056
2008-01-02 14:35:54 +00:00
Jens Ayton
a97c9fd093 Fixed a few leaks, notably one that became serious on the short-range chart screen. Fixed some warnings when building for Windows.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1282 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-24 13:59:30 +00:00
Jens Ayton
4919cb197e Changed OOCreditsQuantity to uint64_t.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1274 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-13 11:53:25 +00:00
Jens Ayton
c1dd9c5b1a Fix for bug where awardEquipment:EQ_TRUMBLE while a trumble infection is in progress would innoculate the player against future trumble infections. Also added code to un-innoculate existing saved games.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1264 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-04 21:43:18 +00:00
Jens Ayton
ea5d5fc9e9 Fix for error messages when loading TestRelease build of Debug OXP (Mac only).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1263 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-04 17:44:06 +00:00
Jens Ayton
4546eb0baa Fix for OXP verifier turning of log message classes. Exterminated all uses of NSLog that turn up in Mac builds.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1257 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-03 17:53:37 +00:00
Jens Ayton
df05fbd65f Updated version numbers.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1250 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-02 20:43:08 +00:00
Jens Ayton
2ca470e07f Fix for bug 011691 Cancelling load game dialog handled badly, work-around for bug 011893 Full-screen mode menu input broken reinstated and cleaned up.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1248 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-02 14:21:46 +00:00
Jens Ayton
56eb8f1738 Renamed a bunch of script handlers and gave NPC scripts some events that only player scripts got before. Added compatibility mechanism to point out uses of old handlers.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1247 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-02 00:50:06 +00:00
Jens Ayton
3fbc24887d * All ships now have a JavaScript script attached, allowing JS scripts to
add behaviours to any ship.
* Legacy script_actions, setup_actions, launch_actions and death_actions
  handled through default JavaScript script.
* In order to implement the above, JS Ship now has a runLegacyScriptActions
  method. This is not to be exposed as an "official" method, though, since
  we might want to change the mechanism -- for instance, to "compile"
  legacy scripts into JS. Handling dynamically-generated legacy scripts in
  that case would be a significant complication.
* Updates for Mac OS X 10.5 "Leopard".
  - Errors on reading/writing plist will not cause a crash if building
    against the Leopard SDK. (I have no intention of requiring Leopard any
    time soon, but future-proofing is good.)
  - OOWeakReference is now more efficient when running under Leopard, by
    implementing the new "fast forwarding" mechanism.
  - Threads now have names set under Leopard, which may provide debugging
    advantages.
  - Fixed some new build warnings for new version of apple-gcc.
  - Updated type declarations to identify Oolite saved games as property
    lists.
* Cleaned up PlayerEntityControls.m somewhat. Moved method declarations
  into files, fixed indentation, broke up monster giant method of doom.
* Script-generated asteroids now behave like system populator-generated
  asteroids (As Seen on BB[TM]).
* Minor optimizations and simplifications of legacy script engine.
* JS System.filteredEntities() now has sensible behaviour if predicate
  throws an exception: the predicate is not called again, and null is
  returned. The exception is reported and not rethrown.


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1240 127b21dd-08f5-0310-b4b7-95ae10353056
2007-11-23 15:04:14 +00:00
Jens Ayton
9d9128bcb1 * Got Game Options submenu working under OS X.
* Save reduced detail, wireframe and shader settings in preferences.
* Implemented variable shader complexity support.
Added default shader, used for all otherwise-unshaded ships with full shaders on, and for smooth ships or ships with effect maps specified in material dictionary with simple shaders.
* All ships now drawn with slight specular highlight by default (shininess = 10, intensity = 0.2) except in reduced detail mode.
* (JS) Made Ship.shipDescription read-write (except for the player).
* (JS) Added global function ExpandDescription(string : String), to perform substitutions like %H, [commander_name] and so forth. 
* (JS) Added global function RandomName(), intended to be like %R substitution. In so doing, I discovered that %R is broken, but left it as-is so it will generate the same name for existing descriptions. Added %X to do the same thing, but without the bugs. RandomName() is different from either in that it doesn't use the "predictable" PRNG, so it will provide a new name each time. To use the "predictable" variant in JavaScript, use ExpandDescription("%X"). 
* Ships that hyperspace out are no longer replenished in interstellar space.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1228 127b21dd-08f5-0310-b4b7-95ae10353056
2007-10-22 12:18:18 +00:00
Jens Ayton
8dac1d08cd Split JS Planet into Planet and Sun in anticipation of splitting PlanetEntity in same way.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1214 127b21dd-08f5-0310-b4b7-95ae10353056
2007-10-15 13:20:27 +00:00
Jens Ayton
6a8c7976dd Added scriptInfo dictionary to ships, and global JS objects worldScripts and worldScriptNames. Fiddled with messages on both sides of debug console. Fiddled with flags on JavaScript classes, hopefully for the better.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1211 127b21dd-08f5-0310-b4b7-95ae10353056
2007-10-13 15:10:16 +00:00
Jens Ayton
160cd8b94d Implemented JS class Planet. Added JS System attributes mainPlanet, sun, planets and allShips, and methods shipsWithPrimaryRole(), shipsWithRole(), entitiesWithScanClass() and filteredEntities() (the latter disabled due to an architectural flaw -- we need more than one JSContext). In support of this, added/exposed generic predicate-based entity counters and getters to Universe.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1198 127b21dd-08f5-0310-b4b7-95ae10353056
2007-10-07 21:41:18 +00:00
Jens Ayton
8904c39401 Oolite should now build with external debug console support on all platforms. Mac debug OXP is broken.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1191 127b21dd-08f5-0310-b4b7-95ae10353056
2007-10-06 11:03:01 +00:00
Jens Ayton
3c16a7cdaf Added clearMissionScreen scripting method (legacy and JS). Scripting tweaks. Ported trumble mission to JavaScript. Attempted to address JS Ship.escorts bug but couldn't reproduce it.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1187 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-29 12:27:31 +00:00
Jens Ayton
8b098b3b76 Implemented Player.commsMessage() and player.consoleMessage() JS methods. Mucked about with key_dump_target_state -- now debug/test build only.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1183 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-23 14:32:40 +00:00
Jens Ayton
7e4b1b0880 Implemented JS clock global object, unbroke makefile.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1175 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-15 15:09:19 +00:00
Jens Ayton
0da77044e5 Implemented JS Timer object. Updated priority queue test case.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1173 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-15 13:53:30 +00:00
Jens Ayton
7b061ad0f7 Work on script timers.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1172 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-14 15:21:06 +00:00
Jens Ayton
77df587d1a Split out remaining JS classes from OOJavaScriptEngine.* into new files. Added expandable pirate-victim recognition via pirate-victim-roles.plist. Added a number of AI methods for searching for entities by role and scan class.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1169 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-12 17:00:59 +00:00
Jens Ayton
693c27e2c2 Added OORoleSet to manage sets of ship roles and probabilities. Now used in -[Universe newShipWithRole:]. Next step: replace ShipEntity.roles with an OORoleSet. Future step: store role sets -- and other attributes -- in 'ship type' objects instead of parsing on the fly.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1165 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-07 10:14:30 +00:00
Jens Ayton
d47bf18321 Refactored debug OXP into a client-server design, potentially allowing external versions of the JavaScript console over Distributed Objects or TCP/IP.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1164 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-06 22:56:58 +00:00
Jens Ayton
51afdc0a40 Fixes for minor build problems.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1159 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-05 14:43:53 +00:00
Jens Ayton
a265c06344 * Work on generic-ish JavaScript object bridging.
* Fixed potential crashing bug in JS memory management (OOJSScript was not releasing its JS GC root).
* Fixed bug with several shipdata.plist settings being ignored in StationEntitys (bug #11684).
* Added JS Oolite object for app and JS version number checking; may add other facilities.
* Require latest version of SpiderMonkey (Gecko 1.8/FireFox 2 version) with JavaScript 1.7 support, built with JS_C_STRINGS_ARE_UTF8. 
*Made SpiderMonkey build as a subproject in Xcode for ease of debugging.
* Further fiddling with Mac debug console.
* Added has_npc_traffic attribute to StationEntity.


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1157 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-04 23:04:09 +00:00
Jens Ayton
2df17375b1 Missing files from r1153.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1154 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-01 12:07:02 +00:00
Jens Ayton
803aa63c67 Mac JS console: implemented history (option-up/down arrow).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1150 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-28 16:55:52 +00:00
Jens Ayton
699e5f5ff6 Fixed bug where player's dockedStation was nil at startup (due to circular dependencies). Added Build All target to Xcode project to avoid circular dependency between Oolite and Debug.oxp. (The Oolite target now no longer builds Debug.oxp. Build All builds Oolite, then builds Debug.oxp, then copies Debug.oxp into AddOns.)
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1147 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-27 13:17:43 +00:00
Jens Ayton
3cb87b1aab Fixed Mac breakage due to previous fix for non-Mac breakage.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1145 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-25 02:21:31 +00:00
Jens Ayton
a1451d4a3e Dicking around with Mac-specific debug stuff instead of doing real work. Added JavaScript console window (intended to be interactive, but isn't yet; shows errors, warnings and JS-generated log messages a bit more prettily than the standard log). Added F-Script support (F-Script is not yet another OXP scripting language, it's an interactive language integrated with the ObjC runtime, making a useful debug tool for poking around).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1141 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-25 01:15:40 +00:00
Jens Ayton
f5e3b4894e Made Mac debug OXP a loadable module instead of including code in Oolite itself.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1139 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-23 20:18:22 +00:00