• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Help understanding AI and creating custom Scripts

Status
Not open for further replies.
Level 6
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))
 
Last edited:
Level 6
Joined
Dec 11, 2014
Messages
93
I gave VSCode a shot and I seen the extension, though I don't fully understand how to utilize it. I also tried to reference some other AI files from Blizz to base my code around that for a better understanding but it still isn't properly functioning.

I made a few modifications to the script since last time as well as the way it runs in the game to see if any of that would fix it but it still just does nothing... :/

Added the new script and screenshots for reference.
 

Attachments

  • Testscript.ai
    3.6 KB · Views: 14
  • Pic1.png
    Pic1.png
    41.4 KB · Views: 22
  • Pic2.png
    Pic2.png
    41.3 KB · Views: 19
  • Pic3.png
    Pic3.png
    40.8 KB · Views: 21
  • Pic4.png
    Pic4.png
    45.3 KB · Views: 22
  • Pic5.png
    Pic5.png
    44.6 KB · Views: 22
Level 6
Joined
Dec 11, 2014
Messages
93
Oh my gosh... Like I said this was my first try and I'm a total noob. THANK YOU SO MUCH FOR NOTICING THIS. I don't even know how many times I poured over this and I can't believe I missed it EVERY. SINGLE. TIME. Lol thank you thank you so much! :goblin_jawdrop:😅
 
Level 6
Joined
Dec 11, 2014
Messages
93
Hello,

I just checked your script. There is a small typo here. Remove one comma and it works fine.

Have fun,

View attachment 397381
By the way, what program were you using to look at the code there? It definitely looks a lot neater than just relying on notepad and seems like finding any mistakes would be easier there, too. It kinda looks like what I've seen from Jasscraft but I have -not- for the life of me found a latest version of Jasscraft that I can get to work for me LOL.
 
Level 6
Joined
Dec 11, 2014
Messages
93
It's Jasscraft, yes.

I don't know if it's the last version, but I downloaded it from here: {Important thread} JASScraft??
It's good enough for my own uses.
Omg thank you thank you THANK YOU I had such a hard time finding the latest version, but I mean if this version works I don't even care because it makes it 100% easier to write any kind of script so THANK YOU SO MUCH AGAIN AHHHHH
 
Omg thank you thank you THANK YOU I had such a hard time finding the latest version, but I mean if this version works I don't even care because it makes it 100% easier to write any kind of script so THANK YOU SO MUCH AGAIN AHHHHH
I don't know jass or vjass well at all, but vscodes extensions coupled with triggerhappy's extension gives you access to nearly every wc3 native there is. I use it for lua, rather than jass or vjass
 
Status
Not open for further replies.
Top