home *** CD-ROM | disk | FTP | other *** search
- FrontLink = ThisCar add "/:FrontLink";
- FrontLink1 = ThisCar add "/:FrontLink1";
- RearLink = ThisCar add "/:RearLink";
- RearLink1 = ThisCar add "/:RearLink1";
- TotalDraft = ThisCar add "/:TotalDraft";
- FrontDraft = ThisCar add "/:FrontDraft";
- RearDraft = ThisCar add "/:RearDraft";
- DraftAmount = ThisCar add "/:DraftAmount";
- set(FrontLink,"0");
- set(FrontLink1,"0");
- set(RearLink,"0");
- set(RearLink1,"0");
- set(TotalDraft,"0");
- set(FrontDraft,"0");
- set(RearDraft,"0");
- set(DraftAmount,"0");
- CountCars = "1";
- while("5" >= CountCars)
- {
- CarNum = "/car" add CountCars;
- CarPositionCount = "0";
- if(getProperty(ThisCar, _X) - "200" < getProperty(CarNum, _X) and getProperty(CarNum, _X) < getProperty(ThisCar, _X) - "175")
- {
- CarPositionCount += "1";
- }
- else if(getProperty(CarNum, _X) >= getProperty(ThisCar, _X) - "175" and getProperty(CarNum, _X) < getProperty(ThisCar, _X) - "150")
- {
- CarPositionCount += "2";
- }
- else if(getProperty(CarNum, _X) >= getProperty(ThisCar, _X) - "150" and getProperty(CarNum, _X) < getProperty(ThisCar, _X) - "125")
- {
- CarPositionCount += "3";
- }
- else if(getProperty(CarNum, _X) >= getProperty(ThisCar, _X) - "125" and getProperty(CarNum, _X) < getProperty(ThisCar, _X))
- {
- CarPositionCount += "4";
- }
- if("7" >= getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) and getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) >= - "7")
- {
- CarPositionCount += "4";
- }
- else if("14" >= getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) and "7" < getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) or getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) >= - "14" and getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) < - "7")
- {
- CarPositionCount += "3";
- }
- else if("21" >= getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) and "14" < getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) or getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) >= - "21" and getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) < - "14")
- {
- CarPositionCount += "2";
- }
- else if("28" >= getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) and "21" < getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) or getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) >= - "28" and getProperty(CarNum, _Y) - getProperty(ThisCar, _Y) < - "21")
- {
- CarPositionCount += "1";
- }
- if(CarPositionCount == "5")
- {
- set(FrontLink,CarNum);
- set(DraftAmount,"1");
- }
- else if(CarPositionCount == "6")
- {
- set(FrontLink,CarNum);
- set(DraftAmount,"2");
- }
- else if(CarPositionCount == "7")
- {
- set(FrontLink,CarNum);
- set(DraftAmount,"3");
- }
- else if(CarPositionCount == "8")
- {
- set(FrontLink,CarNum);
- set(DraftAmount,"4");
- }
- CountCars += "1";
- }
- CountCars = "1";
- while("5" >= CountCars)
- {
- CarNum = "/car" add CountCars;
- if(getProperty(CarNum, _Y) >= getProperty(ThisCar, _Y) - "35" and getProperty(ThisCar, _Y) + "35" >= getProperty(CarNum, _Y) and getProperty(ThisCar, _X) - "180" < getProperty(CarNum, _X) and getProperty(CarNum, _X) < getProperty(ThisCar, _X))
- {
- TempLink = CarNum;
- if(TempLink ne eval(FrontLink))
- {
- set(FrontLink1,CarNum);
- }
- }
- CountCars += "1";
- }
-