|
Thread: Campaign Editor - swich colour of towns | |
|
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?
____________
|
|
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
____________
|
|
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.
|
|
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
____________
|
|
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
____________
|
|
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)
|
|
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
____________
|
|
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.
|
|
zamfir
Promising
Supreme Hero
Allez allez allez
|
posted April 07, 2009 08:29 PM |
|
|
Here is a very good scripting guide.
|
|
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
____________
|
|
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
____________
|
|
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
|
|
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.
|
|
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 :-)
|
|
Karmakeld
Responsible
Supreme Hero
|
posted February 22, 2016 09:49 PM |
|
|
HCM
Your welcome but you should check more frequently for replies
|
|
|