Did anyone ever come up with a way to limit the number of po

Post » Wed Jan 19, 2011 1:19 am

...that's right, I said quaff >.>

But yeah, I'm up to actually editing in the changes for the "Alchemy" portion of my mod, and this is all I can think about. It's, like, driving me crazy. And working on this update has already made me plenty crazy enough.
User avatar
Sharra Llenos
 
Posts: 3399
Joined: Wed Jan 17, 2007 1:09 pm

Post » Wed Jan 19, 2011 12:17 am

You probably already checked, but isn't that just governed by a GMST? (and therefore easy to change)
Maybe I'm thinking of OB.

A quick look ... actually, I'm not seeing a GMST to govern that. anyways.... way passed my bedtime.
User avatar
Epul Kedah
 
Posts: 3545
Joined: Tue Oct 09, 2007 3:35 am

Post » Tue Jan 18, 2011 11:34 pm

I haven't seen one that did that before - though I suspect you could do a check on the player's attributes and pop up a message box once they begin getting uber or even over 100 that tells them if they drink any more they will burst their bladder - could be a good question for the CS forum
User avatar
Kathryn Medows
 
Posts: 3547
Joined: Sun Nov 19, 2006 12:10 pm

Post » Wed Jan 19, 2011 1:16 pm

This is surely a great idea, this is one of those things that definitively needs to be limited.
User avatar
Maya Maya
 
Posts: 3511
Joined: Wed Jul 05, 2006 7:35 pm

Post » Wed Jan 19, 2011 1:50 pm

I haven't seen one that did that before - though I suspect you could do a check on the player's attributes and pop up a message box once they begin getting uber or even over 100 that tells them if they drink any more they will burst their bladder - could be a good question for the CS forum



I was thinking about introducing a system similar to the Witcher. Drinking to many potions in a short timespan results in intoxication or poisioning.
User avatar
J.P loves
 
Posts: 3487
Joined: Thu Jun 21, 2007 9:03 am

Post » Wed Jan 19, 2011 3:22 pm

I love to see a feature like this and I had already thought of doing that.
But I don't think we can't do that with Morrowind : there is no way to count in realtime how many potions player drank.
User avatar
Life long Observer
 
Posts: 3476
Joined: Fri Sep 08, 2006 7:07 pm

Post » Wed Jan 19, 2011 6:45 am

I love to see a feature like this and I had already thought of doing that.
But I don't think we can't do that with Morrowind : there is no way to count in realtime how many potions player drank.


I'm sure there probably is. Like maybe a script to detect when a character consumes a potion and then place a ten-second timer before a new one can be consumed.
User avatar
Liv Staff
 
Posts: 3473
Joined: Wed Oct 25, 2006 10:51 pm

Post » Wed Jan 19, 2011 2:07 am

I'm sure there probably is. Like maybe a script to detect when a character consumes a potion and then place a ten-second timer before a new one can be consumed.

Yes you'll right : I begin something with MWSE.
It can be a great new feature.
I'll work on it today and tomorrow and see if I can do that.
User avatar
Vicki Blondie
 
Posts: 3408
Joined: Fri Jun 16, 2006 5:33 am

Post » Wed Jan 19, 2011 7:14 am

Yes you'll right : I begin something with MWSE.
It can be a great new feature.
I'll work on it today and tomorrow and see if I can do that.

If you can really do that, it would be a HUGE improvement for alchemy!
User avatar
Eve(G)
 
Posts: 3546
Joined: Tue Oct 23, 2007 11:45 am

Post » Wed Jan 19, 2011 2:48 am

I've done something but with some issues...

Features :
- choose the number of potions player can drink at one time (default=2). When you reach this number the inventory is closed.
- choose the delay before you can drink another potion (default=5 * number of potions). You can't open inventory since delay is gone.

Issues :
- If you drop a potion on the ground, the script think you drank it !!! The biggest issue. Need to work on this first !
- Need to scan 2 times the inventory to be sure to count all potions : MWSE seems to have a bug when it scan inventory for the first time ! (Help, Fliggerty !!). It's an issue only for inventory with numerous items, and then the script will be longer.
- A small graphical glitch if you try to open your inventory before delay is gone.
User avatar
lauraa
 
Posts: 3362
Joined: Tue Aug 22, 2006 2:20 pm

Post » Wed Jan 19, 2011 11:13 am

I've done something but with some issues...

Features :
- choose the number of potions player can drink at one time (default=2). When you reach this number the inventory is closed.
- choose the delay before you can drink another potion (default=5 * number of potions). You can't open inventory since delay is gone.

Issues :
- If you drop a potion on the ground, the script think you drank it !!! The biggest issue. Need to work on this first !
- Need to scan 2 times the inventory to be sure to count all potions : MWSE seems to have a bug when it scan inventory for the first time ! (Help, Fliggerty !!). It's an issue only for inventory with numerous items, and then the script will be longer.
- A small graphical glitch if you try to open your inventory before delay is gone.

Instead of using MWSE what about just checking for the potion drinking sound? That would avoid issues with dropping potions and scanning inventory. :lightbulb:
User avatar
neen
 
Posts: 3517
Joined: Sun Nov 26, 2006 1:19 pm

Post » Wed Jan 19, 2011 1:14 pm

Instead of using MWSE what about just checking for the potion drinking sound? That would avoid issues with dropping potions and scanning inventory. :lightbulb:

I've tried with sound but I failed to catch the sound.
What is the sound when player drink potion ?
Because I've tried the drink one and it didn't work.
if ( player->GetSoundPlaying "drink" );didn't workendif

Or maybe it's because getsoundplaying didn't work when you're in menu : is there someone know this ?
User avatar
Breanna Van Dijk
 
Posts: 3384
Joined: Mon Mar 12, 2007 2:18 pm

Post » Wed Jan 19, 2011 2:33 pm

I've tried with sound but I failed to catch the sound.
What is the sound when player drink potion ?
Because I've tried the drink one and it didn't work.
if ( player->GetSoundPlaying "drink" );didn't workendif

Or maybe it's because getsoundplaying didn't work when you're in menu : is there someone know this ?

That should be the sound id, although it's capitalized 'Drink' ... not sure if that makes a difference.

Did you run the checking script from menumode == 1 ?


[edit] there's also sound id 'Swallow' ... maybe that's the correct sound. No wait, that should be for eating.
User avatar
Soku Nyorah
 
Posts: 3413
Joined: Tue Oct 17, 2006 1:25 pm

Post » Wed Jan 19, 2011 12:35 pm

For the sound 'drink' or 'Drink' didn't change anything.
And yes script run in menumode == 1.

I think it's a script limitation in menumode...
User avatar
mike
 
Posts: 3432
Joined: Fri Jul 27, 2007 6:51 pm

Post » Wed Jan 19, 2011 1:04 pm

Or maybe it's because getsoundplaying didn't work when you're in menu : is there someone know this ?

GetSoundPlaying is unreliable on some systems for detecting events. It will usually just fail. Perhaps you have one of those systems that it doesn't work on.

My recommendation is to never rely on GetSoundPlaying to detect events.
User avatar
RAww DInsaww
 
Posts: 3439
Joined: Sun Feb 25, 2007 5:47 pm

Post » Wed Jan 19, 2011 1:23 pm

GetSoundPlaying is unreliable on some systems for detecting events. It will usually just fail. Perhaps you have one of those systems that it doesn't work on.

My recommendation is to never rely on GetSoundPlaying to detect events.

However I use it with a mod to detect spells and it work very well.
User avatar
Guy Pearce
 
Posts: 3499
Joined: Sun May 20, 2007 3:08 pm

Post » Wed Jan 19, 2011 2:34 am

However I use it with a mod to detect spells and it work very well.

Then maybe it does work on your system.

But really my point is that there will be other systems it just will not work on, so I recommend not relying on it exclusively to detect events.
User avatar
Jason King
 
Posts: 3382
Joined: Tue Jul 17, 2007 2:05 pm

Post » Wed Jan 19, 2011 11:24 am

Then maybe it does work on your system.

But really my point is that there will be other systems it just will not work on, so I recommend not relying on it exclusively to detect events.

In any case that doesn"t work so...
User avatar
CArlos BArrera
 
Posts: 3470
Joined: Wed Nov 21, 2007 3:26 am

Post » Wed Jan 19, 2011 12:13 pm

Also, the drink sound might conflict with other mods, such as NoM.
Speaking of NoM, if you wanted to use poisoning effects, one suggestion might be to create variations based on the NoM drunkeness engine - with permission of course.
User avatar
Tom Flanagan
 
Posts: 3522
Joined: Sat Jul 21, 2007 1:51 am

Post » Wed Jan 19, 2011 2:30 am

- If you drop a potion on the ground, the script think you drank it !!! The biggest issue. Need to work on this first !

Also, the drink sound might conflict with other mods, such as NoM.
Speaking of NoM, if you wanted to use poisoning effects, one suggestion might be to create variations based on the NoM drunkeness engine - with permission of course.

The big problem is: checking inventory numbers only, the script can't determine if you drink or drop an item. In NoM I partially solved this problem by assigning to every alcoholic items certain magic effects, but you can do this for a limited set of items like alcoholics, not for all the potions in game (not to mention the player created ones). :brokencomputer:
I was hoping that MWSE had some way to determine when the player drinks a potion without having to check inventory.
User avatar
Anna Beattie
 
Posts: 3512
Joined: Sat Nov 11, 2006 4:59 am

Post » Wed Jan 19, 2011 4:34 am

I found a workaround : if the you want to drop a potion without having the delay just hit the sneak key when dropping a potion.

And this work !

But now you can drink potion without control (just hit the key in the same time) !!!
User avatar
Chloe Yarnall
 
Posts: 3461
Joined: Sun Oct 08, 2006 3:26 am

Post » Wed Jan 19, 2011 3:50 pm

Environmental sounds, such as the player drinking and eating, cannot be detected by GetSoundPlaying. It doesn't work if you define a a reference for it or not. The only way possible at this point to detect the player drinking sound is by using MWE's (not MWSE) sound scan function. But I wouldn't do it since from my experience MWE causes more CTDs and corrupted save games than anything else.

The problem with GetSoundPlaying not returning any results is a hit and miss thing; most of the testing I have had people do for me shows it to work more often than not. Of course for those it doesn't work for that means a lot of mods won't work. But there are many events that we can only detect using that function, and there is no other way. So my thoughts on it is that if I can create something that will work for 75% of those who use it, I'll make it. It svcks for those 25% who can't, but I would rather not deprive everyone else so they don't feel left out. :shrug: (BTW john, have you done any testing to see if the problem is related to hardware vs software acceleration?)

Need to scan 2 times the inventory to be sure to count all potions : MWSE seems to have a bug when it scan inventory for the first time ! (Help, Fliggerty !!). It's an issue only for inventory with numerous items, and then the script will be longer.


It's all about how you scan it. This tripped me up a lot early on, but the main cause of problems for people is the fact that the last time a reference is found the next reference is a 0...but you still need to check the reference. For example, this will not work properly:

ifx ( invref ) ;continue through the list    setx invid invcount invtype invvalue invweight invname invref to pcref->xContentList invrefelse ;get the first item    setx invid invcount invtype invvalue invweight invname invref to pcref->xContentList 0endifif ( invref == 0 ) ;means we are at end of list    ;terminate script or loop    Returnendif


It won't process the last item in the list. This will have very different results:

ifx ( invref ) ;continue through the list    setx invid invcount invtype invvalue invweight invname invref to pcref->xContentList invrefelse ;get the first item    setx invid invcount invtype invvalue invweight invname invref to pcref->xContentList 0endifif ( term == 1 )	;terminate script or loop	Returnendifif ( invref == 0 ) ;means we are at end of list    set term to 1endif


Does that help?
User avatar
Felix Walde
 
Posts: 3333
Joined: Sat Jun 02, 2007 4:50 pm

Post » Wed Jan 19, 2011 8:46 am

The problem with GetSoundPlaying not returning any results is a hit and miss thing; most of the testing I have had people do for me shows it to work more often than not. Of course for those it doesn't work for that means a lot of mods won't work. But there are many events that we can only detect using that function, and there is no other way. So my thoughts on it is that if I can create something that will work for 75% of those who use it, I'll make it. It svcks for those 25% who can't, but I would rather not deprive everyone else so they don't feel left out. :shrug: (BTW john, have you done any testing to see if the problem is related to hardware vs software acceleration?)

I haven't done any testing like that. I only have Linux to test on, so I don't think my system is representative.

The problem with the problem with GetSoundPlaying is that modders have relied on it for years, but it's flakiness has only been documented recently, so I suspect even most modders don't know it can be flaky, and this results in a situation where some mod just doesn't work for some people, but the modder tries to reproduce the problem and it works for them so they cancel the bug report as "unreproducible". As for me, I think that's a lousy outcome, as the modder isn't aware of the problem, and the user is frustrated because they can't get the mod to work. I've seen bug reports for a few mods, where I know the cause of the problem is GetSoundPlaying, but there is no resolution or answer to at least tell people what's going on.

Personally, I would only use GetSoundPlaying for managing when sounds are played, which is the only way it is used in the original Bethesda scripts. I don't think it's a good idea to use it for event detection because users won't understand what's going wrong if something does go wrong. But that's just my opinion.
User avatar
Kayleigh Mcneil
 
Posts: 3352
Joined: Thu Jun 29, 2006 7:32 am

Post » Wed Jan 19, 2011 2:04 pm

Thanks Fliggerty for your response but it's not only the last item which is missed.
From my tests if you do the scan 1 time you can have differents results.
But if you scan 2 times its always good !!

I used this code :
ifx ( doProcess )	ifx ( invref ) 		;get next item in inventory list		setx invid invcount invtype invvalue invweight invname invref to pcRef->xContentList invref	else		; get first inventory item		setx invid invcount invtype invvalue invweight invname invref to pcRef->xContentList 0	endif	set cpt to ( cpt + 1 )	; save only potion items	set temp to ( invtype - 1212369985 )	ifx ( temp )	else		;add number of potions by ref		set count to ( count + invcount )					endif	ifx ( invref )		;there is another item in inventory		return	endifendif

User avatar
kyle pinchen
 
Posts: 3475
Joined: Thu May 17, 2007 9:01 pm

Post » Wed Jan 19, 2011 4:05 am

To avoid this MWSE bug I'll add this before enter the loop :
And it works like a charm...


Edit :
So progress is :

Features :
- choose the number of potions player can drink at one time (default=2). When you reach this number the inventory is closed.
- choose the delay before you can drink another potion (default=5 * number of potions). You can't open inventory since delay is gone.

Issues :
- If you drop a potion on the ground, the script think you drank it !!! The biggest issue. Need to work on this first !
- Need to scan 2 times the inventory to be sure to count all potions : MWSE seems to have a bug when it scan inventory for the first time ! (Help, Fliggerty !!). It's an issue only for inventory with numerous items, and then the script will be longer.
- A small graphical glitch if you try to open your inventory before delay is gone.

For the drop issue, is anyone have an idea ?

Edit 2 :
Or maybe its a feature which can be done in MCP ?
User avatar
SWagg KId
 
Posts: 3488
Joined: Sat Nov 17, 2007 8:26 am

Next

Return to III - Morrowind