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 > MapHaven Guild > Thread: Heroes 5 Map Editor Help and Tips...
Thread: Heroes 5 Map Editor Help and Tips... This thread is 43 pages long: 1 ... 4 5 6 7 8 ... 10 20 30 40 43 · «PREV / NEXT»
xerius
xerius

Tavern Dweller
posted July 04, 2008 11:47 PM

Quote:
@ Xerius -- Take a look at the Map Properites, Teams. Make sure that Teams is checked. Then set the teams correctly, even if one or more teams has only one player, or they all do that's OK.

If that doesn't fix the problem, go to the Players properties and reset each one to the values you desire. Do them all one at a time.


THANKS YOU! it works now.

its good that people like you exist hehe.

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


Promising
Legendary Hero
fallen artist
posted July 06, 2008 01:26 PM
Edited by Warmonger at 13:28, 06 Jul 2008.

Well, no progress in my scripting



final script looks as follows:
Quote:
function everyday ()
supergate ();
end;
Trigger (NEW_DAY_TRIGGER, "everyday");

function supergate ()
 AddObjectCreatures(Supergate, CREATURE_FIRE_ELEMENTAL, GetDate(WEEK));
 AddObjectCreatures(Supergate, CREATURE_WATER_ELEMENTAL, GetDate(WEEK));
 AddObjectCreatures(Supergate, CREATURE_AIR_ELEMENTAL,GetDate(WEEK));
 AddObjectCreatures(Supergate, CREATURE_EARTH_ELEMENTAL,GetDate(WEEK));
 AddObjectCreatures(Supergate, CREATURE_PHOENIX, GetDate(MONTH));
end;


Doesn't work so far :/

I also tried enabling console. According to the guide, I editet Input_a2 file and binded ` to open console, but the rest of it is beyond my understanding.

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


Known Hero
Wyld Mapper
posted July 06, 2008 04:32 PM
Edited by rdeford at 16:49, 06 Jul 2008.

Quote:
Well, no progress in my scripting


Doesn't work so far :/

I also tried enabling console. According to the guide, I editet Input_a2 file and binded ` to open console, but the rest of it is beyond my understanding.


OK, well I created a test map and copy/pasted your script into it. I ran it in the game and looked at the console. It had 2 error messages. The first said something about "getting a nil value for the global variable Supergate."  The second one said something about "wrong type of argument, argument 1, for AddObjectCreatures."

The bug fix was simple. All I did was put quotation marks around the word Supergate so that the compiler would know it is the name of an object, not the name of a variable. Here is the corrected script:

-------------------------------------------
function everyday ()
supergate ();
end;
Trigger (NEW_DAY_TRIGGER, "everyday");

function supergate ()
AddObjectCreatures("Supergate", CREATURE_FIRE_ELEMENTAL, GetDate(WEEK));
AddObjectCreatures("Supergate", CREATURE_WATER_ELEMENTAL, GetDate(WEEK));
AddObjectCreatures("Supergate", CREATURE_AIR_ELEMENTAL,GetDate(WEEK));
AddObjectCreatures("Supergate", CREATURE_EARTH_ELEMENTAL,GetDate(WEEK));
AddObjectCreatures("Supergate", CREATURE_PHOENIX, GetDate(MONTH));
end;

---------------------------------------------

As for enabling the console, I apologize if the instructions in the guide are not clearly written. I will try to help by giving more words here.

Basically, you have to edit two files.

The first file is the autoexec_a2.cfg file in the Ubisoft installation directory. The exact location of this file varies according to the choices you made when installing the game. I used the defaults and this is the path on my computer:

C:\Program Files\Ubisoft\Heroes of Might and Magic V - Tribes of the East\profiles\autoexec_a2.cfg

You open this file with a simple text editor and add this new line as the last line. The password is Russian, so don't try to understand it. You must type the text exactly as shown (or copy/paste from here):

setvar dev_console_password = schwinge-des-todes

The second file is the one you already edited. It is the input_a2.cfg file you already edited. Again, type it without errors or copy it from here:

bind show_console '`'

As long as you didn't make any typos, and you open the game and change to the same profile as you edited, the console will open when you press the "'" key.

I hope all this helps. Writing H5 scripts is not an easy thing to do. I think you are doing quite well so far. Once you get past these initial obstacles, you are going to be a whiz. I am looking forward to playing your first map, in fact I'll volunteer to be your beta tester. All I ask is that you do through alpha play testing before you send it to me.

If you need it, I can send you a normal email message with my test map attached. And, I can send you a copy of my autoexec_a2.cfg file as well. Send me a message to rdeford@dragonfarm.us and ask for the files.



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


Promising
Legendary Hero
fallen artist
posted July 06, 2008 05:38 PM
Edited by Warmonger at 18:12, 06 Jul 2008.

Quote:
The password is Russian

In German actually. Means something like "sudden death" I suppose.

Apart from that, everything works fine.
Now I wonder how to make a loop so the number of garrisson could be changed.

EDIT: So far I got this. Doesn't work, but console shows no error

Quote:
function debuggate ()
for i = 1, 2 do
AddObjectCreatures('"Supergate"GetGameVar(i)', CREATURE_FIRE_ELEMENTAL, GetDate(WEEK));
AddObjectCreatures('"Supergate"GetGameVar(i'), CREATURE_WATER_ELEMENTAL, GetDate(WEEK));
AddObjectCreatures('"Supergate"GetGameVar(i)', CREATURE_AIR_ELEMENTAL,GetDate(WEEK));
AddObjectCreatures('"Supergate"GetGameVar(i)', CREATURE_EARTH_ELEMENTAL,GetDate(WEEK));
AddObjectCreatures('"Supergate"GetGameVar(i)', CREATURE_PHOENIX, GetDate(MONTH));
   end;
end;

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


Known Hero
Wyld Mapper
posted July 06, 2008 09:14 PM

Quote:
Quote:
The password is Russian

In German actually. Means something like "sudden death" I suppose.

Apart from that, everything works fine.
Now I wonder how to make a loop so the number of garrisson could be changed.

EDIT: So far I got this. Doesn't work, but console shows no error

Quote:
function debuggate ()
for i = 1, 2 do
AddObjectCreatures('"Supergate"GetGameVar(i)', CREATURE_FIRE_ELEMENTAL, GetDate(WEEK));
AddObjectCreatures('"Supergate"GetGameVar(i'), CREATURE_WATER_ELEMENTAL, GetDate(WEEK));
AddObjectCreatures('"Supergate"GetGameVar(i)', CREATURE_AIR_ELEMENTAL,GetDate(WEEK));
AddObjectCreatures('"Supergate"GetGameVar(i)', CREATURE_EARTH_ELEMENTAL,GetDate(WEEK));
AddObjectCreatures('"Supergate"GetGameVar(i)', CREATURE_PHOENIX, GetDate(MONTH));
   end;
end;



You really are doing quite well.

First, I trust that you adopted a naming convention for your garrisons such that you have Supergate1, Supergate2, and so forth.

Second, it is entirely possible to write compiler-certified, error-free code that still doesn't do what you desire.

Third, the GetGameVar() is used in conjunction with the SetGameVar() function to create and use a very special type of variable that you use only for passing values between two different script files. I don't think you will ever need to use it.

Fourth, in a for loop, the index variable, i in this case, is used like an ordinary local variable. So, to get its value you simply have to use the letter i in the code like you would any other variable.

Fifth, in order to create a text string that changes for each pass through the loop, you need to use the Lua concatenation operator which is .. (dot-dot) to join the value of the loop index onto the end of the text string. (The concatenation operator is smart enough to convert the number into text when you join a numeric value onto a text string.) Consequently, your line should look something like this:

AddObjectCreatures("Supergate"..i, CREATURE_FIRE_ELEMENTAL, GetDate(WEEK));

My test script worked fine and it looks like this:

function supergate()
for i=1,2 do
AddObjectCreatures("Supergate"..i, CREATURE_FIRE_ELEMENTAL, GetDate(WEEK));
AddObjectCreatures("Supergate"..i, CREATURE_WATER_ELEMENTAL, GetDate(WEEK));
AddObjectCreatures("Supergate"..i, CREATURE_AIR_ELEMENTAL,GetDate(WEEK));
AddObjectCreatures("Supergate"..i, CREATURE_EARTH_ELEMENTAL,GetDate(WEEK));
AddObjectCreatures("Supergate"..i, CREATURE_PHOENIX, GetDate(MONTH));
end;
end;


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


Promising
Legendary Hero
fallen artist
posted July 06, 2008 10:07 PM
Edited by Warmonger at 22:07, 06 Jul 2008.

Works! However, it triggers only from day 2.

Will let you know as soon as the map becomes playable.

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


Known Hero
Wyld Mapper
posted July 07, 2008 03:02 AM

Quote:
Works! However, it triggers only from day 2.

Will let you know as soon as the map becomes playable.


Sounds good to me.


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


Promising
Legendary Hero
fallen artist
posted July 08, 2008 02:05 PM

Ok, I tried to create my own script. Quite annyoing as garrisson peasants don't give gold and I could find no simple "give resource" function to do that. So:

Quote:
function peasanttax()
if GetCurrentPlayer ~= 0 then
   SetPlayerResource (GetCurrentPlayer(), GOLD, GetPlayerResource(GetCurrentPlayer(),GOLD)+GetObjectCreatures(Peasantgate, CREATURE_PEASANT));
   end;
end;

Triggers daily

Does it make any sense?

By the way the map is already avaliable in here:
Clicky

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


Known Hero
Wyld Mapper
posted July 08, 2008 02:40 PM
Edited by rdeford at 14:44, 08 Jul 2008.

Quote:
Ok, I tried to create my own script. Quite annyoing as garrisson peasants don't give gold and I could find no simple "give resource" function to do that. So:

Quote:
function peasanttax()
if GetCurrentPlayer ~= 0 then
   SetPlayerResource (GetCurrentPlayer(), GOLD, GetPlayerResource(GetCurrentPlayer(),GOLD)+GetObjectCreatures(Peasantgate, CREATURE_PEASANT));
   end;
end;

Triggers daily

Does it make any sense?

By the way the map is already avaliable in here:
Clicky


I cut and pasted your function into my test map and I got a error on the console when I let the daily trigger occur. The error indicated that GetObjectCreatures() got a null value for the Pesantgate variable. Since Pesantgate is an object's script name, not a variable, I realized instantly what the trouble was.

The fix was simple. I merely enclosed Pesantgate in quotes and your function worked great.

This is nice work actually. You must be a programmer by profession or hobby, eh?

I will wait until you finish the script before looking at or playing the map. I like to experience the joy of exploration without peeking at the maps in the editor.


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


Promising
Legendary Hero
fallen artist
posted July 08, 2008 02:52 PM
Edited by Warmonger at 14:57, 08 Jul 2008.

At the moment the map should be fully playable and free of errors, however it is not finished yet - more zones and stuff could be added.
Though would like to hear some opinion before flooding it with even more objects.

And yes, I'm applying for the computer engineering studies this year. This map is my first serious project

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


Known Hero
Wyld Mapper
posted July 08, 2008 03:47 PM

Quote:
At the moment the map should be fully playable and free of errors, however it is not finished yet - more zones and stuff could be added.
Though would like to hear some opinion before flooding it with even more objects.

And yes, I'm applying for the computer engineering studies this year. This map is my first serious project


OK, I just downloaded it and I will give it a look. I'll get back to you in a while.

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

Tavern Dweller
posted July 10, 2008 12:11 AM

I'm back .  Thanks to the great advice of rdeford my map is much better than before.  I just have one rather odd request however.  I have the destroyed Haven town on my map.  I'd like to make a function where if my hero walks into "region" with "certain resources" I can convert the destroyed Haven town into a normal functioning town.  Does anyone know if thats possible?

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


Known Hero
Wyld Mapper
posted July 10, 2008 02:26 AM
Edited by rdeford at 03:10, 10 Jul 2008.

Quote:
I'm back .  Thanks to the great advice of rdeford my map is much better than before.  I just have one rather odd request however.  I have the destroyed Haven town on my map.  I'd like to make a function where if my hero walks into "region" with "certain resources" I can convert the destroyed Haven town into a normal functioning town.  Does anyone know if thats possible?


Well, as you no doubt found out, the script function TransformTown() does not seem to recognize the destroyed Heaven town as a town object and refuses to transform it.

I can think of two approaches. (I haven't tried these approaches, just suggesting two ways the problem might be solved.)

Approach #1

Make an small area that the players will never see. For example, make it in a far corner behind some mountains, or make a small underground chamber with no entrance and far away from other underground chambers. Place a Neutral town in this area. Set the value of the isRemovable property of both the destroyed town and the Neutral town to true. Then, when you wish to transform the destroyed town, use the RemoveObject() function to remove it from the map. Then, use the SetObjectPosition() function to move the Neutral town into the spot that was occupied by the destroyed Heaven town. Then use the SetObjectOwner() function to set the owner of the Neutral town to the correct player. If you hide the Neutral town underground just remember to set the floor ID correctly in the SetObjectPosition() function.

Approach #2

Make a custom object out of a normal town that has the skin of the destroyed town. Then you can use the TransformTown()function on it. Just be sure to make the custom object correctly so it doesn't contaminate other objects and other maps. See this posting for directions: http://www.celestialheavens.com/forums/viewtopic.php?t=8751  Also, see the posting by Grumpy Old Wizard on how to change the look of an object. (Do a search to find it on CH as I forget where it is.) EDIT: I forgot to mention that you might wish to disable the custom destroyed town so player cannot interact with it. Then, enable it after the transformation.


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

Tavern Dweller
posted July 10, 2008 03:37 AM
Edited by Rerhero at 04:52, 10 Jul 2008.

I'm going to go with idea number one.  I'll let you know how it turns out.

Edit: Considering I'm still getting used to scripting, I'll probably screw this up somehow. Hahaha. If you don't mind >_< could you come up with a "tutorial" function that I could copy and add the correct variables into for this?  O and also, what do I use for the resource bringing part? (I bet if I do research I could find this, but I'm lazy and you seem to be very knowledgeable about this lol)

2nd Edit: My apologies if this makes me sound like I'm so lazy that I'm going to make you do all the hard work. Just excited about getting this map to be AWESOME xD (like I'm sure many of yours are)

3rd Edit: >_< O noes! I didn't put an underground on this map, so now do I 1) Have to completely restart? 2) Anyway for me to add underground? 3) Anyway to "addObject" the castle I want to the map? 4) Stab myself and give up xD

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


Famous Hero
Overlord of Tililea
posted July 15, 2008 12:50 PM

Hi. I just started trying to use map edittor. The TotE one more specificly. Why will it not let me place artis on my map?!
____________
Forgive my spelling!:<                  

[URL=http://www.ff-fan.com/chartest]Which Final Fantasy Characte... too long to display...

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


Known Hero
Wyld Mapper
posted July 15, 2008 05:00 PM
Edited by rdeford at 17:15, 15 Jul 2008.

Quote:
I'm going to go with idea number one.  I'll let you know how it turns out.

Edit: Considering I'm still getting used to scripting, I'll probably screw this up somehow. Hahaha. If you don't mind >_< could you come up with a "tutorial" function that I could copy and add the correct variables into for this?  O and also, what do I use for the resource bringing part? (I bet if I do research I could find this, but I'm lazy and you seem to be very knowledgeable about this lol)

2nd Edit: My apologies if this makes me sound like I'm so lazy that I'm going to make you do all the hard work. Just excited about getting this map to be AWESOME xD (like I'm sure many of yours are)

3rd Edit: >_< O noes! I didn't put an underground on this map, so now do I 1) Have to completely restart? 2) Anyway for me to add underground? 3) Anyway to "addObject" the castle I want to the map? 4) Stab myself and give up xD


OK RerHero--

Regarding adding an underground: Simply open the Map Properties window, click the General Map Properties tab, then put a check mark in the Has Underground Level. This process will add an underground level to your map. You will still have to put in the tunnels, caverns, lights, etc. though.

Regarding adding a castle: Place it on the map with the editor with the Neutral as the owner. You cannot place a castle onto the map during the game play with the script, but you can move a castles (and just about any other object) around on the map.

Regarding checking for resources: You are going to have to use the Lua programing language if statement. Here is an example from a H6 scripting tutorial I am authoring that checks for the presence of an artifact:

function scareCrowGreeting(heroName)
if HasArtefact(heroName, ARTIFACT_HELM_OF_ENLIGHTMENT) then
RemoveArtefact(heroName, ARTIFACT_HELM_OF_ENLIGHTMENT);
RemoveObject("ScareCrow");
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"ScareCrow", nil);
 else
MessageBox(path.."ScareCrowGreeting.txt");
end;
end;
 Trigger(REGION_ENTER_AND_STOP_TRIGGER,"ScareCrow", "scareCrowGreeting");


You can look through the Script_Functions.pdf guide that came with the game to find functions that will check for resources, war machines, army creatures, etc. For example:  GetPlayerResource()

Regarding a tutorial function: I am about ten days away from having my H5 Scripting Tutorial ready for a test run by a beta tester. If you are interested, I can send you a copy of the tutorial. The only catch is that I ask that you actually go through it and do each of the lessons, then write a report detailing the problems you had. Also, I am interested in suggestions for improvements.

I am sorry I took so long to answer this question. For some reason I wasn't advised the forum's auto mailer that you had posted a question. In the future, if you don't get a timely response from me in the forum, send me a personal email message.

Use, rdeford@dragonfarm.us as the address for personal messages and to state your interest in beta testing the tutorial.

If you wish to play my maps, and study/copy their scripting for your own use, you can download them from:

http://www.maps4heroes.com/heroes5/maps.php?keywords=rdefor&type=&size=&sort=2

or

http://www.celestialheavens.com/search2.php?map_name=&author_name=rdeford&size=&nr_players=&playing_type=&version=&sort_by=map_name&order=asc&multiplayer=&month=&year=&minimaps=on&results1=20&page=1&action=search&submit=Search







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


Promising
Legendary Hero
fallen artist
posted July 15, 2008 05:08 PM

I came to the point where no further progress is possible without some serious quest scripting. I'd be very thankful for this manual, will wait till it's finished.

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


Known Hero
Wyld Mapper
posted July 15, 2008 05:13 PM

Quote:
Hi. I just started trying to use map edittor. The TotE one more specificly. Why will it not let me place artis on my map?!


If you've placed other objects on the map such as tress, rocks, heroes, mountains, etc., the process is the same. Just click on an artifact in the tools panel, click on the map surface in an area that is not occupied by another object, keep clicking in different areas until you have placed as many copies of the object as desired, then press the ESC key to clear the selection so you can select a different object.

If this process doesn't work, then you may have a corrupted map file. Delete it from the Maps folder and create a new map. If this step doesn't fix the problem, you may have a bad game install. Remove the H5 game and re-install the game.


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


Known Hero
Wyld Mapper
posted July 15, 2008 05:27 PM

Quote:
I came to the point where no further progress is possible without some serious quest scripting. I'd be very thankful for this manual, will wait till it's finished.


The H5 Scripting Tutorial will be posted for downloading on the Celestial Heavens download page. It might take three or four weeks. In the meantime, if you have not already done so, download the The Basics of Heroes V Scripting ver. 2.0 for H5, HOF, & ToTE from the Celestial Heavens download page and read it.

http://www.celestialheavens.com/viewpage.php?id=567

While it is not a tutorial, it is does make a great reference guide.

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


Famous Hero
Overlord of Tililea
posted July 18, 2008 06:10 PM

Hi again. I descovered what the problem was back then with the artifacts - i was triyng to put that thing in a tile with coordinates 0:41 or somth. But now I have another question - how do I set my maps max hero level cap and rumours?
____________
Forgive my spelling!:<                  

[URL=http://www.ff-fan.com/chartest]Which Final Fantasy Characte... too long to display...

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 43 pages long: 1 ... 4 5 6 7 8 ... 10 20 30 40 43 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1592 seconds