Lot of Questions.

User avatar
MaximilienLoGiudice
Posts: 35
Joined: Thu Dec 08, 2016 12:50 am

Re: Lot of Questions.

Postby MaximilienLoGiudice » Wed Dec 21, 2016 2:07 pm

Thank you so much ! You Rock !

it work !

For other points :

1. hunger stat not decrease. ( i ask your help please, i dont understand )

2. have you tryed in my project to delete in the characterwindows the stats and try to generate them with StatcollectionUI ? I had to create manually. It work , just want to understand why they dont generate like in your example in my project.

3. i still have the currency in inventory windows that show if i open inventory then loot. i see my currency inside inventory windows that not fade off. ( i know i can fix it with alphagroup ). But trying to understand too.


Thanks you very much for all :))))

User avatar
jjahuijbregts
Site Admin
Posts: 1747
Joined: Wed Apr 22, 2015 7:25 pm
Contact:

Re: Lot of Questions.

Postby jjahuijbregts » Thu Dec 22, 2016 11:59 am

MaximilienLoGiudice wrote:Thank you so much ! You Rock !

it work !

For other points :

1. hunger stat not decrease. ( i ask your help please, i dont understand )

2. have you tryed in my project to delete in the characterwindows the stats and try to generate them with StatcollectionUI ? I had to create manually. It work , just want to understand why they dont generate like in your example in my project.

3. i still have the currency in inventory windows that show if i open inventory then loot. i see my currency inside inventory windows that not fade off. ( i know i can fix it with alphagroup ). But trying to understand too.


Thanks you very much for all :))))


Your hunger doesn't decrease as the method only runs once. To run it endlessly loop it like so:

Code: Select all

    // Work only for 1 point. (from 80 to 79 at start)
    protected IEnumerator DegradeHungerOverTime()
    {
        while (true)
        {
            yield return new WaitForSeconds(1f);

            // Decrease hunger by 1 every second. This will auto. repaint any UI that displays this stat.
            _hunger.ChangeCurrentValueRaw(-1f);
            Debug.Log(_hunger.currentValue);
        }
    }


The UIStatCollectionUI wasn't repainting because of a UIWIndow bug. Fixed and available in the next update :)

Not sure about the currency in the window, looking into that :)

User avatar
MaximilienLoGiudice
Posts: 35
Joined: Thu Dec 08, 2016 12:50 am

Re: Lot of Questions.

Postby MaximilienLoGiudice » Thu Dec 22, 2016 9:20 pm

:) :) :) :) :) :)

thank you so much Devdog ! It work ! I did it for thirst too.
just need to apply UFPS states like i did for my boots, and create some food and drink that can raise stats ;)))

I m very happy.

Thanks for you patience with me.

User avatar
MaximilienLoGiudice
Posts: 35
Joined: Thu Dec 08, 2016 12:50 am

Re: Lot of Questions.

Postby MaximilienLoGiudice » Mon Dec 26, 2016 12:54 pm

Hi DevDog.

Some questions :

1. Any news for currency show bug ?

2. for the collider and safe zone , it works now , i used other.transform.parent.GetComponent<Player>();

3. I have an InfoBox that pop a small windows with items indications. Sometimes, this windows dont disappear on mouse out. I have to right click to make it off. How can i do to make this windows disappear when nothing on cursor please ?
I have exactly the same thing with my Trigger UI windows, sometimes i have cursor with F key and small hand that show and never disappear. I would like to make it dissapear after a short time if nothing on muse cursor.

4. i tryed to make my enemy loot something when he dies. I attached Lootable Object script + Trigger + TriggerHandler. But nothing, when enemy die, his corpse is there and stay for 60sec, but i cant loot it, the trigger doesnt work when my cursor is on mob.
I have others lootable ojects in my game like cases or potions that works correctly. I tryed with a simple cube, i attach , selectable object info and a trigger + trigger handker and that work. I dont understand why not on my enemy. Something is interfering. I think about the raycast. But not sure how i can fix this. At least, if Trigger dont work on enemy, how can i make ennemy spawn a loot when he die ?

5. When i die with a weapon already equiped, i have to put the weapon from slot to inventory then equip it again to make it works. I want to know if its possible to unequip weapons when player respwan.

Thank you for help.

User avatar
jjahuijbregts
Site Admin
Posts: 1747
Joined: Wed Apr 22, 2015 7:25 pm
Contact:

Re: Lot of Questions.

Postby jjahuijbregts » Wed Jan 04, 2017 11:08 am

MaximilienLoGiudice wrote:Hi DevDog.

Some questions :

1. Any news for currency show bug ?

2. for the collider and safe zone , it works now , i used other.transform.parent.GetComponent<Player>();

3. I have an InfoBox that pop a small windows with items indications. Sometimes, this windows dont disappear on mouse out. I have to right click to make it off. How can i do to make this windows disappear when nothing on cursor please ?
I have exactly the same thing with my Trigger UI windows, sometimes i have cursor with F key and small hand that show and never disappear. I would like to make it dissapear after a short time if nothing on muse cursor.

4. i tryed to make my enemy loot something when he dies. I attached Lootable Object script + Trigger + TriggerHandler. But nothing, when enemy die, his corpse is there and stay for 60sec, but i cant loot it, the trigger doesnt work when my cursor is on mob.
I have others lootable ojects in my game like cases or potions that works correctly. I tryed with a simple cube, i attach , selectable object info and a trigger + trigger handker and that work. I dont understand why not on my enemy. Something is interfering. I think about the raycast. But not sure how i can fix this. At least, if Trigger dont work on enemy, how can i make ennemy spawn a loot when he die ?

5. When i die with a weapon already equiped, i have to put the weapon from slot to inventory then equip it again to make it works. I want to know if its possible to unequip weapons when player respwan.

Thank you for help.


1. Still looking, but I can't replicate the issue.

2. Nice :)

3. This should hide auto. do you have the same issue in the demo scene? Also wasn't able to replicate this.

4. These components have a dependency on one another. Make sure to first add the Trigger, then the LootableObject, then the input handler.

5. This isn't built-in, but you could use a UFPS event / callback to call unequip / equip methods.

User avatar
MaximilienLoGiudice
Posts: 35
Joined: Thu Dec 08, 2016 12:50 am

Re: Lot of Questions.

Postby MaximilienLoGiudice » Mon Jan 09, 2017 11:31 pm

Hi Devdog.

1. _
2. _
3. it work on demo scene. i m still trying to find what i did wrong. :(
4. I did it, i have the right trigger and triggerHandler, i think its because of colliders on ragdoll corpse. ( how can i do to have a collider on the dead corpse ? There is already lot of colliders on each part of the body but trigger seems not working with these parts)
5. ok , thank you. i will try with callback.
6. I want to setup a shield, each 10 shield points i want to add 100 to Max HP. So i have :

Code: Select all

void Awake()
    {
        if (m_Player == null)
        {
            m_Player = transform.GetComponent<vp_FPPlayerEventHandler>();
        }

        vp_LocalPlayer.Health = 50;

        var stats = PlayerManager.instance.currentPlayer.inventoryPlayer.stats;

        _shield = stats.Get("Default", "Shield");
        _health = stats.Get("Default", "Health");

        initialShieldValue = _shield.currentValue;
        initialHealthValue = _health.currentValue;
        initialHealthValueUFPS = vp_LocalPlayer.Health;

        oldShieldValue = initialShieldValue;
    }
void OnMessage_ShieldStatChanged(float f)
{
if (f >= 20)
        {
            Debug.Log("ARMORED ! armor = 20+");
            vp_LocalPlayer.MaxHealth = 200;
            vp_LocalPlayer.Health = _health.currentValue;
            _health.SetMaxValueRaw(200, false, true);
            Debug.Log("MaxHealth : " + _health.currentMaxValue);
            Debug.Log("MaxHealthUFPS : " + vp_LocalPlayer.MaxHealth);
            Debug.Log("Health : " + _health.currentValue);     
          }
}


and when i use :

Code: Select all

 _health.ChangeMaxValueRaw(200, true, true);


Debug.Log give me the right Value, but my slider Max Value stay at 100 and the Max Value message ({0}/{1}) stay at 100 too. That should repaint automatically ? How can i change that please ?

7. I have asked some questions on QuestSystemPro Forum but not sure you have seen the reply on my post.

Thanks for your help.

User avatar
jjahuijbregts
Site Admin
Posts: 1747
Joined: Wed Apr 22, 2015 7:25 pm
Contact:

Re: Lot of Questions.

Postby jjahuijbregts » Wed Jan 11, 2017 12:51 pm

MaximilienLoGiudice wrote:Hi Devdog.

1. _
2. _
3. it work on demo scene. i m still trying to find what i did wrong. :(
4. I did it, i have the right trigger and triggerHandler, i think its because of colliders on ragdoll corpse. ( how can i do to have a collider on the dead corpse ? There is already lot of colliders on each part of the body but trigger seems not working with these parts)
5. ok , thank you. i will try with callback.
6. I want to setup a shield, each 10 shield points i want to add 100 to Max HP. So i have :


4. Add a large capsule around the entire body for interactions. This can be a trigger to avoid it messing with the ragdol.
6. The code seems correct to me, how did you set up the stats? Are you using a StatUI component, or are you displaying it in the CharacterUI component?

User avatar
MaximilienLoGiudice
Posts: 35
Joined: Thu Dec 08, 2016 12:50 am

Re: Lot of Questions.

Postby MaximilienLoGiudice » Thu Jan 12, 2017 7:39 am

Hi Devdog.

Thx for reply.

4. i will try today.
5. I dont want to equip or unequip in UFPS. When my player respawn (VP_Player Respawner) i would like to clear Inventory Slots and put the items in inventory.
6. Both ( none is updating ) I have PlayerInfoBox and Character Windows. I also use a script that update health stat from vp_hud. It work well.
I dont understand because both update when i m hit or when i drink potion , it dont work when i set MaxHealth.

I have my other post in quest system pro forum with some questions. Can you please look at it ?
I know i have lot of questions, but i m alone and i m beginner :oops: My post is named : "Dialogues + quests and some others questions."

Thank you for your help.

User avatar
MaximilienLoGiudice
Posts: 35
Joined: Thu Dec 08, 2016 12:50 am

Re: Lot of Questions.

Postby MaximilienLoGiudice » Tue Jan 17, 2017 3:33 pm

Hello Devdog.

Any news about my questions please ?

thank you.

best regards.

User avatar
MaximilienLoGiudice
Posts: 35
Joined: Thu Dec 08, 2016 12:50 am

Re: Lot of Questions.

Postby MaximilienLoGiudice » Wed Jan 18, 2017 3:22 pm

4. still trying.
5. Is there a way to enequip slot by code ?
6. My health stat doesnt update when i set Max health. ( i use statUI 2x , once in player infobox and other in character Windows)
I tryed by code and i also tryed with an item created in the editor.

Code: Select all

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Devdog.General;
using Devdog.InventoryPro;

public class MyMaxhealthPotion : InventoryItemBase
{
    public AudioClip potion;
    AudioSource myAudio;

    private IStat _health;

    private float initialHealthValueUFPS;


    public override LinkedList<ItemInfoRow[]> GetInfo()
    {
        var basic = base.GetInfo();

        //basic.AddAfter(basic.First, new InfoBoxUI.Row[]{
        //    new InfoBoxUI.Row("Restore health", restoreHealth.ToString(), Color.green, Color.green),
        //    new InfoBoxUI.Row("Restore mana", restoreMana.ToString(), Color.green, Color.green)
        //});

        return basic;
    }

    public override void NotifyItemUsed(uint amount, bool alsoNotifyCollection)
    {
        base.NotifyItemUsed(amount, alsoNotifyCollection);

        PlayerManager.instance.currentPlayer.inventoryPlayer.stats.SetAll(stats);
    }

    public override int Use()
    {
        int used = base.Use();
        if (used < 0) // Whoops! Anything below 0 is a failed action.
            return used;

        if (currentStackSize <= 0)
            return -2;
        // Do something specific...


        //  Your potion code...
        myAudio = GameObject.Find("Gringan").GetComponent<AudioSource>();
        myAudio.PlayOneShot(potion, 1F);
        Debug.Log("Potion Used !");

        //updating UFPS Health

        var stats = PlayerManager.instance.currentPlayer.inventoryPlayer.stats;

        _health = stats.Get("Default", "Health");

        initialHealthValueUFPS = vp_LocalPlayer.Health;

        vp_LocalPlayer.MaxHealth+= 10;
        vp_LocalPlayer.Health = _health.currentValue;
        _health.SetMaxValueRaw(_health.currentMaxValue+10, false, true);
        Debug.Log("Initial Health UFPS: " + initialHealthValueUFPS);
        Debug.Log("Max Health IPro : " + _health.currentMaxValue);
        Debug.Log("Max Health UFPS : " + vp_LocalPlayer.MaxHealth);
        Debug.Log("Current Health Ipro: " + _health.currentValue);
        Debug.Log("Current Health UFPS: " + vp_LocalPlayer.Health);


        // Do something with item
        currentStackSize--; // Remove 1



        NotifyItemUsed(1, true);
        return 1; // 1, the item was used, but no items were used (stack decrease) in the process

    }
}


The debug logs show corrects values but the stats doesnt update , my UI still show Max health 50/100 and not 50 /110.

Please how can i fix this ?

Thanks.


Return to “UFPS”

Who is online

Users browsing this forum: No registered users and 1 guest