- Home /
AI scripted by player
Hey guys,
I'm trying to implement a feature which was in Baldur's Gate. You could set a set of actions, with conditions.
Like "if I'm under 50% of health, take a potions ; else, if one of my teammates is under 50%, I cast this spell, else attack the closest enemy". The player can select conditions and their value from a UI and link it to an action.
I have an idea how to implement that, the hard way, hard coding each conditions, with the boolean and all, but do you guys think of a more elegant solution ? I thought about creating a string, build with the player input and than execute it on runtime, but I think it's not a good idea, security wise.
I couldn't find any ressources through google, maybe not knowing the right keywords. Need help !
Thanks :)
Your answer
![](https://koobas.hobune.stream/wayback/20220612193906im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How can i set up a 2d game for iphone/android. 2 Answers
iOS development on PC 1 Answer
Android Build Error. 1 Answer
Android app crash help 0 Answers