Lua Documentation
Explore the Lua functions for The Guild 2: Reforged
0 functions found
Game
UI
Economy
UI
10
HudCancelUserSelection
New
cancels the user measure selection
HudEnableElement
New
enables/disables a hud element specified by element name.
HudGetActiveSheet(
HudPanelIsVisible
New
returns if the panel specified by the given panel name is visible or not
HudSetViewToObject
New
set the camera to focus on any object that has position (locator,sim,building,etc.) at given distance and angle
HudAddToSelection
New
adds an object to the selection of the local player
HudClearSelection
New
Clears the selection of the local player
HudDeselect
New
This function deselects the current selected object
HudGetSelected
New
This function writes the selected object
HudSelect
New
This function selects a guildobject in the hud as the current selection.
HudGetActiveCharacter
New
adds the currently active playercharacter (Sim)
Economy
2
ModifyWorkerWages
Modifies all worker wages in the game by the specified multiplier.
GetTaxRateForBuilding
Gets the current tax rate for a specific building and tax type.
Quests
1
BindQuest
Return value: true if succeeded, false if an error occurs.
Binds the quest with the given quest name.
Buildings
1
BuildingGetBaseHP
Gets the max health points of a building.
Global
461
BindQuest
New
binds the quest with the given questname
ChangeAlias
New
Changes the name of an alias.
CheckGameTimerEnd
New
checks if the gametimer (if set) has ended
ClearStateImpact
New
Clear's a state depended impact. This function is only valid in a state script
CommitAction
New
This function commits an action. The action can create evidences and controls the observer if nessesary. The action are defined in the database.
CopyAliasFromCutscene
New
copy an aliased object to a cutscene
CopyAliasToCutscene
New
copy an aliased object to a cutscene
CourtingId2Measure
New
translates the courting id to the measure name
CreateCutscene
New
create a new cutscene
CreateScriptcall
New
Generates a timed script call of the function 'Function'. The script is specified by the script filename and the function Name.
CutsceneGetMeasureLockTime
New
CutsceneGetMeasureLockTime()
Parameters:
Return Value:
:
no comment
Description:
no comment
CutsceneHUDShow
New
no comment
CutsceneSetMeasureLockTime
New
DoNewBornStuff
New
Initializes attributes for new born sims
Find
New
checks a given amount of objects by the given filter string. The objects that passes the filter will be copied to the Result. Specifics depends on the filterstring and the used filters. If more than one object is found the resultname will be extended by an idx for ever found object (f.e. Result1, Result2...)
FindByID
New
checks a given amount of objects by the given filter via Filter DatabaseID. The objects that passes the filter will be copied to the Result. Specifics depends on the filterstring and the used filters. If more than one object is found the resultname will be extended by an idx for ever found object (f.e. Result1, Result2...)
FindByName
New
checks a given amount of objects by the given filter via name
FindResourceProto
New
gets a resource proto for an item
GFXRand
New
Returns a random
GetAliasByID
New
Assigns the given Alias for the object with the given ID.
GetBuildingBasePrice
New
gets the base price of a building
GetCameraPosition
New
gets the current camera position and zoom from the world - eg.: CamX, CamZ, Zoom = GetCameraPosition()
GetData
New
Returns data from the measure.
GetDatabaseValue
New
Returns an entry from a database table.
GetGametime
New
Get the current gametime in hours.
GetMeasureRepeatName2
New
Gets the standard measure repeat timer name for a measure
GetNobilityTitleLabel
New
Returns the nobility title label of the given
GetOutdoorLocator
New
Get's outdoor-locator from the terrain by it's name. If there is more than one locator buy that name, the locator are returned with the name + the index number. eg. if ret_Position is "Pos", and 3 locators are found, the locators are returned as "Pos0", "Pos1", "Pos2". The first found locator is also returned as "Pos".
GetRound
New
Get the current round (0...n)
GetScenario
New
make the guildworld accessible via an
GetSeason
New
Returns the current season.
GetSettingNumber
New
Get a
GetSettingString
New
Get a string value from the config file
GuildII_ClearImportantPersonSection
New
GuildII_CreateImportantPersonSection
New
GuildII_SetImportantPerson
New
sets the measure runtime for displaying in the Measure OSH
HasData
New
Indicates it a certain data exists.
HasRunningQuest
New
returns if the given actor has the given quest running
HideTutorialBox
New
Hides the tutorial box
Include
New
includes the given script
InitAlias
New
gets a measure alias by user selection, the scripts waits for the selection to be completed
InitData
New
initialize a measure data, the scripts waits for the initialization to be completed
IsAIDriven
New
Returns true if the measure is ai driven.
IsDestroyed
New
Returns if the measure object is in the "destroyed" state.
IsGUIDriven
New
Returns true if the measure is gui driven.
IsInit
New
Returns if the measure object is in the "init" state.
IsMultiplayerGame
New
Indicates if it is a multiplayer game
IsReady
New
Returns if the measure object is in the "ready" state.
IsStateDriven
New
Returns if the measure is state driven.
ItemGetBasePrice(
KillQuest
New
kills the quest specified with pQuestname and QuestSource. If QuestSource is 0 all Quest with pQuestname will be killed. If both are 0, the current quest will be killed.
ListAdd
New
adds the an object to a list
ListClear
New
removes all elements from a list
ListGetElement
New
gets an element from a list by index, and makes it accessible by ObjectAlias if successfull
ListMerge
New
adds the elements of SrcListAliasName to DestListAliasName. The members are not removed from the sourcelist
ListNew
New
Create a list under the alias ListAliasName
ListRemove
New
removes an element from a list
ListSize
New
returns the size of a list
LogText
New
Logs the given text.
MeasureClearRuntimeData
New
clears the script runtime data, which means the script can only access the init data after the function call
MeasureGetID
New
returns the database id of a measure
MeasureGetPriority
New
Returns the priority of the measure.
MeasureSetNotRestartable
New
forbids the measure to restart, which means the measur will cleanup instead of restart
MeasureSetPriority
New
Sets a new priority to this measure.
MsgDebugMeasure
New
Sets a debug message text.
MsgQuestIntro
New
shows the given text in the quest
Name2BuildingType
New
transforms a name of a building type to its number - eg. it returns for "tavern" the id 3 (see database table obj_buildign_type)
OSHSetMeasureCost
New
sets the measure cost for displaying in the Measure Tooltip
OSHSetMeasureRepeat
New
sets the measure repeattime for displaying in the Measure OSH
OSHSetMeasureRuntime
New
sets the measure runtime for displaying in the Measure OSH
PhysicsRand
New
Returns a random
PlaySound
New
Plays a global sound (regardless of the position of the camera)
PlaySound
New
Plays a single sound which is heared regardless of the position of the camera.
PlaySoundVariation
New
Plays a random global sound (regardless of the position of the camera)
PlayerMeasureStarted
New
returns if the player hast already started the measure with the given MeasureID !! untested !!
ProfessionGetLabel
New
Gets the label of an item.
RemoveAlias
New
Removes an alias from the measure.
RemoveData
New
Remove arbitrary data from the measure.
RemoveOverheadSymbol
New
removes an existing overhead symbol. The symbol will be identified by the given OverheadSymbolID
RemoveScriptcall
New
removes a scriptcall by name (attention, this removes ALL SCRICPTCALLS WITH THIS NAME ON EVERY OBJECT)
ResetGamespeed
New
resets the gamespeed to normal
ResetMouseCursorTexture
New
resets the mouse cursor to the default cursor
ResetProcessProgress
New
disables and resets the progressbars.
ResetQuest
New
resets the quest specified with pQuestname and QuestSource. If QuestSource is 0 all Quest with pQuestname will be reseted. If both are 0, the current quest will be reseted. Remember: though the quest will be reseted, the ingame impacts of the quest via runtime can not be reseted, so they have to be undone in the questscript.
ScenarioCreatePosition
New
Creates a outdoor position (eg. for creating a sim/chest)
ScenarioGetObjectByName
New
Get an object from the current world. To find the object the class and it's name is used
ScenarioGetObjects
New
Get all objects from a class from the world. The Objects are returned in the aliases o_Object0 ... o_ObjectN). For example: ScenarioGetObjects("Settlement", 10, "City") gets all settlements and returns it in the aliasse "City0" ... "City9". The count of the aliasses are returned by this function. Attention: You should use this function carefully, because you can get all objects from a big class like "cl_Sim" and got a hole bunch of data.
ScenarioGetObjects
New
Get all objects from a class from the world. The Objects are returned in the aliases o_Object0 ... o_ObjectN). For example: ScenarioGetObjects("Settlement", 10, "City") gets all settlements and returns it in the aliasse "City0" ... "City9". The count of the aliasses are returned by this function. Attention: You should use this function carefully, because you can get all objects from a big class like "cl_Sim" and got a hole bunch of data.
ScenarioGetRandomObject
New
Get a random object from the current world. To find the object the class is used
ScenarioGetTimePlayed
New
gets the time played (in hours) from the world
ScenarioGetUnspawnedEnemiesCount
New
returns the number of unspawned ai dynasties
ScenarioGetYearsPerRound
New
Get the years increment per round (default value is 4 years per round)
ScenarioPauseAI
New
pauses or unpauses the ai of the game
ScenarioSetNameLanguage
New
sets the language of the sim names in the current map. Values can be
language
New
Sets the outdoor scroll boundaries of the scenario. The po
ScenarioSetYearsPerRound
New
Set the years increment per round (default value is 4 years per round)
SendCommand
New
Sends a command to an object. The script will wait for the finish of the command to continue.
SendCommandNoWait
New
Sends a command to an object while proceeding with the script.
SetAvoidanceGroup
New
sets an
SetData
New
Attaches arbitrary data to the measure.
SetDestroyed
New
Sets the measure object to the "destroyed" state.
SetInit
New
Sets the measure object to the "init" state.
SetMainQuest
New
attaches the calling quest as subquest to the given mainquest. Needed for Questbook view
SetMainQuestDescription
New
sets the given main quests description. Creates a new main quest if not allready existing. Needed for Questbook view
SetMainQuestTitle
New
sets the given main quests title. Creates a new main quest if not allready existing. Needed for Questbook view
SetMeasureRepeat
New
Sets the standard measure repeat timer for this measure. If no destination is specified, the timer is global for executing this measure. If a destination is specified the measure is only forbidden with the destination as target.
SetMouseCursorTexture
New
changes the mouse cursor
SetProcessMaxProgress
New
sets a free settable value of maximum progress of a process.
SetProcessProgress
New
sets a free settable value of the current progress of a process (and must always be smaller than MaxProgress!).
SetQuestDescription
New
sets the quest description. pDesc must be a textlabel which will be localized via the textsystem.
SetQuestDescriptionByQuestname
New
sets the quest description. pQuestname must be a name of an allready triggered quest or "" for this quest, pDesc must be a textlabel which will be localized via the textsystem.
SetQuestTitle
New
sets the quest title. pTitle must be a textlabel which will be localized via the textsystem.
SetReady
New
Sets the measure object to the "ready" state.
SetStateImpact
New
Set's a state depended impact. This function is only valid in a state script
SetTime
New
Set the current game time.
SetTitlePrivileges
New
Sets the privilegeVector of a title holder
ShowBuildingFlags
New
Shows or hides the flags of a building
ShowMap
New
shows/hides the hud map sheet ?? untested ??
ShowPanel
New
Shows a panel in the multifunctional display. The script will wait for the movement to be finished.
ShowPanelNoWait
New
Shows a panel in the multifunctional display.
ShowStatistics
New
Shows the statistics screen for the player dynasty. Note that the game will pause !!!
ShowTutorialBox
New
Shows a tutorial box specified by the given arguments, forces the script to wait for user input in the tutorial box, so be shure to add buttons on which the user can click or use ShowTutorialBoxNoWait
ShowTutorialBoxNoWait
New
Shows a tutorial box specified by the given arguments
StartGameTimer
New
starts a gametime decrementing timer which end can be check via the function CheckGameTimerEnd
StartHighPriorMusic
New
Starts a music which overrules the normal music and the pause
StartMission
New
starts a quest with the given questname with the given actor and source if the questrequirements are fullfiled. If RemainInStartup is true the questrequriements will be checked every frame until they are fullfilled an the quest can start.
StartQuest
New
starts a quest with the given questname with the given actor and source if the questrequirements are fullfiled. If RemainInStartup is true the questrequriements will be checked every frame until they are fullfilled an the quest can start.
StartSingleShotParticle
New
Create a particle effect on a given position
StopAction
New
This function stopps emitting an action initiated
CommitAction
New
Stops the current measure.
StopScheduledScript()
Parameters:
Return Value:
:
no comment
Description:
Terminates the execution of the current scheduled script
WaitForSelection
New
forces the measurescript to wait for a user selection
ActionIsEvidence
New
Increases/Decreases the lock counter of an action
ActionIsStopped
New
returns true, if an action is stopped
ActionLock
New
Increases/Decreases the lock counter of an action
ActionSetData
New
Sets a data value for an action, The action must be started bevor
CommitAction
New
Add's a alias parameter to an AIMeasure. This data is requested in the init function of the measure
MeasureAddData
New
Add's a data member to an AIMeasure. This data is requested on the init function of the measure
MeasureCreate
New
Creates a measure for inscript measure starting
MeasureStart
New
Start's a Measure on the ThisObject.
SquadAddMember
New
adds a new member to a existing
SquadAddRandom
New
Add's a new random member to the squad
SquadDestroy
New
Destroys the squad for the object
SquadGetLeader
New
Get's the leader of the
SquadGetLeaderId
New
Get's the leader-id of the squad
SquadGetMeetingPlace
New
get's the meeting place of the squad (on success)
SquadGetMember
New
Get's the leader of the
SquadGetMemberCount
New
returns the count of the people in the
SquadGetProfession
New
returns the profession for the position i
SquadIsNeeded
New
checks if a sim is needed by a squad
SquadMemberExists
New
checks, if a member with the number i
SquadReady
New
returns true, if all members are ready to act
SquadSetMeetingPlace
New
Set's the meeting place of the squad
SquadSetReady
New
Set's a member to a ready state. true = ready false = not ready
SquadWait
New
waits until the squad has finished collecting people
BankGetOffer
New
Get's a credit offer from a bank
BankSetCreditOffer
New
Creates a credit offer in a bank
Evacuate
New
Evacuate the building (all sims leaves the building)
FindWorker(Alias ( of type building) pBuilding, Alias ( of type sim) o_Worker)
Parameters:
Alias ( of type building) pBuilding :
Building to hire a worker
Alias ( of type sim) o_Worker : OUTPUT
the found worker
Return Value:
:
else error message
Description:
Search for a worker for a building.
GetFreeLocatorByName
New
this function looks for a free locator with the name LocatorName +
GetFreeLocatorByName
New
Get's a locator from a building by it's name. The search sequence is first outdoor, than indoor
GuildGameObjects_BuildingGetPrisoner
New
Gets The hijacked guy withing this Building (ofc oly if there is one)
HireWorker(Alias ( of type building) pBuilding, [Alias ( of type sim) o_Worker])
Parameters:
Alias ( of type building) pBuilding :
Building to hire a worker
Alias ( of type sim) o_Worker : OPTIONAL OUTPUT
the hired worker
Return Value:
:
else error message
Description:
Search and hire a worker for a building.
IsLocatorFree
New
Returns true if the given locator is free
LocatorStatus
New
check's the locator status
SetRoomAnimationTime
New
stops an object's animation in the given room of the building
StartRoomAnimation
New
starts an object's animation in the given room of the building
StopRoomAnimation
New
stops an object's animation in the given room of the building
CartGetOperator
New
Get the operator from a cart.
CartGetType
New
Gets the type of the cart.
CityGetEventText(Alias ( of type city) pCity,
AliasExists
New
Indicates it the given alias exists within the measure.
BlockChar
New
Blocks a char exclusiv for the current measure
CrimeForfeit
New
removes a crime event so that nobody can charge the offender for that particular crime
CrimeGetEvidenceValue
New
returns the evidence value for a single evidence
GetDistance
New
Get the grafical distance between to objects (Position/Sim/Building/...). The funktion returns -1, if the two objects are in different move-systems (eg. different rooms)
GetName
New
Get the
GetProperty
New
Gets a certain property from the given object
HasProperty
New
Indicates if the given object has a certain property.
IsType
New
Checks, if a object is from a type (Sim, Building)
RemoveProperty
New
Removes the property from the given object.
ScenarioStopUsingOutdoorScrollBoundaries
New
Disabling the outdoor scroll boundaries
SetProperty
New
Sets the given value as a property to the object regardless if it already exists or not.
BossCreate
New
Creates a player character with the values from the character creation screen
PlayerCreate
New
Creates a player character with the values from the character creation screen
CreditGetInterest
New
Get's the total value (sum +
CreditGetRemainingTime
New
Get's the total value (sum +
CreditGetRuntime
New
Get's the total value (sum +
CreditGetSum
New
Get's the sum of a credit
CreditGetTotal
New
Get's the total value (sum +
CutsceneAddEvent
New
calls a cutscene function in given time
CutsceneAddTriggerEvent
New
adds a cutscene trigger event:
CutsceneCallThread
New
starts a parallel running script, using pObject as contextobject
CutsceneCameraBlend
New
tells the cutscene camera controller to make a smooth transition from the current position to the next one specified.
CutsceneCameraCreate
New
creates a camera object and associates it with the cutscene. note that you should set a position immeadiatly after this .
CutsceneCameraRelease
New
releases the cutscene camera object associated with this cutscene, if the camera control is in cutscene mode
CutsceneCameraSetAbsolutePosition
New
set the cutscenecamera to a given position
CutsceneCameraSetRelativePosition
New
set the cutscene camera to a position specified by an object and a database camera type.
CutsceneCollectEvidences
New
collects all evidences of pWitness against pOffender and stores them in the cutscenes dataholder. If more than 3 evidences exist evidences #3..n are combined to a single evidence
CutsceneGetData
New
copies a property (alias or data element) from a cutscene to the current measure
CutsceneLocalPlayerIsWatching
New
checks if the local player is watching the cutscene
CutsceneSendEventTrigger
New
sends a named event trigger to the given cutscene
CutsceneSetData
New
copies a property (alias or data element) from the current measure to a cutscene
CutsceneSetTimeBar
New
activates the time-out bar for a given cutscene. Works only while letterboxeffect is visible. Expires after duration.
EndCutscene
New
terminates the cutscene
GuildGameObjects_CutsceneCallScheduled
New
call a function inside a cutscene script. This operation immediatly return
GuildGameObjects_CutsceneCallUnscheduled
New
call a function inside a cutscene script. The called function is executed completely after the call to
CanBuildWorkshop
New
Checks if the given dynasty is allowed to build one more workshop
CheckPlayerBankrupt
New
Checks if the player dynasty is indebted
CheckPlayerExtinct
New
Checks if the player dynasty extincted
GetFavorToDynasty
New
Returns the favor from pObject to pTargetDynasty. If pObject is a dynasty-sim the favor from the dynasty of pObject to pTargetDynasty will be returned.
GetFavorToSim
New
Returns the favor from pObject to pTargetSim. If pTargetSim is a dynasty-sim the favor to the dynasty will be returned. If pObject is a dynasty-sim the favor from the dynasty of pObject will be returned.
GetLocalPlayerDynasty
New
Get's the local player dynasty.
GetMaxWorkshopCount(Alias ( of type dynasty) Dynasty)
Parameters:
Alias ( of type dynasty) Dynasty :
The dynasty
Return Value:
:
The maximum number
Description:
Return the maximum number of allowed workshops due to the title
ModifyFavorToDynasty
New
Modifies the favor from pObject to pTargetDynasty by the given amount. If pObject is a dynasty-sim the favor from the dynasty of pObject will be modified.
ModifyFavorToSim
New
Modifies the favor from pObject to pTargetSim by the given amount. If pTargetSim is a dynasty-sim the favor to the dynasty will be modified. If pObject is a dynasty-sim the favor from the dynasty of pObject will be modified.
SetFavorToDynasty
New
Sets the favor from pObject to pTargetDynasty. If pObject is a dynasty-sim the favor from the dynasty of pObject to pTargetDynasty will be set.
SetFavorToSim
New
Sets the favor from pObject to pTargetSim. If pTargetSim is a dynasty-sim the favor to the dynasty will be set. If pObject is a dynasty-sim the favor from the dynasty of pObject will be set.
Realtime2Gametime
New
Transfer a time given in realtime (1 = 1 second) to gametime (1 = 1h ingame time)
AIFindGoodClass(Alias ( of type guildobject) pObject)
Parameters:
Alias ( of type guildobject) pObject :
dynasty or a part of the dynasty
Return Value:
:
a good class
Description:
This ai function searches for a good new class for a child
AddImpact
New
Sets an impact from table gl_impact_type
AddImpactDependendImpact
New
Sets an impact from table gl_impact_type
AddItems
New
Add's items to pObjects inventory.
AddObjectDependendImpact
New
Sets an impact from table gl_impact_type
Attach3DSound
New
Attach a ne sound to a guild object.
BattleFlee
New
Flee from a battle
BattleGetNextEnemy
New
Gets the next target by evalulation of threat
BattleGetWeaponName
New
Returns the currently selected weapon Weapon
BattleIsFighting
New
Checks if object is involved in a battle
BattleJoin
New
Joins a Battle (and creates it before if needed)
BattleLeave
New
Leaves A Battle
BattleWeaponPresent
New
Draws a Weapon
BattleWeaponStore
New
Sheathes a
CanAddItems
New
checks, if an item can be added to the inventory
CanBeControlled
New
checks if the object can currently be controlled by a dynasty (Filter Object.CanBeControlled() )
CreditMoney
New
Gives the object money.
Detach3DSound
New
Detaches a 3d sound from an object
Fight
New
Starts a fight between pObject and pTarget
FindNearestBuilding
New
Get's the nearest building (type/class/level) from pObject
GetArmor
New
returns the armorvalue of the object (sims cumulated armored objects in inventory e.g.)
GetCrimeLocation
New
retrieve a crime location from the memory
GetDirectionTo
New
Returns the direction from the first object to the second
GetDynasty
New
Returns the dynasty for this object
GetDynastyID
New
Returns the dynasty id for this object
GetHP
New
Returns the current hp of the object
GetHPRelative
New
Returns the current relative hp of the object
GetHomeBuilding
New
Get's the home building for a object. If the object is a worker, his worker-hut is return, if it is a cart, it's worker building is returned. A Dynasty sim returns it's residence.
GetHomeBuildingId(Alias ( of type guildobject) pObject)
Parameters:
Alias ( of type guildobject) pObject :
Object (cl_Sim/cl_Cart)
Return Value:
:
the id or -1 on error
Description:
Get's the id of the home building for a object. If the object is a worker, his worker-hut is return, if it is a cart, it's worker building is returned. A Dynasty sim returns it's residence.
GetImpactValue
New
gets the total value of an impact
GetItemCount
New
Get the count of an item from an object
GetMaxHP
New
Returns the maximum hp of the
GetMeasureRepeat
New
Gets the repeat timer for a measure standard measure repeat timer for this measure. If no destination is specified, the timer is global for executing this measure. If a destination is specified the measure is only forbidden with the destination as target.
GetMoney
New
Get's the money the object has. ATTENTION: DO NOT use this with building aliases or it will cause OOS!
GetNearestSettlement
New
Gets the nearest settlement for a object (sim/cart/building)
GetOfficeTypeHolder
New
retrieves the owner of a given office type
GetPositionOfSubobject
New
Gets the Position of
GetRemainingInventorySpace
New
returns the remaining space in the objects inventory for the given
GetRepeatTimerEndtime
New
Get's the gildtime, when the timer object expires. The function returns -1, if the timer doesn't
GetRepeatTimerLeft
New
Get's the left time on the timer object. The function returns -1, if the timer doesn't exists (anymore)
GetRotation
New
Get the rotation between to objects (Position/Sim/Building/...)
GetRotationTo
New
Returns the euler rotation difference from the first object to the second
GetSettlement
New
Get's the assigned settlement of the object
GetSettlementID
New
Get's the id of the assigned settlement of the object
GetState
New
returns the status of an
GetStateImpact
New
Get's a state depended impact from the pObject.
InternalDie
New
lets the object die (cl_Building or cl_Sim)
InternalRemove
New
kill the object from the
InventoryGetSlotCount
New
Gets the slot count from a inventory of the pOwner.
InventoryGetSlotInfo(Alias ( of type guildobject) pObject, Slot, [ InventoryType = INVENTORY_STD])
Parameters:
Alias ( of type guildobject) pObject :
Owner of the measure to start
Slot :
0 <=
IsDead
New
returns true, if the object is dead
IsInLoadingRange
New
This function returns true, if the first object is in loading range to the second
Kill
New
Kills the object (cl_Building or cl_Sim)
MapHighlightObject
New
shows/hides the highlight in the minimap/map for the given object
MeasureRun
New
Directly starts a measure. Only measure's with max. two parameters can be started this way
ModifyHP
New
Set the hp po
MsgBox
New
shows the given text in the hud-messagebox. Text has to be a label which will be localized with the textsystem. The script waits for the user to close the messagebox.
MsgBoxNoWait
New
shows the given text in the hud-messagebox. Text has to be a label which will be localized with the textsystem.
MsgNews
New
sends a news message for the given object and waits for the user to deal with it or for the given timeout
MsgNewsNoWait
New
sends a news message for the given object
MsgQuest
New
shows the given text in the hud-messagebox and waits until the user closes the questbox
MsgQuestNoWait
New
shows the given text in the hud-messagebox.
MsgSay
New
sends a dialog message for the given object and waits until the dialog closes
MsgSayInteraction
New
sends a dialog message which provides user
MsgSayInteractionNoWait
New
sends a dialog message which provides user
MsgSayNoWait
New
sends a dialog message for the given object
NotifyOnStateChange
New
Add a notifiing function, if a state from a object changes. The scriptcall is not sheduled and is called right bevor the state change.
ObjectClearMeasureIcon
New
clears the objects measure icon to show in renderview and simicons. resets to the default behavior
ObjectClearStateIcon
New
clears the objects state icon to show in renderview. resets to the default behavior
ObjectSetHighlight
New
sets an object highlight
ObjectSetMeasureIcon
New
sets the objects measure icon to show in renderview and simicons. Overrides the default behavior so be carefull to cleanup your settings
ObjectSetStateIcon
New
sets the objects state icon to show in renderview. Overrides the default behavior so be carefull to cleanup your settings
PlaySound3D
New
Plays a sound on the position of "SoundSource".
PlaySound3DVariation
New
Plays a random sound from the given foldername on the position of object.
Plunder
New
Transfers the valuables from the targets inventory until no room is left
ReadyToRepeat
New
Check's if the timer event 'Name' still exists for this object
RemoveAllObjectDependendImpacts
New
remove all impacts from pObject that were caused by pObjectDependency
RemoveAllOverheadSymbols
New
removes all existing overhead symbols from an object - regardless who creates the overhead symbol
RemoveDialogBox
New
closes the dialogbox of the given object
RemoveEmptySlots
New
Remove all empty slots from the inventory
RemoveImpact
New
Removes the given impact from the given object
RemoveImpactDependendImpacts
New
removes all impacts depending on 'DependendImpactID' and the impact 'DependendImpactID' itself
RemoveItems
New
Remove items from a objects inventory.
RemoveOverheadSymbols
New
removes all permanent overhead symbols from an object, that was set by the current
ResourceFind
New
Searches for the nearest resource of a specific item type
SetCampaignEndText
New
placeholder for mission end text
SetHomeBuilding
New
Set's the home building for a object. If the object is a worker, his worker-hut is return, if it is a cart, it's worker building is returned. A Dynasty sim returns it's residence.
SetName
New
Set's the name (label) for a guild object (Building/Sim/Cart/Settlement/...). If the object is a sim, the lastname is set.
SetQuestDestination
New
sets the destination object of the running quest
SetQuestSource
New
sets the source object of the running quest
SetRepeatTimer
New
Create a timer event for the object. The event exists for the object for the given time. After the time is elapsed, the timer object is automatically destroyed.
SetState
New
Set or clears a status of an object
ShowBoundingBox
New
Shows the bounding box of an object
ShowOverheadMeasureSymbol
New
shows the symbol of the current measure
ShowOverheadSymbol
New
shows an overhead symbol for the given object.
SpendMoney
New
Lets the object spend money.
SquadCreate
New
Creates a new squad action on a guild object. It can be only one squad action on the object at the same time.
SquadGet
New
gets the current squad from the object
SquadRemoveMember
New
removes this object from its current squad
SystemGetMeasureName
New
Get's the measure name (from the database) of the current
SystemGetMeasurePriority
New
Get's the priority value of the current measure
ThrowObject
New
Transfers all items from the source and transfer them to the destination.
Transfer([Alias ( of type guildobject) pExecuter], [Alias ( of type guildobject) pBuyer], [ BuyerInventoryType], Alias ( of type guildobject) pSeller, SellerInventoryType, ItemId, ItemCount)
Parameters:
Alias ( of type guildobject) pExecuter : OPTIONAL
Object who initiates the transfer
Alias ( of type guildobject) pBuyer : OPTIONAL
Object to buys the items (cl_Sim/cl_Building/cl_Cart/cl_GuildResource/...)
BuyerInventoryType : OPTIONAL
InventoryType of the inventory to remove the items from. If no inventorytype is specified the default inventory will be used
Alias ( of type guildobject) pSeller :
Object to buy the items (cl_Sim/cl_Building/cl_Cart/cl_GuildResource/...)
SellerInventoryType :
InventoryType of the inventory to add the items to. If no inventorytype is specified the default inventory will be used
ItemId :
Item to transfer
ItemCount :
Count of items to transfer
Return Value:
:
count of items transfered
Description:
normal transfer between two guild object. Money is payed if necessary
TransferItems
New
Transfers all items from the source and transfer them to the destination.
ResourceCanBeChanged
New
returns true, if the resource can be sowed
ResourceGetEntry
New
returns the entry id for the given item in the resource
ResourceGetItemId
New
returns the item id related to the given resource
ResourceGetLevel
New
returns the item id related to the given resource
ResourceGetMeasureID
New
returns the measure what is needed to start resource growing on this resource
ResourceGetScriptFunc
New
returns the script function linked with a resource (from database)
ResourceGetTypeCount(Alias ( of type guildresource) pResource)
Parameters:
Alias ( of type guildresource) pResource :
resource alias
Return Value:
:
the number of types (-1 on error)
Description:
returns the count of the possible resource type of this
ResourceGetTypeItem
New
returns the item of the type i
ResourceSow
New
sow's the resource i
SetPosition
New
Set's the position of the given object.
ScenarioFindBuildingProto
New
Finds a proto for a building by its Class/Type/Level/SubLevel. If more than one proto matches the values, a random proto is returned
AllowAllMeasures
New
Allow all measures to be executed for the given AliasObject. This sets the object back to the default state.
AllowMeasure
New
Allow a Measure by ID for the given AliasObject. The mode specifys if the object allows the starting of a measure with it as owner (EN_ACTIVE), to use the object as measure target (EN_PASSIVE) or both (EN_BOTH).
CanBeInterruptetBy
New
Checks, if a measure can be started on the object pThis
ForbidMeasure
New
Forbid a Measure by ID for the given AliasObject. The mode specifys if the object forbids the starting of a measure with it as owner (EN_ACTIVE), to use the object as measure target (EN_PASSIVE) or both (EN_BOTH).
GetCurrentMeasureID
New
get's the current measure id of the object
GetCurrentMeasureName
New
Gets the current measure name of the object
GetCurrentMeasurePriority
New
get's the current measure from the object and return it's priority
MeasureIsValid
New
checks, if the measure is valid. The measure must be defined by it's owner, [a target object] and the measure itself)
MsgMeasure
New
sends a measure message for the given object
MsgQuick
New
sends a quick message for the given object
MsgSystem
New
sends a system message for the given object
SetExclusiveMeasure
New
Specifys the only available Measure by ID for the given AliasObject. The mode specifys if the measure is exclusive for starting by
owner
New
Aligns the object to dest.
BeginUseLocator
New
Blocks a locator and moves the sim to it. The sim is switching to Stance while using the locator. The function waits until
BeginUseLocatorNoWait
New
Blocks a locator and moves the sim to it. The sim is switching to Stance while using the locator
EndUseLocator
New
Stops the session startet with BeginUseLocator or BeginUseLocatorNoWait. The locator will be freed, and the stance of the sim is changed to Stance. The function will wait for finishing the stance.
EndUseLocatorNoWait
New
Stops the session startet with BeginUseLocator or BeginUseLocatorNoWait. The locator will be freed, and the stance of the sim is changed to Stance
GetAnimationLength
New
Get the lenght of an animation.
GetEvadePosition
New
Calcs an evade position for a sim with the given radius.
GetFleePosition
New
Calcs a flee position for a sim with the given distance from pCenter.
GetOutdoorMovePosition
New
Gets the normal outdoor moveto position for that building.
GetRadius
New
returns the radius of a moving sim object (Sim, Cart, Vehicles) for movement/range purposes
GetVehicle
New
returns the vehicle a moving sim object is attached to
LoopAnimation
New
Loops a animation on pMoveSim.
MoveSetActivity
New
sets a certain activity for pObject.
MoveSetStance
New
sets a certain stance for pObject.
MoveStop
New
stop the current move task for pObject.
SetContext
New
Sets the context of the given object
StopAnimation
New
Stops the current playing animation on the pMoveSim.
StopAnimation
New
Stops all playing animation on the pMoveSim.
StopFollow
New
no comment
Stroll
New
Let's the pSim stroll a time.
f_Follow
New
Starts a follow task for pObject.
f_FollowNoWait
New
Starts a follow task for pObject and proceeds with the script
f_MoveTo
New
Starts a move task for pObject.
f_MoveToNoWait
New
Starts a move task for pObject and proceeds with the script
OfficeGetAccessRights
New
returns the acces right of the given sim to the given office
OfficeGetApplicantCount
New
returns the applicant count for the given office
OfficeGetHolder
New
pushes the office holder of the given office
OfficeGetHolderId
New
returns the id of the office holder
OfficeGetLevel
New
retrieves the office level
OfficeGetShadowApplicantCount
New
returns the shadow dynasty applicant count for the given
OfficeGetTextLabel
New
Gets the textlabel of given office
OfficeSetBlock
New
blocks an office against further applications or depositions (for use while an election takes place)
SetOfficePrivileges
New
Sets the privilegeVector of an office
SetOfficeServants
New
Sets the actual servants for a special office and behaviour
PenaltyFinish
New
Set or clears a sim from the wanted-list of a city. If Time is 0, the sim is removed.
PenaltyGetOffender
New
Get the offender from a penalty
PenaltyGetPrisonTime
New
Get the prison time of a prison penalty
PenaltyGetType
New
get's the type of a penalty
PenaltyReset
New
resets a penalty back to the wanted (open) status. city guards will arrest sim with this state, if they get in range to them
GetLocatorIndex
New
Get the index number of a Locator. For example this function return 3 at the locator "Drink_3".
GetPosition
New
Get's the position of an object (sim/building/cart/...) and returns it in
LocaterGetBlocker
New
Blocks a free locator for use for pObject only.
PositionGetArea
New
Returns the area of a position
PositionGetRotation
New
Returns the y-rotation of the given
PositionGetVector
New
Returns x,y,z values from a position (example: x,y,z = PositionGetVector("MyLocator")
PositionModify
New
Modifies a position by DeltaX/DeltaY/DeltaZ
PositionMove
New
Modifies a position by moving it Distance Unit's to ObjectAlias. If angle is 0 degree's, the position is moving towards the object. If angle is 180 degree's, the position is moving back from the object. 90 degrees move's right and 270 to the left
PositionSetArea
New
Sets a area of a position
PositionSetVector
New
Sets x,y,z for a position
ScenarioCreateResource
New
creates a treasure chest on the position PositionAlias
StartMagicalEffect
New
This function generates a "magical effect".
CameraIndoorGetRoom(Alias ( of type room) o_pRoom)
Parameters:
Alias ( of type room) o_pRoom : OUTPUT
alias of the room on success
Return Value:
:
fails if camera is in terrain
Description:
gets the room the camera is currently in
RoomGetInsideSimList
New
returns a list of all sims inside a room
CopyAlias
New
This function copies the object pSource to pDest.
AICheckWorkingPlace
New
Searches for a plan on the given subpath. The data values for the search is specified by pairs of DataName followed by its value
SettlementGetOffice
New
returns an office
SettlementGetOfficeCnt
New
returns the number of offices in a given level
SettlementGetOfficeHolder
New
retrieves an office holder
SettlementGetOfficeLevelCnt
New
returns the number of officelevels in the settlements office tree
SettlementEventGetTime
New
returns the time when a settlement event will happen
AddEvidence
New
creates a new event, and stores evidence in pWitnesses memory
AlignToNearest
New
Aligns the sim to the nearest sim
BaseFE
New
sets a basic facial expression to use when an emote stops. No channel required, this goes to channel cl_CharacterModel::EN_EXPRESSION_CHN_MOOD always.
CalculateCourtingDifficulty
New
Calculates the difficulty of the courting
CarryObject
New
attaches a 3d object to a sim at its hand.
ChangeAnimation
New
Changes the currently played animation to a new one
ChangeAppearance
New
displays the changeappearance dialog for the given sim
ChangeResidence
New
Sets a new residence for a dynasty sim
CheckSkill
New
makes a skillcheck against the level of the given skill and the given skillvalue
CourtingGetMaxCourtingId
New
returns the max amount of courting action
EnterVehicle
New
Lets the operator enter the vehicle
ExitBuildingWithCamera
New
exits the building with the camera if the camera is indoor
ExitCurrentBuilding
New
Lets the sim leaves the current building
FadeInFE
New
activates a facial expression on the character
FadeOutAllFE
New
Fades out all facial expressions
FadeOutFE
New
deactivates a facial expression on the character
Fire
New
Fires the sim from his current job
GetEvidenceAlignmentSum
New
calculates the alignment sum of all evidences the target has about actor
GetEvidenceValues
New
Returns the value sum of all evidences the target has about actor
GetInsideBuilding
New
get's the building where the sim is currently in. If the sim is outside, the function returns false
GetInsideBuildingID
New
get's the building where the sim is currently in. If the sim is outside, the function returns -
GetInsideInfo
New
Gets info from the current inside building. This function returns Proto+Class+Type (example: Proto,Class,Type = SimGetInsideInfo("") )
GetInsideRoom
New
get's the room where the sim is currently in. If the sim is outside, the function returns false
GetNobilityTitle
New
Returns the nobility title of the given sim or the status of the process
GetSimType
New
returns the type of the sim ( 0 = SIM, 1 = DYNASTY SIM, 2 = PARTY SIM)
GetSkillValue
New
Returns the value of the given skill for a sim
IncrementXP
New
Increment the xp from pTarget.
IsDynastySim
New
Returns true if the sim is a dynasty sim
IsOnlyPartyMember
New
Returns true if the sim is the only member of its party
IsPartyMember
New
Returns true if the sim is a party member
PlayAnimation
New
plays a animation on the object. The functions waits for the end of the animation
PlayAnimationNoWait
New
plays a animation on the object
PlayFE
New
plays a facial expression
QuestTalk
New
Executes the
ReleaseAvoidanceGroup
New
the a
RemoveEvidences
New
removes all evidences about a given actor from target's memory
SatisfyNeed
New
Satisfy a need for a sim.
ScriptOnly_StopProduction
New
stops the
SetActiveAvoidance
New
sets a
SetAppearance
New
sets a sims graphical appearance
SetAvoidanceRange
New
sets the size of the circle that is used for a
SetNobilityTitle
New
Starts the grant of a new nobility title of the given sim
SetPassiveAvoidance
New
sets if other sims evade this sim
SetSkillValue
New
Sets the given skill value which is one of (CONSTITUTION, DEXTERITY, CHARISMA, FIGHTING, CRAFTSMANSHIP, SHADOW_ARTS, RHETORIC, EMPATHY, BARGAINING, SECRET_KNOWLEDGE) to the given sim
CutsceneAddSim
New
Divorce both given sims
SquadWaitSim
New
idle until squad collection
StartEmote
New
Start an emote script function from library/emotes.lua
StartProduction
New
start the
StopEmote
New
Stop the running
Talk
New
Executes the
TradeMemoryEvents
New
Trades the memory events from pSource to pDestinations
ScenarioFindBuildingProtoForCharacter
New
Finds a proto for a building by its Class/Type/Level/SubLevel. If more than one proto matches the values, a random proto is returned
EvidenceGetActor
New
get the actor of an evidence of the sim SimAlias and stores it in DestinationAlias
EvidenceGetSeverity
New
returns the severity of the giving evidence
GetMeasureRepeatName
New
Sets the standard measure repeat timer for this measure.
SetMeasureRepeat
New
Searches for a plan on the given subpath. The data values for the search is specified by pairs of DataName followed by its value
BlockLocator
New
Blocks a free locator for use for pObject only.
CalcDistance
New
Returns the distance between the objects.
EndVision
New
end the vision started with StartVision
GetID
New
Get the ID of the object. The id is a unique number per object in the game.
HideObject
New
Hide's a 3d object in the scene of pObject
ReleaseLocator
New
Releases a locator from the use of pObject.
SetDestroyed
New
Set the destroyed status of an object
ShowObject
New
Show's a 3d object in the scene of pObject
StartVision
New
starts a heavenly vision at the postion
simgetservantdynastyid
New
Returns the servant dynasty id for this object
ExitCurrentVehicle
New
Lets the operator of the vehicle leave it
Building
45
BuildingGetBaseHP
New
gets the max hp of a building
BuildingGetPriceProto
New
gets the base price of a building
BuildingBuy
New
Buys a building for a sim.
BuildingCanBeEntered
New
checks if a building can be entered by a movingsimobject
BuildingCanLevelUp
New
checks wheter the given building can be leveled up to the given prototype
BuildingCanProduce
New
Level the building up.
BuildingFindSimByName
New
Finds a sim with a certain name in a certain building.
BuildingFindSimByProperty
New
Finds a sim with a certain property in a certain building.
BuildingGetAISetting(Alias ( of type building) pBuilding,
BuildingGetBasePrice
New
gets the base price (for buying) from the building. The price is defined in the database
BuildingGetCart
New
Get a cart from a building by it's number
BuildingGetCartCount
New
Get the amount of the carts of a building
BuildingGetCharacterClass
New
returns the character class (GL_CLASS_PATRON, GL_CLASS_ARTISAN, GL_CLASS_SCHOLAR, GL_CLASS_CHISELER, GL_CLASS_NPC) needed for the building
BuildingGetCity
New
Gets the settlement the building is belonging to.
BuildingGetClass
New
returns the class from the building
BuildingGetCutscene
New
returns the cutscene of a building. Must have been set before
BuildingLockForCutscene
New
returns the estimated fixed costs of a building
BuildingGetFlag
New
Get's the main flag of the building
BuildingGetForSale
New
Sets the "ForSale"-Flag for the building.
BuildingGetFreeBudget
New
returns the free budget of a building (remaining budget - fixed costs)
BuildingGetInsideSimList
New
returns a list of all sims inside a building
BuildingGetLevel
New
returns the level from the building
BuildingGetMaxWorkerCount
New
Get's the max count of workers a building can have
BuildingGetNPC
New
Gets the building npc by its database npc id
BuildingGetOwner
New
Gets the owner of the building.
BuildingGetProducerCount
New
get the proto from the given building
BuildingGetProfession
New
Get's the profession for the workers of the building
BuildingGetProto
New
get the proto from the given building
BuildingGetReligion
New
returns the religion from the building (if the building is a church)
BuildingGetRepairPrice
New
gets the repair price of a building
BuildingGetSim
New
Get an assigned sim from this building. The sims can be outside the building (but working on it like mine) or in different rooms.
BuildingGetSimCount
New
Get the amount of all sims assigned to this building. The sims can be outside the building (but working on it like mine) or in different rooms.
BuildingGetType
New
returns the type from the building
BuildingGetValue
New
gets the current value of the building. This value includes building/carts/wares/upgrades
BuildingGetWorker
New
Get a worker from the building by number
BuildingGetWorkerCount
New
Get the amount of workers from the building
BuildingGetWorkingEnd
New
get the working end time from a building
BuildingGetWorkingStart
New
get the working start time from a building
BuildingHasUpgrade
New
Checks if a building has an upgrade
BuildingInternalLevelUp
New
Levels a building up to the given proto
BuildingLevelMeUp
New
Level the building up.
BuildingLockForCutscene
New
Locks a building and all sims inside for a cutscene, pCutscene=0 unlocks the building
BuildingRallyWorkers
New
BuildingRallyWorkers to the building
BuildingSetFlagColor
New
Sets's the main flags color of the building
BuildingSetForSale
New
Sets the "ForSale"-Flag for the building.
BuildingSetOwner
New
Sets the owner of the building.
CameraIndoorGetBuilding(Alias ( of type building) o_pBuilding)
Parameters:
Alias ( of type building) o_pBuilding : OUTPUT
alias of the building on success
Return Value:
:
fails if camera is in terrain
Description:
gets the building the camera is currently in
Camera
17
CameraBlend
New
tells the camera controller to make a smooth transition from the current position to the next one specified.
CameraIsIndoor
New
returns true if the camera is inside a building, regardless of being locked or not
CameraIsTerrain
New
returns true if the camera is in terrain, regardless of being locked or not
CameraIsTerrain
New
returns true if the camera has been locked, regardless of being inside a building or in terrain
CameraLock
New
Lock variant #2: Lock the camera to a position specified by an object and a database camera type.
CameraLock
New
Lock variant #3: Lock the camera to a position specified by a database camera type and two objects.
CameraTerrainSet
New
Switches to terrain view mode, last camera position in terrain is used.
CameraTerrainSetPos
New
set terrain camera to focus on any object that has position (locator,sim,building,etc.) at given distance and angle
CameraenableUserUnlock
New
enables or disables the behavior that a right mouse button click performs
CameraUnlock
New
exit's the current campaign
CameraIndoorSetBuilding
New
Switches to indoor view mode, last camera position for given building is used or otherwise if not available the default position.
CameraCheckLineOfSight
New
checks whether the camera position is inside a building
CameraFollow
New
Tells the camera to follow an object (works only in terrain)
CameraLock
New
Lock variant #1: Lock the camera to given position
CameraLockLookAt
New
lets the cutscene camera look at a given object or position, only the view angle is affected
CameraUnlock
New
Removes the camera lock and restores the last camera mode and position before the camera became locked.
CameraIndoorSetRoom
New
Switches to indoor view mode, last camera position for given building is used or otherwise if not available the default position.
City
35
CityLevel2Label
New
translates a city level to its label
CityGetNumEvent
New
Gets the number of events listed in the event schedule of a city
CityAddPenalty
New
the city sets a penalty for a given sim
CityAssignTrialRoles
New
assign
CityBuildNewBuilding
New
Builds a new building. The building is defined by it's proto
CityEndOfficeElection
New
ends a selection, and makes the winner the new office holder
CityFindCrowdedPlace
New
finds a random crowded place in the
CityFindSquad
New
Get's a squad for a dynasty, with a free place
CityGetBuildingByName
New
Get's a building from a city by it's name and returns it in ReturnAlias
CityGetBuildingCount
New
Get's the count of building from a city
CityGetBuildingCountForCharacter
New
Get's the building count from a city for a character class
CityGetBuildingForCharacter
New
Get's a random building from a city for a character class and returns it in
CityGetBuildings
New
Get's all building from a city and returns it the alias
CityGetCitizenCount
New
Get the amount of citizen of a city
CityGetCrimeRate
New
Get the crime rate (0..100) of the settlement
CityGetHighestOfficeLevel
New
returns the hieghest office level of the given city
CityGetLevel
New
Get the level of the settlement
CityGetMaxWorkerhutLevel
New
Gets the max level of workerhuts a city can build
CityGetNearestBuilding
New
Get's a random building from a city and returns it in ReturnAlias
CityGetOffice
New
pushs the office identified with OfficeLevel und OfficeID in the given city
CityGetOfficeCountAtLevel
New
returns the number of offices in the given office level of the given city
CityGetPenalty
New
Get's a penalty for a sim in the city
CityGetRandomBuilding
New
Get's a random building from a city and returns it in
CityGetSeller
New
returns a seller for the item, who has min Count items of the type
CityGetServant
New
Get a town servant of a city by its number [and it's profession]
CityGetServantCount
New
Get the amount of servants of a city
CityModifyCrimeRate
New
Modifies the crime rate (0..100) of the settlement
CityRemoveFromOffice
New
removes the given sim from the office
CityScheduleCutsceneEvent
New
create a new event and assign a time slot
CitySetMaxWorkerhutLevel
New
Sets the max level of workerhuts a city can build
CitySetOfficeApplicant
New
returns if the given sim can apply for the given office in the given settlement
CitySimBreakout
New
notify the settlement, that a sim has broken out of the prison
CityGetLocalMarket
New
returns the local market of the city
CityGetWantedTime
New
returns the prison time if a sim is wanted in a city
CityGuardScan
New
Scans the surrounding of the guard for a wanted one.
Dynasty
38
DynastyCreate
New
Creates a new dynasty.
DynastyGetColor
New
returns the dynasty color as three return values
DynastyTakeCredit
New
Takes a credit from a bank. The credit is defined by the building, the sim and its number
DynastyAddMember
New
Add's a sim to the
DynastyFindSquad
New
Get's a squad for a dynasty, with a free place
DynastyGetFlagNumber
New
retrieve the flag number for the given dynasty
DynastyFindIdleWorker
New
searches in the dynasty for an idle worker. The worker is filtered by it's profession and the
DynastyFindNewBuilding
New
Gets a new working building for a dynasty.
DynastyFindTargetDynasty
New
Gets a random victim of a dynasty for a illegal action
DynastyForceCalcDiplomacy
New
updates the Diplomacy states immediate, rather than waiting for 1 hour
DynastyGetBuildingCount
New
Get's the count of buildings for a dynasty.
DynastyGetCredit
New
Get's a credit from a dynasty
DynastyGetDiplomacyOffer
New
Get the wanted diplomacy state from pObject1 to pObject2
DynastyGetDiplomacyState
New
Get the diplomacy status between two dynasties.
DynastyGetFamilyMember
New
Gets a family member by number from a dynasty
DynastyGetFamilyMemberCount
New
returns the amount of family members of the dynasty
DynastyGetHomeCity
New
Gets the home city of a dynasty
DynastyGetMember
New
Gets a member by number from a dynasty
DynastyGetMemberCount
New
returns the count of members of the dynasty
DynastyGetMemberRandom
New
Gets a random member from a dynasty
DynastyGetRandomBuilding
New
Get's a random building for a dynasty.
DynastyGetRandomVictim
New
Gets a random victim of a dynasty for a illegal
DynastyGetRanking
New
returns an abstract value showing the current progress of the dynasty in wealth, property and char
DynastyGetTeam
New
Returns the team of a dynasty
DynastyGetWorker
New
Get's a worker from the dynasty.
DynastyGetWorkerCount
New
returns the count of the workers of a dynasty
DynastyIsAI
New
Returns true if the ai controls this dynasty
DynastyIsDead
New
Returns true if dynasty is dead
DynastyIsPlayer
New
Returns true if a player controls this dynasty. Attention: if the given object is a sim of a player dynasty AND then sim is not a party member, the function returns false. This is done because the ai had to do decisions for the familiy sim.
DynastyIsShadow
New
Returns true if the dynasty or the objects dynasty is a shadow dynasty
DynastyMakeImpact
New
Make an impact on the character of a dynasty
DynastyPaybackCredit
New
Takes a credit from a bank. The credit is defined by the building, the sim and its number
DynastyRemoveDiplomacyStateImpact
New
removes running diplomacy state impacts on dynasties dynasty's
DynastySetDiplomacyState
New
DynastySetMaxDiplomacyState
New
Set the min diplomacy state between to dynasty's
DynastySetMinDiplomacyState
New
Set the min diplomacy state between to dynasty'
DynastySetTeam
New
sets the team of a dynasty
DynastyRemoveMember
New
removes a sim from the dynasty
Graphics
26
GfxAttachObject
New
Attaches an graphics object on the basis of a filename to the measure.
GfxAttachObject
New
Attaches an graphics object on the basis of a filename to the measure.
GfxAttachObjectByID
New
Attaches an graphics object on the basis of a database-id to the measure.
GfxStartParticle
New
Attaches a particle effect on the basis of a filename.
GfxStartParticle()
Parameters:
Return Value:
:
no comment
Description:
no comment
GfxStartParticle
New
Attaches a particle effect on the basis of a filename.
GfxStopParticle
New
Stops the emitting of a particle effect and kills the effect.
GfxDetachAllObjects
New
Detaches all attached graphics objects.
GfxDetachObject
New
Detaches an attached graphics object from the measure.
GfxDropToFloor
New
Sets an object to the ground of the current scene.
GfxGetHeight
New
Returns the height of the object.
GfxIsMoving
New
Indicates if an attached graphics object is moving.
GfxMoveNoWait
New
Moves an object with a certain speed while proceeding with the script.
GfxMoveTo
New
Moves an object to the position of another object within a certain time. The script will wait for the movement to continue.
GfxMoveToNoWait
New
Moves an object to the position of another object within a certain time while proceeding with the script.
GfxMoveToPosition
New
Moves an object to a certain position within a certain time. The script will wait for the movement to continue.
GfxMoveToPositionNoWait
New
Moves an object to a certain position within a certain time while proceeding with the script.
GfxRotateNoWait
New
Rotates an object around itself around a given axis while proceeding with the script.
GfxRotateTo
New
Rotates an object to the rotation of another object. The script will wait for the rotation to continue.
GfxRotateToAngle
New
Rotates an object to a certain angle within a given time. The script will wait for the rotation to continue.
GfxRotateToAngleNoWait
New
Rotates an object to a certain angle within a given time while proceeding with the script.
GfxRotateToNoWait
New
Rotates an object to the rotation of another object while proceeding with the script.
GfxScale
New
Sets the scale of an attached graphics object.
GfxSetPosition
New
Sets the position of an object related to the measure.
GfxSetPositionTo
New
Sets an object to the position of another object.
GfxSetRotation
New
Sets the rotation of an object related to the measure.
GfxSetRotationTo
New
Rotates an object to the rotation of another object.
Inventory
7
ItemGetCategory
New
Gets the category of an item.
ItemGetID
New
Gets the id of an item.
ItemGetLabel
New
Gets the label of an item.
ItemGetName
New
Gets the name of an item.
ItemGetPriceBuy(
ItemGetProductionTime
New
Gets the time (in hours) of the production of this item
ItemGetSlot
New
Gets the name of an item.
ItemGetSubstLevel(
ItemGetType
New
Gets the type of an item.
Sim
98
SimCreate
New
This function creates a new sim based on an database template specified by TemplateDBId
SimGetBehavior
New
Gets the behavior of a sim.
SimGetCourtLover
New
Gets the court lover of the given sim
SimGetLiason
New
Gets the liaison sim of the given sim
SimResetBehavior
New
Sets the behavior of a sim to the standard behavior for it's state (workless, dynasty, ...)
SimSetBehavior
New
Sets the behavior of a sim.
SimSetBehaviorDataAlias
New
Sets a alias value for the standard behavior.
SimSetBehaviorDataFloat
New
Sets a datavalue for the standard behavior. This value is set as
SimGetRotation
New
Get the rotation from an object (Position/Sim/Building/...)
SimAddCourtingProgress
New
Lets the last courting action take effect on the progress
SimAddDate
New
adds a date to a sims
SimAddDatebookEntry
New
Adds a new entry to the datebook of a sim
SimApplyDeposition
New
apply the deposition of a sim from office
SimArrangeLiaison
New
Sets the SecondSim as new liaison lover for the FirstSim
SimBeamMeUp
New
Beams a sim immediatly to a given
SimCanBeCharged
New
checks if a sim is already charged, currently involved in a trial or imprisoned
SimCanStartCourtLover
New
Checks if pSim can start a new affair with pCourtSim
SimCanWorkHere
New
check's, if a sim can work in this building
SimChargeCharacter
New
use the first evidence in memory for accuse
SimConsumeGoods
New
Let the sim consume a good according to its need
SimCreateCompanion
New
creates a companion animal
SimDoCourtingAction
New
Does the given action to the courted
SimFindExploreTarget
New
Find a near unexplored position for
SimFindProduction
New
searches and sets a new production for a worker and returns true, if a new production is
SimFindSquad
New
Get's a free squad for the sim, that he can join
SimGetAge
New
Returns the age of the sim
SimGetAlignment
New
Get the alignment from a sim. The alignment begins at 0 (good) and ends with 100 (evil)
SimGetAssignedArea
New
returns the assigned area of a sim (eg. the current working place )
SimGetAssignedAreaID
New
returns the assigned area id of the sim.
SimGetBeloved
New
Get the beloved of the sim
SimGetBestEvidence
New
finds the best evidence a sim has and returns it in o_Event
SimGetChild
New
Get the child from a sim
SimGetChild
New
Get a childfather from a
SimGetChildCount
New
Get the child count from a sim
SimGetChildCount
New
Get a count of the childs from a sim
SimGetChurch
New
Returns the church a sim is currently linked
SimGetCityOfOffice
New
gets the settlement that is related to the office of a sim
SimGetClass
New
Get's the character class of a sim which is one of (1 - GL_CLASS_PATRON, 2 - GL_CLASS_ARTISAN, 3 - GL_CLASS_SCHOLAR, 4 - GL_CLASS_FIGHTER, 5 - GL_CLASS_TRADESMAN, 6 - GL_CLASS_NPC)
SimGetCrimeList
New
creates a list of all crimes a sim has committed
SimGetCutscene
New
get the cutscene a sim is currently part of. Must have been set
SimGetFaith
New
Returns the Faith of the sim (range 0..100)
SimGetFather
New
Get the father from a sim
SimGetFavourableCourtingAction
New
Get the best measure for progressing the liasion
SimGetGender
New
gets the gender of the sim
SimGetHandsel
New
get the handsel for the sim for hiring in the place
SimGetLastname
New
Gets the family name of a sim.
SimGetLevel
New
returns the level of the pSim
SimGetMaxOfficeLevel
New
gets the maximal office level a sim had occupied
SimGetMother
New
Get the father from a
SimGetNeed
New
gets the current need value of the need
SimGetOffice
New
get the office index of the currently occupied office (all offices on a level are enumerated from 0 to (n-1))
SimGetOfficeID
New
get the office index of the currently occupied office (all offices on a level are enumerated from 0 to (n-1))
SimGetOfficeIndex
New
get the office index of the currently occupied office (all offices on a level are enumerated from 0 to (n-1))
SimGetOfficeLevel
New
get the office level of the currently occupied office
SimGetPregnant
New
Lets the sim get pregnant
SimGetProduceItemID
New
gets the current production of a sim
SimGetProductivity
New
Returns the age of the sim
SimGetProfession
New
Returns the profession of the sim
SimGetProgress
New
Get the progress to the actual beloved
SimGetRank
New
Returns the rank of the sim (0 = EN_RANK_UNDEFINED, 1 = EN_RANK_DESTITUTE, 2 = EN_RANK_POOR, 3 = EN_RANK_MIDDLE, 4 = EN_RANK_RICH, 5 = EN_RANK_WEALTHY)
SimGetReligion
New
Returns the religion of the sim (0=catholic, 1=protestantic)
SimGetServantDynasty
New
Returns the dynasty for this
SimGetSpouse
New
Get the spouse from a sim
SimGetWage
New
get the handsel for the sim for hiring in the place
SimGetWealth
New
Returns the wealth of the sim
SimGetWorkingPlace
New
returns the working place of a worker
SimGetWorkingPlaceID
New
returns the ID of the working place of a worker
SimHasAbility
New
checks if a sim has a specific ability
SimHire
New
Hire's a sim for a place. The place can be a building or a cart
SimHire
New
Hire's a sim for a place. The place can be a building or a cart
SimIsAppliedForOffice
New
Checks if the sim is currently applied for a office
SimIsInside
New
returns true, if the sim is currently inside a building
SimIsMortal
New
returns true, if a sim is mortal
SimIsWorkingTime
New
returns true, if the sim has currently working time
SimLock
New
Locks the a sim for a time (hours)
SimMarry
New
Let the sim marry another sim
SimPauseWorking
New
Let's a sim pause is currently working task - if nothing else happends, the sim will start working the next logic frame where he is idle
SimReleaseCourtLover
New
Releases the current court lover of the given sim
SimResumePreFightMeasure
New
for fighting state: resume the measure that was running just bevor the fight
SimRunForAnOffice
New
run for an office
SimSetAge
New
Sets a new age to the sim
SimSetClass
New
Set's the character class of a sim which is one of (1 - GL_CLASS_PATRON, 2 - GL_CLASS_ARTISAN, 3 - GL_CLASS_SCHOLAR, 4 - GL_CLASS_FIGHTER, 5 - GL_CLASS_TRADESMAN, 6 - GL_CLASS_NPC). For example: SimSetClass("", GL_CLASS_FIGHTER)
SimSetCourtLover
New
Sets the SecondSim as new lover for the FirstSim
SimSetDoctorTitle
New
Gives a sim a doctor title
SimSetFaith
New
Sets the faith of the sim (range 0..100)
SimSetFamily
New
Add's a new children to a family. This function set's also the new family name for the child
SimSetFirstname
New
Sets the firstname of a sim.
SimSetHireable
New
Enables or disables the hirestate from a sim.
SimSetInvisible
New
sets the sim invisible for all but the local player dynasty (currently for robber camoflague), this should be only executed on members of the own dynasty
SimSetLastname
New
Sets the family name of a sim.
SimSetMortal
New
sets the mortal state of a sim
SimSetOffice
New
lets a sim take an office
SimSetParents
New
Sets the parents of a sim
SimSetProduceItemID
New
starts or stops a production for a sim (use -1 to stop)
SimSetProgress
New
Sets the progress to the actual beloved
SimSetReligion
New
Sets the religion of the sim (0=catholic, 1=protestantic)
SimStartIdleMeasure
New
Starts immediatly the idle measure
SimStopMeasure
New
Stops the current measure on the given sim
Weather
10
Weather_GetSeason
New
retrieves the actual season
Weather_GetValue
New
retrieves a weather value :
Weather_PlaySound
New
plays a weather sound (non looped)
Weather_Rand
New
Random function to be used in the weather scripts
Weather_SetCloudFactor
New
sets the active cloud factor for the weather
Weather_SetLight
New
sets the weather light factor
Weather_SetParticles
New
sets the active weather particles (rain/snow)
Weather_SetSoundLoop
New
Weather_SetSoundLoop()
Parameters:
Return Value:
:
no comment
Description:
no comment
Weather_SetWeather
New
Weather_SetWind
New
sets the active weather's wind
Time
2
Gametime2Total
New
Transfer a time given in gametime (1 = 1h ingame time) to total-value (used by textsystem).
Gametime2Realtime
New
Transfer a time given in gametime (1 = 1h ingame time) to realtime (1 = 1 second)
Select a function to view its documentation
Browse the available functions in the sidebar or use the search to find specific functionality
•
Description
Parameters
Name | Type | Description |
---|
Return Value
No return value documented
Example
Example code with Lua syntax highlighting
This documentation is for The Guild 2: Renaissance Reforged Mod v1.0
The Guild 2: Renaissance Reforged Mod © 2024-2025. API documentation for modders.