Spawning main heroes

Maps and the art of mapmaking.
tofiffe
Peasant
Peasant
Posts: 93
Joined: 21 Mar 2010

Unread postby tofiffe » 16 Sep 2010, 14:32

er why doesn't the spell work? it's casted as it should be, but nothing happens...

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 16 Sep 2010, 17:11

You should be more specific. What spell?

tofiffe
Peasant
Peasant
Posts: 93
Joined: 21 Mar 2010

Unread postby tofiffe » 16 Sep 2010, 17:47

mass decay...do i have to target some units?

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 16 Sep 2010, 18:19

RTFM for god's sake! It's all in the manual!

tofiffe
Peasant
Peasant
Posts: 93
Joined: 21 Mar 2010

Unread postby tofiffe » 25 Sep 2010, 08:49

the problem is, in my scripting manual in game folder, there is no function UnitCastGlobalSpell to lookup...

and one more thing: is there any way to create another dungeon level? the first one is to full, and i need some more space for objects...

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 26 Sep 2010, 17:57

OK, in two words, targeted spells require target to work. And mass plague is a targeted spell.

No way to make another level. You can have another underground instead of the surface though.

tofiffe
Peasant
Peasant
Posts: 93
Joined: 21 Mar 2010

Unread postby tofiffe » 27 Sep 2010, 12:28

so i need to do like:
UnitCastGlobalSpell(hero, SPELL_MASS_PLAGUE, x, y); ?
i have tried this... i did c=GetAttackerUnits() or something like that then x,y=GetUnitPosition(c[0]) and the script returns wrong coordinates...

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 27 Sep 2010, 17:32

Why would you think they are wrong?

Battle arena does have strange coordinate system. If the returned values are numbers, then it's ok.

tofiffe
Peasant
Peasant
Posts: 93
Joined: 21 Mar 2010

Unread postby tofiffe » 29 Sep 2010, 17:58

error:attempt to call a script value. that's what i get...

Franzy
War Dancer
War Dancer
Posts: 362
Joined: 07 Sep 2007
Location: Moscow, Russia
Contact:

Unread postby Franzy » 01 Oct 2010, 05:50

OK, here is the list of combat functions (original game only, in patches a few were added)

Hooks (caled at different battle stages):
bool DoPrepare() - when players place troops on the battlefield

bool DoStart() - right after placement phase before anyone moves

bool UnitMove(sUnitName) - right before any AI move

bool AttackerUnitMove(sUnitName)
bool AttackerHeroMove(sUnitName)
bool AttackerCreatureMove(sUnitName)
bool AttackerWarMachineMove(sUnitName)
bool AttackerBuildingMove(sUnitName)
bool DefenderUnitMove(sUnitName)
bool DefenderHeroMove(sUnitName)
bool DefenderCreatureMove(sUnitName)
bool DefenderWarMachineMove(sUnitName)
bool DefenderBuildingMove(sUnitName)
- the same but with unit type

void UnitDeath(sUnitName) - at a stack death

void AttackerUnitDeath(unitName)
void AttackerHeroDeath(sUnitName)
void AttackerCreatureDeath(sUnitName)
void AttackerWarMachineDeath(sUnitName)
void AttackerBuildingDeath(sUnitName)
void DefenderUnitDeath(sUnitName)
void DefenderHeroDeath(sUnitName)
void DefenderCreatureDeath(sUnitName)
void DefenderWarMachineDeath(sUnitName)
void DefenderBuildingDeath(sUnitName)


Control functions:

void EnableDynamicBattleMode( bEnable )
void EnableAutoFinish( bEnable ) - if diabled the battle won't end when all the troops of one side are slain.
void EnableCinematicCamera( bEnable )
void SetControlMode( nSideID, nModeID )
- sets combat mode, cannot use for AI players
ModeID:
MODE_NORMAL = 0
MODE_MANUAL = 1
MODE_AUTO = 2
SideId:
ATTACKER = 0
DEFENDER = 1

void Finish( nSideID ) - nSideID wins!

void Break()
- cancels combat, no losses are suffered by either side

void showHighlighting( bShow = true )

Unit Control:

void SummonCreature( nSideID, nCreatureID, nCount, nX = -1, nY = -1 )
--this adds troops till end of combat
void AddCreature( nSideID, nCreatureID, nCount, nX = -1, nY = -1 )
-- this func adds troops permantntly
-- make sure to add sleep(1) after calling any of these two

void removeUnit( sUnitName )

void UnitCastAimedSpell( sUnitName, nSpellID, sTarget)

void UnitCastGlobalSpell( sUnitName, nSpellID )

void UnitCastAreaSpell( sUnitName, nSpellID, nX, nY )

--Make sure to add sleep(n) after any of these three, where n - is length of comat casting. e.g. 8 for fireball. 20 or so for Implosion.

void SetUnitManaPoints( sUnitName, nPoints )

number GetUnitMaxManaPoints( sUnitName )

number GetUnitManaPoints( sUnitName )

void commandDefend( sUnitName ) --forces defend command

void commandDoSpell( sUnitName, nSpellID, nX, nY )

void commandShot( sUnitName, sVictimName, bDontShowScene = false )

void commandMove( sUnitName, nX, nY, bCheckPath = false )

void commandMoveAttack(sAttacker, sVictim, nX = -1, nY = -1, bCheckPath = false)

void commandDoSpecial(sUnitName, nAbilityID, nX = -1, nY = -1, bCheckPath = false)

void displace( sUnitName, nX, nY ) - instant teleport

void playAnimation( sUnitName, sAnimType, nActionTypeID = ONESHOT )

IDLE = 1
ONESHOT_STILL = 2
ONESHOT = 3
NON_ESSENTIAL = 5

void combatPlayEmotion( nSideID, n1 )

void RemoveAllUnits()

void setATB( sUnitName, n1 )


Other:
tsUnits GetUnits(nSideID, nType)
Types:
HERO = 0
CREATURE = 1
WAR_MACHINE = 2
BUILDING = 3

sHeroName GetHero(nSideID)
tsUnits GetCreatures(nSideID)
tsUnits GetWarMachines(nSideID)
tsUnits GetBuildings(nSideID)
sHeroName GetAttackerHero()
sHeroName GetDefenderHero()
tsUnits GetAttackerCreatures()
tsUnits GetDefenderCreatures()
tsUnits GetAttackerWarMachines()
tsUnits GetDefenderWarMachines()
tsUnits GetAttackerBuildings()
tsUnits GetDefenderBuildings()
nCreatureID GetCreatureType( sCreatureName )

nX, nY pos( sUnitName ) --gets unit position

bool combatStarted() --returns false ifcobat not yet started

sHeroName GetHeroName( sUnitName )

number GetCreatureNumber( sUnitName )

nX, nY GetUnitPosition( sUnitName )

bool exist( sUnitName ) --is unit alive?

nHostType GetHost( nSideID ) --who controls the side

HUMAN = 0
COMPUTER = 1

bool IsHuman( nSideID )
bool IsComputer( nSideID )

nSideID GetUnitSide( sUnitName )

ATTACKER = 0
DEFENDER = 1

bool IsAttacker( sUnitName )
bool IsDefender( sUnitName )
number GetUnitType( sUnitName )

HERO = 0
CREATURE = 1
WAR_MACHINE = 2
BUILDING = 3

bool IsHero( sUnitName )
bool IsCreature( sUnitName )
bool IsWarMachine( sUnitName )
bool IsBuilding( sUnitName )

number GetWarMachineType( sUnitName )

WAR_MACHINE_BALLISTA = 1
WAR_MACHINE_CATAPULT = 2
WAR_MACHINE_FIRST_AID_TENT = 3
WAR_MACHINE_AMMO_CART = 4

sUnitName GetWarMachine( nSideID, nWarMachineTypeID )
sUnitName GetAttackerWarMachine(nWarMachineTypeID)
sUnitName GetDefenderWarMachine(nWarMachineTypeID)
number GetBuildingType( sUnitName )

BUILDING_WALL = 1
BUILDING_GATE = 2
BUILDING_LEFT_TOWER = 3
BUILDING_BIG_TOWER = 4
BUILDING_MOAT = 5
BUILDING_RIGHT_TOWER = 6
BUILDING_MAGIC_WALL = 7

sUnitName GetBuilding(nSideID, nBuildingID)
sUnitName GetAttackerBuilding(nBuildingID)
sUnitName GetDefenderBuilding(nBuildingID)

sUnitName combatReadyPerson() --return current unit (whose turn it is)

tofiffe
Peasant
Peasant
Posts: 93
Joined: 21 Mar 2010

Unread postby tofiffe » 01 Oct 2010, 16:58

ok thanks, that's a lot of functions...should help a lot!


Return to “Mapmaking Guild”

Who is online

Users browsing this forum: No registered users and 1 guest