Staredit Network > Forums > SC1 Mapping Tools > Topic: Custom AI script on SCMDraft
Custom AI script on SCMDraft
Jul 11 2013, 11:08 am
By: InsaneMonster  

Jul 11 2013, 11:08 am InsaneMonster Post #1



I would like to make a custom map for starcraft using SCMdraft 2... Now, I placed everything, made scripts and so on.
The map runs great! Now, I would like to put my own AI script into the map... I know how to do:
I edited patch_rt.mpq (I made also backup, don't worry) modifing aiscript.bin (adding my own script with PyAI) and stat_txt.tbl (adding one line "Custom 1 - Terran Town A<0>", with neutral Locale ID). Now the problem:

StarEdit sees my script, I tried it and it works bot in editor and when I play the map, but in SCMdraft it didn't show from the cascade menu... I check the profile settings and patch_rt.mpq is the last one in the order (I also try to invert that but nothing changed)...

I'm going mad, is SCmdraft supposed to read the same MPQs of StarEdit or not? :flamer: :flamer: :flamer:

Also I noticed that: if I change the SCMdraft 2 Profile Settings Locale ID to 1040 (Italian language) I get units in my language (I'm Italian xD) but AI scripts still are in english... It's seems like SCMdraft has a sort of backup of aiscript.bin and stat_txt.tbl and didn't see any modifications to that...

Someone expert could help me? I'm desperate I want SCMdraft terrain xD

So: How to import a Custom Made aiscript.bin and stat_txt.tbl into SCMdraft 2? What the hell need I to do with those mpqs?

Thank you in advance :D



None.

Jul 11 2013, 2:22 pm Roy Post #2

An artist's depiction of an Extended Unit Death

I'm not sure of the answer to this, but it seems there are two possibilities:

1) ScmDraft hardcoded the AI scripts.
2) ScmDraft caches the AI scripts, or uses a default when it cannot find it.

If it's #1, there isn't much you can do. You can probably reference the script using StarEdit or Xtra Editor and then do the rest of your map work in ScmDraft.

If it's #2, try putting the file outside of your SC directory and then referencing the full path to it in ScmDraft's profile settings. To do this, when ScmDraft starts up, hit "Edit" on the profile screen (instead of opening the editor) and remove the "%SCPATH%patch_rt.mpq" line. Then, paste in the full path of the new patch_rt file and hit "Add" to add it to the list, and then apply/save settings and start up that profile.




Jul 11 2013, 6:41 pm InsaneMonster Post #3



I tried the second one and it didn't work... This is really annoying...

Ok, fine... Ok I'll load my beautiful map in StarEdit and then reload in SCMDraft... I'll remake the whole terrain...

Thank you very much ^^

But... an other question... When I try to use the trigger text editor in SCMdraft... Save doesn't work (in this windows, I click on it)... So, I save and then when I reopen I found no changes... I don't understand... How to script by this window? (using this I can solve the script problem putting the ID of my script in the command)

I also tried to save in the trigger window then save the map then reopen and still nothing changed...



None.

Jul 11 2013, 7:10 pm Roy Post #4

An artist's depiction of an Extended Unit Death

Quote from InsaneMonster
But... an other question... When I try to use the trigger text editor in SCMdraft... Save doesn't work (in this windows, I click on it)... So, I save and then when I reopen I found no changes... I don't understand... How to script by this window? (using this I can solve the script problem putting the ID of my script in the command)

I also tried to save in the trigger window then save the map then reopen and still nothing changed...
Hit the compile button. It's the last button on the toolbar menu (it looks like a blue diamond above a checkmark). If all goes well, it will say it started and finished compiling the triggers.




Jul 11 2013, 7:13 pm jjf28 Post #5

Cartography Artisan

most of the planned functionality in SCMDrafts trigedit wasn't completed, the button you use to 'compile' triggers into your map is here:



Seems the 4-byte ID of scripts is loaded directly into text trigs, so you should be able to just copy that value from a quick-y map made in staredit, though there's always a chance it will cause problems in classic trigs.

edit: ninja'd :kame:



Rs_yes-im4real - Clan Aura - jjf28.net84.net

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Jul 11 2013, 7:16 pm InsaneMonster Post #6



Ok, I did it... Thanks :D I use the standard window to create a generic Run AI script at location (for example Enter Nearest Bunker)...
I open the text trigger editor, I compile, it works.
Fine, then I changed the ID of Enter Nearest Bunker (EnBk) to mine (Cu01, the one is showed in the same window if I open the StarEdit map in SCMDraft and that works if I save the imported map in SCMDraft and then play) and it says Error at Line 514 (the last line)...

Any idea of the reason? :crazy:



None.

Jul 11 2013, 7:24 pm jjf28 Post #7

Cartography Artisan

double check that your syntax is correct

it might be checking whether the ID matches one it's familiar with, you can try inserting the ID directly into the chk file (from scmdraft's save as, save as .chk, open with notepad++ or HxD's hex editor, ctrl+find the current ID, then replace it with yours, then reload and resave as .scm/.scx).


Edit: oh wait, error at last line? that might just be signaling success

Post has been edited 2 time(s), last time on Jul 11 2013, 7:52 pm by jjf28.



Rs_yes-im4real - Clan Aura - jjf28.net84.net

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Jul 11 2013, 8:13 pm Dem0n Post #8

ᕕ( ᐛ )ᕗ

I haven't modified ai scripts in a long time, but what you maybe could do is modify an already existing AI script, like one of the campaign mission scripts, and then just select that one in your trigger. Then, the game will run that script, but since your mod is different, it will run the modified version instead of the default one.



Memes gather, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die at my post. I am the sword in the darkness. I am the memer on the walls. I am the shield that guards the realms of memes. I pledge my life and honor to the Meme's Watch, for this meme and all the memes to come.

Jul 15 2013, 5:13 pm InsaneMonster Post #9



Sorry for late reply, I was at the seaside...

Quote from jjf28

Edit: oh wait, error at last line? that might just be signaling success


What do you mean by that? ^^
It doesn't save so it's not a success I believe...
Any idea how to fix this?

Quote from Dem0n
I haven't modified ai scripts in a long time, but what you maybe could do is modify an already existing AI script, like one of the campaign mission scripts, and then just select that one in your trigger. Then, the game will run that script, but since your mod is different, it will run the modified version instead of the default one.

I dislike modifing everything... I know it's better, but I wouldn't do that unless I can't in any other way....


In any case, for the next maps I will make everything in StarEdit and then edit the last thing in SCMdraft (such as terrain doddoads, brushes, players and so on...)



None.

Jul 15 2013, 6:41 pm Roy Post #10

An artist's depiction of an Extended Unit Death

Quote from InsaneMonster
What do you mean by that? ^^
It doesn't save so it's not a success I believe...
Any idea how to fix this?
Looks like there is no error message for unknown AI scripts in ScmDraft. The reason it isn't saving is because it doesn't recognize the script ID, which means you can't just put in your own ID and have ScmDraft interpret it.

Demon's solution would be the best if possible.

Quote from InsaneMonster
In any case, for the next maps I will make everything in StarEdit and then edit the last thing in SCMdraft (such as terrain doddoads, brushes, players and so on...)
You can copy/paste the terrain/doodads/units in ScmDraft from one map to another, so you can move any data that won't retain in the other editor to a temporary map and then paste it back over when you switch back to ScmDraft.

To copy everything on the map with ScmDraft, change the first dropdown on the toolbar to "Copy\Cut\Paste\Brush" and then select the entire map and copy it to your clipboard.

Alternatively, you can use http://www.staredit.net/files/460/, which is more powerful and will let you export things like locations and whatnot.




Oct 21 2013, 9:35 pm jjf28 Post #11

Cartography Artisan

Chkdraft's text trigs are now operational and accept arbitrary script names, I would backup your map before editing though, as my text trigs are quite new and might still make a mistake or two.

CHKD is a non-destructive editor (only changes what you ask it to) so it won't mess with SCMDraft terrain.

http://www.staredit.net/files/2741/



Rs_yes-im4real - Clan Aura - jjf28.net84.net

Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:14 pm]
Suicidal Insanity -- science, such as at what temperature do you cook a steak?
[08:04 pm]
jjf28 -- it's where we all raid Heinermann's apartment for Canadian snacks and perform science o.o
[08:02 pm]
dumbducky -- Also wtf is SENCon?
[08:02 pm]
dumbducky -- KrayZee
KrayZee shouted: What happened to his latova website?
THe people demand answers
[11:02 am]
Pr0nogo -- woah, you can't call me an h for being g
[10:06 am]
Suicidal Insanity -- If you are going there .... and kids :P
[06:55 am]
IlyaSnopchenko -- And chicks
[04:15 am]
Oh_Man -- And horses
[04:15 am]
Oh_Man -- And planes
[2019-8-20. : 10:00 pm]
Suicidal Insanity -- I think that kinda matches a car :D
Please log in to shout.


Members Online: Roy, UEDCommander, lifebot