Jump to content
Sign in to follow this  
Coronel_Niel

Secound Ac-130 Firing Problem - Debug

Recommended Posts

Well, here I am asking for help again.

My Ac-130 script works in basic form, but I wanted to add some realism.

So, what has quiet a few smaller numbers, but not a lot of larger ones? I jumped for Exponential. The exp command wouldn't work in Arma 2, I found out after a lot of time trying to get it to work. Next best thing.

I picked Binary. The script is a bit complicated, but experianced coders will make easy sence of it.

Problem is, this script wont fire. At all. The logic seems right, everything goes just fine. With a bit of tweaking, it now only fires on the spot of the target. You'll see if you run it.

Its meant to spread out around the target. Binary adds the proberbility of the number being smaller, as more shots would hit closer to the target than not.

Heres the script, you can try it yourself.

I started with the IED script by Jeevz, as that gave me the idea. But now, it looks nothing like it. I was going to finish off coments ect once i'd finished the work.

; ****************************************************************
; Script file for Armed Assault
; Created by: TODO: Author Name
; ****************************************************************

; AC-130 Gunship Script
; By Niel
; Adapted Jeevz IED script
; v0.1 12/13/06


; This script will simulate a Ac-130 gunship attack.
; It creates an explosion of a
; selected size on any object when called
; The arguments are [objectName, Size of Ammo]
; Explosion Power will be 1 of 3 choices
; 25mm - Gatling Gun - 15 shots -Good for Anti-Personnel use
; 40mm - Will usually disable a Humvee without killing the occupants
; 125mm - Will usually destroy a passing humvee and kill or severly injure all occupants, will disable the tracks and possibly engine on M1A1
; Huge - Nothing will survive, I mean... it's HUGE :-)


; Example script call --> [theCar, "Small"] exec "IED.sqs"

;start script

_theObject = _this select 0
_theExplosion = _this select 1

;locate the Object to be blown up
_bombLoc = GetPos _theObject
_bombLocX = _bombLoc select 0
_bombLocY = _bombLoc select 1
_bombLocZ = _bombLoc select 2

;Reset Shots Fired, binary and Shots

_ShotsFired = 0
_binaryX = 1
_binaryY = 1
_count1=0
_count2=0
_shot1 = 0
_shot2 = 0
_shot3 = 0
_shot4 = 0

; Deterimine the ordinance used to create the explosion
? (_theExplosion == "25mm") : _ammoType = "B_25mm_HE"
? (_theExplosion == "40mm") : _ammoType = "R_57mm_HE"
? (_theExplosion == "125mm") : _ammoType = "Sh_125_HE"
AirAttack sidechat "AC-130 Firing"


; Deterimine the shots used to create the explosion
? (_theExplosion == "25mm") : _ShotsNeeded = (random 10)
? (_theExplosion == "40mm") : _ShotsNeeded = (random 5)
? (_theExplosion == "125mm") : _ShotsNeeded = 1

;Make Small Explosion Shots Fired Random

? (_theExplosion == "25mm") : _ShotsNeeded = _ShotsNeeded+30

;Kept if needed

? (_theExplosion == "40mm") : _ShotsNeeded+0
? (_theExplosion == "125mm") : _ShotsNeeded+0

;Use Different Spreads

? (_theExplosion == "25mm") : _Spread = 10
? (_theExplosion == "40mm") : _Spread = 7.5
? (_theExplosion == "125mm") : _Spread = 5

;Repeating Fire

#loop

Goto "Binary"

#Shot1

_ammoType createVehicle[_bombLocX + _spreadx, _bombLocY + _spreadY, _bombLocZ]
~0.1

_ShotsFired=_ShotsFired+1

_shot1=1

? _ShotsFired>=_ShotsNeeded : goto "End"

Goto "Binary"

#Shot2


_ammoType createVehicle[_bombLocX - _spreadx, _bombLocY + _SpreadY, _bombLocZ]
~0.1

_ShotsFired = _ShotsFired+1

_shot2=1
? _ShotsFired = _ShotsNeeded: Goto "End"

Goto "Binary"

#Shot3

_ammoType createVehicle[_bombLocX + _spreadX, _bombLocY - _SpreadY, _bombLocZ]
~0.1

_ShotsFired = _ShotsFired+1

_shot3=1

? _ShotsFired = _ShotsNeeded : Goto "End"

Goto "Binary"

#Shot4

_ammoType createVehicle[_bombLocX - _spreadx, _bombLocY - _SpreadY, _bombLocZ]
~0.1

_ShotsFired = _ShotsFired+1

_shot4=1

? _ShotsFired = _ShotsNeeded : Goto "End"

Goto "loop"

#Binary

;Spread Logic

;? (_theExplosion == "25mm") : _count1 = (random 10)
;? (_theExplosion == "40mm") : _count1 = (random 10)
;? (_theExplosion == "125mm") : _count1 = (random 10)
;? (_theExplosion == "25mm") : _count2 = (random 10)
;? (_theExplosion == "40mm") : _count2 = (random 10)
;? (_theExplosion == "125mm") : _count2 = (random 10)

_count1 = 10
_count2 = 10

;_count1 = round(random 10)
;_count2 = round(random 10)

;Binary Based Random Spread

while "_count1 > 0" do {_binaryX=2*_binaryX _count1=_count1-1}
while "_count2 > 0" do {_binaryY=2*_binaryY _count2=_count2-1}
_spreadx =(_Binaryx / 1000 *_spread)
;_Binaryx =_Binaryx * _spread
_spready =(_BinaryY / 1000*_spread)
;_BinaryY =_BinaryY * _spread
;_spreadx = _Binaryx
;_spreadY = _BinaryY

? (_shot1 = 0) : goto "Shot1"
? (_shot1 = 1) : goto "Shot2"
? (_shot2 = 1) : goto "Shot3"
? (_shot3 = 1) : goto "Shot4"
? (_shot4 = 1) : goto "Reset"

#Reset

_shot1 = 0
_shot2 = 0
_shot3 = 0
_shot4 = 0

Goto "Shot1"

#End

exit

EDIT:

This script seems scruffy because of the ways I tried to get this to work. A lot of stuff is commented out, after checking it did nothing to help. Once the problem is solved, the randomness will be added back in.

Thanks, any help would be great.

Edited by Coronel_Niel

Share this post


Link to post
Share on other sites

It's now working up to the when statement, I'm not sure what your trying to achieve here? looks like your trying to lay down some random fire a round an area

Most of the errors were = or lack of.

; ****************************************************************
; Script file for Armed Assault
; Created by: TODO: Author Name
; ****************************************************************

; ****************************************************************
; Script file for Armed Assault
; Created by: TODO: Author Name
; ****************************************************************

; AC-130 Gunship Script
; By Niel
; Adapted Jeevz IED script
; v0.1 12/13/06


; This script will simulate a Ac-130 gunship attack.
; It creates an explosion of a
; selected size on any object when called
; The arguments are [objectName, Size of Ammo]
; Explosion Power will be 1 of 3 choices
; 25mm - Gatling Gun - 15 shots -Good for Anti-Personnel use
; 40mm - Will usually disable a Humvee without killing the occupants
; 125mm - Will usually destroy a passing humvee and kill or severly injure all occupants, will disable the tracks and possibly engine on M1A1
; Huge - Nothing will survive, I mean... it's HUGE :-)


; Example script call --> [theCar, "Small"] exec "IED.sqs"

;start script

_theObject = _this select 0
_theExplosion = _this select 1

;locate the Object to be blown up
_bombLoc = GetPos _theObject
_bombLocX = _bombLoc select 0
_bombLocY = _bombLoc select 1
_bombLocZ = _bombLoc select 2

;Reset Shots Fired, binary and Shots

_ShotsFired = 0
_ShotsNeeded = 0
_binaryX = 1
_binaryY = 1
_count1=0
_count2=0
_shot1 = 0
_shot2 = 0
_shot3 = 0
_shot4 = 0

; Deterimine the ordinance used to create the explosion
? (_theExplosion == "25mm") : _ammoType = "B_25mm_HE"
? (_theExplosion == "40mm") : _ammoType = "R_57mm_HE"
? (_theExplosion == "125mm") : _ammoType = "Sh_125_HE"
; AirAttack sidechat "AC-130 Firing"


; Deterimine the shots used to create the explosion
? (_theExplosion == "25mm") : _ShotsNeeded = (random 10)
? (_theExplosion == "40mm") : _ShotsNeeded = (random 5)
? (_theExplosion == "125mm") : _ShotsNeeded = 1

;Make Small Explosion Shots Fired Random

? (_theExplosion == "25mm") : _ShotsNeeded = _ShotsNeeded+30

;Kept if needed

? (_theExplosion == "40mm") : _ShotsNeeded+0
? (_theExplosion == "125mm") : _ShotsNeeded+0

;Use Different Spreads

? (_theExplosion == "25mm") : _Spread = 10
? (_theExplosion == "40mm") : _Spread = 7.5
? (_theExplosion == "125mm") : _Spread = 5
;Repeating Fire

#loop

Goto "Binary"

#Shot1

_ammoType createVehicle[_bombLocX + _spreadx, _bombLocY + _spreadY, _bombLocZ]
~0.1

_ShotsFired=_ShotsFired+1

_shot1 = 1

? (_ShotsFired >=_ShotsNeeded) : goto "End"

Goto "Binary"

#Shot2


_ammoType createVehicle[_bombLocX - _spreadx, _bombLocY + _SpreadY, _bombLocZ]
~0.1

_ShotsFired = _ShotsFired+1

_shot2 = 1
? (_ShotsFired == _ShotsNeeded) : Goto "End"

Goto "Binary"

#Shot3

_ammoType createVehicle[_bombLocX + _spreadX, _bombLocY - _SpreadY, _bombLocZ]
~0.1

_ShotsFired = _ShotsFired+1

_shot3 = 1

? (_ShotsFired == _ShotsNeeded) : Goto "End"

Goto "Binary"

#Shot4

_ammoType createVehicle[_bombLocX - _spreadx, _bombLocY - _SpreadY, _bombLocZ]
~0.1

_ShotsFired = _ShotsFired+1

_shot4 = 1

? (_ShotsFired == _ShotsNeeded) : Goto "End"

Goto "loop"

#Binary

;Spread Logic

;? (_theExplosion == "25mm") : _count1 = (random 10)
;? (_theExplosion == "40mm") : _count1 = (random 10)
;? (_theExplosion == "125mm") : _count1 = (random 10)
;? (_theExplosion == "25mm") : _count2 = (random 10)
;? (_theExplosion == "40mm") : _count2 = (random 10)
;? (_theExplosion == "125mm") : _count2 = (random 10)

_count1 = 10
_count2 = 10

;_count1 = round(random 10)
;_count2 = round(random 10)

;Binary Based Random Spread

while {_count1 > 0} do {_binaryX=2*_binaryX _count1=_count1-1}
while {_count2 > 0} do {_binaryY=2*_binaryY _count2=_count2-1}
_spreadx =(_Binaryx / 1000 *_spread)
;_Binaryx =_Binaryx * _spread
_spready =(_BinaryY / 1000*_spread)
;_BinaryY =_BinaryY * _spread
;_spreadx = _Binaryx
;_spreadY = _BinaryY

? (_shot1 == 0) : goto "Shot1"
? (_shot1 == 1) : goto "Shot2"
? (_shot2 == 1) : goto "Shot3"
? (_shot3 == 1) : goto "Shot4"
? (_shot4 == 1) : goto "Reset"

#Reset

_shot1 = 0
_shot2 = 0
_shot3 = 0
_shot4 = 0

Goto "Shot1"

#End



exit

Share this post


Link to post
Share on other sites

It does work but not as it should. Also to call the script it's not "small" it's one of the ammo sizes "25mm"

Share this post


Link to post
Share on other sites

So what exactly is wrong with it? (I'm sorry if im being a noob) but just curious :)

Share this post


Link to post
Share on other sites

The basic problem is it's old script and a bit messy.

I've gave up and wrote something else it may do what your after as it's much the same thing.

It's just firing a number of shots around a vehicle or object.

Note it's now in sqf format so save the file as AC130.sqf

//////////////////////////////////////////////////////////////////
// call the code using the following 
// null=[target,"25mm"]  execVM "AC130.sqf";
// null=[target,"40mm"]  execVM "AC130.sqf";
// null=[target,"125mm"] execVM "AC130.sqf";
/////////////////////////////////////////////////////////////////

_theObject = _this select 0;
_theExplosion = _this select 1;

//locate the Object to be blown up
_bombLoc = GetPos _theObject;
_bombLocX = _bombLoc select 0;
_bombLocY = _bombLoc select 1;
_bombLocZ = _bombLoc select 2;


_ShotsFired = 0;
_ShotsNeeded = 0;
_ammoType ="";
_Spread = 0;

// Deterimine the ordinance used to create the explosion

if (_theExplosion == "25mm") then { 
      _ammoType = "B_25mm_HE";
       _ShotsNeeded = round(random 40)+20;// No of rounds 
        _Spread = 10;// accuracy 
};

if (_theExplosion == "40mm") then { 
     _ammoType = "R_57mm_HE";
       _ShotsNeeded = round(random 10)+5;// No of rounds
         _Spread = 7.5;// accuracy
};

if (_theExplosion == "125mm") then {
 _ammoType = "Sh_125_HE";
   _ShotsNeeded = 1;// No of rounds
          _Spread = 2; // accuracy
};

// AirAttack sidechat "AC-130 Firing"

for [{_p = 0},{_p < _ShotsNeeded},{_p = _p + 1}] do
{
_bomb = _ammoType createVehicle[(_bombLocX + random _spread)-_spread/2, (_bombLocY + random _spread)-_spread/2,0];
  sleep 0.1;

};

Edited by F2k Sel

Share this post


Link to post
Share on other sites

It works, but this is V3 of the script. The coments are messy, the work is too, and yes, ive created a script that just shoots rounds, how many shots are needed, and the spread.

The reason it fires for times, is once in each quadrent. So its + +, - +, + -, - -.

Binary is 1 x 2, then the answer x2, then that answer x2. So that while is meant to do x*2 and the count is the spread. So it will get 1024.

Then its meant to /1000, to get 1.024

Then its meant to * that by your spread

So, it can get anything from 2 - 1024

Theirs a lot more smaller numbers than bigger ones, and a AC-130 gunner would be more accurate than not.

It calls the binary script, makes a random spread, then goes back to shot1. When shot1 is fired, shot1 = 1.

When it runs binary again, it see's shot 1 is fired and goes to shot 2.

Reset just resets all the values and goes to shot 1.

It also randoms the X and Y Spread, hence count 1 and 2, for totaly random shots.

Edited by Coronel_Niel

Share this post


Link to post
Share on other sites

That's what was confusing me I couldn't see what it was trying to do, when I ran it it just seemed to go on on for such a long time I started to get quite a bit of slowdown.

My maths isn't up to sorting that bit out, is the while working?

I thought it had to be while {code} do and not while "code" do but as I don't use sqs maybe it's fine.

Share this post


Link to post
Share on other sites

This could be a very interesting addon!

Share this post


Link to post
Share on other sites

ive got it to get to:

; ****************************************************************
; Script file for Armed Assault
; Created by: TODO: Author Name
; ****************************************************************

; AC-130 Gunship Script
; By Niel
; Adapted Jeevz IED script
; v0.1 12/13/06


; This script will simulate a Ac-130 gunship attack.
; It creates an explosion of a
; selected size on any object when called
; The arguments are [objectName, Size of Ammo]
; Explosion Power will be 1 of 3 choices
; 25mm - Gatling Gun - 15 shots -Good for Anti-Personnel use
; 40mm - Will usually disable a Humvee without killing the occupants
; 125mm - Will usually destroy a passing humvee and kill or severly injure all occupants, will disable the tracks and possibly engine on M1A1
; Huge - Nothing will survive, I mean... it's HUGE :-)


; Example script call --> [theCar, "Small"] exec "IED.sqs"

;start script

_theObject = _this select 0
_theExplosion = _this select 1

;locate the Object to be blown up
_bombLoc = GetPos _theObject
_bombLocX = _bombLoc select 0
_bombLocY = _bombLoc select 1
_bombLocZ = _bombLoc select 2

;Reset Shots Fired, binary and Shots

_ShotsFired = 0
_binaryX = 1
_binaryY = 1
_count1=0
_count2=0
_shot1 = 0
_shot2 = 0
_shot3 = 0
_shot4 = 0

; Deterimine the ordinance used to create the explosion
? (_theExplosion == "25mm") : _ammoType = "B_25mm_HE"
? (_theExplosion == "40mm") : _ammoType = "R_57mm_HE"
? (_theExplosion == "125mm") : _ammoType = "Sh_125_HE"
AirAttack sidechat "AC-130 Firing"


; Deterimine the shots used to create the explosion
? (_theExplosion == "25mm") : _ShotsNeeded = (random 10)
? (_theExplosion == "40mm") : _ShotsNeeded = (random 5)
? (_theExplosion == "125mm") : _ShotsNeeded = 1

;Make Small Explosion Shots Fired Random

? (_theExplosion == "25mm") : _ShotsNeeded = _ShotsNeeded+30

;Kept if needed

? (_theExplosion == "40mm") : _ShotsNeeded+0
? (_theExplosion == "125mm") : _ShotsNeeded+0

;Use Different Spreads

? (_theExplosion == "25mm") : _Spread = 10
? (_theExplosion == "40mm") : _Spread = 7.5
? (_theExplosion == "125mm") : _Spread = 5

;Repeating Fire

#loop

Goto "Binary"

#Shot1

_ammoType createVehicle[_bombLocX + _spreadx, _bombLocY + _spreadY, _bombLocZ]
~0.1

_ShotsFired = _ShotsFired + 1

_shot1 = _shot1 + 1

? _ShotsFired>=_ShotsNeeded : goto "End"

Goto "Binary"

#Shot2


_ammoType createVehicle[_bombLocX - _spreadx, _bombLocY + _SpreadY, _bombLocZ]
~0.1

_ShotsFired = _ShotsFired+1

_shot2=1
? _ShotsFired = _ShotsNeeded: Goto "End"

Goto "Binary"

#Shot3

_ammoType createVehicle[_bombLocX + _spreadX, _bombLocY - _SpreadY, _bombLocZ]
~0.1

_ShotsFired = _ShotsFired+1

_shot3=1

? _ShotsFired = _ShotsNeeded : Goto "End"

Goto "Binary"

#Shot4

_ammoType createVehicle[_bombLocX - _spreadx, _bombLocY - _SpreadY, _bombLocZ]
~0.1

_ShotsFired = _ShotsFired+1

_shot4=1

? _ShotsFired = _ShotsNeeded : Goto "End"

Goto "loop"

#Binary

;Spread Logic

;? (_theExplosion == "25mm") : _count1 = (random 10)
;? (_theExplosion == "40mm") : _count1 = (random 10)
;? (_theExplosion == "125mm") : _count1 = (random 10)
;? (_theExplosion == "25mm") : _count2 = (random 10)
;? (_theExplosion == "40mm") : _count2 = (random 10)
;? (_theExplosion == "125mm") : _count2 = (random 10)

_count1 = 10
_count2 = 10

;_count1 = round(random 10)
;_count2 = round(random 10)

;Binary Based Random Spread

#Count3

? _count1 == 0 : goto "count4"
_binaryX = _binaryX * 2
_count1 = _count1 - 1

Goto "Count3"

#Count4

? _count2 == 0 : goto "Binary2"
_binaryy = _binaryy * 2
_count2 = _count2 - 1

Goto "Count4"

#Binary2

_spreadx =(_Binaryx / 1000 * _spread)
;_Binaryx =_Binaryx * _spread
_spready =(_BinaryY / 1000 * _spread)
;_BinaryY =_BinaryY * _spread
;_spreadx = _Binaryx
;_spreadY = _BinaryY

? (_shot1 == 0) : goto "Shot1"
? (_shot1 == 1) : goto "Shot2"
? (_shot2 == 1) : goto "Shot3"
? (_shot3 == 1) : goto "Shot4"
? (_shot4 == 1) : goto "Reset"

#Reset

_shot1 = 0
_shot2 = 0
_shot3 = 0
_shot4 = 0

Goto "Shot1"

#End

exit

Still doesnt work, but it should I think.

Share this post


Link to post
Share on other sites

I see one shot fired to the side of the vehicle.

This is how I read it, it goes to binary and then runs into count3 which then repeats until count1==0 and then goes to count 4.

Maybe it should be count not == to 0 goto count 4. (not the right syntax of course.

Even then it just seems to be an endless round of firing.

; ****************************************************************
; Script file for Armed Assault
; Created by: TODO: Author Name
; ****************************************************************

; ****************************************************************
; Script file for Armed Assault
; Created by: TODO: Author Name
; ****************************************************************

; AC-130 Gunship Script
; By Niel
; Adapted Jeevz IED script
; v0.1 12/13/06


; This script will simulate a Ac-130 gunship attack.
; It creates an explosion of a
; selected size on any object when called
; The arguments are [objectName, Size of Ammo]
; Explosion Power will be 1 of 3 choices
; 25mm - Gatling Gun - 15 shots -Good for Anti-Personnel use
; 40mm - Will usually disable a Humvee without killing the occupants
; 125mm - Will usually destroy a passing humvee and kill or severly injure all occupants, will disable the tracks and possibly engine on M1A1
; Huge - Nothing will survive, I mean... it's HUGE :-)


; Example script call --> [theCar, "Small"] exec "IED.sqs"

;start script

_theObject = _this select 0
_theExplosion = _this select 1

;locate the Object to be blown up
_bombLoc = GetPos _theObject
_bombLocX = _bombLoc select 0
_bombLocY = _bombLoc select 1
_bombLocZ = _bombLoc select 2

;Reset Shots Fired, binary and Shots

_ShotsFired = 0
_binaryX = 1
_binaryY = 1
_count1=0
_count2=0
_shot1 = 0
_shot2 = 0
_shot3 = 0
_shot4 = 0

; Deterimine the ordinance used to create the explosion
? (_theExplosion == "25mm") : _ammoType = "B_25mm_HE"
? (_theExplosion == "40mm") : _ammoType = "R_57mm_HE"
? (_theExplosion == "125mm") : _ammoType = "Sh_125_HE"
;AirAttack sidechat "AC-130 Firing"


; Deterimine the shots used to create the explosion
? (_theExplosion == "25mm") : _ShotsNeeded = (random 10)
? (_theExplosion == "40mm") : _ShotsNeeded = (random 5)
? (_theExplosion == "125mm") : _ShotsNeeded = 1

;Make Small Explosion Shots Fired Random

? (_theExplosion == "25mm") : _ShotsNeeded = _ShotsNeeded+30

;Kept if needed

? (_theExplosion == "40mm") : _ShotsNeeded+0
? (_theExplosion == "125mm") : _ShotsNeeded+0

;Use Different Spreads

? (_theExplosion == "25mm") : _Spread = 10
? (_theExplosion == "40mm") : _Spread = 7.5
? (_theExplosion == "125mm") : _Spread = 5

;Repeating Fire

#loop

Goto "Binary"

#Shot1

_ammoType createVehicle[_bombLocX + _spreadx, _bombLocY + _spreadY, _bombLocZ]
~0.1

_ShotsFired = _ShotsFired + 1

_shot1 = _shot1 + 1

? _ShotsFired >_ShotsNeeded : goto "End"

Goto "Binary"

#Shot2


_ammoType createVehicle[_bombLocX - _spreadx, _bombLocY + _SpreadY, _bombLocZ]
~0.1

_ShotsFired = _ShotsFired+1

_shot2=1
? _ShotsFired > _ShotsNeeded: Goto "End"

Goto "Binary"

#Shot3

_ammoType createVehicle[_bombLocX + _spreadX, _bombLocY - _SpreadY, _bombLocZ]
~0.1

_ShotsFired > _ShotsFired+1

_shot3=1

? _ShotsFired > _ShotsNeeded : Goto "End"

Goto "Binary"

#Shot4

_ammoType createVehicle[_bombLocX - _spreadx, _bombLocY - _SpreadY, _bombLocZ]
~0.1

_ShotsFired = _ShotsFired+1

_shot4=1

? _ShotsFired > _ShotsNeeded : Goto "End"

Goto "loop"

#Binary

;Spread Logic

;? (_theExplosion == "25mm") : _count1 = (random 10)
;? (_theExplosion == "40mm") : _count1 = (random 10)
;? (_theExplosion == "125mm") : _count1 = (random 10)
;? (_theExplosion == "25mm") : _count2 = (random 10)
;? (_theExplosion == "40mm") : _count2 = (random 10)
;? (_theExplosion == "125mm") : _count2 = (random 10)

_count1 = 10
_count2 = 10

;_count1 = round(random 10)
;_count2 = round(random 10)

;Binary Based Random Spread


#Count3

?  _count1 > 0 : goto "count4"
_binaryX = _binaryX * 2
_count1 = _count1 - 1

Goto "Count3"

#Count4

?  _count2 > 0 : goto "Binary2"
_binaryy = _binaryy * 2
_count2 = _count2 - 1

Goto "Count4"

#Binary2

_spreadx =(_Binaryx / 1000 * _spread)
;_Binaryx =_Binaryx * _spread
_spready =(_BinaryY / 1000 * _spread)
;_BinaryY =_BinaryY * _spread
;_spreadx = _Binaryx
;_spreadY = _BinaryY

? (_shot1 == 0) : goto "Shot1"
? (_shot1 == 1) : goto "Shot2"
? (_shot2 == 1) : goto "Shot3"
? (_shot3 == 1) : goto "Shot4"
? (_shot4 == 1) : goto "Reset"

#Reset

_shot1 = 0
_shot2 = 0
_shot3 = 0
_shot4 = 0

Goto "Shot1"

#End

exit

I'm getting it to exit now but I still don't see much evidence of spreading shots.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Because theirs no Binary function, it just times 1x2x2x2x2x2x2 and how many times is determined by count1. (Same for count2, that just randoms the y value.)

It spreads meant to be by ussing binary so it hits closer to the target rather than thuther away more often. This changes Probability. It gets all the variables it needs, then it goes to binary. It gets the binary amount, for X and Y, and then divides it by 1000 and times's it by spread. It then see's shot 1 = 0, and goes to shot one, which is under binary. Then it fires shot one, goes to binary, gets anouther random value, see's shot1 = 1 and goes to shot 2. Repeats untill shot 4. When shot 4 == 1 its resets all the values and goes to shot 1.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×