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 > Heroes 5 - Modders Workshop > Thread: [Editor"MOD"]Heroes V Quest Editor
Thread: [Editor"MOD"]Heroes V Quest Editor This thread is 6 pages long: 1 2 3 4 5 6 · «PREV / NEXT»
Asheera
Asheera


Honorable
Undefeatable Hero
Elite Assassin
posted February 07, 2009 06:11 PM

Quote:
In the Practical Guide, it says that we can use the 'GiveExp(heroname, value);' function to add experience. But this function does not appear in the function list token in the New Script Functions manual...

Then I ask you if a function like GiveAttribute(heroname, attributeID, value); or something like that exists.
Just use ChangeHeroStat and GetHeroStat to accomplish both of those things.

Description for these functions can be found in "Editor Documentation\HOMM5_A2_Script_Functions.pdf"
____________

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


Promising
Famous Hero
NCF Blacksmith
posted February 07, 2009 07:06 PM

OK thanks
Now another question :
Does it exist a function like GetMapPath (that would return Maps/Scenario/MyMap/ for example) ? Because I need it to create the .txt files for message boxes.
____________
NCFBank,
the complete and homogen NCF
library.

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


Honorable
Undefeatable Hero
Elite Assassin
posted February 07, 2009 09:22 PM

Sure, in fact I always write the first line of a map script as:

path = GetMapDataPath()

And then use path.."text.txt" or something like that
____________

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


Known Hero
The Red Taskmaster
posted February 08, 2009 08:48 AM
Edited by Lepastur at 08:56, 08 Feb 2009.

Yes, I meant adding Quest through LUA, because if the other way doesn't work, LUA seems to be a force method for anything in Heroes V. For example, on the "Capture object" quest (a city or garrison maybe), it asks for a "scripting name" and I guess it should be given by LUA. By the way, I'm trying to learn a bit through the original maps scripting, maybe you could find some resources there too

And I have a question too for Asheera. Suppose I want to set a castle garrison on an IA Random city. Are there any way to check the faction and give the troops of their kind? I'd also like to ask if there's anyway to set the "Captain" hero of this garrison, I mean, a Hero that it's in the garrison and doesn't move or change Arties and/or Troops. I know we can set a "Hermit" mood for the hero, but I don't know how to get it still.
____________
Torre de Marfil Foro / Portal - La Comunidad
hispana más completa sobre la saga Might&Magic.

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


Promising
Legendary Hero
fallen artist
posted February 08, 2009 09:13 AM

Quote:
For example, on the "Capture object" quest (a city or garrison maybe), it asks for a "scripting name" and I guess it should be given by LUA.

You can set scripting name in object properties with map editor.
It does not work for heroes, who have their internal scipting name.
Quote:
By the way, I'm trying to learn a bit through the original maps scripting, maybe you could find some resources there too

Robert De Ford is da man

Quote:
I'd also like to ask if there's anyway to set the "Captain" hero of this garrison, I mean, a Hero that it's in the garrison and doesn't move or change Arties and/or Troops. I know we can set a "Hermit" mood for the hero, but I don't know how to get it still.

My Wiki post

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


Known Hero
The Red Taskmaster
posted February 08, 2009 10:50 AM

Quote:
Quote:
For example, on the "Capture object" quest (a city or garrison maybe), it asks for a "scripting name" and I guess it should be given by LUA.

You can set scripting name in object properties with map editor.
It does not work for heroes, who have their internal scipting name.

I'd swear I tried that (adding a Name on the name (AB) field) a couple of times. Now I've tried once more and it worked! Now what I have to discover is how to set an image instead that "White and Unknown Square" for the target.

Thanks for the wiki link!
____________
Torre de Marfil Foro / Portal - La Comunidad
hispana más completa sobre la saga Might&Magic.

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


Promising
Famous Hero
NCF Blacksmith
posted February 08, 2009 02:23 PM
Edited by TSoD at 14:26, 08 Feb 2009.

Another question.
Here is the code generated in the LUA file of my program for an Assemble Army quest that give 10 000 exp when Laszlo have 20 or more peasants.

Quote:



--Objective Type : ASSEMBLE ARMY (Function name : f_check__ArmyAssembled0)
--Trigger & Award Functions included

--Needed Variables
v_check__IsArmyAssembled0Working = true;

--Function itself
SetObjectiveState(Quest1, OBJECTIVE_ACTIVE, 1);
f_check__ArmyAssembled0()
while v_check__IsArmyAssembled0Working do
if (GetHeroCreatures("Laszlo", CREATURE_PEASANT) >= 20) then
GiveExp("Laszlo", 10000);
SetObjectiveState(Quest1, OBJECTIVE_COMPLETED, 1);
v_check__IsArmyAssembled0Working = false;
sleep(1);
end;
sleep(50);
end;
end;

NB : it is the entire LUA file, there is no other lines but these.
NB2 : colors shows you which end; go with which stuff.

In the game, the console says me that at the very beginning :

Script ERROR : expected;
at line 22
last token read 'end'
Script failed (or something like that)

Why ? line 22, it is the last one, and there is already a ';'...
____________
NCFBank,
the complete and homogen NCF
library.

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


Honorable
Undefeatable Hero
Elite Assassin
posted February 08, 2009 03:19 PM
Edited by Asheera at 15:20, 08 Feb 2009.

Quote:
Suppose I want to set a castle garrison on an IA Random city. Are there any way to check the faction and give the troops of their kind?
You can use the GetPlayerRace(player) function

for example:

local race = GetPlayerRace(2)

It will return the race player 2 has (the race defined from the starting position)

The race IDs:

Haven 0
Sylvan 1
Academy 2
Dungeon 3
Necropolis 4
Inferno 5
Fortress 6
Stronghold 7

@TSOD:

1) You DON'T need to write a semicolon ( ; ) after every line. In fact it's better if you don't, it saves up memory space

The only time a semicolon is needed in LUA is when you write multiple statements on the same line. Example:

local x = 5; local y = 6

Otherwise you can write it without any semicolon:

local x = 5
local y = 6

People that write a semicolon after every line are too used with C/C++ I think. LUA doesn't require that.

2) The error is on the first red line. It should be:

function f_check__ArmyAssembled0()
____________

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


Promising
Famous Hero
NCF Blacksmith
posted February 08, 2009 03:34 PM
Edited by TSoD at 17:05, 08 Feb 2009.

Thanks alot both of you !
And no, I didn't know I could forget the ';' symbol in LUA in this case, thanks Asheera

My program begin to take a shape now!
In the same time I modify it for LUA scripting, I'm integrating a Check Tool that oblige the MapScript.lua file to not be modified if there are strange/missing information(s) following the quest type and the award type
____________
NCFBank,
the complete and homogen NCF
library.

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


Known Hero
The Red Taskmaster
posted February 10, 2009 10:53 AM

I'm glad this project keeps pushing forward! Now a question for Ash, do you know if it's possible to use a self-made image for the White box of the Quest's exchange screen? I've been searching a bit and I read somewhere it's impossible, but I wonder it could be wrong because Skillwheel MOD can do it, for example. Anything to say to that?
____________
Torre de Marfil Foro / Portal - La Comunidad
hispana más completa sobre la saga Might&Magic.

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


Honorable
Undefeatable Hero
Elite Assassin
posted February 10, 2009 03:05 PM

Yes you can, the texture should be in a 8:8:8:8 ARGB mode without Mip-Maps though (like the Portraits and other Icons), and not DXT3 with Mip-Maps like the usual textures on the models.
____________

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


Known Hero
The Red Taskmaster
posted February 10, 2009 05:34 PM

Quote:
Yes you can, the texture should be in a 8:8:8:8 ARGB mode without Mip-Maps though (like the Portraits and other Icons), and not DXT3 with Mip-Maps like the usual textures on the models.

Thanks for the info, but I guess you forgot to show how to do that I've been searching the Editor and I found no place to input the path of the Quest texture file...
____________
Torre de Marfil Foro / Portal - La Comunidad
hispana más completa sobre la saga Might&Magic.

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


Honorable
Undefeatable Hero
Elite Assassin
posted February 10, 2009 05:36 PM
Edited by Asheera at 17:37, 10 Feb 2009.

Wait wait, you don't do that with the Editor. Textures are common .dds files used in many games, you can create them in various ways. I use Photoshop with Nvidia's DDS Plugins for that, but Photoshop is not free so you may want to use something else.

Don't know much about other programs that can save and edit .dds files, but maybe this thread helps.

EDIT: Obviously you need the editor after to link the texture with an .xdb file (or you can just create the .xdb file manually like I do, since it's just a text file)
____________

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


Known Hero
The Red Taskmaster
posted February 10, 2009 06:40 PM

The DDS creation process is not the problem. What I'd like is that thing you say about this.

Quote:

EDIT: Obviously you need the editor after to link the texture with an .xdb file (or you can just create the .xdb file manually like I do, since it's just a text file)


____________
Torre de Marfil Foro / Portal - La Comunidad
hispana más completa sobre la saga Might&Magic.

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


Honorable
Undefeatable Hero
Elite Assassin
posted February 10, 2009 08:56 PM

I'm not sure, I never use the editor to create .xdb files, maybe someone else who does can help.

I prefer to write the .xdb files manually, somehow I think it's cleaner and more organized that way.

Anyway, a Texture .xdb looks something like this:

<?xml version="1.0" encoding="UTF-8"?>
<Texture>
   <SrcName href="DoesNotMatter"/>
   <DestName href="YourDDSFile.dds"/>
   <Type>TEXTURE_2D</Type>
   <ConversionType>CONVERT_TRANSPARENT</ConversionType>
   <AddrType>CLAMP</AddrType>
   <Format>TF_8888</Format>
   <Width>64</Width>
   <Height>64</Height>
   <MappingSize>0</MappingSize>
   <NMips>1</NMips>
   <Gain>0</Gain>
   <AverageColor>0</AverageColor>
   <InstantLoad>true</InstantLoad>
   <IsDXT>false</IsDXT>
   <FlipY>false</FlipY>
   <StandardExport>true</StandardExport>
   <UseS3TC>false</UseS3TC>
</Texture>


The only important parameters are DestName (which holds the path to your .dds file), Format (which should be TF_8888 in this case), Width and Height (self-explanatory - image size in pixels), NMips (should be 1) and IsDXT (should be false). The others you can ignore them and leave them to their default parameters.
____________

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


Known Hero
The Red Taskmaster
posted February 10, 2009 09:23 PM

Thanks for the lesson. I don't care about the editor or editing any file manually. The missing thing now is how to say to the map "eh, here is a new texture to be used on this quest and no other" I've been searching through the map.xdb but found no place where this kind of thing could fit into, so I guess maybe this should be scripted. Any hint?
____________
Torre de Marfil Foro / Portal - La Comunidad
hispana más completa sobre la saga Might&Magic.

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


Honorable
Undefeatable Hero
Elite Assassin
posted February 10, 2009 09:28 PM

Oh, I thought you were talking about modding or something, don't know if it's possible with scripting. The only function I know where you can specify a texture is TalkBoxForPlayers for that icon it has.

And I'm not sure I even understand what you want to modify. Care to take a screenshot?

But yes unfortunately, as far as I know, you can't modify the normal UI with scripts so the only possibility is modding (which impacts the whole UI, not just one when you want)
____________

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


Known Hero
The Red Taskmaster
posted February 11, 2009 04:28 PM

Sure! Here it is:

What I'd like to know is how to change the "Unknown" text (Desconocido in spanish) and that White square. I don't mind if I should use an existing image from the game, like the city icons for example (Capture Object Quest), although to use a custom imagen would be finer, of course.
____________
Torre de Marfil Foro / Portal - La Comunidad
hispana más completa sobre la saga Might&Magic.

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


Promising
Legendary Hero
fallen artist
posted February 11, 2009 04:56 PM
Edited by Warmonger at 17:33, 11 Feb 2009.

Currently under testing, I have about a hundred of quests to add

EDIT: After rolling files back to the map, game displays only empty labels where the objective names should be. And YES, I added their name and desciption.
Truly saying, description is all I need now, as scripts have been written some months ago

Now, why the ditor doesn't show any objectives at all in the map panel? Or I can't find them?


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


Honorable
Undefeatable Hero
Elite Assassin
posted February 11, 2009 05:08 PM

Sorry, I have never made quests or such with the map editor, I have no clue how it works. But if you do manage to make it work, just know that you will be able to use your own image (as well as internal icons), if you use the correct .dds format for icons and the corresponding .xdb file as well.
____________

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 6 pages long: 1 2 3 4 5 6 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0598 seconds