Problem converting AI to use table instead of variables.


I’ve been following the Making Game Ready AI tutorial and following episode 8 Ian made some changes to incorporate the data table across the project. I’ve attempted to update my own project using the data table but I’m getting a strange behaviour where the AI starts with zero on all stats and dies after a few seconds of running.

At first I thought this might be because I have missed pins on the ‘make struct’ function but looking though my blueprints all of these functions have their pins joined to break struct functions.

I am able to add new stats to the data table and these are added to the list on widget so I know I’ve correctly added the GameState with the StatNames variable. There are also default values for the stats in the data table and in the CurrentStatValues array in the AI_Character BP.

Any idea why my AI is starting is zero on stats? Any help would be greatly appreciated.

Some of the changes Ian made were talked about at the end of episode 9 @ 48 mins ( but it seems quite a lot was missed out.

BPS below.

AI_Character BP

GetStatNames function in AI_Character BP

StatTickDown function in AI_Character BP

GameState BP

StatBar Widget BP

StatBlock Widget BP

Data Table

GoodFoodClass BP