need scipting help

Maps and the art of mapmaking.
anoamas321
Leprechaun
Leprechaun
Posts: 8
Joined: 09 Jul 2008

need scipting help

Unread postby anoamas321 » 09 Jul 2008, 09:51

i am makeing new maps for the frist time it all was going well untill i went around to scirting im only usein a few basic things but it never seems to work heres my scipt and i tested the map and none of it seems to work can anyone help me

SetPlayerStartResources(1,15,15,5,5,5,5,15000);
SetPlayerStartResources(2, 10, 10, 5, 5, 5, 5, 10000 ) ;

EnableAIHeroHiring(2,"town1", false );

SetTownBuildingLimitLevel ("town1"10);
SetTownBuildingLimitLevel ("town2"12);

ChangeHeroStat( "Orrin",STAT_EXPERIENCE, 2000 );

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

Unread postby Franzy » 09 Jul 2008, 10:14

1st 2 lines are ok, but others contain errors. First of all, constants true and false are NOT defined. Use not nil and nil insted (true=not nil, false=nil). Second, read function descriptions more careful nad don't skip required parameters. Third, enable console and keep it opened while testing - it shows all errors (in red) and even provides line number.

anoamas321
Leprechaun
Leprechaun
Posts: 8
Joined: 09 Jul 2008

Unread postby anoamas321 » 09 Jul 2008, 10:38

how do i enable console and keep it opened while testing

User avatar
rdeford
Assassin
Assassin
Posts: 299
Joined: 17 Apr 2007
Location: Sequim, USA
Contact:

Unread postby rdeford » 10 Jul 2008, 15:18

anoamas321 wrote:how do i enable console and keep it opened while testing
Download The Basics of Heroes V Scripting ver. 2.0 for H5, HOF, & ToTE from the CH Downloads page. It tells you how to do it.
rdeford, Mage Of Soquim

“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."

Ernest Holmes 1984

anoamas321
Leprechaun
Leprechaun
Posts: 8
Joined: 09 Jul 2008

Unread postby anoamas321 » 10 Jul 2008, 16:18

yh i just tried following that guide n it still wont wrk

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

Unread postby Franzy » 10 Jul 2008, 18:46

Did you manage to open the console? If so, what did it write?

anoamas321
Leprechaun
Leprechaun
Posts: 8
Joined: 09 Jul 2008

Unread postby anoamas321 » 10 Jul 2008, 20:03

no i cant open console

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

Unread postby Franzy » 10 Jul 2008, 20:40

Follow any of the guides (official manual for example) that explain how to enable console. It's not that difficult, you only need to edit a couple of text files.

User avatar
rdeford
Assassin
Assassin
Posts: 299
Joined: 17 Apr 2007
Location: Sequim, USA
Contact:

Unread postby rdeford » 10 Jul 2008, 23:58

I apologize if the instructions in the guide are not well written. I can't think of anything to add except to say that you must check your work. Even a trivial typing error or even a missing space will prevent the console from opening. You must follow the directions explicitly and make no errors.
rdeford, Mage Of Soquim

“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."

Ernest Holmes 1984

anoamas321
Leprechaun
Leprechaun
Posts: 8
Joined: 09 Jul 2008

Unread postby anoamas321 » 11 Jul 2008, 10:23

yh i fink i got sometin wen i press ctrl it show me da co-ords under cusor but thats bout it wen i press ` notin happends,waht exacly does it look like

User avatar
rdeford
Assassin
Assassin
Posts: 299
Joined: 17 Apr 2007
Location: Sequim, USA
Contact:

Unread postby rdeford » 11 Jul 2008, 13:30

anoamas321 wrote:yh i fink i got sometin wen i press ctrl it show me da co-ords under cusor but thats bout it wen i press ` notin happends,waht exacly does it look like
Well, pressing CTRL to see the coordinates is standard game behavior.

The Console looks like a second window that occupies the entire top one third of the game window. It will have several lines of mono-spaced text in it telling you various things about the activity in the game. You cannot miss seeing it.

Here are some additional words that may help you get the console to display:

Basically, you have to edit two files.

The first file is the autoexec_a2.cfg file in the Ubisoft installation directory. The exact location of this file varies according to the choices you made when installing the game. I used the defaults and this is the path on my computer:

Code: Select all

C:\Program Files\Ubisoft\Heroes of Might and Magic V - Tribes of the East\profiles\autoexec_a2.cfg
You open this file with a simple text editor and add the new line shown below as the last line. The password is German, so don't try to understand it unless you know German. You must type the text exactly as shown (or copy/paste from here):

Code: Select all

setvar dev_console_password = schwinge-des-todes
The second file is the input_a2.cfg file found in your player Profile directory. My player profiles Profiles are located here:

Code: Select all

C:\Documents and Settings\Robert DeFord\My Documents\My Games\Heroes of Might and Magic V - Tribes of the East\Profiles
Choose the profile you are going to test your map with and open that directory. Find the input_a2.cfg and open it for editing. Read the directions in the guide as to where to add this line. This is the line that makes the ` key display the console. You must type this line without errors or copy it from here:

Code: Select all

bind show_console '`'
As long as you didn't make any typos, and you open the game and change to the same profile as you edited, the console will open when you press the ` key.
rdeford, Mage Of Soquim

“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."

Ernest Holmes 1984

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

Unread postby Franzy » 11 Jul 2008, 13:50

If I'm not mistaken, Schwinge des Todes means "Seeder of Death" :) Am I right, Mystic Phoenix?

anoamas321
Leprechaun
Leprechaun
Posts: 8
Joined: 09 Jul 2008

Unread postby anoamas321 » 11 Jul 2008, 14:20

yh i got the consol open but it just says scipt failed unknown error help what can i do

User avatar
rdeford
Assassin
Assassin
Posts: 299
Joined: 17 Apr 2007
Location: Sequim, USA
Contact:

Unread postby rdeford » 11 Jul 2008, 15:46

anoamas321 wrote:yh i got the consol open but it just says scipt failed unknown error help what can i do
Welcome to H5 scripting!

Read the scripting guide you downloaded, especially the section on troubleshooting. And, as Franzy says, read the function descriptions carefully and check all your work. If you still cannot find the error, try commenting out your script lines until the error goes away. When it does, the last line you commented out contains the error. Study it carefully, then rewrite it and try again.
rdeford, Mage Of Soquim

“Forgiving and being forgiven, loving and being loved,
living and letting live, is the simple basis for it all."

Ernest Holmes 1984


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: Amazon [Bot] and 1 guest