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: 191
Joined: Sat Aug 22, 2020 10:49 pm

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, Integer Gathering System(by Marathon)

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 351 times
Attachments
Snippets 2.zip
(20.72 KiB) Downloaded 376 times
Last edited by FireBall37 on Tue Nov 12, 2024 2:45 pm, edited 33 times in total.

User avatar
FireBall37
Swami
Posts: 191
Joined: Sat Aug 22, 2020 10:49 pm

Re: Snippets

Post by FireBall37 »

Hey everyone--added a snippet on deer luring! Let me know how it works :D

User avatar
MrElephant
Swami
Posts: 122
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.
Author of Charon, Reactionary, Ahulane, and BlackKnight!

arandi
Forumer
Posts: 99
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 5025 times

User avatar
FireBall37
Swami
Posts: 191
Joined: Sat Aug 22, 2020 10:49 pm

Re: Snippets

Post by FireBall37 »

Glad it helps you guys :)

User avatar
FireBall37
Swami
Posts: 191
Joined: Sat Aug 22, 2020 10:49 pm

Re: Snippets

Post by FireBall37 »

Added code for garrisoning the town center to shoot enemy units and changed the defconst format for the others.

User avatar
FireBall37
Swami
Posts: 191
Joined: Sat Aug 22, 2020 10:49 pm

Re: Snippets

Post by FireBall37 »

added snippet on first two houses

User avatar
FireBall37
Swami
Posts: 191
Joined: Sat Aug 22, 2020 10:49 pm

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! :)

User avatar
FireBall37
Swami
Posts: 191
Joined: Sat Aug 22, 2020 10:49 pm

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

User avatar
FireBall37
Swami
Posts: 191
Joined: Sat Aug 22, 2020 10:49 pm

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.

Post Reply