Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 4 - Lands of Axeoth > Thread: How can i "prevent" units removing from garrisons?
Thread: How can i "prevent" units removing from garrisons?
vulcancolak
vulcancolak


Famous Hero
posted February 18, 2024 11:57 AM
Edited by vulcancolak at 13:10, 18 Feb 2024.

How can i

Hello everyone. If the specific town captured, i am changing owner of the specific Garrison for the player who captured. And i am giving creature for this Garrison. But i am able to move the units from Garrison.
Is there a way to prevent that?

- Alternative -
Can i give creatures to the garrison BASED on INTEGER?

- Alternative 2 -
Can i use "combat" function and give creatures BASED on INTEGER?

Any of these will solve my problems but first one is best option for me.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted February 18, 2024 04:34 PM

Well, you could use the editor and select the checkbox in the garrison to make troops not removable.

In order to make the checkbox accessible you'll need to initially set an owner for the garrison. If you want the garrison to start out with no owner, you'll need to add a triggerable event to the garrison that changes the owner to neutral, and then you'll need a map timed event on day 1 that calls the triggerable event.

Map timed event means a timed event under Campaign->Map Properties not a timed event on the garrison

I've tested that this works.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
vulcancolak
vulcancolak


Famous Hero
posted February 18, 2024 06:35 PM
Edited by vulcancolak at 18:36, 18 Feb 2024.

The question is "how" i have tried many things and i have realized units can be moved "after the garrison cleared and created unit via triggers"

In other words, if you create any unit in empty garrison "can remove creatures from garrison" function not works

But if you have 10 berserkers and if you will increase these numbers everyday, "can remove creatures from garrison" function works They cannot be moved from garrison when i untick this.

I will be happy if you can post as map file or can show me how can i do with scripts because i don't understand yet.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted February 18, 2024 08:02 PM

vulcancolak said:
The question is "how" i have tried many things and i have realized units can be moved "after the garrison cleared and created unit via triggers"

In other words, if you create any unit in empty garrison "can remove creatures from garrison" function not works

But if you have 10 berserkers and if you will increase these numbers everyday, "can remove creatures from garrison" function works They cannot be moved from garrison when i untick this.

I will be happy if you can post as map file or can show me how can i do with scripts because i don't understand yet.


Buddy, did you even read my post? I literally told you exactly "how" to do it. I even said I tested it and it worked I changed the owner and added creatures to a garrison by triggerable event, and those creatures are unable to be removed from the garrison.

Go back and read my post, then do that on your map.

Just make sure in the editor you UNcheck the box for "Can Remove Creatures from Garrison", which will make it so creatures are unable to be removed from the garrison.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
vulcancolak
vulcancolak


Famous Hero
posted February 18, 2024 08:18 PM

I did the same thing and it not worked for me. Still i am trying to do different things and looking for solution.

Town X > Captured
If Owner is Red
Trigger custom event named "RedGarrison"

RedGarrison > Change Owner to "Red"

End Turn
Day 2
Everyday give 10 harpies to RedGarrison.

And i can move these units from Garrison.
I am looking for solution to make them "never leave"

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted February 18, 2024 08:51 PM

vulcancolak said:
I did the same thing and it not worked for me. Still i am trying to do different things and looking for solution.


It's apparent that you are not doing the same thing

vulcancolak said:
Town X > Captured
If Owner is Red
Trigger custom event named "RedGarrison"

RedGarrison > Change Owner to "Red"

End Turn
Day 2
Everyday give 10 harpies to RedGarrison.

And i can move these units from Garrison.
I am looking for solution to make them "never leave"


I just did exactly this and was unable to remove any added creatures from the garrison.

Post a screenshot of the editor with the garrison open for editing.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
vulcancolak
vulcancolak


Famous Hero
posted February 18, 2024 08:56 PM

Here.
1-) First i am "capturing" the Garrison. Because i have to clear it first.
2-) I am capturing town.
3-) After the turn ends, everyday script gives 10 harpies for the Garrison and i cannot move these creatures from this Garrison.


 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted February 18, 2024 09:35 PM
Edited by iliveinabox05 at 21:42, 18 Feb 2024.

vulcancolak said:
3-) After the turn ends, everyday script gives 10 harpies for the Garrison and i cannot move these creatures from this Garrison.


Then what's the problem? That's what you've been saying you wanted to do..

Edit. I just tested capturing the garrison and that does indeed seem to reset the garrison to a default of being able to remove creatures from the garrison.

Seems like you're out of luck on this one if you want creatures to remain on the garrison.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
vulcancolak
vulcancolak


Famous Hero
posted February 18, 2024 09:44 PM

What about other 2 alternatives? Are they possible to do?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
iliveinabox05
iliveinabox05


Honorable
Famous Hero
posted February 18, 2024 09:48 PM

vulcancolak said:
What about other 2 alternatives? Are they possible to do?


Your 2 alternatives don't make any sense in the context of this post. How would they help prevent removing troops from a garrison?

I tried placing a quest gate on either side of the garrison that requires a hero on the army to pass, and that made it so I was unable to remove creatures from the garrison (unless I visit the garrison with a hero of course).

Really it depends on what you're actually trying to do here, which is unclear from your post.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
vulcancolak
vulcancolak


Famous Hero
posted February 18, 2024 09:57 PM

I am trying to create guarded area "any way i can"
Ok let me what "exactly" i want.

You are capturing town named X.
This town is not good because you cannot build most of the buildings.
BUT your border have a garrison. This garrison gets units everyday.
And the problem is you can move your units from garrison.
Purpose of this garrison is "guarding" only.

This is what i am trying to do.

Now currently i have created system that when the enemy enters the region, 5 behemots are attacking the enemy. But i cannot increase this number.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Karmakeld
Karmakeld


Responsible
Supreme Hero
posted February 19, 2024 06:20 PM
Edited by Karmakeld at 18:31, 19 Feb 2024.

vulcancolak said:
I am trying to create guarded area "any way i can"
Ok let me what "exactly" i want.

You are capturing town named X.
This town is not good because you cannot build most of the buildings.
BUT your border have a garrison. This garrison gets units everyday.
And the problem is you can move your units from garrison.
Purpose of this garrison is "guarding" only.

This is what i am trying to do.

Now currently i have created system that when the enemy enters the region, 5 behemots are attacking the enemy. But i cannot increase this number.


Not as desireable as it would be, but you could place a placed event infront of the garrison, on both sides, that will take away xx number of harpies from current army. Display som simple text, 'these Harpies had sworn to never leave the Garrison, yet they did. You decided they werent trustworthy and dismissed them'.
If you have a hero or another creature with you, all harpies will be removed. If only harpies are in the army (you could check with a conditional script), you can remove all but 1, which would give 1 harpy a day, so you could trigger a combat vs the harpies to avoid this. '100 Black Dragons came to punish the Harpies for breaking their sworn oath'. It's a work around. Cant help test other better solution atm, sorry.

As for increasing the number of Behemoth, if you want the number to for example increase over time, like increase by 1 pr week, so week 1- 5 Behemoth attacks, week 2- 6 behemoths attacks and so on, you should use a conditional script, checking which day it is, and set a condition according to it. You can use the Advanced Option Map Editor to easily copy the main script, rather than having to set up like 10 similar scripts
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
vulcancolak
vulcancolak


Famous Hero
posted February 20, 2024 12:44 AM
Edited by vulcancolak at 00:45, 20 Feb 2024.

Last one ise good idea Karmakeld. But can you tell me how can i use variables effectively in here? I am elder mapmaker of Warcraft III and i have created lot of systems and heroes but i can do anyting in Warcraft III thanks to the World Editor.
But with Heroes 4 editor i was need something like these
This army fights TempInt Behemots
TempInt equals to current week etc etc like something this.
I mean i cannot change quantity with Integers.


 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Karmakeld
Karmakeld


Responsible
Supreme Hero
posted February 20, 2024 06:20 PM
Edited by Karmakeld at 18:25, 20 Feb 2024.

Well in the placed events you make a conditional script. If Current player is human (I asume you only want it run if player is human, not AI), then if army has hero, take xx harpies. If not army has hero fight xx black dragons.

For the Behemoth event, you make a placed script (cant recall if you can choose week or only day). If current day>= 4 or current week is = 1 then this army fights 5 behemoth.
If current day>= 11 or week is = 2, then this army fights 6 behemoth. In the placed event you choose the name of the script you want to link in the map event.
If you need guidance to scripting, I can recommand the Scripting Guide
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0373 seconds