GEOM Help? - Making a unit find another unit

A forum for discussing map making ideas and problems for the Myth series.
Post Reply
Lothar
Posts: 130
Joined: Wed Aug 04, 2004 9:49 pm
Location: Texas
Contact:

Post by Lothar »

Hi all, it's me again with another question :embarassed:

At least you can know that my plugin will have some level of sophistication with all the questions I am asking!


Ok, anyway… Here is what I wanted to do with a GEOM, but can't figure out how:

3 Units - A Lord and 2 Royal Guards. The Lord and the guards attack, but when the Lord attacks twice, he uses his special attack (A force field) (got that part down). When the Lord is using his force field, I want the guards to stop attacking and move to wherever the Lord is standing, and get inside the force field with him to be protected. When the force field is finished, I want them to start attacking again. I can do everything in that except when I try to use a GEOM to find the location of the Lord, and then apply it to a move for the Guards, the guards just stand in place and flinch a lot. Clearly I'm not doing my GEOM correctly :(

Could someone explain for me how to do it?


Thanks!
A-Red
Posts: 771
Joined: Fri Jul 23, 2004 8:36 pm

Post by A-Red »

Try this:

Lord as Waypoint [empty container]

GEOM: Force Field Active?
Object Type:[insert tag code for the force field projectile]
Entire Map
Res. Act. Id.: [insert a blank action]
Tested Items Inside Field Name: null
Activates on Success: Make Lord a Waypoint

GEOM: Make Lord a Waypoint
Monsters: [insert lord]
Entire map
Res. Act. Id.: Lord as Waypoint
Tested Items Inside Location Field Name: wayp
Activates on Success: Move Guards to Lord

MOVE: Move Guards to Lord
Link: Guards/
Lord as Waypoint

I tried it out on Willow Creek with substitute units and projectile, and it worked. You will probably need to have another action to make the guards uncontrollable before they move.

A-Red
Lothar
Posts: 130
Joined: Wed Aug 04, 2004 9:49 pm
Location: Texas
Contact:

Post by Lothar »

A-Red wrote:Object Type:[insert tag code for the force field projectile]
This should be the tag header for the projectile, correct?
A-Red
Posts: 771
Joined: Fri Jul 23, 2004 8:36 pm

Post by A-Red »

Yes, the 4-letter one. Sorry I was unclear.

A-Red
lank
Posts: 766
Joined: Tue Mar 02, 2004 1:46 am
Location: Sydney, NSW, Australia
Contact:

Post by lank »

do the guards get only the one MOVE instruction, or is it possible that they keep getting told to move every time the script runs through and the GEOM finds the projectile?
*toot*
A-Red
Posts: 771
Joined: Fri Jul 23, 2004 8:36 pm

Post by A-Red »

If the GEOMs expire "never," then that would probably be the case. Make sure they expire "on successful execution."

A-Red
Lothar
Posts: 130
Joined: Wed Aug 04, 2004 9:49 pm
Location: Texas
Contact:

Post by Lothar »

ok, here is a related question: if the guards are getting attacked, they tend to just turn around in a circle, and then just keep attacking their attacker. I am guessing this is due to Myth and not scripting, and there isn't any scripting I could use to rememdy this?
A-Red
Posts: 771
Joined: Fri Jul 23, 2004 8:36 pm

Post by A-Red »

That's not surprising, and yes, I believe it is simply their natural reaction due to M2 programming and not due to scripting. The whole idea of having the guards return to the Lord at any time is tricky. Not only could they be in battle already, but there could also be enemy units between them and their master, in which case trying to get inside the forcefield would end up bringing them more harm than remaining in place and retaining their user-controllability. To make them behave intelligently, it is almost certainly going to require more than simply making them come when they're called.

One suggestion I have is that you only make them run to the lord's protection only if they are already fairly close to him. The best way to do this would be to add another GEOM that detects guards within a certain circular radius. The script would then look like this:

Lord as Waypoint [empty container]
Guards to Move [empty container]

GEOM: Force Field Active?
Object Type:[insert tag header for the force field projectile]
Entire Map
Res. Act. Id.: [insert a blank action]
Tested Items Inside Field Name: null
Activates on Success: Make Lord a Waypoint

GEOM: Make Lord a Waypoint
Monsters: [insert lord]
Entire map
Res. Act. Id.: Lord as Waypoint
Tested Items Inside Location Field Name: wayp
Activates on Success: Find Nearby Guards

GEOM: Find Nearby Guards
Link: Guards
Circle Centerpoint (monster): [insert Lord]
Circle Radius: [could be anything, but I would recommend 10 or so]
Res. Act. Id.: Guards to Move
Tested Items Inside Field Name: subj
Activates on Success: Move Guards to Lord



MOVE: Move Guards to Lord
Link: Guards to Move/
Lord as Waypoint

That will help, but it won't make them stop attacking if they've already started. It might help if you activated a General Action with command type 0 (stop) before moving them. In my experience, this isn't always reliable. Another, better way to do it might be to make another Guard monster tag that is set to "does not autotarget." When the force field is activated, the regular guards could be replaced with this non-targeting unit (using a MOMA), which would then run back to the Lord without stopping to fight. Once the force field was down, you would want to replace the non-targeting guard with a regular one. I realize that's a lot of extra work, but I don't see a better way to do it.

Hope this helps.

A-Red
Post Reply