Mapmaking tricks (H4)
Mapmaking tricks (H4)
Hello all, I'm not posting all mapmaking tricks from the old forums, but a few basic ones that are usefull for all players.
So here goes:
(credit for these go to rife)
For some reason, the editor lacks the ability to detect the difficulty level the player chooses at the beginning of the map or campaign, but this simple script (courtesy of Ururam Tururam) when executed at the beginning of the first day, will allow you to accurately gauge it anyway:
difficulty=5
if gold(human)>4000: difficulty=4
if gold(human)>9000: difficulty=3
if gold(human)>14000: difficulty=2
if gold(human)>19000: difficulty=1
Preventing 'Month of' creatures
'Month of' creatures populate at the sites you place nuetral creatures, and only if the 'month of' creature is of the same alignment as the original nuetral stack. If you have nuetrals guarding creature dwellings, 'month of' creatures can render them useless until cleared. Perhaps you don't want a necromancer player getting an unfair advantage due to repopulating creature stacks. Whatever your reason, you can prevent 'month of' creatures by changing the owner of the nuetral stack in the Defeated event.
Destroying nuetral or AI controlled stacks without fighting
For storyline purposes, you might want to place a hero or army within a player's sight, but have them disappear without having the player engage them in combat. I.e. the big bad guy shows up at the beginning of a map with an impossibly huge army to taunt the player before telling him to meet him at his castle... if he dares. Then the big bad guy disappears.
To make this happen, make this triggerable event on the big bad guy's army:
This Army fights 10000 Black Dragons
Then when you want him to disappear, just call the trigger.
Recursive loops
Let's say you want to set up a quest hut that will pay the player 10000 gold for every cart of ore he has. You've scattered dozens of them across the map, but you need an easy way to pay him the correct amount based on how many of the artifact he has. The way to do this is so: set up the quest hut and check if the player has a cart of ore. If so, trigger the following event.
Triggerable Event PAY THE MAN
Take artifact Cart of Ore
Give current player 10000 gold
If current player has Cart of Ore, Trigger custom event PAY THE MAN
The event will continue to pay until the player has no more carts of ore. Similar events can be used to perform an action up to VARIABLE times. For instance, a hero has gone hunting savage gnashers in a set region. You want to increase his experience by 1000 points for every gnasher killed, so you increase the variable PREY by one for every gnasher in a stack (in it's Defeated event). When he visits the Hunter's Lodge, it triggers the following:
Triggerable Event HUNTER'S REWARD
Set PREY=PREY-1
Increase experience by 1000
If PREY>0, Trigger custom event HUNTER'S REWARD
(credit for these goes to Ranke Fne)
Here's one to improve AI according to the level difficulty you play. (I used that in my new campaign, The Gambler - to see it in practise especially check map3 in that campaign):
First use the DIFFICULTY variables as mentioned,
Champion: DIFFICULTY=5
Novice : DIFFICULTY=1 etc.
On a random town you put these scripts:
TRIGGERED EVENT (in town, called "TOWN#1_CREATURES"):
INCREASE DWELLING POPULATION OF 2nd 3rd level CREATURE by 3
A TIMED EVENT in town each 7th day (and only if AI owns that town!!!!):
TRIGGER TOWN#1_CREATURES
TRIGGER TOWN#1_CREATURES
IF DIFFICULTY>2 THEN TRIGGER TOWN#1_CREATURES
IF DIFFICULTY>3 THEN TRIGGER TOWN#1_CREATURES
IF DIFFICULTY>4 THEN TRIGGER TOWN#1_CREATURES
This way on ADVANCE level you add 3x3=9 3rd level 2nd dwelling creatures, on CHAMPION you add 5x3 = 15 creatures.
You can easy adjust it so if fits the overall gameplay by setting the TIMED EVENT to 5th day instead of 7th day etc.
You can copy a town to the OBJECT PALETTE and copy it from there if you want it on several towns. Just remember, in case you copy these scripts to another town, that you should change the name of the TRIGGERED event to TOWN#2_CREATURES etc., else you'd add extra creatures to the first town (TOWN#1_CREATURES).
I use INCREASE POPULATION instead of GIVE x ANGELS, because this way I will always give the creatures that fits that particular town.
Just remember to give AI extra money too, else he will just be able to hire a lot of creatures but won't have to money for it. Also set AI PROPERTIES in the town to "VITAL" or "HIGH" else AI might not hire all creatures.
You can of course add anything else than 3rd level creatures, the higher creatures you add the more courage the AI will be and attack your towns more often. For instance in The Gambler, map2, I only add level 1 and level 2 creatures, so that AI attacks fewer towns. I even cancelled all level 4 buildings in the AI start town to reduce AI agressiveness. To understand this, you should notice the gameplay in map2 versus map3 in The Gambler.
Towns with 2 level 3 dwellings or 2 level 4 dwellings:
Make a TIMED EVENT or TRIGGERED EVENT or CAPTURED EVENT etc:
CONSTRUCT 1ST LEVEL 3 DWELLING
CONSTRUCT 2ND LEVEL 3 DWELLING
The game will crash if you click the fort to hire creatures. The reason why it crashes is that there has to be 1 free creature circle (meaning only 5 out of 6 creature hire slots-circles, if you know what I mean).
So you can just cancel a 1st level dwelling and the game does not crash!
Same goes for level 4 dwellings.
If you want all level 3 and 4 dwellings = 4 dwellings, you can only have 1 more dwelling from the level 1 and 2 dwellings. 5 in all.
I haven't tried nature towns (they have the creature portal) and that might give problems !?!?
I'm using this in a death campaign, because most people just hire vampires and not venom spawns. The same goes for order towns. People always hire genies, not nagas.
(credit goes to Winfrits)
You would have to make the action on either the first, most powerful or least powerful hero in an army. Of course, you'd have to check presence of one or more heroes first.
A quest like that can be found in the quest hut east of 'The Frog' in scenario 'The Frog' in the AWoT campaign, if you want an example.
This one is not recursive and cannot be made recursive, but if the check is performed on something not hero-specific, like possession of a cart of ore, it can be a loop.
On the 'triggered script' of a quest hut, you'd have something like
IF army has cart of ore
TAKE ARTIFACT cart of ore
GIVE EXPERIENCE 23 TO first hero in this army
ELSE
DISPLAY give me a cart of ore to get a huuuuuuge exp bonus
(credit goes to ScarlettP)
Hey! I just stumbled across an answer to Veldrynus's question from quite some time ago. You CAN make a cliff! It's just rather difficult and not very practical. If you increase the elevation on your source map, then copy it over to a blank, flat map... it makes a cliff.
(my own )
The ongoing circle of post 1 doesn't work with creatures (if anyone wanted to try that) for the simple reason that creatures can't be taken or checked in a map-triggered event (that is out of a questhut) and in a questhut you can't trigger it over and over.
[added Nov 14 2005 11:47AM]
In Reply To #1
Oh, another thing, I thought of a way to get a timed event after a triggered one.
If you want a text message (or anything else) after a triggered scipted, you should use a numerical value in the trigger and set boolean, like 'time' set with number that reprisent the number of days + 1.
The boolean makes sure the days start ticking away AFTER you the trigger. So like this (for 3 days after)
Trigger1:
Set Boolean variable: days to true
Set Numerical Value: time to 4
Timed event 1:
Conditional action -
If: 'days'
Then: Set 'time' to time -1
Else: do nothing
Timed event 2:
Conditional action -
If: 'time' = 1
Then: Set boolean 'time_done' to true
Else: do nothing
Trigger2:
Conditional action -
If: 'time_done'
Then: do what you want to do in events
Else: do nothing
See this tread on the old forum for more
So here goes:
(credit for these go to rife)
For some reason, the editor lacks the ability to detect the difficulty level the player chooses at the beginning of the map or campaign, but this simple script (courtesy of Ururam Tururam) when executed at the beginning of the first day, will allow you to accurately gauge it anyway:
difficulty=5
if gold(human)>4000: difficulty=4
if gold(human)>9000: difficulty=3
if gold(human)>14000: difficulty=2
if gold(human)>19000: difficulty=1
Preventing 'Month of' creatures
'Month of' creatures populate at the sites you place nuetral creatures, and only if the 'month of' creature is of the same alignment as the original nuetral stack. If you have nuetrals guarding creature dwellings, 'month of' creatures can render them useless until cleared. Perhaps you don't want a necromancer player getting an unfair advantage due to repopulating creature stacks. Whatever your reason, you can prevent 'month of' creatures by changing the owner of the nuetral stack in the Defeated event.
Destroying nuetral or AI controlled stacks without fighting
For storyline purposes, you might want to place a hero or army within a player's sight, but have them disappear without having the player engage them in combat. I.e. the big bad guy shows up at the beginning of a map with an impossibly huge army to taunt the player before telling him to meet him at his castle... if he dares. Then the big bad guy disappears.
To make this happen, make this triggerable event on the big bad guy's army:
This Army fights 10000 Black Dragons
Then when you want him to disappear, just call the trigger.
Recursive loops
Let's say you want to set up a quest hut that will pay the player 10000 gold for every cart of ore he has. You've scattered dozens of them across the map, but you need an easy way to pay him the correct amount based on how many of the artifact he has. The way to do this is so: set up the quest hut and check if the player has a cart of ore. If so, trigger the following event.
Triggerable Event PAY THE MAN
Take artifact Cart of Ore
Give current player 10000 gold
If current player has Cart of Ore, Trigger custom event PAY THE MAN
The event will continue to pay until the player has no more carts of ore. Similar events can be used to perform an action up to VARIABLE times. For instance, a hero has gone hunting savage gnashers in a set region. You want to increase his experience by 1000 points for every gnasher killed, so you increase the variable PREY by one for every gnasher in a stack (in it's Defeated event). When he visits the Hunter's Lodge, it triggers the following:
Triggerable Event HUNTER'S REWARD
Set PREY=PREY-1
Increase experience by 1000
If PREY>0, Trigger custom event HUNTER'S REWARD
(credit for these goes to Ranke Fne)
Here's one to improve AI according to the level difficulty you play. (I used that in my new campaign, The Gambler - to see it in practise especially check map3 in that campaign):
First use the DIFFICULTY variables as mentioned,
Champion: DIFFICULTY=5
Novice : DIFFICULTY=1 etc.
On a random town you put these scripts:
TRIGGERED EVENT (in town, called "TOWN#1_CREATURES"):
INCREASE DWELLING POPULATION OF 2nd 3rd level CREATURE by 3
A TIMED EVENT in town each 7th day (and only if AI owns that town!!!!):
TRIGGER TOWN#1_CREATURES
TRIGGER TOWN#1_CREATURES
IF DIFFICULTY>2 THEN TRIGGER TOWN#1_CREATURES
IF DIFFICULTY>3 THEN TRIGGER TOWN#1_CREATURES
IF DIFFICULTY>4 THEN TRIGGER TOWN#1_CREATURES
This way on ADVANCE level you add 3x3=9 3rd level 2nd dwelling creatures, on CHAMPION you add 5x3 = 15 creatures.
You can easy adjust it so if fits the overall gameplay by setting the TIMED EVENT to 5th day instead of 7th day etc.
You can copy a town to the OBJECT PALETTE and copy it from there if you want it on several towns. Just remember, in case you copy these scripts to another town, that you should change the name of the TRIGGERED event to TOWN#2_CREATURES etc., else you'd add extra creatures to the first town (TOWN#1_CREATURES).
I use INCREASE POPULATION instead of GIVE x ANGELS, because this way I will always give the creatures that fits that particular town.
Just remember to give AI extra money too, else he will just be able to hire a lot of creatures but won't have to money for it. Also set AI PROPERTIES in the town to "VITAL" or "HIGH" else AI might not hire all creatures.
You can of course add anything else than 3rd level creatures, the higher creatures you add the more courage the AI will be and attack your towns more often. For instance in The Gambler, map2, I only add level 1 and level 2 creatures, so that AI attacks fewer towns. I even cancelled all level 4 buildings in the AI start town to reduce AI agressiveness. To understand this, you should notice the gameplay in map2 versus map3 in The Gambler.
Towns with 2 level 3 dwellings or 2 level 4 dwellings:
Make a TIMED EVENT or TRIGGERED EVENT or CAPTURED EVENT etc:
CONSTRUCT 1ST LEVEL 3 DWELLING
CONSTRUCT 2ND LEVEL 3 DWELLING
The game will crash if you click the fort to hire creatures. The reason why it crashes is that there has to be 1 free creature circle (meaning only 5 out of 6 creature hire slots-circles, if you know what I mean).
So you can just cancel a 1st level dwelling and the game does not crash!
Same goes for level 4 dwellings.
If you want all level 3 and 4 dwellings = 4 dwellings, you can only have 1 more dwelling from the level 1 and 2 dwellings. 5 in all.
I haven't tried nature towns (they have the creature portal) and that might give problems !?!?
I'm using this in a death campaign, because most people just hire vampires and not venom spawns. The same goes for order towns. People always hire genies, not nagas.
(credit goes to Winfrits)
You would have to make the action on either the first, most powerful or least powerful hero in an army. Of course, you'd have to check presence of one or more heroes first.
A quest like that can be found in the quest hut east of 'The Frog' in scenario 'The Frog' in the AWoT campaign, if you want an example.
This one is not recursive and cannot be made recursive, but if the check is performed on something not hero-specific, like possession of a cart of ore, it can be a loop.
On the 'triggered script' of a quest hut, you'd have something like
IF army has cart of ore
TAKE ARTIFACT cart of ore
GIVE EXPERIENCE 23 TO first hero in this army
ELSE
DISPLAY give me a cart of ore to get a huuuuuuge exp bonus
(credit goes to ScarlettP)
Hey! I just stumbled across an answer to Veldrynus's question from quite some time ago. You CAN make a cliff! It's just rather difficult and not very practical. If you increase the elevation on your source map, then copy it over to a blank, flat map... it makes a cliff.
(my own )
The ongoing circle of post 1 doesn't work with creatures (if anyone wanted to try that) for the simple reason that creatures can't be taken or checked in a map-triggered event (that is out of a questhut) and in a questhut you can't trigger it over and over.
[added Nov 14 2005 11:47AM]
In Reply To #1
Oh, another thing, I thought of a way to get a timed event after a triggered one.
If you want a text message (or anything else) after a triggered scipted, you should use a numerical value in the trigger and set boolean, like 'time' set with number that reprisent the number of days + 1.
The boolean makes sure the days start ticking away AFTER you the trigger. So like this (for 3 days after)
Trigger1:
Set Boolean variable: days to true
Set Numerical Value: time to 4
Timed event 1:
Conditional action -
If: 'days'
Then: Set 'time' to time -1
Else: do nothing
Timed event 2:
Conditional action -
If: 'time' = 1
Then: Set boolean 'time_done' to true
Else: do nothing
Trigger2:
Conditional action -
If: 'time_done'
Then: do what you want to do in events
Else: do nothing
See this tread on the old forum for more
Thelonious - Still the maddest magician around Hey, don't look at the secret part of my signature!
- Gaidal Cain
- Round Table Hero
- Posts: 6972
- Joined: 26 Nov 2005
- Location: Solna
Re: Mapmaking tricks
Not really necessary to use multiple variables here. Also, I thought you mentioned a timed event after a triggered one. In the script it seems you have a timed-triggered event. No big deal, but I'll just put up an alternative below :ronald wrote:Oh, another thing, I thought of a way to get a timed event after a triggered one.
If you want a text message (or anything else) after a triggered scipted, you should use a numerical value in the trigger and set boolean, like 'time' set with number that reprisent the number of days + 1.
The boolean makes sure the days start ticking away AFTER you the trigger. So like this (for 3 days after)
1. day1 timed :
SET NUMERIC VARIABLE time TO ZERO
2. trigger1 :
SET NUMERIC VARIABLE time TO 4
3. timed event repeating every day:
IF time > 0
- - SET NUMERIC VARIABLE time = time - 1
END-IF
IF time = 1
- - (TRIGGER ACTION (if you want it timed))
- - REMOVE SCRIPT
END-IF
(4. trigger2 (if you want it triggered instead of timed)
IF time = 1
- - ...
- - REMOVE SCRIPT
END-IF )
Good work with putting up those tips. Ofcourse there's a whole lot more where that came from, so it's a bit of a pity those are 'lost'. On the other hand, thoughts on scripting develop as well. What seemed like a good solution 1 year ago may very well be outdated now. So it's not necessarily bad to reconsider scripting questions.
- Thelonious
- Round Table Knight
- Posts: 1336
- Joined: 06 Jan 2006
- Location: right behind the next one
@ Gaidel - well I thought I'd just put it up - I forgot all those '<' and '>' .. sorry bout that - but I think the main thing is that they are here on this forum -> and as you see Wimfrits allready posts adjustments to the scripts so I don't think we'll be bother with those 'algt' thingies
@ Wimfrits - thanks for correcting
@ Wimfrits - thanks for correcting
Grah!
- Robenhagen
- Admin
- Posts: 1247
- Joined: 21 Nov 2005
- Location: Aarhus, Denmark
- Contact:
Heey! Rife is here! With my old avatar! Yey.
Now, the old forum will be made read-only as soon as GameSpy can get their asses unstuck from the couch and restore Angelspit's admin status. At any time, however, they may decide to pull the plug entirely. So you'd might as well get right to it and start getting the material.
Now, the old forum will be made read-only as soon as GameSpy can get their asses unstuck from the couch and restore Angelspit's admin status. At any time, however, they may decide to pull the plug entirely. So you'd might as well get right to it and start getting the material.
In War: Resolution, In Defeat: Defiance, In Victory: Magnanimity, In Peace: Goodwill.
- Thelonious
- Round Table Knight
- Posts: 1336
- Joined: 06 Jan 2006
- Location: right behind the next one
He's trying to immitate you...
Anyway, another trick for this thread -
The AI -> human trick for HoMM IV
Under the timed event tab make a script that make a boolean - for example this: Blueplayer, which is only true when the blue player plays. (So say you have a red human player as well, and an AI player, make blueplayer false at the beginning of their turns)
Then under the encountered tab of the neutral craeture, run a script that checks if 'Blue player' is true. Then if that is true, let it change the color of that stack to red, the other human player. You'll have a battle between the 2 human players instead of between the AI and 1 huan player.
This script works the same for the red player (ofcourse) only then change blue with red and vice versa.
Anyway, another trick for this thread -
The AI -> human trick for HoMM IV
Under the timed event tab make a script that make a boolean - for example this: Blueplayer, which is only true when the blue player plays. (So say you have a red human player as well, and an AI player, make blueplayer false at the beginning of their turns)
Then under the encountered tab of the neutral craeture, run a script that checks if 'Blue player' is true. Then if that is true, let it change the color of that stack to red, the other human player. You'll have a battle between the 2 human players instead of between the AI and 1 huan player.
This script works the same for the red player (ofcourse) only then change blue with red and vice versa.
Grah!
I've heard of all of those tricks. I don't know if it was in the old forums (stupid modem wouldn't want me to take a look) but you can create a thief without scouting, an archer without combat, a necromancer without death magic and so on by a clever trick found by... Uhh, I think it was Robenhagen.
first, create a hero. edit him/her. check the "custom" box to edit abilites (but don't edit anything) and press OK. Edit the hero again. Change his/her class. click OK. Edit the hero again. Click skills. The hero will have the abilites of the former class, and they can be removed! I don't know if it works in equilbris or patched version of WoW, but I hope it does...
If you use this trick, remove archery from an archer and he will carry a sword!
first, create a hero. edit him/her. check the "custom" box to edit abilites (but don't edit anything) and press OK. Edit the hero again. Change his/her class. click OK. Edit the hero again. Click skills. The hero will have the abilites of the former class, and they can be removed! I don't know if it works in equilbris or patched version of WoW, but I hope it does...
If you use this trick, remove archery from an archer and he will carry a sword!
I'm back!!!
- Thelonious
- Round Table Knight
- Posts: 1336
- Joined: 06 Jan 2006
- Location: right behind the next one
You can make a hero with other skills as well - lets say an archerclass. You make it a Ranger, and them check ok. Then do trhe whole sequence and you'll still have a Ranger.cherko wrote:first, create a hero. edit him/her. check the "custom" box to edit abilites (but don't edit anything) and press OK.
Grah!
- Thelonious
- Round Table Knight
- Posts: 1336
- Joined: 06 Jan 2006
- Location: right behind the next one
- DaemianLucifer
- Round Table Hero
- Posts: 11282
- Joined: 06 Jan 2006
- Location: City 17
- Thelonious
- Round Table Knight
- Posts: 1336
- Joined: 06 Jan 2006
- Location: right behind the next one
- Gaidal Cain
- Round Table Hero
- Posts: 6972
- Joined: 26 Nov 2005
- Location: Solna
- Thelonious
- Round Table Knight
- Posts: 1336
- Joined: 06 Jan 2006
- Location: right behind the next one
- Thelonious
- Round Table Knight
- Posts: 1336
- Joined: 06 Jan 2006
- Location: right behind the next one
A timer event for HoMM IV,
the timer can be started when 'begin' = true and stopped when 'compleet' = true. 'x' is the number of days that the timer has to run before the time has run out.
Code:
the timer can be started when 'begin' = true and stopped when 'compleet' = true. 'x' is the number of days that the timer has to run before the time has run out.
Code:
Triggerable event 'start timer'
If (bladiebladiebla)
Then - Set 'begin' to True
Daily event 'timer'
If 'begin'
Then -(
If 'compleet'
Then - remove script
Else - Set 'timer' to 'timer' + 1)
Daily event 'lose'
If 'begin' And 'timer' > 'x'
Then - Lose
Grah!
Who is online
Users browsing this forum: No registered users and 0 guests