Question concerning how i should go about doing this

Post » Fri May 27, 2011 12:23 pm

I have this quest where this npc says in dialogue that she wants five grand soul gems enchanted with only a golden saint or an ascended sleeper how do i do this? Via script? b/c the item id's are the same for an enchanted soul gem as they are for a regular soul gem and if you enchant a soul gem she won't take the enchanted soul gems even though they have the same item id as a regular soul gem. Any thoughts? I noticed for one of the stronghold missions there is this script they used.

Begin StrongSoulCheckshort counter;in Greeting for HT_Stronghold (phase 1)Set "llunela hleran".hasSoul to 0Set counter to 0if ( Player->HasSoulGem "atronach_storm" > 1 )	Set counter to ( counter + 2 )elseif ( Player->HasSoulGem "atronach_storm" > 0 )	Set counter to ( counter + 1 )endifif ( Player->HasSoulGem "atronach_storm_summon" > 1 )	Set counter to ( counter + 2 )elseif ( Player->HasSoulGem "atronach_storm_summon" > 0 )	Set counter to ( counter + 1 )endifif ( Player->HasSoulGem "atronach_storm_ttmk" > 1 )	Set counter to ( counter + 2 )elseif ( Player->HasSoulGem "atronach_storm_ttmk" > 0 )	Set counter to ( counter + 1 )endifif ( Player->HasSoulGem "golden saint" > 1 )	Set counter to ( counter + 2 )elseif ( Player->HasSoulGem "golden saint" > 0 )	Set counter to ( counter + 1 )endifif ( Player->HasSoulGem "golden saint_summon" > 1 )	Set counter to ( counter + 2 )elseif ( Player->HasSoulGem "golden saint_summon" > 0 )	Set counter to ( counter + 1 )endifif ( Player->HasSoulGem "golden saint_staada" > 1 )	Set counter to ( counter + 2 )elseif ( Player->HasSoulGem "golden saint_staada" > 0 )	Set counter to ( counter + 1 )endifif ( Player->HasSoulGem "winged twilight" > 1 )	Set counter to ( counter + 2 )elseif ( Player->HasSoulGem "winged twilight" > 0 )	Set counter to ( counter + 1 )endifif ( Player->HasSoulGem "winged twilight_summon" > 1 )	Set counter to ( counter + 2 )elseif ( Player->HasSoulGem "winged twilight_summon" > 0 )	Set counter to ( counter + 1 )endifif ( Player->HasSoulGem "winged twilight_grunda_" > 1 )	Set counter to ( counter + 2 )elseif ( Player->HasSoulGem "winged twilight_grunda_" > 0 )	Set counter to ( counter + 1 )endifif ( counter > 1 )	Set "llunela hleran".hasSoul to 1endifStopScript StrongSoulCheckEnd


Begin StrongSoulRemove;called in dialogue for HT_Stronghold (phase 1)short counterSet counter to 2if ( counter > 0 )	if ( Player->HasSoulGem "atronach_storm" > 0 )		Player->RemoveSoulGem "atronach_storm" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "atronach_storm_summon" > 0 )		Player->RemoveSoulGem "atronach_storm_summon" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "atronach_storm_ttmk" > 0 )		Player->RemoveSoulGem "atronach_storm_ttmk" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "golden saint" > 0 )		Player->RemoveSoulGem "golden saint" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "golden saint_summon" > 0 )		Player->RemoveSoulGem "golden saint_summon" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "golden saint_staada" > 0 )		Player->RemoveSoulGem "golden saint_staada" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "winged twilight" > 0 )		Player->RemoveSoulGem "winged twilight" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "winged twilight_summon" > 0 )		Player->RemoveSoulGem "winged twilight_summon" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "winged twilight_grunda_" > 0 )		Player->RemoveSoulGem "winged twilight_grunda_" 1		Set counter to ( counter - 1 )	endifendif;do it all again...if ( counter > 0 )	if ( Player->HasSoulGem "atronach_storm" > 0 )		Player->RemoveSoulGem "atronach_storm" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "atronach_storm_summon" > 0 )		Player->RemoveSoulGem "atronach_storm_summon" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "atronach_storm_ttmk" > 0 )		Player->RemoveSoulGem "atronach_storm_ttmk" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "golden saint" > 0 )		Player->RemoveSoulGem "golden saint" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "golden saint_summon" > 0 )		Player->RemoveSoulGem "golden saint_summon" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "golden saint_staada" > 0 )		Player->RemoveSoulGem "golden saint_staada" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "winged twilight" > 0 )		Player->RemoveSoulGem "winged twilight" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "winged twilight_summon" > 0 )		Player->RemoveSoulGem "winged twilight_summon" 1		Set counter to ( counter - 1 )	endifendifif ( counter > 0 )	if ( Player->HasSoulGem "winged twilight_grunda_" > 0 )		Player->RemoveSoulGem "winged twilight_grunda_" 1		Set counter to ( counter - 1 )	endifendifStopScript StrongSoulRemoveEnd


I remember screwing around with this and couldn't figure it out b/c it didn't work when i tried to create my own script. I think part of the problem was how to activate the script. Targeted would work better here? but i remember trying that and for some reason it didn't work. I don't know why.
User avatar
Wayne W
 
Posts: 3482
Joined: Sun Jun 17, 2007 5:49 am

Post » Fri May 27, 2011 10:19 pm

Begin StrongSoulCheckshort counterSet "llunela hleran".hasSoul to 0Set counter to 0if ( Player->HasSoulGem "golden saint" > 4 )	Set counter to ( counter + 5 )elseif ( Player->HasSoulGem "golden saint" > 3 )	Set counter to ( counter + 4 )elseif ( Player->hassoulgem "golden saint" > 2 )                Set counter to ( counter + 3 )elseif ( player->hasSoulgem "golden saint" > 1 )                Set counter to ( counter + 2 )elseif ( player->hasSoulGem "golden saint" > 0 )                Set counter to ( counter + 1 )endifif ( Player->HasSoulGem "golden saint_summon" > 4 )	Set counter to ( counter + 5 )elseif ( Player->HasSoulGem "golden saint_summon" > 3 )	Set counter to ( counter + 4 )elseif ( Player->hassoulgem "golden saint_summon" > 2 )                Set counter to ( counter + 3 )elseif ( player->hasSoulgem "golden saint_summon" > 1 )                Set counter to ( counter + 2 )elseif ( player->hasSoulGem "golden saint_summon" > 0 )                Set counter to ( counter + 1 )endifif ( counter > 4 )	Set "llunela hleran".hasSoul to 1endifStopScript StrongSoulCheckEnd


ok i just did this for the golden saints but if i were to make my own script for what i wanted is this the right path?
User avatar
Sophie Payne
 
Posts: 3377
Joined: Thu Dec 07, 2006 6:49 am

Post » Fri May 27, 2011 9:44 am

OK, i got the strongsoulremove to work to where it actaully removes strong soulgems the problem is how to check via dialogue. I can start a targeted script but it's not that easy. The way i did it before was set a condition if misc_soulgem_grand was > 5 then this dialogue would pop up and if it's less than 5 then this dialogue poped up. Well that's only good for a plain grand soul gem. How would i go about doing this via dialogue to make it to where if I have more than 5 echanted grand soul gems dialogue A pops up and if i don't have all 5 dialogue B pops up? See what i'm saying? How would i go about doing this to set a condition via dialogue to check that, but the only real way to check to see if i have 5 grand soul gems enchanted is to do it via script. I got the scripts that's not the problem.
User avatar
lucile davignon
 
Posts: 3375
Joined: Thu Mar 22, 2007 10:40 pm

Post » Sat May 28, 2011 12:36 am

You just need the dialog variable for having the full gems?

You should be able to use: Local-> hasSoul = 1

(not sure that's the right name, I didn't look through all your scripts, but you get the idea)
User avatar
Mel E
 
Posts: 3354
Joined: Mon Apr 09, 2007 11:23 pm

Post » Fri May 27, 2011 5:53 pm

i was just experimenting and i first tried the dialogue variable counter but that didn't seem to work then i tried hasShoul and it seems to kind of work. This is the targeted script that i have to check to see if i have the grand sould gems.

Begin StrongSoulCheck27short counter Set "llunela hleran".hasSoul to 0 Set counter to 0 if ( Player->HasSoulGem "golden saint" > 4 ) 	Set counter to ( counter + 5 ) elseif ( Player->HasSoulGem "golden saint" > 3 ) 	Set counter to ( counter + 4 ) elseif ( Player->hassoulgem "golden saint" > 2 )	 Set counter to ( counter + 3 ) elseif ( player->hasSoulgem "golden saint" > 1 ) 	Set counter to ( counter + 2 ) elseif ( player->hasSoulGem "golden saint" > 0 ) 	Set counter to ( counter + 1 ) endif if ( Player->HasSoulGem "golden saint_summon" > 4 ) 	Set counter to ( counter + 5 ) elseif ( Player->HasSoulGem "golden saint_summon" > 3 ) 	Set counter to ( counter + 4 ) elseif ( Player->hassoulgem "golden saint_summon" > 2 ) 	Set counter to ( counter + 3 ) elseif ( player->hasSoulgem "golden saint_summon" > 1 ) 	Set counter to ( counter + 2 ) elseif ( player->hasSoulGem "golden saint_summon" > 0 ) 	Set counter to ( counter + 1 ) endif if ( counter > 4 ) 	Set "llunela hleran".hasSoul to 1 endif StopScript StrongSoulCheck27End


But for some reason it still works if i only have 2 soul gems enchanted with a golden saint, but i want it to where it should be 5. I'm kind of wondering is the original script for the stronghold telvanni mission screwing this up? b/c for that mission they only require 2 grand soul gems, or did i mess something up with the script i have above?
User avatar
Melly Angelic
 
Posts: 3461
Joined: Wed Aug 15, 2007 7:58 am

Post » Fri May 27, 2011 11:12 pm

After doing some trial and error i'm pretty sure that's whats happening here b/c it's the same exact script almost and what happens is if i only have 2 grand soul gems enchanted the local script for the telvanni stronghold kicks in and sets the hasSoul to 1 and thus activates the next set of dialogue. I'm also using the same npc as for the telvanni stronghold quest so that's probably what is going on here.

I was thinking a way around this since i was being really picky anyhow which creatures you can soul trap. I only had it where it was only golden saints but now i'm thinking if i make it only for ascended sleepers then it should work b/c for the original script they don't even check for an ascended sleeper soul trap so since the original script doesn't check for it i could use that for my script and that would be a way around it. Would that be a good idea? Plus, it would take some time to find 5 ascended sleepers to soul trap anyhow. I want to make it somewhat challenging and time consuming anyhow.
User avatar
electro_fantics
 
Posts: 3448
Joined: Fri Mar 30, 2007 11:50 pm

Post » Fri May 27, 2011 5:06 pm

ok after doing a little trial and error i think the best way for this to work is to set a global variable. I can't get the script to work though and i'm sure i don't have something correct. Here is what i got.

Begin StrongSoulCheck27short counter Set counter to 0 if ( Player->HasSoulGem "Ascended_sleeper" > 4 ) 	Set counter to ( counter + 5 ) elseif ( Player->HasSoulGem "Ascended_sleeper" > 3 ) 	Set counter to ( counter + 4 ) elseif ( Player->hassoulgem "Ascended_sleeper" > 2 )	 Set counter to ( counter + 3 ) elseif ( player->hasSoulgem "Ascended_sleeper" > 1 ) 	Set counter to ( counter + 2 ) elseif ( player->hasSoulGem "Ascended_sleeper" > 0 ) 	Set counter to ( counter + 1 ) endif  if ( counter > 4 ) 	Set hassoul27 to 1else if ( counter < 5 )	Set hassoul27 to 0endif endifEnd


Is it a no no to add the variable counter to a global script since so many local scripts use it to?

**edit**

I tried this and it didn't work either.

Begin StrongSoulCheck27If ( HasSoul27 < 1 )short counter Set counter to 0 	if ( Player->HasSoulGem "Ascended_sleeper" > 4 ) 		Set counter to ( counter + 5 ) 	elseif ( Player->HasSoulGem "Ascended_sleeper" > 3 ) 		Set counter to ( counter + 4 ) 	elseif ( Player->hassoulgem "Ascended_sleeper" > 2 )	 	Set counter to ( counter + 3 ) 	elseif ( player->hasSoulgem "Ascended_sleeper" > 1 ) 		Set counter to ( counter + 2 ) 	elseif ( player->hasSoulGem "Ascended_sleeper" > 0 ) 		Set counter to ( counter + 1 ) 			if ( counter > 4 ) 	              Set hassoul27 to 1                else if ( counter < 5 )	              Set hassoul27 to 0                endif                endif	endifendifEnd

User avatar
Franko AlVarado
 
Posts: 3473
Joined: Sun Nov 18, 2007 7:49 pm

Post » Fri May 27, 2011 2:16 pm

i got it to work with this

Begin StrongSoulCheck27If ( HasSoul27 < 1 )short counterSet counter to 0 	if ( Player->HasSoulGem "Ascended_sleeper" > 4 ) 		Set counter to ( counter + 5 ) 	elseif ( Player->HasSoulGem "Ascended_sleeper" > 3 ) 		Set counter to ( counter + 4 ) 	elseif ( Player->hassoulgem "Ascended_sleeper" > 2 )	 	Set counter to ( counter + 3 ) 	elseif ( player->hasSoulgem "Ascended_sleeper" > 1 ) 		Set counter to ( counter + 2 ) 	elseif ( player->hasSoulGem "Ascended_sleeper" > 0 ) 		Set counter to ( counter + 1 ) 	endifif ( counter > 4 ) 	Set hassoul27 to 1elseif ( counter < 5 )	 Set hassoul27 to 0endif endifEnd


I just added an endif after all the counters. I was going to stop the script via result box in the dialogue b/c i wanted to keep checking the player if he/she has the correct amount of soul gems ect. Is this ok?


**edit** There is a slight but where once the counter reaches 5 the global is set to 1 but doesn't go back to zero if a player takes the soul gems out of his inventory. The counter seems to keep track if a player does take the soul gems ouf of his/her iventory but once it reaches 5 it stops keeping track. Technically a player could cheat by putting all five in their inventory and then take them out before talking to Hleran. What am i doing wrong with the script to make it do that?
User avatar
Rachel Hall
 
Posts: 3396
Joined: Thu Jun 22, 2006 3:41 pm

Post » Fri May 27, 2011 12:09 pm

I am having a little difficulty following your plan.

First you write of checking for soul gems filled with souls of golden saints and ascended sleepers, but your latest scripts check for the latter only. This adjustment you seem to have made to accommodate another official script affecting Llunela Hleran that raises my next question. Are you attempting to alter the conditions of this official Telvanni stronghold quest? Is Llunela Hleran really the quest-giver in your (new) quest? Why is the name of your script a variation on this official script? Perhaps it is not necessary to know all the details of what you are trying to accomplish, but different circumstances may require different solutions.

**edit** There is a slight but where once the counter reaches 5 the global is set to 1 but doesn't go back to zero if a player takes the soul gems out of his inventory. The counter seems to keep track if a player does take the soul gems ouf of his/her iventory but once it reaches 5 it stops keeping track. Technically a player could cheat by putting all five in their inventory and then take them out before talking to Hleran. What am i doing wrong with the script to make it do that?

The reason the script does not update the variable HasSoul (I assume this is a global variable) after the player removes the soul gems is because the script processes only when the line if HasSoul27 < 1 is true. While very beneficial for the efficiency of your script it prevents later checks. You may have to sacrifice that line.

Another solution would be to perform the check only when the player is already in dialog with Llunela Hleran thereby preventing the player from removing the gems from inventory. Without knowing very much about what you are attempting I cannot be certain that this appropriate, but if viable you could launch the script global script that checks the player's inventory and updates the dialog flag from dialog results in the greeting. Something like this:

Greeting:


Filter [Journal: YourJournalIndex]: Have you harvested the souls I requested of you?
Results: StartScript "StrongSoulCheck27"

[This assumes that the quest topic is 'harvested the souls'. Certainly the dialog can be modified to include the actual quest topic in your situation.]

Topic: harvested the souls

Filter [Journal: YourJournalIndex]: Yes, %PCName. Do you have the five ascended sleeper souls I require?
Result: Choice "Yes, here they are." 2 "No, not yet."

Filter [Function: Choice = 1]: Speak with me when you have them.

Filter [Function: Choice = 2; Global: HasSoul27 = 0]: No, it does not appear that you have five ascended sleeper souls at this time. Speak with me when you have all of the souls.

Filter [Function: Choice = 2; Global: HasSoul27 >= 1]: Excellent. I will take those now, thank you.
Result: player->RemoveSoulGem "Ascended_sleeper" 5

The script launched in the greeting will update the global variable when the topic is first selected so it will be available as a filter when the player makes his/her choice.

I would suggest a change in your script that will make it more efficient still. Inventory checks are slow functions. Declare a variable to store the number of filled soul gems once each frame and then check the value of the variable. In fact is its current form there is no need to build a hierarchy as you have. That may be a relic of when you wanted to check both golden saint as well as ascended sleeper souls. If you are decided against that approach then your code can be much shorter.

Begin StrongSoulCheck27; Self-terminating global script started from dialog; short HasSoul27 ; global variableif ( player->HasSoulGem "Ascended_sleeper" >= 5 )    set hassoul27 to 1 ; dialog filterelse   set hassoul27 to 0 ; dialog filterendif StopScript "StrongSoulCheck27"End StrongSoulCheck27


This proposal has not been tested. If I have completely misinterpreted your intentions I hope that some of what I have shared might be helpful in fashioning a solution of your own.
User avatar
Genevieve
 
Posts: 3424
Joined: Sun Aug 13, 2006 4:22 pm

Post » Sat May 28, 2011 12:42 am

I am having a little difficulty following your plan.

First you write of checking for soul gems filled with souls of golden saints and ascended sleepers, but your latest scripts check for the latter only. This adjustment you seem to have made to accommodate another official script affecting Llunela Hleran that raises my next question. Are you attempting to alter the conditions of this official Telvanni stronghold quest? Is Llunela Hleran really the quest-giver in your (new) quest? Why is the name of your script a variation on this official script? Perhaps it is not necessary to know all the details of what you are trying to accomplish, but different circumstances may require different solutions.



Yea, at first it was to accommodate for the other script, but now that i created this global variable that's the work around from it screwing with the original script. I like the challenge of this quest so that's why i decided to make it only so that she only accepts ascended sleepers. I thought that was kind of cool. I was in no way shape or form intending on altering the original script. I like to keep all the original scripts, references, ect exactly as they are so i don't screw things up for other quests. And yea Llunela Hleran is the quest-giver for my quest as well as she is for the Telvanni stronghold quest. That's why i had to make a global variable. I also just named it similar b/c the scripts were similar.

Begin StrongSoulCheck27if ( player->HasSoulGem "Ascended_sleeper" >= 5 ) 	set hassoul27 to 1  else 	set hassoul27 to 0endif StopScript StrongSoulCheck27End StrongSoulCheck27 


This worked out just fine. I figured it was something as easy as this. I was trying to do something similar to what Bethesda did and it just got me screwed up. It probably would have worked fine to if the quest giver was different from the Telvanni Stronghold quest, but that wasn't the case. I was also activating the script via dialogue as a targeted script as you had suggested the reason as you stated it that the script i had wasn't really correct so it wasn't checking conditions like i wanted it to. Thanks for the help!
User avatar
Laura Hicks
 
Posts: 3395
Joined: Wed Jun 06, 2007 9:21 am

Post » Fri May 27, 2011 7:45 pm

Just as a quick comment, although it doesn't have much to do with anything now:

This
	if ( Player->HasSoulGem "Ascended_sleeper" > 4 ) 		Set counter to ( counter + 5 ) 	elseif ( Player->HasSoulGem "Ascended_sleeper" > 3 ) 		Set counter to ( counter + 4 ) 	elseif ( Player->hassoulgem "Ascended_sleeper" > 2 )	 	Set counter to ( counter + 3 ) 	elseif ( player->hasSoulgem "Ascended_sleeper" > 1 ) 		Set counter to ( counter + 2 ) 	elseif ( player->hasSoulGem "Ascended_sleeper" > 0 ) 		Set counter to ( counter + 1 ) 	endif

Is the same as


set counter to ( Player->HasSoulGem "Ascended_sleeper" )if ( counter > 5 )    set counter to 5endif


So if you wanted to ensure the player had 5 or more golden saint or ascended sleep soul gems

set counter to ( Player->HasSoulGem "Ascended_sleeper" )set counter to counter + ( Player->HasSoulGem "golden saint" )if ( counter > 5 )    ;do somethingendif

User avatar
Sophh
 
Posts: 3381
Joined: Tue Aug 08, 2006 11:58 pm


Return to III - Morrowind