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

Few basic questions.

Status
Not open for further replies.
Level 9
Joined
Nov 19, 2011
Messages
516
Got another problem with AI. Wrong goldmine set as own.
attachment.php
AI starts getting gold from top one goldmine. Not from own. :/
 

Attachments

  • Untitled.png
    Untitled.png
    10.7 KB · Views: 123
Level 5
Joined
Feb 3, 2012
Messages
107
the picture is quite unclear. should they be at the bottom of the map?
if u have made custom starting units, ull have to change the starting location of the AI. it is likely that it was automatically generated there when u save the map, so the AI thinks that their home base should be there, hence they gather from there. u can replace a starting location at the bottom gold mine and maybe that would fix it.

and making a trigger to destroy a specific tree won't interfere with the AI, but the AI can interfere with the trigger by recalling the unit told to destroy the tree back to base.
hoped it helped
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
1) No, AI units attack enemy units, not trees, you should trigger that...

2) In the object editor, press CTRL+D then you can see it's value (4 digit), like hpea, hfoo, hkni etc...that's the unit type, if you create a custom unit, the h000,h001 will appear...
it will be declared in jass as integers, so instead of unittype, it can be is...
local integer peasant = 'hpea'
 
Level 9
Joined
Nov 19, 2011
Messages
516
@0neM4n4rmy

Its not custom race. Its not even replaced starting location. Just in one melee map AI can't see which goldmine is closer. This is Keys To Dula...sth. Orcs and humans just dies in creeps camp, undead and nightelf stays and not doing anything. :/ You can check it. If you will set all cpu players to undead, 3 or 4 of them will not gather gold. (You will see it on scoreboard.)
 

Attachments

  • (10)Keys KAZA v1.31.w3x
    577.3 KB · Views: 39
1st. Do you mean the AI editor ?

2nd.
JASS:
function example takes nothing returns nothing
     local unittype id = 'hpea'
endfunction
but note that at the end of the function, that local never exist unless you set a global to this local value.

this is wrong...

unittype in jass are things like UNIT_TYPE_HERO, UNIT_TYPE_DEAD etc, the 'hpea' is an integer...
 
Status
Not open for further replies.
Top