Author Topic: Placing Bases?  (Read 2379 times)

Offline spirit1flyer

  • Hero Member
  • *****
  • Posts: 621
Placing Bases?
« on: September 25, 2005, 09:16:05 PM »
I have the code to place four bases on the map but I don't know how to make them farther apart. this is my code that I am using, How do I make it so I can place the bases were I want them or place them farther apart?

int InitProc()
{
   int i;

   // Randomize starting locations
   RandomizeStartingLocations(autosize(startLocation));

   // Place all bases on the map
   for (i = 0; i < TethysGame::NoPlayers(); i++)
   {
      InitPlayerResources(i);

      StartLocation &sLoc = startLocation;
      CreateBase(i, sLoc.x, sLoc.y, *sLoc.baseInfo);
      Player.CenterViewOn(sLoc.x, sLoc.y);
   }


Spirit
"Until you stalk and overrun You can't devour anyone"


Loyal Xfir supporter

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Placing Bases?
« Reply #1 on: September 25, 2005, 09:46:30 PM »
Well, I assume you mean you'd like to keep the layouts of the bases the same, but change where they are created. To do that, just change the base coordinates in the startLocation array. It was placed at the end of BaseData.h.

 

Offline spirit1flyer

  • Hero Member
  • *****
  • Posts: 621
Placing Bases?
« Reply #2 on: September 25, 2005, 10:21:17 PM »
I don't realy care how the bases are laid out I am just learning how to do things. Like placing bases, adding units and setting mission goals


I think you have straightened out this for me but if not I will be back  :P

spirit
"Until you stalk and overrun You can't devour anyone"


Loyal Xfir supporter

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Placing Bases?
« Reply #3 on: September 26, 2005, 05:43:54 AM »
Look at the BaseData.h file. The whole bases r moved around on the map with the start location cord. You change this and the whole base moves. The cords in the base sections, buildings, units etc are cords which are on top of the start location cords in the base data. So if a star location is 10,10 and a unit's cords say 10,5 then it will end up at 20,15 on the map. If you change the start location to 50,50 then the unit will be at 60,55.

Offline spirit1flyer

  • Hero Member
  • *****
  • Posts: 621
Placing Bases?
« Reply #4 on: September 26, 2005, 10:06:06 AM »
Quote
BaseData.h

Who! I guess I know why all the changes I did were not working  :P  I missed that file name the other day. I was trying to do it in OP2Script  :lol:



so all I have to do is change *49, 14,* to anything else to move a base?


struct StartLocation startLocation[] =
{
   { 49,  14, &base[0]},
   {142,  14, &base[1]},
   { 49, 112, &base[2]},
   {142, 112, &base[3]}
};


And what do the numbers at the end of this code right after mapNone, control?

                {  4,  10, mapConVec,      mapNone, 3},
   {  7,  10, mapConVec,      mapNone, 1},
   { 10,  -6, mapCargoTruck,      mapNone, 0},
   { 10,  -4, mapCargoTruck,      mapNone, 1},
   {  8,  -4, mapCargoTruck,      mapNone, 2},
   { 12,  -6, mapRoboSurveyor,      mapNone, 7},
   { 12,  -4, mapRoboMiner,      mapNone, 7},
   {  3,   1, mapEarthworker,      mapNone, 1},
   {  3,  -1, mapRoboDozer,      mapNone, 7}
   {  6,  -2, mapRepairVehicle,                        mapNone,


Spirit
« Last Edit: September 26, 2005, 10:44:46 AM by spirit1flyer »
"Until you stalk and overrun You can't devour anyone"


Loyal Xfir supporter

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
Placing Bases?
« Reply #5 on: September 26, 2005, 12:02:32 PM »
This is the section you need to change
Quote
struct StartLocation startLocation[] =
{
  { 49, 14, &base[0]},
  {142, 14, &base[1]},
  { 49, 112, &base[2]},
  {142, 112, &base[3]}
};
it determines where the bases are built. They are now at
  • 49,14
  • 142,14
  • 49,112
  • 142,112
change those coordinates to set new base positions. Bear in mind that a (31,-1) offset is to be used when converting actual coordinates into the ones used in the c++ code; so 49,14 translates to 18,15 in-game and so on.
« Last Edit: September 26, 2005, 12:02:54 PM by Eddy-B »
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Placing Bases?
« Reply #6 on: September 26, 2005, 02:09:11 PM »
Those numbers after mapNone, etc in the vehicle data controls the rotation of the unit. 0 = pointing toward the right.

There are definitions for each direction in one of the .h files somewhere. (Open the Include\ folder that came with the SDK and take a look)

BTW: When you post code in a forum post, enclose it in [ code ][ /code ] tags (without the extra spaces).. It's a lot easier to read.

Offline spirit1flyer

  • Hero Member
  • *****
  • Posts: 621
Placing Bases?
« Reply #7 on: September 26, 2005, 03:31:43 PM »
Thanks for all the help  :)  
"Until you stalk and overrun You can't devour anyone"


Loyal Xfir supporter

Offline spirit1flyer

  • Hero Member
  • *****
  • Posts: 621
Placing Bases?
« Reply #8 on: September 26, 2005, 05:59:03 PM »
I tried adding a panther but it jammed on me. What do I need to do to have a Microwave Panther?
Here is the code I first used:

Code: [Select]
{  3,  -8, mapMicroPanther,          mapNone, 0},



spirit
"Until you stalk and overrun You can't devour anyone"


Loyal Xfir supporter

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Placing Bases?
« Reply #9 on: September 26, 2005, 07:07:32 PM »
add mapPanther, mapMicrowave for that.

open MapIdEnum.h and you will find the unit and wep list etc.

hf

Offline spirit1flyer

  • Hero Member
  • *****
  • Posts: 621
Placing Bases?
« Reply #10 on: September 26, 2005, 07:20:46 PM »
okay thanks. Now I have ran into another problem, I loaded the file and tried firing the panther. It fired two times and then I tried to move the unit and Outpost 2 jammed?


spirit
"Until you stalk and overrun You can't devour anyone"


Loyal Xfir supporter

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
Placing Bases?
« Reply #11 on: September 27, 2005, 11:51:15 AM »
please post the whole cpp file > these are just bits and pieces, which makes it hard to determine what goes wrong. For one thing: make sure the units are ON the map. The 3,  -8 on the panther uses the offset from the struct StartLocation, and it needs the x to be >31 (as i've mentioned - the 31,-1 offset)
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline spirit1flyer

  • Hero Member
  • *****
  • Posts: 621
Placing Bases?
« Reply #12 on: September 27, 2005, 09:57:41 PM »
I got it solved, It was just the map that was the problem. and Lev helped me with it in another post but thanks anyway


spirit
"Until you stalk and overrun You can't devour anyone"


Loyal Xfir supporter