3152 Commits

Author SHA1 Message Date
Eric Walch
b8359a110b - Added a JS script to pilots. On unloading at a station, the event "unloadCharacter()" is send to the pilot-script.
- Characters in character.plist now always do a basic setup. That way there is always a valid pilot when not using all character keys. This allows for partial randomisation of pilots for the unused keys.
- Added a JS script for the constrictor-pilot.
- Added default pilots to be used by oxps.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3841 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-30 20:11:45 +00:00
Eric Walch
4fe9f0227e Added a "dockingCorridorIsBusy" flag to the station dumpstate.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3840 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-29 21:32:34 +00:00
Eric Walch
2d498a07ca - Fixed the sign bug with the w-component in the vector method "rotateBy".
- Added vectorUp, vectorForward and vectorRight as JS property of ship.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3839 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-28 12:08:00 +00:00
Eric Walch
029f2860fe Added a "distresMessageReceived(agressor, sender)" event handler.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3838 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-27 12:20:18 +00:00
Nikos Barkas
0898cfc152 - Fix for view direction not being updated at the time of guiScreenChange. The JS event handler viewDirectionChanged(to, from) now handles
view screen and custom view changes.
- Renamed the JS property viewID to viewDirection, as the ID suffix usually denotes integer type rather than string.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3837 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-27 10:42:23 +00:00
Nikos Barkas
fbc4ceb0a1 Switching from GUI screens to flight screens is now recognized by the guiScreenChanged event handler. Added the JS player.ship attribute viewID, which is read-only and returns a string corresponding to the current view.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3836 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-26 22:18:51 +00:00
Eric Walch
63ea7e6288 Fixed problem of not showing report screen after a character script had created a mission screen. Report screen check now happens as part of the missionscreen opportunity.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3835 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-25 20:32:03 +00:00
cmdrjames
3dec932e3f Add support for variable ranged turrets
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3834 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-22 23:28:59 +00:00
Eric Walch
bb7c5495a1 Added a second scriptedMisjump check after the shipWillEnterWitchspace handler. That was lost after my last code switch.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3833 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-22 17:06:04 +00:00
Michael Werle
6b405350cd * Add player-wormholes (new AI function: enterPlayerWormhole).
* Refactored jump-code.
* Add minimum 0.1LY fuel consumption
* Fix cannot-jump-to-origin-system-from-interstellar-space bug


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3832 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-21 11:35:28 +00:00
Nikos Barkas
50ff0077bd When an NPC dies by another ship's actions, the script event 'shipKilledOther' is executed, with arguments the ship entity that killed the ship and the context. The handler is executed immediately after the 'shipDied' one, just before the victim ship becomes an explosion.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3831 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-20 23:06:58 +00:00
Eric Walch
b7a140cd79 - added a shipWillExitWitchspace and shipExitedWitchspace handler for launches from interstellar stations when the station appears in normal space after launch.
- made that such interstellar carriers/stations appear near the witchspaceEntryPoint

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3830 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-20 12:58:23 +00:00
Marc
41bbfed293 - stop following the snapshots folder on a mac if it's in the trash!
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3829 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-19 11:40:47 +00:00
Marc
0b5d26459e - hopefully last compile warning correction, for macs this time...
- for named snapshots, i.e. takeSnapShot('foo'), if the file foo.png already exists, the snapshot will be saved as foo-001.png, etc...
- tiny code cleanup!

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3828 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-19 01:32:29 +00:00
Nikos Barkas
8d66d15818 Fixed crash in Windows.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3827 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-18 23:58:01 +00:00
Marc
224044b0e4 - some checks added to takeSnapShot().
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3826 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-18 23:24:57 +00:00
Nikos Barkas
c83f2f1643 Made entity collision radius accessible by scripts and read-only.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3825 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-18 22:18:52 +00:00
Eric Walch
2890ff2d33 - witchspace jump abortion because of damage now takes place before the shipWillEnterWitchspace handler fires.
- takeInternalDamage now also takes the ship_trade_in_factor into account.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3824 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-18 20:30:28 +00:00
Nikos Barkas
c06ef0ba0e Implemented the global JS method takeSnapShot. Takes optional filename as parameter. If filename exists, standard auto-naming snapshot is used to avoid overwrite. The snapshot method now returns boolean. Mac devs, please test.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3823 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-18 16:26:30 +00:00
Nikos Barkas
c7b54ece76 Fixed Berlios bug #17721: Contracts: Able to purchase more than cargo hold limit.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3821 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-17 21:42:31 +00:00
Marc
29b03a7454 - NEARBY_SYSTEM destinations from interstellar space made less unrealistic...
- minor tidy up to hopefully remove some linux nightly build warnings...

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3820 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-17 09:13:16 +00:00
Eric Walch
506770ba27 - better role checking for ships starting to escort. No check for role, but for primaryRole. Should prevent ships being escorted by wrong ships. (It use to be this way in older Oolite versions before 1.72?)
- translated some flashers to the new subentitie definition, allowing the viper flashers to be initially off.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3819 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-16 16:34:32 +00:00
getafix
f2b95b7606 Added the escape pod entry in the joystick configuration menu,
following to the changes introduced in r3808.


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3818 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-15 23:10:31 +00:00
Marc
2ba5c6d0d3 - extra delay - proportional to witchspace travel time - if escape pod ends up in a neighbouring system.
- debug logs cleanup.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3817 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-15 01:59:17 +00:00
Marc
4b494137f5 corrected a mac compile warning
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3816 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-15 01:34:15 +00:00
Marc
954abef139 * escape pods changes:
- while inside the escape pod, stopped js from accessing Ship & PlayerShip properties of player.ship (while in the pod, we still had access to all the equiment inside the original player.ship, etc...)
- new js function: player.setEscapePodDestination() - takes 1 argument to override the standard destination (main station, or none if in witchspace). Accepts either null/false, a specific station inside the current system, or the string 'NEARBY_SYSTEM' to send the rescued capsule to a nearby system's main station - can only be used while inside the pod, via one of the 2 pod triggered events (or the debug console!).
- collision when docking: removed second AI collision message, to prevent carriers from moving about in reaction to a bad docking.
- some cleanup & minor code optimisation...


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3815 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-14 22:19:28 +00:00
Michael Werle
0266a49b78 Commit various options of recharging shields & energy banks, as discussed.
By default, Eric's suggestion is enabled (Case 1).  Case 0 is current
behaviour, and Case 2 is my suggestion.

Once a solution is picked, the others should be removed.


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3814 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-14 18:40:28 +00:00
Nikos Barkas
b0b182153b Weapons online/offline toggle can now work only in non-strict mode.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3813 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-14 15:24:27 +00:00
Nikos Barkas
ac59b3a6b3 Double=tap for escape pod works now only in non-strict mode. Also, the old behaviour can be still applied if the key escape-pod-activation-immediate is set to true inside the preferences file.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3812 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-14 12:40:45 +00:00
Eric Walch
85b8f95c8e - Corrected two dodo flashers that were out of phase, as noticed by Commander McLane
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3811 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-14 10:05:47 +00:00
Eric Walch
06acc9efb2 - Removed the COLLISION AI message for docking ship because that leads to abortion of docking.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3810 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-13 22:20:02 +00:00
Marc
b3647b67bc escape pods part II:
- player and NPCs can eject at all times now.
- if pod ejected in witchspace, it's game over for the player, unless overridden by oxp.
- if pod ejected in normal space, the player will always reappear at the main station, unless overridden by oxp!
- new worldScript event 'escapePodSequenceOver' to override escape pod behaviour: if at the end of the event player.ship.target is a dockable station, the player will reappear inside it, otherwise game over!
- new translation string: gameover-escape-pod

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3809 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-13 20:10:05 +00:00
Nikos Barkas
6e07a6d055 Double click for escape pod should now work also on the assigned joystick button. Fixed problem where first escape pod key press would reset all key states. Now only the keystate of the escape pod key is reset.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3808 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-13 19:03:05 +00:00
Nikos Barkas
98e9aa6f2d Escape pod activation now requires a double keypress. This will guarantee that the player will eject only when they truly want to eject.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3807 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-13 16:45:31 +00:00
Eric Walch
a800373105 - Added a missing "shipCollided" event handler to the docking tunnel.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3806 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-13 16:24:10 +00:00
Nikos Barkas
f81cfc21ae Implemented the allowsAutoDocking property for stations and made it visible and read/write to scripts. Defaults to YES.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3805 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-12 18:20:22 +00:00
Marc
16ec149cca - fix: corrected display problems when launching escape pod while on the F7 screen.
- fix: looking at the F7 screen while docked in interstellar space would disable F1.
- fix: launching the escape pod is meant to reset the player's legal status. Occasionally that wouldn't happen.
- change: escape pod will dock at the nearest friendly station/carrier. Defaults to the system main station otherwise.
- change: if a friendly carrier/temporary station is present in interstellar space, the escape pod can now be ejected.
- cleanup!

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3804 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-12 13:55:33 +00:00
Michael Werle
0557a5ef6c Fix for first ship in Shipyard's rotation being reset. (Introduced in r3796)
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3803 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-11 23:40:58 +00:00
Eric Walch
e3ec0f5c2c Removed the shipname from the commsMessage itself.
The name is now only visible for the player and not for the new receivedCommsMessage handler, that can use the shipEntity to get the name.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3802 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-11 21:01:42 +00:00
Marc
86e597a91c - primed equipment: savegame fix.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3801 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-11 15:40:52 +00:00
Nikos Barkas
5e14f4110f Eliminated 'control reaches end of non-void function' warning. Also, when Ctrl + prime equipment key is pressed, the relevant equipment list is traversed in reverse. This could be useful when a lot of primable equipment exists.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3800 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-10 22:23:05 +00:00
Marc
ec4a512194 * Primable equipment! Use shift-n to select, and n to activate the equipment.
- New primed equipment key in savegames.
- Equipment scripts only respond to the activate event.
- Equipment scripts have access to this.equipmentKey, which contains the equipment type the script is associated to (e.g. 'EQ_WHATEVER')
* More commsMessage stuff:
- new parameter: ship.commsMessage(message [, toShip]) the second - optional - parameter now allows for narrowcast, as opposed to generic broadcast within scanner range - in crowded systems it's faster to narrowcast to a couple of ships, than to just broadcast the message to all ships in range!
- commsMessageReceived event: the ship sending the message is now passed as a second parameter to the event handler.
* new equipmentInfo property: scriptName
* new ship property: isPiloted
* assorted code cleanup...

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3799 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-10 21:49:23 +00:00
Eric Walch
232a22c0c2 changed the scan-method for stations in getWitchspaceEntryCoordinates. Should prevent traders from launching in front of the station during heavy traffic.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3798 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-10 20:03:34 +00:00
Nikos Barkas
3aa5084cbf Made the player ship's weapons online / offline status visible to JavaScript by means of the read-only boolean weaponsOnline property.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3797 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-09 11:29:52 +00:00
Michael Werle
ff9f049d10 Revert hackish ship rotation fix from r3792 and replace by a slightly less hackish version (re-uses a variable in ShipEntity now, instead of in Universe).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3796 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-08 22:12:13 +00:00
Michael Werle
d1b4310ab7 Energy-level-alert fix for ships with only 1 energy bank, now triggers on 0.9 instead of 1.0 for those ships.
Also colour the energy bank red when low on energy.


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3795 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-07 18:57:40 +00:00
Eric Walch
8cd3dbf90c Make sure that a broadcasted commsMessage always goes to the player when he is in range.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3794 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-07 15:48:51 +00:00
Eric Walch
a66ffa1e93 - made sure that vectorUp is used as rotation axis of planets and not the [0,1,0] vector.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3793 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-06 11:58:44 +00:00
Michael Werle
f36eacd966 Maintain rotation of ships in Shipyard and Load/Save Commander screens.
NOTE: This is currently a bit of a hack; should revise.


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3792 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-04 23:40:38 +00:00
Michael Werle
5545cae998 Fixed last commit for 32-bit machines.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3791 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-04 23:25:35 +00:00