Fully intergrating mod 1 in mod 2 succesfully!

Discussion about Mods for Prison Architect

Moderator: NBJeff

User avatar
Brento666
level3
level3
Posts: 290
Joined: Wed Sep 02, 2015 9:23 pm

Fully intergrating mod 1 in mod 2 succesfully!

Postby Brento666 » Wed Oct 28, 2015 4:37 am

I have struggled to come up with a simple setup to string together my own mod (the paint-upgrade... one) with a new mod...
What I've come up with is quite nice and fool proof, so I thought I'd share;

-Mod1 (released) has tools to change mainly doors via subtype extension and 4 toggle tools
-Mod2 extends subtypes for base chair/table/bench
-Mod1's tools need to know if mod 2 is installed before touching any chair/table/bench, lest it mess up some-ones objects in vain!

-> Mod2 now has a width/Height 0 Object defined called ModToken666 ...
-> Mod1's tools now test-spawn a ModToken666 incase a chair/table/bench is near !
=if spawn is successful then Mod 2 must be installed and the subtype of chair/table/bench can be altered !!

Also mod 2 doesn't need any sprites of its own to add the chair/table/bench to the list of up/down gradebles ! Chair will downgrade to dinning chair and upgrade to luxury chair... tables/ will be downgradeble to wooden-finish versions!
These new object will again be fully compliant with room requirements and even the food/storage system, through the magic of extension!
(Also here the new chairs/tables/benches are fully unscripted!)
http://imgur.com/YpIEM8N
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: Fully intergrating mod 1 in mod 2 succesfully!

Postby aubergine18 » Thu Oct 29, 2015 12:34 am

I assume this is using the sprites.png trick you mentioned the other day? So adding additional sprites in the manifest.txt that reference objects.png without using objects.spritebank?

And neat idea with the spawning. I've been pondering similar approach as I'm considering splitting my health and safety mod up in to lots of little mods (that can work on their own but will integrate with each other if multiple are used).

Also, why bother making the spawn object 0,0 width/height? I assume it's deleted immediately after testing?
User avatar
Brento666
level3
level3
Posts: 290
Joined: Wed Sep 02, 2015 9:23 pm

Re: Fully intergrating mod 1 in mod 2 succesfully!

Postby Brento666 » Thu Oct 29, 2015 2:24 am

Yeah, I'm busy sussing out what to add in how...
I have created proxies for most of the newish things, but am currently thinking about removing those and only keeping my upgrade/downgrade rules.. What's the fun in just having the end product available? :D When I can force the use of my tools on people some more :mrgreen:

I personaly like building default beds in cells and upgrading them later (for instance)... I really like keeping the menus unclogged as I did with the previous mod! So the proxies will go before release.

Before the token, I tried stuff like probing for specific strings in mod2's lang through tooltip setting and checking; that didn't work sadly; that could have saved me having to try to spawn a token to test.. But the token way does work and it's proven reliable so, for now we'll have to sense around for other mods running by getting nearby customobjects and/or spawn-testing tokens...

My new mod only has ambiguous base game object extensions like 'Bed', getnearby from Mod 1 wasn't gonna work for me with no custom objects in 2... Happy I found something that worked, now 1 truly extends to 2! Without the user having to add a custom object token to enable cross modding... I was getting very afraid that thatway was gonna turnout to be the only solution 8)

-> I set the width/height 0 and zindex of 3; I have it set because I want to use tokens for other stuff later... like valued tokens to place in cells to maybe get the room-ratings being effected by upgrading/downgrading stuff like bed/toilet, maybe doors... But that's not a goal for rightnow, adding in lots of tokens, I'm not sure I will pursue it very soon...

-Why are you maybe gonna separate out stuff? Are people wanting that? Or you have plans for the separated parts?

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 6 guests