I'm trying to make a save feature for my ship constructor and ran into a problem I can't figure out. The problem is that it saves BuildingSupportBeam3 as the same coords as BuildingSupportBeam2. The code in the first code pocket is the saving and the second one is of the object naming. A side note is that when I test to see if they are in a acceptable position in the program they are treated as seperate objects. E.g. if BuildingSupportBeam2 is in the right location and BuildingSupportBeam3 isn't it shows that.
Rem Save feature
open to write 2,"Crafting/Ship Construction/Sketches/" + Player$ + str$(SketchNumber) + ".txt"
` Support beams
If BuildingSupportBeam1>0 then write string 2,"make object box " + str$(BuildingSupportBeam1) + ",39,16,211"
If BuildingSupportBeam1>0 then write string 2,"position object " + str$(BuildingSupportBeam1) + "," + str$(object position x(BuildingSupportBeam1)) + "," + str$(object position y(BuildingSupportBeam1)) + "," + str$(object position z(BuildingSupportBeam1))
If BuildingSupportBeam2>0 then write string 2,"make object box " + str$(BuildingSupportBeam2) + ",39,16,211"
If BuildingSupportBeam2>0 then write string 2,"position object " + str$(BuildingSupportBeam2) + "," + str$(object position x(BuildingSupportBeam2)) + "," + str$(object position y(BuildingSupportBeam2)) + "," + str$(object position z(BuildingSupportBeam2))
If BuildingSupportBeam3>0 then write string 2,"make object box " + str$(BuildingSupportBeam3) + ",39,16,233"
If BuildingSupportBeam3>0 then write string 2,"position object " + str$(BuildingSupportBeam3) + "," + str$(object position x(BuildingSupportBeam3)) + "," + str$(object position y(BuildingSupportBeam3)) + "," + str$(object position z(BuildingSupportBeam3))
` Wooden Flooring
If WoodenFlooring1>0 then write string 2,"make object box " + str$(WoodenFlooring1) + ",5,100,30"
If WoodenFlooring1>0 then write string 2,"position object" + str$(WoodenFlooring1) + "," + str$(object position x(WoodenFlooring1)) + "," + str$(object position y(WoodenFlooring1)) + "," + str$(object position z(WoodenFlooring1))
If WoodenFlooring2>0 then write string 2,"make object box " + str$(WoodenFlooring2) + ",5,100,30"
Rem Page 1
If mousex()=>228 and mousex()=<423 and mousey()=>65 and mousey()=<110 and mouseclick()=1 and BuildingSupportBeam>0 and ShipPageNumber=1 and ShipConstructionTimer>20 then ShipConstructionSelection=1 : ShipConstructionTimer=0
If mousex()=>228 and mousex()=<423 and mousey()=>130 and mousey()=<175 and mouseclick()=1 and SmallBuildingSupportBeam>0 and ShipPageNumber=1 and ShipConstructionTimer>20 then ShipConstructionSelection=2 : ShipConstructionTimer=0
If mousex()=>228 and mousex()=<423 and mousey()=>195 and mousey()=<240 and mouseclick()=1 and WoodenFlooring>0 and ShipPageNumber=1 and ShipConstructionTimer>20 then ShipConstructionSelection=3 : ShipConstructionTimer=0
If mousex()=>228 and mousex()=<423 and mousey()=>260 and mousey()=<305 and mouseclick()=2 and ThickWoodenWall>0 and ShipPageNumber=1 and ShipConstructionTimer>20 then ShipConstructionSelection=4 : ShipConstructionTimer=0
If mousex()=>228 and mousex()=<423 and mousey()=>260 and mousey()=<305 and mouseclick()=1 and ThickWoodenWall>0 and ShipPageNumber=1 and ShipConstructionTimer>20 then ShipConstructionSelection=5 : ShipConstructionTimer=0
If mousex()=>228 and mousex()=<423 and mousey()=>325 and mousey()=<370 and mouseclick()=1 and WoodenWall>0 and ShipPageNumber=1 and ShipConstructionTimer>20 then ShipConstructionSelection=6 : ShipConstructionTimer=0
Rem Change page
If mousex()=>302 and mousex()=<317 and mousey()=>397 and mousey()=<417 and mouseclick()=1 and ShipConstructionTimer>20 then ShipPageNumber=ShipPageNumber-1 : ShipConstructionTimer=0
If mousex()=>338 and mousex()=<355 and mousey()=>397 and mousey()=<417 and mouseclick()=1 and ShipConstructionTimer>20 then ShipPageNumber=ShipPageNumber+1 : ShipConstructionTimer=0
If keystate(203) and ShipConstructionTimer>20 then ShipPageNumber=ShipPageNumber-1 : ShipConstructionTimer=0
If keystate(205) and ShipConstructionTimer>20 then ShipPageNumber=ShipPageNumber+1 : ShipConstructionTimer=0
If ShipPageNumber>4 then ShipPageNumber=1
If ShipPageNumber<1 then ShipPageNumber=4
Select ShipConstructionSelection
Case 1:
hide sprite 2 : InventoryShipConstruction=0 : make object box ShipBuildingObj,39,16,211 : set object transparency ShipBuildingObj,2 : position object ShipBuildingObj,0,145,0
If BuildingSupportBeam2>0 then BuildingSupportBeam3=ShipBuildingObj
If BuildingSupportBeam1>0 then BuildingSupportBeam2=ShipBuildingObj
If BuildingSupportBeam1=0 then BuildingSupportBeam1=ShipBuildingObj
ShipBuilding=ShipBuilding+1 : BuildingSupportBeam=BuildingSupportBeam-1 : InventoryShipConstruction=0 : ShipConstructionSelection=0
endcase