• 🏆 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!

[JASS] Meaning of these AI code lines?

Status
Not open for further replies.
Level 1
Joined
Jan 7, 2019
Messages
4
I'm poking around AI files from Blizzard's campaign and other authors in Hiveworkshop. There are some lines I could not understand, so I need some help :p


Code:
call SetCaptainHome(ATTACK_CAPTAIN,-2924,-3633)
call SetCaptainHome(DEFENSE_CAPTAIN,-2184,-3257)

and

Code:
 call GroupTimedLife(true)

What do these lines mean? Thanks in advance
 
Last edited:
Level 7
Joined
Oct 3, 2008
Messages
183
That's from the last Night Elf expansion campaign isn't it? As far as I understood it it means that the "home" and attack locations of the AI will be set to those positions.

Code:
One of the biggest problems with the AI is the very inflexible use of captain widgets.
Currently, captain widgets are a "middleman" in charge of orders given to the computer player.
The AI player moves, or teleports, the captain widget to a target location and the units assigned to the captain follow.
There are two captains: attack and defense, each with it's own problems.
The units assigned to the defense captain will stay still even when given an order to change location, until one of three cases:
  aggroed,
  player town under attack,
  another unit is added to the defense captain.

From Kam's new Natives list

---

Not really sure what the second one does.
 
Level 28
Joined
Feb 18, 2014
Messages
3,579
Code:
call GroupTimedLife(true)
Well it's actually quite useful to set GroupTimedLife during the setup of your AI script. It ensures that the AI always includes timed units, like summons and parasites and such in attack waves. If you don't set this the AI doesn't make proper use of those units. For example if you have an attack wave with Meat wagons and Necromancers. The Necromancers raise skeletons from the corpses in the Meat wagons. This happens when the attack party is in combat. However when those skeletons are raised too far from the combat area they do nothing. If you set GroupTimedLife they will be included in the attack party and will automatically move into the combat zone. The same goes for summons from other races.
 
Status
Not open for further replies.
Top