On my current map project (my first one) I have a huge swamp where I would like to place an AI Player who actually cannot leave the swamps. There is only one Gate leading to that area.
Now I'm thinking about a way to restrict the AI to pass that gate. Like you can ban a race from towns perhaps...?
Is this possible without scripting? I'm new on the H5 Editor and didn't engage in scripting, yet...
[H5] Restricting AI Player from passing Gates?
-
- Leprechaun
- Posts: 5
- Joined: 01 Jul 2009
You have to use regions for this. Just make a region over a place you what your "gate", name it something like "aiblock", then add the following line to the map script:
SetRegionBlocked("aiblock",not nil, PLAYER_2)
(assuming you want to block the blue player). Heroes of the blue player won't be able to pass through the blocked region.
To unblock region, use SetRegionBlocked("aiblock",nil, PLAYER_2)
SetRegionBlocked("aiblock",not nil, PLAYER_2)
(assuming you want to block the blue player). Heroes of the blue player won't be able to pass through the blocked region.
To unblock region, use SetRegionBlocked("aiblock",nil, PLAYER_2)
-
- Leprechaun
- Posts: 5
- Joined: 01 Jul 2009
Big thanks for this tip, I was trying to do this with SetObjectEnabled but did not suceed.
VCMI : the future of Heroes 3!
People just don't care.
People just don't care.
gates that restrict
I've done something similar without scripting regions (i.e. in multiplayer maps):
You set up garrison gates passable only by a certain player (and his allies) simply by making it owned by that player and stacking it with huge armies, e.g. 10000 titans or something.
Only the player who owns the gate can get through!
You set up garrison gates passable only by a certain player (and his allies) simply by making it owned by that player and stacking it with huge armies, e.g. 10000 titans or something.
Only the player who owns the gate can get through!
Ach wie schoen das niemand weiss....
-
- Leprechaun
- Posts: 9
- Joined: 20 Feb 2006
Hail: Without scripting there are other ways also. First off, the teleport spell on the main map the heroe can only go 8 tiles. So, set up a border guard, and on the other side just use blocking objects, rocks, trees ect, and have a path 8 tiles long with gold, gems, ect on it. Now he can not hop over, as there is no place to land within his range.
This is easy to do to keep a heroe in his part of the dungeon. On top, just make the area only have 1 or 2 places to land a boat, or a teleporter with 8 blocked grids behind it, and a border guard in front of it.
This method adds one more element to the game, that being, at the end fight, you really need to Win, otherwise, not only did you lose your best heroe, but you just picked up the gems, ect, and now the enemy has a way out of his area.
This is easy to do to keep a heroe in his part of the dungeon. On top, just make the area only have 1 or 2 places to land a boat, or a teleporter with 8 blocked grids behind it, and a border guard in front of it.
This method adds one more element to the game, that being, at the end fight, you really need to Win, otherwise, not only did you lose your best heroe, but you just picked up the gems, ect, and now the enemy has a way out of his area.
Who is online
Users browsing this forum: No registered users and 0 guests