Unable to see I have the footcream?

  1. Started game
  2. Got Foot Cream quest from enemy
  3. Click on that enemy again

footcreamError4OnGameDev

footcreamError5OnGameDev

Note: cleared console before hitting next
4. Click Next


footcreamError7OnGameDev

Note: cleared console before hitting that close X
5. Close dialogue
6. Pickup that footcream Pickup
Note: cleared console before
7. Click on that enemy again
footcreamError8OnGameDev
footcreamError9OnGameDev

Note: cleared console
8. Click next
footcreamError10OnGameDev
footcreamError11OnGameDev

Pic of Inventory

footcreamError12OnGameDev

Well… as you can see I have been spinning my wheels a lot…

Why does the ‘I have the foot Cream’ NOT show up ???

Embarrassed to say how many tries…

Here is the dialogue

Thanks for helping me track this down

Hi Steve,
Conditions are probably the hardest thing in our entire RPG course series to debug. Part of it is relying on strings for parameters, something that’s a necessary evil.

You’ve done a good job laying out debugs for this. It looks like some of the system is working, as it appears you’re getting a true or false for the Condition HasQuest(Mother Hubbars Son). Without that working, you’d never see I’m Already On The Case.

Can you post your Inventory’s Evaluate method? This might help to see what’s going on.

Sure.

Sometime today I hope to remember my flow for my designer step by step for getting this done.

        public bool? Evaluate(PredicateEnum predicate, string[] parameters)
        {
            //Debug.Log($"Evaluate the Inventory.cs: {predicate}");
            switch (predicate)
            {
                case PredicateEnum.HasInventoryItem:
                    Debug.Log($"Evaluate the Inventory.cs: {parameters[0]}");
                    Debug.Log($"HasItem is: {HasItem(InventoryItem.GetFromID(parameters[0]))}");
                    return HasItem(InventoryItem.GetFromID(parameters[0]));
                case PredicateEnum.HasInventoryItems:
                    Debug.Log($"Evaluate the Inventory.cs: {parameters[0]}");
                    Debug.Log($"HasItem is: {HasItem(InventoryItem.GetFromID(parameters[0]))}");
                    int quantity = 0;
                    if(int.TryParse(parameters[1], out quantity))
                    {
                        Debug.Log($"quantity = {quantity}");
                    }
                    int slot;
                    InventoryItem item = InventoryItem.GetFromID(parameters[0]);
                    if (HasItem(item, out slot))
                    {
                        if(GetNumberInSlot(slot) < int.Parse(parameters[1]))
                        {
                            return false;
                        }
                    }
                    else
                    {
                        return false;
                    }
                    return true;
            }

            return null;
        }
    public enum PredicateEnum
    {
        None,
        HasQuest,
        HasInventoryItem,
        HasInventoryItems,
        CompletedQuest
    }

Is this bad practice?

Three enums in one file

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace RPG.Core
{
    public enum PredicateEnum
    {
        None,
        HasQuest,
        HasInventoryItem,
        HasInventoryItems,
        CompletedQuest
    }
    public enum ActionEnum
    {
        None,
        Attack,
        TestObjective,
        GiveQuest,
        GiveRewards,
        CompletedQuest
    }
    public enum ObjectivesEnum
    {
        None,
        FindFootCream,
        FindTheMasterKey,
        FindTheRedKey,
        FindTheBlueKey,
        FindSomething
    }
}

Actually, I do it all the time… I tend to keep related enums together in one file. MonoBehaviors and ScriptableObjects must be in a script with the same name as the class. Just about everything else is fair game.

I can’t see anything in the Evaluate that would return a false instead of a true… next step is to look at the Condition.cs itself.

I think I found the solution on the other thread.

I just do not get how to hook up our scripts in the unity editor at ALL!

i am guessed out for a while…
to frustrating for now…
i will be back after i am ready to do again! try again try again…
dang it…

If I could just see!!!@!@!!!@!
one or two examples

The way I saw it was SPREAD OUT way to much for me…
(not ONE complete example at ONE time)
gotta give credit to those fellow students who got it Congrats!

I will try again after I get smarter i guess
Thanks for your help Brian

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms