[H4 EDITOR] troubleshooting

Maps and the art of mapmaking.
furret
Leprechaun
Leprechaun
Posts: 17
Joined: 11 Jul 2008

Unread postby furret » 11 Feb 2009, 23:17

Hello, it's me again (from the previous page).

After some brake I returned to my previous map and already advanced pretty much. I finished 2/5 of the campaign's maps and put a lot of effort in these two, with the plot (!), decoration and scripts (wait for it. It will be a blast!)
But after finishing those maps I encountered some very irritating problems that I'll be glad if you can help me with:
1. The AI. I have the HOMM4 reguler version (no expansion) and MAN, that computer is SO stupid! I'v been playing the advanced difficulty and he almost didn't do any effort to advance. I put mines around him, avarage monsters to fight with and treasures/power ups to obtain, but while he did treat some of those - he didn't touch the others. I gave the player only two heroes to begin with and no castle while I gave the computer a castle with dwellings, and still, when I got to him I was much stronger then him. He keep doing stupid things without any sense. In the second map he used all the resources I gave him to build ships in the docks (instead of evolving his town) but he didn't use this ships and never put any unit inside them to scout or gather any of the water resources I put around him. What sould I do? A patch? A script? Something in the expansion that I sould know?
2. Creatues strengh: Can I make it be permanent so the number of creatures won't be changed by the difficulty level?
3. When I put an event on an enemy character I can choose between "encountered", "defeated" and "victorious" but when I encounter this enemy in the game it doesn't refering to what I said it to do. For example: I put a script "display message" in the "encounered" category, but when I encountered the enemy it didn't display the message. Why?
4. I had a cool idea - in an island based map I put in one of the hero's timed event an event that take action every number of days that increase the army movment "because the wind is good in that day". But when I tried it I saw that there is no diffence. Again, why?
5. It seems I forgot how to import a new scenario into the campaign. I chose "new scenario" - type: campaign, called it A and the clicked "import" to the campaign I had but a message told me that: "'xxx' is not a single scenario file". What the hell?

Thank you very much for the help!

User avatar
wimfrits
Round Table Knight
Round Table Knight
Posts: 2047
Joined: 06 Jan 2006
Location: Utrecht, the Netherlands

Unread postby wimfrits » 12 Feb 2009, 18:47

1. There are several topics concerning AI manipulation. And some interesting AI tests were performed not so long ago with their results published on CH. Some mapmakers have published mapmaking tips on CH which I'm sure hold some tips concerning AI.
You should be able to find some of these things.

2. Yes; but not without scripting. The easiest way would be a timed-event repeating every day on e.g. a creature stack that shoud hold 65 elves:
Sequence:
TAKE CREATURES Elves 999
GIVE CREATURES Elves 64

This abuses the fact that a script can never take away all creatures; there always remains a minimum of 1.

3. Can be several reasons:
- the script should be placed on the HERO and not on the ARMY. If the script is placed on the army and army swapping occurs, the script will most likely be lost.
- the script ends with an REMOVE SCRIPT option and the enemy has had another encounter earlier; removing the script
- not all the 'only run when owner is' parameters are set properly
- ...

4. Pre-equilibris the movement script is flawed. I thought you needed to boost movement with something in the order of 500 to see an effect.
In equilibris I'm pretty sure the script was fixed.
Which results in the interesting problem that the script cannot function properly for both Equi and non-Equi players.

5. You can turn things around. Single scenarios can be added/imported into the campaign file.
Are you suggesting coconuts migrate?

furret
Leprechaun
Leprechaun
Posts: 17
Joined: 11 Jul 2008

Unread postby furret » 16 Feb 2009, 18:18

Thanks, Wimfrits, this is a great help for me!

1. I did look at other threads (like the sticky map making tricks) and I saw the basic script with the difficulty level (if gold(human)>4000: difficulty=4... etc) but as much as I searched there is no difficulty script in the scripts list.

2. Two problems: First: It require a lot of scripts so it'll make the scenario too heavy it might crash. Second: The monsters population won't increase each day. I think it isn't worth it. I preffer the risk that the players will take on the novice difficulty and have a too easy map or they take the champion difficulty and might stand a chance against the monsters...

3. I think it's the first option. Thanks!

4. Dammit... Then I'll forget about this idea... It's not too critical.

5. Got it fixed. Horray! :]

Now I only need to make the AI smarter... I read the article of Ururam Tururam where he wrote the fact about the "enable standard victory condition" and it's connection to AI difficulty. Anyway, I would be glad to use that "difficulty" script.

User avatar
wimfrits
Round Table Knight
Round Table Knight
Posts: 2047
Joined: 06 Jan 2006
Location: Utrecht, the Netherlands

Unread postby wimfrits » 17 Feb 2009, 16:55

furret wrote:but as much as I searched there is no difficulty script in the scripts list.
There's the scripting library on the CH page that holds a couple of useful tips. And I'm sure some mapmakers shared some tips in a news section but I didn't see it this time.
2. Two problems: First: It require a lot of scripts so it'll make the scenario too heavy it might crash. Second: The monsters population won't increase each day. I think it isn't worth it. I preffer the risk that the players will take on the novice difficulty and have a too easy map or they take the champion difficulty and might stand a chance against the monsters...
The first isn't that much of a problem. Continuous scripts drag down performance but normal timed events have little effect.
The second.. I thought you wanted to fix the amount of creatures? If the creatures should be fixed only on the first day and allow normal (difficulty dependant) growth you could run the script on the first day only.
Are you suggesting coconuts migrate?

User avatar
Mark_XXVI
Leprechaun
Leprechaun
Posts: 12
Joined: 29 Nov 2008

Unread postby Mark_XXVI » 02 May 2009, 03:22

I didn't really like the map that I previously made (and is now still up for testing on this site), so I'm getting started on another huge one.

Two questions:

a) Most of my maps are very story-oriented, and I would like it if I somehow forced all of my storyline heroes to be together in the same party. So does anyone know if I could create a condition like that?

b) Here's an interesting event I'd like to create: in a certain part of the map (Let's call this part 'Arena'), the player will have to fight a battle every day he spends in the place. So, here's my experimental condition for this to work:

In the Timed Events Section, create an event called "Arena_Battle," and make its subsequent occurences to be every day. For its scripting, set its condition to be "If Numerical Value 'Arena_Enemies' is set to 2, then current player will have to fight this (insert random) army." Then we'll have two placed Events, one right after and the other right before the entrance of the Arena. If the player steps on the placed event before the entrance, then set Arena_Enemies to another value. If player steps on the placed event after the Entrance, then Arena_Enemies will be set to 2.

So do you think this will work? Any answer (for both of the questions) will be appreciated.

User avatar
Thelonious
Round Table Knight
Round Table Knight
Posts: 1336
Joined: 06 Jan 2006
Location: right behind the next one

Unread postby Thelonious » 02 May 2009, 14:59

Mark_XXVI wrote:a) Most of my maps are very story-oriented, and I would like it if I somehow forced all of my storyline heroes to be together in the same party. So does anyone know if I could create a condition like that?
I think you can't as scripts on armies rarely work... you'd have to place an event on all the seperate heroes. Under continious events make a conditional event that requires the heroes to stick together (I wonder if you'd want the player to keep 'em together though; you take away lots of freedom)

As for your second question: it'll work that way > do remember that the timed event will have to trigger a triggerable event called (as an example) 'Battle' on the army.

And that's where a problem arises again: if a select group of your heroes could enter the arena while others have to battle. But again I figure a conditional action could check which heroes are inside the arena and could even determine the strength and/or type of creatures the heroes would fight. The biggest problem would be the placed event which would have to check which heroes are in and which are out of the arena. But it could work. Some way.
Grah!

User avatar
Mark_XXVI
Leprechaun
Leprechaun
Posts: 12
Joined: 29 Nov 2008

question

Unread postby Mark_XXVI » 29 Jun 2009, 03:49

Okay, this question is simple and I've seen it done countless times on scenarios I've played before:

When I make a certain hero step onto a specific Placed Event, I want to change a castle's owner to the colour of that hero's flag. How do I do so? Thanks.

User avatar
wimfrits
Round Table Knight
Round Table Knight
Posts: 2047
Joined: 06 Jan 2006
Location: Utrecht, the Netherlands

Unread postby wimfrits » 29 Jun 2009, 08:10

Create a triggerable event x on the town; Change owner to ..

The placed event would then be:
If army has hero .... then trigger custom event x
Are you suggesting coconuts migrate?

User avatar
jeff
Moderator
Moderator
Posts: 3741
Joined: 06 Jan 2006

Unread postby jeff » 29 Jun 2009, 15:45

Mark_XXVI wrote: a) Most of my maps are very story-oriented, and I would like it if I somehow forced all of my storyline heroes to be together in the same party. So does anyone know if I could create a condition like that?
The only way to force the player to put heroes in the same army is to create a loss condition when they travel separately. Now if the loss condition is too strong for you, you can create an event that punishes the player when they travel apart. In one of my maps I didn’t care you traveled with who but I did want them grouped and setup a condition where armies with single heroes where attacked periodically by armies of increasing strength. You could give a post combat message strongly hinting at grouping the heroes, and if they fail to do so then one last event with the loss condition. In your case specify which heroes you want to traveled together and if not they are attacked.
Mala Ipsa Nova :bugsquash:

User avatar
Grumpy Old Wizard
Round Table Knight
Round Table Knight
Posts: 2205
Joined: 06 Jan 2006
Location: Tower Grump

Unread postby Grumpy Old Wizard » 30 Jun 2009, 04:23

In "The Dancing Crusader" I put gates where both main heroes (Elkron and Worm) had to be together to pass. Sometimes they even had to have a third heroe or a specific artifact.

I also gave certain perks for keeping the heroes together. You can do this with scripts placed on each heroe you want to be in the group. You can also use scripts on the heroes to make a heroe give for example an attack bonus to the army when a certain creature type is present in the heroe's army.

You could do something like have a unicorn (or whatever) have a chance to join the army every day your main heroes are together or give the army a movement bonus when they are together. Lots of ways to add "perks" that encourage the player to keep the heroes together rather than penalizing them for not doing so.

Click here for my HOMM4 maps
Frodo: "I wish the ring had never come to me. I wish none of this had happened."
Gandalf: "So do all who live to see such times but that is not for them to decide. All we have to decide is what to do with the time that is given to us."

User avatar
wimfrits
Round Table Knight
Round Table Knight
Posts: 2047
Joined: 06 Jan 2006
Location: Utrecht, the Netherlands

Unread postby wimfrits » 30 Jun 2009, 14:08

Grumpy Old Wizard wrote:Lots of ways to add "perks" that encourage the player to keep the heroes together rather than penalizing them for not doing so.
I can't think of many :)
Seriously; the perk boon should double the individual hero's effectiveness to convince me of keeping heroes together. And a boon of that size will not fit most stories and will probably wreck game balance completely.

So I think the only way to encourage keeping heroes together (aside from having a map with a single linear path) is penalizing them for not doing so. A 'gentle' penalty system is not only very hard to implement but may also have little effect as Jeff will confirm ;)

If you absolutely do not allow splitting of story heroes, then imo the only valid option is a strict system. Checking at the start of each turn:
First day of splitting: warning.
Second day: loss.

(and even then; players will try to maximize turn effectiveness by splitting heroes during a turn)
Are you suggesting coconuts migrate?

User avatar
jeff
Moderator
Moderator
Posts: 3741
Joined: 06 Jan 2006

Unread postby jeff » 30 Jun 2009, 15:50

wimfrits wrote:So I think the only way to encourage keeping heroes together (aside from having a map with a single linear path) is penalizing them for not doing so. A 'gentle' penalty system is not only very hard to implement but may also have little effect as Jeff will confirm ;)
You're right, if a player is insistent about traveling separately there is really nothing you can do. Which is why I used a combination of penalty and gates requiring specific combinations of heroes being present. In the end I still had to write two or more text conversations accounting for the different hero possibilities. This is why a 6 map campaign in which a persons may have about 100 pages of text (a little over 15/map) to read takes about 600 pages to write. :sweat:
Mala Ipsa Nova :bugsquash:

User avatar
Mark_XXVI
Leprechaun
Leprechaun
Posts: 12
Joined: 29 Nov 2008

Unread postby Mark_XXVI » 26 Sep 2009, 03:01

I have another question....

I'd like to create a scripted dwelling via a quest hut, but I want it to function more like a normal dwelling. When I usually create a quest hut meant to sell creatures, you can buy as many as you want as long as you have enough resources. However, I want to make it so that you can buy only a certain number of creatures from that quest hut in a specified time frame. For example, one who visits this quest hut may only buy 1 Black Dragon per month from it. How do you do that?

User avatar
wimfrits
Round Table Knight
Round Table Knight
Posts: 2047
Joined: 06 Jan 2006
Location: Utrecht, the Netherlands

Unread postby wimfrits » 26 Sep 2009, 10:46

Instead of explaining, it's probably better to look at an example of this in other maps. I know that Around the Calendar by UT has a quest hut like that. And I thought the H4 script library at CH has a sea monster merchant that you can modify to fit your demands.

Now that I think about it, my campaign A Wind of Thorns has a time-dependant dwarf merchant around the centre of the underground section of the third map.
Are you suggesting coconuts migrate?

User avatar
Hippotaur
Leprechaun
Leprechaun
Posts: 14
Joined: 07 Nov 2009
Location: San Francsico, California
Contact:

Map is "Bad"

Unread postby Hippotaur » 17 Nov 2009, 01:51

I spent an entire summer creating a HOMM IV Gathering Storm extra-large two-level map...but when I run it the game says "Mapname is bad."

(Of course I was stupid enough when making it to not to "save as" as I was going along...so there's no way to revert to an earlier version.)

I had such high hopes when I read in this forum that there was just such an error message that appeared when the Emerald Bow was used on a map...I loaded the appropriate patches from this site and...it's still bad. :(

I consider this map to be a masterpiece, and would like to recreate it. But before doing so, do any of you know what might have caused it to become "bad"? I have a list of possible suspects:

•Is there a limit to how many monsters can be placed on a map? Could too many make it bad? (There are some areas that are chock-full of 'em)

•Are there other artifacts that may make the map "bad"? I'm pretty sure that I used all of them on this map somewhere or another.

•Could the coding in a quest hut possibly cause this? I noticed when coding that if there were more than about 15 lines of code in a single condition or other function other than a sequence and said condition/function could not display all the lines within the dialogue box's window, then the editor would crash or display the code as gibberish. Sometimes though it wouldn't crash. Possibly could one of these sorts of mal-coded quest huts be making the map bad?

•Any other ideas why it became bad?

Any help would be most appreciated!

User avatar
Pol
Admin
Admin
Posts: 10057
Joined: 29 Nov 2005
Location: IN SOMNIS VERITAS
Contact:

Unread postby Pol » 17 Nov 2009, 10:53

Never heard that. Foremost you will need to judge if message is at least slightly relevant or a completely ridiculous.

My experience is that sometime indeed helps to remove object/script which is causing a problem. A required condition is to know which one it could be or at least be driven by some inner suspicions. I think "scripts" could be a causator.

Also B.A.D could be knowing something about it and he isn't the only, we are full of profs - if they will come here to see it. :D
"We made it!"
The Archives | Collection of H3&WoG files | Older albeit still useful | CH Downloads
PC Specs: A10-7850K, FM2A88X+K, 16GB-1600, SSD-MLC-G3, 1TB-HDD-G3, MAYA44, SP10 500W Be Quiet

User avatar
Hippotaur
Leprechaun
Leprechaun
Posts: 14
Joined: 07 Nov 2009
Location: San Francsico, California
Contact:

Unread postby Hippotaur » 18 Nov 2009, 07:14

Well, the "Filename is Bad" message is critically serious - the game can not even be run after it says that.

At least from the Utility I found here I will be able to copy the drawn part of the map if I don't get a solution here on what might be causing the message.

Then I can re-create the map...and I learned my lesson from this and make lots of backup versions as I go now. So as I place the scripted things back on the map, I will have to run it and test to see if any cause the message again.

With my luck it will be one of the last things I put back on the recreated map when I find it... ;|
"Well, we did do the nose."

furret
Leprechaun
Leprechaun
Posts: 17
Joined: 11 Jul 2008

Unread postby furret » 28 Jun 2010, 21:56

Hello, it's me again from page 4. ^^;

I tried Rakne Fne's AI attack tool to make the AI more aggresive (the one with adding 2000 black dragons to enemy hero and then taking them away when he encounter human player) but it didn't work. Also - more weird things occured...

THis what I'v done:

1. In the Map properties, I put a time event, starting from day 1 and every day along: if current player is purple (human) trigger costume event "Hero1", 2, 3 etc...

2. In the AI HERO (not army), I put a time event (again, that works from day 1 and on): give 2000 black dragons. I put a triggerable event called "Hero1": takes 2000 dragons. So now this buddy suppose to have in each turn 2k dragons on the begining of the turn, and zero dragons on the end of it. Also, I put a standard encounter event: If opposing hero is purple (human) - take 2k dragons from this army.

Now my AI opponent was suppose to be aggresive and attack me all the time, but instead he keeps evading me as always, and also - the weird part - his heroes get's stucked all the time... I mean, they just freeze, always in the enterance of an advanture object, and do nothing for a couple of turns...

What did I do wrong, and how do I fix it?

*Edit: I just tested it the scripts another way: I started as the orange army that supposed to be the AI. Now I saw for sure that I'm starting with 2k dragons. Also - when I attacked the purple (a.k.a human) army, the dragons were gone... But there was another problam - my dragons wasn't taken in the end of the turn by the time event. I don't know why. I duplicated the scripts one to one (exept for the numbers and the names). Also, when I tested the map earlier I didn't see any dragon in the opponent hand, and if it was like now, I was suppose to see millions of dragons.

Please help me. :(

User avatar
jeff
Moderator
Moderator
Posts: 3741
Joined: 06 Jan 2006

Unread postby jeff » 28 Jun 2010, 23:31

I am not sure how you are taking the dragons at the end of the turn, as there is no way to have a timed event execute at the end of a turn. You could have a triggered event that executes at the beginning of the next color’s turn. However the best would probably is to give all AI heroes the dragons immediately at the beginning of the A turn immediately after the human’s turn and then take all the dragons at the beginning the human’s next turn. I would only use triggered events to both give and take the dragons; they are easy to control and are reliable. Remember the army will need an empty slot to acquire the dragons and if they hand them off, either giving to another hero (the receiving hero could then have 4K+ dragons) so I would write the take away script as take 9999 dragons. The AI may also split them off independently then you will have a powerful AI army no longer under your event control.
Mala Ipsa Nova :bugsquash:

furret
Leprechaun
Leprechaun
Posts: 17
Joined: 11 Jul 2008

Unread postby furret » 28 Jun 2010, 23:51

^ You know, I WISH the computer was smart enough to even think of splitting the army.

The problam fixed. I don't know why, but I switched the time event from "if player is purple" to "if player is human". So now that part works - I have an ememy with 2k dragons in his turn, and none in mine. I think the idea you just wrote is the one I'm using now... Anywat, it works. BUT...
The AI is still ultramega stupid, for god sake! Not only this, but he also don't make any effort to attack me, unless I'm right next to him. I made him much quicker, much stronger, and with great lengh of sight, but he still playing around. It is less challanger from the neutral creature! Maybe it's because I canceled the standard victory. My heroes don't have a town so it doesn't bother... This sucks so much.

And another weird problam - the freezing I mentioned before didn't stop. AI stand by an advanture object and just freeze for 5 or so turns. What the hell?

*edit: Another question, this time about Change Owner script: I know how to change owner from none to certain color, but can I make it work backwords or to another color without the game getting crashed?


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 3 guests