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