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 ]
New Server | HOMM1: info forum | HOMM2: info forum | HOMM3: info forum | HOMM4: info forum | HOMM5: info forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 5 - Modders Workshop > Thread: ~ QUESTIONS Topic and FAQ - Modders Workshop ~
Thread: ~ QUESTIONS Topic and FAQ - Modders Workshop ~ This Popular Thread is 120 pages long: 1 2 3 4 5 ... 20 40 60 80 100 ... 116 117 118 119 120 · «PREV / NEXT»
Quantomas
Quantomas


Responsible
Famous Hero
AI Wizard
posted June 19, 2017 10:03 PM
Edited by Quantomas at 22:04, 19 Jun 2017.

SetObjectPosition(AllHeroes[1], HeroPos[1][Race[1]][1], HeroPos[1][Race[1]][2], 0)

The last parameter is the floor designator. 0 indicates the top floor. If you want to specify a position on the underground use 1.

The pre-defined H5 script commands that are available for your use are defined in the HOMM5_A2_Script_Functions.pdf, which is located in: Program Files/UbisoftHeroes of Might and Magic V - Tribes of the East/Editor Documentation .

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


Admirable
Omnipresent Hero
Tastes like chicken
posted June 20, 2017 09:14 AM
Edited by Elvin at 21:49, 23 Jun 2017.

Exactly what I wanted! Thank you
____________
Being human is a roller coaster ride of emotions during rainstorms and sunshine, sprinkled with moments when you can almost reach the stars.

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


Admirable
Omnipresent Hero
Tastes like chicken
posted June 30, 2017 09:08 AM
Edited by Elvin at 09:46, 30 Jun 2017.

Another question:

How could I make the ChangeHeroStat script trigger on visiting an adventure map location?  I would like to set a condition check like the following:

if ObjectExists (“Aberrar”) then
ChangeHeroStat (“Aberrar”, STAT_DEFENCE,1);
end;

How should this look if I wanted the script to trigger when the hero visits a specific location like a sphinx?

Alternatively, would it be possible to change all 4 attributes with one quest?

Any help appreciated!
____________
Being human is a roller coaster ride of emotions during rainstorms and sunshine, sprinkled with moments when you can almost reach the stars.

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


Responsible
Famous Hero
AI Wizard
posted June 30, 2017 06:38 PM bonus applied by Galaad on 28 Aug 2017.
Edited by Quantomas at 11:20, 02 Jul 2017.

I wrote a script for a map with exactly this feature (see below). The map is called EE's Middle Earth_PRT.h5m. Check it out if you wish to examine the original script with proper indenting (the HC editor is rather bare-bones).

To make it work you have to give the adventure map objects a name/ID in the map editor. There is an illustrated example for this in Program Files/UbisoftHeroes of Might and Magic V - Tribes of the East/Editor Documentation.

Surely, you can have as many instructions as you like between the if-then ... end/else.

Here is the script:

Quote:

path = GetMapDataPath() ;

bEnhancedChallengeTaken = 0 ;
heroChallenged          = nil ;

SetObjectEnabled( "EnhancedChallengeSeer",  false );
SetObjectEnabled( "EnhancedChallengeSeer2", false );
SetObjectEnabled( "EnhancedChallengeSeer3", false );

Trigger( OBJECT_TOUCH_TRIGGER, "EnhancedChallengeSeer",  "funcEnhancedChallenge" );
Trigger( OBJECT_TOUCH_TRIGGER, "EnhancedChallengeSeer2", "funcEnhancedChallenge" );
Trigger( OBJECT_TOUCH_TRIGGER, "EnhancedChallengeSeer3", "funcEnhancedChallenge" );

function funcEnhancedChallenge( heroName )

if bEnhancedChallengeTaken > 0 or GetDate() > 7 then
SetObjectEnabled( "EnhancedChallengeSeer",  not nil );
SetObjectEnabled( "EnhancedChallengeSeer2", not nil );
SetObjectEnabled( "EnhancedChallengeSeer3", not nil );
else
heroChallenged = heroName ;

MessageBox( path.."EnhancedChallengeDesc.txt" );
QuestionBox( path.."EnhancedChallengeShortMsg.txt", "funcChallengeAccepted", "funcChallengeRefused" );
end ;

end;


function funcChallengeAccepted()

GiveArtefact( heroChallenged, ARTIFACT_DWARVEN_MITHRAL_CUIRASS );
GiveArtefact( heroChallenged, ARTIFACT_DWARVEN_MITHRAL_HELMET );

-- RemoveObject( "IsengardGate" );

bEnhancedChallengeTaken = 1 ;

GiveBorderguardKey( PLAYER_4, RED_KEY );
GiveBorderguardKey( GetObjectOwner(heroChallenged), RED_KEY );

end ;


function funcChallengeRefused()
end ;



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


Admirable
Omnipresent Hero
Tastes like chicken
posted June 30, 2017 08:18 PM

Great. Do you have a link of the map? I searched a bit but didn't manage to find it.
____________
Being human is a roller coaster ride of emotions during rainstorms and sunshine, sprinkled with moments when you can almost reach the stars.

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


Responsible
Famous Hero
AI Wizard
posted July 01, 2017 06:01 PM
Edited by Quantomas at 18:05, 01 Jul 2017.

Here you go: http://www.bonddisc.com/ref/h5/maps/EE's Middle Earth_PRT.h5m

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


Admirable
Omnipresent Hero
Tastes like chicken
posted July 01, 2017 10:03 PM
Edited by Elvin at 22:16, 01 Jul 2017.

So in the above, EnhancedChallengeSeer1/2/3 are the objects and EnhancedChallenge the name of the quest. If the quest is not taken, the objects activate.

If I wanted to enable one object(aca1) with a trigger touch quest(ChangeHeroStat1) for any hero that visits it, would the following be correct? Or rather, what am I getting wrong?

Quote:

path = GetMapDataPath() ;

bChangeHeroStat1Taken = 0 ;

SetObjectEnabled( "aca1",  false );

Trigger( OBJECT_TOUCH_TRIGGER, "aca1",  "funcChangeHeroStat1" );

function funcChangeHeroStat1( heroName )

if bChangeHeroStat1Taken > 0 then
SetObjectEnabled( "aca1",  not nil );

end;


function funcChangeHeroStat1()

ChangeHeroStat("heroName", STAT_ATTACK, 6)
ChangeHeroStat("heroName", STAT_DEFENSE, 8)
ChangeHeroStat("heroName", STAT_SPELLPOWER, 6)
ChangeHeroStat("heroName", STAT_KNOWLEDGE, 6)

end ;

____________
Being human is a roller coaster ride of emotions during rainstorms and sunshine, sprinkled with moments when you can almost reach the stars.

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


Responsible
Famous Hero
AI Wizard
posted July 01, 2017 11:32 PM
Edited by Quantomas at 23:33, 01 Jul 2017.

First, you need to read the documentation of SetObjectEnabled(), this clarifies what the second parameter does to enable the trigger function.

ALWAYS read the documentation. Pay close attention to the parameters, do not add apostrophe (") if that is not required. CH has good documentation for scripting H5: http://celestialheavens.com/homm5/manuals/CH_H5_scripting2.01.zip

Second, if you have two functions, give each a unique name.

You can't use the parameter heroName simply so in the second function. Parameters are scoped, that is parameters supplied to a function are only valid in the function body (until the end).

Look at the handling of the parameter heroname and bEnhancedChallengeTaken in the provided script. It's handled minimally, so everything is necessary. You cannot leave this out, if you expect your script to work. Don't try to be more clever than the pros.

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


Promising
Supreme Hero
disrupting the moding industry
posted July 01, 2017 11:51 PM

I got a question as well.

Is there a way to force a creature behavior for NPC units? I don't mean like combat scripts (because they are not possible in multiplayer) but just a general behavior.

For example - if I make a NCF mage with 10-15 spells can I tell him when he is in combat to focus on spell casting instead of shooting. Is there a way to tell the creature at what order to cast the spells?

Same goes for the melee/ranged unit focus fire or defensive maneuvers.


____________
Find an opponent at HoMM55 Tavern! | NCF Utility Alpha

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


Responsible
Famous Hero
AI Wizard
posted July 02, 2017 11:43 AM
Edited by Quantomas at 11:50, 02 Jul 2017.

@Elvin
If you just want a simple trigger, without dialog checks and flatly working repeatedly for any hero visiting, you can simply write:

Quote:

SetObjectEnabled( "aca1", false );

Trigger( OBJECT_TOUCH_TRIGGER, "aca1", "ChangeHeroStat1" );

function ChangeHeroStat1( heroName )

   ChangeHeroStat( heroName, STAT_ATTACK,     6);
   ChangeHeroStat( heroName, STAT_DEFENSE,    8);
   ChangeHeroStat( heroName, STAT_SPELLPOWER, 6);
   ChangeHeroStat( heroName, STAT_KNOWLEDGE,  6);

end ;


But for most practical purposes, you don't want heroes to gain such benefits repeatedly.

Quote:

SetObjectEnabled( "aca1", false );

Trigger( OBJECT_TOUCH_TRIGGER, "aca1", "ChangeHeroStat1" );

function ChangeHeroStat1( heroName )

   ChangeHeroStat( heroName, STAT_ATTACK,     6);
   ChangeHeroStat( heroName, STAT_DEFENSE,    8);
   ChangeHeroStat( heroName, STAT_SPELLPOWER, 6);
   ChangeHeroStat( heroName, STAT_KNOWLEDGE,  6);

   SetObjectEnabled( "aca1", true );

end ;


This gives the stat boost only to the first hero visiting.

@dredknight
Technically, that would be a combat script that sets the desired behaviour, or alternatively a property that could be set. I have not seen anything that indicates that this had been implemented.

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


Promising
Supreme Hero
disrupting the moding industry
posted July 02, 2017 12:08 PM

Quantomas said:

@dredknight
Technically, that would be a combat script that sets the desired behaviour, or alternatively a property that could be set. I have not seen anything that indicates that this had been implemented.

I see. Then what module makes the NPC creatures act in battle?
Is this a harcodded thing and can it be changed?
____________
Find an opponent at HoMM55 Tavern! | NCF Utility Alpha

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

Tavern Dweller
posted July 02, 2017 05:18 PM
Edited by Hizsoo at 17:20, 02 Jul 2017.

Is there a way to force most action in combat to be shown with close camera? For the purpose of recording a special footage.

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


Promising
Supreme Hero
disrupting the moding industry
posted July 02, 2017 07:29 PM

Quantomas,

Forget about my last question I believe it is the same dead end.
I believe your knowledge can help answering this question that regards heroes V xml parser. I want to decouple the defaultstats.xdb file into a a few smaller ones which will allow easier integration between NCF and MMH55 mod.

____________
Find an opponent at HoMM55 Tavern! | NCF Utility Alpha

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


Responsible
Famous Hero
AI Wizard
posted July 03, 2017 06:26 PM

Surely the combat AI involves much more than targeting and positioning to be worthwhile. You can't create a worthy heroes combat experience with scripts and properties alone. It would be flat and easily exploitable.

You can break the .xdb files into parts. As far as I know all .xdb files in that folder are read in at start up in the order of the file time stamp. Newer ones override older ones.

But you know my stance on NCF. It will only be feasible if the modders can create new creatures and animations with a proper tool like Blender. Something like that can happen for our own game, and if it is simple enough it might be backported to H5.

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


Promising
Supreme Hero
disrupting the moding industry
posted July 03, 2017 11:25 PM
Edited by dredknight at 23:32, 03 Jul 2017.

Quantomas said:

You can break the .xdb files into parts. As far as I know all .xdb files in that folder are read in at start up in the order of the file time stamp. Newer ones override older ones.


Timestamp thing is clear but the "read all files in the folder" is new.
This means if I create a file called "random_stats.xdb" and put it in defaulstats.xdb folder it will be read as well?

Even if it works I do not understand how the separation will happen because all stats are under one chain here is an example.

The whole data in default stats resides between
<RPGStats ObjectRecordID="1"> and </RPGStats>

How it is supposed to take <TransformTable> and all inside it and put it in a separate file when it is locked under the following chain in default stats:
<RPGStats ObjectRecordID="1">
<combat>
<HeroSkills>
<Necromancer>
<Necromancy>
                                      <TransformTable>
                                      </TransformTable>
</Necromancy>
</Necromancer>
</HeroSkills>
</combat>
</RPGStats>

I made the same chain in the new file but it does not work.
Quantomas said:

But you know my stance on NCF. It will only be feasible if the modders can create new creatures and animations with a proper tool like Blender. Something like that can happen for our own game, and if it is simple enough it might be backported to H5.



3D modders are very rare creatures here.

On the Russian sites the things are a bit better they are pushing originality as far as they can but I believe they are also restricted by existing animations.

Besides the well known member Psatka, a 3D editor with the same level of skill is LordKhorne. He made the Sanctuary mod and the Chaos theory mod.
____________
Find an opponent at HoMM55 Tavern! | NCF Utility Alpha

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


Responsible
Famous Hero
AI Wizard
posted July 04, 2017 05:06 PM

dredknight said:
Timestamp thing is clear but the "read all files in the folder" is new.
This means if I create a file called "random_stats.xdb" and put it in defaulstats.xdb folder it will be read as well?

It's technically standard XML. If I remember correctly, reading the XML is delegated to a standard XML module. So it should support all common XML features, and I would be surprised if XML didn't include a mechanism to refer to other files. I have no time to experiment with it though. That's all I can offer on this feature. There is plenty of documentation around for XML.

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


Admirable
Omnipresent Hero
Tastes like chicken
posted July 05, 2017 01:09 AM

Thanks again.

And now for something completely different! How could I tweak this efreet mod to replace the unupgraded djinn? Original mod replaces the pit spawn.

I do not care about the abilities and texts, just the model, particles and animations.
____________
Being human is a roller coaster ride of emotions during rainstorms and sunshine, sprinkled with moments when you can almost reach the stars.

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


Promising
Supreme Hero
disrupting the moding industry
posted July 05, 2017 10:31 AM
Edited by dredknight at 10:38, 05 Jul 2017.

Here you go Elvin. Just put it in Data folder and it should work.
____________
Find an opponent at HoMM55 Tavern! | NCF Utility Alpha

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


Responsible
Famous Hero
AI Wizard
posted July 05, 2017 07:14 PM

Just to make it clear, XML has plenty of techniques to split definitions into parts.

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


Admirable
Omnipresent Hero
Tastes like chicken
posted July 06, 2017 07:06 PM

Fantastic
____________
Being human is a roller coaster ride of emotions during rainstorms and sunshine, sprinkled with moments when you can almost reach the stars.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This Popular Thread is 120 pages long: 1 2 3 4 5 ... 20 40 60 80 100 ... 116 117 118 119 120 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0727 seconds