I'm attempting to use this script command in my created map. The basic attempt is to have a single hero for all forces the entire time, none of which are entirely defeatable. So I banned all heroes except the few I made and now want this trigger to work. Does anyone know the correct scripting I would to input to use this effectively? This is what I have.
MakeHeroReturnToTavernAfterDeath ( "Hero8" , true, "heroShouldStayAtTavernUntilHired" = 0 )
The Editor recognizes all those commands, yet when I test it, my Hero just disappears into the oblivion after he dies. Anyone have a clue how to work this trigger?
MakeHeroReturnToTavernAfterDeath
- GreatEmerald
- CH Staff
- Posts: 3330
- Joined: 24 Jul 2009
- Location: Netherlands
- GreatEmerald
- CH Staff
- Posts: 3330
- Joined: 24 Jul 2009
- Location: Netherlands
Correct code for your case:
P.S. True and false constans are not defined. Use 'not nil' and 'nil' instead.
Code: Select all
MakeHeroReturnToTavernAfterDeath("Hero8",not nil, 1)
I put
MakeHeroReturnToTavernAfterDeath ("Hero8". not nil, 1)
and still no luck. I've read some scripting guides, and followed the directions, but it still isn't working.
For clarification, the Adobe Document "HOMM5_A2_Script_Functions" says "heroShouldStayAtTavernUntilHired" is part of the syntax, but is that something I have to put in the script, or is it just the document telling me what the last part of the script command stands for?
MakeHeroReturnToTavernAfterDeath ("Hero8". not nil, 1)
and still no luck. I've read some scripting guides, and followed the directions, but it still isn't working.
For clarification, the Adobe Document "HOMM5_A2_Script_Functions" says "heroShouldStayAtTavernUntilHired" is part of the syntax, but is that something I have to put in the script, or is it just the document telling me what the last part of the script command stands for?
You're obviously not a programmer. Syntax is a set of rules that defines interface of a function. There are special notations that are used worldwide, and programmers do understand them. For example if a func description tells something like this
MyFunction (parameter1, parameter2 = 0 )
it means that you can omit parameter2 in which case the compiler will assume that it has value of 0. In other words, 0 is the default value for the parameter2, and you only have to input it only if you want a non-default value for this.
As for your case.
MakeHeroReturnToTavernAfterDeath ("Hero8". not nil, 1)
--------------------------------------------------------^
You have a dot not a comma in your code?
MyFunction (parameter1, parameter2 = 0 )
it means that you can omit parameter2 in which case the compiler will assume that it has value of 0. In other words, 0 is the default value for the parameter2, and you only have to input it only if you want a non-default value for this.
As for your case.
MakeHeroReturnToTavernAfterDeath ("Hero8". not nil, 1)
--------------------------------------------------------^
You have a dot not a comma in your code?
-
- Pixie
- Posts: 100
- Joined: 23 May 2010
- Location: Texas
As Franzy indicated in his post:
MakeHeroReturnToTavernAfterDeath ("Heam", not nil, 1);
Works perfectly. In my instance Findan was returned to the tavern in the second position.
I then attempted to tinker with the statement:
humanplayer = GetCurrentPlayer();
Trigger(PLAYER_REMOVE_HERO_TRIGGER,humanplayer, "deadguy");
function deadguy(killedhero)
MakeHeroReturnToTavernAfterDeath (killedhero, not nil, 1);
end;
This did not work.
MakeHeroReturnToTavernAfterDeath ("Heam", not nil, 1);
Works perfectly. In my instance Findan was returned to the tavern in the second position.
I then attempted to tinker with the statement:
humanplayer = GetCurrentPlayer();
Trigger(PLAYER_REMOVE_HERO_TRIGGER,humanplayer, "deadguy");
function deadguy(killedhero)
MakeHeroReturnToTavernAfterDeath (killedhero, not nil, 1);
end;
This did not work.
-
- Pixie
- Posts: 100
- Joined: 23 May 2010
- Location: Texas
Who is online
Users browsing this forum: No registered users and 1 guest