Page 1 of 1

Script error [Error] (26:45): Closing parenthesis expected

PostPosted: 30 May 2014, 19:59
by Tom_cze
Hi , i making new map and i use first script and i dont know where is bad.i want from script if player 1 (on script 0) has 0 Barbarian script give him 9 troops at 15,9

There is script

begin
if ((States.StatUnitTypeCount(0,23) > 0) then
Actions.GiveGroup(0,23,15,,9,4,3,9);

exit

its for AI barbarian villiage.

Tom

PS: Sry for my english.thx

Re: Script error [Error] (26:45): Closing parenthesis expect

PostPosted: 30 May 2014, 20:29
by Michalpl
mistake here Actions.GiveGroup(0,23,15,,9,4,3,9);
should be
Actions.GiveGroup(0,23,15,9,4,3,9);
and note 0 if its a player value its +1 that means 0 is player 1 and 1 is player 2
if the player 2 is ai then it should be 1

proper code if ai is player 2
begin
if (States.StatUnitTypeCount(1,23) > 0) then
Actions.GiveGroup(1,23,15,9,4,3,9);
end;

Re: Script error [Error] (26:45): Closing parenthesis expect

PostPosted: 30 May 2014, 20:49
by Tom_cze
Thx for help,but i set ai first.The script working but bad.
Untitled 1.jpg

Re: Script error [Error] (26:45): Closing parenthesis expect

PostPosted: 30 May 2014, 20:59
by Michalpl
proper code if ai is player 1
begin
if (States.StatUnitTypeCount(0,23) > 0) then
Actions.GiveGroup(0,23,15,9,4,3,9);
end;

Re: Script error [Error] (26:45): Closing parenthesis expect

PostPosted: 30 May 2014, 21:01
by Tom_cze
NovĂ˝ WinRAR ZIP archiv.zip
i will recorded video so you will see it

Here is the mission (its only begin)

Re: Script error [Error] (26:45): Closing parenthesis expect

PostPosted: 30 May 2014, 21:22
by Michalpl
but whats the deal?

Re: Script error [Error] (26:45): Closing parenthesis expect

PostPosted: 30 May 2014, 21:25
by Tom_cze
i want this.player two have 9 barbarians,if they died,the script give player 2 new 9 barbarians or something else.

Re: Script error [Error] (26:45): Closing parenthesis expect

PostPosted: 30 May 2014, 21:29
by Michalpl
so change it to (this will work)
begin
if (States.StatUnitTypeCount(1,23) = 0) then
Actions.GiveGroup(1,23,15,9,4,3,9);
end;

instead of > make =

and the last 3,9 should be swaped of postion because 3 is amount and 9 is columns

Re: Script error [Error] (26:45): Closing parenthesis expect

PostPosted: 30 May 2014, 21:34
by Tom_cze
Thx Man,this work fine,

PS: Do you have skype ? if yes please add me (*cut*)


Please Lock this topik,thx

E i will see it,i swap it :)

E ok Thx :)

Mod edit: It's not wise to put your email address in plain text on a forum. Please PM anyone you want to give your email address.

Re: Script error [Error] (26:45): Closing parenthesis expect

PostPosted: 30 May 2014, 21:36
by Michalpl
I don't have skype but you can communicate me with pm