I'm learning to AIScript, and I'm having some problems. I made an extremely simple script to get myself going, and its already screwed up.
1) The computer acts strangely and sends its marines on random paths. It does not attack when I tell it to.
2) It freezes (yes freezes, not crashes) sometime in the process. It is my belief that it happeneds around the second set of "attack commands" but before the loop.
The modified script is the "terran campaign easy" script.
I will attach the MPQ, and the AIscript.bin.
...why not just give us the decompiled text file, it would help alot more (too lazy to extract it from the mpq then script
)
The script is supplied outside the MPQ, but if I must, I will. Wait 5 minutes.
CODE
script_name Custom, yay
script_id TLOf
start_campaign
wait 1
start_town
defaultbuild_off
default_min 0
wait 1
;will start with these
build 1 command_center 150
build 8 scv 130
build 1 refinery 80
build 1 barracks 80
build 3 supply_depot 80
train 3 marine 80
;gogo begin owning!
defenseuse_gg 3 marine
build 3 scv 80
train 5 marine
defenseuse_gg 5 marine
build 2 barracks
train 8 marine
attack_add 3 marine
attack_prepare
attack_do
:attack
build 1 academy 80
train 2 medic
defenseuse_gg 2 medic
train 13 marine
train 6 firebat
train 6 medic
attack_add 8 marine
attack_add 6 firebat
attack_add 4 medic
attack_prepare
attack_do
goto attack
Happy?
Didn't AI scripts cease to work after 1.12 or something? IskatuMesk never got them to work properly, and he's the AI god...
The
BW AI Project has some sort of launcher to make modified AIs possible I belive... Try to downgrade to 1.10 or something and see if it works better...
Poof.ADD: Shoot, the problem is exactly the opposite of what you said. I'm ON an older version.
ADD: Nope, doesn't work on any version (that I've yet tried)...
Things I noticed that might be mistakes:
1. custom name - I don't think your allowed to use symbols/extra characters in it. (remove comma)
2. I havn't heard of a bunch of these commands yet (like "start_campaign"), are you sure you're not making them up?
start_campaign shows that its starting a campaign map, and it should expect to have preplaced units, or something like that... And those were all there before I started. I just assumed they were necessary and went with it.
QUOTE
start_campaign
Starts the AI Script for Campaign.
QUOTE
start_town
Starts the AI Script for town management.
No idea what defaultbuild_off or default_min 0 are.
What do you suggest I use as headers?
start_town and a few definemax's, there's really not much you need
I'll try it.
ADD: Why don't blizzard's scripts use define_max???
I'm not really sure, that's a question you'd have to ask them
Edit: I found your problem, your script needs more supply depots!
(moved from earlier post so you'd see it)
That doesn't explain the way it acts. Play it and you'll understand... You'll have to make a map for it, unless you want me to attach mine... Which I suppose I could... One moment... (I did the same, but the map is still in the other post
)
It's most likely from the extra headers you're using, you should never use a header when you don't know it's function.
I think the campaign header is just if you want to use campaign scripts, like the give_money or whatever and the nukepos.
I think it's causing your problems, try removing the extra headers and make it build another supply depot where it's needed and during the attack block to see if it runs any smoother
Same problems... I don't get what's going wrong.
I think I know the problem, there's differant types of attack orders to order the units to attack differant ways,
and you didn't pick one so it's just using the default
I think I pretty much have the code fixed up (thanks, DoA), but I'm having a problem compiling my AIScript... I press the button, the little bar thing pops up for a tenth of a second and then dissapears, and nothing else happens.
Here's the code, by the way:
CODE
; ASC3 File generated by ScAIEdit III
;
; Script name : Terran 1 - Shareware
script_name Terran Campaign Easy - M
script_id TLOf
start_town
wait 1
define_max 11 scv
define_max 20 marine
define_max 20 firebat
define_max 20 medic
;will start with these
build 1 command_center 150
build 8 scv 130
build 1 refinery 80
build 1 barracks 80
build 3 supply_depot 80
train 3 marine
;gogo begin owning!
build 3 scv 80
defensebuild_gg 5 marine
defenseuse_gg 5 marine
build 2 barracks 80
train 8 marine
wait_train 8 marine
attack_add 3 marine
attack_prepare
attack_do
wait_finishattack
attack_clear
build 1 academy 80
defensebuild_gg 2 medic
defenseuse_gg 2 medic
:attack
train 13 marine
train 6 firebat
train 6 medic
wait_train 13 marine
wait_train 6 firebat
wait_train 6 medic
attack_add 8 marine
attack_add 6 firebat
attack_add 4 medic
attack_prepare
attack_do
wait_finishattack
attack_clear
goto attack
Am I compiling it wrong or something?
sometimes SCAIEdit has problems with compiling the AIScripts if they're too big (in total, not seperate files).
are you editing a file that was shorter than that one?
That's probably it. But yeah, I got it to work
I have made a total of 3 successful AIScripts (one of each race, hurrah).
If you want to see it, I'll give you my newest one:
Put the map in your maps folder and run the mod, play the map.
Note: It will only work on THAT map.
I'll test it out and play with it when/if I can, this looks like it'd be pretty fun to play
(unlike the random mods people make)
Oh, I wouldn't rush the comp. I didn't make it get much defense early on, so its an easy target
But it sends pretty big attacks. Well, I guess now I can say:
>>>Topic Locked