First, you have to create the entry for this object. Go to objects_ext_buildings.inf and write the following at the bottom of the file:
- #You have to choose an unused ID, like 1032 in this case
- id=1032
- #The name of you building
- name=House
- group=building,ext,xweetok
- #The icon path, if you have no Icon, just delete this line
- icon=gfxexticonspavillon_damaged.bmp
- #The model path
- model=gfxextpavillon_damaged.b3d
- #The health of the Object
- health=2000
- #The material
- mat=stone
- #If the object is too big or too small, you can adjust this with this value
- scale=1
The line that start with "#" can be left out.
Then you have to add an entry to the buildings.inf:
- #Once again, the ID of your building
- id=165
- #The group you want the building to appear in
- group=building
- #The object that you want to build, in our case it's 1032
- objectid=1032
- req=97,4
- req=32,5
req sets the required items for this building. The first value is the item ID and the second the amount that is needed. You can add as many "req" entries as you want.
When you want to build your building you have to unlock it first. This can be done with the [s2s:cumy4oaz]unlockbuilding[/s2s:cumy4oaz] command. In our case it should say
You can write it in the Global Map Script for testing purposes:
- on:start {
- unlockbuilding 165;
- }
Or you write it in the game.inf under "unlockbuilding 62;". When you want your house to be unlocked when a certain building was build, you can write it the the entry in the buildings.inf, as you can see with other entries there.