change C# script during conversation
Posted: Wed Mar 31, 2021 12:24 pm
Hi Tony!
I hope I can explain this well! I managed to figure out how to get the achievement page to work, which is great. The problem I'm facing is getting the things that trigger during a conversation to apply to the new script that holds all the achievement information.
Here's an example of the achievement script I'm using. Where this basic setup would be applied for each achievement:
The thing is, I'm not sure what I'm doing wrong to get the coroutine to run during a conversation or at the end of a specific conversation. I went into the dialogue node that would trigger the achievement to go off, but when I attach the script to the On Execute() of the Scene-Independent Event area, the option to utilize the coroutine does not show up. Is it something in my script I need to look into, or am I trying to run it from the wrong place in the Dialogue System?
Thank you in advance <3
I hope I can explain this well! I managed to figure out how to get the achievement page to work, which is great. The problem I'm facing is getting the things that trigger during a conversation to apply to the new script that holds all the achievement information.
Here's an example of the achievement script I'm using. Where this basic setup would be applied for each achievement:
Code: Select all
using System.Collections;
using System.Collections.Generic;
using System.Security.Cryptography;
using UnityEngine;
using UnityEngine.UI;
public class AchievementHold : MonoBehaviour
{
//L1 Dead
public int L1Act;
public GameObject L1A;
public GameObject L1B;
public int L1Code;
public int L1Did;
void Start()
{
L1Code = PlayerPrefs.GetInt("L1");
L1Act = PlayerPrefs.GetInt("L1On");
if (L1Act == 1 && L1Code == 12345)
{
L1A.SetActive(true);
L1B.SetActive(false);
}
else L1A.SetActive(false);
L1B.SetActive(true);
}
IEnumerator L1go()
{
L1Code = 12345;
PlayerPrefs.SetInt("L1", L1Code);
L1Act = 1;
PlayerPrefs.SetInt("L1On", L1Act);
yield return new WaitForSeconds(1);
}
}
Thank you in advance <3