| Blockland Forums > Modification Help |
| Bullet Spread |
| (1/4) > >> |
| QuantumEagle:
I simply want to know the code for playing fire/reload animations as well as how to make bullets spread out over a large area. Please? |
| mp7964:
Look at Ephialtes' shotgun script. It has random bullet spread, also, look at T+T, it has spread, too. |
| Extrude:
--- Code: ---function tttpolterImage::onFire(%this,%obj,%slot) { if(%obj.getDamagePercent() < 1.0) %obj.playThread(2, plant); %projectile = %this.projectile; %spread = 0.000001; %shellcount = 1; for(%shell=0; %shell<%shellcount; %shell++) { %vector = %obj.getMuzzleVector(%slot); %objectVelocity = %obj.getVelocity(); %vector1 = VectorScale(%vector, %projectile.muzzleVelocity); %vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor); %velocity = VectorAdd(%vector1,%vector2); %x = (getRandom() - 0.5) * 10 * 3.1415926 * %spread; %y = (getRandom() - 0.5) * 10 * 3.1415926 * %spread; %z = (getRandom() - 0.5) * 10 * 3.1415926 * %spread; %mat = MatrixcreateFromEuler(%x @ " " @ %y @ " " @ %z); %velocity = MatrixMulVector(%mat, %velocity); %p = new (%this.projectileType)() { dataBlock = %projectile; initialVelocity = %velocity; initialPosition = %obj.getMuzzlePoint(%slot); sourceObject = %obj; sourceSlot = %slot; client = %obj.client; }; MissionCleanup.add(%p); } return %p; } --- End code --- |
| QuantumEagle:
Thanks, I'll try it after school today. |
| phflack:
--- Quote from: mp7964 on September 18, 2011, 12:17:07 PM ---Look at Ephialtes' shotgun script. It has random bullet spread, also, look at T+T, it has spread, too. --- End quote --- it's not random, well, there's a few different spreads which it then chooses i think, as there's a horizontal 3 spread EXACTLY the same which keeps popping up |
| Navigation |
| Message Index |
| Next page |