Page 1 of 2

Snippets

Posted: Sun Feb 20, 2022 11:45 am
by FireBall37
Hey everyone, this is a project I've been thinking about for a while.
A lot of work goes into making a script, a good portion of which is just generic code that every AI has in some form. Scripters often have to work a long time figuring out this stuff before going on to the stuff that makes a script fun and unique, and I want to reduce that if possible. I hope to upload some examples of generic scripts that do basic functions, with the goal of either saving scripters time to work on their own unique ideas or helping newer scripters learn how to use DUC and other important scripting skills.

Feel free to study/modify these examples and use them in your AI's, hope this saves someone some :head
If you have any requests for things to add or have a suggestion, let me know :D

Contents: Boar Hunting, Deer Luring, TC Garrisoning, Claiming Sheep, Food Forcedrop, First Houses, RANGED GROUP MICRO(!), Integer Gathering System

IMPORTANT NOTE: the trickiest part of using these is probably getting the defconsts at the beginning right. It is crucial that the ID's of the goals and timers in these examples aren't the same numbers as any other goals/timers in your script as this would most likely cause the code not to work. In the files you will have to adjust the defconsts before the code will work.

P.S. This list of constants needs to be somewhere in your script for these to work.
defaultConstants.zip
(7.32 KiB) Downloaded 220 times

Re: Snippets

Posted: Sun Feb 20, 2022 6:25 pm
by FireBall37
Hey everyone--added a snippet on deer luring! Let me know how it works :D

Re: Snippets

Posted: Thu Feb 24, 2022 6:27 pm
by MrElephant
Wow, this is incredible Fireball. Will surely help everyone in their AI projects.

Re: Snippets

Posted: Sun Feb 27, 2022 5:42 am
by arandi
I made some changes so it fits my AI but overall, deer luring is great, thanks!

Re: Snippets

Posted: Sun Feb 27, 2022 11:10 am
by FireBall37
Glad it helps you guys :)

Re: Snippets

Posted: Mon Feb 28, 2022 9:30 am
by FireBall37
Added code for garrisoning the town center to shoot enemy units and changed the defconst format for the others.

Re: Snippets

Posted: Sun Mar 06, 2022 7:14 pm
by FireBall37
added snippet on first two houses

New Snippets

Posted: Thu Apr 07, 2022 5:39 pm
by FireBall37
Hey guys, added some new stuff here. :dance
--Added precise control for deer luring
--Added some small stuff for the boar lure
--Added a failsafe if one of the first houses is obstructed
--Added a new snippet on force-dropping food from Arandi (thanks Arandi :))
--Added a new snippet on claiming sheep with the scout

Enjoy! :)

Group Micro Snippet

Posted: Fri May 13, 2022 9:57 pm
by FireBall37
Added a snippet on group micro for ranged units, currently supports either a full skirm army or full archer army. It has pretty decent micro, hopefully this will open some doors to those who've wanted to make this but didn't know how. I hope I've done a good job in summarizing and explaining what goes into group micro and that you can learn from and use this in your AIs. There are improvements to be made, but it's a start :D

Small update

Posted: Sun May 15, 2022 12:27 pm
by FireBall37
Reuploaded, with some small changes to the group micro script, including a fix for a pretty major issue in DE and more explanations and many more things to adjust with defconsts.