Fresshness
Wanderer
(Severly) restricting house placement
The way I want house placement to be restricted is severe; I want the players to only be able to place houses in Towns (guarded zones). I think I have found the script that is responsible for this, namely Multis/HousePlacement.cs.
I tried to make some changes, but they did not work. Following the logic, I think the solution has 2 steps:
1) in an earlier stage of the "HousePlacementResult Check" function I made the followin (in red) modification, so that it will not immediatly say the location is invalid just because its situated in town:
However, it does not work. I cannot place houses in town (in addition to placing in regular valid locations).
2) the second part would be the following; at the end of the "HousePlacementResult Check" function, when the location is deemed valid, I would do another check to see if the location is in town. If it is in town, proceed to declare the location valid, if not in town, proceed to declare the location invalid. However, I really have no clue about how to implement this (It would seem, though I might be wrong, that at least some runuo-core knowledge is needed here).
Thanks for any insight you can offer !
The way I want house placement to be restricted is severe; I want the players to only be able to place houses in Towns (guarded zones). I think I have found the script that is responsible for this, namely Multis/HousePlacement.cs.
I tried to make some changes, but they did not work. Following the logic, I think the solution has 2 steps:
1) in an earlier stage of the "HousePlacementResult Check" function I made the followin (in red) modification, so that it will not immediatly say the location is invalid just because its situated in town:
Code:
if ( !reg.AllowHousing( from, testPoint ) ) // Cannot place houses in dungeons, towns, treasure map areas etc
{
if ( reg.IsPartOf( typeof( TreasureRegion ) ) )
return HousePlacementResult.BadRegionHidden;
[COLOR="Red"]if ( reg.IsPartOf( typeof( TownRegion ) ) )
continue; // allow in town placement
else[/COLOR]
return HousePlacementResult.BadRegion;
}
However, it does not work. I cannot place houses in town (in addition to placing in regular valid locations).
2) the second part would be the following; at the end of the "HousePlacementResult Check" function, when the location is deemed valid, I would do another check to see if the location is in town. If it is in town, proceed to declare the location valid, if not in town, proceed to declare the location invalid. However, I really have no clue about how to implement this (It would seem, though I might be wrong, that at least some runuo-core knowledge is needed here).
Thanks for any insight you can offer !