• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

JassCraft

Status
Not open for further replies.
Level 4
Joined
Apr 14, 2021
Messages
56
Hello, one year ago I started using JassCraft to make my own AI scripts. But I've encountered a few problems that were easily fixed. During that time I learned (heard) that JassCraft has two types of programming. The easy one and the hard one. Now, I've learned the easy side of JassCraft, but I'm desperate and commited to learn the hard side of JassCraft, because I heard it paves the way to much more availabilities and possibilities. I'm going to give you an example of what I mean by 'easy' and 'hard' by leaving two AI scripts so that you can better understand what I'm asking for. I've searched for tutorials, but unfortunately found none. I hope and I would really love it if someone can explain to me what is what and how I can comprehend the hard side of JassCraft. Once again, I'm desperate to learn it, even if what I heard about it giving more possibilities is false. Thanks in advance.
 

Attachments

  • easy ai script.ai
    4.6 KB · Views: 48
  • hard ai script.ai
    15.5 KB · Views: 46
Last edited:
I saw this earlier and then didn't have much of a helpful reply to give because for me the distinction between these two files seems fairly arbitrary. For best results, the way to manipulate these kinds of files is mostly to think of them as declared functions that call to each other. And you could optionally use functions to organize the code, or not, but the behavior of what it does is most likely going to end up the same in the end.

So, maybe it is because I have too much skill with the jass programming language that these are written in, but essentially the distinction here between these files was fairly arbitrary and so it's unclear to me how I could help you with that. You can use functions to organize your code, or not. That is really up to you. The Warcraft III engine will construct units based on whether you call the underlying native functions (or common.ai helper functions) to command the AI subsystem to build a particular build order. Both of these scripts do that. If you need to make a working AI script file, then you need to do that.

I had great success in the past by taking the melee AIs (elf.ai, human.ai, orc.ai, undead.ai, etc) and replacing the Unit IDs that they use so that they created units of my custom faction instead.

I would really love it if someone can explain to me what is what
So, to this point I don't know if I really answered your question here. But I think this is fairly involved and most likely probably none of us really know because there was never a guide from Blizzard in 2002-2003 when they created this system, so it is mostly left up to the user to intuit what things mean based on what they are doing. Yet, often they have intuitive names. So maybe I have not helped here much, but the way that I learned to use these AI files was through the Warcraft III World Editor by opening up the AI Editor module. In that module, a GUI can walk you through the process of creating one of these AI files automatically, and save your work as a .WAI file (World Editor AI) which has all of the GUI module settings and properties. If you are just getting started, I suggest using that. There is even a feature to test your AI script on any default melee map of your choice. Of course, on Reforged the fringe features like this might not work, but if you are already modding Warcraft III then you probably know well enough to stay away from the newer World Editor for the obscure fringe features like editing custom campaigns and AIs that were not a part of the focus of the efforts of Reforged. Regardless of that nonsense, I know that when I was a kid the AI Editor module was working well and fine and its test feature let me test the AIs that I was developing with a higher than normal speed, so I could have 2 AIs duke it out in warpspeed and easy get a sense for who was better.
Or you can test the game more slowly and carefully watch how your AI behaves.

My advice is that once you do that for a while, and become familiar with the annoying AI editor bugs -- because there were bugs with that GUI even back in the 2000s -- then you will start to see why it is easier to edit the .ai scripts directly instead once you are very accustomed to how these systems work. At that point, the quickest way to make an AI is probably to rip out of one of the ingame AIs like you did and just change all the Unit IDs to be what you need. Most of the stuff about when to attack an expansion versus when to go creeping, or whatever, is probably not going to be different for your use case. Although obviously you could customize it if you really needed to.
 
Level 4
Joined
Apr 14, 2021
Messages
56
Hey, really appreciate your response. Although I'm drastically late. The whole point of this thread is to basically learn everything needed (at least) for the hard jass scripting, as seen above in the files I attached. Your thorough explanation of messing with the WE AI Editor or ripping out already existing AIs and just editing them to my will is useful. But, I would love to learn how to create an AI of my own in that type of style and to understand what is written in the script, so I know what I should expect to happen from the AI's behavior when constructing it or while scrolling through an already existing one. Because I'm clueless as to what is going on in the hard side of an AI. Take the last mission of the Night Elf campaign in RoC, the AI of the Legion (rainbow.ai) is very complex. It has a lot of stuff while I scrolled through it, and understood nothing other than the building part of the code, and while viewing the map in WE, some Legion units are divided into it's own teams, which really got me wondering what the hell is going on and how was the AI set up in the triggers lol (since I didn't understand much there either). Besides, I'm sure an AI can have something to do with triggers as well, which makes it even harder to master.
 
Status
Not open for further replies.
Top