Have some errors on an inventory array with ES3

Discussion and help for Easy Save 3
Post Reply
ARK07
Posts: 4
Joined: Sat Sep 11, 2021 2:52 pm

Have some errors on an inventory array with ES3

Post by ARK07 »

6 Following errors:

Assets\Easy Save 3\Types\ES3UserType_InventoryP1.cs(19,102): error CS1026: ) expected
Assets\Easy Save 3\Types\ES3UserType_InventoryP1.cs(19,117): error CS0443: Syntax error; value expected
Assets\Easy Save 3\Types\ES3UserType_InventoryP1.cs(19,120): error CS1002: ; expected
Assets\Easy Save 3\Types\ES3UserType_InventoryP1.cs(19,120): error CS1513: } expected
Assets\Easy Save 3\Types\ES3UserType_InventoryP1.cs(33,62): error CS0443: Syntax error; value expected
Assets\Easy Save 3\Types\ES3UserType_InventoryP1.cs(33,65): error CS1525: Invalid expression term ')'

Script:

using System;
using UnityEngine;

namespace ES3Types
{
[UnityEngine.Scripting.Preserve]
[ES3PropertiesAttribute("slots", "invUIP1", "InvUI1")]
public class ES3UserType_InventoryP1 : ES3ComponentType
{
public static ES3Type Instance = null;

public ES3UserType_InventoryP1() : base(typeof(InventoryP1)){ Instance = this; priority = 1;}


protected override void WriteComponent(object obj, ES3Writer writer)
{
var instance = (InventoryP1)obj;

writer.WriteProperty("slots", instance.slots, ES3Internal.ES3TypeMgr.GetES3Type(typeof(InventoryP1+InventorySlot[])));
writer.WritePrivateFieldByRef("invUIP1", instance);
writer.WriteProperty("InvUI1", instance.InvUI1, ES3Type_GameObjectArray.Instance);
}

protected override void ReadComponent<T>(ES3Reader reader, object obj)
{
var instance = (InventoryP1)obj;
foreach(string propertyName in reader.Properties)
{
switch(propertyName)
{

case "slots":
instance.slots = reader.Read<InventoryP1+InventorySlot[]>();
break;
case "invUIP1":
reader.SetPrivateField("invUIP1", reader.Read<InvUIP1>(), instance);
break;
case "InvUI1":
instance.InvUI1 = reader.Read<UnityEngine.GameObject[]>(ES3Type_GameObjectArray.Instance);
break;
default:
reader.Skip();
break;
}
}
}
}


public class ES3UserType_InventoryP1Array : ES3ArrayType
{
public static ES3Type Instance;

public ES3UserType_InventoryP1Array() : base(typeof(InventoryP1[]), ES3UserType_InventoryP1.Instance)
{
Instance = this;
}
}
}
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Have some errors on an inventory array with ES3

Post by Joel »

Hi there,

We don't appear to have had any reports of this. Please could you send me your InventoryP1 class so that I can replicate this at my end?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
ARK07
Posts: 4
Joined: Sat Sep 11, 2021 2:52 pm

Re: Have some errors on an inventory array with ES3

Post by ARK07 »

Here you go
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Have some errors on an inventory array with ES3

Post by Joel »

Thanks for sending that over, that helped me identify the issue. It looks like reflection wasn't recognising the nested type when it's part of a collection.

If you private message me your invoice number I'll send over an update to resolve this.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
ARK07
Posts: 4
Joined: Sat Sep 11, 2021 2:52 pm

Re: Have some errors on an inventory array with ES3

Post by ARK07 »

Thank you Joel for the incredibly fast response, where I can check/get my invoice number?

EDIT: Got it. ask didnt happen
Post Reply