XGM Forum
Сайт - Статьи - Проекты - Ресурсы - Блоги

Форуме в режиме ТОЛЬКО ЧТЕНИЕ. Вы можете задать вопросы в Q/A на сайте, либо создать свой проект или ресурс.
Вернуться   XGM Forum > StarCraft (только чтение)> StarCraft 2 inside
Ник
Пароль
Войти через VK в один клик
Сайт использует только имя.

 
Toadcop

offline
Опыт: 54,313
Активность:
SC2 Galaxy
Galaxy скриптовый язык который используеца в сценариях SC2. По синтаксису он очень похож на С/Java.

пока всё О_О

теперь про некоторые интеерсные вещи что я заметил.

1) RAW code был заменён на строки (т.е. теперь не будет 'Aloc' будет напр "ANLocust" и т.п.)
2) внутри есть 2 типа строк. "внутриние" и те которые выводятса на интерфейс (из того что я заметил хотя могу и ошибатся)
3) пока неуверен но есть вариант что galaxy == java. (ибо зачем изобретать велосипед ?)

вот маленький кусок кода.
Код:
//--------------------------------------------------------------------------------------------------
//  DebugAI
//--------------------------------------------------------------------------------------------------
void DebugAI (string s) {
    if (DEBUG) {
        TriggerDebugOutput(1, StringToText(s), true);
    }
}

//--------------------------------------------------------------------------------------------------
void DebugAIPlayer (int player, string s) {
    if (DEBUG) {
        TriggerDebugOutput(
            1,
            StringToText("[") +
            PlayerColorName(PlayerGetColorIndex(player, false)) +
            StringToText("] ") +
            StringToText(s),
            true
        );
    }
}
Старый 18.02.2010, 19:05
agentex

offline
Опыт: 34,834
Активность:
Toadcop, откуда сурс? ты както распотрошил бетку?
galaxy == java
врядли, близы говорили что ооп в галакси не будет, а жаль
agentex добавил:
и ты уверен что это галакси, а не внутренние скрипты игры?
Старый 18.02.2010, 19:22
XOR

offline
Опыт: 38,159
Активность:
agentex, судя по функциям, это галакси. тс, где достал? Да и они сишное обещали. И не вижу смысла в переводе стринга в текст, разве если у них это идет как быстрый дебаг меседж)
Если чо

Отредактировано XimikS, 17.09.2010 в 20:42.
Старый 18.02.2010, 19:53
agentex

offline
Опыт: 34,834
Активность:
я так понял что текст - это то что выводится на экран, а стринг - внутренний тип.
Если чо
боян же
Старый 18.02.2010, 19:58
Toadcop

offline
Опыт: 54,313
Активность:
Цитата:
Сообщение от Deaod from Wc3c
Heres the rest of the .galaxy files that can be found inside the MPQs.

Theres the common.ai replacement inside.

Sadly, the common.j replacement is empty. My guess is that thats only temporary until the editor is released.

Heres the current list of native types i could make out
Код:
abilcmd
aifilter
bool
fixed // this is the replacement for real
int
marker
order
point // replacement for location
region // ive seen a function creating a circular region, i guess an upgraded version of rects
string
text // no idea, but theres a StringToText() function
trigger
unit
unitfilter // boolexpr replacement specific to unit filtering?
unitgroup // group replacement
wave
waveinfo
wavetarget


Theres no player type (yet?), players are mere integers.

Part(?) of the trigger API was also included:

Код:
native trigger  TriggerCreate (string s);
native void     TriggerDestroy (trigger t);
native void     TriggerExecute (trigger t, bool testConds, bool runActions);
native void     TriggerAddEventMapInit (trigger t);


The string TriggerCreate takes is probably an equivalent to the parameter ExecuteFunc takes in WC3. Its the name of a function that follows a specific interface (returning a boolean and taking two booleans).

There is an interesting constants:

Код:
const int c_maxPlayers = 32;


Hows that for a maximum player count?
Прикрепленные файлы
Тип файла: 7z TriggerLibs.7z (13.3 Кбайт, 48 просмотров )
Старый 18.02.2010, 20:07
XOR

offline
Опыт: 38,159
Активность:
Хз зачем такие выпендрежы с текстами, но надеемся оно к лучшему. Скачавшим- что там с сдк?
Старый 18.02.2010, 20:08
agentex

offline
Опыт: 34,834
Активность:
с чем?) его там нету. (экзешника я не нашел) да и поиграть не получится без бетаключа.
agentex добавил:
const int c_maxPlayers = 32
fake?
Старый 18.02.2010, 20:14
XOR

offline
Опыт: 38,159
Активность:
Какой экзешник у sdk?)
Вполне ожидаемое количество игроков)
Старый 18.02.2010, 20:16
Toadcop

offline
Опыт: 54,313
Активность:
Цитата:
Сообщение от MindWorX
Код:
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


Running the current Base13891\SC2.exe throught IDA, i was able to extract that list of natives, there might be more, as i can't find a definition point, so that's just the list i've found sofar, there's 457 natives in that. I wasn't able to find anything about which arguments they take, so you'll just have to speculate on that. I might be able to gather some information on the argument count later one, once i've analyzed some of the known natives.

EDIT:
Did a bit of poking around, and analyzed a function, specifically, the one called "Point", as it's purpose seems simple enough. After looking at it, I found that handles aren't just a pointer to the data, but a pointer to a struct/class/whatever that contains the data. I still think it uses a handle id, and not memory pointers, based on the following function:
Код:
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;
}


As you can see in the end field_10 and field_14 are assigned the values of the point, and then the function returns field_8, which i suspect might be the handle of the Point structure. This is all speculation, and highly useless atm, but maybe it'll help when we're experimenting in the future.

EDIT 2:
After poking around some more, it seems the "&off_137892C" part of the script, might be a debugging thing, as the function it links to, appears to print some sort of debug string atleast.
Старый 19.02.2010, 17:41
XOR

offline
Опыт: 38,159
Активность:
Всего 457 нативо =/
XiMiKs добавил:
Хотя учитывая возможности нового РО, его будет вполне достаточно.

Отредактировано XiMiKs, 19.02.2010 в 18:02.
Старый 19.02.2010, 17:48
Enein
Silenced by ZlaYa1000
offline
Опыт: 43,453
Активность:
учитывая возможности нового РО
ну и что там за возможности, расскажи а?
Старый 19.02.2010, 17:51
XOR

offline
Опыт: 38,159
Активность:
но в StarCraft II это все может быть настроено полностью в объектах, и Вы могли бы создавать способности вообще без триггеров!
XiMiKs добавил:
еще "умные" вопросы?
Старый 19.02.2010, 17:58
Toadcop

offline
Опыт: 54,313
Активность:
Цитата:
Сообщение от Deaod
Heres a list of galaxy errors:
Код:
e_badLValue=Cannot assign to the left side of assignment expression
e_badParameterType=Can only pass basic types
e_cantFindInclude=Include file not found
e_cantTakeAddress=Cannot use '&' on an object which has no address
e_constAssigned=Const variable already assigned
e_constInitRequired=Must initialize const variables
e_constNotAllowedHere=Cannot use const here
e_derefNotPointer=Cannot use '->' on a non-pointer object
e_expectedArrayIndex=Expected an array index: '['
e_expectedBoolExpr=Expected a boolean expression
e_expectedCloseBrace=Expected a closing brace: '}'
e_expectedComma=Expected a comma: ','
e_expectedConstExpr=Non-constant initialization of constant object
e_expectedExpr=Expected an expression
e_expectedFieldName=Expected a field name inside a structure
e_expectedFieldType=Expected a field type inside a structure
e_expectedFuncBody=Expected ';' or function body
e_expectedGlobalName=Expected unused global variable or function name
e_expectedInclude=Expected an include file name
e_expectedIntType=Shift operator requires integer value
e_expectedLeftParen=Expected '('
e_expectedNativeName=Expected a registered native function name
e_expectedOpenBrace=Expected an opening brace: '{'
e_expectedParams=Invalid parameter list
e_expectedReturn=Expected a return value
e_expectedRightParen=Expected ')'
e_expectedSemicolon=Expected a semicolon: ';'
e_expectedStructIdent=Structure requires an identifier
e_expectedType=Expected type name
e_expectedTypedefIdent=Typedef requires an unused identifier
e_expectedTypedefType=Typedef requires a type
e_globalsTooLarge=Global data are too large
e_identiferTruncated=Truncated identifier
e_illegalArraySize=Illegal array dimension
e_illegalCharacter=Illegal char constant
e_illegalEscapeSeq=Illegal escape sequence
e_illegalIndex=Array index require an integer value
e_illegalOctal=illegal octal digit
e_internalGalaxyError=Internal compiler error
e_localsTooLarge=32k - 1 size limit to local variables
e_mangleOverflow=Mangled name overflow
e_nativeMismatch=Native function prototype does not match the internal function
e_nestingTooDeep=Nesting overflow
e_newlineConst=Newline in constant
e_noBulkCopy=Bulk copy not supported
e_noForwardSupport=struct forward declaration not supported
e_noImplicitCast=Implicit cast not allowed
e_noNestedStruct=struct cannot be nested inside itself
e_notArray=Cannot use '[': object is not an array
e_notFunction=Cannot use '(': object is not a function
e_notStruct=Cannot use '.': object is not a structure
e_notStructField=This field is not a member of the struct type
e_noVoidVars=Illegal variable type: void
e_numericOverflow=Numeric overflow
e_oldStyleDimension=Galaxy array definitions require the dimension after the type
e_paramCountMismatch=Wrong number of parameters
e_paramTypeMismatch=Parameter type does not match the function definition
e_prototypeMismatch=Function does not match previous definition
e_callbackMismatch=Mismatched callback definitions
e_redefinedField=struct field redefinition
e_redefinedFuncName=function already defined
e_redefinedParam=redefined identifier
e_registerUsageOverflow=Register overflow
e_requireStruct=Require struct on left side of -> or .
e_scriptTooLarge=Script too large
e_stateStackOverflow=Stack overflow
e_stringTruncated=Truncated string
e_syntaxError=Syntax error
e_typecastError=That typecast not allowed
e_typeMismatch=Types do not match
e_undefFunction=Function declared but not defined
e_unexpectedBreak=Unexpected 'break' statement
e_unexpectedComment=comment blocks with /* */ are not supported
e_unexpectedContinue=Unexpected 'continue' statement
e_unexpectedDirective=unexpected directive, Galaxy does not have a preprocessor
e_unexpectedGoto='goto' statements are unsupported
e_unexpectedNew=dynamic memory allocation unsupported
e_unexpectedOperator=Operators ++ and -- are unsupported
e_unexpectedReturn=Unexpected value returned from a 'void' function
e_unexpectedSign=unexpected 'signed' or 'unsigned' as Galaxy types have implicit sign
e_unexpectedSwitch='switch' statements are unsupported
e_unreachableCode=unreachable code
e_jumpOutOfBounds=Code jump out of bounds (try reducing the size of very large functions or triggers)
e_noFunctionBody=No function body was ever declared

e_execPaused=Execution paused
e_threadIsActive=Execution currently active
e_threadIsReady=Thread is ready to execute
e_execTimeout=Execution took too long
e_codePtrInData=Code pointer tried to jump to data space
e_dataPtrInCode=Data pointer tried to access code space
e_divByZero=Divide by zero
e_invalidAddr=Invalid address
e_invalidGlobalPtr=Invalid global pointer
e_invalidStackPtr=Invalid stack pointer
e_nativeCodeError=Native function has encountered an error
e_notInCode=Code pointer moved out of code space
e_nullPointer=Dereferenced a null pointer
e_stackOverflow=Stack overflow
e_stackUnderflow=Stack underflow
e_unknownInstr=Unknown instruction

e_functionNotFound=Function not found
e_tooManyThreads=Too many threads
e_nestedIteration=Nested iteration detected
e_noInternalThread=No internal thread
e_tooManyInternalThreads=Too many internal threads



даёт возможность сделать несколько выводов...

XiMiKs, где ты увидел GethandleId или что либо подобное ? О_О

Toadcop добавил:
да говно ты можеш там создать =)
+ это не все нативки.
Старый 19.02.2010, 18:01
agentex

offline
Опыт: 34,834
Активность:
XiMiKs, там же написано: это токо те нативки, которые он смог выловить
e_unexpectedOperator=Operators ++ and -- are unsupported
грустна
да там куча такого, этакий недоси получается
Старый 19.02.2010, 19:01
Toadcop

offline
Опыт: 54,313
Активность:
есть cJass ^__^ будет cGal O_o ...
кстати адика надо подключить оперативно О_О ибо у них нету препроцессора (сами написали О_О). (как мин дефайны точно нужны. да и другие вещи тоже)
Старый 19.02.2010, 19:42
adic3x

offline
Опыт: 108,439
Активность:
подключис со временем) будет мб pyGal ?)
да, препроцессор нужен... меня смутил пост векса в топики жасс хелпера - уж не думаем ли мы, что он будет писать с 0 что то под вар?
время покажет
Старый 20.02.2010, 01:19
ScorpioT1000
Работаем
online
Опыт: отключен
все просто, стринг - это string (наверно cpp string)
текст - это ostream (ихний) тоесть поток вывода с прочими фенечками (как видно не только стринг ту текст есть - AIWaveToText)
Старый 21.02.2010, 23:42
Скайнет
Kicked by ZlaYa1000
offline
Опыт: 8,234
Активность:
ADOLF, векс сошёл с ума или просто нечего делать, что невероятно.
На самом деле интересно, ведь тысячи картоделов, которые мало чего добились в вк3 из-за влияния доты, ворвутся делать десятки тысяч карт с нуля для ск2, это будет эпическое месиво.
Странно что ооп не будет (?), поскольку близы ещё давно обещали сделать галакси максимально годным для работы и примеров необходимых функций и методов лежали в открытую (вжасс).
Старый 22.02.2010, 02:46
ScorpioT1000
Работаем
online
Опыт: отключен
потомучто сделать язык с поддержкой ооп - это уже нехилая работа, а тут целый редактор)
ScorpioT1001 добавил:
visual studio до сих пор имеет масс неудобств и неточностей, которые можно обсуждать годами во всех аспектах. что вы хотите от интерпретатора скриптов?
собственно структуры есть, если руками препроц делать, тут только приватность + наследование
ScorpioT1001 добавил:
кстати говорит о многом:
e_cantFindInclude=Include file not found
)
ScorpioT1001 добавил:
Еще немного анализа:
void AISetStockAlias (int player, int count, string makeType, string aliasType) {
    count = count - AITechCount(player, aliasType, c_techCountQueuedOrBetter);
    if (count > 0) {
        AISetStock(player, count + AITechCount(player, makeType, c_techCountQueuedOrBetter), makeType);
    }
}

void AISetStockFree (int player, int count, string makeType, string prereq) {
    if (AITechCount(player, prereq, c_techCountCompleteOnly) > 0) {
        AISetStock( player, count, makeType );
    }        
}

native point AIBestTargetPoint (
    unitgroup group,
    int minHits,
    int damageBase,
    fixed minScore,
    fixed radius,
    point from,
    fixed range,
    int bonusAttri
);
значит, операторов -= и += ятп скорей всего не будет)
также из TacticalAI.galaxy:
        count = count - 1;
++ и -- тоже? ;(

а перечисления у нас везде вот такие:
const int c_combatEnable     = 1;
const int c_combatDisable    = 2;
const int c_combatRead       = 3;
это хреново. неужели в этом есть преимущества?

добавил вложение из www.wc3c.net/showthread.php?t=108987

Идём дальше:
в файле BuildAI.galaxy я нашел побитовые операции ! :)
const int c_avoidPowerOrCreep       = c_avoidClosePowerOrCreep | c_avoidFarPowerOrCreep;
const int c_avoidFactory            = c_avoidCloseFactory | c_avoidFarFactory;
const int c_avoidDefense            = c_avoidCloseDefense | c_avoidFarDefense;
const int c_avoidDropoff            = c_avoidCloseDropoff | c_avoidFarDropoff;

а вот и ололо, свича нету (тот же косяк как с энумами)
int AIGetDefaultBuildFlags (int player, string objType) {

	// special protoss units
    if (objType == c_PB_Nexus) {
        return c_makeCenter;
    }
    if (objType == c_PB_Pylon) {
        return c_makePower;
    }
    if (objType == c_PB_Obelisk) {
        return c_makeDarkPower;
    }
    if (objType == c_PB_PhotonCannon) {
        return c_makeDefense;
    }
    if (objType == c_PB_Assimilator) {
        return c_makeCollector;
    }
//...
т.е. очевидны явные неудобства, которые просто не устранили)

кстати, из ф-ции
//предполагаем, что так:
TriggerDebugOutput (int, text, bool)

//вызовы:
        TriggerDebugOutput(
            1,
            StringToText("[") +
            PlayerColorName(PlayerGetColorIndex(player, false)) +
            StringToText("] ") +
            StringToText(s),
            true
        );
очевидно, что text - есть своеобразный "поток вывода", как я выше и говорил
ScorpioT1001 добавил:
дальше в MeleeAI.galaxy можно сказать, что объявление локальных переменных разрешено только в начале функции:
void AISetAttackState (int player, int attackState) {
    string msg;
    int oldState = AIState(player, e_attackState);

    AISetSpecificState(player, e_attackState, attackState);
    
    if (DEBUG_ATTACK_STATE) {
        msg = "Player " + IntToString(player) + "-" + PlayerRace(player) + " attack state " + 
            AttackStateName(oldState) + " -> " + AttackStateName(attackState);
        DebugAI(msg);
    }
}

Вобще вот интересно по поводу типа wave, это что-то гибридное между group и order queue чтоли ) типа такие "куски AI"
ScorpioT1001 добавил:
Многострочные комментарии отсутствуют.
ScorpioT1001 добавил:
Есть операторы break и continue:
» open
        while (friendlyCount > 0) {
            friendlyUnit = UnitGroupUnit(friendlyGroup, friendlyCount);
            friendlyCount = friendlyCount - 1;
            // Get friendly data
            friendlyVit = UnitGetPropertyInt(friendlyUnit, c_unitPropLifePercent, c_unitPropCurrent);

            if (UnitMarkerCount(friendlyUnit, m) > 0) {
                continue;
            }
            // Test Priority Target 4 first, if we are in a state of saving ourself
            if (emergencyCast) {
                if (PointsInRange(myPos, enemyPos, forceFieldMaxRadius)) {
                    priorityFound = 1;
                    bestTargetUnit = friendlyUnit;
                    break;
                }
            }
ScorpioT1001 добавил:
нашел натив функцию StringEqual(string, string, bool)
она используется вместо оператора ==
значит, справедливо предположить, что у строки 1 и строки 2 могут быть разные хэндлы (т.е. == вернет false),
но при этом одинаковое содержимое.
Из этого следует, что стринги не автоматизированны ) хотя еще спорно
ScorpioT1001 добавил:
нашёл остаток от деления:
    if (AIGetTime() % 300 > 5) {
        return;
    }
:)
ScorpioT1001 добавил:
RAW code был заменён на строки (т.е. теперь не будет 'Aloc' будет напр "ANLocust" и т.п.)
прав.
void AINewUnitZerg (int player, unit u) {
    wave w;
    string type = UnitGetType(u);
Прикрепленные файлы
Тип файла: rar GALAXY.rar (39.3 Кбайт, 50 просмотров )
Старый 22.02.2010, 05:18
Скайнет
Kicked by ZlaYa1000
offline
Опыт: 8,234
Активность:
А что насчёт обещанных "сборщиков мусора", которые автоматом будут вычищать все утечки памяти без любого вида исправлений?
Старый 22.02.2010, 14:46

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы можете скачивать файлы

BB-коды Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход



Часовой пояс GMT +3, время: 12:49.