Heroes IV: Problem with using "guard"

Maps and the art of mapmaking.
User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Heroes IV: Problem with using "guard"

Unread postby iLiVeInAbOx05 » 09 Nov 2014, 21:04

So I place a creature on the map with the map editor, and set it to "guard" instead of "wander."

Why does this seem to not always work? I've seen several instances while testing my current map where a creature who is set to "guard" his location will either sometimes move, or attack if the player gets too close.

Anyone have any insight into this? It's extremely annoying.

Possibly of note: I've set the creature to a color.

User avatar
Maciek
Scout
Scout
Posts: 168
Joined: 14 May 2009
Location: Poland

Unread postby Maciek » 10 Nov 2014, 00:01

I just managed to observe that for coloured AI armies on ships. They don't want to stand still.

Ship or not and whatever the reason, you can force the naughty monster to stand still by putting it on a stone (or any other small, impassable object). You can then bomb out the stone when the monster gets defeated. (trigger the bomb from 'defeated' script)

The drawback is that then, the monster will only guard 1 tile. I mean, if the passage is more than 1 tile wide, the monster will not really guard it.
So, it's not always a good workaround.

Maybe try to construct a minimum working example of the problem?

User avatar
Kalah
Retired Admin
Retired Admin
Posts: 20078
Joined: 24 Nov 2005

Unread postby Kalah » 10 Nov 2014, 00:09

What have you set as the custom rule for all monsters on the map? Guard or wander?
In War: Resolution, In Defeat: Defiance, In Victory: Magnanimity, In Peace: Goodwill.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Unread postby iLiVeInAbOx05 » 10 Nov 2014, 03:03

Maciek wrote:I just managed to observe that for coloured AI armies on ships. They don't want to stand still.

Ship or not and whatever the reason, you can force the naughty monster to stand still by putting it on a stone (or any other small, impassable object). You can then bomb out the stone when the monster gets defeated. (trigger the bomb from 'defeated' script)

The drawback is that then, the monster will only guard 1 tile. I mean, if the passage is more than 1 tile wide, the monster will not really guard it.
So, it's not always a good workaround.

Maybe try to construct a minimum working example of the problem?
Maciek, thank you for your response! I think this workaround will more than suit me for what I need to do!
Kalah wrote:What have you set as the custom rule for all monsters on the map? Guard or wander?
How do I set this rule for all creatures, colored or no? Is this in the map editor or is it during the prologue screen where you select it?

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Unread postby iLiVeInAbOx05 » 10 Nov 2014, 03:12

If I have time next weekend I might try to get a working example of the creatures set to guard and not guarding, but I'm not sure I'll be able to reproduce this particular issue as easily as some of the others I've looked into.

We'll see!

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Unread postby iLiVeInAbOx05 » 10 Nov 2014, 03:34

Well looks like I spoke too soon about the workaround being everything I needed.

So one of the things I'm trying to do, is have some creatures that will join you. Now I saw this done on one of the Gathering Storm maps, and I thought it was an encountered script that just changes the creatures' color, but I tried that and it didn't work. Ended up fighting the creatures still and controlling BOTH sides of the battle.. kind of a strange bug..

So then I tried to put a placed event a few spaces from the creatures that I wanted to have join the player.. and the creature decided to move toward the placed event so that the player would still have to fight them.

Placing a rock under the creature to keep them from moving works.. but if the creature is supposed to join the player, the rock can't be deleted, because apparently trying to delete and adventure object with a creature there will crash the game :\

I guess I'll just go back to surrounding the creature with rocks and when the player hits the placed event to make the creatures join, it also deleted the rocks.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Unread postby iLiVeInAbOx05 » 10 Nov 2014, 04:37

After much testing, I finally figured out that there is a problem with the script "Delete adventure objects" when it is being called from a triggered script (there seem to be a lot of bugs using triggered scripts..).

There is, apparently, no problem putting a bomb on top of a creature and using the delete adventure objects script on top of it (I thought there initially was because I was calling delete adv obj from a triggered script attached to the creatures).

So far the workaround proposed by Maciek should work for what I need to do, but I would still like to figure out about the "guard" issue.

User avatar
Kalah
Retired Admin
Retired Admin
Posts: 20078
Joined: 24 Nov 2005

Unread postby Kalah » 10 Nov 2014, 15:34

If you set monsters to wander, they will wander no matter what you set in the editor. I seem to remember this is how it works, although it's years since I used the editor and I may be remembering wrong ...
In War: Resolution, In Defeat: Defiance, In Victory: Magnanimity, In Peace: Goodwill.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Unread postby iLiVeInAbOx05 » 10 Nov 2014, 18:45

Kalah wrote:If you set monsters to wander, they will wander no matter what you set in the editor. I seem to remember this is how it works, although it's years since I used the editor and I may be remembering wrong ...
Hmm, but wouldn't that be for creatures that aren't aligned with any player color? I have a hard time believing that extends to any creature (including heroes) that are flying a colored flag.

I don't think I mentioned it earlier, but I have a hero on this same map set to guard, that was moving as well.

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Unread postby Taro » 11 Nov 2014, 19:07

Funny, because in my newest map there is an army of green player set to guard. And it stands on ground, despite game options about wandering armies (I tried both).

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Unread postby iLiVeInAbOx05 » 11 Nov 2014, 20:18

Taro wrote:Funny, because in my newest map there is an army of green player set to guard. And it stands on ground, despite game options about wandering armies (I tried both).
Taro, you mean this particular army does move, regardless of the option you choose before the game?

User avatar
wimfrits
Round Table Knight
Round Table Knight
Posts: 2047
Joined: 06 Jan 2006
Location: Utrecht, the Netherlands

Unread postby wimfrits » 12 Nov 2014, 12:27

I can't check and it's been a while.. but like Kalah I'm pretty sure the player's choice overrules editor settings for neutral armies. I'm not sure if that extends to coloured armies.
Also, note that if coloured armies can interact/combine/split, any script or setting on the army will be lost.
Are you suggesting coconuts migrate?

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Unread postby Taro » 12 Nov 2014, 15:43

No, this army just stands in one place. This army is not neutral, it belongs to green player.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 773
Joined: 21 Jul 2014

Unread postby iLiVeInAbOx05 » 12 Nov 2014, 17:53

wimfrits wrote:I can't check and it's been a while.. but like Kalah I'm pretty sure the player's choice overrules editor settings for neutral armies. I'm not sure if that extends to coloured armies.
Also, note that if coloured armies can interact/combine/split, any script or setting on the army will be lost.
The colored armies (and heroes) in question aren't able to interact with any of the other same colored armies. They only seem to move once, and then never again.
Taro wrote:No, this army just stands in one place. This army is not neutral, it belongs to green player.
Are there any green towns in this map?

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Unread postby Taro » 13 Nov 2014, 14:16

Yes, green has a town.

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Unread postby Taro » 15 Nov 2014, 08:35

(sigh) After some testing I have to say I have this bug. After several days this army goes to underground :( So I have to do a trick with rocks.

User avatar
Duzeom_
Conscript
Conscript
Posts: 235
Joined: 07 Mar 2011

Unread postby Duzeom_ » 25 Nov 2014, 22:10

I have encountered the issue with guard long ago while making Astral Romance campaign. There in second map an army is protecting the Asu prison. I had to think up some mechanism to prevent that the army even with guard could trigger some events - which ment that it moved. In my new campaign I have the same thing. I had to write that campaign works only with guarding enemies...

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1126
Joined: 12 Nov 2011

Unread postby Karmakeld » 26 Nov 2014, 23:31

funny 'coz I haven't envountered this in any of my maps. my experience is that when you choose guard/mobile troops before game start, it affects only those creatures which hasn't been preset in editor. now judging from your test I might be wrong though.
So one of the things I'm trying to do, is have some creatures that will join you...So then I tried to put a placed event a few spaces from the creatures that I wanted to have join the player.. and the creature decided to move toward the placed event so that the player would still have to fight them..
Iliveinabox, drop me a pm with your email and I will send you a test map of how I used the script: enemy will change upon encouter WITHOUT fighting both sides (it can be done).
Oh, do note that this can only work if stack is neutral. if colored they will always attack you.
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground

User avatar
Taro
Scout
Scout
Posts: 163
Joined: 11 Feb 2011
Location: Poland

Unread postby Taro » 27 Nov 2014, 02:51

Karmakeld, could you send me this map as well? I'm intrigued how you did it.

User avatar
Karmakeld
CH Staff
CH Staff
Posts: 1126
Joined: 12 Nov 2011

Unread postby Karmakeld » 27 Nov 2014, 19:29

sure thing.. i'll see if I can remember to upload a pic of the editor map.. someday..
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 3 guests