*Me just casually hiding all the skooma every time the law approaches* That guy on Suran has now become my personal dealer for these matters because Creeper is f*#@ing useless (we really need an overhaul for that guy).
This mod is only supported for OpenMW, while Skoomathesia requires MWSE. If this mod works for you in MWSE, then the two should work together OK, but the combination of both withdrawal effects might be unbalanced.
To give some more detail, this mod detects skooma consumption via an independent script and adds or removes spell effects directly to the player. I'm not too familiar with how Skoomathesia is build internally, but I'm pretty sure there should be zero incompabilities, assuming this mod works in Vanilla MW/MWSE.
At this point I've gotten different results for any combination of Constuction Set, MWEdit, OpenCS, Vanilla MW, Code Patch MW, and OpenMW. I'm going to give up on the vanilla MWScript version of this and rewrite it in Lua for OpenMW, maybe MWSE as well.
I tried the method listed by Confessoru by changing the script with MWEdit and although my game runs it does nothing to my character. I also have Skoomaesthesia running above in the load order for info. I'm running a vanilla+ version of the game with MGE + MWSE and the whole shebang.
To make the script work on vanilla game, it needs to be compiled in MWEdit, and line if ( Player->GetEffect "sEffectCurePoison" ) changed to if ( Player->GetEffect sEffectCurePoison == 1 )
I'm playing with your mod in my save game and I'm not getting the error anymore, I'm also seeing the intended magic effects being applied, so the mod works. Do you want me to send you the esp file with the above changes?
Okay, it seems that this bug only occurs in Vanilla/Bethesda Morrowind. OpenMW doesn't have any problem. Can you all tell me if you're running Vanilla Morrowind or OpenMW?
Alright, so it looks like this is going to have to be an OpenMW-only mod. If you're interested, here are the full details:
The native Morrowind scripting language is ... lacking and buggy. The best way to tell it a player is drinking or eating is to check if the drinking or eating sounds are being played. Unfortunately, the scripting function used to detect this (GetSoundPlaying) is completely bugged in vanilla MW. There is an option to fix these bugs using the Morrowind Code Patch, but in my testing I was unable to get my scripts working with vanilla MW regardless of how the MCP was installed.
Even the simplest script, that really out to work, produces error messages in vanilla MW:
begin wtftester short isDrinking set isDrinking to ( Player->GetSoundPlaying, "Drink" ) end
MW complaines about line 3, and says that ( Player->GetSoundPlating, "Drink" ) resolves to an error. I'm not 100% sure why it errors, but I think it has something to do with the "Drink" sound effect not really being properly detected by the engine, and MCP not fully fixing that detection. It's puzzling.
Sorry all, but vanilla MW is proving to be too buggy and difficult to get this running.
There was actually a workaround that lets you detect specific potion\ingredient consumption in vanilla MW. It was crafted by Stuporstar and it actually works. I used it in my mod to make incredibly simplistic (im not a good script writer) way to give player an empty cup after they drink my mod-added coffee. It requires attaching a script to potion (skooma and sugar in our case), and running global script that is started when this said potion is ingested. The script performs desired actions and gets stopped to reduce lag, until more potion is taken. Im very tired now, so I will just post the scripts that I took from Stuporstar (she allowed anyone to make use of them in the tutorial, IIRC), and hope they make sense to you.
If I get some time this week, I'll try to graft them to your script and hope that it will get it going.
This is on my coffee: begin tel_emptymug_scr short OnPCEquip short PCSkipEquip if ( OnPCEquip == 1 ) if ( ScriptRunning tel_cup_global == 0 ) StartScript tel_cup_global endif Set PCSkipEquip to 0 player->equip tel_trama_coffee set OnPCEquip to 0 elseif ( PCSkipEquip == 0 ) set PCSkipEquip to 1 endif end tel_emptymug_scr
This is the global script: begin tel_cup_global float timer If ( timer == 0 ) ;script is learned from Stuporstar, she's the best Player->AddItem tel_dwrw_tune_cube 1 Player->RemoveItem tel_dwrw_tune_cube 1 Endif Set timer to ( timer + GetSecondsPassed ) If ( timer < 1 ) Return Endif Set timer to 0 player->additem tel_emptymug 1 stopscript tel_cup_global end The cube is a placeholder item that you also have to create, because without it the flow of the script is somehow damaged and nothing works. The way I understood it, it creates either a timeframe for script to detect some changes, or it makes inventory shuffle? I guess?
I'm working on it, made a draft and will hopefully test it tomorrow. Made lil scripts for skooma and sugar, that run each one of two global scripts, either for skooma or sugar, that add to s0_sfm_skoomaInGut their respective amounts. And chopped all the skooma intake processing from the addiction script.
Yep. I can make the script detect skooma intake, but the main code for skooma effects still doesn't sit well with vanilla MWscript. Says expression error, "Infix to postfix", so it can't run it. It is very much above what I can work with. Very very sadly, seeing how exited I am about this mod idea. Still, thank you for making this, makes me happy even imagining how this looks in work in openMW.
Hmm, I'll give this a look. Thanks for sharing your ideas. The approach I took was to use global scripts only, this way I wouldn't conflict with any mods that added scripts to skooma or moon sugar (not that I can think of any that do, off the top of my head). I based my scripts off of the Immersive Alcohol mod, which does seem to work in Vanilla, with the Code Patch applied.
This mod's great! Skooma always felt like the in-game "cheat" potion, so having its effects be a series of highs and lows, just adds to the immersion. Great work!
36 comments
Now we just need a moonsugar mod...
To give some more detail, this mod detects skooma consumption via an independent script and adds or removes spell effects directly to the player. I'm not too familiar with how Skoomathesia is build internally, but I'm pretty sure there should be zero incompabilities, assuming this mod works in Vanilla MW/MWSE.
At this point I've gotten different results for any combination of Constuction Set, MWEdit, OpenCS, Vanilla MW, Code Patch MW, and OpenMW. I'm going to give up on the vanilla MWScript version of this and rewrite it in Lua for OpenMW, maybe MWSE as well.
Sorry to leave you hanging on this.
if ( Player->GetEffect "sEffectCurePoison" )
changed toif ( Player->GetEffect sEffectCurePoison == 1 )
Script error EXPRESSION in s0_sfm_addiction
Can you confirm if that does or does not appear for you?
The native Morrowind scripting language is ... lacking and buggy. The best way to tell it a player is drinking or eating is to check if the drinking or eating sounds are being played. Unfortunately, the scripting function used to detect this (GetSoundPlaying) is completely bugged in vanilla MW. There is an option to fix these bugs using the Morrowind Code Patch, but in my testing I was unable to get my scripts working with vanilla MW regardless of how the MCP was installed.
Even the simplest script, that really out to work, produces error messages in vanilla MW:
begin wtftester
short isDrinking
set isDrinking to ( Player->GetSoundPlaying, "Drink" )
end
MW complaines about line 3, and says that ( Player->GetSoundPlating, "Drink" ) resolves to an error. I'm not 100% sure why it errors, but I think it has something to do with the "Drink" sound effect not really being properly detected by the engine, and MCP not fully fixing that detection. It's puzzling.
Sorry all, but vanilla MW is proving to be too buggy and difficult to get this running.
Im very tired now, so I will just post the scripts that I took from Stuporstar (she allowed anyone to make use of them in the tutorial, IIRC), and hope they make sense to you.
If I get some time this week, I'll try to graft them to your script and hope that it will get it going.
This is on my coffee:
begin tel_emptymug_scr
short OnPCEquip
short PCSkipEquip
if ( OnPCEquip == 1 )
if ( ScriptRunning tel_cup_global == 0 )
StartScript tel_cup_global
endif
Set PCSkipEquip to 0
player->equip tel_trama_coffee
set OnPCEquip to 0
elseif ( PCSkipEquip == 0 )
set PCSkipEquip to 1
endif
end tel_emptymug_scr
This is the global script:
begin tel_cup_global
float timer
If ( timer == 0 ) ;script is learned from Stuporstar, she's the best
Player->AddItem tel_dwrw_tune_cube 1
Player->RemoveItem tel_dwrw_tune_cube 1
Endif
Set timer to ( timer + GetSecondsPassed )
If ( timer < 1 )
Return
Endif
Set timer to 0
player->additem tel_emptymug 1
stopscript tel_cup_global
end
The cube is a placeholder item that you also have to create, because without it the flow of the script is somehow damaged and nothing works. The way I understood it, it creates either a timeframe for script to detect some changes, or it makes inventory shuffle? I guess?
Still, thank you for making this, makes me happy even imagining how this looks in work in openMW.