arelim Posted January 18, 2013 Posted January 18, 2013 I'm not sure if someone can help ... but I'm trying to write my own script that initiates lovers animation and then after its done, I want the NPC to talk to the player again automatically ... I can do the lovers animation no problem ... there are lots of script examples of how to do that and its pretty easy ... but I'm having trouble figuring out how to get the NPC to talk to the player afterward ... I've seen it in a couple of lovers mods and I've tried to figure out how they do it, but its just not clear. Can someone help? Thanks
gregathit Posted January 18, 2013 Posted January 18, 2013 Well I can't help you with "how" to do the script as I am script illiterate. However I can point you at Lovers Adult Play Plus as that plugin contains exactly what you are talking about.
arelim Posted January 18, 2013 Posted January 18, 2013 Thanks. I already looked at adult play plus, lovershooker, and truecrime before posting ... and I can't figure out how its being done in any of them - In adult play plus, what the people say when they initiate the followup conversation is not part of the greeting topic but actually in the 'conversations' tab ... which is normally used for dialogue that takes place outside of the discussion window ... like what NPC's say to you as you walk past them or what they say to each other. Also, its contingent on a 'follow' package ... so I'm not sure how the follow package is causing the NPC to initiate the conversation ... but it must relate somehow. Obviously, I don't know enough about Oblivion dialogue/script moding to reverse engineer whats going on there - and 'trial and error' learning is incredibly time consuming in oblivion ... takes way to long to load up oblivion and get in game to do minor tests ...
mem4ob4 Posted January 19, 2013 Posted January 19, 2013 @arelim In Adultplayplusforssp you might take a look at xLoversAdultPlayStartItem and xLoversAdultPlayAfterItem with their attached scripts. Mem
arelim Posted January 19, 2013 Posted January 19, 2013 Thanks. The xLoversAdultPlayAfter script has a command me.StartConversation Player ... so that is probably the piece I was missing. Have to figure out how they are assigning 'me' to the character, but it at least gives me direction.
Slammer64 Posted January 19, 2013 Posted January 19, 2013 Look at the start of the script arelim, ref = me
gerra6 Posted January 19, 2013 Posted January 19, 2013 Thanks. The xLoversAdultPlayAfter script has a command me.StartConversation Player ... so that is probably the piece I was missing. Have to figure out how they are assigning 'me' to the character' date=' but it at least gives me direction. [/quote'] One thing that can be very helpful when attempting to track down references in complex mods is to use Wrye Bash to export all of the scripts and then use a text editor with a "find in files" string search option to track down every script that calls given function.
mem4ob4 Posted November 3, 2013 Posted November 3, 2013 Calling by UMIDWith LAPF released with UMIDs included, I wanted to be sure how best to make the calls. short myspecificpos ... let myspecificpos := xLoversCmnGetMotionNumberByUMID 100154 set xLoversQuest.SPos to myspecificpos ... Is this the proper way for a single specific animation call within the normal xLoversCmnIsReady calls?mem
WappyOne Posted November 4, 2013 Posted November 4, 2013 Calling by UMID With LAPF released with UMIDs included, I wanted to be sure how best to make the calls. short myspecificpos ... let myspecificpos := xLoversCmnGetMotionNumberByUMID 100154 set xLoversQuest.SPos to myspecificpos ... Is this the proper way for a single specific animation call within the normal xLoversCmnIsReady calls? mem Yes it is, mem. If you wanted to be extra careful you would check if myspecificpos was 0, meaning the user does not have installed the animation with the UMID you're looking for. In that case you could fall back to using the standard xLoversCmnGetRandomSPos function, or hardcoded SPos if you wanted to then assume they were using v2/v3 anim set.
mem4ob4 Posted May 31, 2014 Posted May 31, 2014 Had another crazy idea and decided to see if I could do it. Create a plugin that could use more than one sex system without being 'Mastered' to them. So far a plugin, mastered only to oblivion.esm, with similar code as below has been working without a problem. Others may or may not find it interesting or useful but some may even find better ways. scn Externalsexscript short options short sLpkuse ; variables for using this specific sex system short sLwrs ref Lwpkready ref Lwpkclearall ref Lwpkstart ref Lwpkgetrndpos ref Lwpkquest ref rRapeMeV ref Lwpkumidconvert short sTssuse ; you could have specific shorts and refs for this system or re-use the ones above short sBSexuse ; you could have specific shorts and refs for this system or re-use the ones above ; variables if needed for local calculations etc. short ichk short myPos ; rOsex (offence actor reference) and rDsex (deffence actor reference) must be already set. ; this function is called from dialog script result after setting offender/defender to quest refvariables ; or any script after setting offender/defender to quest refvariables Begin Function {options} ; argument 'options' can be a numerical package of information. ; One example designed with LwPK in mind: ; 1000= what sex system to use. 100=gangrape. 10=nonconsentual. 1-5= grouptype, 6-9=other (prefered umid?) ; if options >= 1000 use sexsystem A else use sexsystem B or sexsystem C etc. ; set options to options%1000 to strip off that first digit. ; if options >= 100 (use a gangbang system ) ; set options to options%100 to strip off that first digit. ; if options >= 100 (designate the sex act as non-consentual ) ; set options to options%10 to strip off that first digit. ; you are now left with possible numbers 0 through 9 and can assign grouptype or specific calls. ; ; You can devise what ever system works best for your specific application ;-------------------------- ;Verify that the expected sex systems are or are not present. ; Not shown here but would be good to verify version numbers as well if available. ; also could adjust options variable to pick alternate if primary is not available ;-------------------------- if IsModLoaded "Lovers with PK.esm" == 0 ; its not loaded set sLpkuse to 0 set sLwrs to 0 else ; it is loaded set sLpkuse to 1 endif if IsModLoaded "TSS.esp" == 0 set sTssuse to 0 else set sTssuse to 1 endif if IsModLoaded "BarnysSexSystem.esp" == 0 set sBSexuse to 0 else set sBSexuse to 1 endif ;------------------ ; Determine what sex system to use and do it. ;-------------------- if options >= 3000 if sBSexuse == 0 ; we called for this specific sex system but it is not loaded. MessageEX "No sexsystem present. No actual intercourse will occur." ; call a fade routine etc. return else ; Make the calls needed... return endif elseif options >= 2000 if sTssuse == 0 ; we called for this specific sex system but it is not loaded. MessageEX "No sexsystem present. No actual intercourse will occur." ; call a fade routine etc. return else ; Make the calls needed... return endif elseif options >= 1000 if sLpkuse == 0 ; we called for this specific sex system but it is not loaded. MessageEX "No sexsystem present. No actual intercourse will occur." ; call a fade routine etc. return else set options to options%1000 ; strip the leading digit ;----------- ; set some local ref variables to the 'possibly' needed LwPK functions ;------------ set Lwpkready to GetFormFromMod "Lovers with PK.esm" "000823" set Lwpkclearall to GetFormFromMod "Lovers with PK.esm" "003140" set Lwpkstart to GetFormFromMod "Lovers with PK.esm" "000829" set Lwpkgetrndpos to GetFormFromMod "Lovers with PK.esm" "00083d" set Lwpkquest to GetFormFromMod "Lovers with PK.esm" "0015ac" set Lwpkumidconvert to GetFormFromMod "Lovers with PK.esm" "000831" ;---------- ; Example of preparing to use a different mod to use its functionality to call for sex) ;---------- if IsModLoaded "LoversRaperS.esp" ;----------- ; NOTE- RunScriptLine works with 'visible' variables like quest variables. ; so we store the reference or data in our quest variables ;----------- RunScriptLine "set MycentralQuest.sLwrsv to xLoversRaperSQuest.Version" if MycentralQuest.sLwrsv >= 1710 set rRapeMeV to GetFormFromMod "LoversRaperS.esp" "080000" if IsFormValid rRapeMeV ;------------ ; Note- we are setting this function to one of our own quest refvariables ;------------ set MycentralQuest.rWapRap to rRapeMeV set sLwrs to 1 else printC "info: did not get valid WappyOnes call for rape function" set sLwrs to 0 endif else printC "info: did not get valid WappyOnes call for rape function" set sLwrs to 0 endif endif ;---------- ; Start setting up to call LoverswPK with our information ; All variables that we pass will be quest variables ;----------- if 0 == Call Lwpkready MycentralQuest.rOsex MessageEX "Offender not ready for intercourse (LwPK says no)." return endif if 0 == Call Lwpkready MycentralQuest.rDsex MessageEX "Deffender not ready for intercourse (LwPK says no)." return endif Call Lwpkclearall ;clear LwPK variables for clean run if options >= 100 && sLwrs ; gangbangstyle using WappyOnes RaperS version 1.71 or higher Let ichk := call MycentralQuest.rWapRap MycentralQuest.rOsex MycentralQuest.rDsex 16503 0 if ichk == 0 ; the raperS function may return its own error messages but added one just in case. printC "WappyRapefuncDenied " endif else ; not doing a gangbang through another plugin so proceed with LwPK calls RunScriptLine "set xLoversQuest.Offence to MycentralQuest.rOsex" RunScriptLine "set xLoversQuest.Deffence to MycentralQuest.rDsex" set option to options%100 ;strip the data from the front ;--------------------- ; This section deals with the NudeFlag and consentual/nonconsentual flags ; There is references to what the flags are and how to use here on LL boards ; NOTE- we are passing actual numbers, not variables that hold numbers so quest ; variables not needed. ;--------------------- if options >= 10 ;nonconsentual RunScriptLine "set xLoversQuest.OffNudeFlag to 128" RunScriptLine "set xLoversQuest.DefNudeFlag to 128" else RunScriptLine "set xLoversQuest.OffNudeFlag to 0" RunScriptLine "set xLoversQuest.DefNudeFlag to 0" endif set options to options%10 ;------------ ; Tell LwPK what sposgroup, specific anim number, or umid we want ;------------ if options == 0 ; random from all groups. If 'Set Additional Animation Automatically' is ; set to ON then positions 1-200 else positions 1-9 Let myPos := Call Lwpkgetrndpos 11111 elseif options == 1 Let myPos := Call Lwpkgetrndpos 1 elseif options == 2 Let myPos := Call Lwpkgetrndpos 10 elseif options == 3 Let myPos := Call Lwpkgetrndpos 100 elseif options == 4 Let myPos := Call Lwpkgetrndpos 100 elseif options == 5 Let myPos := Call Lwpkgetrndpos 10000 elseif options == 6 Set myPos to 165 ; example favoured bj by direct anim number ; can error if there is no 165 elseif options == 7 Let myPos := Call Lwpkumidconvert 100058 ; example favoured umid if myPos <= 0 ; if no anim with umid 100058 just pick randomly Let myPos := Call Lwpkgetrndpos 11111 endif else Let myPos := Call SomeOtherFunctionToCheckArraysOrWhatEverAndReturnAPositionNumber endif set MycentralQuest.iTemp3 to myPos ; set it to a quest variable RunScriptLine "Set xLoversQuest.sPos to MycentralQuest.iTemp3" Call Lwpkstart ;tell LwPK to actually start sex endif return endif else ; options variable did not tell us what system to use endif End ;---------------------------------------------------------------------------------------------------------------------------------------- scn MycentralQuestscript ref rOsex ref rDsex ref rSexcounter ref rWhateverelseisneeded short iTemp short iTemp2 short iTemp3 ;etc... etc... begin GameMode ;startups, cycle clocks etc. etc. if IsModLoaded "Lovers with PK.esm" ;------------ ; LoversWpk uses tokens to keep track of a lot of info ; This one is the number of times the player has had sex ; There are tokens for how many times raped or raped someone else etc. ; Always work with the esm, not the esp. ;------------ set rSexcounter to GetFormFromMod "Lovers with PK.esm" "000800" set sRuningcount to Player.GetItemCount rSexcounter else ; use a different method to keep track if needed set sRuningcount to 0 endif ;Other code End Thanks to the LL community, Mem
Killzone250 Posted June 2, 2014 Posted June 2, 2014 having a problem with some script Calling lovers animations via dialogue Call xlHookerStartWork GetSelf 3 0 1 0startconversation player xLoversAdultPlayAfterConv00 The animations play fine the first time, and the conversation starts correctly after the animation finishes. The problem comes when you go to play the animations a second time. The conversation starts as the defender is doing her animations while still clothed by herself. The animation then proceeds normally, without the end conversation once finished. Leaving and reentering the cell overcomes this, so does going through a different menu to call the same script. Not sure whats going on. Any help would be appreciated. Edit NVM, worked it out, myself..only took me 7 hours !!!. Add xLoversAdultPlayAfterItem and the script calls the convo and removes the token. And the answer was in the posts above...should have came here sooner...
emo877 Posted August 27, 2014 Posted August 27, 2014 Maybe it's obvious, but i just discovered.. using function HasMagicEffect with four-letter-effect-id, such as DGHE,in plugin what does not have oblivion.esm as MASTER, produces run-time errors ("Could not create function context for function script"), and, hence, script does not work properly -- because without mastering to vanila (or other possible sources defining such magic effects) compiled script has zeroes instead of proper magic effect ids (for example, DGHE has id 00001865).And naturally, Construction Set allows to save such script without any warning.Also, some of magic effects (DISE) are not defined in oblivion.esm - and their ids remain "00000000" so far.
movomo Posted August 27, 2014 Posted August 27, 2014 Maybe it's obvious, but i just discovered.. using function HasMagicEffect with four-letter-effect-id, such as DGHE, in plugin what does not have oblivion.esm as MASTER, produces run-time errors ("Could not create function context for function script"), and, hence, script does not work properly -- because without mastering to vanila (or other possible sources defining such magic effects) compiled script has zeroes instead of proper magic effect ids (for example, DGHE has id 00001865). And naturally, Construction Set allows to save such script without any warning. Also, some of magic effects (DISE) are not defined in oblivion.esm - and their ids remain "00000000" so far. If so, try a workaround. You can convert a string meID to a long integer code, from there you should be able to check if it exists in the actor's active effects list. This should work. Or, have you tried CSE instead of CS?
emo877 Posted August 28, 2014 Posted August 28, 2014 Thanks for good advice. Yesterday i've learned more about obse functions, dealing with four-letter ids and their numeric equivalents, so it seems doable for me.In other hand, mentioned mod is just my tweak of tamagoBreak (i tried to add more harmful factors), so for now i trade with myself to add oblivion.esm as master.(No, i had not used CSE before; but now i'm looking at it (@nexus) and possibly will try)
mem4ob4 Posted August 28, 2014 Posted August 28, 2014 Good instructions on CSE installing by fejeena at this post-> Here
Fienyx Posted September 3, 2014 Posted September 3, 2014 Good instructions on CSE installing by fejeena at this post-> Here IMHO, Her instructions should be pinned in the tech support. Very helpful. Also, how would I go about making a percent chance of something happening? I'm trying to alter aphrodisia so that if the lust goes between a certain percent, it will have a chance to trigger masturbation, if it goes higher, trigger rape, and if the PC is enslaved and the lust is high enough, to trigger rape me.
WappyOne Posted September 3, 2014 Posted September 3, 2014 Also, how would I go about making a percent chance of something happening? I'm trying to alter aphrodisia so that if the lust goes between a certain percent, it will have a chance to trigger masturbation, if it goes higher, trigger rape, and if the PC is enslaved and the lust is high enough, to trigger rape me.if ( GetRandomPercent < 60 ) ; 60% chance of happening. endif Note that GetRandomPercent returns 0-99, so use < instead of <= to check GetRandomPercent or <= 0 will pass 1% of the time.
Fienyx Posted September 3, 2014 Posted September 3, 2014 Thanks Wappy. Hopefully I can get this to work. Fingers crossed OK, Having some Issues. Here is what I have so far... scn AphrodisiaActions Short State ref SexualDesire Short CheckEnslaved ref PlayerEnslaved ref RapeMe ref Rape ref JerkIt Begin GameMode set SexualDesire to xLoversAphrodisiaSettingScript set PlayerEnslaved to IchPlayerSlaveQuestScript set CheckEnslaved to 1 set RapeMe to xLoversRaperSMeSpellScript set Rape to xLoversRaperSInitRape set JerkIt to xLoversMB2SpellSelfSC GetRandomPercent If PlayerEnslaved == 1 && SexualDesire >= 76 && GetRandomPercent <80 set RapeMe to 1 elseif PlayerEnslaved == 0 && SexualDesire >= 76 && GetRandomPercent <80 set Rape to 1 elseif PlayerEnslaved == 0 && SexualDesire >=65 && SexualDesire <=75 && GetRandomPercent <30 set JerkIt to 1 endif end It compiled, but how do I get the random percent to check every few seconds once sexual desire is over 65?
mem4ob4 Posted September 4, 2014 Posted September 4, 2014 @fienyxAny info you use from another plugin, it is best to make sure the plugin is actually loaded first.Then set the info you want to your own variables. Otherwise you will have to 'Master' each pluginto your modified plugin (not something you want to be in the habit of doing except for Lovers with PK.esm).You might check post#60 above for some examples of doing this.WappyOne has provided a specific function for external calls to his system with a lot of control for you.Info in the included readme.
Fienyx Posted September 4, 2014 Posted September 4, 2014 Ok. I just started scripting, and most of what I have learned was from looking at other scripts. The only one that would really be optional here would be PSE. That looks really advanced...... my eyes got lost.
WappyOne Posted September 4, 2014 Posted September 4, 2014 scn AphrodisiaActions Short CheckEnslaved Begin GameMode set PlayerEnslaved to IchPlayerSlaveQuestScript GetRandomPercent If PlayerEnslaved == 1 && SexualDesire >= 76 && GetRandomPercent <80 set RapeMe to 1 [...] end It compiled, but how do I get the random percent to check every few seconds once sexual desire is over 65? Okay, this is entirely wrong. It compiles but it totally meaningless code. You are comparing a script reference as if it were a variable contained within the quest script. A little surprised it isn't outright crashing Oblivion. You have two options for what you are trying to accomplish: 1) Use PSE as a Master. This means loading it in CSE at the same time as your plugin. Then you can change the if to: If IchSlaveQuest.PlayerEnslaved == 1 && [Same thing for aphro script].SexualDesire >= 76 && GetRandomPercent < 80 2) Without mastering PSE, find it with OBSE, assign it's quest to a reference and use it that way: ref rIchSlaveQuest set rIchSlaveQuest to GetFormFromMOD "PlayerSlaveEncounters.esp" "01B017" if eval ( GetVariable rTmp "PlayerEnslave" == 1 && GetVariable rAphroQuestName.SexualDesire >= 76 && GetRandomPercent < 80 The first method is much simpler, but restricts your addon to requiring PSE be installed or it won't even load.The second method is a little more complex, but can function with or without PSE ( Though the above will need an additional check to see if GetFormFromMOD succeeded ). Also you don't need to declare GetRandomPercent on it's own line before using. It is a function, not a variable. As for checking every few seconds, that will happen automaticaly with any quest script in a Begin GameMode block. The default is run the script every 5 seconds, you can change that with the fQuestDelay variable.
Fienyx Posted September 4, 2014 Posted September 4, 2014 Thank you wappy, will give the second a go so people who don't use PSE can enjoy this too.
mem4ob4 Posted September 4, 2014 Posted September 4, 2014 fienyx: in case you have not bookmarked it yet- http://cs.elderscrolls.com/index.php?title=Main_Page
Fienyx Posted September 4, 2014 Posted September 4, 2014 OK, well, this is where I must stop for the night. My MS is kicking up real bad and my eyeballs feel like they could explode. it won't let me use set me to getself Here's what I have now scn AphrodisiaActions Short State ref rxLoversAphrodisiaMain ref rIchSlaveQuest ref rxLoversRapersInitRape ref rRapist ref rVictim ref tar ref me ref rxLoversMB2SpellSelf Begin GameMode set rxLoversAphrodisiaMain to GetFormFromMOD "LoversAphrodisia.esp" "000ED5" set rIchSlaveQuest to GetFormFromMOD "PlayerSlaveEncounters.esp" "01B018" set rxLoversRapersInitRape to GetFormFromMOD "LoversRaperS.esp" "080000" set tar to player set me to getself set rxLoversMB2SpellSelf to GetFormFromMOD "LoversMB2.esp" "004C62" If eval ( GetVariable rTmp "PlayerEnslave" == 1 && GetVariable rxLoversAphrodisiaMain.aphrodisiaLv >= 76 && GetRandomPercent < 85 set rRapist to tar set rVictim to me set rxLoversRapersInitRape to 1 elseIf eval ( GetVariable rTmp "PlayerEnslave" == 0 && GetVariable rxLoversAphrodisiaMain.aphrodisiaLv >= 76 && GetRandomPercent < 85 set rRapist to me set rVictim to tar set rxLoversRapersInitRape to 1 elseIf eval ( GetVariable rTmp "PlayerEnslave" == 0 && GetVariable rxLoversAphrodisiaMain.aphrodisiaLv >=65 && GetVariable rxLoversAphrodisiaMain.aphrodisiaLv <=75 && GetRandomPercent <35 set rxLoversMB2SpellSelf to 1 endif end
WappyOne Posted September 4, 2014 Posted September 4, 2014 OK, well, this is where I must stop for the night. My MS is kicking up real bad and my eyeballs feel like they could explode. it won't let me use set me to getself Here's what I have now scn AphrodisiaActions Short State ref rxLoversAphrodisiaMain ref rIchSlaveQuest ref rxLoversRapersInitRape ref rRapist ref rVictim ref tar ref me ref rxLoversMB2SpellSelf Begin GameMode set rxLoversAphrodisiaMain to GetFormFromMOD "LoversAphrodisia.esp" "000ED5" set rIchSlaveQuest to GetFormFromMOD "PlayerSlaveEncounters.esp" "01B018" set rxLoversRapersInitRape to GetFormFromMOD "LoversRaperS.esp" "080000" set tar to player set me to getself set rxLoversMB2SpellSelf to GetFormFromMOD "LoversMB2.esp" "004C62" If eval ( GetVariable rTmp "PlayerEnslave" == 1 && GetVariable rxLoversAphrodisiaMain.aphrodisiaLv >= 76 && GetRandomPercent < 85 set rRapist to tar set rVictim to me set rxLoversRapersInitRape to 1 elseIf eval ( GetVariable rTmp "PlayerEnslave" == 0 && GetVariable rxLoversAphrodisiaMain.aphrodisiaLv >= 76 && GetRandomPercent < 85 set rRapist to me set rVictim to tar set rxLoversRapersInitRape to 1 elseIf eval ( GetVariable rTmp "PlayerEnslave" == 0 && GetVariable rxLoversAphrodisiaMain.aphrodisiaLv >=65 && GetVariable rxLoversAphrodisiaMain.aphrodisiaLv <=75 && GetRandomPercent <35 set rxLoversMB2SpellSelf to 1 endif end set me to GetSelf only has meaning if you are running the script as a magic effect (me set to target of spell) or an item (me set to container/actor holding the item). Has no meaning in a quest script, which I assume this is. Before the if I'd suggest the following to simplify working with/without PSE: short bEnslaved if ( IsFormValid rIchSlaveQuest ) set bEnslaved to GetVariable rIchSlaveQuest "PlayerEnslaved" else set bEnslaved to 0 endifSo if PSE is found, bEnslaved is 0/1 based on the PlayerEnslaved variable, otherwise always set to 0. Changes your first if statement to: If eval ( bEnslaved == 1 && GetVariable rxLoversAphrodisiaMain "aphrodisiaLv" >= 76 && GetRandomPercent < 85 ) GetVariable rxLoversAphrodisiaMain.aphrodisiaLv was wrong, references don't act directly like pointers from other languages, you can only use [questname].[variable] directly, not [reftoquest].[variable]. That level of indirection is what GetVariable is for.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now