Jump to content

Inventory detection HALP!


RngrHawk

Recommended Posts

Hey guys, I have a slight problem. I am new to modding and I am on a quest to make my first mod on the GECK. I don't know if I can find and answer here but it's the biggest modding community ever so why not try right? :tongue:

 

So my problem is that I don't know how to make the game detect non-quest items (For a quest) in the players inventory without a specific trigger (Like talking to an NPC or stepping into a specific area). Do I have to use a script or can I do it somewhere in the Quest section like "Quest Objectives" or maybe "Quest Stages" or even "Topics"? Is it even possible?D: And if yes then PLEASE explainplzplzplz! I've been bothered with this for 2 days now and I cannot find an answer anywhere and I feel like I dug through the whole internet...

 

[if someone doesn't understand my problem or wants a further explanation, here it comes]

Lets say I have a quest where I have to kill some nightstalkers for their blood thingy. I need 10 of it. I shot em up, got the blood in my inventory - now I need the game to just check my inventory for the blood and set the next stage of the quest which is going back to the NPC for my reward.

 

And please, tell me this is something more advanced, because if this was in front of me all the time then I'll throw my PC out the window... xd

Link to comment
Share on other sites

Quest script:

 

BEGIN GAMEMODE
if player.GetItemCount NightstalkerBlood >= 10
SetStage MyQuestName 10
endif
END

Pseudo code, but you get the idea. You could do other stuff if you use NVSE, but that should be sufficient.

 

Not sure where you're at with the mod, but a quest script is a specific type of script (when you make a script, you need to select the type as Quest as opposed to object or effect). Then in the Quest main window there's a dropdown to select scripts of type Quest.

 

You'll need to make a stage of the number you set in the script, and put in the result script the objectives and messages etc, possibly advancing to the next stage.

Link to comment
Share on other sites

Oh man this is gonna be step by step harder and harder aint it? :tongue: I've got another problem. Well few actually - Is it possible to turn the items you pick up (Required for the quest) into quest items (So that you cannot drop them) or just into items that cannot be dropped? Unless there is a way to set the stage of the quest back to the previous one if you have dropped the items, so instead of telling you to go back to the NPC, it tells you to get those items again.

 

Also how can I add more than one item type? Do I just need to make another If statement below this one or is it possible to add other items into this if statement?

 

I've tried a few things and I cannot get to it... :sad:

Edited by marekto98
Link to comment
Share on other sites

You can set the quest item status in geck, but if you want to be able to change it during the game (like only have it quest item at certain times) you'll need NVSE function: http://geck.bethsoft.com/index.php?title=SetQuestItem

 

I don't follow the question... if you wanted to check the counts of two items you could do

if player.GetItemCount item1 >= 10 && player.getitemcount item2 >= 10

If you only want the code to run during certain times, you can wrap it in additional conditions, like

If GetStage yourquestname == 10

endif
Link to comment
Share on other sites

Ah yes, this is what I ment! Also I know about the GetStage part, already used it :D Thanks again mate! Really helpful stuff :smile: My mistake, I've used AND instead of &&:P

 

Although the NVSE function, I do have NVSE installed and working but how do I make it work in GECK? Just like a normal type of script?

Edited by marekto98
Link to comment
Share on other sites

Oh, apparently the multiple item script doesnt work?D: I've done this:

if player.GetItemCount item1 >= 20 && player.getitemcount item2 >= 15 && player.getitemcount item3 >= 10

It only reads the first item (Also I did specify the right items in item1, item2, item3 dwxD)

 

NVM! Turns out I just needed to refresh the quest!

Edited by marekto98
Link to comment
Share on other sites

Sorry to bother this forum so much about this :D I've done something like this and I'm not sure if it's even close?

1. This is an Object script and I tried adding it to the NightStalkerBlood item seperate to the quest script that I've done (btw I'm using other items and other quest names etc. on the forum than I am using in the GECK, dont wanna give anything out:P)

SCN QuestName
BEGIN OnAdd Player
if getstage QuestName == 10
if getstage QuestName == 20
setquestitem 1 NightStalkerBlood
endif
endif
END

2. I've also tried this and adding it to the quest instead of adding it to the item

SCN QuestScript
begin gamemode
if getstage QuestName == 10
if getstage QuestName == 20
if player.getitemcount PreWarMoney >= 50 && player.getitemcount NightStalkerBlood >= 25 && player.getitemcount BobbyPin >= 15
setquestitem 1 PreWarMoney
setquestitem 1 NightStalkerBlood
setquestitem 1 BobbyPin
endif
endif
if player.getitemcount PreWarMoney >= 50 && player.getitemcount NightStalkerBlood >= 25 && player.getitemcount BobbyPin >= 15
setstage QuestName 20
endif
endif
END

3. I have also tried another way for the quest.

SCN QuestScript
begin gamemode
if getstage QuestName == 10
if getstage QuestName == 20
if player.getitemcount PreWarMoney >= 50
setquestitem 1 PreWarMoney
endif
if player.getitemcount NightStalkerBlood >= 25
setquestitem 1 NightStalkerBlood
endif
if player.getitemcount BobbyPin >= 15
setquestitem 1 BobbyPin
endif
endif
endif
if player.getitemcount PreWarMoney >= 50 && player.getitemcount NightStalkerBlood >= 25 && player.getitemcount BobbyPin >= 15
setstage QuestName 20
endif
endif
END

Non of them report any problems with the script after I save and non of them work in game, the only part that works is the one with the setstage QuestName 20, so after I get the items (50 money, 25 blood and 15 pins) the quest progresses from stage 10 to stage 20. I still can't figure out how to add the SetQuestItem to the scriptD: (Im now running NVSE on GECK)

Edited by marekto98
Link to comment
Share on other sites

  • Recently Browsing   0 members

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