Jump to content

Quest reward not being added to player inventory player->additem


v3nture

Recommended Posts

So Ive moved onto quest making and Ive reached the end of path one of the first quest Im working on and I nothing I do adds the item needed to the players inventory and gold isnt removed from the players inventory. I've gone online and looked for syntax solutions but it doesnt matter what order I do. The "crystal shipment" misc item isnt being added to the players inventory and gold isnt being removed.

 

The player is hit with a greeting when they reached stage 40. A hyperlink for the topic "crystal shipment" appears and the player can click on it.

-issue one when the player does the hyperlink/topic is removed

The player is given two options, ask about the amount of the debt, or leave.

When the ask about the amount they are then asked if they wish to pay it off

The player pays it off. The gold is removed and the item is added.

The items are not removed, added and the journal isnt updated. Everything works up until here.

Any help would be appreciated.

N27eQLp.jpg

Edited by v3nture
Link to comment
Share on other sites

What I can see is that you misspelled vs_cystal_shipment journal identifier, it should be vs_crystal_shipment

if you remember to NOT save after doing it (as it messes with global variables), and just reload the mod after, the "Error Check Result" button should be able to catch such errors/write them to the bottom of your Warnings.txt

Edited by abot
Link to comment
Share on other sites

Sorry to double post but I have a few more questions. After trial and error I've reached a point were I need scripts running. The general idea behind this script is that when the player activates it theres 2 skill checks, they can pick it up, or leave it be.

Begin vs_kardryns_shipment

Short controlvar
Short button
Short INT
Short ALC
Short WIL
Short ALT


	If ( OnActivate == 1 )
		If ( controlvar == 0 )
			MessageBox "What would you like to do?", "INT: 75 ALCH: 50 APPRAISE.", "WIL: 50 ALT: 75 - APPRAISE.", "Pick up the crystal shipment.", "Close."
			set controlvar to 1
		endif

		if ( controlvar == 1 )
			set button to GetButtonPressed
			set INT to player-> getintelligence
			set ALC to player-> getalchemy

			if ( button == -1 )
				return

				elseif ( button == 0 )

					if ( INT >= 75 )
						if ( ALC >= 50 ) 
							MessageBox "The box of rocks worth is close to fifty-thousand drakes."
								else
									MessageBox "frig off randy"
					endif
				endif
			endif

			set INT to 0
			set ALC to 0
			Set controlvar to 0
			return

			endif
	endif

End 

At one point I had the script working-ish but it broke if the player had one skill meet the minimums. I no longer remember what I had to do that. (I should probably save them as copies.)

Edit: So Code now displays the skill check success messagebox but after closes me out and re activate it

Edited by v3nture
Link to comment
Share on other sites

Scripts do not work by chance, you have a lot of things to understand before being able to make a correct script. First thing is that OnActivate is true only for the one frame you activate the object, so the if ( controlvar == 1 ) part would never be executed.
You can find info and examples in MSFD
Second, you should indent code properly, it would make easier to find errors for you but especially for other people willing to help. To make formatting easier until you grasp it, you could use MWEdit to auto-indent code and check syntax or use ManaUser's online indenter

Edited by abot
Link to comment
Share on other sites

  • 2 weeks later...

I realized I posted the wrong script last night. Again thanks for the help it was useful and I've managed to setup a few scripts already. The issue right now is the forcegreeting doesnt work while the NPC is transformed. Otherwise works fine, I think.. Is it hardcoded to not talk to werewolves?

I did read this in MWSFE

 

 

If you want to detect the player activating an object, or even another werewolf, one method is to use an invisible door and place it over the object you want to detect the activation of.

Am I going to have to just script the npc to be stationary and spawn a door on it's x,y,z coords that the player activates instead? I did a test earlier to see if you could talk to werewolves and I put one as a creation and it seems to work?

Edit: It seems I can only add topics to creature werewolves and not greetings?

Edit: I realized the scamp script will probably help as a pointer.

edit: My workaround right now is to have a duplicate NPC in the cell handle the dialogue and despawn. Next question would be I know MWSE is it possible to open a dialogue window with a werewolf with it?

Begin FaralenTransform
	
	short AllowWerewolfForceGreeting
	short fightstart
	short doOnceA
	short doOnceB
	
	setfight 0
	
	if ( menumode == 1 ) ; if menu is open dont process 
		return 
	endif
	
	if ( fightstart == 3 )
		return
	endif
	
	if ( fightstart == 2 )
		ForceGreeting
		set fightstart to 3
	endif
	
	If ( GetDeadCount, "vs_Aenz_R1_HMelee1" == 1 )
		If ( GetDeadCount, "vs_Aenz_R1_HMelee2" == 1 )
			if ( fightstart == 1 )
				setfight 0
				set fightstart to 2
				;if ( "vs_Trevyn Faralen"->IsWerewolf == 1 )
				;endif
			endif
		endif
	endif
	
	if ( fightstart == 1 )
		if ( doOnceA == 0 )
			If ( GetDeadCount, "vs_Aenz_R1_HMelee2" == 0 )
				startcombat "vs_Aenz_R1_HMelee2"
				set doOnceA to 1
				setfight 0
			endif
		endif
		
		if ( doOnceB == 0 )
			If ( GetDeadCount, "vs_Aenz_R1_HMelee1" == 0 )
				"vs_Trevyn Faralen"->startcombat "vs_Aenz_R1_HMelee1"
				set doOnceB to 1
				setfight 0
			endif
		endif
	endif
	
	If ( player->GetPos X, <= -1400 )
		If ( player->GetPos X, >= -1900 )
			if ( player->GetPos Y, >= 4200 )
				set fightstart to 1
				;"vs_Trevyn Faralen"->BecomeWerewolf
				;"vs_Trevyn Faralen"->SetWerewolfAcrobatics
			endif
		endif
	endif
end
Edited by v3nture
Link to comment
Share on other sites

Sorry for the double post but Ive made some progress with my work around.

Begin FaralenTransform
    
    short AllowWerewolfForceGreeting
    short fightstart
    short doOnceA
    short doOnceB
    
    setfight 0
    
    if ( menumode == 1 ) ; if menu is open dont process
        return
    endif
    
    if ( fightstart == 3 )
        if ( GetJournalIndex "vs_Maybe They're Just Explorers..." == 30 )
            AiWander 0 0 0 0
            messagebox "set fightstart to 4"
            set fightstart to 4
        endif
    endif
    
    
    if ( fightstart == 2 )
        "vs_Trevyn Faralen"->AIFollow, player, 0, 0, 0, 0
        messagebox "ai follow 1"
        messagebox "set fightstart to 3"
        setfight 0
        set fightstart to 3
    endif
    
    if ( fightstart == 1 )
        If ( GetDeadCount, "vs_Aenz_R1_HMelee1" == 1 )
            If ( GetDeadCount, "vs_Aenz_R1_HMelee2" == 1 )
                setfight 0
                set fightstart to 2
                messagebox "set fightstart to 2"
            endif
        endif
    endif
    
    if ( fightstart == 1 )
        if ( doOnceA == 0 )
            If ( GetDeadCount, "vs_Aenz_R1_HMelee2" == 0 )
                startcombat "vs_Aenz_R1_HMelee2"
                set doOnceA to 1
                setfight 0
            endif
        endif
        
        if ( doOnceB == 0 )
            If ( GetDeadCount, "vs_Aenz_R1_HMelee1" == 0 )
                "vs_Trevyn Faralen"->startcombat "vs_Aenz_R1_HMelee1"
                set doOnceB to 1
                setfight 0
            endif
        endif
    endif
    
    If ( player->GetPos X, <= -1400 )
        If ( player->GetPos X, >= -1900 )
            if ( player->GetPos Y, >= 4200 )
                set fightstart to 1
                setfight 0
                "vs_Trevyn Faralen"->BecomeWerewolf
                "vs_Trevyn Faralen"->SetWerewolfAcrobatics
            endif
        endif
    endif
end 

edit

I added in the stopcombat command command. It works until the ai retriggers combat and then stops it again.

edit: I cant have NPC's attack certain werewolves. So am I right in saying iwerewolffightmod is controllable through MWSE? That is what controls hostility and is uncontrollable through scripts in the TES CS

https://mwse.readthedocs.io/en/latest/mwscript/GMSTs.html

begin vs_VampA_Passive
	
	short done
	short nolore
	short nohello
	short noflee
	short noidle
	short nointruder
	short nothief
	short doOnce
	short nofightFAR
	
	if ( nofightFAR == 1)
		stopcombat
	endif
	
	if ( "vs_Trevyn Faralen"->IsWerewolf == 1 ) ;DONT RUN IF FARALEN ISNT WEREWOLF  
		set nofightFar to 1
	endif 
	
	if ( doOnce == 4 )
		return
	endif
	
	if ( doOnce == 3 )
		ForceGreeting
		set doOnce to 4
	endif
	
	
	If ( GetDeadCount, "vs_Q1_Hunter_Melee" == 1 )
		If ( GetDeadCount, "vs_AenzIN_HRange_01" == 1 )
			if ( doOnce == 1 )
				ForceGreeting
				set doOnce to 2
			endif
		endif
	endif
	
	
	If ( GetDeadCount, "vs_Q1_Hunter_Melee" == 1 )
		If ( GetDeadCount, "vs_AenzIN_HRange_01" == 1 )
			if ( doOnce == 0 )
				If ( player->GetPos X, <= 100 ) 
					if ( player->GetPos Y, <= 3550 )
						set doOnce to 3
					endif
				endif
			endif
		endif
	endif
	
	
	If ( GetDeadCount, "vs_Q1_Hunter_Melee" != 1 )
		If ( GetDeadCount, "vs_AenzIN_HRange_01" != 1 )
			if ( doOnce == 0 )
				If ( player->GetPos X, <= 100 ) 
					if ( player->GetPos Y, <= 3550 )
						ForceGreeting
						set doOnce to 1
					endif
				endif
			endif
		endif
	endif
	
	
	if ( done == 0 )
		AddSpell, "Vampire Blood Aundae"	;this is the blood disease
		AddSpell, "Vampire Attributes"
		AddSpell, "Vampire Skills"
		AddSpell, "Vampire Immunities"
		AddSpell, "Vampire Sun Damage"
		AddSpell, "Vampire Touch"
		AddSpell, "Vampire Aundae Specials"
		ModRestoration 75
		set done to 1
		setfight 0
		
	endif
	
end Vampire_Aundae
Edited by v3nture
Link to comment
Share on other sites

Not sure if Im doing something wrong, but it's probably just a bug.

Begin vs_alpha_cliff_racer
	
	short doOnce
	short infCliff
	short deathIC
	float timer
	float timer2
	float timerAlpha
	
	if ( menumode == 1 )
		return
	endif
	
	if ( Cellchanged == 1 )
		return
	endif
	
	if ( GetJournalIndex "vs_Where's Jiub when you need him" == 0 )
		disable
	elseif ( GetJournalIndex "vs_Where's Jiub when you need him" == 30 )
		disable
	endif
	
	if ( infCliff == 3 )
		return
	endif
	
	If ( GetDeadCount, "vs_Alph_Cliff_Racer" >= 1 )  
		Journal "vs_Where's Jiub when you need him", 20
	endif 
	
	if ( GetJournalIndex "vs_Where's Jiub when you need him" == 10 )
		enable
		if ( infCliff == 2 )
			
			if ( menumode == 1 )
				return
			endif
			
			set timer to ( timer + GetSecondsPassed )
			set timer2 to ( timer2 + GetSecondsPassed )
			set timerAlpha to ( timerAlpha + GetSecondsPassed )
			
			if ( timerAlpha >= 60 )
				if ( doOnce == 0 )
					player->PlaceAtMe "vs_Alph_Cliff_Racer" 1, 2500, 1
					messagebox "kaw kaw mafk"
					startcombat, player
					set doOnce to 1
				endif
			endif
			
			if ( timer >= 8 )
				
				if ( timer2 <= 119 )
					if ( deathIC == 1 )
						player->PlaceAtMe "vs_cliff_racer" 1, 1500, 1
						player->PlaceAtMe "vs_cliff_racer" 1, 2000, 1
						player->PlaceAtMe "vs_cliff_racer" 1, 2500, 1
						startcombat, player
						set timer to 0
						messagebox "spawn 3 cliffracers"
					endif
				elseif ( timer2 >= 120 )
					set deathIC to 2
					set infCliff to 3
					return
				endif	
			endif
		endif
		
		if ( infCliff == 1 )
			player->PlaceAtMe "vs_cliff_racer" 1, 1500, 1
			player->PlaceAtMe "vs_cliff_racer" 1, 2000, 1
			player->PlaceAtMe "vs_cliff_racer" 1, 2500, 1
			set infCliff to 2
			messagebox "infcliff 1 set to 2"
		endif
		
		if ( onDeath == 1 )
			
			if ( deathC == 0 )
				set deathC to 1
				messagebox "deathc 1"
				
			elseif ( deathC == 1 )
				set deathC to 2
				messagebox "deathc 2"
				
			elseif ( deathC == 2 )
				set deathC to 3
				set deathIC to 1
				messagebox "deathc 3"
				set infCliff to 1
				
			endif
		endif
	endif
end

So, the issue is if the player holds only backwards it registers him as facing backwards so the cliff racers can spawn in front of the player. I feel like it's worth mentioning if someone else hasn't noticed it yet.

Edited by v3nture
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...