|
Thread: H6 map editor - triggers - questions & answers | This thread is pages long: 1 2 3 · NEXT» |
|
Thanatoeil
Adventuring Hero
|
posted April 08, 2013 11:01 PM |
|
|
H6 map editor - triggers - questions & answers
I open this thread so that H6-mapmakers can exchange about the triggers used in the H6-map editor.
I know that there are very few H6-mapmakers, but maybe it will help the courageous ones struggling with the editor and its triggers.
|
|
Thanatoeil
Adventuring Hero
|
posted April 08, 2013 11:05 PM |
|
|
Territory with controlled access
I want to create an owned territory with several entrances. These entrances are only passable by heroes belonging to the player who controls the territory's fort.
But I did not find a simple way to make it.
Has anybody a solution ?
|
|
natalka
Supreme Hero
Bad-mannered
|
posted April 08, 2013 11:46 PM |
|
|
Have u tried isOwnerOfEntity under conditions?
But then how do u make it passable/impassable.
|
|
natalka
Supreme Hero
Bad-mannered
|
posted April 09, 2013 12:06 PM |
|
|
I want to recreate windmill/watermill.
Do you know how to make if any hero of a player interacts with a signpost something happens?
I tried making a script using IsDayOfWeek and when it is day 1 a variable gets a 0 value. Then I have to check if this variable = 0 when I visit the signpost. Interacting with the signpost gives 1000 gold and changes the variable to 1. In this way you can`t revisit the location until day 1 of next week when it is changed back to 0.
|
|
Thanatoeil
Adventuring Hero
|
posted April 09, 2013 06:39 PM |
|
|
Any hero activates an entity
I think you can build something by combinating both condition triggers :
- EntityIsInLocation : to set an EntityVariable with the name of the hero stepping in the location surrounding the signpost
- EntityInteractedWithEntity : to test if the spotted hero activates the signpost.
It's only an idea, I didn't test it (I only successfully tested the EntityInteractedWithEntity condition).
|
|
natalka
Supreme Hero
Bad-mannered
|
posted April 09, 2013 07:07 PM |
|
Edited by natalka at 19:59, 09 Apr 2013.
|
So the idea is to set entity variable which is assigned something whenever a hero enters the location. Can you write down this script only?
Anyway my biggest trouble is to "resupply" the watermill at the beginning of each new week. I am trying with IsDayOfWeek but it only triggers on day 1 week 1 and not on day 1 week 2 etc.
|
|
Thanatoeil
Adventuring Hero
|
posted April 09, 2013 11:55 PM |
|
|
Any hero activates an entity
Here is the script testing if any hero activates an entity (signpost)
For my test I create a location (square 3 x 3) with the signpost in the middle.
The script works fine, but it is necessary to write one test per player.
And the size of the location must be adapted, so that no other hero can be in the area when the signpost is activated.
|
|
Thanatoeil
Adventuring Hero
|
posted April 10, 2013 12:07 AM |
|
|
Counting the days
Quote: Anyway my biggest trouble is to "resupply" the watermill at the beginning of each new week. I am trying with IsDayOfWeek but it only triggers on day 1 week 1 and not on day 1 week 2 etc.
I already searched for a function giving the number of the day. I found the function GetgameTime in the "obsolet" list. But I wasn't able to make it work, maybe it can't work.
So the only solution I see, is to create a variable that counts the days. Each time the player 1 turn begins, the counter is incremented. By this way, you create your own function that gives the day number.
But it's only an idea, I never wrote or tested it.
Nota : the lack of function that gives the day number is a proof that the map editor was not build for the fan map makers. UbiHole built only the triggers they needed in their maps/campaigns.
|
|
natalka
Supreme Hero
Bad-mannered
|
posted April 10, 2013 12:27 AM |
|
Edited by natalka at 00:36, 10 Apr 2013.
|
I totally agree about the editor and ubisoft. I don`t know how to make increments to the variable.
I tested your script but instead of placing glories I put addResource 10000 gold and nothing happens. Everything else is the same - signpost, getEntity. Do I have to assign a variable to getEntityinLocation
|
|
Thanatoeil
Adventuring Hero
|
posted April 10, 2013 12:47 AM |
|
|
It is a bit late for me (past midnigt). I will give you more informations tomorrow.
|
|
natalka
Supreme Hero
Bad-mannered
|
posted April 10, 2013 11:28 AM |
|
|
Can u show me how to remove starting army from a hero I buy in the tavern.
|
|
Thanatoeil
Adventuring Hero
|
posted April 10, 2013 06:36 PM |
|
|
Any hero activates an entity
I made a small map containing only the "windmill" function (1 hero, 1 signpost, 1 location and the script).
The script works and gives 10000 gold.
I can send you this map. If you agree, we can use PM to organize the map exchange.
|
|
natalka
Supreme Hero
Bad-mannered
|
posted April 10, 2013 09:18 PM |
|
|
|
Thanatoeil
Adventuring Hero
|
posted April 11, 2013 06:41 PM |
|
|
Repeatability of triggers
(answering to natalka's question)
A trigger works only once : if a trigger is activated, it becomes disabled.
In order to make a trigger work repeatedly, it must be reactivated by using the function RestartTrigger.
Scenario_RestartTrigger :
parameters : the name of the trigger to be re-enabled, how long to wait before re-enabling the trigger (value in days)
Scenario_RestartTriggerMs :
parameters : the name of the trigger to be re-enabled, how long to wait before re-enabling the trigger (value in milliseconds)
@ natalka : I send you the updated map, including the RestartTrigger, allowing to activate the windmill repeatedly.
|
|
Thanatoeil
Adventuring Hero
|
posted April 11, 2013 11:55 PM |
|
|
Recruiting hero without army
I think it's impossible to write such a script :
there are so many possibilities, that it is impossible to take into account all the cases.
For example :
1- a new hero is recruited when another hero is already in this town (garrison or visiting) : it is nearly impossible to know which one was recruited, which one was in town before,
2- a new hero is recruited in a town where creatures are in garrison, so all creatures (the hero's army and the garrison) are mixed and it is nearly impossible to knwo which creatures came with the new hero.
|
|
natalka
Supreme Hero
Bad-mannered
|
posted April 15, 2013 03:28 PM |
|
Edited by natalka at 15:39, 15 Apr 2013.
|
I am aware of this. I will put a message in the loading screen
It will happen on second, third hero in one week. It will happen very rarely imo.
My latest script is about 7 "banks" being randomly placed on a circular template so each position has only one bank and according to the bank the creatures in the area are increased too. There are also 3 types of bank strength.
|
|
Thanatoeil
Adventuring Hero
|
posted April 15, 2013 09:42 PM |
|
|
Recruiting hero without army
If you want to investigate, you can try the following triggers :
- (Condition) Scenario_IsPlayerBuyHero
- (Get Triggers) GetEntityInTownGarrison
- (Get Triggers) GetEntityInTownGarrison
- (Scenario) RemoveFullArmy
|
|
Thanatoeil
Adventuring Hero
|
posted April 15, 2013 10:25 PM |
|
|
Calendar function
I wrote a script (Calendar) handling the day, week and month in game (this function doesn't exist among the UbiHole triggers) :
@natalka : if you want, I can send you the test map containing this script.
|
|
natalka
Supreme Hero
Bad-mannered
|
posted April 16, 2013 10:32 AM |
|
|
recruiting hero without army - yes that`s exactly how I did it.
Can you send map with the calendar. My windmill doesn`t work properly :/
|
|
Thanatoeil
Adventuring Hero
|
posted April 16, 2013 09:59 PM |
|
|
natalka, I just sent you the map.
|
|
|