Loathing 1.5 and the ATTA Map Action - Scripting an attack on a 3D position?

A forum for discussing map making ideas and problems for the Myth series.
Post Reply
Walrus Momentum
Posts: 4
Joined: Mon Jan 31, 2005 12:06 am
Location: WA, USA

Post by Walrus Momentum »

Myth II 1.5 introduced a new ATTA parameter, "Attack 3D Location". I very badly want to use this feature, but I don't know how to use GEOM to get a 3D location (as the docs hinted at).

Naturally, I want to script a fetch to zap away incoming arrows (or other projectiles) by attacking their positions in the air. I'm currently only able to zap their 2D ground coordinates (this kinda works, but I suppose attacking the air would at least look cooler, if not be more effective). I can't for the life of me figure out how to coax a 'world_point3d' position from GEOM. As far as I can tell, it can only produce 'world_point2d'-type positions. I tried entering 'wp3d' in the "Tested Items Inside Location Field Name" paramter, but it didn't work.

What am I missing?
User avatar
iron
Site Admin
Posts: 2006
Joined: Thu Feb 26, 2004 1:21 am
Location: diving out of the Sun at 10 o'clock high!
Contact:

Post by iron »

Good question :) As far as I know, no-one (not even me) has used that feature yet. If I get a chance I'll look & see how exactly it works.
...playing as long5hot on War Thunder
Sam The Butcher
Posts: 118
Joined: Tue May 04, 2004 5:53 pm

Post by Sam The Butcher »

Hey Walrus, are you saying that you have scripted the fetch to know when arrows are being shot at it and when they are the fetch attacks the ground to deflect the arrows? If that is what you have. Could you tell me how you were able to do that? I have been trying to do a similiar thing but cant figure out how to get the script to check for that. I can get units to identify a projectile that is on the map at the start of the game, but not a new projectile that is shot or dropped during the game. Thanks
Image
Walrus Momentum
Posts: 4
Joined: Mon Jan 31, 2005 12:06 am
Location: WA, USA

Post by Walrus Momentum »

Sam:

Here's an example exported from Loathing. It perpetually filters for a 'maeb' projectile (Warlock fireball) within a 9.999 world unit radius about a fetch (the fetch's range), and stores the ground location (world_point2d) of any such in-range projectile in the container "Fireball Location" as a 'wayp' parameter. If no projectile passes the geometry test, then the container is made empty. When the geometry filter finds at least one fireball, it triggers the fetch to attack the ground at the location specified by the freshly-inserted 'wayp' parameter in the linked-to container, "Fireball Location".

I learned about this from Ares' scripting guide and from looking at similar scripting in the solo level Shiver (only there it was Shiver against satchel charges).

Code: Select all

Fireball Filter [Geometry Filter]
          initially_active
          deactivates_never
          0.00, 0.00
{
          Object Type
                    maeb
          Circle Centerpoint (Monster)
                    10000 (fetch)
          Circle Radius
                    9.999
          Results Action Identifier
                    <<<Fireball Location>>>
          Tested Items Inside Location Field Name
                    wayp
          Maximum Number of Items
                    1
          Minimum Number of Items        //probably not necessary
                    1
          Activates on Success
                    Zap Fireball Location
}

<<<Fireball Location>>>
{
}

Zap Fireball Location [Attack]
          deactivates_on_execution
          0.00, 0.00
{
          Attackers
                    10000 (fetch)
          Link
                    <<<Fireball Location>>>
          Don't Retarget Flag       //not really necessary
}
This can also work against archer arrows or theoretically any other projectile, but in my experience not as well. Fast moving projectiles are able to proceed well into the fetch's range before being detected, but maybe I'm doing something wrong there. It almost seems like the Geometry test is only run several times per second (ie, not frequently enough), or maybe it just has an inherent delay when returning successful.[/color]
User avatar
iron
Site Admin
Posts: 2006
Joined: Thu Feb 26, 2004 1:21 am
Location: diving out of the Sun at 10 o'clock high!
Contact:

Post by iron »

Heh, its a funny thing with Shiver's check for satchels - her attack doesn't actually destroy them. Get a few sats near her at the start of the Shiver level and you can hang the script indefinitely while she goes crazy trying to blast them :)

I'd suggest removing the Minimum # of Items check from the GEOM, and adding in the Choose Random Item, as that will stop it grabbing the same projectile each time it runs.
...playing as long5hot on War Thunder
User avatar
iron
Site Admin
Posts: 2006
Joined: Thu Feb 26, 2004 1:21 am
Location: diving out of the Sun at 10 o'clock high!
Contact:

Post by iron »

Ok, I've not had a chance to test, but this is how I think it should work for attacking a 3D location.

Basically your GEOM doesn't pass through the location of the projectile - instead it sends the projectile itself to the ATTA using "tested items inside field name" and "proj".

If you're scripting the ATTA directly to attack a given projectile, you'd make a link, edit it to be "proj" and "object_identifier", then click on the projectile.

That _should_ do the trick. If not please let me know :)

The "Attack 3D Location" and "wp3d" are plain wrong - very sorry about that.

Edit: One thing to bear in mind is that it'll shoot at the proj as if its not moving - it won't "lead the target". So if the arrow is moving quickly, the lightning may not score a direct hit. Still its tons better than firing at the ground.




Edited By iron on 1107901599
...playing as long5hot on War Thunder
Walrus Momentum
Posts: 4
Joined: Mon Jan 31, 2005 12:06 am
Location: WA, USA

Post by Walrus Momentum »

It works! Thank you very much!
Sam The Butcher
Posts: 118
Joined: Tue May 04, 2004 5:53 pm

Post by Sam The Butcher »

Thanks Walrus for showing me how to use the geometry test command. I was able to get it to work.
Image
Post Reply