Question on speed and Railguns.oxp
Moderators: winston, another_commander
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: Question on speed and Railguns.oxp
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.
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
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
- Commander Learner
- Dangerous
- Posts: 123
- Joined: Thu Aug 20, 2009 12:08 pm
- Location: Somewheeeeeere over the rainbooooooooooow~
Re: Question on speed and Railguns.oxp
Har har Capt Murphy. Very funny.
Anyway, I changed it from to
and
to
And oh yes! Does this code from Railguns.oxp
define the energy used to fire one projectile or the weapon energy of the projectile to deal when it collides?
Anyway, I changed it from
Code: Select all
if(player.ship.speed == 12 * player.ship.maxSpeed)
Code: Select all
if(player.ship.speed == 22 * player.ship.maxSpeed)
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);
}
}
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);
}
}
Code: Select all
<key>energy</key>
<integer>4</integer>
<key>frequency</key>
<real>0.29999999999999999</real>
Shooting polygons since 2001
- Capt. Murphy
- Commodore
- Posts: 1127
- Joined: Fri Feb 25, 2011 8:46 am
- Location: UK South Coast.
Re: Question on speed and Railguns.oxp
Well at least I made you laugh, but seriously it wasn't clear what you had done from what you had posted.Commander Learner wrote:Har har Capt Murphy. Very funny.
Anyway, I changed it fromtoCode: Select all
if(player.ship.speed == 12 * player.ship.maxSpeed)
Code: Select all
if(player.ship.speed == 22 * player.ship.maxSpeed)
The original reads
if(player.ship.speed == 7 * player.ship.maxSpeed)
which is a valid test for being under injectorsBoth 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.
Given the problem with the first bit this.fuelFlag will rarely if ever been 1 or 8 so this code probably never kicks in.andtoCode: 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); } }
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); } }
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.And oh yes! Does this code from Railguns.oxpdefine the energy used to fire one projectile or the weapon energy of the projectile to deal when it collides?Code: Select all
<key>energy</key> <integer>4</integer> <key>frequency</key> <real>0.29999999999999999</real>
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
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
Re: Question on speed and Railguns.oxp
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.My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link