SCAI Editor Problems...

Help - Resources - AI Scripting - Grafting - Plugins - Modding Projects
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
User avatar
pandut
Posts: 26
Joined: Tue Jul 03, 2007 6:17 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

SCAI Editor Problems...

Postby pandut » Tue Jul 07, 2009 6:26 pm

I recently downloaded SCAI Editor 3.1, in hopes to begin modding AI scripts (Obviously).

My first script was simple, a Terran and Zerg script that only limited them to construct one building, and three units. This script of course, is for a certain mod.

However, SCAI keeps rejecting my script when I compile it, saying that there's errors, when there isn't. I've talked to few people about it, but this is out of there field of experience.

Here is the Terran script I'm using, the same error shows up for both Zerg and terran.

CODE; ASC3 File generated by ScAIEdit III
;
; Script name : Terran Expansion Custom Level

script_name Terran Expansion Custom Level
script_id TMCx

start_town
transports_off
farms_notiming
define_max 10 ghost
define_max 4 scv
define_max 40 marine
build 1 command_center 80
build 4 scv 40
give_money
attack_add 3 marine
attack_prepare
attack_do
attack_clear
clear_combatdata
build 2 command_center 80
give_money
defensebuild_gg 10 marine
defensebuild_gg 3 ghost
give_money
attack_add 15 marine
attack_add 1 ghost
attack_prepare
attack_do
attack_clear
clear_combatdata
build 3 command_center 80

:block1
give_money
attack_add 25 marine
attack_add 6 ghost
attack_prepare
attack_do
attack_clear
clear_combatdata
wait 50

goto block1

One of the people I talked to said this would be the correct AI script, although it keeps giving false errors.

This, is the error message I keep getting...

'1 error message

(38) Error! An integer was expected at parameter 1.'

Line 38 is 'attack_prepare'. I don't see any integer needed there...
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Archon_Wing » Tue Jul 07, 2009 10:37 pm

Weird, I don't get any errors if I copy/paste the script. Are you sure there's not an older version of the script in the aiscript.bin? Try deleting the terran script in the aiscript.bin and trying again. If that doesn't work, I'd recomend trying PYAI:
User avatar
pandut
Posts: 26
Joined: Tue Jul 03, 2007 6:17 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby pandut » Tue Jul 07, 2009 11:14 pm

[quote name='Archon_Wing' post='6960' date='Jul 7 2009, 02:37 PM']Weird, I don't get any errors if I copy/paste the script. Are you sure there's not an older version of the script in the aiscript.bin? Try deleting the terran script in the aiscript.bin and trying again. If that doesn't work, I'd recomend trying PYAI: [/quote]
There is no original Terran AI to this original script. I wanted to add AI for the other two factions, Zerg and Terran. And I've tried almost everything in the book to get it to work.

And how exactly to you use PYAI? I downloaded PYMS and all it did was give me a bunch of files...
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Archon_Wing » Tue Jul 07, 2009 11:20 pm

Make sure you have downloaded the exe version, (Unzip the files to a folder of your choosing) and run and then run pyai.exe .

Here's how to convert from a scaiedit file to a pyai one.
Make sure you have downloaded the exe version of PYMS , and unzipped it to a folder
In PYAI, click edit----> manage external definition files.

Then click the + icon.


Navigate to the folder you placed PYAI in (It should already be there by default). There should be a file called unitdef.txt ; select this file and click open.

Now click ok. Then, start a new aiscript.bin by clicking file---> new
Press the + icon in the toolbar on the left side, you will see a new script being created; click ok. Double click in this script. When it opens, delete everything in the window.

Copy and paste your scaiedit script in the window. Click the convert to pyai icon (2nd last from right). Click the check mark to check for any errors. Note that PYAI is case sensitive. Once that's done, close the window and say yes if you want to save.

You will see a new script created (Terran/Protoss/Zerg Expansion level). It is strongly recomended you export the script by right clicking on the script and choosing export. Name it anything you want but make sure it has a .txt at the end. In case anything goes wrong, you can simply import this text file into pyai (import is the 5th icon from bottom left of the toolbar)


Repeat this for any other scripts you wish to import
To save the aiscript.bin, click file---> save as. Save it to a folder you will remember and save the file as aiscript.bin

To actually play the AIs you will need to use WINMPQ to move the aiscript.bin into the BWAIwar4 exe file.
Follow the instructions here, though you will be using BWAIwar4.exe instead of blankai vista.exe, of course.
User avatar
pandut
Posts: 26
Joined: Tue Jul 03, 2007 6:17 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby pandut » Wed Jul 08, 2009 12:19 am

THANK YOU

I'd kiss you if I could :P

It AI's work very well, and with no problems. Thanks for the little tutorial as well :)
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Archon_Wing » Wed Jul 08, 2009 12:25 am

Ok good ^^
Scourge_Splitter
Posts: 36
Joined: Fri May 11, 2007 12:56 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Scourge_Splitter » Tue Aug 18, 2009 4:07 pm

[quote name='Archon_Wing' post='6960' date='Jul 8 2009, 12:37 AM']I'd recomend trying PYAI: [/quote]
I actually used PYAI a while back but I reverted back to SCAI 3.

PYAI crashed on me too often to be funny.
And the stupid thing was, I just clicked a liuttle too close to the screenborder.
But all my hard work back then was gone in an instant. Now I'm back at SCAI 3 and it's fine with me.
User avatar
Archon_Wing
Posts: 903
Joined: Wed Jul 25, 2007 11:22 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Postby Archon_Wing » Tue Aug 18, 2009 7:36 pm

The latest version hasn't ever crashed on me, and solved the above problem, though I will admit the previous versions may have been screwy. The validation is also much better.

[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “StarCraft Modding”

Who is online

Users browsing this forum: No registered users and 2 guests