- Joined
- Dec 11, 2014
- Messages
- 93
So I was looking at a few different guides and tutorials on how to create a custom AI for games, and I really want to make my own little mini campaign in Reforged for my friend and I to play. The only problem is I am a complete novice when it comes to AI scripts and a lot of the guides that I'm pulling from are older and are using things like Jasscraft and such that I can't find current versions of just looking around (Unless I'm totally blind and missed it somehow but I didn't see anything searching here for the latest version of it either)
I ended up trying to mull through it and ended up with the following attached code. The only thing is I don't know why it won't properly function, like what exactly I am doing wrong or what error there is in the code.
I wrote it using TESH in the editor but then it kept giving me a bunch of errors because I didn't realize TESH used the same functions to launch the game and such so there were duplicate mains and stuff (Like I said, I am VERY new to this LOL) so I decided to just copy and paste it into a notepad file instead and import it into my game, then use the triggers to run it.
Except when I try to do that and my game starts it just orders all of the wisps to gather lumber and doesn't do anything else. I know it can be super particular in the spacing and ordering and commands of everything so it is VERY possible I missed something super simple or perhaps it's not working because I wrote it in TESH (and the example script was done in jasscraft I believe) and because I put it in notepad it doesn't recognize the constants or something?
I'm so noobish at this so any help would be so so appreciated everyone, thank you.
NOTE: I also attached the triggers I'm using in game to launch/activate the AI in case the problem is there as well (the gold and lumber triggers are just your standard "if the AI gets low, give them more!")
EDIT: Please see my reply for the updated code and screenshots of triggers to launch it if you wish to help, thanks! ((It's still not functioning))
I ended up trying to mull through it and ended up with the following attached code. The only thing is I don't know why it won't properly function, like what exactly I am doing wrong or what error there is in the code.
I wrote it using TESH in the editor but then it kept giving me a bunch of errors because I didn't realize TESH used the same functions to launch the game and such so there were duplicate mains and stuff (Like I said, I am VERY new to this LOL) so I decided to just copy and paste it into a notepad file instead and import it into my game, then use the triggers to run it.
Except when I try to do that and my game starts it just orders all of the wisps to gather lumber and doesn't do anything else. I know it can be super particular in the spacing and ordering and commands of everything so it is VERY possible I missed something super simple or perhaps it's not working because I wrote it in TESH (and the example script was done in jasscraft I believe) and because I put it in notepad it doesn't recognize the constants or something?
I'm so noobish at this so any help would be so so appreciated everyone, thank you.
NOTE: I also attached the triggers I'm using in game to launch/activate the AI in case the problem is there as well (the gold and lumber triggers are just your standard "if the AI gets low, give them more!")
EDIT: Please see my reply for the updated code and screenshots of triggers to launch it if you wish to help, thanks! ((It's still not functioning))
Last edited: