Posts by Fajeth

    Die aktuellsten Infos gibts im Discord, das Forum lese ich meist nur sporadisch...

    Ich hatte mich etwas überarbeitet und dann was Anderes gemacht, hab aber seit dieser Woche wieder die Arbeiten aufgenommen

    You actually need to edit (or other Sets if you use russian versions). The only drawback is, I have no idea how to 'find' the right locations for the empty icons. But you can delete old icons and use the new icon if you place it on the exact same spot

    Don't generate mipmaps as that leads to resolution issues with your font on low res

    (Object.Type == Position)
    (Object.Type == Sim)
    (Object.Type == Cart)
    (Object.Type == Building)
    (Object.Type==Vehicle) -- not sure.carts and ships? In the scripts Ships are counted as carts aswell though
    (Object.GetObjectsByRadius(Building)==600) -- gets objects in range. Object type can be changed for sim, cart etc. attention, can get a lot of possible results!
    (Object.GetLevel()==2) -- referenced as a building. Might work with sims aswell
    (Object.GetState(state)) --> statename from scripts/states
    (Object.CanAttack()) -- fisher boats can't attack, but not sure how this is done. State_impact no attack maybe?
    (Object.IsInFight()) --> If battle is true
    (Object.IsHostile()) --> now, this is a tricky one. Normally it refers to objects you are in battle with but I already experienced trouble when you are in battle and there are characters with very low favor nearby (even though they didn't attack me)
    (Object.Property.PropertyName==1) -- Can be any name from any property you created in your scripts and any value you want
    (Object.LacksProperty('is_apprentice')) -- opposite of having a property
    (Object.IsClass(1)) --> this is tricky. It refers to characterclasses aswell as building classes, depending on what object you have selected before.
    (Object.CompareHPRelative()<99) --> any HP percentage you want to check. Works for sims and buildings
    (Object.HasImpact(EmbezzlePublicMoney)) --> Any impactname from DB/Impacts.dbt
    (Object.GetItemCnt(AboutTalents1)>0) --> any itemname from DB/Items.dbt
    (Object.IsMultiplayer()) -- true if the game is a multiplayer session
    (Object.IsResourceMeasure()) -- has something to do with creating new resources (peasant)
    (Object.GetResourceScriptFunction()=='Fishing') -- that refers to gather.lua iirc
    (Object.GetReligion()>=0) -- RELIGION_CATHOLIC/RELIGION_EVANGELIC or RELIGION_NONE -- works for buildings aswell
    (Object.HasSameReligion('Owner')) -- the string is probably the Alias from the Script init function. Might be hardcoded 'Owner' and 'Destination'

    (Object.BelongsToMe()) --> This works for buildings, family members and for employees.
    (Object.CanBeControlled())--> This works unless the object has the StateImpact 'no_control'
    (Object.IsDynastySim()) -- Dynasty sims are also NPCs sometimes. Target measures should use the correct target measure object instead (MeasureToObjects.dbt)

    (Object.CanHireNewWorker()) -- probably means that you have enough slots open.
    (Object.IsBuyable()) --> This is for buildings on sale
    (Object.CanLevelUp()) --> This is used for building levels. Maybe working for sims aswell?
    (Object.GetInsideBuilding()) --> Gets the building you are currently in. False if outside
    (Object.HasUpgrade(UpgradeName)) --> Name from DB/BuildingUpgrades.dbt
    (Object.CameraIsInBuilding()) --> Probably checks whether you look at an indoor scene
    (Object.Property.HasIndoor > 0) --> HasIndoor is probably a hardcoded property name?
    (Object.HasItemToSell()) --> For market. Maybe for buildings aswell
    (Object.IsType(4)) --> This refers to building types. See DB/BuildingTypes.dbt
    (Object.IsBuildingOwnedByMe()) --> not sure if that refers to dynasty ownage or character ownage. might be the latter
    (Object.CanBuildingBeOwnedByMe()) --> this probably checks for class and level requirements
    (Object.IsBuildingMyHome()) -- Checks for GetHome
    (Object.CanBeGathered()) --> for buildings that are resources
    (Object.BuildingHasPrisoner()) -- this works for thieve huts. might work on the public prison aswell

    Sim Related
    (Object.CanHire()) --> probably means that you can hire the object
    (Object.GetProfession()== ID) --> ID from DB/Professions.dbt, Dynasty chars have profession 0
    (Object.CanWorkHere()) --> Only works with actions, that appear when your object is inside a building.
    (Object.GetWorkBuilding()) --> works for employees
    (Object.GetOwnedBuildings()) -- this only works for dynasty sims and will probably get a full list of objects. Make sure to get the type next.
    (Object.MinAge(16)) --> this is only really needed for targets. For Object-Filter use 'CanBeControlled' instead. Unless you want to attach a measure to a non-controllable child.
    (Object.IsNotAloneInRoom()) --> not sure if that counts NPCs aswell.
    (Object.IsInBuilding(player)) --> this is really interesting. Not sure if player is hardcoded parameter or not
    (Object.WillFollow(Owner)) --> follow only works on specific sims. Check FollowSim.lua
    (Object.IsQuestSource()) -- probably if the Object started a quest (like the tutorial/campaign quests)
    (Object.CanMoveTo(Destination)) --> I am not sure if that relates to pathfinding or anything else. Destination is probably the destination from measure init.
    (Object.IsInOfficeBuilding()) --> probably just a quicker way to check for insidebuilding with type TOWNHALL
    (Object.CanGatherResource()) --> not sure
    (Object.ActionAdmissible()) --> this probably checks for state impacts that forbid interactions
    (Object.HasAccessToItem(MiracleCure)) -- that probably refers to ai_HasAccessToItem and also counts the items in work buildings
    (Object.HasBehavior(Schooldays)) -- behavior as an Scripts/Measures/Behavior (name from Measures.dbt)
    (Object.CanCryForGuards()) -- sims who witness a crime I guess (actions which are evidence?)
    (Object.HasSquad()) -- squads are created by the AI. You can do it as a player aswell if you press ctrl + number
    (Object.CanJoinSquad()) -- not sure why this can by false

    (Object.IsOnVehicle()) -- this is for cart operators
    (Object.IsInOwnLoadingRange()) --> this is cart related. Maybe if a cart is in reach of the building to appear in the storage list. Might work on sims aswell

    (Object.CanCourt()) --> this is false if you are married. It probably is true if you just are 'in remorse
    (Object.CanBeCourted()) --> the same
    (Object.HasCourtLover()) --> ongoing courtship
    (Object.HasLiaison()) --> liason is a hardcoded status like married
    (Object.IsSocialMeasureTarget()) -- not sure
    (Object.HasFullLoverProgress()) -- 100% progress bar. hardcoded
    (Object.IsMySpouse()) --pretty clear
    (Object.IsMyLover()) --> Lover as in Courtlover? Not sure if that works with spouses or liasons aswell
    (Object.IsMyCourtLover()) -- weird cause there is also IsMyLover

    (Object.EnoughEvidenceAgainst()) -->not sure how much 'enough' is
    (Object.CanBeThreated()) -- you need evidence for that. maybe also checks for forced alliances
    (Object.IsOfficeLevelLower(6)) -- has a lower office level than 6? See GetOfficeLevel
    (Object.HasOfficeType(3)) -- For OfficeTypes see DB/Offices.dbt
    (Object.InTalk()) --> talk is a hardcoded status, used to transfer evidence. Maybe also true for quest talks, unsure
    (Object.PlayerHasOfficeImpact('CommandCityGuard')) --> office impacts are stored inside the privilege scripts iirc
    (Object.IsVacantOffice()) -- if office is empty
    (Object.IsOfficeBearer()) -- if object has an office
    (Object.HasOfficeAccess('apply')) -- OfficeGetAccessRights says: (EN_POLL = 1, EN_REELECT = 2, EN_REMOVE = 4, EN_APPLY = 8
    (Object.HasOfficeAccess('deposit')) -- same
    (Object.HasOfficeAccess('leave')) -- yea
    (Object.HasMinNobilityTitle(4)) --> Nobility title >=4 (see DB/NobilityTitles.dbt)

    (Object.CheckCutscene()) -- this means whether the character currently is in a cutscene
    (Object.CanBeControlledInCutscene()) -- only relevant for cutscene break out sessions
    (Object.HudIsInCutscene()) --> not sure
    (Object.IsInventoryVisible()) --> HUD related

    I'll edit this if I find more. Feel free to add.

    A Group / squad measure is a measure you can start when you have selected multiple sims. Those measures/actions will only appear in your action bar if you have set "selectionmode" in MeasureToObjects.dbt to "1". However the tricky part is making that work for workersims (type 1) and dynastysims (type 6) or with any other object type together.

    At the moment, dynasty chars and workers are seperated and can not start the same action if you multiselected, cause they use different filters. To make it work, workers and dynastychars (or any other type you want) have to use the same filter-IDs (target filter and object filter).

    A good example for that is the burglary-measure. In Vanilla it uses ID 215 for workers (Filter.dbt: 'IsMyThief') and 380 for dynasty sims ('HasThievesHut')
    The seperation is done, cause 'IsMyThief' uses the Profession function, which dynasty chars obviously haven't.

    380   "HasThievesHut"   "__F((Object.CanBeControlled())AND(Object.IsClass(4))AND(Object.MinAge(16))AND(Object.GetOwnedBuildings())AND(Object.IsType(101)))"   |

    215   "IsMyThief"   "__F((Object.CanBeControlled())AND(Object.GetProfession()== 26)AND(Object.MinAge(16)))"   |

    Now, because of how the statement 'OR' works in Filter.dbt it is not possible to make 2 filters into one with the simple usage of (). In Fact, besides the outer () and the ones you need for parameters, I am pretty sure they are mostly ignored (unless you miss one). But then we have a problem, cause we can't compare 'GetProfession()' and 'GetOwnedBuildings' AND 'IsType' together. Or just compares the functions directly connected. So it will just compare: Profession? Okay. Getownedbuildings? Okay. ObjectType? Wait, Professions don't have object types! So it will not work for workers anymore.

    Basicly you have to find a filter that fits both object types. Easier said than done! But I found 2 very good ways.
    First: if you have a building measure (let's say 'assign to service'), you can use the Filter-function "Object.CanWorkHere()". That works if your measure only appears if you are inside a building. Great, now you can use it for both of your cases, cause it also works with dynasty chars who own the building. But what with the burglary? Now, we could use this filter-function, but that would require the strange change of only beeing able to start a burglary from inside of your thiefs building. Weird!

    Better is the second solution, I came up with. Use 'GetOwnedBuildings' for the dynasty case and 'GetWorkBuilding' for your employees. We can easily connect them with an OR and then can go for the buildingType. Fantastic!

    Final solution:

    215   "IsMyThief"   "__F((Object.CanBeControlled())AND(Object.GetOwnedBuildings())OR(Object.GetWorkBuilding())AND(Object.IsType(101)))"   |

    You can apply this to many actions. You really don't need the profession-filter-function, unless maybe as a target filter. But object-filter are way better with Building-filter-functions!



    Get a List of offices for a given city and Call it OfficeList.
    With ListSize("OfficeList") we can get the size in a number, so we can use for i=0, ListSize-1 do to go through all of them, check the elements with ListGetElement("OfficeList", i,"Office") (Office is Output-Parameter)

    This function exists in the documentation, but is missing a paramenter (the third, Output-Alias)

    BuildingGetNPC(BuildingAlias, NPCid, "OutputAlias")

    NPCid refers to DB/BuildingNPC.dbt number

    To remove a countdown counter

    local ID = "Event"..GetID("")
    HudRemoveCountdown(ID, false)

    The alias of the counter is set via the 2nd subparameter of the Countdown-Panel-parameter (see MsgNewsNoWait)

    To show a countdown at the bottom you need to use the third parameter of MsgNewsNoWait

    local DestTime = CurrentTime + WaitTime
    local ID = "Event"..GetID("Voter")
    MsgNewsNoWait("Voter", "Voter", "@C[@L_OFFICE_SESSION_IN_TOWN_COUNTDOWN_+0,%i3,%l4]", "default", -1,
    	        GetID("Voter"), GetID("settlement"), DestTime, ID)

    You use @C[LABEL,%i,%l]

    Label can be anything from the Text.dbt
    %i needs the number of a int-parameter. This will be your end-time. Use GetGametime() to specify an end-time (here: DestTime)
    %l needs to be a String. That string is the ID-String. It is used as the Alias for the countdown ("Event"..+ID of the object)

    To remove a countdown you use the function

    local ID = "Event"..GetID("")
    HudRemoveCountdown(ID, false)

    I'm not quite sure what the 2nd parameter is. This function doesn't appear in the script documentation.

    Important: you MUST use the "default" channel or it won't work. I lost several hours because I had it set to "politics". Don't be me!

    Hi. Ja, allerdings arbeite ich an einem kompletten Rework, das in wenigen Wochen veröffentlicht werden soll.

    Auf dem Laufenden hält dich unser Discord Server!


    You can show Symbols in your text messages. You can find these in Textures/Hud/fonts/BookAntiqua_large_2000-2255.tga and Textures/Hud/fonts/BookAntiqua_medium_2000-2255.tga and finally Textures/Hud/fonts/sylfaen_6pt_2000-2255.tga

    they are enumerated (IDs 2000-2255, from left to right) but only a few slots are actually used. That means you can add your own symbols to the .tga and use the number in your labels! To use a symbol use "@L$S[2000]" - 2000 beeing the symbol ID in this case. This is pretty cool!