More Awesome Than You!

The Bowels of Trogdor => The Small Intestines of Trogdor => Topic started by: jase on 2006 December 03, 07:35:54



Title: Procedural Modification of TTAB Flags?
Post by: jase on 2006 December 03, 07:35:54
At the risk of sounding redundant - I've asked this before many moons ago but: social advertisement aside, is anyone aware of a mechanism by which the flags of a TTAB interaction can be modified procedurally?  Say, for example, I want to expose Kiss... | Peck to children.  This behavior is normally restricted to teens and older.  For the sake of argument, let's assume that I also want to suppress this interaction for all other age groups.  I know I could extend this interaction to children via a social plug-in, but is there any known mechanism for directly modifying the flags of the existing one?  Or possibly: can a social plug-in behavior "supplant/mask out/trump" a PersonGlobal interaction so that the PersonGlobal is no longer considered?


Title: Re: Procedural Modification of TTAB Flags?
Post by: J. M. Pescado on 2006 December 03, 07:38:58
This really is more Bowels of Trogdor material.

And no, there is no way known to modify a TTAB in-game. TTABs can only be hacked from outside the system and overridden, which is probably not what you want to be doing with PersonGlobals. If you want to suppress an interaction, you're better off hacking the test BHAV. However, there are issues with autonomy and plug-in socials for non-adults.


Title: Re: Procedural Modification of TTAB Flags?
Post by: jase on 2006 December 03, 07:57:23
Alas.  Such was the case when I first posed this question a year ago.  It's easy enough to add new interaction functionality w/o going near PersonGlobals, but modifying a PersonGlobal interaction without actually touching PersonGlobals itself is problematic (if not impossible).  Moreover, the lack of consistency in how Maxis handles its age checks is bothersome.  Some interactions are gated by age in their TEST routines.  Others are gated by their TTAB flags. And still others are some perverse combination of the two.  I imagine this was done for performance reasons - since testing a bit is certainly faster than executing a script - but damn, it really limits your choices where modding PersonalGlobal interactions are concerned.


Title: Re: Procedural Modification of TTAB Flags?
Post by: syberspunk on 2006 December 03, 08:24:50
Or possibly: can a social plug-in behavior "supplant/mask out/trump" a PersonGlobal interaction so that the PersonGlobal is no longer considered?

I think you should be able to do this. I don't remember if it was pinhead or ebruere maybe that suggested this to me once (and I don't remember if it was in private via pm/email or if it was publicly posted... maybe on MTS2 somewhere?). But if I understand what you are asking, you should be able to create a social plug in... and then couldn't you just modify/override the Maxis EA TEST and interaction BHAVs. I used pinhead's moveinall hack as the basis for creating my vamprocillin-d fix for teens and elders. Unfortunately... as Pescado points out (and twojeffs explained to me) social plugins do not advertise to non-adults. My crappity workaround for this was to hack my own PersonalGlobals TTAB and set the motive advertising the same for all age groups.

Ste


Title: Re: Procedural Modification of TTAB Flags?
Post by: dizzy on 2006 December 03, 11:59:40
If you don't mind dinking around with Lua, I think there's a function for that:

OverrideTreeTable(objectId, value1, value2, bool)

I'm not completely sure what it does, though.  :P


Title: Re: Procedural Modification of TTAB Flags?
Post by: jase on 2006 December 03, 17:50:42
and then couldn't you just modify/override the Maxis EA TEST and interaction BHAVs.
Indeed, but the objective here is to affect the original tree without actually overriding a PersonGlobal BHAV or TTAB in the process.  It really boils down to procedurally overriding the TEST conditions (and apparently the non-adult advertisement).  Keep in mind that some interactions (not just PersonGlobals) share a common test BHAV (although I think these are extremely rare) and some don't even supply a guardian test BHAV at all you could even override.

Using your vamprocillin example, it's clear how you can "add" to the pie menu as you've done.  What's not clear is how you can "subtract" from it.  What if you wanted (for some stupid reason) to disallow adults from using the vamprocillin?  I see no clear alternative but to override Interaction - Use Vampire Cure - TEST to always return FALSE and then replace it with the version supplied via your social plug-in or (god-forbid) you override the PersonGlobals TTAB and untick all the flags *gaugh* so you now have the very worst of both worlds: a global override of PersonGlobals and broken advertisement to boot (not that anyone really cares about the latter in this particular example).

Quote from: dizzy
If you don't mind dinking around with Lua, I think there's a function for that:
OverrideTreeTable(objectId, value1, value2, bool)

Curious.  Is there an example of its usage anywhere?



Title: Re: Procedural Modification of TTAB Flags?
Post by: J. M. Pescado on 2006 December 03, 19:37:14
I'm pretty sure it doesn't do what you think it does, if simply because I can't imagine how you'd overwrite an entire TTAB entry in two values. I think the idea you propose is simply impossible: How would you override the entry on a permanent basis WITHOUT a global override? Some BHAV line would have to run, and how would you insure that this line would be run before that particular test was ever evaluated? It does not make sense.

The only way I can think of to do this would be to override the test tree, inserting a bit of code to selectively disable that interaction in cases where it would normally be available, but you wish it to be unavailable, and then use the plugin method to enable it in cases where it would never have been available in the first place.


Title: Re: Procedural Modification of TTAB Flags?
Post by: jase on 2006 December 03, 21:57:24
The only way I can think of to do this would be to override the test tree, inserting a bit of code to selectively disable that interaction in cases where it would normally be available, but you wish it to be unavailable, and then use the plugin method to enable it in cases where it would never have been available in the first place.
Oi.  That's the only way I can think to do this also.  Unfortunately, that puts you squarely back in the land of global mods and PersonGlobals.  :-\  Of course if the test behavior doesn't exist at all, then you're truly fux0red.


Title: Re: Procedural Modification of TTAB Flags?
Post by: dizzy on 2006 December 03, 22:02:18
If you want examples, try looking at the Lua code for "HidingFunctions" or "DisablingFunctions" in the Global Lua function. "ResetShop" also uses it in Object Lua functions. Use dizziness or ChunkSpy rather than SimPE for that.

It may well only govern the specialty functions for Hiding and For Sale modes, but I rather doubt that.