Skip to content

Commit

Permalink
Fix: [news] MaxTopicality corrected (weather news start with 100% now…
Browse files Browse the repository at this point in the history
…). Report: Hans
  • Loading branch information
GWRon committed Jan 8, 2017
1 parent d822b5a commit 578978b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions source/game.newsagency.bmx
Expand Up @@ -471,10 +471,10 @@ Type TNewsAgencyNewsProvider_Weather extends TNewsAgencyNewsProvider

Local NewsEvent:TNewsEvent = new TNewsEvent.Init("", localizeTitle, localizeDescription, TVTNewsGenre.CURRENTAFFAIRS, quality, null, TVTNewsType.InitialNewsByInGameEvent)
NewsEvent.SetModifier("price", price)
'after 20 hours a news topicality is 0 - so accelerating it by
'2.0 means it reaches topicality of 0 at 10 hours after creation.
'after 50 hours a news topicality is 0 - so accelerating it by
'5.0 means it reaches topicality of 0 at 10 hours after creation.
'This is 2 hours after the next forecast (a bit overlapping)
NewsEvent.SetModifier("topicality::age", 2.0)
NewsEvent.SetModifier("topicality::age", 5.0)

NewsEvent.AddKeyword("WEATHERFORECAST")

Expand Down
11 changes: 6 additions & 5 deletions source/game.programme.newsevent.bmx
Expand Up @@ -538,17 +538,18 @@ Type TNewsEvent extends TBroadcastMaterialSource {_exposeToLua="selected"}
'age influence
local qualityAgeMod:Float = 0.8 * devQualityAgeMod

'the older the less ppl want to watch - 1hr = 0.95%, 2hr = 0.90%...
'means: after 20 hrs, the topicality is 0
'the older the less ppl want to watch - 1hr = 0.98%, 2hr = 0.96%...
'means: after ~50 hrs, the topicality is 0
local ageHours:int = floor( float(GetWorldTime().GetTimeGone() - self.happenedTime)/3600.0 )
Local ageInfluence:Float = 1.0 - 0.01 * Max(0, 100 - 5 * Max(0, ageHours) )
Local ageInfluence:Float = 1.0 - 0.01 * Max(0, 100 - 2 * Max(0, ageHours) )
ageInfluence :* GetModifier("topicality::age")
'the lower the quality of an newsevent, the higher the age influences
'the max topicality, up to 80% is possible
ageInfluence = (1.0-qualityAgeMod) * ageInfluence + qualityAgeMod * (1 - GetQualityRaw() )
ageInfluence = (1.0-qualityAgeMod) * ageInfluence + ageInfluence*qualityAgeMod * (1 - GetQualityRaw())
'print GetTitle() + " " +agehours +" influence="+ageInfluence +" devAgeMod="+devageMod +" qualityAgeMod="+qualityAgeMod +" qualityRaw="+GetQualityRaw()

'the first 12 broadcasts do decrease maxTopicality
Local timesBroadcastedInfluence:Float = 0.01 * Min(12, GetTimesBroadcasted() )
Local timesBroadcastedInfluence:Float = 0.02 * Min(12, GetTimesBroadcasted() )
timesBroadcastedInfluence :* GetModifier("topicality::timesBroadcasted")

'subtract various influences (with individual weights)
Expand Down

0 comments on commit 578978b

Please sign in to comment.