Snippets

Upload your latest creations here.
Please note that by posting comments to posts in this forum you forfeit your personal copyright on whatever you post. AI Scripters reserves the right to re-use objective comments in script reviews without requiring the posting author's permission. Credit, where appropriate will be given in such cases.
User avatar
FireBall37
Swami
Posts: 122
Joined: Sat Aug 22, 2020 10:49 pm
Location: United States

Snippets

Post 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(!)

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 34 times
Attachments
Snippets.zip
Added Ranged Group Micro
(18.04 KiB) Downloaded 10 times
Last edited by FireBall37 on Sun May 15, 2022 12:26 pm, edited 29 times in total.
those hackers are just idiots, i spit on them :lol: - Mabuse

User avatar
FireBall37
Swami
Posts: 122
Joined: Sat Aug 22, 2020 10:49 pm
Location: United States

Re: Snippets

Post by FireBall37 »

Hey everyone--added a snippet on deer luring! Let me know how it works :D
those hackers are just idiots, i spit on them :lol: - Mabuse

User avatar
MrElephant
Forumer
Posts: 35
Joined: Sun Dec 20, 2020 6:28 am

Re: Snippets

Post by MrElephant »

Wow, this is incredible Fireball. Will surely help everyone in their AI projects.

arandi
Forumer
Posts: 10
Joined: Sat Oct 02, 2021 5:56 pm

Re: Snippets

Post by arandi »

I made some changes so it fits my AI but overall, deer luring is great, thanks!
Attachments
deer.PNG
deer.PNG (529.33 KiB) Viewed 724 times

User avatar
FireBall37
Swami
Posts: 122
Joined: Sat Aug 22, 2020 10:49 pm
Location: United States

Re: Snippets

Post by FireBall37 »

Glad it helps you guys :)
those hackers are just idiots, i spit on them :lol: - Mabuse

User avatar
FireBall37
Swami
Posts: 122
Joined: Sat Aug 22, 2020 10:49 pm
Location: United States

Re: Snippets

Post by FireBall37 »

Added code for garrisoning the town center to shoot enemy units and changed the defconst format for the others.
those hackers are just idiots, i spit on them :lol: - Mabuse

User avatar
FireBall37
Swami
Posts: 122
Joined: Sat Aug 22, 2020 10:49 pm
Location: United States

Re: Snippets

Post by FireBall37 »

added snippet on first two houses
those hackers are just idiots, i spit on them :lol: - Mabuse

User avatar
FireBall37
Swami
Posts: 122
Joined: Sat Aug 22, 2020 10:49 pm
Location: United States

New Snippets

Post 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! :)
those hackers are just idiots, i spit on them :lol: - Mabuse

User avatar
FireBall37
Swami
Posts: 122
Joined: Sat Aug 22, 2020 10:49 pm
Location: United States

Group Micro Snippet

Post 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
those hackers are just idiots, i spit on them :lol: - Mabuse

User avatar
FireBall37
Swami
Posts: 122
Joined: Sat Aug 22, 2020 10:49 pm
Location: United States

Small update

Post 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.
those hackers are just idiots, i spit on them :lol: - Mabuse

Post Reply