Glad you liked the new indicator Petr, I think it suits the tank pretty well. It was on my mind for future improvement, but while I was thinking of ai, got it finished.
There is a bug in the game which will be addressed further down the line. When you move your tank in the z axis, the radar indicator for the shot does not match reality.
The aspect ratio adjustment is messing it up when I move the tank. I am aware of this bug, but it is not critical for now. The actual 3d world stuff works, it is when translating to 2d and adjusting for aspect that it only messes up in the game z but radar y values. I tried some quick solutions, but none worked.
Anyways onto the main topic now...
Petr, I think I know the answer, but I want to make sure with you first.
Ok, we have:
Begin Const
%TankFirst = 1
%TankLast = Game.NumTanks
%Tanks
%Player
%Light
%Level
%PlayerShot
%Reticle
%Explosion
End Const
But it gets really confusing when we add more elements as:
Begin Const
%TankFirst = 1
%TankLast = Game.NumTanks
%TankShotFirst
%TankShotLast = %TankLast + Game.NumTanks
%Tanks
%Player
%Light
%Level
%PlayerShot
%Reticle
%Explosion
End Const
Now you can imagine how confusing it gets when later on in the programs trying to do loops and when you create your arrays.
The Constants don't match the dimension of the arrays and you get all sorts of errors.
Right now the only solution I see is to keep offset variables for each entity that is an array, can you think of anything else?
So I would have an offset variable for any array entity after the first set:
%TankShotOffset = Game.NumTanks
Then when I loop the array of TankShots it would look like
For s = %TankShotFirst to %TankShotLast
TankShot(s-%TankShotOffset).Alive = 1
tbgl_EntitySetPos(%Game, s , TankShot(s-%TankShotOffset).Pos.x, TankShot(s-%TankShotOffset).Pos.y, TankShot(s-%TankShotOffset).Pos.z)
Next
Of this could also be written:
For s = %TankShotFirst to %TankShotLast
s = s - %TankShotOffset
TankShot(s).Alive = 1
tbgl_EntitySetPos(%Game, s + %TankShotOffset , TankShot(s).Pos.x, TankShot(s).Pos.y, TankShot(s).Pos.z)
Next
As you can see not the cleanest of solutions... just wanted to mention it to you so your super brain can work on it in the background till you find an amazing solution!
Bookmarks