Page 1 of 1

[Closed] Bug: Domina power recharge time resets

Posted: Sat Jan 01, 2011 8:09 pm
by SpongeJr
It seems that if you "Save and Quit" and Continue your game that the "recharge" time for your Domina powers isn't saved, so you have to wait allll over again for your powers to come back. It is reproducable. Seems to happen every time for me. Just set your Domina level to >1 and try it.

This MAY be "working as intended", but I don't think so... when you save your game, I'd imagine the whole "game state" should be saved?

Posted: Sat Jan 01, 2011 8:11 pm
by Arisaya
This is a bug, likely resulting from the attempt to fix the issue of them not working when the universe timer was too low.

Posted: Sun Jan 02, 2011 2:00 am
by Jeoshua
Actually, in the scripts I've noticed that global variables are deleted once their code section does... namely when the game closes. Maybe this is related, maybe not... but Domina does use alot of script.

Re: Bug: Domina power recharge time resets

Posted: Fri Feb 04, 2011 9:00 pm
by Bobby
Specifically in the case of domina powers unvGetTick resets every time the game is saved and restarted.

Re: Bug: Domina power recharge time resets

Posted: Sat Feb 05, 2011 5:46 am
by alterecco
this would be a good thing for the official T patch to fix. We should have a list where we could add pending fixes

Re: Bug: Domina power recharge time resets

Posted: Sat Feb 05, 2011 6:17 am
by Ttech
alterecco wrote:this would be a good thing for the official T patch to fix. We should have a list where we could add pending fixes

We could use something like google code, Github (it supports SVN) and or we can use trac. Those would suffice.

Re: Bug: Domina power recharge time resets

Posted: Sat Feb 05, 2011 8:16 am
by SpongeJr
This quick little bit of code is my workaround for the unvGetTick / Domina powers & tithing bug:

Code: Select all

<Invoke>
<!-- This is a temporary solution. Very inelegant. -->
(block nil
	(if (typGetGlobalData 0x00202001 "lastInvokeTime1") (typSetGlobalData 0x00202001 "lastInvokeTime1" 180))
	(if (typGetGlobalData 0x00202001 "lastInvokeTime2") (typSetGlobalData 0x00202001 "lastInvokeTime2" 180))
	(if (typGetGlobalData 0x00202001 "lastInvokeTime3") (typSetGlobalData 0x00202001 "lastInvokeTime3" 180))
	(if (typGetGlobalData 0x00202001 "lastInvokeTime4") (typSetGlobalData 0x00202001 "lastInvokeTime4" 180))
	(if (typGetGlobalData 0x00202001 "lastInvokeTime5") (typSetGlobalData 0x00202001 "lastInvokeTime5" 180))
	(if (typGetGlobalData 0x00202001 "lastInvokeTime6") (typSetGlobalData 0x00202001 "lastInvokeTime6" 180))
	(objSetData gPlayerShip "sistersLastDonation" (60))
	(plyMessage gplayer (cat "Domina powers reset. Your Domina XP is currently: " (typGetGlobalData 0x00202001 "xp")))
)
</Invoke>
This code, when added to an item, does the following when the item is <U>sed:

- Set the "last invoke time" for each of the Domina powers of levels 1-6 to 180 "ticks" (a few seconds after game start)
- Set the "last donation time" for Sisters of Domina tithing to 60 ticks (two seconds after game start)
- Send a message to the player indicating that powers have been reset and also revealing their current Domina XP.

Notes:
- Yes, I should have used a loop. Initially I just tried level 1 powers and I copy/pasted from that instead of rewriting the code.
- Tithing @ Sisters of Domina temple is affected by unvGetTick, hence why it is reset also.
- If you don't understand Domina XP and levels, revealing that info might be a minor spoiler for you.
- You could use this code to cheat and have basically perpetually usable Domina powers with no "cooldown". I thought about ways to make it fair but decided that was way too much effort for my own uses since I know I would never use it to cheat. If you cheat with it, it's your conscience, not mine. I also heard that Domina doesn't like cheaters.
- I stuck this code in a ROM biosoft that doesn't go away when you use it, and then edited the playerships to have the ROM right from the start of the game. I called it "Domina Bugfix ROM" and gave it basically no other value. If you do something like this, be warned that you could still lose the item to, e.g., solvent flooding your cargo hold.
- I also stuck the code into the Jewel of Contemplation item 'cuz I thought that would be neat.
- The code provided here is in the Public Domain. You can use it, steal it, modify it, print it out, wear it on a t-shirt, whatever you want. No credit to me is necessary.

- Oh yeah, almost forgot. I hardcoded the 0x00202001 ID instead of using the global variable. That's not good. There's a constant set for it in Transcendence.xml I think, something like &stDomina. I had the number memorized but not the variable name. Anyway, that's bad practice, don't do it.

Re: Bug: Domina power recharge time resets

Posted: Mon Feb 07, 2011 11:07 pm
by Bobby
I made a fix for this bug too, you can find it on xelerus here. It works by:

1. replacing unvGetTick with unvGetTickDom for the context of domina.xml, reading a stored variable instead of the resetting unvGetTick.

Code: Select all

        (setq unvGetTickDom (lambda Nil
            (block (ticks)
                (setq ticks (typGetGlobalData &stDomina; "ticks"))
                ticks
            )
        ))
2. Code placed in the latest captain's log (CL) will check if this mod is installed and increment the variable used in step one. It's in CL because That's the first convenient universal recurring event I could think of (and when the bug is properly fixed no new stations have been added so this can be removed during a game), but it could be put anywhere, perhaps an item.

Code: Select all

        (if (not (isError (unvGetTickDom)))
            (block (ticks domticks newticks)
                (if (isError  (setq domticks (typGetGlobalData &stDomina; "ticks")))
                    (typSetGlobalData &stDomina; "ticks" 0)
                (typSetGlobalData &stDomina; "ticks" (add domticks 150)))
            )
        )
note that on each running of this event the counter is incremented by 150, which is the length of the delay on this event, so adjust it accordingly.


the result is a transparent solution (assuming you already have CL) that works as originally intended, or at least close to it.

Re: Bug: Domina power recharge time resets

Posted: Tue Feb 08, 2011 12:13 am
by SpongeJr
Bobby, author of that cool Captain's Log mod, arranged some bytes thusly:
I made a fix for this bug too, you can find it on xelerus ...
Sweet. A very nice solution indeed. I'm a fan of CL but I'm doing a plain Vanilla playthrough (well... Vanilla + SpongeJr's Variety Sounds and SpongeJr's Variety Text mods... but they don't count :P ) so I can't try this out for myself yet. It certainly looks like a better solution than my clunky code though. Good work.

Re: Bug: Domina power recharge time resets

Posted: Thu Feb 10, 2011 7:05 am
by alterecco
The very pretentiously named, but apparently legit Official Patch mod now also carries this fix (and not much else yet)

Re: Bug: Domina power recharge time resets

Posted: Thu Feb 10, 2011 3:22 pm
by Arisaya
Well, I wouldn't consider that its pretentiously named when it was originally named "Unofficial" like all the other mods like it for all those other games, until it was made official, so the name was changed >.> :roll:

But yeah, its rather incomplete ATM. :lol: