These are the five scripts that make up Bullet Time Movement for The MATRIX MOD. Theres a problem that baffels me. Everything worked fine until one day I goto test the scripts out and the options in the action menu repeat forever! These are the four scripts, I can't find anything wrong with any of them... Can any of you's??
1. This one creates the trail of the bullet...
_bullet = _this select 0
_speed = 100
_bearing = 0
_distance = .1
_zpos = .3
_zinc = false
#dropspeed
_bearing = _bearing + 1
_pos = [(getpos _bullet select 0) + sin (getdir _bullet + _bearing) * _distance, (getpos _bullet select 1) + cos (getdir _bullet + _bearing) * _distance, _zpos]
_bullet setVelocity [_speed*(sin getDir _bullet),_speed*(cos getDir _bullet),0]
_rndc = (random .1)+(random .2)
_color = [[0.8,0.8,0.8-_rndc,0.1], [0.8,0.8,0.8-_rndc,0.4], [0.8,0.8,0.8-_rndc,0.8], [0.8,0.8,0.8-_rndc,0.1]]
drop ["cl_fireD", "", "Billboard", 0.2, .1, _pos, [0,0,0], 500, 1.275, 1, 1, [.01,.1], _color, [0,0], 0, 0, "", "",_unit]
~0.001
if (_zpos < -.2) then {_zinc = true}
if (_zpos > .2) then {_zinc = false}
if (_zinc) then {_zpos = _zpos + .01} else {_zpos = _zpos - .01}
? (_speed > 0) : _speed = _speed - 10
? (isNull _bullet) : exit
goto "dropspeed"
2. This one creates the dodge actions (this is where I believe the problem is...):
_unit = _this select 0
_caller = _this select 1
_id = _this select 2
? (_unit != _caller) : exit
_nowPos = getPos _unit
_i = 0
#setposloop
_i = _i + .07
~.001
_unit setPos [(_nowPos select 0)-_i,_nowPos select 1,0]
? (_i < 2) : goto "setposloop"
exit
3. This is what verfies the doging action (back-up)
_unit = _this select 0
_caller = _this select 1
_id = _this select 2
? (_unit != _caller) : exit
_nowPos = getPos _unit
_i = 0
#setposloop
_i = _i + .07
~.001
_unit setPos [(_nowPos select 0)+_i,_nowPos select 1,0]
? (_i < 2) : goto "setposloop"
exit
4. This one creates the Dodge *ACTIONS IN THE MENU*(This is also where I think a problem resides):
_unit = _this select 0
_bullets = ["bulletsinglew","bulletburstw","bulletfullautow","bulletsinglee","bulletburste","bulletfullautoe","bullet7_6","bullet12_7"]
#start
@ ({_x == typeOf (nearestObject [_unit,_x])} count _bullets) > 0
? (vehicle _unit != _unit) : goto "start"
_b = 0
while "(_b < (count _bullets)) && ((typeOf (nearestObject [_unit,(_bullets select _b)])) != _bullets select _b)" do {_b = _b + 1;};
_curbul = (nearestObject [_unit,(_bullets select _b)])
_curdis = _curbul distance _unit
~.001
? (_curdis < _curbul distance _unit) : goto "start"
[_curbul] exec "bullet_trail.sqs"
setAccTime 0.05
apleft = _unit addAction ["dodge left","dodgel.sqs"]
apright = _unit addAction ["dodge right","dodger.sqs"]
aphalt = _unit addAction ["halt bullet","halt.sqs"]
;apdiv = _unit addAction ["divert bullet","divert.sqs"]
[_unit] exec "detect.sqs"
@ (_curbul distance _unit > 60) || (isNull _curbul)
_unit removeAction apleft
_unit removeAction apright
_unit removeAction aphalt
setAccTime 1
exit
5. This final one halts the bullets:
_unit = _this select 0
_caller = _this select 1
_id = _this select 2
? (_unit != _caller) : exit
_bullets = ["bulletsinglew","bulletburstw","bulletfullautow","bulletsinglee","bulletburste","bulletfullautoe","bullet7_6","bullet12_7"]
@ ({_x == typeOf (nearestObject [_unit,_x])} count _bullets) > 0
_b = 0
while "(_b < (count _bullets)) && ((typeOf (nearestObject [_unit,(_bullets select _b)])) != _bullets select _b)" do {_b = _b + 1;};
_curbul = (nearestObject [_unit,(_bullets select _b)])
_curbul setVelocity [0,0,0]
_unit switchMove "FxShow3"
setAccTime 1.00
~0.9
setAccTime 0.05
_rndc = (random .1)+(random .2)
drop ["cl_fire", "", "Billboard", 0.2, 1, [0,.8,1.6], [0,0,0], 500, 1.275, 1, 0, [.1,3], [[0,0.5-_rndc,0,0.1], [0,0.5-_rndc,0,0.4], [0,0.5-_rndc,0,0.8],[0,0.5-_rndc,0,0.1]], [0,0], 0, 0, "", "",_unit]
_d = 0
#droploop
_rndc = (random .1)+(random .2)
_color = [[0,0.8-_rndc,0,0.1], [0,0.8-_rndc,0,0.4], [0,0.8-_rndc,0,0.8],[0,0.8-_rndc,0,0.1]]
_color2 = [[0.8-_rndc,0.8-_rndc,0,0.1], [0.8-_rndc,0.8-_rndc,0,0.4], [0.8-_rndc,0.8-_rndc,0,0.8],[0.8-_rndc,0.8-_rndc,0,0.1]]
_vel = [0-(random 2)+(random 4),0-(random .5)+(random 1),0-(random 2)+(random 4)]
_vel2 = [0-(random 3)+(random 6),0,0-(random 3)+(random 6)]
drop ["cl_fire", "", "Billboard", 0.2, .1, [0,1,1.6], _vel, 500, 1.275, 1, 0, [.05,.1], _color, [0,0], 0, 0, "", "",_unit]
drop ["cl_fire", "", "Billboard", 0.2, .1, [0,1,1.6], _vel2, 500, 1.275, 1, 0, [.01,.01], _color2, [0,0], 0, 0, "", "",_unit]
~.001
_d = _d + 1
? (_d < 500) : goto "droploop"
exit
Now the question again is that what makes the actions repeat and go on FOREVER in the ACTION MENU?? I'm baffled. Any ideas? I'll add ur name to the credits if you help me!
;D
Tanks!