DarkBlizz

Game On => STARCRAFT II: WINGS OF LIBERTY => Not enough Pylons => Topic started by: redspike474 on February 27, 2010, 02:26:50 AM

Title: Tutorial : How to play against ai
Post by: redspike474 on February 27, 2010, 02:26:50 AM
Hello,
                 i have been doing some research into Ai in starcraft 2, im sure now everyone has played lazytowns sandbox mod, which is great, big thanks to them,
your probally borred of playing against yourself,
here i will explain how to edit a map file to add ai.

Currently the ai only attack you if you attack them, and do not come looking for you or build ect, so they are kind of brain dead. maybe you would say not even ai? however its a step further than playing with yourself.

first you will need a mpq editor.

use your mpq editor to open the map you wish to add ai to,
find and extrac the file called objects.file

open this file in notepad.

this file is a file generated by the sc2 map editor, it contains the location of all the maps objects such as minerals gas rocks watch towers ect. but also could contain units heros buildings effects ect. to add a unit to the objects list you must use the correct name for the unit .

here is a example. this line places a highyeild mineral filed at the specifyed location.

<Unit id="66" variation="7" position="49,86.5,0" scale="1,1,1" unitType="HighYieldMineralField">

if you modify it to this

  <Unit id="66" position="49,86.5,0"  scale="1,1,1" unitType="Zealot" player="2"/>
adding the player="2" stops the unit from being neutral.

other options you can experiment with are
Variation
scale
rotation
let me know if you find any others, you can use this to add buildings critters anything to your map. tricky part is working out the positions.
Does anyone know a debug way of showing position of the cursor?

once you have edited you objects file, readde it to the s2ma file .replaceing the original,
then run your m ap with lazytown !

hopefully using this method we can create some maps that are more intresting than playing on our own.

Also ive figured out alot more for custom mods. such as for each map u can have custom units , custom upgrades ,and its very easy to change the atmosphere of a map, all can edited per map with out effecting other maps wich is really cool and loads of possibiltys for mods.

Also i have been looking into gettin ai to work correctly.
firstly im not sure exactly what the lazytown crack does, does it just boot you into a melee  game?  does it say victory when u start because there is no ai player, there for you have won?
anyways i have asumed that the reason for the ai not apearing is because the maps are not setup for or are not triggering  ai to spawn when the map is loaded,
You can edit the .galaxy script files but as of yet i havent managed to get ai that think, they just stand there,
if anyone that knows more about the galaxy scripting would like to help, than please do,
maybe we need to just setup the maps correctly.
this is just speculation though.

anyways its really really late here 7 in the morning. so i probally have done a bad job at typeing all this, i just thought people might like to play against some computer before i go to sleep.
im more than happy for a mod to edit my post , as i really am half asleep whilst i type this.
here is a pic showing it working. in the picture i have replaced the watch towers with Zelots, as you can see they attack when i get close.
(http://s3-llnw-screenshots.wegame.com/10-8257530363722012/8257530363722012.jpg)
Title: Re: Tutorial : How to play against ai
Post by: Rain[sun] on February 27, 2010, 02:36:05 AM
Didnt test it out but, props if you got it, wont be very hard id imagine to get a fully functioning player now

Edit: You could probably do some major editing and create a zombie-base to siege, which could definitely keep me entertained till a fully functioning crack comes out, will see what I can come up with when I get on tomorrow!

As you mentioned with the possibilities, that is what the designers hinted at about the Editor having limitless possibilties, nice to know it wasnt all talk for once
Title: Re: Tutorial : How to play against ai
Post by: MiCrOMaN1 on February 27, 2010, 02:43:38 AM
Yo! You got it bro! It works fine~
So far I've created an entire Terran base as an AI lol...too bad it doesn't do anything.
Hmm...Did you know that if you open up the trigger file using MPQ extractor, you can edit the triggers...but you need to know its ID...so that won't help. LoL.
Title: Re: Tutorial : How to play against ai
Post by: openheimer on February 27, 2010, 03:31:44 AM
Oh sweet, could you post your objects.file or map file so we could mess around with it without creating one of our own?


If anyone else creates one that they enjoy, would you mind posting it? I know it's not much at all but it can give me something to mess around with for little bit.


Thanks
Title: Re: Tutorial : How to play against ai
Post by: sYk0 on February 27, 2010, 04:10:01 AM
@redspike474: Nice find, very nice indeed :D

I started messing around with the map files a few mins ago and have already found something very interesting, which i'm sure all of you will find interesting too.

All I did was add a (one) command to the MapScript.galaxy file and have managed to spawn a second base (without editing the "objects.file")

Some key things you may want to take note of:
Technically, all I did was create an additional loop in the "MapScript.galaxy" file, which made it initialize twice.

But hey, it's a starting point.
Title: Re: Tutorial : How to play against ai
Post by: Rain[sun] on February 27, 2010, 04:10:01 AM
True enough, just copying the file here will save everyone else some time, if it isn't done tomorrow then I'll post what I can get!
Title: Re: Tutorial : How to play against ai
Post by: lovetoby on February 27, 2010, 04:35:14 AM
hi guys mabe we schould compare sc1 trigger and put them into trigger files ill play with it now... an i thin beginning here and writing a few startoptions would be nix progress so i thing the uni id could let the unit walk over to som coordinates ... just triggering no ai but the native ai will start if they see non friendly one?! http://nopaste.info/ef673f53a3.html (http://nopaste.info/ef673f53a3.html)
Title: Re: Tutorial : How to play against ai
Post by: ups on February 27, 2010, 04:35:29 AM
Can you please put a link to were to download the map editor.

I tried to open the .s2ma with regular mpq editors ... but it did not open.
Title: Re: Tutorial : How to play against ai
Post by: lovetoby on February 27, 2010, 04:39:58 AM
Quote from: ups on February 27, 2010, 04:35:29 AM
Can you please put a link to were to download the map editor.

I tried to open the .s2ma with regular mpq editors ... but it did not open.

EDITOR
http://www.zezula.net/en/mpq/download.html (http://www.zezula.net/en/mpq/download.html)

Maybe someone can tell me the Terrain - Thor Unit Id and attributes?
Title: Re: Tutorial : How to play against ai
Post by: Blackcode on February 27, 2010, 04:51:02 AM
I think we should dig into this even more.... i'll ask for a wiki place to start developing.....

the AI is initialized from the map so teoreticalli we've could build custon AI maps

    if (runActions) {
        MeleeInitResources();
        MeleeInitUnits();
        MeleeInitAI();
        MeleeInitOptions();
    }
Title: Re: Tutorial : How to play against ai
Post by: Blackcode on February 27, 2010, 04:52:48 AM
Quote from: lovetoby on February 27, 2010, 04:35:14 AM
hi guys mabe we schould compare sc1 trigger and put them into trigger files ill play with it now... an i thin beginning here and writing a few startoptions would be nix progress so i thing the uni id could let the unit walk over to som coordinates ... just triggering no ai but the native ai will start if they see non friendly one?! http://nopaste.info/ef673f53a3.html (http://nopaste.info/ef673f53a3.html)

I think the most closed parent to sc2 is war3 not sc1
Title: Re: Tutorial : How to play against ai
Post by: dodongbadong on February 27, 2010, 05:06:27 AM
i agree with blackcode..

the setting and unit handling is quite war3 though its in sc background. . well its a combination of the two. but definitely the economy is sc. hahaha.

man i cant wait playing online or atleast a good ai to understand more about the game. hehe

but i think multiplayer on own server is much better playing against other darkblizz would much more be fun too bad no one has any idea on how to make 1 yet since almost all of us have not played on real server coz of beta key thingy.. hehe

or not really server may be a lan like hamachi style or changing the server to connect to.. eeerrrr cant understand my self anymore on what to do to have a possible multiplayer game with beta..
Title: Re: Tutorial : How to play against ai
Post by: araknee on February 27, 2010, 05:25:09 AM
if someone manages to make an AI map, please post it here^^
thx
Title: Re: Tutorial : How to play against ai
Post by: ooni on February 27, 2010, 05:26:28 AM
Quote from: Blackcode on February 27, 2010, 04:51:02 AM
I think we should dig into this even more.... i'll ask for a wiki place to start developing.....

the AI is initialized from the map so teoreticalli we've could build custon AI maps

    if (runActions) {
        MeleeInitResources();
        MeleeInitUnits();
        MeleeInitAI();
        MeleeInitOptions();
    }

Hate to burst people's bubble but MeleeIntAI() is the same as the JASS (wc3 language) for intialising a computer player.
What it does is looks if there is a computer slot and assign's to that slot with AI.
^The very thing we need to do, oh the irony~

What we need is simple, use galaxy to create starting units for player 2 and set AI to the player. I could do this in JASS but I do not know the functions names in galaxy. If anyone has list of functions I'll be happy to do this~ But if someone did have the list of functions, this would have been already done.

Well we can deduce that from the following galaxy code that
        MeleeInitResources(); This function gives each player in slot starting resources for melee (50 minerals)
        MeleeInitUnits(); This function gives each player in slot starting units (workers and base)

etc and etc
Title: Re: Tutorial : How to play against ai
Post by: useruseryey on February 27, 2010, 05:39:36 AM
This is WORKING!
I'm making a huge zerg fleet to hit 10 static marins and one thor standing in the corner lol...

anyone up for making a map with a full base with bunkers, turrets and whatever? is it doable? still not really AI but at least some sort of simulation on attacking a baseץץ
Title: Re: Tutorial : How to play against ai
Post by: Odoyle721 on February 27, 2010, 05:54:56 AM
I found some insight into the Galaxy code here

http://www.sc2armory.com/forums/topic/12295 (http://www.sc2armory.com/forums/topic/12295)
Title: Re: Tutorial : How to play against ai
Post by: Valkirie on February 27, 2010, 06:05:45 AM
In each map we can find.


<Point id="1" position="41.5,21.5,0" scale="1,1,1" type="StartLoc" name="Start Location 001" color="0,0,0,0"/>
<Point id="2" position="49.5,114.5,0" scale="1,1,1" type="StartLoc" name="Start Location 002" color="0,0,0,0"/>
<Point id="3" position="134.5,114.5,0" scale="1,1,1" type="StartLoc" name="Start Location 003" color="0,0,0,0"/>
<Point id="4" position="126.5,21.5,0" scale="1,1,1" type="StartLoc" name="Start Location 004" color="0,0,0,0"/>

What about replacing the Location 002/003/004 by:

<Unit id="9997" position="49.5,114.5,0"  scale="1,1,1" unitType="Hatchery" player="2"/>
<Unit id="9998" position="134.5,114.5,0"  scale="1,1,1" unitType="Nexus" player="3"/>
<Unit id="9999" position="126.5,21.5,0"  scale="1,1,1" unitType="CommandCenter" player="4"/>



Possible somehow ?
Title: Re: Tutorial : How to play against ai
Post by: 2g4u on February 27, 2010, 06:07:22 AM
I am 90% done with a custom map in which the goal is to reach the center and eliminate all the troops there. Ofc no victory or defeat conditions.
Title: Re: Tutorial : How to play against ai
Post by: aimaimaim on February 27, 2010, 06:31:00 AM
woooooooooooooooooo

LOVE FORE DEVS!!!!
Title: Re: Tutorial : How to play against ai
Post by: kdronez on February 27, 2010, 06:58:23 AM
Strange,but when I edit Objects file and put it back in the s2ma file my Sc crash.
I think that even if you guys add 2nd AI player it wont start to build or do smth becouse with this crack you start the game after its finished :>(it says victory xD ) so after that the AI dont do anything becouse the game has ended :>.
And one more think 939af36920bfbb04566fcc1f894a15404fba8e93a33ca4b52782078d65968e70 is s2ma fail,but when you open it with winmpq it shows different files inside it.
Title: Re: Tutorial : How to play against ai
Post by: Blackcode on February 27, 2010, 07:02:31 AM
Quote from: kdronez on February 27, 2010, 06:58:23 AM
Strange,but when I edit Objects file and put it back in the s2ma file my Sc crash.
I think that even if you guys add 2nd AI player it wont start to build or do smth becouse with this crack you start the game after its finished :>(it says victory xD ) so after that the AI dont do anything becouse the game has ended :>.
And one more think 939af36920bfbb04566fcc1f894a15404fba8e93a33ca4b52782078d65968e70 is s2ma fail,but when you open it with winmpq it shows different files inside it.


the crash it's because you still have your map open in winmpq... close winmpq before opening the map in sc2.
And "game finished" is because you ahve only 1 player on the map
Title: Re: Tutorial : How to play against ai
Post by: 2g4u on February 27, 2010, 07:07:41 AM
http://darkblizz.org/Forum2/index.php?topic=568.0 (http://darkblizz.org/Forum2/index.php?topic=568.0)

Check it out, its Lost Temple and in the middle I got a surprise for you. Better to go there prepared :D
Title: Re: Tutorial : How to play against ai
Post by: tomsons26 on February 27, 2010, 07:10:28 AM
the war3 map script
//===========================================================================
//
// Just another Warcraft III map
//
//   Warcraft III map script
//   Generated by the Warcraft III World Editor
//   Date: Sat Feb 27 14:02:30 2010
//   Map Author: Unknown
//
//===========================================================================

//***************************************************************************
//*
//*  Global Variables
//*
//***************************************************************************

globals
    // Generated
    trigger                 gg_trg_Melee_Initialization = null
endglobals

function InitGlobals takes nothing returns nothing
endfunction

//***************************************************************************
//*
//*  Unit Creation
//*
//***************************************************************************

//===========================================================================
function CreateBuildingsForPlayer0 takes nothing returns nothing
    local player p = Player(0)
    local unit u
    local integer unitID
    local trigger t
    local real life

    set u = CreateUnit( p, 'htow', 320.0, 64.0, 270.000 )
endfunction

//===========================================================================
function CreateBuildingsForPlayer1 takes nothing returns nothing
    local player p = Player(1)
    local unit u
    local integer unitID
    local trigger t
    local real life

    set u = CreateUnit( p, 'ogre', -512.0, -192.0, 270.000 )
    set u = CreateUnit( p, 'otto', -1024.0, -64.0, 270.000 )
endfunction

//===========================================================================
function CreateUnitsForPlayer1 takes nothing returns nothing
    local player p = Player(1)
    local unit u
    local integer unitID
    local trigger t
    local real life

    set u = CreateUnit( p, 'opeo', -367.2, 141.4, 352.793 )
endfunction

//===========================================================================
function CreatePlayerBuildings takes nothing returns nothing
    call CreateBuildingsForPlayer0(  )
    call CreateBuildingsForPlayer1(  )
endfunction

//===========================================================================
function CreatePlayerUnits takes nothing returns nothing
    call CreateUnitsForPlayer1(  )
endfunction

//===========================================================================
function CreateAllUnits takes nothing returns nothing
    call CreatePlayerBuildings(  )
    call CreatePlayerUnits(  )
endfunction

//***************************************************************************
//*
//*  Triggers
//*
//***************************************************************************

//===========================================================================
// Trigger: Melee Initialization
//
// Default melee game initialization for all players
//===========================================================================
function Trig_Melee_Initialization_Actions takes nothing returns nothing
    call MeleeStartingVisibility(  )
    call MeleeStartingHeroLimit(  )
    call MeleeGrantHeroItems(  )
    call MeleeStartingResources(  )
    call MeleeClearExcessUnits(  )
    call MeleeStartingUnits(  )
    call MeleeStartingAI(  )
    call MeleeInitVictoryDefeat(  )
endfunction

//===========================================================================
function InitTrig_Melee_Initialization takes nothing returns nothing
    set gg_trg_Melee_Initialization = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Melee_Initialization, function Trig_Melee_Initialization_Actions )
endfunction

//===========================================================================
function InitCustomTriggers takes nothing returns nothing
    call InitTrig_Melee_Initialization(  )
endfunction

//===========================================================================
function RunInitializationTriggers takes nothing returns nothing
    call ConditionalTriggerExecute( gg_trg_Melee_Initialization )
endfunction

//***************************************************************************
//*
//*  Players
//*
//***************************************************************************

function InitCustomPlayerSlots takes nothing returns nothing

    // Player 0
    call SetPlayerStartLocation( Player(0), 0 )
    call ForcePlayerStartLocation( Player(0), 0 )
    call SetPlayerColor( Player(0), ConvertPlayerColor(0) )
    call SetPlayerRacePreference( Player(0), RACE_PREF_HUMAN )
    call SetPlayerRaceSelectable( Player(0), true )
    call SetPlayerController( Player(0), MAP_CONTROL_USER )

    // Player 1
    call SetPlayerStartLocation( Player(1), 1 )
    call ForcePlayerStartLocation( Player(1), 1 )
    call SetPlayerColor( Player(1), ConvertPlayerColor(1) )
    call SetPlayerRacePreference( Player(1), RACE_PREF_ORC )
    call SetPlayerRaceSelectable( Player(1), true )
    call SetPlayerController( Player(1), MAP_CONTROL_COMPUTER )

endfunction

function InitCustomTeams takes nothing returns nothing
    // Force: TRIGSTR_003
    call SetPlayerTeam( Player(0), 0 )
    call SetPlayerTeam( Player(1), 0 )

endfunction

//***************************************************************************
//*
//*  Main Initialization
//*
//***************************************************************************

//===========================================================================
function main takes nothing returns nothing
    call SetCameraBounds( -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), -3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) )
    call SetDayNightModels( "Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl" )
    call NewSoundEnvironment( "Default" )
    call SetAmbientDaySound( "LordaeronSummerDay" )
    call SetAmbientNightSound( "LordaeronSummerNight" )
    call SetMapMusic( "Music", true, 0 )
    call CreateAllUnits(  )
    call InitBlizzard(  )
    call InitGlobals(  )
    call InitCustomTriggers(  )
    call RunInitializationTriggers(  )

endfunction

//***************************************************************************
//*
//*  Map Configuration
//*
//***************************************************************************

function config takes nothing returns nothing
    call SetMapName( "Just another Warcraft III map" )
    call SetMapDescription( "Nondescript" )
    call SetPlayers( 2 )
    call SetTeams( 2 )
    call SetGamePlacement( MAP_PLACEMENT_USE_MAP_SETTINGS )

    call DefineStartLocation( 0, 512.0, -448.0 )
    call DefineStartLocation( 1, -832.0, 256.0 )

    // Player setup
    call InitCustomPlayerSlots(  )
    call SetPlayerSlotAvailable( Player(0), MAP_CONTROL_USER )
    call SetPlayerSlotAvailable( Player(1), MAP_CONTROL_COMPUTER )
    call InitGenericPlayerSlots(  )
endfunction

Title: Re: Tutorial : How to play against ai
Post by: kewickviper on February 27, 2010, 07:14:09 AM
From the looks of it some of the functions correlate from War3 to SC2. It would be worth checking if     call SetPlayerController( Player(0), MAP_CONTROL_USER ) works in SC2 to set a player to computer.
Title: Re: Tutorial : How to play against ai
Post by: kdronez on February 27, 2010, 07:20:01 AM
the crash it's because you still have your map open in winmpq... close winmpq before opening the map in sc2.
And "game finished" is because you ahve only 1 player on the map
[/quote]
I close the winmpq and have the same problem when I started SC 2. NVM I will w8 for some1 to make a map xD.
Title: Re: Tutorial : How to play against ai
Post by: ooni on February 27, 2010, 07:26:33 AM
Quote from: kewickviper on February 27, 2010, 07:14:09 AM
From the looks of it some of the functions correlate from War3 to SC2. It would be worth checking if     call SetPlayerController( Player(0), MAP_CONTROL_USER ) works in SC2 to set a player to computer.
Obviously not.
Let's say SetPlayerController is the correct function, MAP_CONTROL_USER is wc3 constant. SC2 Constant start with c_ and all lower cases with different names. Curse you Blizzard!


Quote from: kdronez on February 27, 2010, 07:20:01 AM
the crash it's because you still have your map open in winmpq... close winmpq before opening the map in sc2.
And "game finished" is because you ahve only 1 player on the map
I close the winmpq and have the same problem when I started SC 2. NVM I will w8 for some1 to make a map xD.

Remember the Blizzard game MPQ directory rule. If you have a file that duplicate file in any installation folder it automatically overrides any other file with the same name. Check if you saved your edited files in the installation folder aka Program Files\Starcraft Beta

http://forums.starcraft.org/showthread.php?t=44080 (http://forums.starcraft.org/showthread.php?t=44080)
Found the list of functions. None of them really useful for our purposes. (unless you are willing to make AI from scratch)
Title: Re: Tutorial : How to play against ai
Post by: tomsons26 on February 27, 2010, 07:31:09 AM

    // Player setup
    call InitCustomPlayerSlots(  )
    call SetPlayerSlotAvailable( Player(0), MAP_CONTROL_USER )
    call SetPlayerSlotAvailable( Player(1), MAP_CONTROL_COMPUTER )
    call InitGenericPlayerSlots(  )
endfunction

all Player setup works but is get no base fow is not reviled etc bugs

BTW if the code is the same like in War3x we can get the game to revile FOW
Title: Re: Tutorial : How to play against ai
Post by: tomsons26 on February 27, 2010, 07:38:39 AM
    call FogEnableOff(  )
Title: Re: Tutorial : How to play against ai
Post by: LoneWolf on February 27, 2010, 07:40:13 AM
Damn, I wish I had more time to crack at this. All I managed to do was to start the game with no players at all and start the game with me having 2 bases right next to eachother, lol.
Title: Re: Tutorial : How to play against ai
Post by: Darkmapper on February 27, 2010, 09:30:50 AM
Well basicly we could just try some ids out, hope to find out what each is.
But if you can place units by knowing their ID, could it be possilbe that we can add units like lurker Terra-Tron medics firebats, and some april fool units?
Just an idea, and i think its worth to find out.
Title: Re: Tutorial : How to play against ai
Post by: DKSlayer on February 27, 2010, 09:41:52 AM
Just grabbed the cache off of some site and started looking at at the files. Obiously we have the triggers file. Which looks like this.
<?xml version="1.0" encoding="utf-8"?>
<TriggerData>
    <root>
        <item type="Trigger" id="DA585CDF"/>
    </root>
    <element type="Trigger" id="DA585CDF">
        <event type="FunctionCall" id="9FD28024"/>
        <action type="FunctionCall" id="D8249E80"/>
        <action type="FunctionCall" id="879D3981"/>
        <action type="FunctionCall" id="BB0E3A48"/>
        <action type="FunctionCall" id="C749188F"/>
    </element>
    <element type="FunctionCall" id="879D3981">
        <function type="FunctionDef" library="Ntve" id="00000145"/>
    </element>
    <element type="FunctionCall" id="9FD28024">
        <function type="FunctionDef" library="Ntve" id="00000120"/>
    </element>
    <element type="FunctionCall" id="BB0E3A48">
        <function type="FunctionDef" library="Ntve" id="00000150"/>
    </element>
    <element type="FunctionCall" id="C749188F">
        <function type="FunctionDef" library="Ntve" id="00000148"/>
    </element>
    <element type="FunctionCall" id="D8249E80">
        <function type="FunctionDef" library="Ntve" id="00000143"/>
    </element>
</TriggerData>


we can see that the lower functions are being pulled from the native Triggers file. Which I have been unable to find. My thought it this is probably coded in. Anyways the functions are called by a Code number and given an Id. In the enUS.SC2DAta\LocalizedData\TriggerStrings.txt you find this:

Trigger/Name/DA585CDF=Melee Initialization

in another map thought you get

Trigger/Name/6B580A10=Melee Initialization


and in the triggers file for the second map you see

<?xml version="1.0" encoding="us-ascii"?>
<TriggerData>
    <root>
        <item type="Trigger" id="6B580A10"/>
    </root>
    <element type="Trigger" id="6B580A10">
        <event type="FunctionCall" id="55F0159A"/>
        <action type="FunctionCall" id="32730DBD"/>
        <action type="FunctionCall" id="8C8C05D9"/>
        <action type="FunctionCall" id="414B4FFA"/>
        <action type="FunctionCall" id="4E1DE037"/>
    </element>
    <element type="FunctionCall" id="32730DBD">
        <function type="FunctionDef" library="Ntve" id="00000143"/>
    </element>
    <element type="FunctionCall" id="414B4FFA">
        <function type="FunctionDef" library="Ntve" id="00000150"/>
    </element>
    <element type="FunctionCall" id="4E1DE037">
        <function type="FunctionDef" library="Ntve" id="00000148"/>
    </element>
    <element type="FunctionCall" id="55F0159A">
        <function type="FunctionDef" library="Ntve" id="00000120"/>
    </element>
    <element type="FunctionCall" id="8C8C05D9">
        <function type="FunctionDef" library="Ntve" id="00000145"/>
    </element>
</TriggerData>

As you can see the ids in the Function Call portion are random. I am guessing the map editor just creates a random unique id for each one even though the native. But the actualy Native functions are the same. So one side defines the triggers and the other side calls them.
Anyways the link someone showed above showed that in one of the maps someone actually was able to pull a more full AI like file. Anyways looking through the maps here to see what they are.
Title: Re: Tutorial : How to play against ai
Post by: dodongbadong on February 27, 2010, 10:08:16 AM
hahaha.. very interesting map.. sad coz i wipe them all out but no conclusion wither victory or defeat but non the less its better than playing against yourself. more map please..

hmm id like to make my own map.. where do i start? hehe

i use to make starcraft broodwar map before though just simple editing using map editor or star forge but i guess sc2 is way different. T_T

more map please.. btw if you find some interesting script or inputs dealing with ai please post it here i beg you.. so that we can interact on what to do.
thx
Title: Re: Tutorial : How to play against ai
Post by: Gamewiz on February 27, 2010, 10:08:41 AM
2g4u thank you for the map! I'm gonna try it out now! :D

Thank you guys for working on this. Looks like you are making really good progress! Sorry I can't contribute, I'm not good at this kind of stuff. :(
Title: Re: Tutorial : How to play against ai
Post by: p-On:E on February 27, 2010, 10:32:21 AM
uhm guys, a question...

we have the triggers, and were able to edit them, right?
were able to spawn units, theoretically set up a base for the "braindead-AI" and have some fun.

so if were able to make some trigger stuff etc, arent were able to create locations and let some triggers do the action, like "attackmove -> all units on location A -> to Location B"?

that with some timeed triggers would make it possible to script the own AI.. kinda..

is this possible?

and is there any way to find out the coordinates for the grid to place units and buildings properly?
Title: Re: Tutorial : How to play against ai
Post by: lovetoby on February 27, 2010, 10:39:43 AM
oki so far placing units doesnt depend on their id, you can use players startlocation coordinates to make funny things, also we can have 4 players, i ll release a map being able to fight against 3 opponents btw they fight each other too...
still much to do... triggering a wave lik walk behaiour and placing building... maybe the id are for the trigger action codes... so be carefull! but actually the ids doesnt matter what kind of unity u place! also u can play terrain and spawn zerg unit... so have fun cu later
Title: Re: Tutorial : How to play against ai
Post by: 2g4u on February 27, 2010, 10:45:01 AM
Taken from wc3campaigns.net

Here is the full list of types.
DebugString
DebugUnit
DebugInt
DebugFixed
DebugPoint
DebugDump
AISetDifficulty
AIGetDifficulty
AIStart
AIGivingUp
AIGoodGame
AIIsCampaign
AISetAPM
AIGrabUnit
AIState
AISetSpecificState
AISetAllStates
AISetFlag
AIGetFlag
AITechFlag
AIResetUserData
AISetUserString
AIGetUserString
AISetUserInt
AIGetUserInt
AIAddStringInt
AIGetTime
AIGetTotalStartLocs
AIGetGroundStartLocs
AIGetAirStartLocs
AIGetTotalTownLocs
AIGetGroundTownLocs
AIGetAirTownLocs
AIRandomVal
AINewChooseSubState
AISetSubStateChance
AIChooseSubState
AIWantsMultipleTransport
AISetWantsMultipleTransport
AIGetNumMobileTransports
AIGetBestCreepSpot
AIAddDetectionDanger
AIDefaultSuspectDetectionDanger
AIAnyWorkersFleeingNearby
AIGetNumEnemies
AIGetNumAllies
AIPlacementNearbyFindTest
AIAddToExtraScoutGroup
AIOfferNewScout
AIAnyAllyAttacking
AIBestAllyAttackPoint
AIAnyAllyNeedsDefending
AIBestAllyDefendPoint
AIGlobalSuicide
AIUnitGetWave
AIWaveGetUnits
AIGetAllEscorts
AIGetAllEscortsGroup
AIRemoveUnitFromAnyWaves
AIRemoveGroupFromAnyWaves
AIGetUnitsInWavesWithTarget
AIIsScriptControlled
AISetUnitScriptControlled
AISetGroupScriptControlled
AIIsSuicideUnit
AISetUnitSuicide
AISetGroupSuicide
AIIsNotUsableInWaves
AISetUnitNotUsableInWaves
AISetGroupNotUsableInWaves
AISetWantsToUpgrade
AIInitCampaignTowns
AIInitCampaignHarvest
AIDeclareTown
AIGetMainTown
AISetMainTown
AIUpdateMainTown
AIGetTownState
AIGetTownEstablishedTime
AIGetTownLocation
AIGetClosestTown
AIGetNextUnusedTownSlot
AIGetBuildingCountInTown
AIIsTownHarvestRunning
AIHarvest
AIHarvestRate
AIHarvestBonus
AISetGasPeonCountOverride
AIGetCurPeonCount
AIGetMinPeonCount
AIGetMaxPeonCount
AIGetMineralAmountLeft
AIGetGasAmountLeft
AIGetMineralNumSpots
AIGetRawGasNumSpots
AIGetGatherLocation
AIGetGatherDefLocation
AIExpand
AIGetTownThreats
AIGetObstruction
AIHasNearbyOpenExpansion
AIScout
AISetNumScouts
AISetScoutTimes
AIGetNextScoutLoc
AIClearCampaignScout
AIBuild
AITrain
AIResearch
AIMakeAlways
AIMakeOnce
AIClearBuildQueue
AIClearTrainQueue
AIClearResearchQueue
AIHasRes
AITechCount
AITechCountFixupSingle
AITechCountFixupEither
AITechCountFixupInOrder
AIKnownUnitCount
AIResetCounterUnits
AICounterUnit
AICounterUnits
AIGetRallyPoint
AISetPowerBuilding
AISetCreepBuilding
AIClearStock
AIEnableStock
AISetStockEx
AISetStock
AISetStockOpt
AISetStockUnitNext
AISetStockTown
AISetStockExpand
AISetStockExtra
AISetStockFarms
AISetStockPeons
AINewTechStock
AITechStockAdd
AISetStockTechNext
AIDefaultEconomy,'-4ssss4?',0AIDefaultExpansion
AIClearLimitTech
AILimitTech,'-4444444',0AIImportantTech
AILimitStockLarva
AIHasStock
AIHasStockFromTown
AIRemoveStockFromTown
AIDefaultGetObjectType
AIDefaultGetMaker
AIDefaultGetFirstMissingReq
AIDefaultGetFirstUnfinishedReq
AIDefaultGetFullMakeTime
AIGetBaseName
AIGetBuildAtName
AIReqCountAsBuiltObject
AIReqAddSpecialMaker
AISetNukeNukeCastTime
AISetNukeCloakCost
AISetNukeCloakRegenRate
AISetNukeGhost
AISetNukeNukeEffect
AISetNukeCloak
AISetNukeNukeAbilLink
AISetNukeCloakAbilLink
AISetNukeDamage
AISetNukeRadiusClose
AISetNukeRadiusMedium
AISetNukeRadiusFar
AIBaseThink
AIEvalTacticalData
AICast
AICastFlee
AINearbyUnits
AIFindUnits
AISameCommand
AILastAttacker
AILastAttack
AIControlWantsToMove
AIControlForceToMove
AIControlWantsToUnburrow
AIControlWantsToBurrow
AIControlForceUnburrow
AIUnitIsInCombat
AIIsIgnoredByWave
AISetIgnoredByWave
AIGetHomePosition
AIGetCloakedAttacker
AIClearCloakedAttacker
AISawCloakedUnit
AIRandomSpawnPoint
AIBestTargetPoint,'pu4433p34',0AIDefaultCombatPriority
AIFilter
AISetFilterAlliance
AISetFilterMarker
AISetFilterSelf
AISetFilterBits
AISetFilterRange
AISetFilterLife
AISetFilterLifeLost
AISetFilterLifePercent
AISetFilterLifeSortReference
AISetFilterLifeMod
AISetFilterLifePerMarker
AISetFilterShields
AISetFilterEnergy
AISetFilterPlane
AISetFilterCanAttackEnemy
AISetFilterCanAttackAlly
AISetFilterBehaviorCount
AIGetFilterGroup
AIFilterGathering
AIFilterPathable
AIFilterCasters
AICloakEvaluate
AISetTacticalAttackTargetPoint
AISetTacticalAttackTargetUnit
AIUnitGroupGetValidOrder
AIIsFollowingUnit
AIGetPlayerGroup
AINearbyPlaneTest
AIUnitGroupStrength
AIAllyEnemyRatio
AICombatTargetProduction
AICombatTargetDropOffs
AICombatTargetFood
AICombatTargetActiveProduction
AICombatTargetWorkers
AICombatTargetAllyThreats
AICombatTargetSelfThreats
AICombatTargetCurrent
AICombatTargetAir
AICombatTargetMovers
AICombatTargetInjuries
AICombatTargetInAttackRange
AICombatTargetThreats
AICombatTargetHealers
AICombatTargetSiege
AICombatTargetAttackers
AICombatTargetSpecial
AICombatAvoidTimedUnits
AICombatAvoidNonThreats
AICombatAvoidWeakUnits
AICombatAvoidDisabledUnits
AITransportIgnore
AITransportSetPanic
AITransportSetReturn
AIWaveInfoCreate
AIWaveInfo
AIWaveInfoAdd
AIWaveInfoAttack
AIWaveInfoSuicide
AIWaveInfoScout
AIWaveToString
AIWaveToText
AIWaveCreate
AIWaveAddUnit
AIWaveAddUnitPriority
AIWaveRemoveUnit
AIWaveUnitCount
AIWaveDetectorCount
AIWaveSetType
AIWaveState
AIWaveDelete
AIWaveTargetUnit
AIWaveTargetUnitGroup
AIWaveTargetUnitPoint
AIWaveTargetPoint
AIWaveTargetPlayer
AIWaveTargetMelee
AIWaveTargetMeleeHarass
AIWaveTargetMeleeDrop
AIWaveTargetMeleeDefend
AIWaveTargetMerge
AIWaveTargetPatrol
AIWaveTargetEscort
AIWaveTargetEscortNL
AIWaveTargetGatherO
AIWaveTargetGatherD
AIWaveTargetRegion
AIWaveTargetGatherOPoint
AIWaveTargetGatherDPoint
AIWaveTargetGetUnit
AIWaveTargetGetUnitGroup
AIWaveHarassRetreat
AIWaveGetTarget
AIWaveIsInCombat
AIWaveGetTimeInCombat
AIWaveGetTimeSinceCombat
AIWaveGetTimeSinceOrdered
AIWaveGetTimeSinceRetreat
AIDefenseThreat
AIDefenseThreatEval
AIWaveEval
AIWaveEvalRatio
AIUnitAreaEvalRatio
AIEvalRatio
AIEvalSetCustomIndex
AIEvalAllAllied
AIEvalLargestEnemy
AILastWaveEvalStaticRatio
AIWaveTargetAddWaypoint
AIWaveTargetClearWaypoints
AIWaveGet
AIWaveSet
AIWaveType
AIWaveSetUserData
AIWaveGetUserData
AIWaveMerge
AIWaveMergeMelee
WaveLastCreated
AIGetBestTarget
AIFindDropAttackTarget
AILastDropLocation
AILastDropGoal
AIGetNextDropTimeCheck
AISetNextDropTimeCheck
AILastAttackRatio
AILastAttackStartEval
AIAttackWaveAddUnits
AIAttackWaveSend
AIAttackWaveCancel
AIAttackWaveSetGatherPoint
AIAttackWaveUseUnit
AIAttackWaveUseGroup
AIAttackWaveAddEscortUnit
AIAttackWaveAddEscortType
AIAttackWaveSetTargetUnit
AIAttackWaveSetTargetUnitGroup
AIAttackWaveSetTargetUnitPoint
AIAttackWaveSetTargetPoint
AIAttackWaveSetTargetPlayer
AIAttackWaveSetTargetMelee
AIAttackWaveSetTargetMeleeHarass
AIAttackWaveSetTargetMeleeDrop
AIAttackWaveSetTargetMeleeDefend
AIAttackWaveSetTargetMerge
AIAttackWaveSetTargetPatrol
AIAttackWaveSetTargetEscort
AIAttackWaveSetTargetEscortNL
AIAttackWaveSetTargetGatherO
AIAttackWaveSetTargetGatherD
AIAttackWaveSetTargetRegion
AIAttackWaveSetGatherEarlyNoReplace
AIAttackWaveSetKeepAlive
AIAttackWaveAddWaypoint
AIAttackWaveClearWaypoints
AISetMinimumBullyCount
AISetGeneralRebuildCount
AISetSpecificRebuildCount
AISetBullyAttackWavePercent
AINearestTownLimitWaveGather
AINearestTownBullyRebuild
AIToggleBulliesInRegion
AIResetBullyRebuildCountsInRegion
AIClearAllBullies
AIAddBully
AIGetBullyType
CameraGetTarget
CatalogFieldValueGet
IntToFixed
IntToString
FixedToInt
StringToInt
StringToFixed
StringWord
CliffLevel
TriggerAddEventMapInit
TriggerAddEventChatMessage
EventChatMessage
MaxF
AbsI
RandomInt
MarkerCastingUnit
MarkerSetMatchFlag
MarkerSetMismatchFlag
MeleeInitResources
MeleeInitUnits
MeleeInitAI
MeleeInitOptions
AbilityCommand
AbilityCommandGetAbility
Order
OrderGetAbilityCommand
OrderSetPlayer
OrderGetPlayer
OrderGetTargetType
OrderSetTargetPlacement
OrderSetTargetPoint
OrderGetTargetPoint
OrderGetTargetPosition
OrderSetTargetUnit
OrderGetTargetUnit
OrderSetTargetPassenger
PlayerGetPropertyInt
PlayerRace
PlayerDifficulty
PlayerStartLocation
PlayerGetColorIndex
PlayerColorName
PlayerGetAlliance
DifficultyAPM
PlayerGroupAll
Point
PointWithOffset
PointWithOffsetPolar
PointsInRange
AngleBetweenPoints
DistanceBetweenPoints
RegionCircle
RegionRandomPoint
StringEqual
StringToText
TechTreeBehaviorCount
TechTreeUnitCount
TriggerCreate
TriggerDebugOutput
UnitIsAlive
UnitGetType
UnitGetOwner
UnitGetPosition
UnitGetFacing
UnitTestState
UnitGetPropertyInt
UnitGetPropertyFixed
UnitCargoGroup
UnitCargoValue
UnitTestPlane
UnitBehaviorCount
UnitMarkerCount
UnitOrder
UnitOrderCount
UnitOrderHasAbil
UnitOrderIsValid
UnitIsHarvesting
UnitRallyPointTargetCount
UnitRallyPointTargetPoint
UnitWeaponsPlaneTest
UnitTypeTestFlag
UnitTypeTestAttribute
UnitFilter
UnitFilterStr
UnitFilterSetState
UnitGroupCopy
UnitGroupAlliance
UnitGroup
UnitGroupFilter
UnitGroupFilterAlliance
UnitGroupFilterPlane
UnitGroupFilterRegion
UnitGroupFilterThreat
UnitGroupAdd
UnitGroupCount
UnitGroupUnit
UnitGroupTestPlane
UnitGroupNearestUnit
UIDisplayMessage
Wait

And a code sample featuring Point. Both curtesy of MindWorX.
int __stdcall Point(int x, int y)
{
    galaxyPoint *p;
    p = sub_B35410(32);
    if (p)
    {
        sub_AA3160(p, 11, 0); //This is a __thiscall, so it would prolly look like this in normal code: "p->sub_AA3160(11, 0);"
        p->field_0 = &off_137892C;
        p->field_C = 0;
        p->field_10 = 0;
        p->field_14 = 0;
        p->field_18 = 0;
        p->field_1C = 0;
    }
    else
    {
        p = 0;
    }
    p->field_10 = x;
    p->field_14 = y;
    return p->field_8;
}
Title: Re: Tutorial : How to play against ai
Post by: Darkmapper on February 27, 2010, 11:44:28 AM
It doesnt work for me. Im using winMPQ and when i save the object.file, it creates a second one. So it doesnt replace it but it has just two object.files. Im opening the file with Scite and also tried it with the windows Editor. Is it bcause of winMPQ? MPQEditor doesnt work for me, and i used it in starcraft 2 already.
Title: Re: Tutorial : How to play against ai
Post by: tomsons26 on February 27, 2010, 12:33:29 PM
my theory about AI
in MapScript.galaxy there is only include "TriggerLibs/NativeLib" that shoud be be the AI that when an AI unit is attacked then he attacks you (kinda like natural hostile in war3)
can someone that maked an map with AI test adding these tags

//==================================================================================================
include "TriggerLibs/NativeLib"
include "TriggerLibs/RequirementsAI"
include "TriggerLibs/BuildAI"
include "TriggerLibs/MeleeAI"
include "TriggerLibs/Terran"
include "TriggerLibs/Protoss"
include "TriggerLibs/Zerg"

//--------------------------------------------------------------------------------------------------
Title: Re: Tutorial : How to play against ai
Post by: RaTcHeT302 on February 27, 2010, 12:34:37 PM
What's the name of the map?
Title: Re: Tutorial : How to play against ai
Post by: tomsons26 on February 27, 2010, 12:36:32 PM

// Name:   Holy Land
// Author: Blizzard Entertainment
Title: Re: Tutorial : How to play against ai
Post by: Valkirie on February 27, 2010, 12:49:03 PM
Quote from: tomsons26 on February 27, 2010, 12:33:29 PM
my theory about AI
in MapScript.galaxy there is only include "TriggerLibs/NativeLib" that shoud be be the AI that when an AI unit is attacked then he attacks you (kinda like natural hostile in war3)
can someone that maked an map with AI test adding these tags

//==================================================================================================
include "TriggerLibs/NativeLib"
include "TriggerLibs/RequirementsAI"
include "TriggerLibs/BuildAI"
include "TriggerLibs/MeleeAI"
include "TriggerLibs/Terran"
include "TriggerLibs/Protoss"
include "TriggerLibs/Zerg"

//--------------------------------------------------------------------------------------------------


http://www.mediafire.com/?gjnnzwjjdxk (http://www.mediafire.com/?gjnnzwjjdxk)
Also added a Hatchery at Starting point loc 002. Looks like nothing is moving.
Title: Re: Tutorial : How to play against ai
Post by: redspike474 on February 27, 2010, 01:17:51 PM
Quote from: Valkirie on February 27, 2010, 12:49:03 PM
Quote from: tomsons26 on February 27, 2010, 12:33:29 PM
my theory about AI
in MapScript.galaxy there is only include "TriggerLibs/NativeLib" that shoud be be the AI that when an AI unit is attacked then he attacks you (kinda like natural hostile in war3)
can someone that maked an map with AI test adding these tags

//==================================================================================================
include "TriggerLibs/NativeLib"
include "TriggerLibs/RequirementsAI"
include "TriggerLibs/BuildAI"
include "TriggerLibs/MeleeAI"
include "TriggerLibs/Terran"
include "TriggerLibs/Protoss"
include "TriggerLibs/Zerg"

//--------------------------------------------------------------------------------------------------


http://www.mediafire.com/?gjnnzwjjdxk (http://www.mediafire.com/?gjnnzwjjdxk)
Also added a Hatchery at Starting point loc 002. Looks like nothing is moving.

i dont think this method would work at all, if it is moving you wont get victory when u start the map. u get Victory because u have no oponant.


currently i belive that its the lazy town sandbox that needs to change its way of loading into the map, it isnt anything to do with the galaxy scripting.
because the scripts are working u can mess with them youselfs.

any triggers ect are no longer valid anyways after u have won the game, eg after vicotory is displayed its end game, i think... im not sure.

lazytown needs to load the map and emulate or tell the computer slot to be full , or somthing like that. there is no ai because all the player slots are empty, one needs to be set to computer.  well as far as i can figure out, 
Title: Re: Tutorial : How to play against ai
Post by: tomsons26 on February 27, 2010, 01:21:25 PM
there is an ai opponent needed to be added in MapScript.galaxy
because in wc3 there was one and this script is an wc3 script mod
Title: Re: Tutorial : How to play against ai
Post by: redspike474 on February 27, 2010, 01:34:30 PM
actually i belive its more like starcraft 1.

seeing as there are no units or buildings placed for the race you play as.
each time u play a map it randomly choses your starting location from those defined in the objects file, and then randomly chooses your race.  and gives you a command center ect.
i see no reason why it would not do the same for player 2 , or a computer player.
there simply is no computer  player present when the map starts. the slot is empty or closed.
yes it might be possible to create a map using triggers simaler to Ums in sc1, more like a single player mission, however i dont think this is possible at the moment with the current lazytown program ,
if you think about it what settings for custom map are there?
ums?
mele?
Player vs player>
think how many there was in sc1 And how each was a diffrent game mode, only ums used map settings and used triggers ect,
Title: Re: Tutorial : How to play against ai
Post by: cryystyy on February 27, 2010, 01:35:31 PM
hmm :-? if this MeleeInitResources(); gives you 50 minerals at start how can we edit it to give 100 or 9999 :-?.
Title: Re: Tutorial : How to play against ai
Post by: redspike474 on February 27, 2010, 01:44:25 PM
easy ;p

that command gives you the resources defined in... racedata.xml

edit that file and add it to your maps base.sc2data/gamedata/ folder


example here showing 9999 mineral


<?xml version="1.0" encoding="us-ascii"?>
<Catalog>
    <CRace id="Terr">
        <AttributeId value="Terr"/>
        <LoadingImage value="Assets\Textures\TerranLoad.dds"/>
        <DefeatImage value="Assets\Textures\TerranDefeat.dds"/>
        <VictoryImage value="Assets\Textures\TerranVictory.dds"/>
        <StartingResource index="Minerals" value="9999"/>
        <Flags index="Selectable" value="1"/>
        <StartingUnitArray Unit="CommandCenter"/>
        <StartingUnitArray Count="9" Unit="SCV">
            <Offset value="0,-3"/>
            <Offset value="1,-3"/>
            <Offset value="2,-3"/>
            <Offset value="3,-3"/>
            <Offset value="3,-2"/>
            <Offset value="3,-1"/>
            <Offset value="3,0"/>
            <Offset value="3,1"/>
            <Offset value="3,2"/>
            <Offset value="3,3"/>
            <Offset value="2,3"/>
            <Offset value="1,3"/>
            <Offset value="0,3"/>
            <Offset value="-1,3"/>
            <Offset value="-2,3"/>
            <Offset value="-3,3"/>
            <Offset value="-3,2"/>
            <Offset value="-3,1"/>
            <Offset value="-3,0"/>
            <Offset value="-3,-1"/>
            <Offset value="-3,-2"/>
            <Offset value="-3,-3"/>
            <Offset value="-2,-3"/>
            <Offset value="-1,-3"/>
        </StartingUnitArray>
        <GlossaryTeamColorIndex value="1"/>
    </CRace>
    <CRace id="Prot">
        <AttributeId value="Prot"/>
        <LoadingImage value="Assets\Textures\ProtossLoad.dds"/>
        <DefeatImage value="Assets\Textures\ProtossDefeat.dds"/>
        <VictoryImage value="Assets\Textures\ProtossVictory.dds"/>
        <StartingResource index="Minerals" value="50"/>
        <Flags index="Selectable" value="1"/>
        <StartingUnitArray Unit="Nexus"/>
        <StartingUnitArray Count="6" Unit="Probe">
            <Offset value="0,-3"/>
            <Offset value="1,-3"/>
            <Offset value="2,-3"/>
            <Offset value="3,-3"/>
            <Offset value="3,-2"/>
            <Offset value="3,-1"/>
            <Offset value="3,0"/>
            <Offset value="3,1"/>
            <Offset value="3,2"/>
            <Offset value="3,3"/>
            <Offset value="2,3"/>
            <Offset value="1,3"/>
            <Offset value="0,3"/>
            <Offset value="-1,3"/>
            <Offset value="-2,3"/>
            <Offset value="-3,3"/>
            <Offset value="-3,2"/>
            <Offset value="-3,1"/>
            <Offset value="-3,0"/>
            <Offset value="-3,-1"/>
            <Offset value="-3,-2"/>
            <Offset value="-3,-3"/>
            <Offset value="-2,-3"/>
            <Offset value="-1,-3"/>
        </StartingUnitArray>
        <GlossaryTeamColorIndex value="2"/>
    </CRace>
    <CRace id="Zerg">
        <AttributeId value="Zerg"/>
        <LoadingImage value="Assets\Textures\TerranLoad.dds"/>
        <DefeatImage value="Assets\Textures\ZergDefeat.dds"/>
        <VictoryImage value="Assets\Textures\ZergVictory.dds"/>
        <StartingResource index="Minerals" value="50"/>
        <Flags index="Selectable" value="1"/>
        <StartingUnitArray Unit="Hatchery"/>
        <StartingUnitArray Count="6" Unit="Drone">
            <Offset value="0,-3"/>
            <Offset value="1,-3"/>
            <Offset value="2,-3"/>
            <Offset value="3,-3"/>
            <Offset value="3,-2"/>
            <Offset value="3,-1"/>
            <Offset value="3,0"/>
            <Offset value="3,1"/>
            <Offset value="3,2"/>
            <Offset value="3,3"/>
            <Offset value="2,3"/>
            <Offset value="1,3"/>
            <Offset value="0,3"/>
            <Offset value="-1,3"/>
            <Offset value="-2,3"/>
            <Offset value="-3,3"/>
            <Offset value="-3,2"/>
            <Offset value="-3,1"/>
            <Offset value="-3,0"/>
            <Offset value="-3,-1"/>
            <Offset value="-3,-2"/>
            <Offset value="-3,-3"/>
            <Offset value="-2,-3"/>
            <Offset value="-1,-3"/>
        </StartingUnitArray>
        <StartingUnitArray Unit="Overlord">
            <Offset value="0,-3"/>
            <Offset value="1,-3"/>
            <Offset value="2,-3"/>
            <Offset value="3,-3"/>
            <Offset value="3,-2"/>
            <Offset value="3,-1"/>
            <Offset value="3,0"/>
            <Offset value="3,1"/>
            <Offset value="3,2"/>
            <Offset value="3,3"/>
            <Offset value="2,3"/>
            <Offset value="1,3"/>
            <Offset value="0,3"/>
            <Offset value="-1,3"/>
            <Offset value="-2,3"/>
            <Offset value="-3,3"/>
            <Offset value="-3,2"/>
            <Offset value="-3,1"/>
            <Offset value="-3,0"/>
            <Offset value="-3,-1"/>
            <Offset value="-3,-2"/>
            <Offset value="-3,-3"/>
            <Offset value="-2,-3"/>
            <Offset value="-1,-3"/>
        </StartingUnitArray>
        <GlossaryTeamColorIndex value="4"/>
    </CRace>
</Catalog>



all that meleeinitresources does is load this. i belive.
u can see there is alot u can change , starting units and buildings ect and colours.
you could make it so u start with allready a large army.
Title: Re: Tutorial : How to play against ai
Post by: cryystyy on February 27, 2010, 01:54:41 PM
thx for the info :)
i think i found some command to add as attributes.i think :-?

//  !!! WARNING !!! This is generated code. Changes made here will be overwritten.
// 
//GENERATED CODE====================================================================================

//  EClassIdCUnit
const int c_classIdCUnit = 0;
const string c_classIdCUnitName = "CUnit";

//  EUnitFlag
const int c_unitFlagBounce = 0;
const int c_unitFlagTurnable = 1;
const int c_unitFlagMovable = 2;
const int c_unitFlagWorker = 3;
const int c_unitFlagCreateVisible = 4;
const int c_unitFlagUnclickable = 5;
const int c_unitFlagUncommandable = 6;
const int c_unitFlagUnhighlightable = 7;
const int c_unitFlagUntooltipable = 8;
const int c_unitFlagUnselectable = 9;
const int c_unitFlagUntargetable = 10;
const int c_unitFlagUncursorable = 11;
const int c_unitFlagHero = 12;
const int c_unitFlagIndividualSubgroups = 13;
const int c_unitFlagNoDraw = 14;
const int c_unitFlagPreventReveal = 15;
const int c_unitFlagPreventDefeat = 16;
const int c_unitFlagPreventDestroy = 17;
const int c_unitFlagDefeatReveal = 18;
const int c_unitFlagUncloakable = 19;
const int c_unitFlagMissile = 20;
const int c_unitFlagUndetectable = 21;
const int c_unitFlagUnradarable = 22;
const int c_unitFlagUseLineOfSight = 23;
const int c_unitFlagPressForwardDisabled = 24;
const int c_unitFlagKillCredit = 25;
const int c_unitFlagTownAlert = 26;
const int c_unitFlagInvulnerable = 27;
const int c_unitFlagDestructible = 28;
const int c_unitFlagCloaked = 29;
const int c_unitFlagBuried = 30;
const int c_unitFlagNoScore = 31;
const int c_unitFlagIgnoreTerrainZInit = 32;
const int c_unitFlagTurnBeforeMove = 33;
const int c_unitFlagAlwaysThreatens = 34;
const int c_unitFlagNoDeathEvent = 35;
const int c_unitFlagNoPortraitTalk = 36;
const int c_unitFlagTownCamera = 37;
const int c_unitFlagAIThreatGround = 38;
const int c_unitFlagAIThreatAir = 39;
const int c_unitFlagAILifetime = 40;
const int c_unitFlagAISiege = 41;
const int c_unitFlagAIDefense = 42;
const int c_unitFlagAICaster = 43;
const int c_unitFlagAISupport = 44;
const int c_unitFlagShowResources = 45;
const int c_unitFlagArmorDisabledWhileConstructing = 46;
const int c_unitFlagPawnable = 47;
const string c_unitFlagBounceName = "Bounce";
const string c_unitFlagTurnableName = "Turnable";
const string c_unitFlagMovableName = "Movable";
const string c_unitFlagWorkerName = "Worker";
const string c_unitFlagCreateVisibleName = "CreateVisible";
const string c_unitFlagUnclickableName = "Unclickable";
const string c_unitFlagUncommandableName = "Uncommandable";
const string c_unitFlagUnhighlightableName = "Unhighlightable";
const string c_unitFlagUntooltipableName = "Untooltipable";
const string c_unitFlagUnselectableName = "Unselectable";
const string c_unitFlagUntargetableName = "Untargetable";
const string c_unitFlagUncursorableName = "Uncursorable";
const string c_unitFlagHeroName = "Hero";
const string c_unitFlagIndividualSubgroupsName = "IndividualSubgroups";
const string c_unitFlagNoDrawName = "NoDraw";
const string c_unitFlagPreventRevealName = "PreventReveal";
const string c_unitFlagPreventDefeatName = "PreventDefeat";
const string c_unitFlagPreventDestroyName = "PreventDestroy";
const string c_unitFlagDefeatRevealName = "DefeatReveal";
const string c_unitFlagUncloakableName = "Uncloakable";
const string c_unitFlagMissileName = "Missile";
const string c_unitFlagUndetectableName = "Undetectable";
const string c_unitFlagUnradarableName = "Unradarable";
const string c_unitFlagUseLineOfSightName = "UseLineOfSight";
const string c_unitFlagPressForwardDisabledName = "PressForwardDisabled";
const string c_unitFlagKillCreditName = "KillCredit";
const string c_unitFlagTownAlertName = "TownAlert";
const string c_unitFlagInvulnerableName = "Invulnerable";
const string c_unitFlagDestructibleName = "Destructible";
const string c_unitFlagCloakedName = "Cloaked";
const string c_unitFlagBuriedName = "Buried";
const string c_unitFlagNoScoreName = "NoScore";
const string c_unitFlagIgnoreTerrainZInitName = "IgnoreTerrainZInit";
const string c_unitFlagTurnBeforeMoveName = "TurnBeforeMove";
const string c_unitFlagAlwaysThreatensName = "AlwaysThreatens";
const string c_unitFlagNoDeathEventName = "NoDeathEvent";
const string c_unitFlagNoPortraitTalkName = "NoPortraitTalk";
const string c_unitFlagTownCameraName = "TownCamera";
const string c_unitFlagAIThreatGroundName = "AIThreatGround";
const string c_unitFlagAIThreatAirName = "AIThreatAir";
const string c_unitFlagAILifetimeName = "AILifetime";
const string c_unitFlagAISiegeName = "AISiege";
const string c_unitFlagAIDefenseName = "AIDefense";
const string c_unitFlagAICasterName = "AICaster";
const string c_unitFlagAISupportName = "AISupport";
const string c_unitFlagShowResourcesName = "ShowResources";
const string c_unitFlagArmorDisabledWhileConstructingName = "ArmorDisabledWhileConstructing";
const string c_unitFlagPawnableName = "Pawnable";

//  EUnitAttribute
const int c_unitAttributeLight = 0;
const int c_unitAttributeArmored = 1;
const int c_unitAttributeBiological = 2;
const int c_unitAttributeMechanical = 3;
const int c_unitAttributeRobotic = 4;
const int c_unitAttributePsionic = 5;
const int c_unitAttributeMassive = 6;
const int c_unitAttributeStructure = 7;
const int c_unitAttributeHover = 8;
const int c_unitAttributeHeroic = 9;
const string c_unitAttributeLightName = "Light";
const string c_unitAttributeArmoredName = "Armored";
const string c_unitAttributeBiologicalName = "Biological";
const string c_unitAttributeMechanicalName = "Mechanical";
const string c_unitAttributeRoboticName = "Robotic";
const string c_unitAttributePsionicName = "Psionic";
const string c_unitAttributeMassiveName = "Massive";
const string c_unitAttributeStructureName = "Structure";
const string c_unitAttributeHoverName = "Hover";
const string c_unitAttributeHeroicName = "Heroic";

//  ECmdFlags
const int c_cmdAlternate = 0;
const int c_cmdQueued = 1;
const int c_cmdPreempt = 2;
const int c_cmdSmartClick = 3;
const int c_cmdSmartRally = 4;
const int c_cmdSubgroup = 5;
const int c_cmdSetAutoCast = 6;
const int c_cmdSetAutoCastOn = 7;
const string c_cmdAlternateName = "Alternate";
const string c_cmdQueuedName = "Queued";
const string c_cmdPreemptName = "Preempt";
const string c_cmdSmartClickName = "SmartClick";
const string c_cmdSmartRallyName = "SmartRally";
const string c_cmdSubgroupName = "Subgroup";
const string c_cmdSetAutoCastName = "SetAutoCast";
const string c_cmdSetAutoCastOnName = "SetAutoCastOn";
Title: Re: Tutorial : How to play against ai
Post by: MiCrOMaN1 on February 27, 2010, 02:08:01 PM
Btw, guys you know the location set (e.g. 148,90) when you move your cursor around in the Starcraft 1 editor, Do you think maybe that the locations are the same? Like maybe if we find out where the location sets are, then maybe we can build an entire base nicely...?


By the way trying hero units and none of them work lol. Just FYI.
Title: Re: Tutorial : How to play against ai
Post by: RaTcHeT302 on February 27, 2010, 02:10:26 PM
Is possible to make something that registers your coordinates?

Example : You type in the chat "save_cord" and you will it find your last coordinates into a txt. Maybe if possible make the comand work with only the comand center?
Title: Re: Tutorial : How to play against ai
Post by: cryystyy on February 27, 2010, 02:12:36 PM
yeah that would be nice.
Title: Re: Tutorial : How to play against ai
Post by: redspike474 on February 27, 2010, 02:13:59 PM
i suggest we all talk in that irc channel for now, im currently there.
Title: Re: Tutorial : How to play against ai
Post by: cryystyy on February 27, 2010, 02:14:46 PM
redspike474 i'm in there 2 but i can't se you :|
Title: Re: Tutorial : How to play against ai
Post by: cryystyy on February 27, 2010, 02:37:58 PM
i see that in racedata.xml the races are defined as <CRace id="Terr"> can't this be implemented in something else to give you with the specific race ? :-?
Title: Re: Tutorial : How to play against ai
Post by: lovetoby on February 27, 2010, 02:47:50 PM
Starcraft 2 Beta - LazyTown Mod - 4 Players "Stupid AI" Fighting Scene (http://www.youtube.com/watch?v=8dBJhVy2n8g#)
latest vid.... sry for the audio... 4 players fighting each other...
Title: Re: Tutorial : How to play against ai
Post by: redspike474 on February 27, 2010, 02:50:14 PM
join the chat , i am on there with alot of other people irc rizon -> #sc2maphack

i can answer more questions there
Title: Re: Tutorial : How to play against ai
Post by: Mangala on February 27, 2010, 02:56:25 PM
Guys, I want to help but I'm new to IRC. How do I join "rizon -> @sc3maphack"?  :'(


Edit: Nevermind, got in!
Title: Re: Tutorial : How to play against ai
Post by: cd_wizard on March 19, 2010, 08:23:10 PM
Wow thanks for the tip