Its been a while since I used Types but have recently got back into the swing of things.
I am presently working on a little project where ships circle an island. When I point the camera to a ship from the island, I would like to select the ship, however I am using camera pick to pick out the ship (sprite) but it always reports the last ship in the type list to be created and not the actual ship looked at (Ships ID for that type entry)
I have the ships circling using the function below
Function updateships()
For s.ship = Each ship
Local shipx#, shipz#
Local shstart =200
;Update position around radius using the sin/cos functions
shipx# = S\SCX# - ( Cos#(S\SA#) * S\SDS# )
shipz# = S\SCZ# + ( Sin#(S\SA#) * S\SDS# )
;draw the ship
PositionEntity S\SIMAGE,shipx#,S\SY#,shipz#
RotateEntity S\SIMAGE,0,(90-S\SA#),0
;update shipangle# and maintain speed at different distances
S\SA#=S\SA#+(S\SP#/S\SDS#)
SA=S\SA#;
SNAME1=S\SNAME
SX1#=shipx#
SZ1#=shipz#
SSP1#=S\SP#
SDS=S\SDS#
SDE=S\SDE#
SIMAGE=S\SIMAGE
SID=S\SID%
Next
End Function
Function selectship()
And a camera pick function
picked = CameraPick(camera,378,278)
If Picked > 0
sh$ = "Ship ID picked"
sh$ = sh$ + SID%
Else
sh$ = "Nothing"
EndIf
End Function
Is there a way of reporting back the actual sprite being looked at. I have 3 ship type's defind but cant remember how to report back on individual S\SID% when the camera picks it.
Appreciated,
Thanks,
I am presently working on a little project where ships circle an island. When I point the camera to a ship from the island, I would like to select the ship, however I am using camera pick to pick out the ship (sprite) but it always reports the last ship in the type list to be created and not the actual ship looked at (Ships ID for that type entry)
I have the ships circling using the function below
Function updateships()
For s.ship = Each ship
Local shipx#, shipz#
Local shstart =200
;Update position around radius using the sin/cos functions
shipx# = S\SCX# - ( Cos#(S\SA#) * S\SDS# )
shipz# = S\SCZ# + ( Sin#(S\SA#) * S\SDS# )
;draw the ship
PositionEntity S\SIMAGE,shipx#,S\SY#,shipz#
RotateEntity S\SIMAGE,0,(90-S\SA#),0
;update shipangle# and maintain speed at different distances
S\SA#=S\SA#+(S\SP#/S\SDS#)
SA=S\SA#;
SNAME1=S\SNAME
SX1#=shipx#
SZ1#=shipz#
SSP1#=S\SP#
SDS=S\SDS#
SDE=S\SDE#
SIMAGE=S\SIMAGE
SID=S\SID%
Next
End Function
Function selectship()
And a camera pick function
picked = CameraPick(camera,378,278)
If Picked > 0
sh$ = "Ship ID picked"
sh$ = sh$ + SID%
Else
sh$ = "Nothing"
EndIf
End Function
Is there a way of reporting back the actual sprite being looked at. I have 3 ship type's defind but cant remember how to report back on individual S\SID% when the camera picks it.
Appreciated,
Thanks,