|
ernieschwitz -> RE: Shared Event Code VP for Oil and Raw (6/2/2015 8:28:31 AM)
|
You could make this code shorter if you wanted to, and more efficient. Let me show you how: 0) Comment Change VP of Raw and Oil Locations 1) Comment Raw 2) LOOPER: TempVar0 FROM 0 TO CheckMapWidth 3) LOOPER: TempVar1 FROM 0 TO CheckMapHeight 4) Comment Line below checks for location type #2 Raw 5) CHECK: CheckLocTypeXY(TempVar0, TempVar1) == 2 6) Comment Line below Changes VP amount of that Hex to 20 7) EXECUTE: ExecChangeVP(TempVar0, TempVar1, 20) 8) END CHECK 14) CHECK: CheckLocTypeXY(TempVar0, TempVar1) == 3 15) EXECUTE: ExecChangeVP(TempVar0, TempVar1, 20) 16) END CHECK 9) END LOOPER 10) END LOOPER I´ve kept the line numbers the way you wrote them originally. Notice that I just moved the Check for Oil, into the looper for checking for raw. By doing it this way, you only run 1 looper that checks every hex on the map.
|
|
|
|