|
Post by m0nomer on Dec 21, 2017 22:55:00 GMT
Hello! First off, huge thanks for this tutorial series, it's been amazing not only for the project I want to make but also just for my comprehension of coding practices.
I've been running into an issue with the Jobs prefabs (specifically their stats): I originally ran the jobs parser using the default values from the tutorial for stats, and saved the prefabs, and all was well. Along the way, I changed the stats to new values, ran the parser again, and saved the project. For that working session, everything worked as expected, but every time I close Unity and re-open, the stats in the Jobs prefabs revert to their original values.
Any ideas on what I could have borked here? For context, the only changes I've made so far as changing stats values in the excel sheets/.CSVs, and commenting out some stats in StatTypes that I'm not using in my updated damage calculations/ability system.
using UnityEngine;
using System.Collections;
public enum StatTypes
{
LVL, // Level
EXP, // Experience
HP, // Hit Points
MHP, // Max Hit Points
//MP, // Magic Points //starting off without MP/using cooldowns
//MMP, // Max Magic Points
ATK, // Physical Attack
DEF, // Physical Defense
MAG, //All-encompassing magic stat
//MAT, // Magic Attack
//MDF, // Magic Defense
EVD, // Evade
RES, // Status Resistance
SPD, // Speed
MOV, // Move Range
JMP, // Jump Height
CTR, // Counter - for turn order
Count
}
|
|
|
Post by Admin on Dec 21, 2017 23:47:44 GMT
I'm always glad to hear that. It's amazing to me that this project is still popular after so long.
Saving the project should be enough to persist the settings on the prefabs between sessions. You could create a new simple project to prove that for yourself, and if necessary slowly rebuild up to your current project until you spot the issue - but that could take awhile. I would also make sure that the changes to the spread sheets were properly saved just in case you used the post processing trick to make Unity reload if it detects a change in the source file. Also, when you create the jobs prefabs, make sure you are not in play mode, because when you exit playmode, the prefab values get reverted (If I remember right).
|
|
|
Post by m0nomer on Dec 22, 2017 22:07:49 GMT
Thanks; I'll do some sanity checks to see what the breaking point is. And you are correct about play mode AFAIK; I've been making all these changes/parsing them outside of play mode. Thanks for the reply though!
|
|
|
Post by m0nomer on Jan 29, 2018 7:04:48 GMT
FYI, adding a line to mark the Job object as dirty after modifying it in JobParser seemed to fix it. Maybe I missed a similar line in the example code? In any case, problem is solved now, without any negative repercussions as far as I can tell.
|
|
|
Post by Admin on Jan 29, 2018 14:55:29 GMT
I'm glad its finally working for you! I think I missed adding that dirty flag in my code, so actually I'm not sure why my code DID work while everyone else's code is failing.
|
|