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

Post » Tue Dec 06, 2011 11:01 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
stacy hamilton
 
Posts: 3354
Joined: Fri Aug 25, 2006 10:03 am

Post » Tue Dec 06, 2011 4:55 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
Lucie H
 
Posts: 3276
Joined: Tue Mar 13, 2007 11:46 pm

Post » Tue Dec 06, 2011 12:55 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
Lexy Dick
 
Posts: 3459
Joined: Mon Feb 12, 2007 12:15 pm

Post » Tue Dec 06, 2011 9:43 am

This is surely a great idea, this is one of those things that definitively needs to be limited.
User avatar
Mackenzie
 
Posts: 3404
Joined: Tue Jan 23, 2007 9:18 pm

Post » Tue Dec 06, 2011 11:51 am

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
michael danso
 
Posts: 3492
Joined: Wed Jun 13, 2007 9:21 am

Post » Tue Dec 06, 2011 2:50 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.
User avatar
Cayal
 
Posts: 3398
Joined: Tue Jan 30, 2007 6:24 pm

Post » Tue Dec 06, 2011 10:00 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
LADONA
 
Posts: 3290
Joined: Wed Aug 15, 2007 3:52 am

Post » Tue Dec 06, 2011 6:36 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
Jack Walker
 
Posts: 3457
Joined: Wed Jun 06, 2007 6:25 pm

Post » Tue Dec 06, 2011 5:03 pm

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
Tasha Clifford
 
Posts: 3295
Joined: Fri Jul 21, 2006 7:08 am

Post » Tue Dec 06, 2011 1:10 pm

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
kitten maciver
 
Posts: 3472
Joined: Fri Jun 30, 2006 2:36 pm

Post » Tue Dec 06, 2011 11:32 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
Mimi BC
 
Posts: 3282
Joined: Sat Oct 07, 2006 10:30 pm

Post » Tue Dec 06, 2011 3:49 am

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
Kieren Thomson
 
Posts: 3454
Joined: Sat Jul 21, 2007 3:28 am

Post » Tue Dec 06, 2011 12:02 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
Guinevere Wood
 
Posts: 3368
Joined: Mon Dec 04, 2006 3:06 pm

Post » Tue Dec 06, 2011 3:01 am

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
I love YOu
 
Posts: 3505
Joined: Wed Aug 09, 2006 12:05 pm

Post » Tue Dec 06, 2011 2:25 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
Jason Wolf
 
Posts: 3390
Joined: Sun Jun 17, 2007 7:30 am

Post » Tue Dec 06, 2011 5:39 am

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
Donatus Uwasomba
 
Posts: 3361
Joined: Sun May 27, 2007 7:22 pm

Post » Tue Dec 06, 2011 5:11 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
Louise Andrew
 
Posts: 3333
Joined: Mon Nov 27, 2006 8:01 am

Post » Tue Dec 06, 2011 4:23 pm

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
meg knight
 
Posts: 3463
Joined: Wed Nov 29, 2006 4:20 am

Post » Tue Dec 06, 2011 2:00 am

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
laila hassan
 
Posts: 3476
Joined: Mon Oct 09, 2006 2:53 pm

Post » Tue Dec 06, 2011 3:27 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
BaNK.RoLL
 
Posts: 3451
Joined: Sun Nov 18, 2007 3:55 pm

Post » Tue Dec 06, 2011 8:08 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
Brittany Abner
 
Posts: 3401
Joined: Wed Oct 24, 2007 10:48 pm

Post » Tue Dec 06, 2011 4:02 am

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
Silencio
 
Posts: 3442
Joined: Sun Mar 18, 2007 11:30 pm

Post » Tue Dec 06, 2011 10:22 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
Laura Shipley
 
Posts: 3564
Joined: Thu Oct 26, 2006 4:47 am

Post » Tue Dec 06, 2011 1:20 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
Jason King
 
Posts: 3382
Joined: Tue Jul 17, 2007 2:05 pm

Post » Tue Dec 06, 2011 8:12 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
Reven Lord
 
Posts: 3452
Joined: Mon May 21, 2007 9:56 pm

Next

Return to III - Morrowind