You have to think logically about these things, but I guess it's just something you have to get the hang of. Here is my idea...
When you create an object, eg. a tank... you want to be able to know when you click on it that it is a tank. So how we solve that is to have an array, eg. "vehicles(1000)". This array stores the type of vehicle that it is, in this case a tank. Lets work out the values for the vehicles...
1 = armoured car
2 = tank
3 = missile launcher
4 = gold collector
So the object that we want to make is a tank, so we make the tank, position it and assign the array slot corrisponding to the object number with the number 2...
rem Make and position object
load object "tank.x",vehicle_num
position object vehicle_num,construction_x#,construction_y#,construction_z#
rem Assign object type
vehicle(vehicle_num)=2
inc vehicle_num
"vehicle_num" is the number of the object that you are creating, you have to increase it each time so you can make a new object in the next slot next time. "construction_x#" and the others are the position that the vehicles will be made.
You would then have a tank. Now you want to be able to select and move the tank around, this is simple.
Now that you have your object type assigned to the array, when you select the object (by detecting if the mouse is near to it's screen position) you store the object type in a variable and all the following actions depend on the number stored...
rem Store the current object type in a variable
if object is selected then current_object_type=vehicle(object_selected)
rem Any actions that follow depend on the object type...
if current_object_type=2 and vehicle is ordered to move
do tank type moving
endif
if current_object_type=3 and vehicle is ordered to move
do missile launcher type moving
endif
if current_object_type=2 and vehicle is ordered to fire
do tank type shooting
endif
if current_object_type=3 and vehicle is ordered to fire
do missile launcher type shooting
endif
Thats just an example, obviously you would have to adapt that a lot.
Hope I helped!

Hamish
Why the hell'd you ask me for crying out loud!?!
Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM