Page 2 of 2

Re: Question on speed and Railguns.oxp

Posted: Sun Jan 29, 2012 4:03 pm
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.

Re: Question on speed and Railguns.oxp

Posted: Tue Jan 31, 2012 4:08 am
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?

Re: Question on speed and Railguns.oxp

Posted: Tue Jan 31, 2012 7:01 am
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.

Re: Question on speed and Railguns.oxp

Posted: Tue Jan 31, 2012 7:43 am
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.