Staredit Network

Staredit Network -> Modding Assistance -> To you AIScripters
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-08-07 at 18:40:26
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.

Report, edit, etc...Posted by TERRAINFIGHTER on 2006-08-07 at 20:37:35
...why not just give us the decompiled text file, it would help alot more (too lazy to extract it from the mpq then script tongue.gif)
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-08-08 at 07:34:31
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?
Report, edit, etc...Posted by Ojan on 2006-08-08 at 08:15:29
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... tongue.gif

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...
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-08-08 at 08:28:31
Poof.

ADD: Shoot, the problem is exactly the opposite of what you said. I'm ON an older version. tongue.gif

ADD: Nope, doesn't work on any version (that I've yet tried)...
Report, edit, etc...Posted by TERRAINFIGHTER on 2006-08-08 at 09:42:27
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?
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-08-08 at 09:58:46
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?
Report, edit, etc...Posted by TERRAINFIGHTER on 2006-08-08 at 10:01:38
start_town and a few definemax's, there's really not much you need tongue.gif
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-08-08 at 10:02:26
I'll try it.

ADD: Why don't blizzard's scripts use define_max???
Report, edit, etc...Posted by TERRAINFIGHTER on 2006-08-08 at 10:03:49
I'm not really sure, that's a question you'd have to ask them tongue.gif

Edit: I found your problem, your script needs more supply depots! tongue.gif (moved from earlier post so you'd see it)
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-08-08 at 10:05:34
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 tongue.gif)
Report, edit, etc...Posted by TERRAINFIGHTER on 2006-08-08 at 10:18:32
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.
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-08-08 at 10:49:29
I think the campaign header is just if you want to use campaign scripts, like the give_money or whatever and the nukepos.
Report, edit, etc...Posted by TERRAINFIGHTER on 2006-08-08 at 10:53:01
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
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-08-08 at 12:00:34
Same problems... I don't get what's going wrong.
Report, edit, etc...Posted by TERRAINFIGHTER on 2006-08-08 at 12:04:42
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
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-08-08 at 12:37:54
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?
Report, edit, etc...Posted by TERRAINFIGHTER on 2006-08-09 at 21:53:26
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?
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-08-10 at 09:04:45
That's probably it. But yeah, I got it to work smile.gif 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.
Report, edit, etc...Posted by TERRAINFIGHTER on 2006-08-10 at 09:16:41
I'll test it out and play with it when/if I can, this looks like it'd be pretty fun to play smile.gif (unlike the random mods people make)
Report, edit, etc...Posted by Killer_Kow(MM) on 2006-08-10 at 09:18:09
Oh, I wouldn't rush the comp. I didn't make it get much defense early on, so its an easy target tongue.gif But it sends pretty big attacks. Well, I guess now I can say:


>>>Topic Locked
Next Page (1)