Author Topic: Impassable Tube Tile  (Read 3333 times)

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Impassable Tube Tile
« on: November 29, 2006, 08:30:15 AM »
I have a idea for a new map.

Anyway here is my question. Can I place a tube in code (yes) but can I make the tile it is on impassable so that buildings one side of the impassable terrain can be connected to the CC on the other side via the tube and I don't have to have two CC's. So units cant get to buildings behind the impassable terrain perhaps.

Thx

Offline Mcshay

  • Administrator
  • Sr. Member
  • *****
  • Posts: 404
Impassable Tube Tile
« Reply #1 on: November 29, 2006, 03:17:00 PM »
No, since the tube atribute is also a cell type. It can be either a tube or impassible.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Impassable Tube Tile
« Reply #2 on: December 02, 2006, 06:48:18 PM »
Well, you could make all tubes inpassible.  ;)

But that could make base layout a little more interesting.


Btw, there are a number of tube tiles interally. I don't know if the other tube types are properly recognized as tubes, but you can try them out. If they also work as tubes, then you can just change the passability attributes for those tubes only.

I'm pretty sure you'd need a slight mem hack to change the passability of cells, but it's an easy one. I'm pretty sure the info has been posted already. ... but it's not much use for what you want to do unless the other tubes tiles are recognized as tubes, or if you don't mind making all tubes impassible.
 

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Impassable Tube Tile
« Reply #3 on: December 03, 2006, 06:41:32 PM »
all tubes impassible not realy that great ;p

i think ill just work around the limitation.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Impassable Tube Tile
« Reply #4 on: December 03, 2006, 11:23:07 PM »
Have you tried to use the other tube tiles and see if they work?
 

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Impassable Tube Tile
« Reply #5 on: December 04, 2006, 09:51:27 AM »
No not yet. How can i in code?
« Last Edit: December 04, 2006, 09:51:37 AM by Leviathan »

Offline Mcshay

  • Administrator
  • Sr. Member
  • *****
  • Posts: 404
Impassable Tube Tile
« Reply #6 on: December 04, 2006, 01:53:57 PM »
One way to do this would be to order all units that move onto the section of tube you want impassible to turn around. The only problem with this is that you would need the wall to be 2 tiles thick to send the units back to the correct side, and when they are ordered back, their orders would be killed. Not to mention that pathfinding would still send units over the tube.

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Impassable Tube Tile
« Reply #7 on: December 04, 2006, 02:27:55 PM »
Interesting.

I mean how do I add tube which is not the standard tube that normals gets placed on the map when you code it in the missions?
 

Offline Mcshay

  • Administrator
  • Sr. Member
  • *****
  • Posts: 404
Impassable Tube Tile
« Reply #8 on: December 04, 2006, 02:52:43 PM »
You can use this function to create a normal tube:

Code: [Select]
TethysGame::CreateWallOrTube(int tileX, int tileY, int, enum map_id wallTubeType);

I can't remember what the third param is in that function though.

Or do what the function does manualy (and have a bit more control):

Code: [Select]
TethysGame::SetTile(struct LOCATION where, int what);
TethysGame::SetCellType(struct LOCATION where, int what);

The "int what" variable in the last two are taken from the mapper for tiles, and from the NonExportedEnums.h file for cell types.

Technicaly a tube is just a cell type with a graphic pasted on top, however you should always give it the correct tile, because tile transformations might be messed up if units ever mess with the tile.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Impassable Tube Tile
« Reply #9 on: December 04, 2006, 09:20:34 PM »
Yeah, change the cell type. You should be able to do it either directly from the mapper or from code using TethysGame::SetCellType.

The cell types are:
0 (0x0)    Fast Passible 1      - rock vegetation
1 (0x1)    Impassible 2      - meteor craters, cracks/crevasses
2 (0x2)    Slow Passible 1      - lava rock (dark)
3 (0x3)    Slow Passible 2      - rippled dirt/lava rock bumps
4 (0x4)    Medium Passible 1   - dirt
5 (0x5)    Medium Passible 2   - lava rock
6 (0x6)    Impassible 1      - dirt/rock/lava rock mound/ice cap/volcano
7 (0x7)    Fast Passable 2    - rock
8 (0x8)    North Cliffs      -
9 (0x9)    Cliffs - High side   -
10 (0xA)    Cliffs - Low Side   - cliffs, low side (and middle too)
11 (0xB)    Vents and Fumaroles   - fumaroles (only passable by GeoCons/RoboMiners?)
12 (0xC)    zPad 12
13 (0xD)    zPad 13
14 (0xE)    zPad 14
15 (0xF)    zPad 15
16 (0x10)    zPad 16
17 (0x11)    zPad 17
18 (0x12)    zPad 18
19 (0x13)    zPad 19
20 (0x14)    zPad 20
21 (0x15)    Dozed Area       - bulldozed, non tubed area (buildings are tubed underneath) - does not include buildings
22 (0x16)    Rubble
23 (0x17)    Normal Wall
24 (0x18)    Microbe Wall
25 (0x19)    Lava Wall
26 (0x1A)    Tube0          - tubed (buildings are tubed underneath, including docks) - includes buildings
27 (0x1B)    Tube1
28 (0x1C)    Tube2
29 (0x1D)    Tube3
30 (0x1E)    Tube4
31 (0x1F)    Tube5


The strings were taken from somewhere in Outpost2.exe, so don't go asking me what exactly they mean. I don't know unless it's obvious.

 

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Impassable Tube Tile
« Reply #10 on: December 04, 2006, 09:31:57 PM »
Yeah same as in mapper. Thanks