Map Editor Bugs

Feedback for the articles that appear on Celestial Heavens.
User avatar
Hippotaur
Leprechaun
Leprechaun
Posts: 14
Joined: 07 Nov 2009
Location: San Francsico, California
Contact:

Map Editor Bugs

Unread postby Hippotaur » 17 Nov 2009, 06:58

If you would like to take a look at the original page visit this link:
https://www.celestialheavens.com/75
"Well, we did do the nose."

User avatar
Hippotaur
Leprechaun
Leprechaun
Posts: 14
Joined: 07 Nov 2009
Location: San Francsico, California
Contact:

Map Editor Bugs

Unread postby Hippotaur » 17 Nov 2009, 06:58

I have run into the "complex conditionals" problem. I will expand on GhostWriter's comment...

Generally I have found that this problem happens when:
1) There are more than 15 lines of commands within a particular Condition or Ask Question function. And basically 15 lines is the amount that is displayed in the script editor window. Each "line" is a different script editor choice: e.g. Display Message, Give Artifact, Increase Spell Points, etc. However, this problem does not happen within a Sequence statement.

2) There are too many conditions/ask questions nested within conditions/ask questions.

My workaround is this:

1) Of course, all scripts should start with the Sequence statement.
2) Put your Condition/Ask Question statement in the Sequence statement. Have the results trigger variables. If there will be many results, use numeric variables and assign a different number for each result you want. Sometimes you may want to break the conditions apart so that there is only one test and one result.
3) Add a Condition for each of the variable results from step #2 in the Sequence statement.

Example:

SEQUENCE
CONDITION
If Current Player Color = Red
SetBooleanVariable IsRed
Else
Do Nothing
CONDITION
If Current Player Color = Blue
SetBooleanVariable IsBlue
Else
Do Nothing
{...etc. through all the colours...}
CONDITION
If Current Player Color = Teal
SetBooleanVariable IsTeal
Else
Do Nothing
CONDITION
If Variable IsRed
Whatever you want Red to get/have...
Else
Do Nothing
{...etc. through all the colours...}
CONDITION
If Variable IsTeal
15 Things you want Teal to get/have...
Else
Do Nothing
CONDITION
If Variable IsTeal
The rest of the things you want Teal to get/have...
Else
Do Nothing

******

Using a numeric variable instead:

SEQUENCE
CONDITION
If Current Player Color = Red
SetNumericVariable PlayerColor = 1
Else
Do Nothing
{...etc. through all the colours...}
CONDITION
If Current Player Color = Teal
SetNumericVariable PlayerColor = 6
Else
Do Nothing
CONDITION
If Equals Variable Playercolor = 1
Whatever you want Red to get/have...
Else
Do Nothing
CONDITION
If Equals Variable Playercolor = 2
Whatever you want Blue to get/have...
Else
Do Nothing
{...etc. through all the colours...}
CONDITION
If Equals Variable Playercolor = 6
15 Things you want Teal to get/have...
Else
Do Nothing
CONDITION
If Equals Variable Playercolor = 6
The rest of the things you want Teal to get/have...
Else
Do Nothing

*******
Here is an example with the Ask Question function:

SEQUENCE
ASK QUESTION
"Does your hero want to slay the Jabberwock?"
Yes:
Set NumericVariable JabberwockAnswer = 1
No:
Set NumericVariable JabberwockAnswer = 2
CONDITION
If Equals Variable JabberwockAnswer = 1
...then put the all the stuff that happens if the answer was yes
Else
Do Nothing
CONDITION
If Equals Variable JabberwockAnswer = 2
...then put the all the stuff that happens if the answer was no
Else
Do Nothing

*******
I haven't had any problems once I learned to start splitting up the conditionals/questions like this.
"Well, we did do the nose."

kozmoteam
Leprechaun
Leprechaun
Posts: 1
Joined: 12 Jul 2014

Map Editor Bugs

Unread postby kozmoteam » 12 Jul 2014, 14:33

COMBAT Script

another version of workaround, where you aren't given a ghost if you lose:

SEQUENCE:

_COMBAT - enemy with an artifact X

_CONDITION

_ IF fled (#heroes and creatures = 0)

_ _THEN ......fled :P

_ _ELSE

_ _ _CONDITION

_ _ _ IF (has artifact X)

_ _ _ _THEN

_ _ _ _ SEQUENCE (won script)

_ _ _ _ _REMOVE ARTIFACT (artifact X)

_ _ _ _ _rest of the script

_ _ _ _ELSE

_ _ _ _ fail script



No disadvantages except there's a "looting" window after the combat where you just need to click OK, doesn't matter if you drag the "artifact X" on your hero or creature. No additional ghosts if you lost and your hero lays on the ground as a grey marker.
Edited on Sat, Jul 12 2014, 10:36 by kozmoteam


Return to “Articles”

Who is online

Users browsing this forum: No registered users and 16 guests