|
Thread: Heroes 5 Map Editor Help and Tips... | This thread is pages long: 1 ... 5 6 7 8 9 ... 10 20 30 40 43 · «PREV / NEXT» |
|
rdeford
Known Hero
Wyld Mapper
|
posted July 18, 2008 06:42 PM |
|
|
Quote: 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?
While in the Editor, View/Map Properties/General Map Properties.
--Set the Restrict Hero Level field value by typing in a number.
--Click the Rumors tab. Click Add to add a rumor. Repeat as required.
|
|
Serpent2
Famous Hero
Overlord of Tililea
|
posted July 19, 2008 11:58 AM |
|
|
Thnx.
____________
Forgive my spelling!:<
[URL=http://www.ff-fan.com/chartest]Which Final Fantasy Characte... too long to display...
|
|
del_diablo
Legendary Hero
Manifest
|
posted July 19, 2008 03:24 PM |
|
|
How the heck do i add water on a global level? HELP!
____________
|
|
rdeford
Known Hero
Wyld Mapper
|
posted July 19, 2008 06:00 PM |
|
|
Quote: How the heck do i add water on a global level? HELP!
View the Tools Panel. Click the Tiles tab. Click the Lower button. Select any of the tool sizes. Click, or click-hold-drag, on the map land area. You will get water. Leave islands as you desire. All the shores you create will be un-passable. Use the Ramp tool to create water enter/exit places.
|
|
rdeford
Known Hero
Wyld Mapper
|
posted July 25, 2008 04:07 PM |
|
|
Quote: I'm really sorry if this is a stupid question, but it's been driving me crazy.
Whenever I have made a custom multiplayer map and selected teams in the map properties, the editor cancels it after I say "ok". This is also true on other multiplayer maps where I have tried to add teams. I have tried everything: all other changes are saved, but "teams" is unchecked. I simply don't understand what's wrong: all 4 players have assigned random towns and heroes and are computer and human playable, and the story is the same on every different map I load. Is it a Vista problem?
Please Help!
No, it is not a stupid question. I have had this same problem on my earlier maps. It doesn't happen now, but I am not exactly sure what I am doing differently. My advice is: Make sure you have the entire team setup done correctly. In other words, check the teams check box. Then select the number of teams you desire to have. Then select the team assignments for each player so that it is on a team. NOTE: Having 4 teams with only one player on each team works fine. Close the Map Properties window. Make some trivial change on the map like move a rock one square and back again. Then, do a SAVE. Open the Map Properties window and look at the teams again. If they are still set up, then close the map editor. Then open the map again in the editor. The teams should still be set up.
Oh, and I don't have Vista. Ubisoft says that H5 is not guaranteed to be 100% compatible with Vista, but I don't think that Vista is causing your problem.
____________
-------------
Mage of Soquim
|
|
Sorceresss
Tavern Dweller
Witch
|
posted July 27, 2008 05:03 PM |
|
|
King Mausoleum Scripting
I've been editing maps for 2 years ... but I've never used any scripting. I've read all the .pdf documentation that comes with the game, but it doesn't offer any scripting tutorial.
For now, I would be happy if someone showed me, in detail, how to give the King's Mausoleum an effective touch script, so that if a hero touches the structure, something can happen.
I went into a KM's properties tree, and the structure doesn't even have a name! If I left-click or right-click on the name line, I do not get any option to confer a name -- which is vital for scripting.
Q1 > How do I grant to a particular structure a specific name that will be used in the script editor?
Q2 > Once named, what would I have to write, in the script editor, to grant to that KM a touch-script functionality?
What I ideally need is a specific, detailed example I could imitate (not general, abstract instructions).
I will certainly read the Scripting Tutorial when it is published. I'm new to this website, so I don't know if a Scripting Guide is already available.
Thanks!
|
|
rdeford
Known Hero
Wyld Mapper
|
posted July 27, 2008 05:51 PM |
|
Edited by rdeford at 18:35, 27 Jul 2008.
|
Quote: I've been editing maps for 2 years ... but I've never used any scripting. I've read all the .pdf documentation that comes with the game, but it doesn't offer any scripting tutorial.
For now, I would be happy if someone showed me, in detail, how to give the King's Mausoleum an effective touch script, so that if a hero touches the structure, something can happen.
I went into a KM's properties tree, and the structure doesn't even have a name! If I left-click or right-click on the name line, I do not get any option to confer a name -- which is vital for scripting.
Q1 > How do I grant to a particular structure a specific name that will be used in the script editor?
Q2 > Once named, what would I have to write, in the script editor, to grant to that KM a touch-script functionality?
What I ideally need is a specific, detailed example I could imitate (not general, abstract instructions).
I will certainly read the Scripting Tutorial when it is published. I'm new to this website, so I don't know if a Scripting Guide is already available.
Thanks!
Greetings Sorceress!
It is nearly impossible to learn H5 scripting without reading the The Basics of Heroes V Scripting ver. 2.0 for H5, HOF, & ToTE
You can download this guide from here:
http://www.celestialheavens.com/viewpage.php?id=567
My tutorial is intended to be a companion to this guide. I have just finished the rough draft of the H5 Scripting Tutorial and it will be ready for beta testing by an outside party in about five or six days. If you would like to help me, just send me your email address and I will send you a beta copy of the tutorial. It has a nice, clearly written lesson that covers how to give an object a scripting name. Briefly, you go into the object's properties list, and select the Name property. Then, you click in the field for that property that is actually over under the Value column but invisible until you click where it should be. You will suddenly see a blank field. Then, you simply type a scripting name for the object in that field.
Once you've done that, you will delighted to know that I do a quest with the King's Mausoleum in my map named: Jackdaw Jake. It is a good idea to download that map and study the script. I am going go copy and paste the function definitions from the script that make up that quest below. However, without seeing it in context, and without reading the scripting guide it might be difficult to understand. Here it is:
--=======================================
-- King's Tomb quest
--=======================================
function kingsTombAct(heroName)
if kingsTombVisited == 0 and HasArtefact(heroName, ARTIFACT_TAROT_DECK) then
-- greet Jake and give him the quest
Play2DSound( "/Sounds/_(Sound)/Spells/Hypnotize.xdb#xpointer(/Sound)");
PlayVisualEffect( "/Effects/_(Effect)/Spells/Dispel.xdb#xpointer(/Effect)", "kingsTomb");
ShowFlyingSign(path.."keyAccepted.txt", "kingsTomb", PLAYER_1, 12);
sleep(20);
MessageBox(path.."kingsTombFirstGreeting.txt");
SetObjectiveState("kingsCrown", OBJECTIVE_ACTIVE, PLAYER_1);
-- start night attacks. See dawn()
kingsTombVisited = 1;
kingsTombWeek = GetDate(WEEK);
kingsTombDay = GetDate(DAY_OF_WEEK);
-- give a few points for accepting quest
Play2DSound( "/Sounds/_(Sound)/Interface/Ingame/Tutorial.xdb#xpointer(/Sound)");
ShowFlyingSign(path.."points3.txt", jake, PLAYER_1, 12);
points = points + 3;
if points >= pointsGoal then
SetObjectiveState("getPoints", OBJECTIVE_COMPLETED, PLAYER_1);
end;
end;
if kingsTombVisited == 1 and HasArtefact(heroName, ARTIFACT_TAROT_DECK)
and HasArtefact(heroName, ARTIFACT_DRAGON_TALON_CROWN) then
-- take the artifact
Play2DSound( "/Sounds/_(Sound)/Spells/Hypnotize.xdb#xpointer(/Sound)");
PlayVisualEffect( "/Effects/_(Effect)/Spells/Dispel.xdb#xpointer(/Effect)", "kingsTomb");
ShowFlyingSign(path.."keyAccepted.txt", "kingsTomb", PLAYER_1, 12);
sleep(20);
MessageBox(path.."kingsTombSecondGreeting.txt");
RemoveArtefact(heroName, ARTIFACT_DRAGON_TALON_CROWN);
SetObjectiveState("kingsCrown", OBJECTIVE_COMPLETED, PLAYER_1);
-- stop night attacks. See dawn()
kingsTombVisited = 2;
-- awared points for completing quest
Play2DSound( "/Sounds/_(Sound)/Interface/Ingame/Tutorial.xdb#xpointer(/Sound)");
ShowFlyingSign(path.."points10.txt", jake, PLAYER_1, 12);
points = points + 10;
if points >= pointsGoal then
SetObjectiveState("getPoints", OBJECTIVE_COMPLETED, PLAYER_1);
end;
end;
if kingsTombVisited == 2 and GetCurrentPlayer() == PLAYER_1 then
MessageBox(path.."kingsTombPeaceful.txt");
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER,"kingsTomb", "kingsTombAct");
function tombKeyReqired(heroName)
if kingsTombVisited == 0 and GetCurrentPlayer() == PLAYER_1
and HasArtefact(heroName, ARTIFACT_TAROT_DECK) == nil then
ShowFlyingSign(path.."keyRequired.txt", "kingsTomb", PLAYER_1, 12);
end;
end;
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"kingsTombRgn", "tombKeyReqired");
____________
-------------
Mage of Soquim
|
|
Sorceresss
Tavern Dweller
Witch
|
posted July 28, 2008 11:16 AM |
|
|
Thanks a lot for your lengthy reply, rdeford ... but the scripting code-lines you have copied from your quest appear to me, at first glance, as very complicated.
I will soon read the basic guide you have recommended.
For the moment, all I wish to create is a simple "touch script" with the KM :
A hero (of any faction) touches the KM and something simple arrives (such as +2 morale for the next combat).
I will be back on this thread to report my progress on this, my very first scripting task. Thanks again.
________________________________
EDIT (a few hours later) > Well ... I read the 2 guides on scripting (Pitsu's + your 2.0 version) ... and I found that overwhelming. It's just way too much for someone who has no talent for mathematics, logic, and software coding. The 2 authors seem to presume that the reader already has some knowledge & experience in LUA scripting (or in a somewhat similar language).
Like I said, all I wish to learn is a simple, basic "touch script" for the KM. I would not know how to do that after reading the 2 guides (and your complex, posted example).
One thing I do not understand is that on a KM's properties tree, there is a "name" line where there is no name whatsoever for the KM. It just states there that a name is required for scripting. But if I left-click or right-click on that name line, no naming option appears. I only get options like "refresh" and "copy".
I guess that I shall have to wait for your tutorial.
|
|
rdeford
Known Hero
Wyld Mapper
|
posted July 28, 2008 03:18 PM |
|
Edited by rdeford at 15:25, 28 Jul 2008.
|
Quote:
For the moment, all I wish to create is a simple "touch script" with the KM :
I apologize for my poorly thought out cut and paste. I was in a hurry and forgot that it is not easy to look at a mass of complex H5 script and see how to do a simpler task. To make up for my error, here is a tested script that does what you asked:
function rewardKM(heroName)
ChangeHeroStat(heroName, STAT_MORALE, 2);
end;
Trigger(OBJECT_TOUCH_TRIGGER, "testKM", "rewardKM");
Where: testKM is the script name of the KM.
While this function does what you asked, you can't really use it in your map as is. For example, it would be nice to announce the moral increase (e.g., flying sign) if it is a human player that is getting the reward, and to have a lock-out to prevent the hero from touching it over and over again to bump the hero's moral up to a max value, and to make the moral boost temporary until after the next battle (a daunting scripting task BTW), and so forth. In other words, even though I've given you a simple piece of code that does what you asked, I have not removed the scripting challenge from what seems on the surface to be a simple task.
As for the KM name, the trick is to make the Properties Tree window wide enough so that you can see the Value column to the right of the Property column. If you left-click on the Name row over under the Value column, you will get an empty field where you can type the name.
____________
-------------
Mage of Soquim
|
|
Sorceresss
Tavern Dweller
Witch
|
posted July 28, 2008 05:33 PM |
|
|
Thanks ! I will try it in a few minutes. A few questions :
1. Will your KM script work with any KM structure, without having had to name it in its properties tree ? Is "KM" associated, by default, with a KM structure -- without having to do anything in its properties ?
2. Since my thus scripted map will only be played by me, with comps, can I assume that the A.I. heroes won't cheat by touching the KM repeatedly ?
(I don't see why they would do that, since they do not have the habit of doing that, except in the case of 2-way teleporters & whirlpools. I just have to refrain from cheating.)
3. Anyway, if I'm not mistaken, even if you would enter combat with +10 morale, the effective consequences of having higher morale are not without limits. No ?
____________________________________
P.S. (edit) > I have tried this ... and it apparently failed :
1. I copied what you gave me exactly as it was in the Script Editor of a map where I had placed a KM next to a starting castle.
2. I did not do anything in the KM's properties tree.
(Anyway ... what you told me about it did not appear to work. On the [ab]Name line of the KM's properties, I slided towards the far right of the line. The only thing I found, in the middle, was the "Name of the object (used in scipts)" (not scripts!) label. I did not find anything there, even to the far right, where I could name anything. When I left-clicked on the line, nothing happened. When I right-clicked, I only got those 4 options : refresh + copy + undo + show hidden.)
3. I saved the map under a new test-file.
4. I started the game. My first hero had 0 morale. He immediately touched the nearby KM (an action that the HM&M raised-unicorn cursor confirmed as successful). I checked the hero's morale again : still at 0. No change.
2nd P.S. > After reading you subsequent message, I understand why it did not work. I did not name the KM ! (I did not succeed in finding how to do it in its properties tree.)
|
|
rdeford
Known Hero
Wyld Mapper
|
posted July 28, 2008 06:16 PM |
bonus applied by angelito on 30 Jul 2008. |
Edited by rdeford at 18:19, 28 Jul 2008.
|
Quote: Thanks ! I will try it in a few minutes. A few questions :
1. Will your KM script work with any KM structure, without having had to name it in its properties tree ? Is "KM" associated, by default, with a KM structure -- without having to do anything in its properties ?
2. Since my thus scripted map will only be played by me, with comps, can I assume that the A.I. heroes won't cheat by touching the KM repeatedly ?
(I don't see why they would do that, since they do not have the habit of doing that, except in the case of 2-way teleporters & whirlpools. I just have to refrain from cheating.)
3. Anyway, if I'm not mistaken, even if you would enter combat with +10 morale, the effective consequences of having higher morale are not without limits. No ?
Regarding:
#1 -- No, not in the sense you are asking the question anyway. It is the trigger, not the function, that uses the name of the KM to work its magic. So, you have to give each KM a unique name, then create a separate trigger for each KM. In other words, the function simply gives moral to whatever hero touches a particular KM, and can be called into action by multiple triggers. Side Note: While triggers can appear anywhere in the script, I like to line them up under the function they call. (See example below.)
#2 -- I'm not sure. You're likely correct about the AI. I was thinking of the future when you publish your map and other humans will be playing it.
#3 -- Again, I'm not sure. You're likely correct.
Example of multiple triggers:
-----------------------------
function rewardKM(heroName)
ChangeHeroStat(heroName, STAT_MORALE, 2);
end;
Trigger(OBJECT_TOUCH_TRIGGER, "testKM1", "rewardKM");
Trigger(OBJECT_TOUCH_TRIGGER, "testKM2", "rewardKM");
Trigger(OBJECT_TOUCH_TRIGGER, "testKM3", "rewardKM");
Trigger(OBJECT_TOUCH_TRIGGER, "testKM4", "rewardKM");
Where the four KM's are named, testKM1, testKM2, testKM3, testKM4
BTW: You do not need to supply an actual hero name for the heroName parameter. The game will pass the name of hero to the function automatically if you type it exactly as I've shown.
____________
-------------
Mage of Soquim
|
|
Sorceresss
Tavern Dweller
Witch
|
posted July 28, 2008 06:18 PM |
|
|
Please read the P.S. of my previous message :
I could not name the KM ! I did not find out how to do it in the KM's properties tree.
(I'm going back into the editor : I will try again to find that "value column" you mentioned.)
|
|
rdeford
Known Hero
Wyld Mapper
|
posted July 28, 2008 06:40 PM |
|
Edited by rdeford at 18:42, 28 Jul 2008.
|
Quote: Please read the P.S. of my previous message :
I could not name the KM ! I did not find out how to do it in the KM's properties tree.
Well, the script will not work without a script name for the KM. The Trigger must have a valid script name for its object name parameter.
I cannot figure out how to post a screen shot, or I would show you what it looks like in my editor. So, since I can't do that, I will try to write better instructions.
1. While in the map editor, slowly move the cursor over the right hand edge of frame around the Properties Tree window. It will change into a vertical thing with two small arrows pointing out of it. When you see that happen, left-click and hold while dragging the mouse to the right. This action will stretch the properties window towards the right, making it wider and wider. Release the mouse button and look at the column header at the top of the window. If you don't see the Value column, stretch the widow wider again, and again. Stop stretching when you can see the Value column header showing up at the top of the window. Look in the Value column. You'll see a vertical row of numbers that are the values for the properties. There won't be a value for the Name property.
2. Left-click on the [ab] box next to the Name to highlight the entire Name row.
3. Left-click on the highlighted row on a place under the other values in the Value column. An empty field will appear in the highlighted area.
4. Type the name for the KM in this field.
I hope this works for you. If it doesn't I will try to think of what else to say.
____________
-------------
Mage of Soquim
|
|
Sorceresss
Tavern Dweller
Witch
|
posted July 28, 2008 07:50 PM |
|
|
DOUBLE SUCCESS !!
1a. I succeeded in naming the KM structure by following your procedure (in your previous post). I named it KM1.
1b. I changed "testKM" in the script editor with "KM1".
2a. I started the custom game, and my initial hero's morale did jump from 0 to 2 after visiting the nearby KM !
2b. I made him try a second time, and as you predicted, morale went up to 4.
Thanxxx a great lot : YOU made my very first script effective.
In what concerns naming the KM, I had already seen the Value column, because it was not located far to the right. I think it was my manner of clicking on the Name line that did not make the empty box appear easily. This time, I left-clicked repeatedly and the box finally appeared.
What's left for me is to add an effect when the hero touches the KM : a message (+2 morale for the next combat) with or without a sound effect.
But for now, you made my day. After fooling around in the HM&M 5 editor for 2 years, I have a functional script -- even though it is quite basic. I will try to apply what you have recently taught me to other structures. I will consult the list of LUA codes to see if I can insert something else than +2 morale : such as +1000 gold.
When your tutorial will be published, you can be assured that I shall be one of the first people to read it with interest.
Thanks again ... Sorry : got to go now -- in the editor!
|
|
rdeford
Known Hero
Wyld Mapper
|
posted July 28, 2008 08:10 PM |
|
Edited by rdeford at 20:13, 28 Jul 2008.
|
Quote: DOUBLE SUCCESS !!
What's left for me is to add an effect when the hero touches the KM : a message (+2 morale for the next combat) with or without a sound effect.
But for now, you made my day. After fooling around in the HM&M 5 editor for 2 years, I have a functional script -- even though it is quite basic. I will try to apply what you have recently taught me to other structures. I will consult the list of LUA codes to see if I can insert something else than +2 morale : such as +1000 gold.
When your tutorial will be published, you can be assured that I shall be one of the first people to read it with interest.
By look at LUA codes, I assume you mean looking in the Script_Functions.pdf that came with the Editor. That is the place to look, and the answers you seek are there, but they are custom H5 functions created by the H5 developers, not LUA codes.
There is no nice easy way to add an effect to the reward function. The easiest solution is to use:
ShowFlyingSign(messageName, objectName, targetPlayerID = -1, time = 1.0);
However, in order to do so, you will have to create a text resource file for your map and get the full path to it for the messageName parameter. All this is in the tutorial, but beyond the scope of this forum I think.
I am half way through turning the rough draft tutorial into a final draft. I should be done in a few days. Then I have to find someone to beta test the tutorial and point out errors, and make suggestions for improvements. That process can take one to four weeks depending on how much time and energy the beta testers have. I have one volunteer beta tester but I am looking for another. <smile> That would be one way for you to see the tutorial sooner.
____________
-------------
Mage of Soquim
|
|
Sorceresss
Tavern Dweller
Witch
|
posted July 28, 2008 08:32 PM |
|
|
Quote: I have one volunteer beta tester but I am looking for another. <smile> That would be one way for you to see the tutorial sooner.
In part to thank you for your precious, recent help, I do volunteer but I wonder what beta-test contribution I could make, since my knowledge & experience with HM&M 5 Scripting is extremely recent & limited.
What use I could be to you, as a total neophyte (or scripting n00b, if your prefer) in such a test ?
_____________________________________
Another question pops to my mind :
In the basic script you posted for me, why is the end; line inserted above the last line (which starts by TRIGGER) ?
If you end your little script, must you not insert end; to close the whole block of the script ?
How would you separate that KM +2 morale block from a totally different script block, starting after the TRIGGER line ? By this ? :
end;
end;
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted July 28, 2008 08:52 PM |
|
|
end; is used at the end of each function or block such as "if...else" block so the computer knows where it starts and ends and can understand it as a separate whole.
Here is an example:
function majorgate()
for i=1,2 do
AddObjectCreatures("Majorgate"..i, CREATURE_FIRE_ELEMENTAL, GetDate(WEEK)+(GetDate(MONTH)-1));
AddObjectCreatures("Majorgate"..i, CREATURE_WATER_ELEMENTAL, GetDate(WEEK)+(GetDate(MONTH)-1));
AddObjectCreatures("Majorgate"..i, CREATURE_AIR_ELEMENTAL,GetDate(WEEK)+(GetDate(MONTH)-1));
AddObjectCreatures("Majorgate"..i, CREATURE_EARTH_ELEMENTAL,GetDate(WEEK)+(GetDate(MONTH)-1));
if mod(GetDate(DAY), 7) == 1 then
AddObjectCreatures("Majorgate"..i, CREATURE_PHOENIX, GetDate(MONTH));
end;
end;
end;
Triggers are functions themselves. You simply say: trigger this, trigger that and they obey.
What I really need is to know how to link basic functions to objects so they do anything at all. Now I got some insight. Writting down what I want it to do should be easy then
|
|
rdeford
Known Hero
Wyld Mapper
|
posted July 28, 2008 09:16 PM |
|
Edited by rdeford at 21:25, 28 Jul 2008.
|
Quote:
What I really need is to know how to link basic functions to objects so they do anything at all. Now I got some insight. Writting down what I want it to do should be easy then
The Trigger() function is what you use to tie the functions in your script to events that happen on the map during the game. The Trigger() function has a good write up in the official Script_Functions.pdf document. You will notice that some types of triggers require an object's script name as one parameter. (See my KM example earlier in this thread.) The most common type of triggers used are the ones that trigger a function when a hero enters a region defined by the mapmaker. These triggers require the name of the region as one parameter.
____________
-------------
Mage of Soquim
|
|
rdeford
Known Hero
Wyld Mapper
|
posted July 28, 2008 09:23 PM |
|
|
Quote:
What use I could be to you, as a total neophyte (or scripting n00b, if your prefer) in such a test ?
You are exactly my target audience and will make the best beta tester. If any part of the tutorial doesn't work for you, then I need to rewrite it. Also, if the tutorial is paced to fast for you, or skips something you need to know, or doesn't cover enough, then I need to know that as well.
Please send me your email address so I can send you a beta test copy of the Tutorial for your use. Don't post your address if you don't want too. Instead send it me using the address I provide in my profile.
____________
-------------
Mage of Soquim
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted July 28, 2008 09:26 PM |
|
|
Quite simply, do I put the triggers in the map script or object script?
|
|
|
|