v3nture Posted December 12, 2023 Share Posted December 12, 2023 Hey, Im new to scripting with MWSE and one issue Ive run into Is that the following bit will run find in vanilla morrowind but will not with mwse. My first assumption was that with mwse I had to assign the player as a reference but havent had much luck. Any help would be appreciated. Begin vsthisworks if ( player->GetItemCount, "vs_ingred_Ember_01" == 1 ) messagebox "pholdember" endif if ( player->GetItemCount, "vs_ingred_ember_01" == 0 ) messagebox "noember" endif end vsthisworks It all stems from testing some simple detection Begin vs_mwseTest long pRef ; The Player long pcTarget ; The Players target long ContCheck long ContName ;TypeString "Burning Coals" long ContNCheck short cCont short isCont Setx pRef to xGetRef, "Player" Setx pcTarget to xGetPCTarget Setx ContCheck to pcTarget->xRefType Setx ContName to xStringBuild, "Burning Coals" Setx ContNCheck to pcTarget->xGetName ;ifx ( pRef->GetItemCount, "vs_ingred_ember_01" == 0 ) ;messagebox "no ember" ;endif if ( pcTarget == 0 ) ;messagebox "nothing looked at" return; do nothing endif if ( ContName != ContNCheck ) set cCont to 1 ;player looking at wrong container if ( cCont == 1 ) ;Messagebox "not looking at rock" endif else set cCont to 2 ;player looking at right container if ( cCont == 2 ) ;Messagebox "looking at rock" endif endif ;container detection; if ( ContCheck == 1414418243 ) ;reftpe container set isCont to 1 ;Messagebox "container" else return endif ;container detection; end vs_mwseTest Link to comment Share on other sites More sharing options...
cpassuel Posted April 27 Share Posted April 27 (edited) Hello, Depending on what kind of mod you're creating, you may use Lua instead of mwscript with mwse, you'll find lots of information here https://mwse.github.io/MWSE/guides/introduction/ and if you want some examples on how container / inventory works with, go check QuickLoot source code https://www.nexusmods.com/morrowind/mods/46283 or my mod https://www.nexusmods.com/morrowind/mods/52918 Edited April 27 by cpassuel Link to comment Share on other sites More sharing options...
Recommended Posts