Re: ORK integration
Posted: Fri Mar 01, 2019 7:52 pm
Oops, sorry, I thought we were in the Dialogue System section. Please check the Quest Machine Extras page. I just put the updated package there.
Support and discussion forum for Pixel Crushers products
https://www.pixelcrushers.com:443/phpbb/
https://www.pixelcrushers.com:443/phpbb/viewtopic.php?t=1178
Have you tried putting ORKExpRewardSystem first? If you put ORKCurrencyRewardSystem first, it will use up all the points, leaving none for ORKExpRewardSystem.
Set the action's Completion Conditions > Required Value. This value now specifies the minimum even if the NPC finds only 1. For example, the action below will always require at least 3, even if the NPC only sees 1:
Code: Select all
// Copyright © Pixel Crushers. All rights reserved.
using UnityEngine;
namespace PixelCrushers.QuestMachine.ORKSupport
{
/// <summary>
/// Gives currency to the ORK player equal to the point value of the quest.
/// </summary>
[AddComponentMenu("Pixel Crushers/Quest Machine/Third Party/ORK Framework/Generator/ORK Item Reward System")]
public class ORKItemRewardSystem : RewardSystem
{
public StringField itemName = new StringField();
public override int DetermineReward(int points, Quest quest, EntityType entityType)
{
var bodyText = BodyTextQuestContent.CreateInstance<BodyTextQuestContent>();
bodyText.bodyText = new StringField(points + " " + itemName);
quest.offerContentList.Add(bodyText);
var itemAction = ORKItemQuestAction.CreateInstance<ORKItemQuestAction>();
itemAction.usePlayer = true;
itemAction.operation = ORKAddRemoveOperation.Add;
itemAction.quantity = new QuestNumber(points);
itemAction.itemName = new StringField(itemName);
var successInfo = quest.GetStateInfo(QuestState.Successful);
successInfo.actionList.Add(itemAction);
return 0;
}
}
}
Code: Select all
itemAction.quantity = new QuestNumber(points);
Code: Select all
itemAction.quantity = new QuestNumber(1);
Code: Select all
using UnityEngine;
namespace PixelCrushers.QuestMachine.ORKSupport
{
/// <summary>
/// Gives currency to the ORK player equal to the point value of the quest.
/// </summary>
[AddComponentMenu("Pixel Crushers/Quest Machine/Third Party/ORK Framework/Generator/ORK Item Reward System")]
public class ORKItemRewardSystem : RewardSystem
{
public StringField itemName = new StringField();
private int itemPoints = 1;
public override int DetermineReward(int points, Quest quest, EntityType entityType)
{
var bodyText = BodyTextQuestContent.CreateInstance<BodyTextQuestContent>();
bodyText.bodyText = new StringField(itemPoints + " " + itemName);
quest.offerContentList.Add(bodyText);
var itemAction = ORKItemQuestAction.CreateInstance<ORKItemQuestAction>();
itemAction.usePlayer = true;
itemAction.operation = ORKAddRemoveOperation.Add;
itemAction.quantity = new QuestNumber(itemPoints);
itemAction.itemName = new StringField(itemName);
var successInfo = quest.GetStateInfo(QuestState.Successful);
successInfo.actionList.Add(itemAction);
return 0;
}
}
}