Unlock grant after played time

Discussion about Mods for Prison Architect

Moderator: NBJeff

ShadowVision
level0
Posts: 4
Joined: Sun Oct 11, 2015 6:05 pm

Unlock grant after played time

Postby ShadowVision » Sun Oct 11, 2015 6:35 pm

Hello again,

just another question related to grants: Is there a way to unlock a grant based on playtime? As a example: If a player has played 30 days ingame there should appear a grant in the list he can accept. Until this moment it should be hidden. Actually i know only the grant-accepted related timer.

With this i would manage such "hidden" grants like "hey you managed to get 100 prisoners in the first 3 days - accept the grant to get the money". I would like to play arround with such hidden milestones and rewards... ^^
User avatar
Brento666
level3
level3
Posts: 290
Joined: Wed Sep 02, 2015 9:23 pm

Re: Unlock grant after played time

Postby Brento666 » Mon Oct 12, 2015 12:18 am

Hey hiya, I just replied to yer other request, but thisone got me thinking a little more on this subject...

There is sadly no built in functionality for this, so if you want to time this, it would be with a 'very dirty' script. Also from script Game.Time() isn't too precise with time units across different prisons, pc's or platforms. So you couldn't count exact days in any simple way in script.

It would come down to this;
-The grant you want to has an almost impossible prerequisite, and then you temporarily make the impossible possible in your script: (thus making the grand visible)
Objective.SetPreRequisite ( "Prisoners", "AtLeast", 1000)

and then Spawn the missing number of prisoners somewhere via script at your timing...

That's the only way I see it being possible to cue a grant at your leisure. You can't effect money directly from script so using a money prerequisite and fulfilling it is out, sadly.

Honestly I'd forego efforts to mod this kind of trigger (atm) as the modding api just doesn't allow to stray from the norm too far!
I also think that a well balanced set of hefty 'regular' prerequisites is clearer to the player and will be appreciated more then seemingly random appearing grants...
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: Unlock grant after played time

Postby aubergine18 » Thu Oct 15, 2015 6:22 am

Objective.RequireTimePassed( timeInPrisonMinutes )
User avatar
Brento666
level3
level3
Posts: 290
Joined: Wed Sep 02, 2015 9:23 pm

Re: Unlock grant after played time

Postby Brento666 » Sun Oct 18, 2015 8:11 pm

aubergine18 wrote:Objective.RequireTimePassed( timeInPrisonMinutes )


That will make an accepted grant complete after x amount of time has passed. I think Shadowvision want's the grant to be hidden until x amount has passed...

(He'd like a time based prerequisite, not an objective requirement)

Could be mistaken, that's just what I understood.
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: Unlock grant after played time

Postby aubergine18 » Sun Oct 18, 2015 10:11 pm

IIRC grants can depend on other grants. So you could possibly have a hidden "dummy" grant (there are functions that hide grants from the to-do list), that uses RequireTimePassed(), and then the real grant relies on the dummy grant.
ShadowVision
level0
Posts: 4
Joined: Sun Oct 11, 2015 6:05 pm

Re: Unlock grant after played time

Postby ShadowVision » Mon Oct 19, 2015 9:30 am

Hey guys, thanks for your replies and sorry for the late anwser on my side.

I would love to test this, but my grants.lua doesn't work like it should. -.- After hours of unsuccessful testing and trying, i can't figure out why my "simple" grants doesn't work (2 of them work - the others not and there is NO ****** reason for it - especially some of them worked before in testing). In combination with this, it makes no sense for me to give your workarrounds a try, because - on my side - the investment of time and the result isn't worth any more. :/ But i'm very thankful for your replies - maybe it can help some others.
User avatar
Brento666
level3
level3
Posts: 290
Joined: Wed Sep 02, 2015 9:23 pm

Re: Unlock grant after played time

Postby Brento666 » Mon Oct 19, 2015 2:05 pm

Sorry to hear stuff didn't work out! I'd be up for some challenging extra grants!

But seeing as simple 'get extra money' grants seem pretty popular, maybe the added investment in time and effort in this pursuit would go mostly unnoticed or unused... I'm not sure...

1 thing I can say is that you are always free to give it another go (and another) when you're bored with other stuff or get a new idea! -Sometimes leaving stuff as is, then coming back later with fresh eyes/ideas, can be a good thing.

Anyway, good luck letting it go for now!
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: Unlock grant after played time

Postby aubergine18 » Mon Oct 19, 2015 5:33 pm

Just in case additional eyes can spot the problem, could you post your grants.lua script?

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 8 guests