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: Campaign Editor - swich colour of towns
Thread: Campaign Editor - swich colour of towns
Ritcha
Ritcha


Hired Hero
posted April 07, 2009 04:46 PM

Campaign Editor - swich colour of towns

Hello

I've been working on a map for ages - and now I've been working on an issue for the last many times in that map and just can't make it work.

In one of the Heroes 4 campaigns, where you play dead, you suddenly loose some towns to another player.

I'd like to know how to do that, since I need it in my map

I'll try to describe, how I'd like it to happen:

When the orange hero steps on a placed event, the three green towns and heroes should change colour into orange instead of green.

Can anyone help me? I'd like it to happen through a placed event, but if that is not possible, how then?
____________

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


Promising
Famous Hero
posted April 07, 2009 05:14 PM

change ownership command is under town properties, so you can do it this way: create placed event, which sets boolean variable as 'true' and a continuous event in town, which checks if the variable is 'true' and if it is 'true' it changes ownership
____________

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


Honorable
Legendary Hero
Far-flung Keeper
posted April 07, 2009 05:27 PM

Can't exactly help you with scripting myself, but if you tell me which mission that script was in, I can upload the map for you and you can investigate it in the map editor yourself.

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


Hired Hero
posted April 07, 2009 05:42 PM

Quote:
change ownership command is under town properties, so you can do it this way: create placed event, which sets boolean variable as 'true' and a continuous event in town, which checks if the variable is 'true' and if it is 'true' it changes ownership


Thank you for your reply

I just tried to look at it, but I can't chose a town? It only sets the quest-gates as possibly choices.

I chose "SEQUENCE" and then pressed new. There I chose "SET BOOLEAN (TRUE/FALSE) VARIABLE" - and there was no towns to chose
____________

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


Hired Hero
posted April 07, 2009 05:51 PM

Quote:
Can't exactly help you with scripting myself, but if you tell me which mission that script was in, I can upload the map for you and you can investigate it in the map editor yourself.


Ehm, I only remember I was playing dead (at least, it was such towns). But I know that in the last map in "Elwin and Shaera" there's a hero that changes colour - so if you can send that I'd be greatful too
____________

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


Honorable
Legendary Hero
Far-flung Keeper
posted April 07, 2009 06:44 PM
Edited by Cepheus at 18:45, 07 Apr 2009.

You must be thinking of Gramin, but he begins under your control and just can't move until you approach him.  I did find a useful script that does what you want from "The True Blade", final map, though.

---Placed Event - Rasan Hill (placed on map)---

Effects:
Luckily, the impeccable reputations of Sir Kentaine and Lady Desette are enough to convince the people of Rasan Hill that Worton is not the rightful heir to the Gryphonheart throne, so they decide to join your cause against the usurper.

Script:

--SEQUENCE--

- Set 'Boolean1' to TRUE (SET BOOLEAN TRUE/FALSE VARIABLE)
- Set 'RasanHill' to '[Current Day]' (SET NUMERIC VARIABLE)
- Trigger Custom Event named 'Rasan Hill' (TRIGGER CUSTOM EVENT)
- Remove script (REMOVE SCRIPT)

---Custom Event - Rasan Hill (Triggerable Event in town: Rasan Hill)---

Effects:
None

Script:

--SEQUENCE--

- Change ownership to Purple Player (CHANGE OWNER)
- Remove script (REMOVE SCRIPT)

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


Hired Hero
posted April 07, 2009 07:14 PM

Quote:
You must be thinking of Gramin, but he begins under your control and just can't move until you approach him.  I did find a useful script that does what you want from "The True Blade", final map, though.

---Placed Event - Rasan Hill (placed on map)---

Effects:
Luckily, the impeccable reputations of Sir Kentaine and Lady Desette are enough to convince the people of Rasan Hill that Worton is not the rightful heir to the Gryphonheart throne, so they decide to join your cause against the usurper.

Script:

--SEQUENCE--

- Set 'Boolean1' to TRUE (SET BOOLEAN TRUE/FALSE VARIABLE)
- Set 'RasanHill' to '[Current Day]' (SET NUMERIC VARIABLE)
- Trigger Custom Event named 'Rasan Hill' (TRIGGER CUSTOM EVENT)
- Remove script (REMOVE SCRIPT)

---Custom Event - Rasan Hill (Triggerable Event in town: Rasan Hill)---

Effects:
None

Script:

--SEQUENCE--

- Change ownership to Purple Player (CHANGE OWNER)
- Remove script (REMOVE SCRIPT)


Yeah, I was thinking of Gramin. I was sure he wasn't part of one's army from the start... Well, apparently I was wrong.

Thank you for copying all that here

My problem now is, that I can't select the towns (in the numeric variable) in the placed event - there are no proposals whatsoever. And where does "Boolean1" come from?

Sorry about my questions, I'm just a little confused about this, hehe
____________

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


Honorable
Legendary Hero
Far-flung Keeper
posted April 07, 2009 07:20 PM
Edited by Cepheus at 19:21, 07 Apr 2009.

Sorry about that Boolean1 and RasanHill stuff, they're both just variables which set the day (two days after getting Rasan Hill you receive another town, so the variables set the day you activated the first event on).  

You can delete them unless you want a similar event where you get one town, then another a few days later, etc.  To get the town, you need only set a triggerable event in the town you want to obtain, then trigger it using Trigger Custom Script in the placed event.

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


Promising
Supreme Hero
Allez allez allez
posted April 07, 2009 08:29 PM

Here is a very good scripting guide.

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


Hired Hero
posted April 07, 2009 08:56 PM

Quote:
Sorry about that Boolean1 and RasanHill stuff, they're both just variables which set the day (two days after getting Rasan Hill you receive another town, so the variables set the day you activated the first event on).  

You can delete them unless you want a similar event where you get one town, then another a few days later, etc.  To get the town, you need only set a triggerable event in the town you want to obtain, then trigger it using Trigger Custom Script in the placed event.


Thank you so much! - finally I made it work! With the triggerable.

At last, I was so close to give it up
____________

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


Hired Hero
posted April 07, 2009 09:00 PM

Quote:
[url=http://www.celestialheavens.com/viewpage.php?id=517]Here[/url] is a very good scripting guide.


Thank you!

I think I will be addicted to that article, you can do so much different with Heroes 4 maps, I just love it But it's some kind of a maze to find out how some times
____________

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

Tavern Dweller
posted July 16, 2015 09:10 AM

Map editor changing a town's ownership

HoMM4 campaign editor problem

I have built a scenario where all the players (human and computer, both townless) must locate a town to conquer; except some computer players decides to quit before they even get started. To fix this I am attempting to automatically change the town's ownership from neutral to computer player at the 12 day mark but apparently I can't figure out the right script to achieve this. Can anybody help me? I've failed at bath the timed event and the triggered event attempts.

Thank you, Dave Ashby

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


Responsible
Supreme Hero
posted July 19, 2015 12:28 PM

Karmakeld

Hey Dave.
In Town properties select triggered a events, create event called change_town_Ai. Select change owner, change to desired color, remove script.
Go to map properties, select timed events. Set to day 12, run on day 12 only. Create a sequence, trigger custom event named change_town_Ai. Remove script. Hope this works for you.

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

Tavern Dweller
posted February 20, 2016 11:02 PM

Karmakeld said:
Hey Dave.
In Town properties select triggered a events, create event called change_town_Ai. Select change owner, change to desired color, remove script.
Go to map properties, select timed events. Set to day 12, run on day 12 only. Create a sequence, trigger custom event named change_town_Ai. Remove script. Hope this works for you.


Yes, thank you. That helped perfectly :-)

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


Responsible
Supreme Hero
posted February 22, 2016 09:49 PM

HCM

Your welcome but you should check more frequently for replies

 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.0419 seconds