wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 03-29-2010, 10:04 PM   #1
Panto
LASER DRAGONS IS RELEASED
 
Panto's Avatar


Development Moderator
User Project: Panto
 
Join Date: Mar 2003
Posts: 3,167

Submissions (2)

Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)

Approved Map: Call to Arms

Default Mommy, where does Artificial Intelligence come from?

"Well son, when a man and a computer love each other very much..."

So when a neutral player controls units, they obey certain hardcoded AI behaviors. For example, they remember their starting location, and if they go too far away or spend any time without orders, they return to their starting location.

I didn't think this was a behavior that computer-controlled player slots did (note, player slots, not neutral slots). However, in a map I have, if a computer-player unit is ordered via trigger into the center of the map, once he sits there for a second, he runs back to his starting location.

I solved this previously by saving the unit's starting location and checking to see if any orders it receives tell it to "smart" back there. Then I would tell it Ignore Guard Position and it would be fine for the rest of the game.

However, this is kind of a half-assed way of solving the problem and involves doing a lot of storing and checking that seems unnecessary and sloppy.

So the question is: What's making these computer-player units want to run home? It's not fresh-baked cookies, before you suggest that.
__________________
Pantokrator Maps forum.
LASER DRAGONS RELEASED!.
"One good test is worth a thousand expert opinions." Wernher von Braun
"The perfect is the enemy of the good." Voltaire
"When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." C.S. Lewis
Panto is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 03-29-2010, 10:31 PM   #2
Alevice
It feels good
 
Alevice's Avatar
 
Join Date: Mar 2006
Posts: 1,305

Alevice is a jewel in the rough (190)Alevice is a jewel in the rough (190)Alevice is a jewel in the rough (190)

Default

Gameplay constants iirc. Even if you control them via shared unit control, they still go back to the safety of their homes once they have complied with your orders.
__________________
_-|-_

Alevice.jones is SC2 Beta, losers.

Check out my never updated deviantart gallery!!

Kalimdor Raiders (Race Contest #1) Pastebin Page
Cavern Crawlers (Race Contest #2) Pastebin Page
Airship Race Motherfuckers!
Quote:
Originally Posted by http://ajaxian.com/archives/would-you-like-a-_-with-that-new-library-gives-js-what-it-should-have#comment-276203
- Dont solve problems that dont exist.
- Improve the wheel, dont reinvent it.
- Port the wheel if it doesnt exist in your environment.
- Integrate the wheel into your project.
- Make sure you can replace your wooden wheel for a rubber one if someone else invents it.
Alevice is offline   Reply With Quote
Old 03-29-2010, 10:47 PM   #3
Panto
LASER DRAGONS IS RELEASED
 
Panto's Avatar


Development Moderator
User Project: Panto
 
Join Date: Mar 2003
Posts: 3,167

Submissions (2)

Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)

Approved Map: Call to Arms

Default

Quote:
Originally Posted by Alevice
Gameplay constants iirc. Even if you control them via shared unit control, they still go back to the safety of their homes once they have complied with your orders.
What gameplay constant are you referring to?
__________________
Pantokrator Maps forum.
LASER DRAGONS RELEASED!.
"One good test is worth a thousand expert opinions." Wernher von Braun
"The perfect is the enemy of the good." Voltaire
"When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." C.S. Lewis
Panto is offline   Reply With Quote
Old 03-29-2010, 11:03 PM   #4
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)

Default

There is a function IgnorePlayerGuardPostions() (something like that). Just call that once for the player and you are golden.

edit: RemoveAllGuardPositions(Player)
__________________

Last edited by Ammorth : 03-29-2010 at 11:09 PM.
Ammorth is offline   Reply With Quote
Old 03-29-2010, 11:22 PM   #5
Panto
LASER DRAGONS IS RELEASED
 
Panto's Avatar


Development Moderator
User Project: Panto
 
Join Date: Mar 2003
Posts: 3,167

Submissions (2)

Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)

Approved Map: Call to Arms

Default

There's RemoveAllGuardPositions(player) but the description for the function says:

"This action tells the AI for the given player to neither use nor replace any of its preplaced units."

And it also doesn't seem to change anything when called during map init (or time elapsed zero). The units still go home.


There's also RecycleGuardPosition(unit) about which it says:

"This action requests that the AI recycle the guard position that once belonged to the specified unit."

Which sounds perfect! Except that if I call it on units as they are created, they stop in place and don't proceed to the waypoint.

Before you say "well order them individually to the waypoint then," that was my original system, but it's very useful to be able to take advantage of shift-click to set multiple waypoints, which won't work with that solution.


EDIT: Interesting to note, with RemoveAllGuardPositions(player), if a unit gets to where it's ordered to go, it stays there. But if it ever can't reach it (if, for example, there's already a unit standing on the exact spot of the rally point, it tries and then gives up and returns to its origin. Is this noteworthy?
__________________
Pantokrator Maps forum.
LASER DRAGONS RELEASED!.
"One good test is worth a thousand expert opinions." Wernher von Braun
"The perfect is the enemy of the good." Voltaire
"When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." C.S. Lewis

Last edited by Panto : 03-29-2010 at 11:27 PM.
Panto is offline   Reply With Quote
Old 03-30-2010, 05:31 AM   #6
DioD
obey
 
DioD's Avatar
 
Join Date: Feb 2006
Posts: 1,532

Submissions (4)

DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)DioD is a jewel in the rough (220)

Send a message via ICQ to DioD
Default

creep camp return time and return range constants.

natives doesnot work in way you want, they not really work at all.
DioD is offline   Reply With Quote
Old 03-30-2010, 01:00 PM   #7
Panto
LASER DRAGONS IS RELEASED
 
Panto's Avatar


Development Moderator
User Project: Panto
 
Join Date: Mar 2003
Posts: 3,167

Submissions (2)

Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)

Approved Map: Call to Arms

Default

Quote:
Originally Posted by DioD
creep camp return time and return range constants.

natives doesnot work in way you want, they not really work at all.
Unfortunately no, I've already set those quite high in the gameplay constants and they don't appear to influence the problem at all.
__________________
Pantokrator Maps forum.
LASER DRAGONS RELEASED!.
"One good test is worth a thousand expert opinions." Wernher von Braun
"The perfect is the enemy of the good." Voltaire
"When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." C.S. Lewis
Panto is offline   Reply With Quote
Old 03-30-2010, 01:05 PM   #8
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Remove the 'Unit can flee' from the units in OE and it should be solved.
Had same issues before in my TD.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 03-30-2010, 01:13 PM   #9
Kueken
User
 
Join Date: Mar 2009
Posts: 149

Kueken will become famous soon enough (41)Kueken will become famous soon enough (41)

Default

Quote:
Originally Posted by Anachron
Remove the 'Unit can flee' from the units in OE and it should be solved.
Had same issues before in my TD.
The unit can flee value only changes the behavior of a unit, if it is attacked by another unit which it cannot attack itself (eg by an invulnerable unit), nothing more.
Kueken is offline   Reply With Quote
Old 03-30-2010, 01:16 PM   #10
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

I thought that too, except that it does more.
It (somehow) also effect the units guarding (if I remember correctly).
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 03-30-2010, 01:59 PM   #11
Panto
LASER DRAGONS IS RELEASED
 
Panto's Avatar


Development Moderator
User Project: Panto
 
Join Date: Mar 2003
Posts: 3,167

Submissions (2)

Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)

Approved Map: Call to Arms

Default

Hm, this also did not affect the problem. Darn, I had such high hopes for it, too.
__________________
Pantokrator Maps forum.
LASER DRAGONS RELEASED!.
"One good test is worth a thousand expert opinions." Wernher von Braun
"The perfect is the enemy of the good." Voltaire
"When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." C.S. Lewis
Panto is offline   Reply With Quote
Old 03-30-2010, 02:06 PM   #12
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Can you tell us what exactly the units have?
How many sight range, abilities, etc?

Edit: What if you add "foray" with a range of 0 to them?
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]

Last edited by Anachron : 03-30-2010 at 02:06 PM.
Anachron is offline   Reply With Quote
Old 04-05-2010, 01:53 PM   #13
Panto
LASER DRAGONS IS RELEASED
 
Panto's Avatar


Development Moderator
User Project: Panto
 
Join Date: Mar 2003
Posts: 3,167

Submissions (2)

Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)

Approved Map: Call to Arms

Default

Foray?

They don't have any special sight range, nor abilities. However, they are created via the Tinker Factory spawn ability.
__________________
Pantokrator Maps forum.
LASER DRAGONS RELEASED!.
"One good test is worth a thousand expert opinions." Wernher von Braun
"The perfect is the enemy of the good." Voltaire
"When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." C.S. Lewis
Panto is offline   Reply With Quote
Old 04-05-2010, 02:55 PM   #14
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

I mean 'strife' ability.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 04-05-2010, 10:04 PM   #15
Panto
LASER DRAGONS IS RELEASED
 
Panto's Avatar


Development Moderator
User Project: Panto
 
Join Date: Mar 2003
Posts: 3,167

Submissions (2)

Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)Panto is a jewel in the rough (247)

Approved Map: Call to Arms

Default

Hm, you still lost me. What ability is that?
__________________
Pantokrator Maps forum.
LASER DRAGONS RELEASED!.
"One good test is worth a thousand expert opinions." Wernher von Braun
"The perfect is the enemy of the good." Voltaire
"When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." C.S. Lewis
Panto is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 09:22 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services