Create a simple Ai

  • Thread starter Thread starter Nmare
  • Start date Start date
N

Nmare

Guest
Hi all.

I want to create a simple Ai for my map. Before asking i want to state that I'm fairly new to warcraft 3 editing; so sorry if this is a trivial question :)

I spawn creeps for 2 sides. Beside that I also spawn 2 heroes. The heroes helps the player by running around and killing the creeps, going home to heal and so on. This works perfectly. What I want to implent is some sort check if the hero is outnumbered i.e. if there are more of the opponents creeps than his. And if he is, then pull back and wait for some reinforcements.

I thought of something like:

1. Check a region where the hero is in center 20 units at each side.
2. See if there are more of opponent creeps than his.
3. Run back.

But i can't find out how to make .1

Any help and or suggestions would be really great
-NMare
 
Maybe sumthing like this?

Event: Time - Every (youfillthis) seconds
Conditions: (not required, if u wanna put some here do it...)
Actions:
Pick every unit in ur region
If: amount of [picked units] is higher than 20 (or sumthing)
Then: (command ur hero to go back for healing)
Else: do nothing

I don't have world editor available here right now so u gotta make sumthing of it urself, when im back ill look into it.
 
post

That solution could work - but im trying to make it so I wound't need some predefined regions. So the region to check would be a rectangle from:


Hero position -20x,-20y to hero position +20x,+20y.
 
That solution could work - but im trying to make it so I wound't need some predefined regions. So the region to check would be a rectangle from:


Hero position -20x,-20y to hero position +20x,+20y.
 
maybe you can periodically store your hero's position in a variable and create a region that uses the variable to determine its position?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)
  • The Helper The Helper:
    New Science News Forum and it starts out with 420 threads :)
  • The Helper The Helper:
    Technical Support forum name changed To Technology News, there is now a Tech, sci/tech and science forums now :)
  • The Helper The Helper:
    Happy Saturday! Hope everyone has a fantastic weekend!
  • Ghan Ghan:
    We are now on Ubuntu 24.04. Had some issues with the style after the OS/PHP upgrade but now resolved.
    +1
  • Ghan Ghan:
    PHP 8.3 now live
    +1
  • The Helper The Helper:
    Weekend went by too fast. Next weekend I am going to try to do a nature thing - buddy of mine lives by the Colorado river and has some kayaks and invited me to do some kayaking from a place he knows to get on the river.
  • Ghan Ghan:
    That sounds like an adventure.
  • The Helper The Helper:
    400 users all online all looking at latest content
  • The Helper The Helper:
    I wonder how all these bots that sit on the lastest content page get passed anubis or maybe they did not but they are just registering on whos online
  • The Helper The Helper:
    showing up on whos online not registration
  • Ghan Ghan:
    The first gate is stopping all the bots that don't execute javascript.
  • Ghan Ghan:
    That's the main thing with Anubis - no Javascript, no site. Typically you can still get the site to load without Javascript.
  • The Helper The Helper:
    I remember the whole javascript thing, question - how many real people disable that?
  • The Helper The Helper:
    Hell I guess I could go back on the stats to know that - we probably capture that and we know the before and after
  • Ghan Ghan:
    Real users can't really disable Javascript anymore these days.
  • Ghan Ghan:
    The internet is broken without it.
  • Ghan Ghan:
    Bot readable, not human usable.
  • The Helper The Helper:
    got it
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    Check out the new Featured Content feature we apparently got with the forum software upgrade! https://www.thehelper.net/featured/

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top