Skip to content

giveturn

Charles Hydronium edited this page Nov 9, 2024 · 5 revisions

Give Turn

this library adds a function that forcibly gives a turn to a specified team. Usually used at the end of cutscenes.

To use anything from this library, you need to add the following to the script:

HedgewarsScriptLoad("/Missions/Campaign/A_Collection_of_Unimaginative_Dreams/Scripts/giveturn.lua")

Hedgewars' Tracker library needs to be loaded too.

HedgewarsScriptLoad("/Scripts/Tracker.lua")

as is recommended by the Tracker library, the function trackTeams() needs to be added in onGameStart()

function onGameStart()
     trackTeams()
end

the function CheckGivenTurn() needs to be added in onNewTurn()

function onNewTurn()
     CheckGivenTurn()
end

all hedgehogs need to be tracked from the beginning

function onGearAdd(gear) if GetGearType(gear) == gtHedgehog then trackGear(gear) end end
function onGearDelete(gear) if GetGearType(gear) == gtHedgehog then trackDeletion(gear) end end

onGivenTurn()

This function is called when a new turn starts that was called using GiveTurn. Useful when a team still needs to be passive after all teams are no longer passive (NPC Teams, etc.)

function onGivenTurn()
	SetTeamPassive(PrincessTeam,true)
end

GiveTurn(team[, hog])

Ends the current turn and gives it to the first hedgehog of team team, or optionally to a hedgehog hog. Needs to be a real team name, see AddTeam.

GiveTurn(HelperTeam)
GiveTurn(HumanName,triggered)

Note

every other function in this library isn't supposed to be used anywhere else

Clone this wiki locally