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 4 - Lands of Axeoth > Thread: Getting a homemade map into the game?!
Thread: Getting a homemade map into the game?! This thread is 2 pages long: 1 2 · «PREV
Teller
Teller

Tavern Dweller
posted April 02, 2020 01:22 AM
Edited by Teller at 01:27, 02 Apr 2020.

iliveinabox05 said:
You can't make a sequence in the actual "if" block (the top of the three). That is where your actual condition goes, which is what I put inside the parentheses in my example.

The second block going down is for when the condition is true, and the third for when it is false. In these two blocks they do start out with a sequence script, so you just click new and add the necessary scripts. So when you click new, you add another conditional, which will give you a second "if" statement.

I do not show "then" or "else" to make the pseudo script code cleaner. In programming, the general syntax is:

if (condition)
{
   // path for condition is true
   // this is the equivalent of the "then" block in the editor
}
else
{
   // path for condition is false
}

There is nothing in the else blocks for what you want to do because you don't need to take any action in them.

If you are instead asking how to put more than one script for the condition (my third if statement), then you start with the "equals" script in the condition. Edit the top block and select variable, and set it to current day. Edit the lower block and select "plus", which will bring up another dialog. Edit the top block and select your startQuestDay variable. Edit the bottom block and select "number" and set it to 20.

Either way, you should probably read this [url=https://www.celestialheavens.com/homam-iv/general/scripting-guide]scripting guide[/url] thoroughly, which covers all the basics.


I really and truly believe I did everything correct, but there must have been something I misunderstood, cause it did not work :-( I've looked it through several times and can't find the possible mistake!

But even if it didn't work, getting to understand your scripting, has made me understand the variables and booleans way better now! Where your link didn't really help me :-/ I overall understand a lot of the scripting, having done quiet a fair bit of it throughout the time, but the variables and booleans I haven't worked with in ages - I only remember having worked a bit with booleans years and years ago, but forgotten it and haven't been able to grasp it by reading the guides.

But getting to understand it better actually means I have found a little different way to make the scripting work!

In the initial timed event i've made "isQuestActivated" be "TRUE" from day one. "isQuestComplete" is obviously "FALSE". "StartQuest" I have completed removed out of all scripting.

The second timed even has been changed a bit, too:

Timed event day 20, never reoccurs:
Sequence:
1st Conditional action:
If
'isQuestComplete'

Then:
'Remove script'

2nd Conditional action:
If:
'isQuestActivated'

then:
[conditional action] if not 'isQuestComplete'

Then
   Purple Player Loses


The Quest Hut they have to reach goes like this:
Conditional action
If:
This Army has the heroes named X X X

Then:
Set 'isQuestComplete' to 'TRUE'
Set 'isQuestActivated' to 'FALSE'
Display "XXX"
Display "XXX"
Remove Script

***

It might not be the way you wrote to do it, but it works and I can truly thank you for making me understand the scripting through your examples - thank you for your immense patience!

I am just a little bit annoyed, that I didn't get the "current day" = "startQuest" + 20 to work, as that knowledge might come in handy somewhere else!

But that time, that sorrow, as we say in Danish (and if it ever becomes relevant for me). But maybe I can make it work then, if I should need it! :-)
____________
Best regards
Rikke - Denmark

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


Honorable
Famous Hero
posted April 02, 2020 03:50 AM

Hey that's alright, at least you got it to do what you needed it to do!

But yeah, being able to really use the numeric variables and booleans will give you the freedom to do pretty much anything you want to with scripting. I've got loads of custom skills and abilities, random battles, and much more that I've been able to accomplish with the available scripts

And with the Advanced Options Map Editor, copying and pasting these scripts and events between objects and maps is a HUGE time saver.

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

Page compiled in 0.0265 seconds