Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Question on speed and Railguns.oxp

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Question on speed and Railguns.oxp

Post by Capt. Murphy »

Err - can you post the complete script after your edits. The 'code' snippets you are posting suggests you are editing the comments to the code and not the code itself. If that is the case then your changes won't do anything at all.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Commander Learner
Dangerous
Dangerous
Posts: 123
Joined: Thu Aug 20, 2009 12:08 pm
Location: Somewheeeeeere over the rainbooooooooooow~

Re: Question on speed and Railguns.oxp

Post by Commander Learner »

Har har Capt Murphy. Very funny.
Anyway, I changed it from

Code: Select all

if(player.ship.speed == 12 * player.ship.maxSpeed) 
to

Code: Select all

if(player.ship.speed == 22 * player.ship.maxSpeed) 
and

Code: Select all

	if(this.fuelFlag == 8.0) // every second under fuel injection
		{ 
		player.ship.fuel += 0.1;
		player.ship.velocity = player.ship.velocity.multiply(1.2);
		}
	}
to

Code: Select all

	if(this.fuelFlag == 1.0) // every second under fuel injection
		{ 
		player.ship.fuel += 5.0;
		player.ship.velocity = player.ship.velocity.multiply(1.0);
		}
	}
And oh yes! Does this code from Railguns.oxp

Code: Select all

			<key>energy</key>
			<integer>4</integer>
			<key>frequency</key>
			<real>0.29999999999999999</real>
define the energy used to fire one projectile or the weapon energy of the projectile to deal when it collides?
Shooting polygons since 2001
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Question on speed and Railguns.oxp

Post by Capt. Murphy »

Commander Learner wrote:
Har har Capt Murphy. Very funny.
Anyway, I changed it from

Code: Select all

if(player.ship.speed == 12 * player.ship.maxSpeed) 
to

Code: Select all

if(player.ship.speed == 22 * player.ship.maxSpeed) 
Well at least I made you laugh, but seriously it wasn't clear what you had done from what you had posted. :wink:

The original reads if(player.ship.speed == 7 * player.ship.maxSpeed) which is a valid test for being under injectors
Both of your edits break this. Your ship will never be at 12 or 22 times player.ship.maxSpeed for more than a millisecond and then only when accelerating to or decelerating from Torus speeds, so this test will nearly always be false and this.fuelflag isn't counting seconds anymore. Under full injectors any player ship is going at 7 x max speed, and under Torus 32 x Max Speed.

and

Code: Select all

	if(this.fuelFlag == 8.0) // every second under fuel injection
		{ 
		player.ship.fuel += 0.1;
		player.ship.velocity = player.ship.velocity.multiply(1.2);
		}
	}
to

Code: Select all

	if(this.fuelFlag == 1.0) // every second under fuel injection
		{ 
		player.ship.fuel += 5.0;
		player.ship.velocity = player.ship.velocity.multiply(1.0);
		}
	}
Given the problem with the first bit this.fuelFlag will rarely if ever been 1 or 8 so this code probably never kicks in.
And oh yes! Does this code from Railguns.oxp

Code: Select all

			<key>energy</key>
			<integer>4</integer>
			<key>frequency</key>
			<real>0.29999999999999999</real>
define the energy used to fire one projectile or the weapon energy of the projectile to deal when it collides?
Energy used to fire one projectile. The projectile imparts collision damage only on collision which is related to it's mass and velocity relative to the entity it collides with.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Question on speed and Railguns.oxp

Post by Thargoid »

In the original code, this.fuelFlag is a simple cyclic counter and works fine (the refuel boost only happens every 8s under continuous injection). But if people are hacking the code and modifying it to do other things then nothing is guaranteed, nor is it supported.
Post Reply