MakeHeroReturnToTavernAfterDeath

Maps and the art of mapmaking.
Mushimoo
Leprechaun
Leprechaun
Posts: 3
Joined: 08 Jul 2010

MakeHeroReturnToTavernAfterDeath

Unread postby Mushimoo » 08 Jul 2010, 23:29

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?

User avatar
Mirez
Moderator
Moderator
Posts: 1512
Joined: 28 Aug 2006
Location: in the core of the hart of the centre of everything

Unread postby Mirez » 09 Jul 2010, 17:14

moved to mapmaking section
treants are dendrosexual 0_o

User avatar
GreatEmerald
CH Staff
CH Staff
Posts: 3330
Joined: 24 Jul 2009
Location: Netherlands

Unread postby GreatEmerald » 09 Jul 2010, 18:34

I bet this is not about the original Heroes games?..

Mushimoo
Leprechaun
Leprechaun
Posts: 3
Joined: 08 Jul 2010

Unread postby Mushimoo » 09 Jul 2010, 20:27

It is, its about HoMM5, making a map. The title is the name of the command I am trying to figure out.

User avatar
GreatEmerald
CH Staff
CH Staff
Posts: 3330
Joined: 24 Jul 2009
Location: Netherlands

Unread postby GreatEmerald » 09 Jul 2010, 20:38

MMH5 is not original, it's the Ashan universe :p Original universe is HoMM1-4 and MM1-8, with MM9 being questionable.

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 12 Jul 2010, 03:47

Correct code for your case:

Code: Select all

MakeHeroReturnToTavernAfterDeath("Hero8",not nil, 1)
P.S. True and false constans are not defined. Use 'not nil' and 'nil' instead.

Mushimoo
Leprechaun
Leprechaun
Posts: 3
Joined: 08 Jul 2010

Unread postby Mushimoo » 12 Jul 2010, 21:19

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?

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 13 Jul 2010, 04:23

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?

bkknight2602
Pixie
Pixie
Posts: 100
Joined: 23 May 2010
Location: Texas

Unread postby bkknight2602 » 20 Aug 2010, 19:43

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.

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 22 Aug 2010, 17:26

That's because deadguy function is called AFTER hero death, while you need to use MakeHeroReturnToTavernAfterDeath BEFORE death. I suggest using PLAYER_ADD_HERO trigher instead.

bkknight2602
Pixie
Pixie
Posts: 100
Joined: 23 May 2010
Location: Texas

Unread postby bkknight2602 » 22 Aug 2010, 20:07

Nice idea, tried it and worked perfectly, thanks.


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 11 guests