Item Collection Quest with Item Stacking

Fung

New Member
Reaction score
0
After reading 2 very informative tutorials on how to stack items and how to create an item collection quest I tried to merge the 2. First of all the item stacking works perfectly.

So I tried to create a separate trigger for the item stacking quest. The player (Fung) has to collect 10 (for testing I made it 2) banshee dust to complete the quest (3).

Code:
Finish Quest Us and Them
    Events
        Unit - A unit owned by Player 1 (Red) Acquires an item
    Conditions
        (Quest[3] is enabled) Equal to True
        (Item-type of (Item being manipulated)) Equal to Banshee Dust
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Charges remaining in (Item carried by Fung 0002 <gen> of type Banshee Dust)) Equal to 2
            Then - Actions
                Quest - Mark Quest[3] as Completed
                Game - Display to Player Group - Player 1 (Red) the text: Return the Banshee ...
            Else - Actions

Well this didn't work. So I emailed SFilip and asked for his help. He suggested I put it directly into his acquire trigger and it came out like this.

Code:
Acquire
    Events
        Unit - A unit Acquires an item
    Conditions
        (Owner of (Triggering unit)) Equal to Player 1 (Red)
        (Charges remaining in (Item being manipulated)) Not equal to 0
    Actions
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
                        (Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) Less than (Item level of (Item carried by (Hero manipulating item) in slot (Integer A)))
                        (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated))) Greater than (Item level of (Item being manipulated))
                            Then - Actions
                                Item - Set charges remaining in (Item being manipulated) to (((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated))) - (Item level of (Item being manipulated)))
                                Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to (Item level of (Item being manipulated))
                            Else - Actions
                                Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated)))
                                Item - Remove (Item being manipulated)
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Quest[3] is enabled) Equal to True
                (Item-type of (Item being manipulated)) Equal to Banshee Dust
                (Charges remaining in (Item carried by Fung 0002 <gen> of type Banshee Dust)) Equal to 2
            Then - Actions
                Quest - Mark Quest[3] as Completed
                Game - Display to Player Group - Player 1 (Red) the text: Return the Banshee ...
            Else - Actions

This didn't work either. I collect 2 dust and nothing happens. SFilip didn't know of a solution and suggested I post for help.

Any thoughts?
 

Exide

I am amazingly focused right now!
Reaction score
448
Try changing:

(Item carried by Fung 0002 <gen> of type Banshee Dust)

into

(Item carried by (Triggering unit) of type Banshee Dust)

If that doesn't work, undo your second trigger. (So that the stack - trigger is one trigger and the 'quest trigger' is another trigger. -Two triggers again.)
And then use an integer variable to count how many items the hero has.
For example:

Code:
Finish Quest Us and Them
    Events
        Unit - A unit owned by Player 1 (Red) Acquires an item
    Conditions
        (Quest[3] is enabled) Equal to True
        (Item-type of (Item being manipulated)) Equal to Banshee Dust
    Actions
        set Counter_Variable = (Counter_Variable + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                [COLOR="Red"]Counter_Variable is Greater than or equal to 2[/COLOR]
            Then - Actions
                Quest - Mark Quest[3] as Completed
                Game - Display to Player Group - Player 1 (Red) the text: Return the Banshee ...
            Else - Actions

That should do the trick.
Make sure the player can't drop and pick up the same item, though. Either that or have a trigger deduct the number of counts in 'Counter_Variable' for each charge in the item. (In order to prevent cheating.)
 

Fung

New Member
Reaction score
0
First suggestion didn't work.

Code:
Finish Quest Us and Them
    Events
        Unit - A unit owned by Player 1 (Red) Acquires an item
    Conditions
        (Quest[3] is enabled) Equal to True
        (Item-type of (Item being manipulated)) Equal to Banshee Dust
    Actions
        Set CountDust = (CountDust + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                CountDust Greater than or equal to 2
            Then - Actions
                Quest - Mark Quest[3] as Completed
                Game - Display to Player Group - Player 1 (Red) the text: Return the Banshee ...
            Else - Actions

This is somewhat working. Whenever I pickup a single dust the quest is marked complete. Just to clarify "CountDust" is an integer variable with an initial value of 0.
 

Exide

I am amazingly focused right now!
Reaction score
448
Try setting it in a 'Map Init' trigger to 0, and/or change:

Code:
            If - Conditions
                CountDust Greater than or equal to 2

into

Code:
            If - Conditions
                CountDust Greater than or equal to 3

and see if that works.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
you could make your dust item into a stacking item by useing charges, then check if it has 2 charges in the condition..
 

Fung

New Member
Reaction score
0
Try setting it in a 'Map Init' trigger to 0, and/or change:

Code:
            If - Conditions
                CountDust Greater than or equal to 2

into

Code:
            If - Conditions
                CountDust Greater than or equal to 3

and see if that works.

I tried both options, same result. Once I pickup a single dust the quest gets marked complete.
 

Exide

I am amazingly focused right now!
Reaction score
448
Try disabling the charge-stack-trigger, and playtest again.

Try increasing the value of the condition and see if it works.
 

Exide

I am amazingly focused right now!
Reaction score
448
Nah.
Just make the Quest-item non-stackable.
Or make them dissapear from the unit as soon as you pick it up. -And have a message Display: 1/2 items found.. 2/2 items found..
 

Fung

New Member
Reaction score
0
you could make your dust item into a stacking item by useing charges, then check if it has 2 charges in the condition..

I tried your item charge system and it has the same result as SFilip's stacking system. Once I pickup the item it completes the quest.

I rather the player see the items in their inventory then receive status updates. Guess I just need to keep trying new things.

Exide said:
Just make the Quest-item non-stackable.

Where is this done?
 

Exide

I am amazingly focused right now!
Reaction score
448
Remove the charges from the item, in Object Editor.
 

Fung

New Member
Reaction score
0
Remove the charges from the item, in Object Editor.

Interesting. Doing this and enabling either the charge or item stacking trigger doesn't complete the quest when I aquire 1 dust, but it also doesn't stack the item.
 

Fung

New Member
Reaction score
0
I got it to work.

Code:
Finish Quest Us and Them
    Events
        Unit - A unit owned by Player 1 (Red) Acquires an item
    Conditions
        (Quest[3] is enabled) Equal to True
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Charges remaining in (Item carried by (Triggering unit) of type Banshee Dust)) Greater than or equal to 2
            Then - Actions
                Quest - Mark Quest[3] as Completed
                Game - Display to Player Group - Player 1 (Red) the text: Return the Banshee ...
            Else - Actions

Using this and SFilip's stacking system. However I need to do some modifying so the messages stop after collecting 2 dust and the trigger fires off in case the player drops the dusts.
 

dragonhord

Knowledge is true opinion. - Plato
Reaction score
82
If you try to make the item unstackable than you can just base it off an entirely different item... It would be fairly simple that way, adding an integer and removing an integer each time an item is grabbed or dropped... But if you want to maintain charges in order to help with inventory space you could always check whether or not the player is dropping or picking up an item. Make sure the item is your dust that they are trying to get. Then every time they do it set a variable equal to the number of charges on the dust item they have... If the number of charges is equal to your quest condition than it should fire up a completed quest and you should be fine... If you need me to elaborate more I will... Haven't been on in a while so sorry about not responding prior...
 
General chit-chat
Help Users
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top