Map Database  •  FAQ  •  RSS  •  Login

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

<<

Tom_cze

Serf

Posts: 5

Joined: 27 May 2014, 19:05

KaM Skill Level: Average

Post 30 May 2014, 19:59

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

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
<<

Michalpl

Sword Fighter

Posts: 318

Joined: 10 May 2014, 21:46

KaM Skill Level: Fair

Post 30 May 2014, 20:29

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

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;
<<

Tom_cze

Serf

Posts: 5

Joined: 27 May 2014, 19:05

KaM Skill Level: Average

Post 30 May 2014, 20:49

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

Thx for help,but i set ai first.The script working but bad.
Untitled 1.jpg
You do not have the required permissions to view the files attached to this post.
<<

Michalpl

Sword Fighter

Posts: 318

Joined: 10 May 2014, 21:46

KaM Skill Level: Fair

Post 30 May 2014, 20:59

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

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;
<<

Tom_cze

Serf

Posts: 5

Joined: 27 May 2014, 19:05

KaM Skill Level: Average

Post 30 May 2014, 21:01

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

Nový WinRAR ZIP archiv.zip
i will recorded video so you will see it

Here is the mission (its only begin)
You do not have the required permissions to view the files attached to this post.
<<

Michalpl

Sword Fighter

Posts: 318

Joined: 10 May 2014, 21:46

KaM Skill Level: Fair

Post 30 May 2014, 21:22

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

but whats the deal?
<<

Tom_cze

Serf

Posts: 5

Joined: 27 May 2014, 19:05

KaM Skill Level: Average

Post 30 May 2014, 21:25

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

i want this.player two have 9 barbarians,if they died,the script give player 2 new 9 barbarians or something else.
<<

Michalpl

Sword Fighter

Posts: 318

Joined: 10 May 2014, 21:46

KaM Skill Level: Fair

Post 30 May 2014, 21:29

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

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
<<

Tom_cze

Serf

Posts: 5

Joined: 27 May 2014, 19:05

KaM Skill Level: Average

Post 30 May 2014, 21:34

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

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.
Last edited by Tom_cze on 13 Sep 2021, 14:02, edited 3 times in total.
Reason: removed email address
<<

Michalpl

Sword Fighter

Posts: 318

Joined: 10 May 2014, 21:46

KaM Skill Level: Fair

Post 30 May 2014, 21:36

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

I don't have skype but you can communicate me with pm

Return to “General / Questions”

Who is online

Users browsing this forum: No registered users and 22 guests